max_stars_repo_path
stringlengths 4
237
| max_stars_repo_name
stringlengths 6
117
| max_stars_count
int64 0
95.2k
| id
stringlengths 1
7
| content
stringlengths 12
593k
| input_ids
sequencelengths 7
549k
|
---|---|---|---|---|---|
specialized-skills/artificial-intelligence/statistics-and-machine-learning/correlation-and-regression-quick-recap-3.py | tobal/hackerrank | 1 | 146286 | <filename>specialized-skills/artificial-intelligence/statistics-and-machine-learning/correlation-and-regression-quick-recap-3.py
x = [15 ,12, 8, 8, 7, 7, 7, 6, 5, 3]
y = [10 ,25, 17, 11, 13, 17, 20, 13, 9, 15]
n = len(x)
xy = [x[i] * y[i] for i in range(n)]
x_square = [x[i] * x[i] for i in range(n)]
avg_x = sum(x) / n
avg_y = sum(y) / n
avg_xy = sum(xy) / n
avg_xsqr = sum(x_square) / n
m = ((avg_x * avg_y) - avg_xy) / (avg_x ** 2 - avg_xsqr)
c = avg_y - (m * avg_x)
print(round((m * 10 + c), 2))
| [
1,
529,
9507,
29958,
18732,
1891,
29899,
808,
6090,
29914,
442,
928,
616,
29899,
524,
28286,
29914,
6112,
6765,
29899,
392,
29899,
23523,
29899,
21891,
29914,
2616,
23445,
29899,
392,
29899,
276,
11476,
29899,
24561,
29899,
3757,
481,
29899,
29941,
29889,
2272,
13,
29916,
353,
518,
29896,
29945,
1919,
29896,
29906,
29892,
29871,
29947,
29892,
29871,
29947,
29892,
29871,
29955,
29892,
29871,
29955,
29892,
29871,
29955,
29892,
29871,
29953,
29892,
29871,
29945,
29892,
29871,
29941,
29962,
13,
29891,
353,
518,
29896,
29900,
1919,
29906,
29945,
29892,
29871,
29896,
29955,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29941,
29892,
29871,
29896,
29955,
29892,
29871,
29906,
29900,
29892,
29871,
29896,
29941,
29892,
29871,
29929,
29892,
29871,
29896,
29945,
29962,
13,
29876,
353,
7431,
29898,
29916,
29897,
13,
3594,
353,
518,
29916,
29961,
29875,
29962,
334,
343,
29961,
29875,
29962,
363,
474,
297,
3464,
29898,
29876,
4638,
13,
29916,
29918,
17619,
353,
518,
29916,
29961,
29875,
29962,
334,
921,
29961,
29875,
29962,
363,
474,
297,
3464,
29898,
29876,
4638,
13,
485,
29887,
29918,
29916,
353,
2533,
29898,
29916,
29897,
847,
302,
13,
485,
29887,
29918,
29891,
353,
2533,
29898,
29891,
29897,
847,
302,
13,
485,
29887,
29918,
3594,
353,
2533,
29898,
3594,
29897,
847,
302,
13,
485,
29887,
29918,
29916,
3044,
29878,
353,
2533,
29898,
29916,
29918,
17619,
29897,
847,
302,
13,
29885,
353,
5135,
485,
29887,
29918,
29916,
334,
1029,
29887,
29918,
29891,
29897,
448,
1029,
29887,
29918,
3594,
29897,
847,
313,
485,
29887,
29918,
29916,
3579,
29871,
29906,
448,
1029,
29887,
29918,
29916,
3044,
29878,
29897,
13,
29883,
353,
1029,
29887,
29918,
29891,
448,
313,
29885,
334,
1029,
29887,
29918,
29916,
29897,
13,
2158,
29898,
14486,
3552,
29885,
334,
29871,
29896,
29900,
718,
274,
511,
29871,
29906,
876,
13,
2
] |
bookworm/library/views.py | srilatha44/threepress | 0 | 1614334 | from django.utils.translation import ugettext as _
from django.core.mail import EmailMessage
import logging, sys, urllib, urllib2, MySQLdb, os.path, unicodedata, traceback, urlparse
from cStringIO import StringIO
from zipfile import BadZipfile
from xml.sax.saxutils import escape as xml_escape
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.auth.forms import UserCreationForm
from django.contrib import auth
from django.template import RequestContext
from django.core.paginator import Paginator, EmptyPage
from django.views.generic.simple import direct_to_template
from django.conf import settings
from django.views.decorators.cache import cache_page, cache_control, never_cache
from django.views.decorators.vary import vary_on_headers, vary_on_cookie
from django_authopenid.views import signin
from bookworm.library.epub import InvalidEpubException
from bookworm.library.models import EpubArchive, HTMLFile, StylesheetFile, ImageFile, SystemInfo, get_file_by_item, order_fields, DRMEpubException, UserArchive
from bookworm.library.forms import EpubValidateForm, ProfileForm
from bookworm.library.epub import constants as epub_constants
from bookworm.library.google_books.search import Request
from bookworm.library.epub import epubcheck
log = logging.getLogger('library.views')
@never_cache
def index(request):
'''Public home page. This should be heavily cached (in fact eventually should be
served only by the web server.)'''
if request.user.is_authenticated():
return HttpResponseRedirect(reverse('library'))
# If this is a mobile user, skip the public page
if settings.MOBILE:
return signin(request)
return direct_to_template(request, "public.html", {})
@login_required
@never_cache
def library(request,
page_number=settings.DEFAULT_START_PAGE,
order=settings.DEFAULT_ORDER_FIELD,
dir=settings.DEFAULT_ORDER_DIRECTION):
'''Users's library listing. The page itself should not be cached although
individual items in the library should be cached at the model level.'''
if not dir in settings.VALID_ORDER_DIRECTIONS:
raise Exception("Direction %s was not in our list of known ordering directions" % dir)
if not order in settings.VALID_ORDER_FIELDS:
raise Exception("Field %s was not in our list of known ordering fields" % order)
if dir == 'desc':
order_computed = '-%s' % order
reverse_dir = 'asc'
else:
order_computed = order
reverse_dir = 'desc'
if page_number is None:
page_number = settings.DEFAULT_START_PAGE
user = request.user
form = EpubValidateForm()
paginator = Paginator(EpubArchive.objects.filter(user_archive__user=user).order_by(order_computed).distinct(), settings.DEFAULT_NUM_RESULTS)
try:
page = paginator.page(page_number)
except EmptyPage:
page_number = settings.DEFAULT_START_PAGE
# If we somehow got to an invalid page number, start over
return HttpResponseRedirect(reverse('library-paginate', args=[page_number]))
for d in page.object_list:
if d.orderable_author == '':
# Populate the author field if it was empty before
d.orderable_author = d.safe_author()
d.save()
sysinfo = SystemInfo()
return direct_to_template(request, 'index.html', {'documents':paginator,
'page':page,
'form':form,
'order':order,
'dir':dir,
'total_users':sysinfo.get_total_users(),
'total_books':sysinfo.get_total_books(),
'reverse_dir':reverse_dir,
'order_text': order_fields[order],
'order_direction': _('ascending') if dir == 'asc' else _('descending'),
'order_adverb': _('alphabetically') if order != 'created_time' else _('by date value'),
}
)
# We can't cache this at the page level because the user may be
# going to the last-read page rather than the document start
@never_cache
def view(request, title, key, first=False, resume=False):
'''If we view just a document, we want to either see our last chapter,
or see the first item in the <opf:spine>, as required by the epub specification.'''
log.debug("Looking up title %s, key %s" % (title, key))
document = _get_document(request, title, key)
# If we got 'None' from get_document with an anonymous user, then prompt them
# to login; this is probably just a bookmark with an unauthenticated user
if document is None and request.user.is_anonymous():
return HttpResponseRedirect(reverse('user_signin'))
if not request.user.is_anonymous():
uprofile = request.user.get_profile()
last_chapter_read = document.get_last_chapter_read(request.user)
else:
last_chapter_read = None
uprofile = None
if resume and last_chapter_read is not None:
chapter = last_chapter_read
elif not first and uprofile and uprofile.open_to_last_chapter and last_chapter_read:
chapter = last_chapter_read
else:
try:
toc = document.get_toc()
first_item = toc.first_item()
chapter = get_file_by_item(first_item, document)
except InvalidEpubException:
# We got some kind of catastrophic error while trying to
# parse this document
message = _('There was a problem reading the metadata for this document.')
return view_chapter(request, title, key, None, message=message)
if chapter is None:
log.error('Could not find an item with the id of %s' % first_item)
raise Http404
if first:
log.debug("Forcing first chapter")
# Force an HTTP redirect so we get a clean URL but go to the correct chapter ID
return HttpResponseRedirect(reverse('view_chapter', kwargs={'title':document.safe_title(), 'key': document.id, 'chapter_id':chapter.filename}))
return view_chapter(request, title, key, None, chapter=chapter, document=document)
# Not cacheable either because it may be a different user
@never_cache
def view_chapter(request, title, key, chapter_id, chapter=None, document=None, google_books=None, message=None):
if chapter is not None:
chapter_id = chapter.id
log.debug("Looking up title %s, key %s, chapter %s" % (title, key, chapter_id))
if not document:
document = _get_document(request, title, key)
if chapter is None:
# Legacy objects may have more than one duplicate representation
h = HTMLFile.objects.filter(archive=document, filename=chapter_id)
if h.count() == 0:
raise Http404
chapter = h[0]
next = _chapter_next_previous(document, chapter, 'next')
previous = _chapter_next_previous(document, chapter, 'previous')
parent_chapter = None
subchapter_href = None
toc = document.get_top_level_toc()
for t in toc:
href = chapter.filename.encode(epub_constants.ENC)
if href in [c.href() for c in t.find_descendants()]:
parent_chapter = t
subchapter_href = href
break
# Check whether this will render without throwing an exception
try:
chapter.render()
stylesheets = chapter.stylesheets.all()[0:settings.MAX_CSS_FILES]
# If we got 0 stylesheets, this may be a legacy book
if len(stylesheets) == 0:
stylesheets = StylesheetFile.objects.filter(archive=document)[0:settings.MAX_CSS_FILES]
except InvalidEpubException, e:
log.error(traceback.format_exc())
chapter = None
stylesheets = None
message = _('''
This book contained content that Bookworm couldn't read. You may need to check with the
publisher that this is a valid ePub book that contains either XHTML or DTBook-formatted
content.''')
return direct_to_template(request, 'view.html', {'chapter':chapter,
'document':document,
'next':next,
'message':message,
'toc':toc,
'subchapter_href':subchapter_href,
'parent_chapter':parent_chapter,
'stylesheets':stylesheets,
'google_books':google_books,
'previous':previous})
@cache_page(60 * 15)
@cache_control(private=True)
def view_chapter_image(request, title, key, image):
log.debug("Image request: looking up title %s, key %s, image %s" % (title, key, image))
document = _get_document(request, title, key)
try:
image_obj = ImageFile.objects.filter(archive=document, filename=image)[0]
except IndexError:
image = os.path.basename(image)
try:
image_obj = ImageFile.objects.filter(archive=document, filename=image)[0]
except IndexError:
raise Http404
response = HttpResponse(content_type=str(image_obj.content_type))
if image_obj.content_type == 'image/svg+xml':
response.content = image_obj.file
else:
try:
response.content = image_obj.get_data()
except AttributeError: # Zero-length image
raise Http404
return response
@cache_page(60 * 15)
@cache_control(public=True)
def view_stylesheet(request, title, key, stylesheet_id):
document = _get_document(request, title, key)
log.debug('getting stylesheet %s' % stylesheet_id)
stylesheets = StylesheetFile.objects.filter(archive=document,filename=stylesheet_id)
if len(stylesheets) == 0:
raise Http404
stylesheet = stylesheets[0]
response = HttpResponse(content=stylesheet.file, content_type='text/css')
return response
@cache_control(private=True)
def download_epub(request, title, key, nonce=None):
document = _get_document(request, title, key, nonce=nonce)
return _return_epub(document)
def _return_epub(document):
'''Return the epub archive content. If it's accidentally been deleted
off the storage mechanism (usually this happens in developmif document is None:
raise Http404
if document.get_content() is None: # This occurs if the file has been deleted unexpected from the filesystem
raise Http404 elopment), return
a 404 instead o.read of a zero-byte download.'''
content = document.get_content()
if content is None:
raise Http404
response = HttpResposafe_name = unicodedata.normalize('NFKC', document.name).encode('ASCII', 'backslashreplace').replace(' ', '_')
response['Content-Disposition'] = 'attachment; filename=%s' % safe_['Content-Disposition'] = 'at
def view_document_metadata(request, title, key):
log.debug("Looking up metadata %s, key %s" % (title, key))
document = _get_document(request, title, key)
if not document:
raise Http404
google_books = _get_google_books_info(document, request)
form = EpubValidateForm()
return direct_to_template(request, 'view.html', {'document':document, 'form': form, 'google_books':google_books})
@login_required
def delete(request):
'''Delete a book and associated metadata, and decrement our total books counter'''
if 'key' in request.POST and 'title' in request.POST:
title = request.POST['title']
key = request.POST['key']
log.debug("Deleting title %s, key %s" % (title, key))
if request.user.is_superuser:
document = _get_document(request, title, key, override_owner=True)
else:
document = _get_document(request, title, key)
# They should be the owner of this book to delete it
if document is not None and document.is_owner(request.user):
_delete_document(request, document)
else:
raise Http404
return HttpResponseRedirect(reverse('library'))
def register(request):
'''Register a new user on Bookworm'''
form = UserCreationForm()
if request.method == 'POST':
data = request.POST.copy()
errors = form.get_validation_errors(data)
if not errors:
new_user = form.save(data)
user = auth.authenticate(username=new_user.username, password=request.POST['<PASSWORD>'])
if user is not None and user.is_active:
auth.login(request, user)
return HttpResponseRedirect(reverse('library.views.index'))
return direct_to_template(request, "auth/register.html", { 'form' : form })
@login_required
@never_cache
def profile(request):
uprofile = RequestContext(request).get('profile')
if request.openid:
sreg = request.openid.sreg
# If we have the email from OpenID and not in their profile, pre-populate it
if not request.user.email and sreg.has_key('email'):
request.user.email = sreg['email']
if sreg.has_key('fullname'):
uprofile.fullname = sreg['fullname']
if sreg.has_key('nickname'):
uprofile.nickname = sreg['nickname']
# These should only be updated if they haven't already been changed
if uprofile.timezone is None and sreg.has_key('timezone'):
uprofile.timezone = sreg['timezone']
if uprofile.language is None and sreg.has_key('language'):
uprofile.language = sreg['language']
if uprofile.country is None and sreg.has_key('country'):
uprofile.country = sreg['country']
uprofile.save()
if settings.LANGUAGE_COOKIE_NAME in request.session:
log.debug("Updating language to %s" % request.session.get(settings.LANGUAGE_COOKIE_NAME))
uprofile.language = request.session.get(settings.LANGUAGE_COOKIE_NAME)
uprofile.save()
if request.method == 'POST':
form = ProfileForm(request.POST, instance=uprofile)
if form.is_valid():
form.save()
message = _("Your profile has been updated.")
else:
form = ProfileForm(instance=uprofile)
message = None
if 'msg' in request.GET:
message = request.GET['msg']
return direct_to_template(request,
'auth/profile.html',
{'form':form, 'prefs':uprofile, 'message':message})
@login_required
def profile_delete(request):
if not request.POST.has_key('delete'):
# Extra sanity-check that this is a POST request
log.error('Received deletion request but was not POST')
message = _("There was a problem with your request to delete this profile.")
return direct_to_template(request, 'profile.html', { 'message':message})
if not request.POST['delete'] == request.user.email:
# And that we're POSTing from our own form (this is a sanity check,
# not a security feature. The current logged-in user profile is always
# the one to be deleted, regardless of the value of 'delete')
log.error('Received deletion request but nickname did not match: received %s but current user is %s' % (request.POST['delete'], request.user.nickname()))
message = _("There was a problem with your request to delete this profile.")
return direct_to_template(request, 'profile.html', { 'message':message})
request.user.get_profile().delete()
# Delete all their books (this is likely to time out for large numbers of books)
documents = EpubArchive.objects.filter(user_archive__user=request.user)
for d in documents:
_delete_document(request, d)
return HttpResponseRedirect('/') # fixme: actually log them out here
tachment; filename=%sprofile_toggle_reading_mode(request):
'''Toggle whether to use the simple reading more or the default mode.'''
if request.method == 'POST':
profile = request.user.get_profile()
profile.simple_reading_mode = not(profile.simple_reading_mode)
log.debug('setting reading mode to %s' % profile.simple_reading_mode)
profile.save()
url = request.META.get('HTTP_REFERER')
if url is None:
url = '/library/'
return HttpResponseRedirect(url)
@login_required
def profile_change_font_size(request, size):
'''Change the font size associated with the user's account'''
if request.method == 'POST':
profile = request.user.get_profile()
profile.font_size = size;
log.debug('setting font size to %s' % profile.font_size)
profile.save()
return HttpResponse('1')
@login_required
def profile_change_font_family(request, font):
'''Change the font family associated with the user's account'''
if request.method == 'POST':
profile = request.user.get_profile()
profile.font_family = font;
log.debug('setting font family to %s' % profile.font_family)
profile.save()
return HttpResponse('1')
tachment; filename=%s' % document.n, title=None, key=None):
'''Uploads a new document and stores it in the database. If 'title' and 'key'
are provided then this is a reload of an existing document, which should retain
the same ID. The user must be an existing owner to reload a book.'''
document = None
ment and stores it in the database'''
document = None
if request.method == 'POST'':
form = EpubValidat # The temporary file assigned by Django
temp_file = request.FILES['epub'].temporary_file_path(in request.FILES['epub'].chunks():
data.write(c)
if not key:
log.debug("Creating new document: '%s'" % document_name)
document = EpubArchive(name=document_name)
document.save()
else:
log.debug("Reloading existing document: '%s'" % document_name)
try:
document = EpubArchive.objects.get(id__exact=key)
log.debug(document.title)
log.debug(request.user)
# Is thie an owner of the document?
if UserArchive.objects.filter(user=request.user,
owner=True,
archive=document).count() == 0:
raise Http404
# Save off some metadata about it
is_public = document.is_public
# Delete the old one
document.delete()
# Create a new one with the possibly-new name
document = EpubArchive(name=document_name,id=key)
document.is_public = is_public
document.save()
successful_redirect = reverse('view_first', kwargs={'key':key,
urn direct_to_template(request, 'upload.html', {'form':form,
'title':title,
urn direct_to_template(request, 'upload.html', {'form':form,
})
except EpubArchive.DoesNotExist:
log.error("Key %s did not exist; creating new document" % (key))
document = EpubArchive(name=document_name)
document.save()
documenreturn add_data_to_document(request, document, open(temp_file, 'rb+'), form)
# The form isn't valid (generally because we didn't actually upload anything)
se from epubcheck, ignoring: %s' % d)
_template(request, 'upload.html', {
'form':form})
else:
form = EpubValidateForm()
return add_data_to_document(request, document, data, form, redirect_success_to_page=True):
'''Add epub data (as a file-like object) to a document, then explode it.
If this returns True, return a successful redirect; otherwise return an error template.
If the redirect_to_page parameter is True (default), the code will redirect
'''
successful_redirect = reverse('library')
document.set_content(data)
try:
document.explode()
document.user_archive.create(archive=document,
owner=True,
user=request.user)
document.save()
except BadZipfile, e:
# The user tried to upload something that wasn't a zip
# file. This error isn't interesting; don't send email
m _( log.error(sys.exc_value)
message = 'The file you uploaded was not recogni)zed as anreturn _report_error(request, document, data, m, form, e, email=False)
except MySQLdb.OperationalError, e:
# This occurs normally when a single large transaction
# is passed to MySQL. If you get many of these,
# increase the value of the MySQL config value
# max_allowed_packet (> 16M recommended).
m = _(uebug("Got operational error %s" % e)
message = "We detected a problem with your ebook that is most likely related to it being too big to display safely in a web browser. This can happen with very large images, or with extremely long chapters. Please check with the publisher that the book has been formatted correctly. Very large pages would require a lot of scrolling and load) first soreturn _report_error(request, document, data, m, form, e, email=True)
except DRMEpubException, e:
# DRM is evil
m = _(u)
document.delete()
message = "It appears that you've uploaded a book which contains DRM (Digital Rights Management). This is a restriction that is meant to prevent illegal copying but also prevents legitimate owners from reading their ebooks wherever they like. You will probably need to use Adobe Digital Editions to read this ebook, but consider contacting the publisnot be addreturn _report_error(request, document, data, m, form, e, email=False)
except Exception, e:
# We got some unknown error (usually a malformed epub). We
# want to know about these since they are sometimes actually Bookworm bugs.
if settings.SKIP_EPUBCHECK:
se from epubcheck, ignoring: %s' % d)
return direct_to_template(request, 'upload.html', {'form':for 'message':str(e)})
_email_errors_to_admin(e, data, document)
traceback.format_exc()
log.error(tb)
# Delete it first sodocument.delete()
log.error(f)
document.delete()
# Let's see what's wrong with this by asking epvalid_resp = epubcheck.validate(data)
error = _exception_message(e)
if len(error) > 200:
error = error[0:200] + u'...'
message = []
message.append(_(u <p class='bw-upload-message'> error = error[0:200] + '...'
message = "The file you uploaded looks like an ePub archive, but it has some problems that prevented it from being loaded. This may be a bug in Bookworm, or it may be a problem with th</p>"))
message.append(_(u"<p class='bw-upload-errors'>%s</p>" % xml_escape(error)))
log.error(f)
document.delete()
# Let's see what's wrong with this by asking epvalid_resp = epubcheck.validate(data)
if valid_resp is None:
# We got nothing useful from the validator (oops)
pass
elif len(valid_resp) == 0:
message.append(_(u"<p>(epubcheck thinks this file is valid, so this may be a Bookworm error)</p>"))
else:
e = '\n'.join([i.text for i in valid_resp])
errors = ['<li>%s</li>' % i.replace('\n', '<br/>') for i in e.split('ERROR:') if i]
message.append(_(u"<p class='bw-upload-message'>'.join(epub_error_list)
message += "<p><a href='http://code.google.com/p/epubcheck/'>epubcheck</a> agrees that this is not a valid ePub file, so you <strong id='bw-num-errors'>%d</strong> error(s):</p>" % len(errors)))
message.append(u" <ol id='bw-upload-error-list'>%s</ol>" % ''.join(errors))
se from epubcheck, ignoring: %s' % d)
return direct_to_template(request, 'upload.html', {'form':for'message':u''.join(message)})
if redirect_success_to_page:
return HttpResponseRedirect(successful_redirect)
return document
@login_required
@never_cache
def add_by_url(request):
'''Accepts a GET request with parameter 'epub' which should be valid ePub URL. This will be added
to the current logged-in user's library'''
if not 'epub' in request.GET:
raise Http404
epub_url = request.GET['epub']
return add_by_url_field(request, epub_url, redirect_success_to_page=True)
def add_by_url_field(request, epub_url, redirect_success_to_page):
form = EpubValidateForm()
try:
data = urllib2.urlopen(epub_url).read()
data = StringIO(data)
except urllib2.URLError:
message = _("The address you provided does not point to an ePub book")
se from epubcheck, ignoring: %s' % d)
return direct_to_template(request, 'upload.html', {'form':for'message':message})
document = EpubArchive.objects.create(name=os.path.basename(urlparse.urlparse(epub_url).path))
document.save()
return add_data_to_document(request, document, data, form, redirect_success_to_page)
eturn dchapter_next_previous(document, chapter, dir='next'):
'''Returns the next or previous data object from the OPF'''
toc = document.get_toc()
item = toc.find_item_by_id(chapter.idref)
if dir == 'next':
target_item = toc.find_next_item(item)
else:
target_item = toc.find_previous_item(item)
if target_item is None:
return None
object = get_file_by_item(target_item, document)
return object
urn direct_to_template(request, 'upload.html', {'form':forl book
epubindex
toc = HTMLFile.objects.filter(archive=document)
if toc:
for t in toc:
filter(archive=document)
if toc:
for t in toc:
t.delete()
# Delete all the stylesheets in the book
css = StylesheetFile.objects.filter(archive=document)
if css:
for c in css:
c.delete()
# Delete all the images in the book
images = ImageFile.objects.filter(archive=document)
if images:
for i in images:
i.delete()
# Delete the book itself
document.delete()
def _get_document(request, title, key, override_owner=False, nonce=None):
'''Return a document by id and owner. Setting override_owner
will search regardless of ownership, for use with admin accounts.'''
user = requeest.user
:
if document.is_nonce_valid(nonce):
return document
else:
log.error("Got an expired or invalid nonce: '%s', nonce='%s'" % (title, nonce))
raise Http404nce an# Anonymous users can never access non-public books
if not document.is_public and user.is_anonymous():
log.error('Anonymous user tried to access non-public document %s' % (document.title))
return None
if not document.is_public and not override_owner and not document.is_owner(user) andis_public and not override_owner and document.owner != user and not user.is_superuser:
log.error('User %s tried to access document %s, which they do not own' % (user, title))
raise Http404
return document
def _get_google_books_info(document, request):
# Find all the words in the title and all the names in the author by splitting on
# spaces and commas
title_words = document.title.replace(',', '').split(' ')
author_words = document.author.replace(',', '').split(' ')
for t in title_words:
query = 'intitle:%s+' % urllib.quote(t.encode('utf8'))
for a in author_words:
query += 'inauthor:%s+' % urllib.quote(a.encode('utf8'))
if 'REMOTE_ADDR' in request.META:
remote_addr = request.META['REMOTE_ADDR']
else:
remdef _report_error(request, document, data, user_message, form, exception, email=False):
'''Report an error with an uploaded book to the user.
Required:
- The request object
- The document object created (will be deleted)
- The data uploaded by the user
- A message to the user
- The form
- The exception raised
Setting 'email' to True will send a message to the value defined
in settings.ERROR_EMAIL_RECIPIENTS (by default this is the first
admin in settings.ADMINS).
'''
log.error(exception)
document.delete()
if email:
# Email it to the admins
_email_errors_to_admin(exception, data, document)
return direct_to_template(request, 'upload.html', { 'form':form, 'message':user_message})
def _email_errors_to_admin(exception, data, document):
'''Send am email to the users registered to receive these messages (the value of
settings.ERROR_EMAIL_RECIPIENTS (by default this is the first admin in settings.ADMINS).
'''
# Email it to the admins
message = _exception_message(exception)
email = EmailMessage(u'[bookworm-error] %s (book=%s)' % (message, document.name),
settings.REPLYTO_EMAIL,
settings.ERROR_EMAIL_RECIPIENTS)
email.attach(document.name, data, epub_constants.MIMETYPE)
def _exception_message(exception):
'''Return unicode string from exception.'''
try:
return exception.__unicode__() # Python 2.6
except AttributeError:
return unicode(exception.message) # Python 2.5
| [
1,
515,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
408,
903,
13,
13,
3166,
9557,
29889,
3221,
29889,
2549,
1053,
22608,
3728,
13,
13,
5215,
12183,
29892,
10876,
29892,
3142,
1982,
29892,
3142,
1982,
29906,
29892,
9254,
2585,
29892,
2897,
29889,
2084,
29892,
443,
293,
6797,
532,
29892,
9637,
1627,
29892,
3142,
5510,
13,
3166,
274,
1231,
5971,
1053,
1714,
5971,
13,
3166,
14319,
1445,
1053,
9178,
26264,
1445,
13,
3166,
4903,
29889,
29879,
1165,
29889,
29879,
1165,
13239,
1053,
10169,
408,
4903,
29918,
21587,
13,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
19557,
4097,
1053,
6464,
29918,
12403,
13,
3166,
9557,
29889,
1124,
1053,
9056,
5103,
24735,
29892,
9056,
29946,
29900,
29946,
29892,
9056,
5103,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
13,
3166,
9557,
29889,
3221,
29889,
2271,
9778,
874,
1053,
11837,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9514,
1053,
4911,
9832,
362,
2500,
13,
3166,
9557,
29889,
21570,
1053,
4817,
13,
3166,
9557,
29889,
6886,
1053,
10729,
2677,
13,
3166,
9557,
29889,
3221,
29889,
13573,
262,
1061,
1053,
349,
26584,
1061,
29892,
2812,
2349,
5074,
13,
3166,
9557,
29889,
7406,
29889,
19206,
29889,
12857,
1053,
1513,
29918,
517,
29918,
6886,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
7406,
29889,
19557,
4097,
29889,
8173,
1053,
7090,
29918,
3488,
29892,
7090,
29918,
6451,
29892,
2360,
29918,
8173,
13,
3166,
9557,
29889,
7406,
29889,
19557,
4097,
29889,
29894,
653,
1053,
13100,
29918,
265,
29918,
13662,
29892,
13100,
29918,
265,
29918,
21509,
13,
13,
3166,
9557,
29918,
5150,
3150,
333,
29889,
7406,
1053,
1804,
262,
13,
13,
3166,
3143,
29893,
555,
29889,
5258,
29889,
1022,
431,
1053,
21403,
29923,
5467,
2451,
13,
3166,
3143,
29893,
555,
29889,
5258,
29889,
9794,
1053,
382,
5467,
13197,
573,
29892,
4544,
2283,
29892,
624,
5577,
4155,
2283,
29892,
7084,
2283,
29892,
2184,
3401,
29892,
679,
29918,
1445,
29918,
1609,
29918,
667,
29892,
1797,
29918,
9621,
29892,
26900,
2303,
5467,
2451,
29892,
4911,
13197,
573,
13,
3166,
3143,
29893,
555,
29889,
5258,
29889,
9514,
1053,
382,
5467,
7211,
403,
2500,
29892,
20802,
2500,
13,
3166,
3143,
29893,
555,
29889,
5258,
29889,
1022,
431,
1053,
17727,
408,
321,
5467,
29918,
3075,
1934,
13,
3166,
3143,
29893,
555,
29889,
5258,
29889,
3608,
29918,
12733,
29889,
4478,
1053,
10729,
13,
3166,
3143,
29893,
555,
29889,
5258,
29889,
1022,
431,
1053,
321,
5467,
3198,
13,
13,
1188,
353,
12183,
29889,
657,
16363,
877,
5258,
29889,
7406,
1495,
13,
13,
29992,
484,
369,
29918,
8173,
13,
1753,
2380,
29898,
3827,
1125,
13,
1678,
14550,
19858,
3271,
1813,
29889,
29871,
910,
881,
367,
20365,
22152,
313,
262,
2114,
10201,
881,
367,
13,
1678,
6766,
871,
491,
278,
1856,
1923,
1846,
12008,
13,
1678,
565,
2009,
29889,
1792,
29889,
275,
29918,
27218,
630,
7295,
13,
4706,
736,
9056,
5103,
24735,
29898,
24244,
877,
5258,
8785,
13,
1678,
396,
960,
445,
338,
263,
10426,
1404,
29892,
14383,
278,
970,
1813,
13,
1678,
565,
6055,
29889,
6720,
12809,
1307,
29901,
13,
4706,
736,
1804,
262,
29898,
3827,
29897,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
376,
3597,
29889,
1420,
613,
426,
1800,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
29992,
484,
369,
29918,
8173,
13,
1753,
3489,
29898,
3827,
29892,
13,
3986,
1813,
29918,
4537,
29922,
11027,
29889,
23397,
29918,
25826,
29918,
7228,
1692,
29892,
29871,
13,
3986,
1797,
29922,
11027,
29889,
23397,
29918,
22364,
29918,
3738,
27286,
29892,
13,
3986,
4516,
29922,
11027,
29889,
23397,
29918,
22364,
29918,
4571,
1525,
9838,
1125,
13,
1678,
14550,
5959,
29915,
29879,
3489,
18028,
29889,
29871,
450,
1813,
3528,
881,
451,
367,
22152,
5998,
29871,
13,
1678,
5375,
4452,
297,
278,
3489,
881,
367,
22152,
472,
278,
1904,
3233,
29889,
12008,
13,
1678,
565,
451,
4516,
297,
6055,
29889,
26707,
29918,
22364,
29918,
4571,
1525,
9838,
29903,
29901,
13,
4706,
12020,
8960,
703,
21602,
1273,
29879,
471,
451,
297,
1749,
1051,
310,
2998,
20520,
18112,
29908,
1273,
4516,
29897,
13,
1678,
565,
451,
1797,
297,
6055,
29889,
26707,
29918,
22364,
29918,
3738,
6670,
8452,
29901,
13,
4706,
12020,
8960,
703,
3073,
1273,
29879,
471,
451,
297,
1749,
1051,
310,
2998,
20520,
4235,
29908,
1273,
1797,
29897,
13,
1678,
565,
4516,
1275,
525,
14273,
2396,
13,
4706,
1797,
29918,
12097,
287,
353,
17411,
29995,
29879,
29915,
1273,
1797,
13,
4706,
11837,
29918,
3972,
353,
525,
6151,
29915,
13,
1678,
1683,
29901,
13,
4706,
1797,
29918,
12097,
287,
353,
1797,
13,
4706,
11837,
29918,
3972,
353,
525,
14273,
29915,
13,
259,
13,
1678,
565,
1813,
29918,
4537,
338,
6213,
29901,
13,
4706,
1813,
29918,
4537,
353,
6055,
29889,
23397,
29918,
25826,
29918,
7228,
1692,
13,
1678,
1404,
353,
2009,
29889,
1792,
13,
1678,
883,
353,
382,
5467,
7211,
403,
2500,
580,
13,
1678,
10203,
262,
1061,
353,
349,
26584,
1061,
29898,
29923,
5467,
13197,
573,
29889,
12650,
29889,
4572,
29898,
1792,
29918,
10867,
1649,
1792,
29922,
1792,
467,
2098,
29918,
1609,
29898,
2098,
29918,
12097,
287,
467,
5721,
5562,
3285,
6055,
29889,
23397,
29918,
13967,
29918,
15989,
8647,
29903,
29897,
13,
1678,
1018,
29901,
13,
4706,
1813,
353,
10203,
262,
1061,
29889,
3488,
29898,
3488,
29918,
4537,
29897,
13,
1678,
5174,
2812,
2349,
5074,
29901,
13,
4706,
1813,
29918,
4537,
353,
6055,
29889,
23397,
29918,
25826,
29918,
7228,
1692,
13,
4706,
396,
960,
591,
10431,
2355,
304,
385,
8340,
1813,
1353,
29892,
1369,
975,
13,
4706,
736,
9056,
5103,
24735,
29898,
24244,
877,
5258,
29899,
13573,
16976,
742,
6389,
11759,
3488,
29918,
4537,
12622,
13,
13,
1678,
363,
270,
297,
1813,
29889,
3318,
29918,
1761,
29901,
13,
4706,
565,
270,
29889,
2098,
519,
29918,
8921,
1275,
525,
2396,
13,
9651,
396,
6977,
5987,
278,
4148,
1746,
565,
372,
471,
4069,
1434,
13,
9651,
270,
29889,
2098,
519,
29918,
8921,
353,
270,
29889,
11177,
29918,
8921,
580,
13,
9651,
270,
29889,
7620,
580,
13,
13,
1678,
10876,
3888,
353,
2184,
3401,
580,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
2248,
29889,
1420,
742,
11117,
3225,
29879,
2396,
13573,
262,
1061,
29892,
29871,
13,
462,
462,
632,
525,
3488,
2396,
3488,
29892,
13,
462,
462,
632,
525,
689,
2396,
689,
29892,
13,
462,
462,
632,
525,
2098,
2396,
2098,
29892,
13,
462,
462,
632,
525,
3972,
2396,
3972,
29892,
13,
462,
462,
632,
525,
7827,
29918,
7193,
2396,
9675,
3888,
29889,
657,
29918,
7827,
29918,
7193,
3285,
13,
462,
462,
632,
525,
7827,
29918,
12733,
2396,
9675,
3888,
29889,
657,
29918,
7827,
29918,
12733,
3285,
13,
462,
462,
632,
525,
24244,
29918,
3972,
2396,
24244,
29918,
3972,
29892,
13,
462,
462,
632,
525,
2098,
29918,
726,
2396,
1797,
29918,
9621,
29961,
2098,
1402,
13,
462,
462,
632,
525,
2098,
29918,
20845,
2396,
903,
877,
6151,
2548,
1495,
565,
4516,
1275,
525,
6151,
29915,
1683,
903,
877,
14273,
2548,
5477,
13,
462,
462,
632,
525,
2098,
29918,
328,
18248,
2396,
903,
877,
284,
17416,
1711,
1495,
565,
1797,
2804,
525,
11600,
29918,
2230,
29915,
1683,
903,
877,
1609,
2635,
995,
5477,
13,
462,
462,
632,
500,
13,
462,
795,
1723,
13,
13,
29937,
1334,
508,
29915,
29873,
7090,
445,
472,
278,
1813,
3233,
1363,
278,
1404,
1122,
367,
13,
29937,
2675,
304,
278,
1833,
29899,
949,
1813,
3265,
1135,
278,
1842,
1369,
13,
29992,
484,
369,
29918,
8173,
13,
1753,
1776,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
937,
29922,
8824,
29892,
620,
2017,
29922,
8824,
1125,
13,
1678,
14550,
3644,
591,
1776,
925,
263,
1842,
29892,
591,
864,
304,
2845,
1074,
1749,
1833,
16385,
29892,
13,
1678,
470,
1074,
278,
937,
2944,
297,
278,
529,
15818,
29901,
1028,
457,
10202,
408,
3734,
491,
278,
321,
5467,
21992,
29889,
12008,
13,
13,
1678,
1480,
29889,
8382,
703,
14959,
292,
701,
3611,
1273,
29879,
29892,
1820,
1273,
29879,
29908,
1273,
313,
3257,
29892,
1820,
876,
13,
13,
1678,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29897,
13,
13,
1678,
396,
960,
591,
2355,
525,
8516,
29915,
515,
679,
29918,
3225,
411,
385,
21560,
1404,
29892,
769,
9508,
963,
13,
1678,
396,
304,
6464,
29936,
445,
338,
3117,
925,
263,
3143,
3502,
411,
385,
1185,
2806,
4173,
630,
1404,
13,
1678,
565,
1842,
338,
6213,
322,
2009,
29889,
1792,
29889,
275,
29918,
25772,
7295,
13,
4706,
736,
9056,
5103,
24735,
29898,
24244,
877,
1792,
29918,
4530,
262,
8785,
13,
13,
1678,
565,
451,
2009,
29889,
1792,
29889,
275,
29918,
25772,
7295,
13,
4706,
701,
307,
1445,
353,
2009,
29889,
1792,
29889,
657,
29918,
10185,
580,
13,
4706,
1833,
29918,
27349,
29918,
949,
353,
1842,
29889,
657,
29918,
4230,
29918,
27349,
29918,
949,
29898,
3827,
29889,
1792,
29897,
13,
1678,
1683,
29901,
13,
4706,
1833,
29918,
27349,
29918,
949,
353,
6213,
13,
4706,
701,
307,
1445,
353,
6213,
13,
13,
1678,
565,
620,
2017,
322,
1833,
29918,
27349,
29918,
949,
338,
451,
6213,
29901,
13,
4706,
16385,
353,
1833,
29918,
27349,
29918,
949,
13,
1678,
25342,
451,
937,
322,
701,
307,
1445,
322,
701,
307,
1445,
29889,
3150,
29918,
517,
29918,
4230,
29918,
27349,
322,
1833,
29918,
27349,
29918,
949,
29901,
13,
4706,
16385,
353,
1833,
29918,
27349,
29918,
949,
13,
1678,
1683,
29901,
13,
4706,
1018,
29901,
13,
9651,
304,
29883,
353,
1842,
29889,
657,
29918,
517,
29883,
580,
13,
9651,
937,
29918,
667,
353,
304,
29883,
29889,
4102,
29918,
667,
580,
13,
9651,
16385,
353,
679,
29918,
1445,
29918,
1609,
29918,
667,
29898,
4102,
29918,
667,
29892,
1842,
29897,
13,
4706,
5174,
21403,
29923,
5467,
2451,
29901,
13,
9651,
396,
1334,
2355,
777,
2924,
310,
6635,
579,
19783,
293,
1059,
1550,
1811,
304,
29871,
13,
9651,
396,
6088,
445,
1842,
13,
9651,
2643,
353,
903,
877,
8439,
471,
263,
1108,
5183,
278,
15562,
363,
445,
1842,
29889,
1495,
13,
9651,
736,
1776,
29918,
27349,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
6213,
29892,
2643,
29922,
4906,
29897,
13,
4706,
565,
16385,
338,
6213,
29901,
13,
9651,
1480,
29889,
2704,
877,
23323,
451,
1284,
385,
2944,
411,
278,
1178,
310,
1273,
29879,
29915,
1273,
937,
29918,
667,
29897,
13,
9651,
12020,
9056,
29946,
29900,
29946,
13,
4706,
565,
937,
29901,
13,
9651,
1480,
29889,
8382,
703,
2831,
3277,
937,
16385,
1159,
13,
9651,
396,
11004,
385,
7331,
6684,
577,
591,
679,
263,
5941,
3988,
541,
748,
304,
278,
1959,
16385,
3553,
13,
9651,
736,
9056,
5103,
24735,
29898,
24244,
877,
1493,
29918,
27349,
742,
9049,
5085,
3790,
29915,
3257,
2396,
3225,
29889,
11177,
29918,
3257,
3285,
525,
1989,
2396,
1842,
29889,
333,
29892,
525,
27349,
29918,
333,
2396,
27349,
29889,
9507,
20073,
13,
1678,
736,
1776,
29918,
27349,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
6213,
29892,
16385,
29922,
27349,
29892,
1842,
29922,
3225,
29897,
13,
13,
13,
29937,
2216,
7090,
519,
2845,
1363,
372,
1122,
367,
263,
1422,
1404,
13,
29992,
484,
369,
29918,
8173,
13,
1753,
1776,
29918,
27349,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
16385,
29918,
333,
29892,
16385,
29922,
8516,
29892,
1842,
29922,
8516,
29892,
5386,
29918,
12733,
29922,
8516,
29892,
2643,
29922,
8516,
1125,
13,
1678,
565,
16385,
338,
451,
6213,
29901,
13,
4706,
16385,
29918,
333,
353,
16385,
29889,
333,
13,
13,
1678,
1480,
29889,
8382,
703,
14959,
292,
701,
3611,
1273,
29879,
29892,
1820,
1273,
29879,
29892,
16385,
1273,
29879,
29908,
1273,
313,
3257,
29892,
1820,
29892,
16385,
29918,
333,
876,
268,
13,
13,
1678,
565,
451,
1842,
29901,
13,
4706,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29897,
13,
13,
1678,
565,
16385,
338,
6213,
29901,
13,
4706,
396,
5682,
4135,
3618,
1122,
505,
901,
1135,
697,
7929,
8954,
13,
4706,
298,
353,
29871,
4544,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29892,
10422,
29922,
27349,
29918,
333,
29897,
13,
4706,
565,
298,
29889,
2798,
580,
1275,
29871,
29900,
29901,
13,
9651,
12020,
9056,
29946,
29900,
29946,
13,
4706,
16385,
353,
298,
29961,
29900,
29962,
13,
13,
1678,
2446,
353,
903,
27349,
29918,
4622,
29918,
24957,
29898,
3225,
29892,
16385,
29892,
525,
4622,
1495,
13,
1678,
3517,
353,
903,
27349,
29918,
4622,
29918,
24957,
29898,
3225,
29892,
16385,
29892,
525,
24957,
1495,
13,
13,
1678,
3847,
29918,
27349,
353,
6213,
13,
1678,
1014,
27349,
29918,
12653,
353,
6213,
13,
13,
1678,
304,
29883,
353,
1842,
29889,
657,
29918,
3332,
29918,
5563,
29918,
517,
29883,
580,
13,
13,
1678,
363,
260,
297,
304,
29883,
29901,
13,
4706,
2822,
353,
16385,
29889,
9507,
29889,
12508,
29898,
1022,
431,
29918,
3075,
1934,
29889,
1430,
29907,
29897,
13,
4706,
565,
2822,
297,
518,
29883,
29889,
12653,
580,
363,
274,
297,
260,
29889,
2886,
29918,
14273,
355,
1934,
580,
5387,
13,
9651,
3847,
29918,
27349,
353,
260,
13,
9651,
1014,
27349,
29918,
12653,
353,
2822,
13,
9651,
2867,
13,
1678,
396,
5399,
3692,
445,
674,
4050,
1728,
17452,
385,
3682,
13,
1678,
1018,
29901,
13,
4706,
16385,
29889,
9482,
580,
13,
4706,
11949,
354,
1691,
353,
16385,
29889,
9783,
354,
1691,
29889,
497,
580,
29961,
29900,
29901,
11027,
29889,
12648,
29918,
19407,
29918,
24483,
29962,
13,
13,
4706,
396,
960,
591,
2355,
29871,
29900,
11949,
354,
1691,
29892,
445,
1122,
367,
263,
25000,
3143,
13,
4706,
565,
7431,
29898,
9783,
354,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
11949,
354,
1691,
353,
624,
5577,
4155,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
9601,
29900,
29901,
11027,
29889,
12648,
29918,
19407,
29918,
24483,
29962,
13,
13,
1678,
5174,
21403,
29923,
5467,
2451,
29892,
321,
29901,
13,
4706,
1480,
29889,
2704,
29898,
15003,
1627,
29889,
4830,
29918,
735,
29883,
3101,
13,
4706,
16385,
353,
6213,
13,
4706,
11949,
354,
1691,
353,
6213,
13,
4706,
2643,
353,
903,
877,
4907,
13,
4013,
3143,
11122,
2793,
393,
6726,
29893,
555,
8496,
29915,
29873,
1303,
29889,
29871,
887,
1122,
817,
304,
1423,
411,
278,
29871,
13,
23679,
261,
393,
445,
338,
263,
2854,
321,
21076,
3143,
393,
3743,
2845,
1060,
7020,
470,
360,
29911,
10967,
29899,
689,
19667,
13,
3051,
29889,
4907,
1495,
13,
13,
13,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
1493,
29889,
1420,
742,
11117,
27349,
2396,
27349,
29892,
13,
462,
462,
9651,
525,
3225,
2396,
3225,
29892,
13,
462,
462,
9651,
525,
4622,
2396,
4622,
29892,
13,
462,
462,
9651,
525,
4906,
2396,
4906,
29892,
539,
13,
462,
462,
9651,
525,
517,
29883,
2396,
517,
29883,
29892,
13,
462,
462,
9651,
525,
1491,
27349,
29918,
12653,
2396,
1491,
27349,
29918,
12653,
29892,
13,
462,
462,
9651,
525,
3560,
29918,
27349,
2396,
3560,
29918,
27349,
29892,
13,
462,
462,
9651,
525,
9783,
354,
1691,
2396,
9783,
354,
1691,
29892,
13,
462,
462,
9651,
525,
3608,
29918,
12733,
2396,
3608,
29918,
12733,
29892,
13,
462,
462,
9651,
525,
24957,
2396,
24957,
1800,
13,
13,
13,
29992,
8173,
29918,
3488,
29898,
29953,
29900,
334,
29871,
29896,
29945,
29897,
13,
29992,
8173,
29918,
6451,
29898,
9053,
29922,
5574,
29897,
13,
1753,
1776,
29918,
27349,
29918,
3027,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
1967,
1125,
13,
1678,
1480,
29889,
8382,
703,
2940,
2009,
29901,
3063,
701,
3611,
1273,
29879,
29892,
1820,
1273,
29879,
29892,
1967,
1273,
29879,
29908,
1273,
313,
3257,
29892,
1820,
29892,
1967,
876,
308,
13,
1678,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29897,
13,
1678,
1018,
29901,
29871,
13,
4706,
1967,
29918,
5415,
353,
7084,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29892,
10422,
29922,
3027,
9601,
29900,
29962,
13,
1678,
5174,
11374,
2392,
29901,
13,
4706,
1967,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
3027,
29897,
13,
4706,
1018,
29901,
13,
9651,
1967,
29918,
5415,
353,
7084,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29892,
10422,
29922,
3027,
9601,
29900,
29962,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
12020,
9056,
29946,
29900,
29946,
13,
1678,
2933,
353,
9056,
5103,
29898,
3051,
29918,
1853,
29922,
710,
29898,
3027,
29918,
5415,
29889,
3051,
29918,
1853,
876,
13,
1678,
565,
1967,
29918,
5415,
29889,
3051,
29918,
1853,
1275,
525,
3027,
29914,
15120,
29974,
3134,
2396,
13,
4706,
2933,
29889,
3051,
353,
1967,
29918,
5415,
29889,
1445,
13,
1678,
1683,
29901,
13,
4706,
1018,
29901,
13,
9651,
2933,
29889,
3051,
353,
1967,
29918,
5415,
29889,
657,
29918,
1272,
580,
13,
4706,
5174,
23833,
2392,
29901,
396,
28933,
29899,
2848,
1967,
13,
9651,
12020,
9056,
29946,
29900,
29946,
13,
13,
1678,
736,
2933,
13,
13,
29992,
8173,
29918,
3488,
29898,
29953,
29900,
334,
29871,
29896,
29945,
29897,
13,
29992,
8173,
29918,
6451,
29898,
3597,
29922,
5574,
29897,
13,
1753,
1776,
29918,
13558,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
11949,
4155,
29918,
333,
1125,
13,
1678,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29897,
13,
1678,
1480,
29889,
8382,
877,
29264,
11949,
4155,
1273,
29879,
29915,
1273,
11949,
4155,
29918,
333,
29897,
13,
1678,
11949,
354,
1691,
353,
624,
5577,
4155,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29892,
9507,
29922,
13558,
29918,
333,
29897,
13,
1678,
565,
7431,
29898,
9783,
354,
1691,
29897,
1275,
29871,
29900,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
13,
1678,
11949,
4155,
353,
11949,
354,
1691,
29961,
29900,
29962,
13,
1678,
2933,
353,
9056,
5103,
29898,
3051,
29922,
13558,
29889,
1445,
29892,
2793,
29918,
1853,
2433,
726,
29914,
4268,
1495,
13,
1678,
736,
2933,
13,
13,
29992,
8173,
29918,
6451,
29898,
9053,
29922,
5574,
29897,
13,
1753,
5142,
29918,
1022,
431,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
1661,
346,
29922,
8516,
1125,
13,
1678,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
1661,
346,
29922,
5464,
346,
29897,
13,
1678,
736,
903,
2457,
29918,
1022,
431,
29898,
3225,
29897,
13,
13,
1753,
903,
2457,
29918,
1022,
431,
29898,
3225,
1125,
13,
1678,
14550,
11609,
278,
321,
5467,
18871,
2793,
29889,
29871,
960,
372,
29915,
29879,
11423,
635,
1063,
11132,
13,
1678,
1283,
278,
8635,
13336,
313,
375,
1474,
445,
5930,
297,
2693,
29885,
361,
1842,
338,
6213,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
308,
13,
1678,
565,
1842,
29889,
657,
29918,
3051,
580,
338,
6213,
29901,
396,
910,
10008,
565,
278,
934,
756,
1063,
11132,
15668,
515,
278,
22101,
13,
4706,
12020,
9056,
29946,
29900,
29946,
4706,
560,
459,
358,
511,
736,
13,
1678,
263,
29871,
29946,
29900,
29946,
2012,
288,
29889,
949,
310,
263,
5225,
29899,
10389,
5142,
29889,
12008,
13,
1678,
2793,
353,
1842,
29889,
657,
29918,
3051,
580,
13,
1678,
565,
2793,
338,
6213,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
13,
1678,
2933,
353,
9056,
1666,
22842,
1725,
29918,
978,
353,
443,
293,
6797,
532,
29889,
8945,
675,
877,
22498,
29968,
29907,
742,
1842,
29889,
978,
467,
12508,
877,
28599,
2687,
742,
525,
1627,
17057,
6506,
2824,
6506,
877,
13420,
22868,
1495,
13,
1678,
2933,
1839,
3916,
29899,
4205,
3283,
2033,
353,
525,
14930,
358,
29936,
10422,
16328,
29879,
29915,
1273,
9109,
29918,
1839,
3916,
29899,
4205,
3283,
2033,
353,
525,
271,
259,
13,
1753,
1776,
29918,
3225,
29918,
19635,
29898,
3827,
29892,
3611,
29892,
1820,
1125,
13,
1678,
1480,
29889,
8382,
703,
14959,
292,
701,
15562,
1273,
29879,
29892,
1820,
1273,
29879,
29908,
1273,
313,
3257,
29892,
1820,
876,
13,
1678,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29897,
13,
1678,
565,
451,
1842,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
13,
1678,
5386,
29918,
12733,
353,
903,
657,
29918,
3608,
29918,
12733,
29918,
3888,
29898,
3225,
29892,
2009,
29897,
13,
1678,
883,
353,
382,
5467,
7211,
403,
2500,
580,
308,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
1493,
29889,
1420,
742,
11117,
3225,
2396,
3225,
29892,
525,
689,
2396,
883,
29892,
525,
3608,
29918,
12733,
2396,
3608,
29918,
12733,
1800,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
5217,
29898,
3827,
1125,
13,
1678,
14550,
12498,
263,
3143,
322,
6942,
15562,
29892,
322,
9263,
358,
1749,
3001,
8277,
6795,
12008,
13,
13,
1678,
565,
525,
1989,
29915,
297,
2009,
29889,
5438,
322,
525,
3257,
29915,
297,
2009,
29889,
5438,
29901,
13,
4706,
3611,
353,
2009,
29889,
5438,
1839,
3257,
2033,
13,
4706,
1820,
353,
2009,
29889,
5438,
1839,
1989,
2033,
13,
4706,
1480,
29889,
8382,
703,
2772,
1026,
292,
3611,
1273,
29879,
29892,
1820,
1273,
29879,
29908,
1273,
313,
3257,
29892,
1820,
876,
13,
4706,
565,
2009,
29889,
1792,
29889,
275,
29918,
9136,
1792,
29901,
13,
9651,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
5712,
29918,
20348,
29922,
5574,
29897,
13,
4706,
1683,
29901,
13,
9651,
1842,
353,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29897,
13,
13,
4706,
396,
2688,
881,
367,
278,
12271,
310,
445,
3143,
304,
5217,
372,
13,
4706,
565,
1842,
338,
451,
6213,
322,
1842,
29889,
275,
29918,
20348,
29898,
3827,
29889,
1792,
1125,
13,
9651,
903,
8143,
29918,
3225,
29898,
3827,
29892,
1842,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
9056,
29946,
29900,
29946,
13,
1678,
736,
9056,
5103,
24735,
29898,
24244,
877,
5258,
8785,
13,
13,
1753,
6036,
29898,
3827,
1125,
13,
1678,
14550,
15213,
263,
716,
1404,
373,
6726,
29893,
555,
12008,
13,
13,
1678,
883,
353,
4911,
9832,
362,
2500,
580,
13,
462,
462,
632,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
848,
353,
2009,
29889,
5438,
29889,
8552,
580,
13,
4706,
4436,
353,
883,
29889,
657,
29918,
18157,
29918,
12523,
29898,
1272,
29897,
13,
4706,
565,
451,
4436,
29901,
13,
9651,
716,
29918,
1792,
353,
883,
29889,
7620,
29898,
1272,
29897,
13,
9651,
1404,
353,
4817,
29889,
27218,
403,
29898,
6786,
29922,
1482,
29918,
1792,
29889,
6786,
29892,
4800,
29922,
3827,
29889,
5438,
1839,
29966,
25711,
17013,
29958,
11287,
13,
9651,
565,
1404,
338,
451,
6213,
322,
1404,
29889,
275,
29918,
4925,
29901,
13,
18884,
4817,
29889,
7507,
29898,
3827,
29892,
1404,
29897,
13,
18884,
736,
9056,
5103,
24735,
29898,
24244,
877,
5258,
29889,
7406,
29889,
2248,
8785,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
376,
5150,
29914,
9573,
29889,
1420,
613,
426,
525,
689,
29915,
584,
883,
5615,
13,
13,
29992,
7507,
29918,
12403,
13,
29992,
484,
369,
29918,
8173,
13,
1753,
8722,
29898,
3827,
1125,
13,
1678,
701,
307,
1445,
353,
10729,
2677,
29898,
3827,
467,
657,
877,
10185,
1495,
13,
268,
13,
1678,
565,
2009,
29889,
3150,
333,
29901,
13,
4706,
269,
1727,
353,
2009,
29889,
3150,
333,
29889,
29879,
1727,
13,
4706,
396,
960,
591,
505,
278,
4876,
515,
4673,
1367,
322,
451,
297,
1009,
8722,
29892,
758,
29899,
7323,
5987,
372,
13,
4706,
565,
451,
2009,
29889,
1792,
29889,
5269,
322,
269,
1727,
29889,
5349,
29918,
1989,
877,
5269,
29374,
13,
9651,
2009,
29889,
1792,
29889,
5269,
353,
269,
1727,
1839,
5269,
2033,
13,
4706,
565,
269,
1727,
29889,
5349,
29918,
1989,
877,
8159,
978,
29374,
13,
9651,
701,
307,
1445,
29889,
8159,
978,
353,
269,
1727,
1839,
8159,
978,
2033,
13,
4706,
565,
269,
1727,
29889,
5349,
29918,
1989,
877,
19254,
978,
29374,
13,
9651,
701,
307,
1445,
29889,
19254,
978,
353,
269,
1727,
1839,
19254,
978,
2033,
13,
13,
4706,
396,
4525,
881,
871,
367,
4784,
565,
896,
7359,
29915,
29873,
2307,
1063,
3939,
13,
4706,
565,
701,
307,
1445,
29889,
2230,
8028,
338,
6213,
322,
269,
1727,
29889,
5349,
29918,
1989,
877,
2230,
8028,
29374,
13,
9651,
701,
307,
1445,
29889,
2230,
8028,
353,
269,
1727,
1839,
2230,
8028,
2033,
13,
4706,
565,
701,
307,
1445,
29889,
11675,
338,
6213,
322,
269,
1727,
29889,
5349,
29918,
1989,
877,
11675,
29374,
13,
9651,
701,
307,
1445,
29889,
11675,
353,
269,
1727,
1839,
11675,
2033,
13,
4706,
565,
701,
307,
1445,
29889,
13509,
338,
6213,
322,
269,
1727,
29889,
5349,
29918,
1989,
877,
13509,
29374,
13,
9651,
701,
307,
1445,
29889,
13509,
353,
269,
1727,
1839,
13509,
2033,
13,
4706,
701,
307,
1445,
29889,
7620,
580,
13,
268,
13,
1678,
565,
6055,
29889,
29931,
19453,
29965,
10461,
29918,
3217,
8949,
8673,
29918,
5813,
297,
2009,
29889,
7924,
29901,
13,
4706,
1480,
29889,
8382,
703,
3373,
26747,
4086,
304,
1273,
29879,
29908,
1273,
2009,
29889,
7924,
29889,
657,
29898,
11027,
29889,
29931,
19453,
29965,
10461,
29918,
3217,
8949,
8673,
29918,
5813,
876,
13,
4706,
701,
307,
1445,
29889,
11675,
353,
2009,
29889,
7924,
29889,
657,
29898,
11027,
29889,
29931,
19453,
29965,
10461,
29918,
3217,
8949,
8673,
29918,
5813,
29897,
13,
4706,
701,
307,
1445,
29889,
7620,
580,
13,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
883,
353,
20802,
2500,
29898,
3827,
29889,
5438,
29892,
2777,
29922,
29884,
10185,
29897,
13,
4706,
565,
883,
29889,
275,
29918,
3084,
7295,
13,
9651,
883,
29889,
7620,
580,
13,
4706,
2643,
353,
903,
703,
10858,
8722,
756,
1063,
4784,
23157,
13,
1678,
1683,
29901,
13,
4706,
883,
353,
20802,
2500,
29898,
8758,
29922,
29884,
10185,
29897,
13,
4706,
2643,
353,
6213,
13,
1678,
565,
525,
7645,
29915,
297,
2009,
29889,
7194,
29901,
13,
4706,
2643,
353,
2009,
29889,
7194,
1839,
7645,
2033,
13,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
13,
462,
795,
525,
5150,
29914,
10185,
29889,
1420,
742,
29871,
13,
462,
795,
11117,
689,
2396,
689,
29892,
525,
29886,
24539,
2396,
29884,
10185,
29892,
525,
4906,
2396,
4906,
1800,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
8722,
29918,
8143,
29898,
3827,
1125,
13,
13,
1678,
565,
451,
2009,
29889,
5438,
29889,
5349,
29918,
1989,
877,
8143,
29374,
13,
4706,
396,
7338,
336,
9753,
537,
29899,
3198,
393,
445,
338,
263,
11971,
2009,
13,
4706,
1480,
29889,
2704,
877,
29816,
7374,
291,
2009,
541,
471,
451,
11971,
1495,
13,
4706,
2643,
353,
903,
703,
8439,
471,
263,
1108,
411,
596,
2009,
304,
5217,
445,
8722,
23157,
13,
4706,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
10185,
29889,
1420,
742,
426,
525,
4906,
2396,
4906,
1800,
13,
13,
1678,
565,
451,
2009,
29889,
5438,
1839,
8143,
2033,
1275,
2009,
29889,
1792,
29889,
5269,
29901,
13,
4706,
396,
1126,
393,
591,
29915,
276,
11971,
292,
515,
1749,
1914,
883,
313,
1366,
338,
263,
9753,
537,
1423,
29892,
29871,
13,
4706,
396,
451,
263,
6993,
4682,
29889,
29871,
450,
1857,
13817,
29899,
262,
1404,
8722,
338,
2337,
13,
4706,
396,
278,
697,
304,
367,
11132,
29892,
17126,
310,
278,
995,
310,
525,
8143,
1495,
13,
4706,
1480,
29889,
2704,
877,
29816,
7374,
291,
2009,
541,
25985,
978,
1258,
451,
1993,
29901,
4520,
1273,
29879,
541,
1857,
1404,
338,
1273,
29879,
29915,
1273,
313,
3827,
29889,
5438,
1839,
8143,
7464,
2009,
29889,
1792,
29889,
19254,
978,
22130,
13,
4706,
2643,
353,
903,
703,
8439,
471,
263,
1108,
411,
596,
2009,
304,
5217,
445,
8722,
23157,
13,
4706,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
10185,
29889,
1420,
742,
426,
525,
4906,
2396,
4906,
1800,
13,
13,
1678,
2009,
29889,
1792,
29889,
657,
29918,
10185,
2141,
8143,
580,
13,
13,
1678,
396,
21267,
599,
1009,
8277,
313,
1366,
338,
5517,
304,
931,
714,
363,
2919,
3694,
310,
8277,
29897,
13,
1678,
10701,
353,
382,
5467,
13197,
573,
29889,
12650,
29889,
4572,
29898,
1792,
29918,
10867,
1649,
1792,
29922,
3827,
29889,
1792,
29897,
13,
13,
1678,
363,
270,
297,
10701,
29901,
13,
4706,
903,
8143,
29918,
3225,
29898,
3827,
29892,
270,
29897,
13,
13,
1678,
736,
9056,
5103,
24735,
11219,
1495,
396,
2329,
1004,
29901,
2869,
1480,
963,
714,
1244,
13,
13,
29873,
25117,
29936,
10422,
16328,
29879,
10185,
29918,
13270,
29918,
19715,
29918,
8513,
29898,
3827,
1125,
13,
1678,
14550,
27199,
3692,
304,
671,
278,
2560,
5183,
901,
470,
278,
2322,
4464,
29889,
12008,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
8722,
353,
2009,
29889,
1792,
29889,
657,
29918,
10185,
580,
13,
4706,
8722,
29889,
12857,
29918,
19715,
29918,
8513,
353,
451,
29898,
10185,
29889,
12857,
29918,
19715,
29918,
8513,
29897,
13,
4706,
1480,
29889,
8382,
877,
26740,
5183,
4464,
304,
1273,
29879,
29915,
1273,
8722,
29889,
12857,
29918,
19715,
29918,
8513,
29897,
13,
4706,
8722,
29889,
7620,
580,
13,
1678,
3142,
353,
2009,
29889,
2303,
6040,
29889,
657,
877,
10493,
29918,
25866,
1001,
1001,
1495,
13,
1678,
565,
3142,
338,
6213,
29901,
13,
4706,
3142,
353,
8207,
5258,
22208,
13,
1678,
736,
9056,
5103,
24735,
29898,
2271,
29897,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
8722,
29918,
3167,
29918,
5657,
29918,
2311,
29898,
3827,
29892,
2159,
1125,
13,
1678,
14550,
7277,
278,
4079,
2159,
6942,
411,
278,
1404,
29915,
29879,
3633,
12008,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
8722,
353,
2009,
29889,
1792,
29889,
657,
29918,
10185,
580,
13,
4706,
8722,
29889,
5657,
29918,
2311,
353,
2159,
29936,
13,
4706,
1480,
29889,
8382,
877,
26740,
4079,
2159,
304,
1273,
29879,
29915,
1273,
8722,
29889,
5657,
29918,
2311,
29897,
13,
4706,
8722,
29889,
7620,
580,
13,
1678,
736,
9056,
5103,
877,
29896,
1495,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
8722,
29918,
3167,
29918,
5657,
29918,
11922,
29898,
3827,
29892,
4079,
1125,
13,
1678,
14550,
7277,
278,
4079,
3942,
6942,
411,
278,
1404,
29915,
29879,
3633,
12008,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
8722,
353,
2009,
29889,
1792,
29889,
657,
29918,
10185,
580,
13,
4706,
8722,
29889,
5657,
29918,
11922,
353,
4079,
29936,
13,
4706,
1480,
29889,
8382,
877,
26740,
4079,
3942,
304,
1273,
29879,
29915,
1273,
8722,
29889,
5657,
29918,
11922,
29897,
13,
4706,
8722,
29889,
7620,
580,
13,
1678,
736,
9056,
5103,
877,
29896,
1495,
13,
13,
29873,
25117,
29936,
10422,
16328,
29879,
29915,
1273,
1842,
29889,
29876,
29892,
3611,
29922,
8516,
29892,
1820,
29922,
8516,
1125,
13,
1678,
14550,
17553,
29879,
263,
716,
1842,
322,
14422,
372,
297,
278,
2566,
29889,
29871,
960,
525,
3257,
29915,
322,
525,
1989,
29915,
13,
1678,
526,
4944,
769,
445,
338,
263,
19763,
310,
385,
5923,
1842,
29892,
607,
881,
11551,
13,
1678,
278,
1021,
3553,
29889,
29871,
450,
1404,
1818,
367,
385,
5923,
12271,
304,
19763,
263,
3143,
29889,
12008,
13,
1678,
1842,
353,
6213,
29871,
13,
358,
322,
14422,
372,
297,
278,
2566,
12008,
13,
1678,
1842,
353,
6213,
29871,
13,
268,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
29915,
2396,
13,
4706,
883,
353,
382,
5467,
7211,
271,
9651,
396,
450,
13201,
934,
9859,
491,
15337,
13,
9651,
5694,
29918,
1445,
353,
2009,
29889,
24483,
1839,
1022,
431,
13359,
1356,
1971,
653,
29918,
1445,
29918,
2084,
29898,
262,
2009,
29889,
24483,
1839,
1022,
431,
13359,
305,
18801,
7295,
13,
18884,
848,
29889,
3539,
29898,
29883,
29897,
13,
4706,
565,
451,
1820,
29901,
13,
18884,
1480,
29889,
8382,
703,
9832,
1218,
716,
1842,
29901,
14210,
29879,
11838,
1273,
1842,
29918,
978,
29897,
13,
18884,
1842,
353,
382,
5467,
13197,
573,
29898,
978,
29922,
3225,
29918,
978,
29897,
13,
18884,
1842,
29889,
7620,
580,
13,
9651,
1683,
29901,
13,
18884,
1480,
29889,
8382,
703,
29934,
7078,
9382,
5923,
1842,
29901,
14210,
29879,
11838,
1273,
1842,
29918,
978,
29897,
29871,
13,
18884,
1018,
29901,
13,
462,
1678,
1842,
353,
382,
5467,
13197,
573,
29889,
12650,
29889,
657,
29898,
333,
1649,
735,
627,
29922,
1989,
29897,
13,
462,
1678,
1480,
29889,
8382,
29898,
3225,
29889,
3257,
29897,
13,
462,
1678,
1480,
29889,
8382,
29898,
3827,
29889,
1792,
29897,
13,
13,
462,
1678,
396,
1317,
266,
347,
385,
12271,
310,
278,
1842,
29973,
13,
462,
1678,
565,
4911,
13197,
573,
29889,
12650,
29889,
4572,
29898,
1792,
29922,
3827,
29889,
1792,
29892,
13,
462,
462,
462,
29871,
12271,
29922,
5574,
29892,
13,
462,
462,
462,
29871,
18871,
29922,
3225,
467,
2798,
580,
1275,
29871,
29900,
29901,
13,
462,
4706,
12020,
9056,
29946,
29900,
29946,
13,
13,
462,
1678,
396,
16913,
1283,
777,
15562,
1048,
372,
13,
462,
1678,
338,
29918,
3597,
353,
1842,
29889,
275,
29918,
3597,
13,
13,
462,
1678,
396,
21267,
278,
2030,
697,
13,
462,
1678,
1842,
29889,
8143,
580,
13,
13,
462,
1678,
396,
6204,
263,
716,
697,
411,
278,
10075,
29899,
1482,
1024,
13,
462,
1678,
1842,
353,
382,
5467,
13197,
573,
29898,
978,
29922,
3225,
29918,
978,
29892,
333,
29922,
1989,
29897,
13,
462,
1678,
1842,
29889,
275,
29918,
3597,
353,
338,
29918,
3597,
13,
462,
1678,
1842,
29889,
7620,
580,
13,
462,
1678,
9150,
29918,
17886,
353,
11837,
877,
1493,
29918,
4102,
742,
9049,
5085,
3790,
29915,
1989,
2396,
1989,
29892,
13,
595,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
11117,
689,
2396,
689,
29892,
29871,
13,
3986,
525,
3257,
2396,
3257,
29892,
13,
595,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
11117,
689,
2396,
689,
29892,
29871,
13,
3986,
5615,
13,
13,
18884,
5174,
382,
5467,
13197,
573,
29889,
25125,
3664,
1252,
391,
29901,
13,
462,
1678,
1480,
29889,
2704,
703,
2558,
1273,
29879,
1258,
451,
1863,
29936,
4969,
716,
1842,
29908,
1273,
313,
1989,
876,
13,
462,
1678,
1842,
353,
382,
5467,
13197,
573,
29898,
978,
29922,
3225,
29918,
978,
29897,
462,
268,
13,
462,
1678,
1842,
29889,
7620,
580,
13,
418,
1574,
14170,
2457,
788,
29918,
1272,
29918,
517,
29918,
3225,
29898,
3827,
29892,
1842,
29892,
1722,
29898,
7382,
29918,
1445,
29892,
525,
6050,
29974,
5477,
883,
29897,
13,
13,
4706,
396,
450,
883,
3508,
29915,
29873,
2854,
313,
4738,
635,
1363,
591,
3282,
29915,
29873,
2869,
6441,
3099,
29897,
13,
344,
515,
321,
5467,
3198,
29892,
5330,
8253,
29901,
1273,
29879,
29915,
1273,
270,
29897,
13,
462,
13,
1669,
903,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
426,
13,
18884,
525,
689,
2396,
689,
1800,
13,
13,
13,
1678,
1683,
29901,
13,
4706,
883,
353,
382,
5467,
7211,
403,
2500,
580,
308,
13,
13,
1678,
736,
788,
29918,
1272,
29918,
517,
29918,
3225,
29898,
3827,
29892,
1842,
29892,
848,
29892,
883,
29892,
6684,
29918,
8698,
29918,
517,
29918,
3488,
29922,
5574,
1125,
13,
1678,
14550,
2528,
321,
5467,
848,
313,
294,
263,
934,
29899,
4561,
1203,
29897,
304,
263,
1842,
29892,
769,
3902,
356,
372,
29889,
13,
539,
960,
445,
3639,
5852,
29892,
736,
263,
9150,
6684,
29936,
6467,
736,
385,
1059,
4472,
29889,
13,
539,
960,
278,
6684,
29918,
517,
29918,
3488,
3443,
338,
5852,
313,
4381,
511,
278,
775,
674,
6684,
13,
13,
539,
14550,
13,
1678,
9150,
29918,
17886,
353,
11837,
877,
5258,
1495,
13,
13,
1678,
1842,
29889,
842,
29918,
3051,
29898,
1272,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
1842,
29889,
24516,
356,
580,
13,
4706,
1842,
29889,
1792,
29918,
10867,
29889,
3258,
29898,
10867,
29922,
3225,
29892,
13,
462,
462,
268,
12271,
29922,
5574,
29892,
13,
462,
462,
268,
1404,
29922,
3827,
29889,
1792,
29897,
13,
4706,
1842,
29889,
7620,
580,
13,
13,
1678,
5174,
9178,
26264,
1445,
29892,
321,
29901,
13,
4706,
396,
450,
1404,
1898,
304,
6441,
1554,
393,
9007,
29915,
29873,
263,
14319,
13,
4706,
396,
934,
29889,
910,
1059,
3508,
29915,
29873,
8031,
29936,
1016,
29915,
29873,
3638,
4876,
13,
4706,
286,
259,
903,
29898,
9651,
1480,
29889,
2704,
29898,
9675,
29889,
735,
29883,
29918,
1767,
29897,
13,
18884,
2643,
353,
525,
1576,
934,
366,
20373,
471,
451,
1162,
468,
1240,
29897,
24688,
408,
385,
2457,
903,
12276,
29918,
2704,
29898,
3827,
29892,
1842,
29892,
848,
29892,
286,
29892,
883,
29892,
321,
29892,
4876,
29922,
8824,
29897,
13,
13,
1678,
5174,
9254,
2585,
29889,
7094,
1288,
2392,
29892,
321,
29901,
13,
4706,
396,
910,
10008,
12891,
746,
263,
2323,
2919,
10804,
13,
4706,
396,
338,
4502,
304,
9254,
29889,
960,
366,
679,
1784,
310,
1438,
29892,
13,
4706,
396,
7910,
278,
995,
310,
278,
9254,
2295,
995,
13,
4706,
396,
4236,
29918,
24622,
29918,
4058,
300,
313,
29958,
29871,
29896,
29953,
29924,
13622,
467,
13,
4706,
286,
353,
903,
29898,
434,
6152,
703,
29954,
327,
1751,
1288,
1059,
1273,
29879,
29908,
1273,
321,
29897,
13,
18884,
2643,
353,
376,
4806,
17809,
263,
1108,
411,
596,
321,
2909,
393,
338,
1556,
5517,
4475,
304,
372,
1641,
2086,
4802,
304,
2479,
23511,
297,
263,
1856,
4714,
29889,
910,
508,
3799,
411,
1407,
2919,
4558,
29892,
470,
411,
14154,
1472,
10708,
2153,
29889,
3529,
1423,
411,
278,
9805,
261,
393,
278,
3143,
756,
1063,
20917,
5149,
29889,
29871,
18064,
2919,
6515,
723,
1996,
263,
3287,
310,
23064,
322,
2254,
29897,
937,
7319,
300,
595,
903,
12276,
29918,
2704,
29898,
3827,
29892,
1842,
29892,
848,
29892,
286,
29892,
883,
29892,
321,
29892,
4876,
29922,
5574,
29897,
13,
13,
1678,
5174,
26900,
2303,
5467,
2451,
29892,
321,
29901,
13,
4706,
396,
26900,
29924,
338,
16126,
13,
4706,
286,
353,
903,
29898,
29884,
29897,
13,
13,
18884,
1842,
29889,
8143,
580,
13,
18884,
2643,
353,
376,
3112,
5692,
393,
366,
29915,
345,
20373,
263,
3143,
607,
3743,
26900,
29924,
313,
27103,
26863,
15057,
467,
29871,
910,
338,
263,
24345,
393,
338,
6839,
304,
5557,
27302,
17596,
541,
884,
28057,
25204,
6490,
1914,
414,
515,
5183,
1009,
321,
12733,
29693,
896,
763,
29889,
887,
674,
3117,
817,
304,
671,
2087,
16945,
15918,
2155,
2187,
304,
1303,
445,
321,
2909,
29892,
541,
2050,
6958,
292,
278,
2529,
23443,
1333,
367,
788,
2457,
903,
12276,
29918,
2704,
29898,
3827,
29892,
1842,
29892,
848,
29892,
286,
29892,
883,
29892,
321,
29892,
4876,
29922,
8824,
29897,
13,
13,
1678,
5174,
8960,
29892,
321,
29901,
13,
4706,
396,
1334,
2355,
777,
9815,
1059,
313,
375,
1474,
263,
4439,
15628,
321,
5467,
467,
29871,
1334,
13,
4706,
396,
864,
304,
1073,
1048,
1438,
1951,
896,
526,
6041,
2869,
6726,
29893,
555,
24557,
29889,
13,
13,
4706,
565,
6055,
29889,
16033,
5690,
29918,
29923,
7056,
29933,
3210,
16658,
29901,
13,
1678,
409,
515,
321,
5467,
3198,
29892,
5330,
8253,
29901,
1273,
29879,
29915,
1273,
270,
29897,
13,
462,
13,
18884,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
11117,
689,
2396,
1454,
1678,
525,
4906,
2396,
710,
29898,
29872,
26972,
462,
13,
4706,
903,
5269,
29918,
12523,
29918,
517,
29918,
6406,
29898,
29872,
29892,
848,
29892,
1842,
29897,
13,
13,
29871,
9637,
1627,
29889,
4830,
29918,
735,
29883,
580,
13,
18884,
1480,
29889,
2704,
29898,
22625,
29897,
13,
18884,
396,
21267,
372,
937,
20892,
4463,
29889,
8143,
580,
13,
13,
418,
1480,
29889,
2704,
29898,
29888,
29897,
13,
13,
18884,
1842,
29889,
8143,
580,
13,
13,
18884,
396,
2803,
29915,
29879,
1074,
825,
29915,
29879,
2743,
411,
445,
491,
6721,
9358,
3084,
29918,
13713,
353,
321,
5467,
3198,
29889,
15480,
29898,
1272,
29897,
13,
13,
4706,
1059,
353,
903,
11739,
29918,
4906,
29898,
29872,
29897,
13,
4706,
565,
7431,
29898,
2704,
29897,
1405,
29871,
29906,
29900,
29900,
29901,
13,
9651,
1059,
353,
1059,
29961,
29900,
29901,
29906,
29900,
29900,
29962,
718,
318,
29915,
856,
29915,
13,
13,
4706,
2643,
353,
5159,
13,
4706,
2643,
29889,
4397,
7373,
29898,
29884,
529,
29886,
770,
2433,
29890,
29893,
29899,
9009,
29899,
4906,
11041,
539,
1059,
353,
1059,
29961,
29900,
29901,
29906,
29900,
29900,
29962,
718,
525,
856,
29915,
13,
18884,
2643,
353,
376,
1576,
934,
366,
20373,
3430,
763,
385,
321,
21076,
18871,
29892,
541,
372,
756,
777,
4828,
393,
5557,
287,
372,
515,
1641,
7500,
29889,
29871,
910,
1122,
367,
263,
6494,
297,
6726,
29893,
555,
29892,
470,
372,
1122,
367,
263,
1108,
411,
266,
829,
29886,
29958,
5783,
13,
4706,
2643,
29889,
4397,
7373,
29898,
29884,
29908,
29966,
29886,
770,
2433,
29890,
29893,
29899,
9009,
29899,
12523,
11041,
29995,
29879,
829,
29886,
11903,
1273,
4903,
29918,
21587,
29898,
2704,
4961,
13,
13,
418,
1480,
29889,
2704,
29898,
29888,
29897,
13,
13,
18884,
1842,
29889,
8143,
580,
13,
13,
18884,
396,
2803,
29915,
29879,
1074,
825,
29915,
29879,
2743,
411,
445,
491,
6721,
9358,
3084,
29918,
13713,
353,
321,
5467,
3198,
29889,
15480,
29898,
1272,
29897,
13,
13,
4706,
565,
2854,
29918,
13713,
338,
6213,
29901,
13,
9651,
396,
1334,
2355,
3078,
5407,
515,
278,
2854,
1061,
313,
29877,
3554,
29897,
13,
9651,
1209,
13,
4706,
25342,
7431,
29898,
3084,
29918,
13713,
29897,
1275,
29871,
29900,
29901,
13,
9651,
2643,
29889,
4397,
7373,
29898,
29884,
29908,
29966,
29886,
5961,
1022,
431,
3198,
22405,
445,
934,
338,
2854,
29892,
577,
445,
1122,
367,
263,
6726,
29893,
555,
1059,
29897,
829,
29886,
29958,
5783,
13,
4706,
1683,
29901,
13,
9651,
321,
353,
11297,
29876,
4286,
7122,
4197,
29875,
29889,
726,
363,
474,
297,
2854,
29918,
13713,
2314,
13,
9651,
4436,
353,
6024,
29966,
492,
29958,
29995,
29879,
829,
492,
16299,
1273,
474,
29889,
6506,
28909,
29876,
742,
12801,
1182,
3779,
1495,
29871,
363,
474,
297,
321,
29889,
5451,
877,
11432,
29901,
1495,
565,
474,
29962,
13,
9651,
2643,
29889,
4397,
7373,
29898,
29884,
29908,
29966,
29886,
770,
2433,
29890,
29893,
29899,
9009,
29899,
4906,
11041,
4286,
7122,
29898,
1022,
431,
29918,
2704,
29918,
1761,
29897,
13,
462,
4706,
2643,
4619,
9872,
29886,
5299,
29874,
2822,
2433,
1124,
597,
401,
29889,
3608,
29889,
510,
29914,
29886,
29914,
1022,
431,
3198,
29914,
11041,
1022,
431,
3198,
829,
29874,
29958,
8571,
267,
393,
445,
338,
451,
263,
2854,
321,
21076,
934,
29892,
577,
366,
29871,
529,
1110,
1178,
2433,
29890,
29893,
29899,
1949,
29899,
12523,
11041,
29995,
29881,
829,
1110,
29958,
1059,
29898,
29879,
1125,
829,
29886,
11903,
1273,
7431,
29898,
12523,
4961,
13,
9651,
2643,
29889,
4397,
29898,
29884,
29908,
529,
324,
1178,
2433,
29890,
29893,
29899,
9009,
29899,
2704,
29899,
1761,
11041,
29995,
29879,
829,
324,
11903,
1273,
525,
4286,
7122,
29898,
12523,
876,
13,
308,
13,
344,
515,
321,
5467,
3198,
29892,
5330,
8253,
29901,
1273,
29879,
29915,
1273,
270,
29897,
13,
462,
13,
18884,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
11117,
689,
2396,
1454,
29915,
4906,
2396,
29884,
29915,
4286,
7122,
29898,
4906,
26972,
462,
13,
13,
1678,
565,
6684,
29918,
8698,
29918,
517,
29918,
3488,
29901,
13,
4706,
736,
9056,
5103,
24735,
29898,
8698,
1319,
29918,
17886,
29897,
13,
1678,
736,
1842,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
29992,
484,
369,
29918,
8173,
13,
1753,
788,
29918,
1609,
29918,
2271,
29898,
3827,
1125,
13,
1678,
14550,
23965,
29879,
263,
12354,
2009,
411,
3443,
525,
1022,
431,
29915,
607,
881,
367,
2854,
321,
21076,
3988,
29889,
29871,
910,
674,
367,
2715,
13,
1678,
304,
278,
1857,
13817,
29899,
262,
1404,
29915,
29879,
3489,
12008,
13,
1678,
565,
451,
525,
1022,
431,
29915,
297,
2009,
29889,
7194,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
13,
1678,
321,
5467,
29918,
2271,
353,
2009,
29889,
7194,
1839,
1022,
431,
2033,
13,
1678,
736,
788,
29918,
1609,
29918,
2271,
29918,
2671,
29898,
3827,
29892,
321,
5467,
29918,
2271,
29892,
6684,
29918,
8698,
29918,
517,
29918,
3488,
29922,
5574,
29897,
13,
13,
1753,
788,
29918,
1609,
29918,
2271,
29918,
2671,
29898,
3827,
29892,
321,
5467,
29918,
2271,
29892,
6684,
29918,
8698,
29918,
517,
29918,
3488,
1125,
13,
1678,
883,
353,
382,
5467,
7211,
403,
2500,
580,
13,
13,
1678,
1018,
29901,
13,
4706,
848,
353,
3142,
1982,
29906,
29889,
332,
417,
2238,
29898,
1022,
431,
29918,
2271,
467,
949,
580,
13,
4706,
848,
353,
1714,
5971,
29898,
1272,
29897,
13,
1678,
5174,
3142,
1982,
29906,
29889,
4574,
1307,
24616,
29901,
13,
4706,
2643,
353,
903,
703,
1576,
3211,
366,
4944,
947,
451,
1298,
304,
385,
321,
21076,
3143,
1159,
13,
344,
515,
321,
5467,
3198,
29892,
5330,
8253,
29901,
1273,
29879,
29915,
1273,
270,
29897,
13,
462,
13,
18884,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
11117,
689,
2396,
1454,
29915,
4906,
2396,
4906,
1800,
462,
13,
308,
13,
1678,
1842,
353,
382,
5467,
13197,
573,
29889,
12650,
29889,
3258,
29898,
978,
29922,
359,
29889,
2084,
29889,
6500,
3871,
29898,
2271,
5510,
29889,
2271,
5510,
29898,
1022,
431,
29918,
2271,
467,
2084,
876,
13,
1678,
1842,
29889,
7620,
580,
13,
1678,
736,
788,
29918,
1272,
29918,
517,
29918,
3225,
29898,
3827,
29892,
1842,
29892,
848,
29892,
883,
29892,
6684,
29918,
8698,
29918,
517,
29918,
3488,
29897,
13,
1678,
634,
595,
270,
27349,
29918,
4622,
29918,
24957,
29898,
3225,
29892,
16385,
29892,
4516,
2433,
4622,
29374,
13,
1678,
14550,
11609,
29879,
278,
2446,
470,
3517,
848,
1203,
515,
278,
6418,
29943,
12008,
13,
1678,
304,
29883,
353,
1842,
29889,
657,
29918,
517,
29883,
580,
13,
1678,
2944,
353,
304,
29883,
29889,
2886,
29918,
667,
29918,
1609,
29918,
333,
29898,
27349,
29889,
333,
999,
29897,
13,
13,
1678,
565,
4516,
1275,
525,
4622,
2396,
13,
4706,
3646,
29918,
667,
353,
304,
29883,
29889,
2886,
29918,
4622,
29918,
667,
29898,
667,
29897,
13,
1678,
1683,
29901,
13,
4706,
3646,
29918,
667,
353,
304,
29883,
29889,
2886,
29918,
24957,
29918,
667,
29898,
667,
29897,
13,
1678,
565,
3646,
29918,
667,
338,
6213,
29901,
13,
4706,
736,
6213,
13,
1678,
1203,
353,
679,
29918,
1445,
29918,
1609,
29918,
667,
29898,
5182,
29918,
667,
29892,
1842,
29897,
13,
1678,
736,
1203,
13,
13,
13,
595,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
11117,
689,
2396,
1454,
29880,
3143,
13,
1678,
321,
5467,
2248,
13,
1678,
304,
29883,
353,
4544,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29897,
13,
1678,
565,
304,
29883,
29901,
13,
4706,
363,
260,
297,
304,
29883,
29901,
13,
1678,
4175,
29898,
10867,
29922,
3225,
29897,
13,
1678,
565,
304,
29883,
29901,
13,
4706,
363,
260,
297,
304,
29883,
29901,
13,
9651,
260,
29889,
8143,
580,
13,
13,
1678,
396,
21267,
599,
278,
11949,
354,
1691,
297,
278,
3143,
13,
1678,
5997,
353,
624,
5577,
4155,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29897,
13,
1678,
565,
5997,
29901,
13,
4706,
363,
274,
297,
5997,
29901,
13,
9651,
274,
29889,
8143,
580,
13,
13,
1678,
396,
21267,
599,
278,
4558,
297,
278,
3143,
13,
1678,
4558,
353,
7084,
2283,
29889,
12650,
29889,
4572,
29898,
10867,
29922,
3225,
29897,
13,
1678,
565,
4558,
29901,
13,
4706,
363,
474,
297,
4558,
29901,
13,
9651,
474,
29889,
8143,
580,
13,
13,
1678,
396,
21267,
278,
3143,
3528,
13,
1678,
1842,
29889,
8143,
580,
13,
13,
1753,
903,
657,
29918,
3225,
29898,
3827,
29892,
3611,
29892,
1820,
29892,
5712,
29918,
20348,
29922,
8824,
29892,
1661,
346,
29922,
8516,
1125,
13,
1678,
14550,
11609,
263,
1842,
491,
1178,
322,
12271,
29889,
29871,
21605,
5712,
29918,
20348,
13,
1678,
674,
2740,
17126,
310,
27428,
29892,
363,
671,
411,
4113,
15303,
29889,
12008,
13,
1678,
1404,
353,
337,
802,
342,
29889,
1792,
13,
13,
259,
584,
13,
4706,
565,
1842,
29889,
275,
29918,
5464,
346,
29918,
3084,
29898,
5464,
346,
1125,
13,
9651,
736,
1842,
13,
4706,
1683,
29901,
13,
9651,
1480,
29889,
2704,
703,
29954,
327,
385,
1518,
2859,
470,
8340,
1661,
346,
29901,
14210,
29879,
742,
1661,
346,
2433,
29995,
29879,
11838,
1273,
313,
3257,
29892,
1661,
346,
876,
13,
9651,
12020,
9056,
29946,
29900,
29946,
29876,
346,
385,
29937,
530,
11428,
4160,
508,
2360,
2130,
1661,
29899,
3597,
8277,
13,
1678,
565,
451,
1842,
29889,
275,
29918,
3597,
322,
1404,
29889,
275,
29918,
25772,
7295,
13,
4706,
1480,
29889,
2704,
877,
2744,
11428,
1404,
1898,
304,
2130,
1661,
29899,
3597,
1842,
1273,
29879,
29915,
1273,
313,
3225,
29889,
3257,
876,
13,
4706,
736,
6213,
13,
308,
13,
1678,
565,
451,
1842,
29889,
275,
29918,
3597,
322,
451,
5712,
29918,
20348,
322,
451,
1842,
29889,
275,
29918,
20348,
29898,
1792,
29897,
322,
275,
29918,
3597,
322,
451,
5712,
29918,
20348,
322,
1842,
29889,
20348,
2804,
1404,
322,
451,
1404,
29889,
275,
29918,
9136,
1792,
29901,
13,
4706,
1480,
29889,
2704,
877,
2659,
1273,
29879,
1898,
304,
2130,
1842,
1273,
29879,
29892,
607,
896,
437,
451,
1914,
29915,
1273,
313,
1792,
29892,
3611,
876,
13,
4706,
12020,
9056,
29946,
29900,
29946,
13,
13,
1678,
736,
1842,
13,
13,
1753,
903,
657,
29918,
3608,
29918,
12733,
29918,
3888,
29898,
3225,
29892,
2009,
1125,
13,
1678,
396,
10987,
599,
278,
3838,
297,
278,
3611,
322,
599,
278,
2983,
297,
278,
4148,
491,
24368,
373,
29871,
13,
1678,
396,
8162,
322,
844,
294,
13,
1678,
3611,
29918,
9303,
353,
1842,
29889,
3257,
29889,
6506,
29317,
742,
525,
2824,
5451,
877,
25710,
13,
1678,
4148,
29918,
9303,
353,
1842,
29889,
8921,
29889,
6506,
29317,
742,
525,
2824,
5451,
877,
25710,
13,
1678,
363,
260,
297,
3611,
29918,
9303,
29901,
13,
4706,
2346,
353,
525,
524,
1740,
16664,
29879,
23097,
1273,
3142,
1982,
29889,
1396,
29898,
29873,
29889,
12508,
877,
9420,
29947,
8785,
13,
1678,
363,
263,
297,
4148,
29918,
9303,
29901,
13,
4706,
2346,
4619,
525,
1099,
329,
2015,
16664,
29879,
23097,
1273,
3142,
1982,
29889,
1396,
29898,
29874,
29889,
12508,
877,
9420,
29947,
8785,
13,
1678,
565,
525,
1525,
29924,
2891,
29923,
29918,
3035,
8353,
29915,
297,
2009,
29889,
2303,
6040,
29901,
13,
4706,
7592,
29918,
10030,
353,
2009,
29889,
2303,
6040,
1839,
1525,
29924,
2891,
29923,
29918,
3035,
8353,
2033,
13,
1678,
1683,
29901,
13,
4706,
1083,
1753,
903,
12276,
29918,
2704,
29898,
3827,
29892,
1842,
29892,
848,
29892,
1404,
29918,
4906,
29892,
883,
29892,
3682,
29892,
4876,
29922,
8824,
1125,
13,
1678,
14550,
13020,
385,
1059,
411,
385,
20373,
3143,
304,
278,
1404,
29889,
13,
13,
1678,
830,
5958,
29901,
13,
418,
448,
450,
2009,
1203,
13,
418,
448,
450,
1842,
1203,
2825,
313,
14043,
367,
11132,
29897,
13,
418,
448,
450,
848,
20373,
491,
278,
1404,
13,
418,
448,
319,
2643,
304,
278,
1404,
29871,
13,
418,
448,
450,
883,
13,
418,
448,
450,
3682,
10425,
13,
13,
1678,
21605,
525,
5269,
29915,
304,
5852,
674,
3638,
263,
2643,
304,
278,
995,
3342,
13,
1678,
297,
6055,
29889,
11432,
29918,
26862,
6227,
29918,
1525,
8426,
2227,
3919,
29903,
313,
1609,
2322,
445,
338,
278,
937,
13,
1678,
4113,
297,
6055,
29889,
3035,
16173,
29903,
467,
259,
13,
1678,
14550,
13,
1678,
1480,
29889,
2704,
29898,
11739,
29897,
13,
1678,
1842,
29889,
8143,
580,
13,
1678,
565,
4876,
29901,
13,
4706,
396,
22608,
372,
304,
278,
7336,
1144,
13,
4706,
903,
5269,
29918,
12523,
29918,
517,
29918,
6406,
29898,
11739,
29892,
848,
29892,
1842,
29897,
13,
13,
1678,
736,
1513,
29918,
517,
29918,
6886,
29898,
3827,
29892,
525,
9009,
29889,
1420,
742,
426,
525,
689,
2396,
689,
29892,
525,
4906,
2396,
1792,
29918,
4906,
1800,
268,
13,
13,
462,
1669,
13,
1753,
903,
5269,
29918,
12523,
29918,
517,
29918,
6406,
29898,
11739,
29892,
848,
29892,
1842,
1125,
13,
1678,
14550,
12600,
626,
4876,
304,
278,
4160,
15443,
304,
7150,
1438,
7191,
313,
1552,
995,
310,
13,
1678,
6055,
29889,
11432,
29918,
26862,
6227,
29918,
1525,
8426,
2227,
3919,
29903,
313,
1609,
2322,
445,
338,
278,
937,
4113,
297,
6055,
29889,
3035,
16173,
29903,
467,
259,
13,
1678,
14550,
13,
1678,
396,
22608,
372,
304,
278,
7336,
1144,
13,
1678,
2643,
353,
903,
11739,
29918,
4906,
29898,
11739,
29897,
13,
13,
1678,
4876,
353,
22608,
3728,
29898,
29884,
29915,
29961,
2909,
29893,
555,
29899,
2704,
29962,
1273,
29879,
313,
2909,
16328,
29879,
16029,
1273,
313,
4906,
29892,
1842,
29889,
978,
511,
13,
462,
308,
6055,
29889,
1525,
7390,
29979,
4986,
29918,
26862,
6227,
29892,
13,
462,
308,
6055,
29889,
11432,
29918,
26862,
6227,
29918,
1525,
8426,
2227,
3919,
29903,
29897,
13,
1678,
4876,
29889,
14930,
29898,
3225,
29889,
978,
29892,
848,
29892,
321,
5467,
29918,
3075,
1934,
29889,
29924,
8890,
11116,
29897,
13,
13,
13,
1753,
903,
11739,
29918,
4906,
29898,
11739,
1125,
13,
1678,
14550,
11609,
29104,
1347,
515,
3682,
29889,
12008,
13,
13,
1678,
1018,
29901,
13,
4706,
736,
3682,
17255,
2523,
356,
1649,
580,
268,
396,
5132,
29871,
29906,
29889,
29953,
13,
1678,
5174,
23833,
2392,
29901,
13,
4706,
736,
29104,
29898,
11739,
29889,
4906,
29897,
29871,
396,
5132,
29871,
29906,
29889,
29945,
13,
13,
13,
13,
2
] |
apps/04_journal/program.py | derrickyoo/python-jumpstart | 0 | 196818 | <gh_stars>0
import journal
def main():
print_header()
run_event_loop()
pass
def print_header():
print('------------------------------------------')
print(' Personal Journal App ')
print('------------------------------------------')
print()
def run_event_loop():
cmd = 'EMPTY'
journal_name = 'default'
journal_data = journal.load(journal_name)
while cmd != 'x' and cmd:
cmd = input('What do you want to do? [L]ist, [A]dd, or E[x]it? ')
cmd = cmd.lower().strip()
if cmd == 'l':
list_entries(journal_data)
elif cmd == 'a':
add_entry(journal_data)
elif cmd != 'x' and cmd:
print('Sorry, we don\'t understand {}'.format(cmd))
print('Done, goodbye.')
journal.save(journal_name, journal_data)
def list_entries(data):
print('Your journal entries: ')
entries = reversed(data)
for idx, entry in enumerate(entries):
print('* [{0}] - {1}'.format(idx+1, entry))
def add_entry(data):
text = input('Type your entry, <enter> to exit: ')
journal.add_entry(text, data)
if __name__ == '__main__':
main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
8955,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
1596,
29918,
6672,
580,
13,
1678,
1065,
29918,
3696,
29918,
7888,
580,
13,
1678,
1209,
13,
13,
13,
1753,
1596,
29918,
6672,
7295,
13,
1678,
1596,
877,
2683,
2683,
28400,
1495,
13,
1678,
1596,
877,
965,
16224,
8237,
2401,
965,
25710,
13,
1678,
1596,
877,
2683,
2683,
28400,
1495,
13,
1678,
1596,
580,
13,
13,
13,
1753,
1065,
29918,
3696,
29918,
7888,
7295,
13,
1678,
9920,
353,
525,
29923,
3580,
15631,
29915,
13,
1678,
8955,
29918,
978,
353,
525,
4381,
29915,
13,
1678,
8955,
29918,
1272,
353,
8955,
29889,
1359,
29898,
29926,
4659,
29918,
978,
29897,
13,
13,
1678,
1550,
9920,
2804,
525,
29916,
29915,
322,
9920,
29901,
13,
4706,
9920,
353,
1881,
877,
5618,
437,
366,
864,
304,
437,
29973,
518,
29931,
29962,
391,
29892,
518,
29909,
29962,
1289,
29892,
470,
382,
29961,
29916,
29962,
277,
29973,
25710,
13,
4706,
9920,
353,
9920,
29889,
13609,
2141,
17010,
580,
13,
4706,
565,
9920,
1275,
525,
29880,
2396,
13,
9651,
1051,
29918,
26586,
29898,
29926,
4659,
29918,
1272,
29897,
13,
4706,
25342,
9920,
1275,
525,
29874,
2396,
13,
9651,
788,
29918,
8269,
29898,
29926,
4659,
29918,
1272,
29897,
13,
4706,
25342,
9920,
2804,
525,
29916,
29915,
322,
9920,
29901,
13,
9651,
1596,
877,
29903,
3818,
29892,
591,
1016,
20333,
29873,
2274,
6571,
4286,
4830,
29898,
9006,
876,
13,
13,
1678,
1596,
877,
25632,
29892,
1781,
26966,
29889,
1495,
13,
1678,
8955,
29889,
7620,
29898,
29926,
4659,
29918,
978,
29892,
8955,
29918,
1272,
29897,
13,
13,
13,
1753,
1051,
29918,
26586,
29898,
1272,
1125,
13,
1678,
1596,
877,
10858,
8955,
9976,
29901,
25710,
13,
1678,
9976,
353,
18764,
287,
29898,
1272,
29897,
13,
1678,
363,
22645,
29892,
6251,
297,
26985,
29898,
26586,
1125,
13,
4706,
1596,
877,
29930,
15974,
29900,
6525,
448,
426,
29896,
29913,
4286,
4830,
29898,
13140,
29974,
29896,
29892,
6251,
876,
13,
13,
13,
1753,
788,
29918,
8269,
29898,
1272,
1125,
13,
1678,
1426,
353,
1881,
877,
1542,
596,
6251,
29892,
529,
5893,
29958,
304,
6876,
29901,
25710,
13,
1678,
8955,
29889,
1202,
29918,
8269,
29898,
726,
29892,
848,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
puma/helpers/testing/logging/decorator.py | gift-surg/puma | 0 | 115315 | import functools
from typing import Any, Callable, TypeVar, Union, overload
from unittest import TestCase
from puma.context import Exit_1, Exit_2, Exit_3
from puma.helpers.testing.logging.capture_logs import CaptureLogs
from puma.logging import LogLevel
RT = TypeVar('RT') # _return type
@overload # noqa: F811
def assert_no_warnings_or_errors_logged(func_or_testcase: Callable[..., RT]) -> Callable[..., RT]:
"""A decorator that checks that no errors or warnings are logged within the scope.
For this to work, a logger must be configured at warning level to capture the log messages - this will usually be the case since default logging
is at warning level.
@assert_no_warnings_or_errors_logged
def do_something():
...
"""
...
@overload # noqa: F811
def assert_no_warnings_or_errors_logged(func_or_testcase: TestCase) -> 'AssertingCaptureLogs':
"""A function returning a context managed object which checks that no errors or warnings are logged within the scope.
For this to work, a logger must be configured at warning level to capture the log messages - this will usually be the case since default logging
is at warning level.
def do_something():
assert_no_warnings_or_errors_logged(self) as log_context:
...
"""
...
def assert_no_warnings_or_errors_logged(func_or_testcase: Union[Callable[..., RT], TestCase]) -> Union[Callable[..., RT], 'AssertingCaptureLogs']: # noqa: F811
"""Implementation of the assert_no_warnings_or_errors_logged overloads."""
if isinstance(func_or_testcase, TestCase):
return AssertingCaptureLogs(func_or_testcase)
elif callable(func_or_testcase):
return assert_no_warnings_or_errors_logged_decorator(func_or_testcase)
else:
raise TypeError("assert_no_warnings_or_errors_logged called with unsupported parameter type")
def assert_no_warnings_or_errors_logged_decorator(func: Callable[..., RT]) -> Callable[..., RT]:
"""A decorator that can be applied to test methods (i.e. methods of classes derived from TestCase). Causes a failure if the method logs any warning or error messages."""
@functools.wraps(func)
def wrapper(self: TestCase, *args: Any, **kwargs: Any) -> RT:
with AssertingCaptureLogs(self):
return func(self, *args, **kwargs)
return wrapper
class AssertingCaptureLogs(CaptureLogs):
def __init__(self, test_case: TestCase) -> None:
self._test_case = test_case
super().__init__(LogLevel.warn)
def __exit__(self, exc_type: Exit_1, exc_value: Exit_2, traceback: Exit_3) -> None:
records = self._context.pop_captured_records()
super().__exit__(exc_type, exc_value, traceback)
filtered_records = records.with_levels_in({LogLevel.warn, LogLevel.error, LogLevel.fatal})
if filtered_records:
lines = filtered_records.get_lines(timestamp=False)
self._test_case.fail(f"Unexpectedly raised warnings or errors: {lines}")
| [
1,
1053,
2090,
312,
8789,
13,
3166,
19229,
1053,
3139,
29892,
8251,
519,
29892,
5167,
9037,
29892,
7761,
29892,
975,
1359,
13,
3166,
443,
27958,
1053,
4321,
8259,
13,
13,
3166,
282,
10859,
29889,
4703,
1053,
25954,
29918,
29896,
29892,
25954,
29918,
29906,
29892,
25954,
29918,
29941,
13,
3166,
282,
10859,
29889,
3952,
6774,
29889,
13424,
29889,
21027,
29889,
17885,
545,
29918,
20756,
1053,
8868,
545,
3403,
29879,
13,
3166,
282,
10859,
29889,
21027,
1053,
4522,
10108,
13,
13,
13079,
353,
5167,
9037,
877,
13079,
1495,
29871,
396,
903,
2457,
1134,
13,
13,
13,
29992,
957,
1359,
29871,
396,
694,
25621,
29901,
383,
29947,
29896,
29896,
13,
1753,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
29898,
9891,
29918,
272,
29918,
1688,
4878,
29901,
8251,
519,
29961,
16361,
390,
29911,
2314,
1599,
8251,
519,
29961,
16361,
390,
29911,
5387,
13,
1678,
9995,
29909,
10200,
1061,
393,
12747,
393,
694,
4436,
470,
18116,
526,
13817,
2629,
278,
6874,
29889,
13,
13,
1678,
1152,
445,
304,
664,
29892,
263,
17927,
1818,
367,
13252,
472,
9177,
3233,
304,
10446,
278,
1480,
7191,
448,
29871,
445,
674,
5491,
367,
278,
1206,
1951,
2322,
12183,
13,
1678,
338,
472,
9177,
3233,
29889,
13,
13,
1678,
732,
9294,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
13,
1678,
822,
437,
29918,
14481,
7295,
13,
4706,
2023,
13,
1678,
9995,
13,
1678,
2023,
13,
13,
13,
29992,
957,
1359,
29871,
396,
694,
25621,
29901,
383,
29947,
29896,
29896,
13,
1753,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
29898,
9891,
29918,
272,
29918,
1688,
4878,
29901,
4321,
8259,
29897,
1599,
525,
2887,
643,
1259,
21133,
545,
3403,
29879,
2396,
13,
1678,
9995,
29909,
740,
7863,
263,
3030,
8745,
1203,
607,
12747,
393,
694,
4436,
470,
18116,
526,
13817,
2629,
278,
6874,
29889,
13,
13,
1678,
1152,
445,
304,
664,
29892,
263,
17927,
1818,
367,
13252,
472,
9177,
3233,
304,
10446,
278,
1480,
7191,
448,
29871,
445,
674,
5491,
367,
278,
1206,
1951,
2322,
12183,
13,
1678,
338,
472,
9177,
3233,
29889,
13,
13,
1678,
822,
437,
29918,
14481,
7295,
13,
4706,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
29898,
1311,
29897,
408,
1480,
29918,
4703,
29901,
13,
9651,
2023,
13,
1678,
9995,
13,
1678,
2023,
13,
13,
13,
1753,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
29898,
9891,
29918,
272,
29918,
1688,
4878,
29901,
7761,
29961,
5594,
519,
29961,
16361,
390,
29911,
1402,
4321,
8259,
2314,
1599,
7761,
29961,
5594,
519,
29961,
16361,
390,
29911,
1402,
525,
2887,
643,
1259,
21133,
545,
3403,
29879,
2033,
29901,
29871,
396,
694,
25621,
29901,
383,
29947,
29896,
29896,
13,
1678,
9995,
1888,
14607,
310,
278,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
975,
18132,
1213,
15945,
13,
1678,
565,
338,
8758,
29898,
9891,
29918,
272,
29918,
1688,
4878,
29892,
4321,
8259,
1125,
13,
4706,
736,
1094,
643,
1259,
21133,
545,
3403,
29879,
29898,
9891,
29918,
272,
29918,
1688,
4878,
29897,
13,
1678,
25342,
1246,
519,
29898,
9891,
29918,
272,
29918,
1688,
4878,
1125,
13,
4706,
736,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
29918,
19557,
1061,
29898,
9891,
29918,
272,
29918,
1688,
4878,
29897,
13,
1678,
1683,
29901,
13,
4706,
12020,
20948,
703,
9294,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
2000,
411,
443,
23765,
3443,
1134,
1159,
13,
13,
13,
1753,
4974,
29918,
1217,
29918,
25442,
886,
29918,
272,
29918,
12523,
29918,
1188,
3192,
29918,
19557,
1061,
29898,
9891,
29901,
8251,
519,
29961,
16361,
390,
29911,
2314,
1599,
8251,
519,
29961,
16361,
390,
29911,
5387,
13,
1678,
9995,
29909,
10200,
1061,
393,
508,
367,
7436,
304,
1243,
3519,
313,
29875,
29889,
29872,
29889,
3519,
310,
4413,
10723,
515,
4321,
8259,
467,
315,
1485,
267,
263,
10672,
565,
278,
1158,
10748,
738,
9177,
470,
1059,
7191,
1213,
15945,
13,
13,
1678,
732,
7692,
312,
8789,
29889,
29893,
336,
567,
29898,
9891,
29897,
13,
1678,
822,
14476,
29898,
1311,
29901,
4321,
8259,
29892,
334,
5085,
29901,
3139,
29892,
3579,
19290,
29901,
3139,
29897,
1599,
390,
29911,
29901,
13,
4706,
411,
1094,
643,
1259,
21133,
545,
3403,
29879,
29898,
1311,
1125,
13,
9651,
736,
3653,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
736,
14476,
13,
13,
13,
1990,
1094,
643,
1259,
21133,
545,
3403,
29879,
29898,
21133,
545,
3403,
29879,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1243,
29918,
4878,
29901,
4321,
8259,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
1688,
29918,
4878,
353,
1243,
29918,
4878,
13,
4706,
2428,
2141,
1649,
2344,
12035,
3403,
10108,
29889,
25442,
29897,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29901,
25954,
29918,
29896,
29892,
5566,
29918,
1767,
29901,
25954,
29918,
29906,
29892,
9637,
1627,
29901,
25954,
29918,
29941,
29897,
1599,
6213,
29901,
13,
4706,
6475,
353,
1583,
3032,
4703,
29889,
7323,
29918,
17885,
2955,
29918,
3757,
4339,
580,
13,
4706,
2428,
2141,
1649,
13322,
12035,
735,
29883,
29918,
1853,
29892,
5566,
29918,
1767,
29892,
9637,
1627,
29897,
13,
4706,
22289,
29918,
3757,
4339,
353,
6475,
29889,
2541,
29918,
5563,
29879,
29918,
262,
3319,
3403,
10108,
29889,
25442,
29892,
4522,
10108,
29889,
2704,
29892,
4522,
10108,
29889,
29888,
2075,
1800,
13,
4706,
565,
22289,
29918,
3757,
4339,
29901,
13,
9651,
3454,
353,
22289,
29918,
3757,
4339,
29889,
657,
29918,
9012,
29898,
16394,
29922,
8824,
29897,
13,
9651,
1583,
3032,
1688,
29918,
4878,
29889,
14057,
29898,
29888,
29908,
29965,
13996,
6021,
368,
10425,
18116,
470,
4436,
29901,
426,
9012,
27195,
13,
2
] |
APIs/Telegram API/telethon/crypto/authkey.py | Gregor-Davies/Awesome-Scripts-1 | 141 | 193634 | """
This module holds the AuthKey class.
"""
import struct
from hashlib import sha1
from ..extensions import BinaryReader
class AuthKey:
"""
Represents an authorization key, used to encrypt and decrypt
messages sent to Telegram's data centers.
"""
def __init__(self, data):
"""
Initializes a new authorization key.
:param data: the data in bytes that represent this auth key.
"""
self.key = data
@property
def key(self):
"""
Returns the key of the key.
Args:
self: (todo): write your description
"""
return self._key
@key.setter
def key(self, value):
"""
Return the private key for the value.
Args:
self: (todo): write your description
value: (todo): write your description
"""
if not value:
self._key = self.aux_hash = self.key_id = None
return
if isinstance(value, type(self)):
self._key, self.aux_hash, self.key_id = \
value._key, value.aux_hash, value.key_id
return
self._key = value
with BinaryReader(sha1(self._key).digest()) as reader:
self.aux_hash = reader.read_long(signed=False)
reader.read(4)
self.key_id = reader.read_long(signed=False)
# TODO This doesn't really fit here, it's only used in authentication
def calc_new_nonce_hash(self, new_nonce, number):
"""
Calculates the new nonce hash based on the current attributes.
:param new_nonce: the new nonce to be hashed.
:param number: number to prepend before the hash.
:return: the hash for the given new nonce.
"""
new_nonce = new_nonce.to_bytes(32, 'little', signed=True)
data = new_nonce + struct.pack('<BQ', number, self.aux_hash)
# Calculates the message key from the given data
return int.from_bytes(sha1(data).digest()[4:20], 'little', signed=True)
def __bool__(self):
"""
Returns true if the boolean is true false otherwise.
Args:
self: (todo): write your description
"""
return bool(self._key)
def __eq__(self, other):
"""
Return true if other is equal to other.
Args:
self: (todo): write your description
other: (todo): write your description
"""
return isinstance(other, type(self)) and other.key == self._key
| [
1,
9995,
13,
4013,
3883,
8640,
278,
13189,
2558,
770,
29889,
13,
15945,
29908,
13,
5215,
2281,
13,
3166,
6608,
1982,
1053,
528,
29874,
29896,
13,
13,
3166,
6317,
24299,
1053,
29479,
6982,
13,
13,
13,
1990,
13189,
2558,
29901,
13,
1678,
9995,
13,
1678,
830,
4569,
1237,
385,
28733,
1820,
29892,
1304,
304,
27924,
322,
1602,
4641,
13,
1678,
7191,
2665,
304,
9699,
1393,
29915,
29879,
848,
1644,
414,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
848,
1125,
13,
4706,
9995,
13,
4706,
17250,
7093,
263,
716,
28733,
1820,
29889,
13,
13,
4706,
584,
3207,
848,
29901,
278,
848,
297,
6262,
393,
2755,
445,
4817,
1820,
29889,
13,
4706,
9995,
13,
4706,
1583,
29889,
1989,
353,
848,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1820,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
16969,
278,
1820,
310,
278,
1820,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1583,
29901,
313,
29873,
8144,
1125,
2436,
596,
6139,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
1989,
13,
13,
1678,
732,
1989,
29889,
842,
357,
13,
1678,
822,
1820,
29898,
1311,
29892,
995,
1125,
13,
4706,
9995,
13,
4706,
7106,
278,
2024,
1820,
363,
278,
995,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1583,
29901,
313,
29873,
8144,
1125,
2436,
596,
6139,
13,
9651,
995,
29901,
313,
29873,
8144,
1125,
2436,
596,
6139,
13,
4706,
9995,
13,
4706,
565,
451,
995,
29901,
13,
9651,
1583,
3032,
1989,
353,
1583,
29889,
2993,
29918,
8568,
353,
1583,
29889,
1989,
29918,
333,
353,
6213,
13,
9651,
736,
13,
13,
4706,
565,
338,
8758,
29898,
1767,
29892,
1134,
29898,
1311,
22164,
13,
9651,
1583,
3032,
1989,
29892,
1583,
29889,
2993,
29918,
8568,
29892,
1583,
29889,
1989,
29918,
333,
353,
320,
13,
18884,
995,
3032,
1989,
29892,
995,
29889,
2993,
29918,
8568,
29892,
995,
29889,
1989,
29918,
333,
13,
9651,
736,
13,
13,
4706,
1583,
3032,
1989,
353,
995,
13,
4706,
411,
29479,
6982,
29898,
17051,
29896,
29898,
1311,
3032,
1989,
467,
7501,
342,
3101,
408,
9591,
29901,
13,
9651,
1583,
29889,
2993,
29918,
8568,
353,
9591,
29889,
949,
29918,
5426,
29898,
7433,
29922,
8824,
29897,
13,
9651,
9591,
29889,
949,
29898,
29946,
29897,
13,
9651,
1583,
29889,
1989,
29918,
333,
353,
9591,
29889,
949,
29918,
5426,
29898,
7433,
29922,
8824,
29897,
13,
13,
1678,
396,
14402,
910,
1838,
29915,
29873,
2289,
6216,
1244,
29892,
372,
29915,
29879,
871,
1304,
297,
10760,
13,
1678,
822,
22235,
29918,
1482,
29918,
5464,
346,
29918,
8568,
29898,
1311,
29892,
716,
29918,
5464,
346,
29892,
1353,
1125,
13,
4706,
9995,
13,
4706,
20535,
1078,
278,
716,
1661,
346,
6608,
2729,
373,
278,
1857,
8393,
29889,
13,
13,
4706,
584,
3207,
716,
29918,
5464,
346,
29901,
278,
716,
1661,
346,
304,
367,
6608,
287,
29889,
13,
4706,
584,
3207,
1353,
29901,
1353,
304,
8273,
355,
1434,
278,
6608,
29889,
13,
4706,
584,
2457,
29901,
278,
6608,
363,
278,
2183,
716,
1661,
346,
29889,
13,
4706,
9995,
13,
4706,
716,
29918,
5464,
346,
353,
716,
29918,
5464,
346,
29889,
517,
29918,
13193,
29898,
29941,
29906,
29892,
525,
29880,
1992,
742,
8794,
29922,
5574,
29897,
13,
4706,
848,
353,
716,
29918,
5464,
346,
718,
2281,
29889,
4058,
877,
29966,
29933,
29984,
742,
1353,
29892,
1583,
29889,
2993,
29918,
8568,
29897,
13,
13,
4706,
396,
20535,
1078,
278,
2643,
1820,
515,
278,
2183,
848,
13,
4706,
736,
938,
29889,
3166,
29918,
13193,
29898,
17051,
29896,
29898,
1272,
467,
7501,
342,
580,
29961,
29946,
29901,
29906,
29900,
1402,
525,
29880,
1992,
742,
8794,
29922,
5574,
29897,
13,
13,
1678,
822,
4770,
11227,
12035,
1311,
1125,
13,
4706,
9995,
13,
4706,
16969,
1565,
565,
278,
7223,
338,
1565,
2089,
6467,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1583,
29901,
313,
29873,
8144,
1125,
2436,
596,
6139,
13,
4706,
9995,
13,
4706,
736,
6120,
29898,
1311,
3032,
1989,
29897,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
9995,
13,
4706,
7106,
1565,
565,
916,
338,
5186,
304,
916,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1583,
29901,
313,
29873,
8144,
1125,
2436,
596,
6139,
13,
9651,
916,
29901,
313,
29873,
8144,
1125,
2436,
596,
6139,
13,
4706,
9995,
13,
4706,
736,
338,
8758,
29898,
1228,
29892,
1134,
29898,
1311,
876,
322,
916,
29889,
1989,
1275,
1583,
3032,
1989,
13,
2
] |
python/unittest/maximumElementAfterDecrementingAndRearranging.py | geyuqiu/kata-bootstraps | 0 | 120214 | from typing import List
class MaximumElementAfterDecrementingAndRearranging:
def maximumElementAfterDecrementingAndRearranging(self, arr: List[int]) -> int:
N = len(arr)
arr.sort()
if (arr[0] > 1):
arr[0] = 1
for i in range(1, N):
if (abs(arr[i] - arr[i - 1]) > 1):
arr[i] = arr[i - 1] + 1
return max(arr) | [
1,
515,
19229,
1053,
2391,
13,
13,
1990,
5918,
12539,
2642,
13555,
6185,
276,
358,
292,
2855,
29934,
799,
29878,
9776,
29901,
13,
1678,
822,
7472,
2642,
13555,
6185,
276,
358,
292,
2855,
29934,
799,
29878,
9776,
29898,
1311,
29892,
3948,
29901,
2391,
29961,
524,
2314,
1599,
938,
29901,
13,
13,
4706,
405,
353,
7431,
29898,
2749,
29897,
13,
4706,
3948,
29889,
6605,
580,
13,
4706,
565,
313,
2749,
29961,
29900,
29962,
1405,
29871,
29896,
1125,
13,
9651,
3948,
29961,
29900,
29962,
353,
29871,
29896,
13,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
405,
1125,
13,
9651,
565,
313,
6897,
29898,
2749,
29961,
29875,
29962,
448,
3948,
29961,
29875,
448,
29871,
29896,
2314,
1405,
29871,
29896,
1125,
13,
18884,
3948,
29961,
29875,
29962,
353,
3948,
29961,
29875,
448,
29871,
29896,
29962,
718,
29871,
29896,
13,
13,
4706,
736,
4236,
29898,
2749,
29897,
2
] |
sdk/python/pulumi_aws/secretsmanager/outputs.py | RafalSumislawski/pulumi-aws | 260 | 85590 | <filename>sdk/python/pulumi_aws/secretsmanager/outputs.py<gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'SecretReplica',
'SecretRotationRotationRules',
'SecretRotationRules',
'GetSecretRotationRotationRuleResult',
'GetSecretRotationRuleResult',
]
@pulumi.output_type
class SecretReplica(dict):
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "kmsKeyId":
suggest = "kms_key_id"
elif key == "lastAccessedDate":
suggest = "last_accessed_date"
elif key == "statusMessage":
suggest = "status_message"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in SecretReplica. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
SecretReplica.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
SecretReplica.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
region: str,
kms_key_id: Optional[str] = None,
last_accessed_date: Optional[str] = None,
status: Optional[str] = None,
status_message: Optional[str] = None):
"""
:param str region: Region for replicating the secret.
:param str kms_key_id: ARN, Key ID, or Alias.
:param str last_accessed_date: Date that you last accessed the secret in the Region.
:param str status: Status can be `InProgress`, `Failed`, or `InSync`.
:param str status_message: Message such as `Replication succeeded` or `Secret with this name already exists in this region`.
"""
pulumi.set(__self__, "region", region)
if kms_key_id is not None:
pulumi.set(__self__, "kms_key_id", kms_key_id)
if last_accessed_date is not None:
pulumi.set(__self__, "last_accessed_date", last_accessed_date)
if status is not None:
pulumi.set(__self__, "status", status)
if status_message is not None:
pulumi.set(__self__, "status_message", status_message)
@property
@pulumi.getter
def region(self) -> str:
"""
Region for replicating the secret.
"""
return pulumi.get(self, "region")
@property
@pulumi.getter(name="kmsKeyId")
def kms_key_id(self) -> Optional[str]:
"""
ARN, Key ID, or Alias.
"""
return pulumi.get(self, "kms_key_id")
@property
@pulumi.getter(name="lastAccessedDate")
def last_accessed_date(self) -> Optional[str]:
"""
Date that you last accessed the secret in the Region.
"""
return pulumi.get(self, "last_accessed_date")
@property
@pulumi.getter
def status(self) -> Optional[str]:
"""
Status can be `InProgress`, `Failed`, or `InSync`.
"""
return pulumi.get(self, "status")
@property
@pulumi.getter(name="statusMessage")
def status_message(self) -> Optional[str]:
"""
Message such as `Replication succeeded` or `Secret with this name already exists in this region`.
"""
return pulumi.get(self, "status_message")
@pulumi.output_type
class SecretRotationRotationRules(dict):
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "automaticallyAfterDays":
suggest = "automatically_after_days"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in SecretRotationRotationRules. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
SecretRotationRotationRules.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
SecretRotationRotationRules.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
automatically_after_days: int):
"""
:param int automatically_after_days: Specifies the number of days between automatic scheduled rotations of the secret.
"""
pulumi.set(__self__, "automatically_after_days", automatically_after_days)
@property
@pulumi.getter(name="automaticallyAfterDays")
def automatically_after_days(self) -> int:
"""
Specifies the number of days between automatic scheduled rotations of the secret.
"""
return pulumi.get(self, "automatically_after_days")
@pulumi.output_type
class SecretRotationRules(dict):
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "automaticallyAfterDays":
suggest = "automatically_after_days"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in SecretRotationRules. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
SecretRotationRules.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
SecretRotationRules.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
automatically_after_days: int):
"""
:param int automatically_after_days: Specifies the number of days between automatic scheduled rotations of the secret.
"""
pulumi.set(__self__, "automatically_after_days", automatically_after_days)
@property
@pulumi.getter(name="automaticallyAfterDays")
def automatically_after_days(self) -> int:
"""
Specifies the number of days between automatic scheduled rotations of the secret.
"""
return pulumi.get(self, "automatically_after_days")
@pulumi.output_type
class GetSecretRotationRotationRuleResult(dict):
def __init__(__self__, *,
automatically_after_days: int):
pulumi.set(__self__, "automatically_after_days", automatically_after_days)
@property
@pulumi.getter(name="automaticallyAfterDays")
def automatically_after_days(self) -> int:
return pulumi.get(self, "automatically_after_days")
@pulumi.output_type
class GetSecretRotationRuleResult(dict):
def __init__(__self__, *,
automatically_after_days: int):
pulumi.set(__self__, "automatically_after_days", automatically_after_days)
@property
@pulumi.getter(name="automaticallyAfterDays")
def automatically_after_days(self) -> int:
return pulumi.get(self, "automatically_after_days")
| [
1,
529,
9507,
29958,
15348,
29914,
4691,
29914,
29886,
352,
15547,
29918,
10467,
29914,
344,
1037,
1372,
12847,
29914,
4905,
29879,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
29937,
14137,
29922,
9420,
29899,
29947,
13,
29937,
18610,
399,
25614,
29901,
445,
934,
471,
5759,
491,
278,
27477,
15547,
20839,
689,
16230,
313,
13264,
1885,
29897,
21704,
29889,
18610,
13,
29937,
18610,
1938,
451,
3863,
491,
1361,
6521,
366,
29915,
276,
3058,
366,
1073,
825,
366,
526,
2599,
29991,
18610,
13,
13,
5215,
18116,
13,
5215,
9505,
15547,
13,
5215,
9505,
15547,
29889,
15634,
13,
3166,
19229,
1053,
3139,
29892,
341,
20304,
29892,
28379,
29892,
922,
3910,
29892,
7761,
29892,
975,
1359,
13,
3166,
6317,
1053,
903,
4422,
1907,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
525,
28459,
5612,
10123,
742,
13,
1678,
525,
28459,
21281,
362,
21281,
362,
29934,
2540,
742,
13,
1678,
525,
28459,
21281,
362,
29934,
2540,
742,
13,
1678,
525,
2577,
28459,
21281,
362,
21281,
362,
10740,
3591,
742,
13,
1678,
525,
2577,
28459,
21281,
362,
10740,
3591,
742,
13,
29962,
13,
13,
29992,
29886,
352,
15547,
29889,
4905,
29918,
1853,
13,
1990,
10213,
5612,
10123,
29898,
8977,
1125,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
4770,
1989,
29918,
27392,
29898,
1989,
29901,
851,
1125,
13,
4706,
4368,
353,
6213,
13,
4706,
565,
1820,
1275,
376,
29895,
1516,
2558,
1204,
1115,
13,
9651,
4368,
353,
376,
29895,
1516,
29918,
1989,
29918,
333,
29908,
13,
4706,
25342,
1820,
1275,
376,
4230,
6638,
287,
2539,
1115,
13,
9651,
4368,
353,
376,
4230,
29918,
5943,
287,
29918,
1256,
29908,
13,
4706,
25342,
1820,
1275,
376,
4882,
3728,
1115,
13,
9651,
4368,
353,
376,
4882,
29918,
4906,
29908,
13,
13,
4706,
565,
4368,
29901,
13,
9651,
9505,
15547,
29889,
1188,
29889,
25442,
29898,
29888,
29908,
2558,
22372,
1989,
10162,
451,
1476,
297,
10213,
5612,
10123,
29889,
11028,
278,
995,
3025,
278,
22372,
29879,
688,
7118,
10162,
2875,
679,
357,
2012,
23157,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
1820,
29901,
851,
29897,
1599,
3139,
29901,
13,
4706,
10213,
5612,
10123,
17255,
1989,
29918,
27392,
29898,
1989,
29897,
13,
4706,
736,
2428,
2141,
1649,
657,
667,
12035,
1989,
29897,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
1820,
29901,
851,
29892,
2322,
353,
6213,
29897,
1599,
3139,
29901,
13,
4706,
10213,
5612,
10123,
17255,
1989,
29918,
27392,
29898,
1989,
29897,
13,
4706,
736,
2428,
2141,
657,
29898,
1989,
29892,
2322,
29897,
13,
13,
1678,
822,
4770,
2344,
12035,
1649,
1311,
1649,
29892,
334,
29892,
13,
462,
5120,
29901,
851,
29892,
13,
462,
413,
1516,
29918,
1989,
29918,
333,
29901,
28379,
29961,
710,
29962,
353,
6213,
29892,
13,
462,
1833,
29918,
5943,
287,
29918,
1256,
29901,
28379,
29961,
710,
29962,
353,
6213,
29892,
13,
462,
4660,
29901,
28379,
29961,
710,
29962,
353,
6213,
29892,
13,
462,
4660,
29918,
4906,
29901,
28379,
29961,
710,
29962,
353,
6213,
1125,
13,
4706,
9995,
13,
4706,
584,
3207,
851,
5120,
29901,
11069,
363,
1634,
506,
1218,
278,
7035,
29889,
13,
4706,
584,
3207,
851,
413,
1516,
29918,
1989,
29918,
333,
29901,
9033,
29940,
29892,
7670,
3553,
29892,
470,
10785,
294,
29889,
13,
4706,
584,
3207,
851,
1833,
29918,
5943,
287,
29918,
1256,
29901,
4712,
393,
366,
1833,
20592,
278,
7035,
297,
278,
11069,
29889,
13,
4706,
584,
3207,
851,
4660,
29901,
16034,
508,
367,
421,
797,
14470,
1673,
421,
17776,
1673,
470,
421,
797,
21077,
1412,
13,
4706,
584,
3207,
851,
4660,
29918,
4906,
29901,
7777,
1316,
408,
421,
5612,
1414,
14792,
29952,
470,
421,
28459,
411,
445,
1024,
2307,
4864,
297,
445,
5120,
1412,
13,
4706,
9995,
13,
4706,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
12803,
613,
5120,
29897,
13,
4706,
565,
413,
1516,
29918,
1989,
29918,
333,
338,
451,
6213,
29901,
13,
9651,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
29895,
1516,
29918,
1989,
29918,
333,
613,
413,
1516,
29918,
1989,
29918,
333,
29897,
13,
4706,
565,
1833,
29918,
5943,
287,
29918,
1256,
338,
451,
6213,
29901,
13,
9651,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
4230,
29918,
5943,
287,
29918,
1256,
613,
1833,
29918,
5943,
287,
29918,
1256,
29897,
13,
4706,
565,
4660,
338,
451,
6213,
29901,
13,
9651,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
4882,
613,
4660,
29897,
13,
4706,
565,
4660,
29918,
4906,
338,
451,
6213,
29901,
13,
9651,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
4882,
29918,
4906,
613,
4660,
29918,
4906,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
13,
1678,
822,
5120,
29898,
1311,
29897,
1599,
851,
29901,
13,
4706,
9995,
13,
4706,
11069,
363,
1634,
506,
1218,
278,
7035,
29889,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
12803,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
29895,
1516,
2558,
1204,
1159,
13,
1678,
822,
413,
1516,
29918,
1989,
29918,
333,
29898,
1311,
29897,
1599,
28379,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
9033,
29940,
29892,
7670,
3553,
29892,
470,
10785,
294,
29889,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
29895,
1516,
29918,
1989,
29918,
333,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
4230,
6638,
287,
2539,
1159,
13,
1678,
822,
1833,
29918,
5943,
287,
29918,
1256,
29898,
1311,
29897,
1599,
28379,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
4712,
393,
366,
1833,
20592,
278,
7035,
297,
278,
11069,
29889,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
4230,
29918,
5943,
287,
29918,
1256,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
13,
1678,
822,
4660,
29898,
1311,
29897,
1599,
28379,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
16034,
508,
367,
421,
797,
14470,
1673,
421,
17776,
1673,
470,
421,
797,
21077,
1412,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
4882,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
4882,
3728,
1159,
13,
1678,
822,
4660,
29918,
4906,
29898,
1311,
29897,
1599,
28379,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
7777,
1316,
408,
421,
5612,
1414,
14792,
29952,
470,
421,
28459,
411,
445,
1024,
2307,
4864,
297,
445,
5120,
1412,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
4882,
29918,
4906,
1159,
13,
13,
13,
29992,
29886,
352,
15547,
29889,
4905,
29918,
1853,
13,
1990,
10213,
21281,
362,
21281,
362,
29934,
2540,
29898,
8977,
1125,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
4770,
1989,
29918,
27392,
29898,
1989,
29901,
851,
1125,
13,
4706,
4368,
353,
6213,
13,
4706,
565,
1820,
1275,
376,
17405,
19574,
13555,
25991,
1115,
13,
9651,
4368,
353,
376,
17405,
19574,
29918,
7045,
29918,
16700,
29908,
13,
13,
4706,
565,
4368,
29901,
13,
9651,
9505,
15547,
29889,
1188,
29889,
25442,
29898,
29888,
29908,
2558,
22372,
1989,
10162,
451,
1476,
297,
10213,
21281,
362,
21281,
362,
29934,
2540,
29889,
11028,
278,
995,
3025,
278,
22372,
29879,
688,
7118,
10162,
2875,
679,
357,
2012,
23157,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
1820,
29901,
851,
29897,
1599,
3139,
29901,
13,
4706,
10213,
21281,
362,
21281,
362,
29934,
2540,
17255,
1989,
29918,
27392,
29898,
1989,
29897,
13,
4706,
736,
2428,
2141,
1649,
657,
667,
12035,
1989,
29897,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
1820,
29901,
851,
29892,
2322,
353,
6213,
29897,
1599,
3139,
29901,
13,
4706,
10213,
21281,
362,
21281,
362,
29934,
2540,
17255,
1989,
29918,
27392,
29898,
1989,
29897,
13,
4706,
736,
2428,
2141,
657,
29898,
1989,
29892,
2322,
29897,
13,
13,
1678,
822,
4770,
2344,
12035,
1649,
1311,
1649,
29892,
334,
29892,
13,
462,
6336,
29918,
7045,
29918,
16700,
29901,
938,
1125,
13,
4706,
9995,
13,
4706,
584,
3207,
938,
6336,
29918,
7045,
29918,
16700,
29901,
12048,
11057,
278,
1353,
310,
3841,
1546,
18428,
21467,
5731,
800,
310,
278,
7035,
29889,
13,
4706,
9995,
13,
4706,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
613,
6336,
29918,
7045,
29918,
16700,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
17405,
19574,
13555,
25991,
1159,
13,
1678,
822,
6336,
29918,
7045,
29918,
16700,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
13,
4706,
12048,
11057,
278,
1353,
310,
3841,
1546,
18428,
21467,
5731,
800,
310,
278,
7035,
29889,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
1159,
13,
13,
13,
29992,
29886,
352,
15547,
29889,
4905,
29918,
1853,
13,
1990,
10213,
21281,
362,
29934,
2540,
29898,
8977,
1125,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
4770,
1989,
29918,
27392,
29898,
1989,
29901,
851,
1125,
13,
4706,
4368,
353,
6213,
13,
4706,
565,
1820,
1275,
376,
17405,
19574,
13555,
25991,
1115,
13,
9651,
4368,
353,
376,
17405,
19574,
29918,
7045,
29918,
16700,
29908,
13,
13,
4706,
565,
4368,
29901,
13,
9651,
9505,
15547,
29889,
1188,
29889,
25442,
29898,
29888,
29908,
2558,
22372,
1989,
10162,
451,
1476,
297,
10213,
21281,
362,
29934,
2540,
29889,
11028,
278,
995,
3025,
278,
22372,
29879,
688,
7118,
10162,
2875,
679,
357,
2012,
23157,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
1820,
29901,
851,
29897,
1599,
3139,
29901,
13,
4706,
10213,
21281,
362,
29934,
2540,
17255,
1989,
29918,
27392,
29898,
1989,
29897,
13,
4706,
736,
2428,
2141,
1649,
657,
667,
12035,
1989,
29897,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
1820,
29901,
851,
29892,
2322,
353,
6213,
29897,
1599,
3139,
29901,
13,
4706,
10213,
21281,
362,
29934,
2540,
17255,
1989,
29918,
27392,
29898,
1989,
29897,
13,
4706,
736,
2428,
2141,
657,
29898,
1989,
29892,
2322,
29897,
13,
13,
1678,
822,
4770,
2344,
12035,
1649,
1311,
1649,
29892,
334,
29892,
13,
462,
6336,
29918,
7045,
29918,
16700,
29901,
938,
1125,
13,
4706,
9995,
13,
4706,
584,
3207,
938,
6336,
29918,
7045,
29918,
16700,
29901,
12048,
11057,
278,
1353,
310,
3841,
1546,
18428,
21467,
5731,
800,
310,
278,
7035,
29889,
13,
4706,
9995,
13,
4706,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
613,
6336,
29918,
7045,
29918,
16700,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
17405,
19574,
13555,
25991,
1159,
13,
1678,
822,
6336,
29918,
7045,
29918,
16700,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
13,
4706,
12048,
11057,
278,
1353,
310,
3841,
1546,
18428,
21467,
5731,
800,
310,
278,
7035,
29889,
13,
4706,
9995,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
1159,
13,
13,
13,
29992,
29886,
352,
15547,
29889,
4905,
29918,
1853,
13,
1990,
3617,
28459,
21281,
362,
21281,
362,
10740,
3591,
29898,
8977,
1125,
13,
1678,
822,
4770,
2344,
12035,
1649,
1311,
1649,
29892,
334,
29892,
13,
462,
6336,
29918,
7045,
29918,
16700,
29901,
938,
1125,
13,
4706,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
613,
6336,
29918,
7045,
29918,
16700,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
17405,
19574,
13555,
25991,
1159,
13,
1678,
822,
6336,
29918,
7045,
29918,
16700,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
1159,
13,
13,
13,
29992,
29886,
352,
15547,
29889,
4905,
29918,
1853,
13,
1990,
3617,
28459,
21281,
362,
10740,
3591,
29898,
8977,
1125,
13,
1678,
822,
4770,
2344,
12035,
1649,
1311,
1649,
29892,
334,
29892,
13,
462,
6336,
29918,
7045,
29918,
16700,
29901,
938,
1125,
13,
4706,
9505,
15547,
29889,
842,
22168,
1311,
1649,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
613,
6336,
29918,
7045,
29918,
16700,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
732,
29886,
352,
15547,
29889,
657,
357,
29898,
978,
543,
17405,
19574,
13555,
25991,
1159,
13,
1678,
822,
6336,
29918,
7045,
29918,
16700,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
736,
9505,
15547,
29889,
657,
29898,
1311,
29892,
376,
17405,
19574,
29918,
7045,
29918,
16700,
1159,
13,
13,
13,
2
] |
home/ftp.py | Jiunan73/flask | 0 | 72376 | <filename>home/ftp.py
import time,os
from ftplib import FTP
fall_file=''
ir_file=''
def ftp_upload(filepath):
IP = '127.0.0.1'
user = 'johnlin'
password = '<PASSWORD>'
filename = os.path.basename(filepath)
ftp=FTP()
#ftp.set_debuglevel(2)
ftp.connect(IP)
ftp.login(user,password)
ftp.cwd("/home/johnlin/ftp")
ftp.storbinary('STOR %s'%filename, open(filepath, 'rb',8192))
print('success')
if __name__ == '__main__':
while True:
b=os.listdir('/home/pi/flask/static/ir_cam/20200807/AD-HF048-P-192.168.1.20')
a=sorted(b)
ir_path='/home/pi/flask/static/ir_cam/20200807/AD-HF048-P-192.168.1.20/'+a[len(a)-1]
if not ir_path==ir_file:
ftp_upload(ir_path)
ir_file=ir_path
b= os.listdir('/home/pi/flask/static/ir_cam/fall/')
for s in b:
if s.endswith('.jpg')==False:
print('del ',s)
b.remove(s)
a=sorted(b)
fall_path='/home/pi/flask/static/ir_cam/fall/'+a[len(a)-1]
print(fall_path)
if not fall_path==fall_file:
ftp_upload(fall_path)
fall_file=fall_path
time.sleep(5)
| [
1,
529,
9507,
29958,
5184,
29914,
23102,
29889,
2272,
13,
5215,
931,
29892,
359,
13,
3166,
285,
9392,
1982,
1053,
383,
3557,
13,
11950,
29918,
1445,
2433,
29915,
13,
381,
29918,
1445,
2433,
29915,
13,
1753,
285,
9392,
29918,
9009,
29898,
1445,
2084,
1125,
13,
12,
5690,
353,
525,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29915,
13,
12,
1792,
353,
525,
29926,
6547,
1915,
29915,
13,
12,
5630,
353,
12801,
25711,
17013,
16299,
13,
12,
9507,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
1445,
2084,
29897,
13,
12,
23102,
29922,
29943,
3557,
580,
13,
12,
29937,
23102,
29889,
842,
29918,
8382,
5563,
29898,
29906,
29897,
13,
12,
23102,
29889,
6915,
29898,
5690,
29897,
13,
12,
23102,
29889,
7507,
29898,
1792,
29892,
5630,
29897,
13,
12,
23102,
29889,
29883,
9970,
11974,
5184,
29914,
29926,
6547,
1915,
29914,
23102,
1159,
13,
12,
23102,
29889,
28957,
19541,
877,
1254,
1955,
1273,
29879,
29915,
29995,
9507,
29892,
1722,
29898,
1445,
2084,
29892,
525,
6050,
742,
29947,
29896,
29929,
29906,
876,
29871,
13,
12,
2158,
877,
8698,
1495,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
12,
8000,
5852,
29901,
13,
12,
12,
29890,
29922,
359,
29889,
1761,
3972,
11219,
5184,
29914,
1631,
29914,
1579,
1278,
29914,
7959,
29914,
381,
29918,
11108,
29914,
29906,
29900,
29906,
29900,
29900,
29947,
29900,
29955,
29914,
3035,
29899,
29950,
29943,
29900,
29946,
29947,
29899,
29925,
29899,
29896,
29929,
29906,
29889,
29896,
29953,
29947,
29889,
29896,
29889,
29906,
29900,
1495,
13,
12,
12,
29874,
29922,
24582,
29898,
29890,
29897,
13,
12,
12,
381,
29918,
2084,
2433,
29914,
5184,
29914,
1631,
29914,
1579,
1278,
29914,
7959,
29914,
381,
29918,
11108,
29914,
29906,
29900,
29906,
29900,
29900,
29947,
29900,
29955,
29914,
3035,
29899,
29950,
29943,
29900,
29946,
29947,
29899,
29925,
29899,
29896,
29929,
29906,
29889,
29896,
29953,
29947,
29889,
29896,
29889,
29906,
29900,
29914,
18717,
29874,
29961,
2435,
29898,
29874,
6817,
29896,
29962,
13,
12,
12,
361,
451,
3805,
29918,
2084,
1360,
381,
29918,
1445,
29901,
13,
12,
12,
12,
23102,
29918,
9009,
29898,
381,
29918,
2084,
29897,
13,
12,
12,
12,
381,
29918,
1445,
29922,
381,
29918,
2084,
13,
13,
12,
12,
29890,
29922,
2897,
29889,
1761,
3972,
11219,
5184,
29914,
1631,
29914,
1579,
1278,
29914,
7959,
29914,
381,
29918,
11108,
29914,
11950,
29914,
1495,
29871,
13,
12,
12,
1454,
269,
297,
289,
29901,
13,
12,
12,
12,
361,
269,
29889,
1975,
2541,
12839,
6173,
1495,
1360,
8824,
29901,
13,
12,
12,
12,
12,
2158,
877,
6144,
13420,
29879,
29897,
13,
12,
12,
12,
12,
29890,
29889,
5992,
29898,
29879,
29897,
13,
13,
12,
12,
29874,
29922,
24582,
29898,
29890,
29897,
13,
12,
12,
11950,
29918,
2084,
2433,
29914,
5184,
29914,
1631,
29914,
1579,
1278,
29914,
7959,
29914,
381,
29918,
11108,
29914,
11950,
29914,
18717,
29874,
29961,
2435,
29898,
29874,
6817,
29896,
29962,
13,
12,
12,
2158,
29898,
11950,
29918,
2084,
29897,
13,
12,
12,
361,
451,
6416,
29918,
2084,
1360,
11950,
29918,
1445,
29901,
13,
12,
12,
12,
23102,
29918,
9009,
29898,
11950,
29918,
2084,
29897,
13,
12,
12,
12,
11950,
29918,
1445,
29922,
11950,
29918,
2084,
13,
13,
12,
12,
2230,
29889,
17059,
29898,
29945,
29897,
13,
2
] |
lib/OSCP.py | streetlightvision/oscp-datalogger | 0 | 48341 | <filename>lib/OSCP.py
import sqlite3
import sys
import json
import datetime
import time
import xml.etree.ElementTree as ET
from lib.CMS import CMS
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
State = enum('INIT', 'CONNECT_LOCAL_DB', 'GATHER_DATA', 'DISCONNECT_LOCAL_DB', 'BUILD_MESSAGES', 'CMS_CONNECT', 'CMS_SEND_MESSAGES', 'CMS_DISCONNECT', 'UPDATE_LOCAL_DB', 'SLEEP')
class OSCP:
def __init__(self, config_file):
with open(config_file) as data_file:
config = json.load(data_file)
if 'debug' in config:
self.debug_flag = bool(config['debug'])
else:
self.debug_flag = True
if 'refresh_interval' in config:
self.refresh_interval = int(config['refresh_interval'])
else:
self.refresh_interval = 60
self.cms = CMS(config_file)
self.state = State.INIT
self.highest_id = 0
self.to_send = []
self.state_arr = [
self.init,
self.connect_local_db,
self.gather_data,
self.disconnect_local_db,
self.build_messages,
self.cms_connect,
self.cms_send_messages,
self.cms_disconnect,
self.update_local_db,
self.sleep
]
if self.debug_flag == True:
print('Debug: '+str(self.debug_flag))
def run(self):
print('Starting OSCP Gateway (Data Logger)...')
running = True
while running:
self.state_arr[self.state]()
def init(self):
self.debug('Initializing...')
self.debug('Loaded configuration file.')
self.state = State.CONNECT_LOCAL_DB
def connect_local_db(self):
self.debug('Connecting to local database (sqlite)...')
self.conn = sqlite3.connect('data.db', timeout=60)
cursor = self.conn.execute("SELECT name FROM sqlite_master WHERE type='table'")
found_data = False
found_info = False
for row in cursor:
if row[0] == 'oscp_data':
found_data = True
if row[0] == 'oscp_info':
found_info = True
if found_data == False:
print('Table `oscp_data` not found. Creating...')
self.conn.execute("""CREATE TABLE "oscp_data" (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`controllerStrId` TEXT NOT NULL,
`idOnController` TEXT NOT NULL,
`meaning` TEXT,
`value` TEXT NOT NULL,
`time` INTEGER NOT NULL
)""")
self.conn.commit()
if found_info == False:
print('Table `oscp_info` not found. Creating...')
self.conn.execute("""CREATE TABLE `oscp_info` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT NOT NULL,
`value` TEXT NOT NULL
)""")
self.conn.execute("INSERT INTO `oscp_info` (`name`, `value`) VALUES ('last_pushed', 0)")
self.conn.commit()
self.debug('Reading last `id` sent to CMS...')
cursor = self.conn.execute("SELECT `value` FROM `oscp_info` WHERE `name`='last_pushed'")
self.last_pushed = cursor.fetchone()[0]
self.state = State.GATHER_DATA
def gather_data(self):
self.debug('Looking for new data...')
cursor = self.conn.execute("SELECT `id`, `controllerStrId`, `idOnController`, `meaning`, `value`, `time` FROM `oscp_data` WHERE `id` > "+self.last_pushed)
for row in cursor:
if self.is_valid_entry(row) == True:
self.to_send.append(row)
self.state = State.DISCONNECT_LOCAL_DB
def disconnect_local_db(self):
if len(self.to_send) > 0:
self.debug('Got new data!')
self.state = State.BUILD_MESSAGES
else:
self.debug('No data to send!')
self.state = State.SLEEP
self.conn.close()
self.debug('Disconnecting from local database (sqlite)')
def build_messages(self):
self.root = ET.Element("reporting")
for entry in self.to_send:
if int(entry[0]) > self.highest_id:
self.highest_id = entry[0]
value = ET.SubElement(self.root, "value",
ctrlId=entry[1],
id=entry[2],
meaning=entry[3],
date=entry[5]
)
value.text = entry[4]
self.state = State.CMS_CONNECT
del self.to_send[:]
def cms_connect(self):
self.cms.connect()
print('Connected to CMS!')
if self.cms.auth() == True:
self.debug('Authenticated!')
self.state = State.CMS_SEND_MESSAGES
else:
print('Error connecting to CMS!')
time.sleep(10)
def cms_send_messages(self):
self.debug('Sending messages to CMS')
answer = self.cms.sendOSCP(ET.tostring(self.root).decode("utf-8"))
error = False
answer = ET.fromstring(answer)
if self.debug == True:
for entry in answer.findall('error'):
error = True
code = entry.get('code')
print('Got error code '+code+': '+entry.text)
if error == True:
print("The entries that got an error won't be re-sent to the CMS.")
self.state = State.CMS_DISCONNECT
def cms_disconnect(self):
self.debug('Disconnecting from CMS...')
self.cms.getConnection().close()
self.state = State.UPDATE_LOCAL_DB
def update_local_db(self):
self.debug('Writing last `id` sent to CMS...')
self.conn = sqlite3.connect('data.db', timeout=60)
self.conn.execute("UPDATE `oscp_info` SET `value` = "+str(self.highest_id)+" WHERE `name` = 'last_pushed'")
self.conn.commit()
self.conn.close()
self.state = State.SLEEP
def sleep(self):
self.debug('Sleeping for '+str(self.refresh_interval)+'s...')
time.sleep(self.refresh_interval)
self.state = State.CONNECT_LOCAL_DB
def is_valid_entry(self, entry):
# `id`, `controllerStrId`, `idOnController`, `meaning`, `value`, `time`
if len(entry[1]) == 0:
return False
if len(entry[2]) == 0:
return False
if len(entry[3]) == 0:
return False
try:
datetime.datetime.strptime(str(entry[5]), '%Y-%m-%dT%H:%M:%S.%fZ')
except ValueError:
print('@@@@-> Invalid string format for `time` field!')
return False
return True
def debug(self, string):
if self.debug_flag == True:
print(string)
| [
1,
529,
9507,
29958,
1982,
29914,
3267,
6271,
29889,
2272,
13,
5215,
21120,
29941,
13,
5215,
10876,
13,
5215,
4390,
13,
5215,
12865,
13,
5215,
931,
13,
5215,
4903,
29889,
300,
929,
29889,
2642,
9643,
408,
382,
29911,
13,
13,
3166,
4303,
29889,
29907,
4345,
1053,
315,
4345,
13,
13,
1753,
14115,
10456,
6831,
2556,
29892,
3579,
17514,
1125,
13,
12,
264,
6762,
353,
9657,
29898,
7554,
29898,
6831,
2556,
29892,
3464,
29898,
2435,
29898,
6831,
2556,
876,
511,
3579,
17514,
29897,
13,
12,
2457,
1134,
877,
16854,
742,
313,
511,
427,
6762,
29897,
13,
13,
2792,
353,
14115,
877,
26019,
742,
525,
6007,
8186,
1783,
29918,
16652,
1964,
29918,
4051,
742,
525,
29954,
1299,
4448,
29918,
14573,
742,
525,
23711,
6007,
8186,
1783,
29918,
16652,
1964,
29918,
4051,
742,
525,
29933,
25282,
29918,
2303,
1799,
10461,
29903,
742,
525,
29907,
4345,
29918,
6007,
8186,
1783,
742,
525,
29907,
4345,
29918,
29903,
11794,
29918,
2303,
1799,
10461,
29903,
742,
525,
29907,
4345,
29918,
23711,
6007,
8186,
1783,
742,
525,
14474,
29918,
16652,
1964,
29918,
4051,
742,
525,
29903,
1307,
15488,
1495,
13,
13,
1990,
6570,
6271,
29901,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
2295,
29918,
1445,
1125,
13,
12,
12,
2541,
1722,
29898,
2917,
29918,
1445,
29897,
408,
848,
29918,
1445,
29901,
13,
12,
12,
12,
2917,
353,
4390,
29889,
1359,
29898,
1272,
29918,
1445,
29897,
13,
13,
12,
12,
361,
525,
8382,
29915,
297,
2295,
29901,
13,
12,
12,
12,
1311,
29889,
8382,
29918,
15581,
353,
6120,
29898,
2917,
1839,
8382,
11287,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
8382,
29918,
15581,
353,
5852,
13,
13,
12,
12,
361,
525,
22379,
29918,
19207,
29915,
297,
2295,
29901,
13,
12,
12,
12,
1311,
29889,
22379,
29918,
19207,
353,
938,
29898,
2917,
1839,
22379,
29918,
19207,
11287,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
22379,
29918,
19207,
353,
29871,
29953,
29900,
13,
13,
12,
12,
1311,
29889,
29883,
1516,
353,
315,
4345,
29898,
2917,
29918,
1445,
29897,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
26019,
13,
12,
12,
1311,
29889,
9812,
342,
29918,
333,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
517,
29918,
6717,
353,
5159,
13,
13,
12,
12,
1311,
29889,
3859,
29918,
2749,
353,
518,
13,
12,
12,
12,
1311,
29889,
2344,
29892,
13,
12,
12,
12,
1311,
29889,
6915,
29918,
2997,
29918,
2585,
29892,
13,
12,
12,
12,
1311,
29889,
29887,
1624,
29918,
1272,
29892,
13,
12,
12,
12,
1311,
29889,
2218,
6915,
29918,
2997,
29918,
2585,
29892,
13,
12,
12,
12,
1311,
29889,
4282,
29918,
19158,
29892,
13,
12,
12,
12,
1311,
29889,
29883,
1516,
29918,
6915,
29892,
13,
12,
12,
12,
1311,
29889,
29883,
1516,
29918,
6717,
29918,
19158,
29892,
13,
12,
12,
12,
1311,
29889,
29883,
1516,
29918,
2218,
6915,
29892,
13,
12,
12,
12,
1311,
29889,
5504,
29918,
2997,
29918,
2585,
29892,
13,
12,
12,
12,
1311,
29889,
17059,
13,
12,
12,
29962,
13,
13,
12,
12,
361,
1583,
29889,
8382,
29918,
15581,
1275,
5852,
29901,
13,
12,
12,
12,
2158,
877,
11862,
29901,
525,
29974,
710,
29898,
1311,
29889,
8382,
29918,
15581,
876,
13,
13,
12,
1753,
1065,
29898,
1311,
1125,
13,
12,
12,
2158,
877,
4763,
292,
6570,
6271,
22510,
1582,
313,
1469,
28468,
467,
636,
1495,
13,
12,
12,
21094,
353,
5852,
13,
12,
12,
8000,
2734,
29901,
13,
12,
12,
12,
1311,
29889,
3859,
29918,
2749,
29961,
1311,
29889,
3859,
29962,
580,
13,
13,
12,
1753,
2069,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
8382,
877,
15514,
5281,
856,
1495,
13,
12,
12,
1311,
29889,
8382,
877,
29147,
5285,
934,
29889,
1495,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
6007,
8186,
1783,
29918,
16652,
1964,
29918,
4051,
13,
13,
12,
1753,
4511,
29918,
2997,
29918,
2585,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
8382,
877,
17918,
292,
304,
1887,
2566,
313,
22793,
467,
636,
1495,
13,
12,
12,
1311,
29889,
13082,
353,
21120,
29941,
29889,
6915,
877,
1272,
29889,
2585,
742,
11815,
29922,
29953,
29900,
29897,
13,
13,
13,
12,
12,
18127,
353,
1583,
29889,
13082,
29889,
7978,
703,
6404,
1024,
3895,
21120,
29918,
6207,
5754,
1134,
2433,
2371,
29915,
1159,
13,
12,
12,
11940,
29918,
1272,
353,
7700,
13,
12,
12,
11940,
29918,
3888,
353,
7700,
13,
13,
12,
12,
1454,
1948,
297,
10677,
29901,
13,
12,
12,
12,
361,
1948,
29961,
29900,
29962,
1275,
525,
359,
6814,
29918,
1272,
2396,
13,
12,
12,
12,
12,
11940,
29918,
1272,
353,
5852,
13,
12,
12,
12,
361,
1948,
29961,
29900,
29962,
1275,
525,
359,
6814,
29918,
3888,
2396,
13,
12,
12,
12,
12,
11940,
29918,
3888,
353,
5852,
13,
12,
12,
361,
1476,
29918,
1272,
1275,
7700,
29901,
13,
12,
12,
12,
2158,
877,
3562,
421,
359,
6814,
29918,
1272,
29952,
451,
1476,
29889,
26221,
856,
1495,
13,
12,
12,
12,
1311,
29889,
13082,
29889,
7978,
703,
15945,
27045,
10911,
376,
359,
6814,
29918,
1272,
29908,
313,
13,
12,
12,
12,
12,
12,
29952,
333,
29952,
12,
1177,
4330,
17070,
29778,
14636,
26524,
6992,
22245,
13780,
29892,
13,
12,
12,
12,
12,
12,
29952,
8299,
5015,
1204,
29952,
12,
16975,
6058,
4265,
29892,
13,
12,
12,
12,
12,
12,
29952,
333,
2951,
2956,
29952,
12,
16975,
6058,
4265,
29892,
13,
12,
12,
12,
12,
12,
29952,
12676,
292,
29952,
12,
16975,
29892,
13,
12,
12,
12,
12,
12,
29952,
1767,
29952,
12,
16975,
6058,
4265,
29892,
13,
12,
12,
12,
12,
12,
29952,
2230,
29952,
12,
1177,
4330,
17070,
6058,
4265,
13,
12,
12,
12,
12,
5513,
29908,
1159,
13,
12,
12,
12,
1311,
29889,
13082,
29889,
15060,
580,
13,
12,
12,
361,
1476,
29918,
3888,
1275,
7700,
29901,
13,
12,
12,
12,
2158,
877,
3562,
421,
359,
6814,
29918,
3888,
29952,
451,
1476,
29889,
26221,
856,
1495,
13,
12,
12,
12,
1311,
29889,
13082,
29889,
7978,
703,
15945,
27045,
10911,
421,
359,
6814,
29918,
3888,
29952,
313,
13,
12,
12,
12,
12,
12,
29952,
333,
29952,
12,
1177,
4330,
17070,
29778,
14636,
26524,
6992,
22245,
13780,
29892,
13,
12,
12,
12,
12,
12,
29952,
978,
29952,
12,
16975,
6058,
4265,
29892,
13,
12,
12,
12,
12,
12,
29952,
1767,
29952,
12,
16975,
6058,
4265,
13,
12,
12,
12,
12,
5513,
29908,
1159,
13,
12,
12,
12,
1311,
29889,
13082,
29889,
7978,
703,
19460,
11646,
421,
359,
6814,
29918,
3888,
29952,
6695,
978,
1673,
421,
1767,
6348,
15673,
6702,
4230,
29918,
5910,
287,
742,
29871,
29900,
25760,
13,
12,
12,
12,
1311,
29889,
13082,
29889,
15060,
580,
13,
12,
13,
12,
12,
1311,
29889,
8382,
877,
6359,
292,
1833,
421,
333,
29952,
2665,
304,
315,
4345,
856,
1495,
13,
12,
12,
18127,
353,
1583,
29889,
13082,
29889,
7978,
703,
6404,
421,
1767,
29952,
3895,
421,
359,
6814,
29918,
3888,
29952,
5754,
421,
978,
29952,
2433,
4230,
29918,
5910,
287,
29915,
1159,
13,
12,
12,
1311,
29889,
4230,
29918,
5910,
287,
353,
10677,
29889,
9155,
650,
580,
29961,
29900,
29962,
13,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29954,
1299,
4448,
29918,
14573,
13,
13,
12,
1753,
11705,
29918,
1272,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
8382,
877,
14959,
292,
363,
716,
848,
856,
1495,
13,
12,
12,
18127,
353,
1583,
29889,
13082,
29889,
7978,
703,
6404,
421,
333,
1673,
421,
8299,
5015,
1204,
1673,
421,
333,
2951,
2956,
1673,
421,
12676,
292,
1673,
421,
1767,
1673,
421,
2230,
29952,
3895,
421,
359,
6814,
29918,
1272,
29952,
5754,
421,
333,
29952,
1405,
15691,
1311,
29889,
4230,
29918,
5910,
287,
29897,
13,
12,
12,
1454,
1948,
297,
10677,
29901,
13,
12,
12,
12,
361,
1583,
29889,
275,
29918,
3084,
29918,
8269,
29898,
798,
29897,
1275,
5852,
29901,
13,
12,
12,
12,
12,
1311,
29889,
517,
29918,
6717,
29889,
4397,
29898,
798,
29897,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
23711,
6007,
8186,
1783,
29918,
16652,
1964,
29918,
4051,
13,
13,
12,
1753,
766,
6915,
29918,
2997,
29918,
2585,
29898,
1311,
1125,
12,
13,
12,
12,
361,
7431,
29898,
1311,
29889,
517,
29918,
6717,
29897,
1405,
29871,
29900,
29901,
13,
12,
12,
12,
1311,
29889,
8382,
877,
29954,
327,
716,
848,
29991,
1495,
13,
12,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29933,
25282,
29918,
2303,
1799,
10461,
29903,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
8382,
877,
3782,
848,
304,
3638,
29991,
1495,
13,
12,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29903,
1307,
15488,
13,
12,
12,
1311,
29889,
13082,
29889,
5358,
580,
13,
12,
12,
1311,
29889,
8382,
877,
4205,
6915,
292,
515,
1887,
2566,
313,
22793,
29897,
1495,
13,
13,
12,
1753,
2048,
29918,
19158,
29898,
1311,
1125,
12,
13,
12,
12,
1311,
29889,
4632,
353,
382,
29911,
29889,
2642,
703,
12276,
292,
1159,
13,
12,
12,
1454,
6251,
297,
1583,
29889,
517,
29918,
6717,
29901,
13,
12,
12,
12,
361,
938,
29898,
8269,
29961,
29900,
2314,
1405,
1583,
29889,
9812,
342,
29918,
333,
29901,
13,
12,
12,
12,
12,
1311,
29889,
9812,
342,
29918,
333,
353,
6251,
29961,
29900,
29962,
13,
12,
12,
12,
1767,
353,
382,
29911,
29889,
4035,
2642,
29898,
1311,
29889,
4632,
29892,
376,
1767,
613,
29871,
13,
12,
12,
12,
12,
24220,
1204,
29922,
8269,
29961,
29896,
1402,
29871,
13,
12,
12,
12,
12,
333,
29922,
8269,
29961,
29906,
1402,
29871,
13,
12,
12,
12,
12,
12676,
292,
29922,
8269,
29961,
29941,
1402,
29871,
13,
12,
12,
12,
12,
1256,
29922,
8269,
29961,
29945,
29962,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
1767,
29889,
726,
353,
6251,
29961,
29946,
29962,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29907,
4345,
29918,
6007,
8186,
1783,
13,
12,
12,
6144,
1583,
29889,
517,
29918,
6717,
7503,
29962,
13,
13,
12,
1753,
274,
1516,
29918,
6915,
29898,
1311,
1125,
12,
13,
12,
12,
1311,
29889,
29883,
1516,
29889,
6915,
580,
13,
12,
12,
2158,
877,
20971,
2954,
304,
315,
4345,
29991,
1495,
13,
12,
12,
361,
1583,
29889,
29883,
1516,
29889,
5150,
580,
1275,
5852,
29901,
13,
12,
12,
12,
1311,
29889,
8382,
877,
6444,
4173,
630,
29991,
1495,
13,
12,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29907,
4345,
29918,
29903,
11794,
29918,
2303,
1799,
10461,
29903,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
2158,
877,
2392,
16791,
304,
315,
4345,
29991,
1495,
13,
12,
12,
12,
2230,
29889,
17059,
29898,
29896,
29900,
29897,
13,
13,
12,
1753,
274,
1516,
29918,
6717,
29918,
19158,
29898,
1311,
1125,
12,
13,
12,
12,
1311,
29889,
8382,
877,
29903,
2548,
7191,
304,
315,
4345,
1495,
13,
12,
12,
12011,
353,
1583,
29889,
29883,
1516,
29889,
6717,
3267,
6271,
29898,
2544,
29889,
517,
1807,
29898,
1311,
29889,
4632,
467,
13808,
703,
9420,
29899,
29947,
5783,
13,
12,
12,
2704,
353,
7700,
13,
12,
12,
12011,
353,
382,
29911,
29889,
3166,
1807,
29898,
12011,
29897,
13,
12,
12,
361,
1583,
29889,
8382,
1275,
5852,
29901,
13,
12,
12,
12,
1454,
6251,
297,
1234,
29889,
2886,
497,
877,
2704,
29374,
13,
12,
12,
12,
12,
2704,
353,
5852,
13,
12,
12,
12,
12,
401,
353,
6251,
29889,
657,
877,
401,
1495,
13,
12,
12,
12,
12,
2158,
877,
29954,
327,
1059,
775,
525,
29974,
401,
29974,
2396,
525,
29974,
8269,
29889,
726,
29897,
13,
12,
12,
12,
361,
1059,
1275,
5852,
29901,
13,
12,
12,
12,
12,
2158,
703,
1576,
9976,
393,
2355,
385,
1059,
2113,
29915,
29873,
367,
337,
29899,
18616,
304,
278,
315,
4345,
23157,
13,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29907,
4345,
29918,
23711,
6007,
8186,
1783,
13,
13,
12,
1753,
274,
1516,
29918,
2218,
6915,
29898,
1311,
1125,
12,
13,
12,
12,
1311,
29889,
8382,
877,
4205,
6915,
292,
515,
315,
4345,
856,
1495,
13,
12,
12,
1311,
29889,
29883,
1516,
29889,
657,
5350,
2141,
5358,
580,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
14474,
29918,
16652,
1964,
29918,
4051,
13,
13,
12,
1753,
2767,
29918,
2997,
29918,
2585,
29898,
1311,
1125,
12,
13,
12,
12,
1311,
29889,
8382,
877,
29956,
768,
292,
1833,
421,
333,
29952,
2665,
304,
315,
4345,
856,
1495,
13,
12,
12,
1311,
29889,
13082,
353,
21120,
29941,
29889,
6915,
877,
1272,
29889,
2585,
742,
11815,
29922,
29953,
29900,
29897,
13,
12,
12,
1311,
29889,
13082,
29889,
7978,
703,
14474,
421,
359,
6814,
29918,
3888,
29952,
11368,
421,
1767,
29952,
353,
15691,
710,
29898,
1311,
29889,
9812,
342,
29918,
333,
7240,
29908,
5754,
421,
978,
29952,
353,
525,
4230,
29918,
5910,
287,
29915,
1159,
13,
12,
12,
1311,
29889,
13082,
29889,
15060,
580,
13,
12,
12,
1311,
29889,
13082,
29889,
5358,
580,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
29903,
1307,
15488,
13,
13,
12,
1753,
8709,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
8382,
877,
29903,
5436,
292,
363,
525,
29974,
710,
29898,
1311,
29889,
22379,
29918,
19207,
7240,
29915,
29879,
856,
1495,
13,
12,
12,
2230,
29889,
17059,
29898,
1311,
29889,
22379,
29918,
19207,
29897,
13,
12,
12,
1311,
29889,
3859,
353,
4306,
29889,
6007,
8186,
1783,
29918,
16652,
1964,
29918,
4051,
13,
13,
12,
1753,
338,
29918,
3084,
29918,
8269,
29898,
1311,
29892,
6251,
1125,
13,
12,
12,
29937,
421,
333,
1673,
421,
8299,
5015,
1204,
1673,
421,
333,
2951,
2956,
1673,
421,
12676,
292,
1673,
421,
1767,
1673,
421,
2230,
29952,
13,
13,
12,
12,
361,
7431,
29898,
8269,
29961,
29896,
2314,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
2457,
7700,
13,
12,
12,
361,
7431,
29898,
8269,
29961,
29906,
2314,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
2457,
7700,
13,
12,
12,
361,
7431,
29898,
8269,
29961,
29941,
2314,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
2457,
7700,
13,
13,
12,
12,
2202,
29901,
13,
12,
12,
12,
12673,
29889,
12673,
29889,
710,
415,
603,
29898,
710,
29898,
8269,
29961,
29945,
11724,
14210,
29979,
19222,
29885,
19222,
29881,
29911,
29995,
29950,
16664,
29924,
16664,
29903,
29889,
29995,
29888,
29999,
1495,
13,
12,
12,
19499,
7865,
2392,
29901,
13,
12,
12,
12,
2158,
877,
25380,
25380,
976,
21403,
1347,
3402,
363,
421,
2230,
29952,
1746,
29991,
1495,
13,
12,
12,
12,
2457,
7700,
13,
12,
12,
12,
13,
12,
12,
2457,
5852,
13,
13,
12,
1753,
4744,
29898,
1311,
29892,
1347,
1125,
13,
12,
12,
361,
1583,
29889,
8382,
29918,
15581,
1275,
5852,
29901,
13,
12,
12,
12,
2158,
29898,
1807,
29897,
12,
12,
12,
12,
13,
2
] |
visualize.py | mac389/semantic-distance | 2 | 31710 | <reponame>mac389/semantic-distance
import os, json, matplotlib
matplotlib.use('Agg')
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
READ = 'rb'
directory = json.load(open('directory.json',READ))
filename = os.path.join(directory['data-prefix'],'test-similarity-matrix.npy')
data = np.load(filename).astype(float)
data = (data-data.min())/(data.max()-data.min()) #Think more about how to scale
f,ax = plt.subplots(figsize=(12,9))
#Only for control
color_series = {i:color for i,color in enumerate(sns.color_palette("husl", 3))}
colors = pd.Series([color_series[i%3] for i in xrange(data.shape[0])])
print colors
hmap = sns.clustermap(np.corrcoef(data),col_colors = colors,row_colors=colors)
#plt.tight_layout()
plt.savefig('./results/clustermap-corr2.png') | [
1,
529,
276,
1112,
420,
29958,
8628,
29941,
29947,
29929,
29914,
12846,
7716,
29899,
19244,
13,
5215,
2897,
29892,
4390,
29892,
22889,
29871,
13,
2922,
17357,
29889,
1509,
877,
29909,
1505,
1495,
13,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
12655,
408,
7442,
29871,
13,
5215,
11701,
408,
10518,
29871,
13,
13,
16310,
353,
525,
6050,
29915,
13,
12322,
353,
4390,
29889,
1359,
29898,
3150,
877,
12322,
29889,
3126,
742,
16310,
876,
12,
12,
13,
9507,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12322,
1839,
1272,
29899,
13506,
7464,
29915,
1688,
29899,
29764,
537,
29899,
5344,
29889,
29876,
2272,
1495,
13,
13,
13,
1272,
353,
7442,
29889,
1359,
29898,
9507,
467,
579,
668,
29898,
7411,
29897,
13,
1272,
29871,
353,
313,
1272,
29899,
1272,
29889,
1195,
3101,
14571,
1272,
29889,
3317,
580,
29899,
1272,
29889,
1195,
3101,
396,
1349,
682,
901,
1048,
920,
304,
6287,
13,
13,
29888,
29892,
1165,
353,
14770,
29889,
1491,
26762,
29898,
1003,
2311,
7607,
29896,
29906,
29892,
29929,
876,
13,
13,
29937,
11730,
363,
2761,
13,
13,
2780,
29918,
13757,
353,
426,
29875,
29901,
2780,
363,
474,
29892,
2780,
297,
26985,
29898,
29879,
1983,
29889,
2780,
29918,
29886,
26456,
703,
14116,
29880,
613,
29871,
29941,
876,
29913,
13,
27703,
353,
10518,
29889,
19204,
4197,
2780,
29918,
13757,
29961,
29875,
29995,
29941,
29962,
363,
474,
297,
921,
3881,
29898,
1272,
29889,
12181,
29961,
29900,
2314,
2314,
13,
2158,
11955,
13,
13,
29882,
1958,
353,
269,
1983,
29889,
695,
504,
837,
481,
29898,
9302,
29889,
29725,
1111,
1389,
29898,
1272,
511,
1054,
29918,
27703,
353,
11955,
29892,
798,
29918,
27703,
29922,
27703,
29897,
13,
29937,
572,
29873,
29889,
29873,
523,
29918,
2680,
580,
13,
572,
29873,
29889,
7620,
1003,
877,
6904,
9902,
29914,
695,
504,
837,
481,
29899,
29725,
29906,
29889,
2732,
1495,
2
] |
exerciciosEntrega/exercicioEntrega08.py | igorprati/python_modulo01_entrega | 0 | 139991 | #08 - Crie um programa que leia nome, ano de nascimento e carteira de trabalho e cadastre-os (com idade) em um dicionário. Se por acaso a CTPS for diferente de 0, o dicionário receberá também o ano de contratação e o salário. Calcule e acrescente , além da idade, com quantos anos a pessoa vai se aposentar. Considere que o trabalhador deve contribuir por 35 anos para se aposentar.
ano = 2021 # ano atual que estamos
dados = dict() # dicionário com os dados do usuário
dados['Nome'] = input('Nome: ') # chave 'Nome' recebe valor
dados['Idade'] = 2021 - int(input('Ano de nascimento: ')) # chave 'Idade' recebe ano de nascimento
dados['CTPS'] = int(input('Carteira de trabalho: ')) # chave 'CTPS' recebe carteira de trabalho
if dados['CTPS'] != 0: # se a carteira de trabalho for diferente de ZERO:
dados['anoContratacao'] = int(input('Ano de contratação: ')) # o programa vai pedir ano de contratação e adicionar à chave 'anoContratacao'
dados['Salário'] = int(input('Salário: ')) # o programa vai pedir salario e adicionar à chave 'Salário'
aposentadoria = (dados['anoContratacao'] + 35) - 1998 # cria uma variável que recebe com quantos anos a pessoa vai se aposentar. Para isso, soma o ano de contratação + 35 anos de serviço - ano de nascimento
print(f'Você irá se aposentar com {aposentadoria} anos.')
else:
print('Não sei quando você vai se aposentar...')
| [
1,
396,
29900,
29947,
448,
315,
2546,
1922,
16914,
712,
454,
423,
9235,
29892,
19410,
316,
29229,
6174,
321,
20206,
3055,
316,
19739,
1251,
321,
13840,
579,
276,
29899,
359,
313,
510,
1178,
1943,
29897,
953,
1922,
12124,
291,
12288,
29889,
922,
1277,
1274,
17764,
263,
315,
3557,
29903,
363,
12186,
2016,
316,
29871,
29900,
29892,
288,
12124,
291,
12288,
2414,
495,
29976,
10409,
288,
19410,
316,
4313,
532,
2340,
321,
288,
4497,
12288,
29889,
3037,
29883,
1297,
321,
23931,
21450,
1919,
394,
2249,
1146,
1178,
1943,
29892,
419,
4323,
359,
14110,
263,
23109,
29874,
325,
1794,
409,
263,
1066,
296,
279,
29889,
2138,
333,
406,
712,
288,
19739,
29882,
3136,
28542,
27895,
381,
1277,
29871,
29941,
29945,
14110,
1702,
409,
263,
1066,
296,
279,
29889,
13,
13,
1562,
353,
29871,
29906,
29900,
29906,
29896,
396,
19410,
472,
950,
712,
707,
14054,
13,
29881,
2255,
353,
9657,
580,
396,
12124,
291,
12288,
419,
2897,
270,
2255,
437,
502,
29884,
12288,
13,
13,
29881,
2255,
1839,
29940,
608,
2033,
353,
1881,
877,
29940,
608,
29901,
25710,
396,
521,
1351,
525,
29940,
608,
29915,
2414,
915,
16497,
13,
29881,
2255,
1839,
1204,
1943,
2033,
353,
29871,
29906,
29900,
29906,
29896,
448,
938,
29898,
2080,
877,
29909,
1217,
316,
29229,
6174,
29901,
525,
876,
396,
521,
1351,
525,
1204,
1943,
29915,
2414,
915,
19410,
316,
29229,
6174,
13,
29881,
2255,
1839,
1783,
7024,
2033,
353,
938,
29898,
2080,
877,
8179,
371,
3055,
316,
19739,
1251,
29901,
525,
876,
396,
521,
1351,
525,
1783,
7024,
29915,
2414,
915,
20206,
3055,
316,
19739,
1251,
13,
13,
361,
270,
2255,
1839,
1783,
7024,
2033,
2804,
29871,
29900,
29901,
396,
409,
263,
20206,
3055,
316,
19739,
1251,
363,
12186,
2016,
316,
796,
1001,
29949,
29901,
13,
1678,
270,
2255,
1839,
1562,
1168,
509,
532,
1113,
29877,
2033,
353,
938,
29898,
2080,
877,
29909,
1217,
316,
4313,
532,
2340,
29901,
525,
876,
396,
288,
16914,
325,
1794,
8939,
381,
19410,
316,
4313,
532,
2340,
321,
594,
15353,
279,
818,
521,
1351,
525,
1562,
1168,
509,
532,
1113,
29877,
29915,
13,
1678,
270,
2255,
1839,
20392,
12288,
2033,
353,
938,
29898,
2080,
877,
20392,
12288,
29901,
525,
876,
396,
288,
16914,
325,
1794,
8939,
381,
4497,
2628,
321,
594,
15353,
279,
818,
521,
1351,
525,
20392,
12288,
29915,
13,
1678,
263,
1066,
296,
3136,
423,
353,
313,
29881,
2255,
1839,
1562,
1168,
509,
532,
1113,
29877,
2033,
718,
29871,
29941,
29945,
29897,
448,
29871,
29896,
29929,
29929,
29947,
396,
274,
2849,
3672,
1197,
28691,
712,
2414,
915,
419,
4323,
359,
14110,
263,
23109,
29874,
325,
1794,
409,
263,
1066,
296,
279,
29889,
12994,
338,
578,
29892,
1047,
29874,
288,
19410,
316,
4313,
532,
2340,
718,
29871,
29941,
29945,
14110,
316,
27299,
6102,
448,
19410,
316,
29229,
6174,
1678,
13,
1678,
1596,
29898,
29888,
29915,
29963,
542,
30037,
3805,
29976,
409,
263,
1066,
296,
279,
419,
426,
481,
359,
296,
3136,
423,
29913,
14110,
29889,
1495,
13,
2870,
29901,
13,
1678,
1596,
877,
29940,
1368,
13106,
9836,
7931,
30037,
325,
1794,
409,
263,
1066,
296,
279,
856,
1495,
13,
2
] |
dmutils/filters.py | DilwoarH/digitalmarketplace-utils | 0 | 140672 | <gh_stars>0
from __future__ import unicode_literals
import re
from six import string_types
from jinja2 import evalcontextfilter, Markup, escape
def smartjoin(input):
list_to_join = list(input)
if len(list_to_join) > 1:
return '{} and {}'.format(', '.join(list_to_join[:-1]), list_to_join[-1])
elif len(list_to_join) == 1:
return '{}'.format(list_to_join[0])
else:
return ''
def format_links(text):
"""
Filter that searches a given string (or other string-like object) for any URIs
and wraps them with either an anchor link or a span, depending on whether the link contains a valid protocol.
Python3's re library returns matches with type string rather than the arg's type, which
causes problems for Markup() objects containing tags to be escaped later. Therefore
we need to cast the matches and formatted links back to the original type before returning the value.
"""
url_match = re.compile(r"""(
(?:https?://|www\.) # start with http:// or www.
(?:[^\s<>"'/?#]+) # domain doesn't have these characters
(?:[^\s<>"']+) # post-domain part of URL doesn't have these characters
[^\s<>,"'\.] # no dot at end
)""", re.X)
matched_urls = [type(text)(substr) for substr in url_match.findall(text)]
if matched_urls:
link = '<a href="{0}" class="break-link" rel="external">{0}</a>'
plaintext_link = '<span class="break-link">{0}</span>'
text_array = [type(text)(substr) for substr in url_match.split(text)]
formatted_text_array = []
for partial_text in text_array:
if partial_text in matched_urls:
if partial_text.startswith('www'):
url = plaintext_link.format(Markup.escape(partial_text))
else:
url = link.format(Markup.escape(partial_text))
formatted_text_array.append(url)
else:
partial_text = Markup.escape(partial_text)
formatted_text_array.append(partial_text)
formatted_text = Markup(''.join(formatted_text_array))
return formatted_text
else:
return text
def nbsp(text):
"""Replace spaces with nbsp.
If you want to use html with this filter you need to pass it in as marksafe
ie.
{{ "some text and <html>"|marksafe|nbsp }}"""
text = escape(text)
return text.replace(' ', Markup(' '))
def capitalize_first(maybe_text):
"""If it's a string capitalise the first character, unless it looks like a URL
:param maybe_text: Could be anything
:return: If maybe_text is a string it will be returned with an initial capital letter, otherwise unchanged
"""
if maybe_text and isinstance(maybe_text, string_types):
if not maybe_text.startswith('http'):
return maybe_text[0].capitalize() + maybe_text[1:]
elif isinstance(maybe_text, (list, tuple)):
return [capitalize_first(item) for item in maybe_text]
return maybe_text
# find repeated sequences of '\r\n\', optionally separated by other non-newline whitespace space characters
_multiple_newlines_re = re.compile(r'(\r\n[ \t\f\v]*){2,}')
# find \r\n sequences
_single_newline_re = re.compile(r'(\r\n)')
@evalcontextfilter
def preserve_line_breaks(eval_ctx, value):
# `escape()` returns Markdown objects in python2
# We want to cast the output value back into unicode strings
value = u'{}'.format(escape(value))
# limit sequences of "\r\n\r\n ..."s to two
value = _multiple_newlines_re.sub(u'\r\n\r\n', value)
result = _single_newline_re.sub(u'<br>', value)
if eval_ctx.autoescape:
result = Markup(result)
return result
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
5215,
337,
13,
3166,
4832,
1053,
1347,
29918,
8768,
13,
3166,
432,
262,
1764,
29906,
1053,
19745,
4703,
4572,
29892,
4485,
786,
29892,
10169,
13,
13,
13,
1753,
15040,
7122,
29898,
2080,
1125,
13,
1678,
1051,
29918,
517,
29918,
7122,
353,
1051,
29898,
2080,
29897,
13,
1678,
565,
7431,
29898,
1761,
29918,
517,
29918,
7122,
29897,
1405,
29871,
29896,
29901,
13,
4706,
736,
525,
8875,
322,
6571,
4286,
4830,
29317,
15300,
7122,
29898,
1761,
29918,
517,
29918,
7122,
7503,
29899,
29896,
11724,
1051,
29918,
517,
29918,
7122,
14352,
29896,
2314,
13,
1678,
25342,
7431,
29898,
1761,
29918,
517,
29918,
7122,
29897,
1275,
29871,
29896,
29901,
13,
4706,
736,
525,
8875,
4286,
4830,
29898,
1761,
29918,
517,
29918,
7122,
29961,
29900,
2314,
13,
1678,
1683,
29901,
13,
4706,
736,
6629,
13,
13,
13,
1753,
3402,
29918,
4965,
29898,
726,
1125,
13,
1678,
9995,
13,
1678,
19916,
393,
29645,
263,
2183,
1347,
313,
272,
916,
1347,
29899,
4561,
1203,
29897,
363,
738,
501,
29934,
3624,
13,
1678,
322,
11463,
567,
963,
411,
2845,
385,
17360,
1544,
470,
263,
10638,
29892,
8679,
373,
3692,
278,
1544,
3743,
263,
2854,
9608,
29889,
13,
1678,
5132,
29941,
29915,
29879,
337,
3489,
3639,
7087,
411,
1134,
1347,
3265,
1135,
278,
1852,
29915,
29879,
1134,
29892,
607,
13,
1678,
9946,
4828,
363,
4485,
786,
580,
3618,
6943,
8282,
304,
367,
19824,
2678,
29889,
7857,
13,
1678,
591,
817,
304,
4320,
278,
7087,
322,
20917,
2988,
1250,
304,
278,
2441,
1134,
1434,
7863,
278,
995,
29889,
13,
1678,
9995,
13,
1678,
3142,
29918,
4352,
353,
337,
29889,
12198,
29898,
29878,
15945,
29908,
29898,
13,
462,
18884,
22308,
29901,
991,
29973,
597,
29989,
1636,
29905,
1846,
1678,
396,
1369,
411,
1732,
597,
470,
7821,
29889,
13,
462,
18884,
22308,
10834,
3823,
29879,
29966,
11903,
29915,
13401,
29937,
10062,
29897,
418,
396,
5354,
1838,
29915,
29873,
505,
1438,
4890,
13,
462,
18884,
22308,
10834,
3823,
29879,
29966,
11903,
2033,
28135,
308,
396,
1400,
29899,
7247,
760,
310,
3988,
1838,
29915,
29873,
505,
1438,
4890,
13,
462,
18884,
518,
3823,
29879,
25299,
1699,
12764,
5586,
965,
396,
694,
8329,
472,
1095,
13,
462,
18884,
1723,
15945,
613,
337,
29889,
29990,
29897,
13,
1678,
19228,
29918,
26045,
353,
518,
1853,
29898,
726,
5033,
27790,
29897,
363,
25148,
297,
3142,
29918,
4352,
29889,
2886,
497,
29898,
726,
4638,
13,
1678,
565,
19228,
29918,
26045,
29901,
13,
4706,
1544,
353,
12801,
29874,
2822,
10724,
29900,
5038,
770,
543,
8690,
29899,
2324,
29908,
1104,
543,
23176,
1013,
29912,
29900,
16040,
29874,
16299,
13,
4706,
8656,
726,
29918,
2324,
353,
12801,
9653,
770,
543,
8690,
29899,
2324,
1013,
29912,
29900,
16040,
9653,
16299,
13,
4706,
1426,
29918,
2378,
353,
518,
1853,
29898,
726,
5033,
27790,
29897,
363,
25148,
297,
3142,
29918,
4352,
29889,
5451,
29898,
726,
4638,
13,
4706,
20917,
29918,
726,
29918,
2378,
353,
5159,
13,
4706,
363,
7687,
29918,
726,
297,
1426,
29918,
2378,
29901,
13,
9651,
565,
7687,
29918,
726,
297,
19228,
29918,
26045,
29901,
13,
18884,
565,
7687,
29918,
726,
29889,
27382,
2541,
877,
1636,
29374,
13,
462,
1678,
3142,
353,
8656,
726,
29918,
2324,
29889,
4830,
29898,
9802,
786,
29889,
21587,
29898,
3846,
29918,
726,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
3142,
353,
1544,
29889,
4830,
29898,
9802,
786,
29889,
21587,
29898,
3846,
29918,
726,
876,
13,
18884,
20917,
29918,
726,
29918,
2378,
29889,
4397,
29898,
2271,
29897,
13,
9651,
1683,
29901,
13,
18884,
7687,
29918,
726,
353,
4485,
786,
29889,
21587,
29898,
3846,
29918,
726,
29897,
13,
18884,
20917,
29918,
726,
29918,
2378,
29889,
4397,
29898,
3846,
29918,
726,
29897,
13,
4706,
20917,
29918,
726,
353,
4485,
786,
877,
4286,
7122,
29898,
689,
19667,
29918,
726,
29918,
2378,
876,
13,
4706,
736,
20917,
29918,
726,
13,
1678,
1683,
29901,
13,
4706,
736,
1426,
13,
13,
13,
1753,
302,
29890,
1028,
29898,
726,
1125,
13,
1678,
9995,
20083,
8162,
411,
302,
29890,
1028,
29889,
13,
13,
1678,
960,
366,
864,
304,
671,
3472,
411,
445,
4175,
366,
817,
304,
1209,
372,
297,
408,
2791,
11177,
13,
1678,
19282,
29889,
13,
1678,
8620,
376,
5372,
1426,
322,
529,
1420,
11903,
29989,
3502,
11177,
29989,
14239,
500,
5038,
15945,
13,
1678,
1426,
353,
10169,
29898,
726,
29897,
13,
1678,
736,
1426,
29889,
6506,
877,
13420,
4485,
786,
877,
29987,
14239,
29936,
8785,
13,
13,
13,
1753,
7483,
675,
29918,
4102,
29898,
26026,
29918,
726,
1125,
13,
1678,
9995,
3644,
372,
29915,
29879,
263,
1347,
7483,
895,
278,
937,
2931,
29892,
6521,
372,
3430,
763,
263,
3988,
13,
13,
1678,
584,
3207,
5505,
29918,
726,
29901,
6527,
367,
3099,
13,
1678,
584,
2457,
29901,
960,
5505,
29918,
726,
338,
263,
1347,
372,
674,
367,
4133,
411,
385,
2847,
7483,
5497,
29892,
6467,
443,
15033,
13,
1678,
9995,
13,
1678,
565,
5505,
29918,
726,
322,
338,
8758,
29898,
26026,
29918,
726,
29892,
1347,
29918,
8768,
1125,
13,
4706,
565,
451,
5505,
29918,
726,
29889,
27382,
2541,
877,
1124,
29374,
13,
9651,
736,
5505,
29918,
726,
29961,
29900,
1822,
5030,
2410,
675,
580,
718,
5505,
29918,
726,
29961,
29896,
17531,
13,
1678,
25342,
338,
8758,
29898,
26026,
29918,
726,
29892,
313,
1761,
29892,
18761,
22164,
13,
4706,
736,
518,
5030,
2410,
675,
29918,
4102,
29898,
667,
29897,
363,
2944,
297,
5505,
29918,
726,
29962,
13,
13,
1678,
736,
5505,
29918,
726,
13,
13,
13,
29937,
1284,
10324,
15602,
310,
11297,
29878,
29905,
29876,
29905,
742,
2984,
635,
13055,
491,
916,
1661,
29899,
1482,
1220,
24358,
2913,
4890,
13,
29918,
20787,
29918,
1482,
9012,
29918,
276,
353,
337,
29889,
12198,
29898,
29878,
29915,
1194,
29878,
29905,
29876,
29961,
320,
29873,
29905,
29888,
29905,
29894,
14178,
2597,
29906,
29892,
29913,
1495,
13,
29937,
1284,
320,
29878,
29905,
29876,
15602,
13,
29918,
14369,
29918,
1482,
1220,
29918,
276,
353,
337,
29889,
12198,
29898,
29878,
29915,
1194,
29878,
29905,
29876,
29897,
1495,
13,
13,
13,
29992,
14513,
4703,
4572,
13,
1753,
19905,
29918,
1220,
29918,
8690,
29879,
29898,
14513,
29918,
13073,
29892,
995,
1125,
13,
13,
1678,
396,
421,
21587,
2555,
3639,
4485,
3204,
3618,
297,
3017,
29906,
13,
1678,
396,
1334,
864,
304,
4320,
278,
1962,
995,
1250,
964,
29104,
6031,
13,
1678,
995,
353,
318,
29915,
8875,
4286,
4830,
29898,
21587,
29898,
1767,
876,
13,
13,
1678,
396,
4046,
15602,
310,
6634,
29878,
29905,
29876,
29905,
29878,
29905,
29876,
2023,
29908,
29879,
304,
1023,
13,
1678,
995,
353,
903,
20787,
29918,
1482,
9012,
29918,
276,
29889,
1491,
29898,
29884,
12764,
29878,
29905,
29876,
29905,
29878,
29905,
29876,
742,
995,
29897,
13,
13,
1678,
1121,
353,
903,
14369,
29918,
1482,
1220,
29918,
276,
29889,
1491,
29898,
29884,
29915,
29966,
1182,
29958,
742,
995,
29897,
13,
13,
1678,
565,
19745,
29918,
13073,
29889,
6921,
21587,
29901,
13,
4706,
1121,
353,
4485,
786,
29898,
2914,
29897,
13,
13,
1678,
736,
1121,
13,
2
] |
theano/sparse/__init__.py | michaelosthege/aesara | 1 | 80798 | <gh_stars>1-10
from warnings import warn
try:
import scipy
enable_sparse = True
except ImportError:
enable_sparse = False
warn("SciPy can't be imported. Sparse matrix support is disabled.")
from theano.sparse.type import *
if enable_sparse:
from theano.sparse import opt, sharedvar
from theano.sparse.basic import *
from theano.sparse.sharedvar import sparse_constructor as shared
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
18116,
1053,
29383,
13,
13,
13,
2202,
29901,
13,
1678,
1053,
4560,
2272,
13,
13,
1678,
9025,
29918,
29879,
5510,
353,
5852,
13,
19499,
16032,
2392,
29901,
13,
1678,
9025,
29918,
29879,
5510,
353,
7700,
13,
1678,
29383,
703,
29903,
455,
19737,
508,
29915,
29873,
367,
19673,
29889,
29871,
317,
5510,
4636,
2304,
338,
12708,
23157,
13,
13,
3166,
278,
1562,
29889,
29879,
5510,
29889,
1853,
1053,
334,
13,
13,
13,
361,
9025,
29918,
29879,
5510,
29901,
13,
1678,
515,
278,
1562,
29889,
29879,
5510,
1053,
3523,
29892,
7258,
1707,
13,
1678,
515,
278,
1562,
29889,
29879,
5510,
29889,
16121,
1053,
334,
13,
1678,
515,
278,
1562,
29889,
29879,
5510,
29889,
12366,
1707,
1053,
29234,
29918,
27821,
408,
7258,
13,
2
] |
src/python/create_folder_tree.py | natukikazemizo/Sedna1.0 | 4 | 165660 | <reponame>natukikazemizo/Sedna1.0<filename>src/python/create_folder_tree.py
# !BPY
# -*- coding: UTF-8 -*-
# Create Folder Tree
#
# Create Objects & Expnasion Motion
#
# 2019.03.12 Natukikazemizo
#
import bpy
import os
import math
# CONSTANT OF PARAMETERS
FOLDER_SPLITTER = "_"
SEED_FOLDER_NAME = 'Folder'
SEED_FOLDER_LEAF_NAME = 'Folder.Leaf'
SEED_FILE_NAME = 'File'
SEED_BRANCH_NAME = 'Branch'
ROOT_FOLDER = "C:/SRC/blender"
ROOT_FOLDER_ORG_NAME = "blender-2.79b"
# DEF FOR TEST
#ROOT_FOLDER = "C:/tmp/folder_tree_test/"
#ROOT_FOLDER_ORG_NAME = "root"
ROOT_FOLDER_SHORT_NAME = "Folder_0001"
ACTION_SUFFIX = 'Action'
SEED_ACTION = 'FolderAction'
FILE_SEED_ACTION = 'FileAction'
NEW_FOLDER_NAME = 'Folder_'
FOLDER_ZFILL = 4
NEW_FILE_NAME = 'File_'
FILE_ZFILL = 8
NEW_BRANCH_NAME = 'Branch_'
NEW_BRANCH_H_NAME = 'Branch_h_'
NEW_FOLDER_LEAF_NAME = "Folder.Leaf_"
START_FRAME = 3000
FPS = 12
SCALE_STORAGE = 0.5
SCALE_NORMAL = 1.0
# Folder Constants
FOLDER_X_POS_START = 0.02
FOLDER_X_POS_END = 0.2
FOLDER_X_MARGIN = 0.7
FOLDER_Y_MARGIN = 0.7
FOLDER_Z_MARGIN = 0.48
FOLDER_LEVEL1_Y_MARGIN = 2
FOLDER_STORAGE_SCALE = 0.02
FOLDER_FRAME_START_MARGIN = 1
FOLDER_FRAME_EXPAND_Z_WAIT = 0
FOLDER_FRAME_EXPAND_Z = 5
FOLDER_FRAME_EXPAND_X_WAIT = 1
FOLDER_FRAME_EXPAND_X = 6
FOLDER_FRAME_GO_OUT = 4
FOLDER_FRAME_RESIZE_WAIT = 1
FOLDER_FRAME_RESIZE = 4
FOLDER_FRAME_OPEN_WAIT = 1
FOLDER_FRAME_OPEN= 4
folder_motion_list = [
FOLDER_FRAME_START_MARGIN
, FOLDER_FRAME_EXPAND_Z_WAIT
, FOLDER_FRAME_EXPAND_Z
, FOLDER_FRAME_EXPAND_X_WAIT
, FOLDER_FRAME_EXPAND_X
, FOLDER_FRAME_GO_OUT
, FOLDER_FRAME_RESIZE_WAIT
, FOLDER_FRAME_RESIZE
, FOLDER_FRAME_OPEN_WAIT
, FOLDER_FRAME_OPEN
]
# Folder.Leaf Constants
FOLDER_REAF_X = 0
FOLDER_REAF_Y = -0.04
FOLDER_REAF_Z = -0.15682
FOLDER_REAF_OPEN = math.pi / 4
# Folder Name Constants
FOLDER_NAME_PREFIX = "FolderName_"
FOLDER_NAME_X_MARGIN = -0.2
FOLDER_NAME_Y_MARGIN = -0.2
FOLDER_NAME_SCALE_STOREGE = 0.03
FOLDER_NAME_ROT_X = -1 * math.pi / 9
FOLDER_NAME_FRAME_START_MARGIN = 48
FOLDER_NAME_FRAME_MOVE_X = 8
FOLDER_NAME_FRAME_RESIZE_WAIT = 4
FOLDER_NAME_FRAME_RESIZE = 8
FOLDER_NAME_FRAME_ROT_WAIT = 4
FOLDER_NAME_FRAME_ROT = 8
# Branch Constants
BRANCH_X_MARGIN = 0.5
BRANCH_Z_MARGIN = 0.2
# File Constants
FILE_X_MARGIN = 0.4
FILE_Y_MARGIN = 0
FILE_Z_MARGIN = 0
FILE_FRAME_START_MARGIN = 4
FILE_FRAME_Z_EXPAND = 12
FILE_FRAME_RESIZE_WAIT = 4
FILE_FRAME_RESIZE = 8
FILE_FRAME_X_ROT_WAIT = 4
FILE_FRAME_X_ROT = 8
FILE_FRAME_Y_EXPAND_WAIT = 4
FILE_FRAME_Y_EXPAND = 18
F_CURVE_X_LOC = 0
F_CURVE_Y_LOC = 1
F_CURVE_Z_LOC = 2
F_CURVE_X_ROT = 3
F_CURVE_Y_ROT = 4
F_CURVE_Z_ROT = 5
F_CURVE_X_SCA = 6
F_CURVE_Y_SCA = 7
F_CURVE_Z_SCA = 8
F_CURVE_ARRAY = 9
# Global dic
file_parent_dic = {}
folder_pos_dic = {ROOT_FOLDER_SHORT_NAME:("", 0, 0, 0)}
FOLDER_POS_PARENT_FOLDER_NAME = 0
FOLDER_POS_INDEX = 1
FOLDER_POS_LEVEL = 2
FOLDER_POS_ABSOLUTE_INDEX = 3
folder_num_name_dic = {"":"", ROOT_FOLDER_SHORT_NAME:ROOT_FOLDER_SHORT_NAME}
file_cnt_dic = {}
folder_end_frame_dic = {ROOT_FOLDER_SHORT_NAME:START_FRAME}
# Global list
level1_folder_list = []
# Global params
folder_absolute_index = 0
# File I/O
FOLDER_LIST_FILE_NAME="FolderList.txt"
root_path = bpy.path.abspath("//") + "data/"
text_file = open(root_path + FOLDER_LIST_FILE_NAME, mode = 'w')
def get_file_num_name(folder_name):
folder_num_name = folder_num_name_dic[folder_name]
file_num_name = NEW_FILE_NAME + folder_num_name[-FOLDER_ZFILL:]
return file_num_name
def convert_folder_id(folder):
ret = folder.replace(ROOT_FOLDER_ORG_NAME, ROOT_FOLDER_SHORT_NAME)
ret = ret.replace(os.sep, FOLDER_SPLITTER)
return ret
def clear_old_breakpoints(fcurve):
old_keyframe_index_list = []
for i, point in enumerate(fcurve.keyframe_points):
if point.co[0] != START_FRAME:
old_keyframe_index_list.append(i)
if len(old_keyframe_index_list) > 0:
old_keyframe_index_list.reverse()
for i in old_keyframe_index_list:
fcurve.keyframe_points.remove(fcurve.keyframe_points[i])
fcurve.update()
def clear_all_old_breakpoints(fcurves):
clear_old_breakpoints(fcurves[F_CURVE_X_LOC])
clear_old_breakpoints(fcurves[F_CURVE_Y_LOC])
clear_old_breakpoints(fcurves[F_CURVE_Z_LOC])
clear_old_breakpoints(fcurves[F_CURVE_X_ROT])
clear_old_breakpoints(fcurves[F_CURVE_Y_ROT])
clear_old_breakpoints(fcurves[F_CURVE_Z_ROT])
clear_old_breakpoints(fcurves[F_CURVE_X_SCA])
clear_old_breakpoints(fcurves[F_CURVE_Y_SCA])
clear_old_breakpoints(fcurves[F_CURVE_Z_SCA])
def clear_file_all_old_breakpoints(fcurves):
clear_all_old_breakpoints(fcurves)
clear_old_breakpoints(fcurves[F_CURVE_ARRAY])
def add_location_key_frame(fcurves, frame, x, y, z):
add_keyframe_point(fcurves[F_CURVE_X_LOC], frame, x)
add_keyframe_point(fcurves[F_CURVE_Y_LOC], frame, y)
add_keyframe_point(fcurves[F_CURVE_Z_LOC], frame, z)
def add_rotation_key_frame(fcurves, frame, x, y, z):
add_keyframe_point(fcurves[F_CURVE_X_ROT], frame, x)
add_keyframe_point(fcurves[F_CURVE_Y_ROT], frame, y)
add_keyframe_point(fcurves[F_CURVE_Z_ROT], frame, z)
def add_scale_key_frame(fcurves, frame, x, y, z):
add_keyframe_point(fcurves[F_CURVE_X_SCA], frame, x)
add_keyframe_point(fcurves[F_CURVE_Y_SCA], frame, y)
add_keyframe_point(fcurves[F_CURVE_Z_SCA], frame, z)
def add_array_key_frame(fcurves, frame, val):
add_keyframe_point(fcurves[F_CURVE_ARRAY], frame, val)
# get file list
file_list = []
for root, folders, files in os.walk(ROOT_FOLDER):
root = os.path.relpath(root, ROOT_FOLDER)
if root == '.': root = ''
parent_folder = convert_folder_id(root)
file_list.append([root, sorted(folders), sorted(files), parent_folder])
def print_file(file_name, level_list, last):
"""
print fileName
"""
t = ''
if len(level_list): t += ' '
if len(level_list) >= 2:
for b in level_list[1:]:
if b:
t += ' '
else:
t += '|'
if len(level_list):
if last:
t += '-'
else:
t += '+'
print(t + file_name)
text_file.write(t + file_name + '\n')
def dupObject(src_name, dup_name):
"""
duplidate object
"""
if bpy.data.objects.find(dup_name) < 0:
src_obj = bpy.data.objects[src_name]
# Select object
bpy.ops.object.select_all(action='DESELECT')
src_obj.select = True
bpy.ops.object.duplicate(linked=True)
new_obj = bpy.data.objects[src_name + '.001']
new_obj.name = dup_name
def create_folder_num_name(folder_name):
if folder_name not in folder_num_name_dic:
folder_num_name_dic[folder_name] = NEW_FOLDER_NAME \
+ str(len(folder_num_name_dic) + 1).zfill(FOLDER_ZFILL)
def create_action(object_name):
action_name = object_name + ACTION_SUFFIX
if bpy.data.actions.find(action_name) < 0:
new_action = bpy.data.actions[SEED_ACTION].copy()
new_action.name = action_name
bpy.data.objects[object_name].animation_data.action = new_action
else:
bpy.data.objects[object_name].animation_data.action = \
bpy.data.actions[action_name]
def create_file_action(object_name):
action_name = object_name + ACTION_SUFFIX
# Enable Hire when f-cureve inclease .etc
#if bpy.data.actions.find(action_name) > 0:
# bpy.data.actions.remove(bpy.data.actions[action_name])
if bpy.data.actions.find(action_name) < 0:
new_action = bpy.data.actions[FILE_SEED_ACTION].copy()
new_action.name = action_name
bpy.data.objects[object_name].animation_data.action = new_action
else:
bpy.data.objects[object_name].animation_data.action = \
bpy.data.actions[action_name]
def get_branch_num_name(folder_name):
folder_num_name = folder_num_name_dic[folder_name]
return folder_num_name.replace(NEW_FOLDER_NAME, NEW_BRANCH_NAME)
def get_branch_h_num_name(folder_name):
folder_num_name = folder_num_name_dic[folder_name]
return folder_num_name.replace(NEW_FOLDER_NAME, NEW_BRANCH_H_NAME)
def get_folder_leaf_num_name(folder_name):
folder_num_name = folder_num_name_dic[folder_name]
return folder_num_name.replace(NEW_FOLDER_NAME, NEW_FOLDER_LEAF_NAME)
def get_folder_index(folder_num_name):
if folder_num_name == ROOT_FOLDER_SHORT_NAME or folder_num_name == "":
return 0
return int(folder_num_name.replace(NEW_FOLDER_NAME, ""))
def create_folder_mesh(parent_folder_name, folder_name):
"""
create folder mesh
"""
create_folder_num_name(folder_name)
# duplicate object
num_name = folder_num_name_dic[folder_name]
# delete org
# Enable hire when you want to delete objects
#if bpy.data.objects.find(num_name) > 0:
# bpy.ops.object.select_all(action= 'DESELECT')
# bpy.data.objects[num_name].select = True
# bpy.ops.object.delete()
dupObject(SEED_FOLDER_NAME , num_name)
# Enable Render
bpy.data.objects[num_name].hide_render = False
# Create new Action on new Object
create_action(num_name)
act = bpy.data.objects[num_name].animation_data.action
# remove old keyframes
clear_all_old_breakpoints(act.fcurves)
# set start location
add_location_key_frame(act.fcurves, START_FRAME, 0, 0, 0)
# set start scale
add_scale_key_frame(act.fcurves, START_FRAME, FOLDER_STORAGE_SCALE,\
FOLDER_STORAGE_SCALE, FOLDER_STORAGE_SCALE)
def create_folder_leaf_mesh(parent_folder_name, folder_name):
"""
create folder leaf mesh
"""
# GetName
folder_leaf_num_name = get_folder_leaf_num_name(folder_name)
# delete org
# Enable hire when you want to delete objects
#if bpy.data.objects.find(folder_leaf_num_name) > 0:
# bpy.ops.object.select_all(action='DESELECT')
# bpy.data.objects[num_name].select = True
# bpy.ops.object.delete()
dupObject(SEED_FOLDER_LEAF_NAME , folder_leaf_num_name)
print(folder_leaf_num_name)
set_obj_parent(folder_num_name_dic[folder_name], folder_leaf_num_name)
# Enable Render
bpy.data.objects[folder_leaf_num_name].hide_render = False
# Create new Action on new Object
create_action(folder_leaf_num_name)
act = bpy.data.objects[folder_leaf_num_name].animation_data.action
# remove old keyframes
clear_all_old_breakpoints(act.fcurves)
# set start location
add_location_key_frame(act.fcurves, START_FRAME, FOLDER_REAF_X, \
FOLDER_REAF_Y, FOLDER_REAF_Z)
# set start rotation
add_rotation_key_frame(act.fcurves, START_FRAME, 0, 0, 0)
# set start scale
add_scale_key_frame(act.fcurves, START_FRAME, 1, 1, 1)
def create_branch_mesh(parent_folder_name, folder_name):
"""
create branch mesh
"""
# duplicate object
branch_num_name = get_branch_num_name(folder_name)
dupObject(SEED_BRANCH_NAME , branch_num_name)
# Enable Render
bpy.data.objects[branch_num_name].hide_render = False
# Create new Action on new Object
create_action(branch_num_name)
act = bpy.data.objects[branch_num_name].animation_data.action
# remove old keyframes
clear_all_old_breakpoints(act.fcurves)
# set start location
add_location_key_frame(act.fcurves, START_FRAME, 0, 0, 0)
# set start scale
add_scale_key_frame(act.fcurves, START_FRAME, SCALE_STORAGE, SCALE_STORAGE,\
SCALE_STORAGE)
def create_branch_h_mesh(parent_folder_name, folder_name):
"""
create branch mesh
"""
# duplicate object
branch_h_num_name = get_branch_h_num_name(folder_name)
dupObject(SEED_BRANCH_NAME , branch_h_num_name)
# Enable Render
bpy.data.objects[branch_h_num_name].hide_render = False
# Create new Action on new Object
create_action(branch_h_num_name)
act = bpy.data.objects[branch_h_num_name].animation_data.action
# remove old keyframes
clear_all_old_breakpoints(act.fcurves)
# set start location
add_location_key_frame(act.fcurves, START_FRAME, 0, 0, 0)
# set start scale
add_scale_key_frame(act.fcurves, START_FRAME, SCALE_STORAGE, SCALE_STORAGE,\
SCALE_STORAGE)
def create_file_mesh(file_name):
"""
create file mesh
"""
# delete org
# Enable hire when you want to delete objects
#if bpy.data.objects.find(file_name) > 0:
# bpy.ops.object.select_all(action='DESELECT')
# bpy.data.objects[file_name].select = True
# bpy.ops.object.delete()
# duplicate object
dupObject(SEED_FILE_NAME , file_name)
# Enable Render
bpy.data.objects[file_name].hide_render = False
# Create new Action on new Object
create_file_action(file_name)
act = bpy.data.objects[file_name].animation_data.action
# remove old keyframes
clear_file_all_old_breakpoints(act.fcurves)
# set start location
add_location_key_frame(act.fcurves, START_FRAME, 0, 0, 0)
# set start rotation
add_rotation_key_frame(act.fcurves, START_FRAME, 0, 0, 0)
# set start scale
add_scale_key_frame(act.fcurves, START_FRAME, SCALE_STORAGE, SCALE_STORAGE, SCALE_STORAGE)
# set start array count
add_array_key_frame(act.fcurves, START_FRAME, 1)
def set_obj_parent(parent_name, obj_name):
"""
set parent on object
"""
# set parent
if parent_name != "":
obj = bpy.data.objects[obj_name]
# set parent
obj.parent = bpy.data.objects[parent_name]
def func_main(arg, level_list):
"""
MAIN
"""
global folder_absolute_index
root, folders, files, parent_folder = arg
folder_len = len(folders)
file_len = len(files)
# Output subfolder
for i, folder_name in enumerate(folders):
nounder = (i == folder_len - 1 and file_len == 0)
folder_id = folder_name
# Replace root folder name to short name
if folder_id == ROOT_FOLDER_ORG_NAME:
folder_id = ROOT_FOLDER_SHORT_NAME
if parent_folder != "":
folder_id = parent_folder + FOLDER_SPLITTER + folder_id
create_folder_mesh(parent_folder, folder_id)
create_folder_leaf_mesh(parent_folder, folder_id)
create_branch_mesh(parent_folder, folder_id)
create_branch_h_mesh(parent_folder, folder_id)
print_file('<' + folder_id + '>', level_list, nounder)
level = len(level_list)
folder_pos_dic[folder_id] = (parent_folder, i, level, \
folder_absolute_index)
if level == 1:
level1_folder_list.append(folder_id)
folder_absolute_index += 1
# Output subfolder's subfolder
under_root = os.path.join(root, folder_name)
under_list = []
for t in file_list:
if t[0] == under_root:
under_list.append(t)
for j, t in enumerate(under_list):
if nounder and j == len(under_list) - 1:
add = [True]
else:
add = [False]
func_main(t, level_list + add)
# Output files
for i, file_name in enumerate(files):
file_id = parent_folder + FOLDER_SPLITTER + file_name
print_file(file_id, level_list, (i == file_len - 1))
file_cnt = len(files)
if file_cnt > 0:
file_num_name = get_file_num_name(parent_folder)
create_file_mesh(file_num_name)
file_cnt_dic[parent_folder] = (file_num_name, file_cnt)
def add_keyframe_point(fcurve, frame, value):
# find same frame keyframe_point
index = 0
find_frame = False
for i, point in enumerate(fcurve.keyframe_points):
if point.co[0] == frame:
index = i
find_frame = True
break
if find_frame == False:
# add keyframe_point when same frame not found
fcurve.keyframe_points.add(1)
index = len(fcurve.keyframe_points) - 1
# setup keyframe
fcurve.keyframe_points[index].type = "BREAKDOWN"
fcurve.keyframe_points[index].co = frame, value
fcurve.keyframe_points[index].handle_left = frame - 0.5, value
fcurve.keyframe_points[index].handle_right = frame + 0.5, value
def setupFolders(max_start_frame):
# reset root folder size
act = bpy.data.objects[ROOT_FOLDER_SHORT_NAME].animation_data.action
# set start scale
add_scale_key_frame(act.fcurves, 1000, SCALE_NORMAL, SCALE_NORMAL, SCALE_NORMAL)
for folder_name, pos in folder_pos_dic.items():
parent_folder_name, index, level, absolute_index = pos
folder_num_name = folder_num_name_dic[folder_name]
folder_index = get_folder_index(folder_num_name);
# Setup folder Name on Level 0, 1 Folders
if level <= 1:
# Get Folder Name Object's ID
folder_name_id = FOLDER_NAME_PREFIX + folder_num_name
# Set parent object
set_obj_parent(folder_num_name, folder_name_id)
# get fcurves
fcurves = bpy.data.objects[folder_name_id].animation_data.action.fcurves
# Clear old breakpoints
clear_all_old_breakpoints(fcurves)
# add Initial KeyFrame
frame = START_FRAME
add_location_key_frame(fcurves, frame, 0, 0, 0)
add_rotation_key_frame(fcurves, frame, 0, 0, 0)
add_scale_key_frame(fcurves, frame, FOLDER_NAME_SCALE_STOREGE, \
FOLDER_NAME_SCALE_STOREGE, FOLDER_NAME_SCALE_STOREGE)
# add Move x Start key Frame
frame += (level + index) * sum(folder_motion_list) \
+ FOLDER_NAME_FRAME_START_MARGIN
add_location_key_frame(fcurves, frame, 0, 0, 0)
# add Move x End key Frame
frame += FOLDER_NAME_FRAME_MOVE_X
add_location_key_frame(fcurves, frame, FOLDER_NAME_X_MARGIN, \
FOLDER_NAME_Y_MARGIN, 0)
# add Resize wait key frame
frame += FOLDER_NAME_FRAME_RESIZE_WAIT
add_scale_key_frame(fcurves, frame, FOLDER_NAME_SCALE_STOREGE, \
FOLDER_NAME_SCALE_STOREGE, FOLDER_NAME_SCALE_STOREGE)
# add Resize end key frame
frame += FOLDER_NAME_FRAME_RESIZE
add_scale_key_frame(fcurves, frame, 1, 1, 1)
# add Rotation wait key frame
frame += FOLDER_NAME_FRAME_ROT_WAIT
add_rotation_key_frame(fcurves, frame, 0, 0, 0)
# add Rotaion end key frame
frame += FOLDER_NAME_FRAME_ROT
add_rotation_key_frame(fcurves, frame, FOLDER_NAME_ROT_X, 0, 0)
fcurves.update()
# set parent object
branch_num_name = get_branch_num_name(folder_name)
branch_h_num_name = get_branch_h_num_name(folder_name)
if folder_name != ROOT_FOLDER_SHORT_NAME:
set_obj_parent(folder_num_name_dic[parent_folder_name], branch_num_name)
set_obj_parent(folder_num_name_dic[parent_folder_name], branch_h_num_name)
set_obj_parent(folder_num_name_dic[parent_folder_name], folder_num_name)
# Calclate folder relative index
parent_absolute_index = 0
if parent_folder_name != "":
parent_absolute_index = \
folder_pos_dic[parent_folder_name][FOLDER_POS_ABSOLUTE_INDEX]
relative_index = absolute_index - parent_absolute_index
if relative_index == 0:
relative_index = 1
# calc start frame
parent_folder_index = 0
if parent_folder_name != ROOT_FOLDER_SHORT_NAME :
parent_folder_index = get_folder_index(folder_num_name_dic[parent_folder_name])
frame = START_FRAME + (level + index) * sum(folder_motion_list)
# get fcurves
branch_fcurves = bpy.data.objects[branch_num_name].animation_data.action.fcurves
brnc_h_fcurves = bpy.data.objects[branch_h_num_name].animation_data.action.fcurves
folder_fcurves = bpy.data.objects[folder_num_name].animation_data.action.fcurves
start_frame = frame
# add move start key_frame
frame += FOLDER_FRAME_START_MARGIN
add_location_key_frame(branch_fcurves, frame, 0, 0, 0)
add_rotation_key_frame(branch_fcurves, frame, 0, 0, 0)
add_rotation_key_frame(brnc_h_fcurves, frame, 0, math.pi / 2, 0)
add_location_key_frame(folder_fcurves, frame, 0, 0, 0)
# add expand z wait key_frame
frame += FOLDER_FRAME_EXPAND_Z_WAIT
add_scale_key_frame(branch_fcurves, frame, 1, 1, 1)
add_location_key_frame(brnc_h_fcurves, frame, 0, 0, 0)
add_location_key_frame(folder_fcurves, frame, 0, 0, 0)
# calc 1st Z add_location_key_frame
z_loc_0010 = FOLDER_Z_MARGIN * index
if folder_name == ROOT_FOLDER_SHORT_NAME:
z_loc_0010 = FOLDER_Z_MARGIN * 2
# add expand z end key_frame
frame += FOLDER_FRAME_EXPAND_Z
add_scale_key_frame(branch_fcurves, frame, 1, 1, z_loc_0010 * 100)
add_location_key_frame(brnc_h_fcurves, frame, 0, 0, z_loc_0010)
add_location_key_frame(folder_fcurves, frame, 0, 0, z_loc_0010)
# add expand x wait key_frame
frame += FOLDER_FRAME_EXPAND_X_WAIT
add_scale_key_frame(brnc_h_fcurves, frame, 1, 1, 1)
add_location_key_frame(folder_fcurves, frame, 0, 0, z_loc_0010)
# add expand x end key_frame
frame += FOLDER_FRAME_EXPAND_X
add_scale_key_frame(brnc_h_fcurves, frame, 1, 1, \
FOLDER_X_MARGIN * 100)
add_location_key_frame(folder_fcurves, frame, FOLDER_X_MARGIN, 0, \
z_loc_0010)
# add go out key_frame
frame += FOLDER_FRAME_GO_OUT
add_location_key_frame(folder_fcurves, frame, \
FOLDER_X_MARGIN + FOLDER_X_POS_START, 0, z_loc_0010)
# add resize wait key_frame
frame += FOLDER_FRAME_RESIZE_WAIT
add_location_key_frame(folder_fcurves, frame,
FOLDER_X_MARGIN + FOLDER_X_POS_START, 0, \
z_loc_0010)
add_scale_key_frame(folder_fcurves, frame, FOLDER_STORAGE_SCALE, \
FOLDER_STORAGE_SCALE, FOLDER_STORAGE_SCALE)
# add resize key_frame
frame += FOLDER_FRAME_RESIZE
add_location_key_frame(folder_fcurves, frame, \
FOLDER_X_MARGIN + FOLDER_X_POS_END, 0, z_loc_0010)
add_scale_key_frame(folder_fcurves, frame, SCALE_NORMAL, \
SCALE_NORMAL, SCALE_NORMAL)
# add folder motion end frame to dic
folder_end_frame_dic[folder_name] = frame
# add Z move end key frame
z_loc_0020 = FOLDER_Z_MARGIN * relative_index
if folder_name == ROOT_FOLDER_SHORT_NAME:
z_loc_0020 = FOLDER_Z_MARGIN * 2
frame = max_start_frame
add_location_key_frame(folder_fcurves, frame, \
FOLDER_X_MARGIN + FOLDER_X_POS_END, 0, z_loc_0020)
add_location_key_frame(brnc_h_fcurves, frame, 0, 0, z_loc_0020)
add_scale_key_frame(branch_fcurves, frame, 1, 1, z_loc_0020 * 100)
# write log
text_file.write(folder_num_name + "RelativeIndex:" + str(relative_index).zfill(4) \
+ "Level:" + str(level).zfill(3) \
+ "StartFrame:" + str(start_frame) + "EndFrame:" + str(frame) \
+ "index:" + str(index).zfill(3) \
+ "ParentFolder:" + parent_folder_name + " MyName:" + folder_name \
+ '\n')
# update fcurve
branch_fcurves.update()
folder_fcurves.update()
def setupFiles():
for parent_folder, val in file_cnt_dic.items():
file_num_name, file_cnt = val
folder_leaf_num_name = get_folder_leaf_num_name(parent_folder)
# Set parent object
set_obj_parent(folder_num_name_dic[parent_folder], file_num_name)
# get fcurves
fcurves = bpy.data.objects[file_num_name].animation_data.action.fcurves
folder_leaf_fcurves = \
bpy.data.objects[folder_leaf_num_name].animation_data.action.fcurves
# get start frame
frame = folder_end_frame_dic[parent_folder]
# add open wait key_frame
frame += FOLDER_FRAME_OPEN_WAIT
add_rotation_key_frame(folder_leaf_fcurves, frame, 0, 0, 0)
# add open key_frame
frame += FOLDER_FRAME_OPEN
add_rotation_key_frame(folder_leaf_fcurves, frame, FOLDER_REAF_OPEN, \
0, 0)
# add move start key frame
frame += FILE_FRAME_START_MARGIN
add_location_key_frame(fcurves, frame, 0, 0, 0)
# add z expand end keyFrame
frame += FILE_FRAME_Z_EXPAND
add_location_key_frame(fcurves, frame, FILE_X_MARGIN, 0, 0)
# add resize wait keyFrame
frame += FILE_FRAME_RESIZE_WAIT
add_scale_key_frame(fcurves, frame, SCALE_STORAGE, SCALE_STORAGE, \
SCALE_STORAGE)
# add resize end keyFrame
frame += FILE_FRAME_RESIZE
add_scale_key_frame(fcurves, frame, SCALE_NORMAL, SCALE_NORMAL, \
SCALE_NORMAL)
# add x rot WAIT key frame
frame += FILE_FRAME_X_ROT_WAIT
add_rotation_key_frame(fcurves, frame, 0, 0, 0)
# add x rot end key frame
frame += FILE_FRAME_X_ROT
add_location_key_frame(fcurves, frame, FILE_X_MARGIN, 0, 0)
add_rotation_key_frame(fcurves, frame, math.pi, math.pi / 2, 0 )
# add y expand wait key frame
frame += FILE_FRAME_Y_EXPAND_WAIT
add_array_key_frame(fcurves, frame, 1)
# add y expand end key frame
frame += FILE_FRAME_Y_EXPAND
add_array_key_frame(fcurves, frame, file_cnt)
# update fcurve
fcurves.update()
# START
print("### start ###")
create_folder_mesh("", ROOT_FOLDER_SHORT_NAME)
func_main(file_list.pop(0), [])
# calc max start frame
max_start_frame = 0
for folder_name, pos in folder_pos_dic.items():
parent_folder_name, index, level, absolute_index = pos
frame = START_FRAME + (level + index) * sum(folder_motion_list)
if frame > max_start_frame:
max_start_frame = frame
setupFolders(max_start_frame)
setupFiles()
text_file.close()
print("### end ###")
| [
1,
529,
276,
1112,
420,
29958,
8924,
2679,
638,
834,
331,
11411,
29914,
29903,
287,
1056,
29896,
29889,
29900,
29966,
9507,
29958,
4351,
29914,
4691,
29914,
3258,
29918,
12083,
29918,
8336,
29889,
2272,
13,
29937,
1738,
29933,
20055,
13,
29937,
448,
29930,
29899,
14137,
29901,
18351,
29899,
29947,
448,
29930,
29899,
13,
29937,
6204,
383,
3194,
15472,
13,
29937,
13,
29937,
6204,
4669,
29879,
669,
12027,
29876,
7002,
7142,
291,
13,
29937,
13,
29937,
29871,
29906,
29900,
29896,
29929,
29889,
29900,
29941,
29889,
29896,
29906,
19259,
2679,
638,
834,
331,
11411,
13,
29937,
13,
13,
5215,
289,
2272,
13,
5215,
2897,
13,
5215,
5844,
13,
13,
29937,
8707,
1254,
13566,
8079,
349,
1718,
25797,
4945,
29903,
13,
29943,
5607,
8032,
29918,
5550,
29931,
1806,
4945,
353,
11119,
29908,
13,
1660,
3352,
29918,
29943,
5607,
8032,
29918,
5813,
353,
525,
12924,
29915,
13,
1660,
3352,
29918,
29943,
5607,
8032,
29918,
1307,
5098,
29918,
5813,
353,
525,
12924,
29889,
3226,
2142,
29915,
13,
1660,
3352,
29918,
7724,
29918,
5813,
353,
525,
2283,
29915,
13,
1660,
3352,
29918,
15176,
2190,
3210,
29918,
5813,
353,
525,
29933,
4014,
29915,
13,
21289,
29918,
29943,
5607,
8032,
353,
376,
29907,
8419,
29903,
10363,
29914,
2204,
1581,
29908,
13,
21289,
29918,
29943,
5607,
8032,
29918,
1955,
29954,
29918,
5813,
353,
376,
2204,
1581,
29899,
29906,
29889,
29955,
29929,
29890,
29908,
13,
29937,
5012,
29943,
15842,
17067,
1254,
13,
29937,
21289,
29918,
29943,
5607,
8032,
353,
376,
29907,
8419,
7050,
29914,
12083,
29918,
8336,
29918,
1688,
12975,
13,
29937,
21289,
29918,
29943,
5607,
8032,
29918,
1955,
29954,
29918,
5813,
353,
376,
4632,
29908,
13,
21289,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
353,
376,
12924,
29918,
29900,
29900,
29900,
29896,
29908,
13,
13,
24705,
29918,
14605,
29943,
25634,
353,
525,
4276,
29915,
13,
1660,
3352,
29918,
24705,
353,
525,
12924,
4276,
29915,
13,
7724,
29918,
1660,
3352,
29918,
24705,
353,
525,
2283,
4276,
29915,
13,
13,
28577,
29918,
29943,
5607,
8032,
29918,
5813,
353,
525,
12924,
29918,
29915,
13,
29943,
5607,
8032,
29918,
29999,
3738,
2208,
353,
29871,
29946,
13,
28577,
29918,
7724,
29918,
5813,
353,
525,
2283,
29918,
29915,
13,
7724,
29918,
29999,
3738,
2208,
353,
29871,
29947,
13,
28577,
29918,
15176,
2190,
3210,
29918,
5813,
353,
525,
29933,
4014,
29918,
29915,
13,
28577,
29918,
15176,
2190,
3210,
29918,
29950,
29918,
5813,
353,
525,
29933,
4014,
29918,
29882,
29918,
29915,
13,
28577,
29918,
29943,
5607,
8032,
29918,
1307,
5098,
29918,
5813,
353,
376,
12924,
29889,
3226,
2142,
27508,
13,
13,
25826,
29918,
29943,
4717,
2303,
353,
29871,
29941,
29900,
29900,
29900,
13,
29943,
7024,
353,
29871,
29896,
29906,
13,
29903,
5454,
1307,
29918,
1254,
1955,
10461,
353,
29871,
29900,
29889,
29945,
13,
29903,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
353,
29871,
29896,
29889,
29900,
13,
13,
29937,
383,
3194,
5798,
1934,
13,
29943,
5607,
8032,
29918,
29990,
29918,
24815,
29918,
25826,
353,
29871,
29900,
29889,
29900,
29906,
13,
29943,
5607,
8032,
29918,
29990,
29918,
24815,
29918,
11794,
353,
29871,
29900,
29889,
29906,
13,
29943,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
29889,
29955,
13,
29943,
5607,
8032,
29918,
29979,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
29889,
29955,
13,
29943,
5607,
8032,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
29889,
29946,
29947,
13,
29943,
5607,
8032,
29918,
1307,
29963,
6670,
29896,
29918,
29979,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29906,
13,
13,
29943,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
353,
29871,
29900,
29889,
29900,
29906,
13,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29896,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29999,
29918,
12982,
1806,
353,
29871,
29900,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29999,
353,
29871,
29945,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29990,
29918,
12982,
1806,
353,
29871,
29896,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29990,
353,
29871,
29953,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
17080,
29918,
12015,
353,
29871,
29946,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
353,
29871,
29896,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
353,
29871,
29946,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
4590,
1430,
29918,
12982,
1806,
353,
29871,
29896,
13,
29943,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
4590,
1430,
29922,
29871,
29946,
13,
12083,
29918,
29885,
8194,
29918,
1761,
353,
518,
13,
418,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29999,
29918,
12982,
1806,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29999,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29990,
29918,
12982,
1806,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29990,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
17080,
29918,
12015,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
4590,
1430,
29918,
12982,
1806,
13,
1678,
1919,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
4590,
1430,
13,
1678,
4514,
13,
13,
29937,
383,
3194,
29889,
3226,
2142,
5798,
1934,
13,
29943,
5607,
8032,
29918,
1525,
5098,
29918,
29990,
353,
29871,
29900,
13,
29943,
5607,
8032,
29918,
1525,
5098,
29918,
29979,
353,
448,
29900,
29889,
29900,
29946,
13,
29943,
5607,
8032,
29918,
1525,
5098,
29918,
29999,
353,
448,
29900,
29889,
29896,
29945,
29953,
29947,
29906,
13,
29943,
5607,
8032,
29918,
1525,
5098,
29918,
4590,
1430,
353,
5844,
29889,
1631,
847,
29871,
29946,
13,
13,
13,
29937,
383,
3194,
4408,
5798,
1934,
13,
29943,
5607,
8032,
29918,
5813,
29918,
15094,
25634,
353,
376,
12924,
1170,
27508,
13,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
353,
448,
29900,
29889,
29906,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29979,
29918,
1529,
29934,
29954,
1177,
353,
448,
29900,
29889,
29906,
13,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
353,
29871,
29900,
29889,
29900,
29941,
13,
29943,
5607,
8032,
29918,
5813,
29918,
1672,
29911,
29918,
29990,
353,
448,
29896,
334,
5844,
29889,
1631,
847,
29871,
29929,
13,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29946,
29947,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
6720,
12064,
29918,
29990,
353,
29871,
29947,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
353,
29871,
29946,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
353,
29871,
29947,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1672,
29911,
29918,
12982,
1806,
353,
29871,
29946,
13,
29943,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1672,
29911,
353,
29871,
29947,
13,
13,
29937,
25889,
5798,
1934,
13,
15176,
2190,
3210,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
29889,
29945,
13,
15176,
2190,
3210,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
29889,
29906,
13,
13,
29937,
3497,
5798,
1934,
13,
7724,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
29889,
29946,
13,
7724,
29918,
29979,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
13,
7724,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29900,
13,
13,
7724,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
353,
29871,
29946,
13,
7724,
29918,
29943,
4717,
2303,
29918,
29999,
29918,
5746,
29925,
9468,
353,
29871,
29896,
29906,
13,
7724,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
353,
29871,
29946,
13,
7724,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
353,
29871,
29947,
13,
7724,
29918,
29943,
4717,
2303,
29918,
29990,
29918,
1672,
29911,
29918,
12982,
1806,
353,
29871,
29946,
13,
7724,
29918,
29943,
4717,
2303,
29918,
29990,
29918,
1672,
29911,
353,
29871,
29947,
13,
7724,
29918,
29943,
4717,
2303,
29918,
29979,
29918,
5746,
29925,
9468,
29918,
12982,
1806,
353,
29871,
29946,
13,
7724,
29918,
29943,
4717,
2303,
29918,
29979,
29918,
5746,
29925,
9468,
353,
29871,
29896,
29947,
13,
13,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
16652,
353,
29871,
29900,
13,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
16652,
353,
29871,
29896,
13,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
16652,
353,
29871,
29906,
13,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
1672,
29911,
353,
29871,
29941,
13,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
1672,
29911,
353,
29871,
29946,
13,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
1672,
29911,
353,
29871,
29945,
13,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
29903,
5454,
353,
29871,
29953,
13,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
29903,
5454,
353,
29871,
29955,
13,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
29903,
5454,
353,
29871,
29947,
13,
29943,
29918,
22484,
12064,
29918,
1718,
22800,
353,
29871,
29929,
13,
13,
29937,
12002,
12124,
13,
1445,
29918,
3560,
29918,
27774,
353,
6571,
13,
12083,
29918,
1066,
29918,
27774,
353,
426,
21289,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29901,
703,
613,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
2915,
13,
29943,
5607,
8032,
29918,
24815,
29918,
16320,
3919,
29918,
29943,
5607,
8032,
29918,
5813,
353,
29871,
29900,
13,
29943,
5607,
8032,
29918,
24815,
29918,
27992,
353,
29871,
29896,
13,
29943,
5607,
8032,
29918,
24815,
29918,
1307,
29963,
6670,
353,
29871,
29906,
13,
29943,
5607,
8032,
29918,
24815,
29918,
2882,
29903,
5607,
26027,
29918,
27992,
353,
29871,
29941,
13,
13,
12083,
29918,
1949,
29918,
978,
29918,
27774,
353,
8853,
4710,
613,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29901,
21289,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29913,
13,
1445,
29918,
20047,
29918,
27774,
353,
6571,
13,
12083,
29918,
355,
29918,
2557,
29918,
27774,
353,
426,
21289,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29901,
25826,
29918,
29943,
4717,
2303,
29913,
13,
13,
29937,
12002,
1051,
13,
5563,
29896,
29918,
12083,
29918,
1761,
353,
5159,
13,
13,
29937,
12002,
8636,
13,
12083,
29918,
23552,
29918,
2248,
353,
29871,
29900,
13,
13,
29937,
3497,
306,
29914,
29949,
13,
29943,
5607,
8032,
29918,
24360,
29918,
7724,
29918,
5813,
543,
12924,
1293,
29889,
3945,
29908,
13,
4632,
29918,
2084,
353,
289,
2272,
29889,
2084,
29889,
370,
1028,
493,
703,
458,
1159,
718,
376,
1272,
12975,
13,
726,
29918,
1445,
353,
1722,
29898,
4632,
29918,
2084,
718,
383,
5607,
8032,
29918,
24360,
29918,
7724,
29918,
5813,
29892,
4464,
353,
525,
29893,
1495,
13,
13,
13,
1753,
679,
29918,
1445,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
1125,
13,
1678,
4138,
29918,
1949,
29918,
978,
353,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
13,
1678,
934,
29918,
1949,
29918,
978,
353,
29091,
29918,
7724,
29918,
5813,
718,
4138,
29918,
1949,
29918,
978,
14352,
29943,
5607,
8032,
29918,
29999,
3738,
2208,
17531,
13,
1678,
736,
934,
29918,
1949,
29918,
978,
13,
13,
13,
13,
1753,
3588,
29918,
12083,
29918,
333,
29898,
12083,
1125,
13,
13,
1678,
3240,
353,
4138,
29889,
6506,
29898,
21289,
29918,
29943,
5607,
8032,
29918,
1955,
29954,
29918,
5813,
29892,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29897,
13,
1678,
3240,
353,
3240,
29889,
6506,
29898,
359,
29889,
19570,
29892,
383,
5607,
8032,
29918,
5550,
29931,
1806,
4945,
29897,
13,
13,
1678,
736,
3240,
13,
13,
1753,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
345,
1125,
13,
1678,
2030,
29918,
1989,
2557,
29918,
2248,
29918,
1761,
353,
5159,
13,
13,
1678,
363,
474,
29892,
1298,
297,
26985,
29898,
29888,
2764,
345,
29889,
1989,
2557,
29918,
9748,
1125,
13,
4706,
565,
1298,
29889,
1111,
29961,
29900,
29962,
2804,
6850,
8322,
29918,
29943,
4717,
2303,
29901,
13,
9651,
2030,
29918,
1989,
2557,
29918,
2248,
29918,
1761,
29889,
4397,
29898,
29875,
29897,
13,
13,
1678,
565,
7431,
29898,
1025,
29918,
1989,
2557,
29918,
2248,
29918,
1761,
29897,
1405,
29871,
29900,
29901,
13,
4706,
2030,
29918,
1989,
2557,
29918,
2248,
29918,
1761,
29889,
24244,
580,
13,
4706,
363,
474,
297,
2030,
29918,
1989,
2557,
29918,
2248,
29918,
1761,
29901,
13,
9651,
285,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29889,
5992,
29898,
29888,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29961,
29875,
2314,
13,
4706,
285,
2764,
345,
29889,
5504,
580,
13,
13,
1753,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
1125,
13,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
16652,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
16652,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
16652,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
1672,
29911,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
1672,
29911,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
1672,
29911,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
29903,
5454,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
29903,
5454,
2314,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
29903,
5454,
2314,
13,
13,
1753,
2821,
29918,
1445,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
1125,
13,
1678,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29897,
13,
1678,
2821,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
1718,
22800,
2314,
13,
13,
1753,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
921,
29892,
343,
29892,
503,
1125,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
16652,
1402,
3515,
29892,
921,
29897,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
16652,
1402,
3515,
29892,
343,
29897,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
16652,
1402,
3515,
29892,
503,
29897,
13,
13,
1753,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
921,
29892,
343,
29892,
503,
1125,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
1672,
29911,
1402,
3515,
29892,
921,
29897,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
1672,
29911,
1402,
3515,
29892,
343,
29897,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
1672,
29911,
1402,
3515,
29892,
503,
29897,
13,
13,
1753,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
921,
29892,
343,
29892,
503,
1125,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29990,
29918,
29903,
5454,
1402,
3515,
29892,
921,
29897,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29979,
29918,
29903,
5454,
1402,
3515,
29892,
343,
29897,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
29999,
29918,
29903,
5454,
1402,
3515,
29892,
503,
29897,
13,
13,
1753,
788,
29918,
2378,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
659,
1125,
13,
1678,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
1960,
29961,
29943,
29918,
22484,
12064,
29918,
1718,
22800,
1402,
3515,
29892,
659,
29897,
13,
13,
13,
29937,
679,
934,
1051,
13,
1445,
29918,
1761,
353,
5159,
13,
1454,
3876,
29892,
16495,
29892,
2066,
297,
2897,
29889,
20919,
29898,
21289,
29918,
29943,
5607,
8032,
1125,
13,
1678,
3876,
353,
2897,
29889,
2084,
29889,
2674,
2084,
29898,
4632,
29892,
16641,
2891,
29918,
29943,
5607,
8032,
29897,
13,
1678,
565,
3876,
1275,
15300,
2396,
3876,
353,
6629,
13,
1678,
3847,
29918,
12083,
353,
3588,
29918,
12083,
29918,
333,
29898,
4632,
29897,
13,
1678,
934,
29918,
1761,
29889,
4397,
4197,
4632,
29892,
12705,
29898,
8771,
414,
511,
12705,
29898,
5325,
511,
3847,
29918,
12083,
2314,
13,
13,
13,
1753,
1596,
29918,
1445,
29898,
1445,
29918,
978,
29892,
3233,
29918,
1761,
29892,
1833,
1125,
13,
1678,
9995,
13,
1678,
1596,
29729,
13,
1678,
9995,
13,
1678,
260,
353,
6629,
13,
13,
1678,
565,
7431,
29898,
5563,
29918,
1761,
1125,
260,
4619,
525,
525,
13,
13,
1678,
565,
7431,
29898,
5563,
29918,
1761,
29897,
6736,
29871,
29906,
29901,
13,
4706,
363,
289,
297,
3233,
29918,
1761,
29961,
29896,
29901,
5387,
13,
9651,
565,
289,
29901,
13,
18884,
260,
4619,
525,
525,
13,
9651,
1683,
29901,
13,
18884,
260,
4619,
525,
29989,
29915,
13,
13,
1678,
565,
7431,
29898,
5563,
29918,
1761,
1125,
13,
4706,
565,
1833,
29901,
13,
9651,
260,
4619,
17411,
29915,
13,
4706,
1683,
29901,
13,
9651,
260,
4619,
525,
23097,
13,
13,
1678,
1596,
29898,
29873,
718,
934,
29918,
978,
29897,
13,
1678,
1426,
29918,
1445,
29889,
3539,
29898,
29873,
718,
934,
29918,
978,
718,
11297,
29876,
1495,
13,
13,
1753,
5141,
2061,
29898,
4351,
29918,
978,
29892,
5141,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
868,
572,
333,
403,
1203,
13,
1678,
9995,
13,
13,
1678,
565,
289,
2272,
29889,
1272,
29889,
12650,
29889,
2886,
29898,
20908,
29918,
978,
29897,
529,
29871,
29900,
29901,
13,
4706,
4765,
29918,
5415,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
4351,
29918,
978,
29962,
13,
13,
4706,
396,
7605,
1203,
13,
4706,
289,
2272,
29889,
3554,
29889,
3318,
29889,
2622,
29918,
497,
29898,
2467,
2433,
2287,
6404,
1495,
13,
4706,
4765,
29918,
5415,
29889,
2622,
353,
5852,
13,
13,
4706,
289,
2272,
29889,
3554,
29889,
3318,
29889,
20908,
5926,
29898,
2324,
287,
29922,
5574,
29897,
13,
4706,
716,
29918,
5415,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
4351,
29918,
978,
718,
15300,
29900,
29900,
29896,
2033,
13,
4706,
716,
29918,
5415,
29889,
978,
353,
5141,
29918,
978,
13,
13,
1753,
1653,
29918,
12083,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
1125,
13,
1678,
565,
4138,
29918,
978,
451,
297,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29901,
13,
4706,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
353,
29091,
29918,
29943,
5607,
8032,
29918,
5813,
320,
13,
9651,
718,
851,
29898,
2435,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29897,
718,
29871,
29896,
467,
29920,
5589,
29898,
29943,
5607,
8032,
29918,
29999,
3738,
2208,
29897,
13,
13,
1753,
1653,
29918,
2467,
29898,
3318,
29918,
978,
1125,
13,
1678,
3158,
29918,
978,
353,
1203,
29918,
978,
718,
319,
9838,
29918,
14605,
29943,
25634,
13,
1678,
565,
289,
2272,
29889,
1272,
29889,
7387,
29889,
2886,
29898,
2467,
29918,
978,
29897,
529,
29871,
29900,
29901,
13,
4706,
716,
29918,
2467,
353,
289,
2272,
29889,
1272,
29889,
7387,
29961,
1660,
3352,
29918,
24705,
1822,
8552,
580,
13,
4706,
716,
29918,
2467,
29889,
978,
353,
3158,
29918,
978,
13,
4706,
289,
2272,
29889,
1272,
29889,
12650,
29961,
3318,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
353,
716,
29918,
2467,
13,
1678,
1683,
29901,
13,
4706,
289,
2272,
29889,
1272,
29889,
12650,
29961,
3318,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
353,
320,
13,
9651,
289,
2272,
29889,
1272,
29889,
7387,
29961,
2467,
29918,
978,
29962,
13,
13,
1753,
1653,
29918,
1445,
29918,
2467,
29898,
3318,
29918,
978,
1125,
13,
1678,
3158,
29918,
978,
353,
1203,
29918,
978,
718,
319,
9838,
29918,
14605,
29943,
25634,
13,
1678,
396,
1174,
519,
379,
533,
746,
285,
29899,
29883,
545,
345,
5528,
1511,
869,
7070,
13,
1678,
396,
361,
289,
2272,
29889,
1272,
29889,
7387,
29889,
2886,
29898,
2467,
29918,
978,
29897,
1405,
29871,
29900,
29901,
13,
1678,
396,
1678,
289,
2272,
29889,
1272,
29889,
7387,
29889,
5992,
29898,
29890,
2272,
29889,
1272,
29889,
7387,
29961,
2467,
29918,
978,
2314,
13,
1678,
565,
289,
2272,
29889,
1272,
29889,
7387,
29889,
2886,
29898,
2467,
29918,
978,
29897,
529,
29871,
29900,
29901,
13,
4706,
716,
29918,
2467,
353,
289,
2272,
29889,
1272,
29889,
7387,
29961,
7724,
29918,
1660,
3352,
29918,
24705,
1822,
8552,
580,
13,
4706,
716,
29918,
2467,
29889,
978,
353,
3158,
29918,
978,
13,
4706,
289,
2272,
29889,
1272,
29889,
12650,
29961,
3318,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
353,
716,
29918,
2467,
13,
1678,
1683,
29901,
13,
4706,
289,
2272,
29889,
1272,
29889,
12650,
29961,
3318,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
353,
320,
13,
9651,
289,
2272,
29889,
1272,
29889,
7387,
29961,
2467,
29918,
978,
29962,
13,
13,
13,
1753,
679,
29918,
17519,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
1125,
13,
1678,
4138,
29918,
1949,
29918,
978,
353,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
13,
1678,
736,
4138,
29918,
1949,
29918,
978,
29889,
6506,
29898,
28577,
29918,
29943,
5607,
8032,
29918,
5813,
29892,
29091,
29918,
15176,
2190,
3210,
29918,
5813,
29897,
13,
13,
1753,
679,
29918,
17519,
29918,
29882,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
1125,
13,
1678,
4138,
29918,
1949,
29918,
978,
353,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
13,
1678,
736,
4138,
29918,
1949,
29918,
978,
29889,
6506,
29898,
28577,
29918,
29943,
5607,
8032,
29918,
5813,
29892,
29091,
29918,
15176,
2190,
3210,
29918,
29950,
29918,
5813,
29897,
13,
13,
1753,
679,
29918,
12083,
29918,
29500,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
1125,
13,
1678,
4138,
29918,
1949,
29918,
978,
353,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
13,
1678,
736,
4138,
29918,
1949,
29918,
978,
29889,
6506,
29898,
28577,
29918,
29943,
5607,
8032,
29918,
5813,
29892,
29091,
29918,
29943,
5607,
8032,
29918,
1307,
5098,
29918,
5813,
29897,
13,
13,
1753,
679,
29918,
12083,
29918,
2248,
29898,
12083,
29918,
1949,
29918,
978,
1125,
13,
1678,
565,
4138,
29918,
1949,
29918,
978,
1275,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
470,
4138,
29918,
1949,
29918,
978,
1275,
376,
1115,
13,
4706,
736,
29871,
29900,
13,
1678,
736,
938,
29898,
12083,
29918,
1949,
29918,
978,
29889,
6506,
29898,
28577,
29918,
29943,
5607,
8032,
29918,
5813,
29892,
5124,
876,
13,
13,
1753,
1653,
29918,
12083,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29918,
978,
29892,
4138,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
1653,
4138,
27716,
13,
1678,
9995,
13,
13,
1678,
1653,
29918,
12083,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
29897,
13,
13,
1678,
396,
7929,
1203,
13,
1678,
954,
29918,
978,
353,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
13,
13,
1678,
396,
5217,
1638,
13,
1678,
396,
1174,
519,
298,
533,
746,
366,
864,
304,
5217,
3618,
13,
1678,
396,
361,
289,
2272,
29889,
1272,
29889,
12650,
29889,
2886,
29898,
1949,
29918,
978,
29897,
1405,
29871,
29900,
29901,
13,
1678,
396,
1678,
289,
2272,
29889,
3554,
29889,
3318,
29889,
2622,
29918,
497,
29898,
2467,
29922,
525,
2287,
6404,
1495,
13,
1678,
396,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1949,
29918,
978,
1822,
2622,
353,
5852,
13,
1678,
396,
1678,
289,
2272,
29889,
3554,
29889,
3318,
29889,
8143,
580,
13,
13,
1678,
5141,
2061,
29898,
1660,
3352,
29918,
29943,
5607,
8032,
29918,
5813,
1919,
954,
29918,
978,
29897,
13,
13,
1678,
396,
1174,
519,
26000,
13,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1949,
29918,
978,
1822,
11458,
29918,
9482,
353,
7700,
13,
13,
1678,
396,
6204,
716,
9123,
373,
716,
4669,
13,
1678,
1653,
29918,
2467,
29898,
1949,
29918,
978,
29897,
13,
13,
1678,
1044,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
13,
13,
1678,
396,
3349,
2030,
1820,
19935,
13,
1678,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
627,
29889,
29888,
2764,
1960,
29897,
13,
13,
1678,
396,
731,
1369,
4423,
13,
1678,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
731,
1369,
6287,
13,
1678,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
383,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
2053,
13,
4706,
383,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
29892,
383,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
29897,
13,
13,
13,
1753,
1653,
29918,
12083,
29918,
29500,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29918,
978,
29892,
4138,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
1653,
4138,
20447,
27716,
13,
1678,
9995,
13,
13,
1678,
396,
3617,
1170,
13,
1678,
4138,
29918,
29500,
29918,
1949,
29918,
978,
353,
679,
29918,
12083,
29918,
29500,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
29897,
13,
13,
1678,
396,
5217,
1638,
13,
1678,
396,
1174,
519,
298,
533,
746,
366,
864,
304,
5217,
3618,
13,
1678,
396,
361,
289,
2272,
29889,
1272,
29889,
12650,
29889,
2886,
29898,
12083,
29918,
29500,
29918,
1949,
29918,
978,
29897,
1405,
29871,
29900,
29901,
13,
1678,
396,
1678,
289,
2272,
29889,
3554,
29889,
3318,
29889,
2622,
29918,
497,
29898,
2467,
2433,
2287,
6404,
1495,
13,
1678,
396,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1949,
29918,
978,
1822,
2622,
353,
5852,
13,
1678,
396,
1678,
289,
2272,
29889,
3554,
29889,
3318,
29889,
8143,
580,
13,
13,
1678,
5141,
2061,
29898,
1660,
3352,
29918,
29943,
5607,
8032,
29918,
1307,
5098,
29918,
5813,
1919,
4138,
29918,
29500,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
1596,
29898,
12083,
29918,
29500,
29918,
1949,
29918,
978,
29897,
13,
1678,
731,
29918,
5415,
29918,
3560,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
1402,
4138,
29918,
29500,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
396,
1174,
519,
26000,
13,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
12083,
29918,
29500,
29918,
1949,
29918,
978,
1822,
11458,
29918,
9482,
353,
7700,
13,
13,
1678,
396,
6204,
716,
9123,
373,
716,
4669,
13,
1678,
1653,
29918,
2467,
29898,
12083,
29918,
29500,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
1044,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
12083,
29918,
29500,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
13,
13,
1678,
396,
3349,
2030,
1820,
19935,
13,
1678,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
627,
29889,
29888,
2764,
1960,
29897,
13,
13,
1678,
396,
731,
1369,
4423,
13,
1678,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
383,
5607,
8032,
29918,
1525,
5098,
29918,
29990,
29892,
320,
13,
4706,
383,
5607,
8032,
29918,
1525,
5098,
29918,
29979,
29892,
383,
5607,
8032,
29918,
1525,
5098,
29918,
29999,
29897,
13,
13,
1678,
396,
731,
1369,
13733,
13,
1678,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
731,
1369,
6287,
13,
1678,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
13,
13,
1753,
1653,
29918,
17519,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29918,
978,
29892,
4138,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
1653,
5443,
27716,
13,
1678,
9995,
13,
13,
1678,
396,
7929,
1203,
13,
13,
1678,
5443,
29918,
1949,
29918,
978,
353,
679,
29918,
17519,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
29897,
13,
13,
1678,
5141,
2061,
29898,
1660,
3352,
29918,
15176,
2190,
3210,
29918,
5813,
1919,
5443,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
396,
1174,
519,
26000,
13,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
17519,
29918,
1949,
29918,
978,
1822,
11458,
29918,
9482,
353,
7700,
13,
13,
1678,
396,
6204,
716,
9123,
373,
716,
4669,
13,
1678,
1653,
29918,
2467,
29898,
17519,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
1044,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
17519,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
13,
13,
1678,
396,
3349,
2030,
1820,
19935,
13,
1678,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
627,
29889,
29888,
2764,
1960,
29897,
13,
13,
1678,
396,
731,
1369,
4423,
13,
1678,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
731,
1369,
6287,
13,
1678,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
2053,
13,
4706,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29897,
13,
13,
1753,
1653,
29918,
17519,
29918,
29882,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29918,
978,
29892,
4138,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
1653,
5443,
27716,
13,
1678,
9995,
13,
13,
1678,
396,
7929,
1203,
13,
13,
1678,
5443,
29918,
29882,
29918,
1949,
29918,
978,
353,
679,
29918,
17519,
29918,
29882,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
29897,
13,
13,
1678,
5141,
2061,
29898,
1660,
3352,
29918,
15176,
2190,
3210,
29918,
5813,
1919,
5443,
29918,
29882,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
396,
1174,
519,
26000,
13,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
17519,
29918,
29882,
29918,
1949,
29918,
978,
1822,
11458,
29918,
9482,
353,
7700,
13,
13,
1678,
396,
6204,
716,
9123,
373,
716,
4669,
13,
1678,
1653,
29918,
2467,
29898,
17519,
29918,
29882,
29918,
1949,
29918,
978,
29897,
13,
13,
1678,
1044,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
17519,
29918,
29882,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
13,
13,
1678,
396,
3349,
2030,
1820,
19935,
13,
1678,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
627,
29889,
29888,
2764,
1960,
29897,
13,
13,
1678,
396,
731,
1369,
4423,
13,
1678,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
731,
1369,
6287,
13,
1678,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
2053,
13,
4706,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29897,
13,
13,
13,
1753,
1653,
29918,
1445,
29918,
4467,
29882,
29898,
1445,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
1653,
934,
27716,
13,
1678,
9995,
13,
13,
1678,
396,
5217,
1638,
13,
1678,
396,
1174,
519,
298,
533,
746,
366,
864,
304,
5217,
3618,
13,
1678,
396,
361,
289,
2272,
29889,
1272,
29889,
12650,
29889,
2886,
29898,
1445,
29918,
978,
29897,
1405,
29871,
29900,
29901,
13,
1678,
396,
1678,
289,
2272,
29889,
3554,
29889,
3318,
29889,
2622,
29918,
497,
29898,
2467,
2433,
2287,
6404,
1495,
13,
1678,
396,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1445,
29918,
978,
1822,
2622,
353,
5852,
13,
1678,
396,
1678,
289,
2272,
29889,
3554,
29889,
3318,
29889,
8143,
580,
13,
13,
1678,
396,
7929,
1203,
13,
1678,
5141,
2061,
29898,
1660,
3352,
29918,
7724,
29918,
5813,
1919,
934,
29918,
978,
29897,
13,
13,
1678,
396,
1174,
519,
26000,
13,
1678,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1445,
29918,
978,
1822,
11458,
29918,
9482,
353,
7700,
13,
13,
1678,
396,
6204,
716,
9123,
373,
716,
4669,
13,
1678,
1653,
29918,
1445,
29918,
2467,
29898,
1445,
29918,
978,
29897,
13,
13,
1678,
1044,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1445,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
13,
13,
1678,
396,
3349,
2030,
1820,
19935,
13,
1678,
2821,
29918,
1445,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
627,
29889,
29888,
2764,
1960,
29897,
13,
13,
1678,
396,
731,
1369,
4423,
13,
1678,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
731,
1369,
13733,
13,
1678,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
731,
1369,
6287,
13,
1678,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29897,
13,
13,
1678,
396,
731,
1369,
1409,
2302,
13,
1678,
788,
29918,
2378,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
6850,
8322,
29918,
29943,
4717,
2303,
29892,
29871,
29896,
29897,
13,
13,
1753,
731,
29918,
5415,
29918,
3560,
29898,
3560,
29918,
978,
29892,
5446,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
731,
3847,
373,
1203,
13,
1678,
9995,
13,
1678,
396,
731,
3847,
13,
1678,
565,
3847,
29918,
978,
2804,
376,
1115,
13,
4706,
5446,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
5415,
29918,
978,
29962,
13,
13,
4706,
396,
731,
3847,
13,
4706,
5446,
29889,
3560,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
3560,
29918,
978,
29962,
13,
13,
13,
1753,
3653,
29918,
3396,
29898,
1191,
29892,
3233,
29918,
1761,
1125,
13,
1678,
9995,
13,
1678,
14861,
1177,
13,
1678,
9995,
13,
1678,
5534,
4138,
29918,
23552,
29918,
2248,
13,
1678,
3876,
29892,
16495,
29892,
2066,
29892,
3847,
29918,
12083,
353,
1852,
13,
13,
1678,
4138,
29918,
2435,
353,
7431,
29898,
8771,
414,
29897,
13,
1678,
934,
29918,
2435,
353,
7431,
29898,
5325,
29897,
13,
13,
1678,
396,
10604,
1014,
12083,
13,
13,
1678,
363,
474,
29892,
4138,
29918,
978,
297,
26985,
29898,
8771,
414,
1125,
13,
4706,
302,
618,
261,
353,
313,
29875,
1275,
4138,
29918,
2435,
448,
29871,
29896,
322,
934,
29918,
2435,
1275,
29871,
29900,
29897,
13,
13,
13,
4706,
4138,
29918,
333,
353,
4138,
29918,
978,
13,
4706,
396,
22108,
3876,
4138,
1024,
304,
3273,
1024,
13,
4706,
565,
4138,
29918,
333,
1275,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
1955,
29954,
29918,
5813,
29901,
13,
9651,
4138,
29918,
333,
353,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
13,
13,
4706,
565,
3847,
29918,
12083,
2804,
376,
1115,
13,
9651,
4138,
29918,
333,
353,
3847,
29918,
12083,
718,
383,
5607,
8032,
29918,
5550,
29931,
1806,
4945,
718,
4138,
29918,
333,
13,
13,
4706,
1653,
29918,
12083,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29892,
4138,
29918,
333,
29897,
13,
4706,
1653,
29918,
12083,
29918,
29500,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29892,
4138,
29918,
333,
29897,
13,
4706,
1653,
29918,
17519,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29892,
4138,
29918,
333,
29897,
13,
4706,
1653,
29918,
17519,
29918,
29882,
29918,
4467,
29882,
29898,
3560,
29918,
12083,
29892,
4138,
29918,
333,
29897,
13,
13,
4706,
1596,
29918,
1445,
877,
26717,
718,
4138,
29918,
333,
718,
525,
29958,
742,
3233,
29918,
1761,
29892,
302,
618,
261,
29897,
13,
13,
4706,
3233,
353,
7431,
29898,
5563,
29918,
1761,
29897,
13,
4706,
4138,
29918,
1066,
29918,
27774,
29961,
12083,
29918,
333,
29962,
353,
313,
3560,
29918,
12083,
29892,
474,
29892,
3233,
29892,
29871,
320,
13,
9651,
4138,
29918,
23552,
29918,
2248,
29897,
13,
4706,
565,
3233,
1275,
29871,
29896,
29901,
13,
9651,
3233,
29896,
29918,
12083,
29918,
1761,
29889,
4397,
29898,
12083,
29918,
333,
29897,
13,
13,
4706,
4138,
29918,
23552,
29918,
2248,
4619,
29871,
29896,
13,
13,
4706,
396,
10604,
1014,
12083,
29915,
29879,
1014,
12083,
13,
13,
4706,
1090,
29918,
4632,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4138,
29918,
978,
29897,
13,
4706,
1090,
29918,
1761,
353,
5159,
13,
13,
4706,
363,
260,
297,
934,
29918,
1761,
29901,
13,
9651,
565,
260,
29961,
29900,
29962,
1275,
1090,
29918,
4632,
29901,
13,
18884,
1090,
29918,
1761,
29889,
4397,
29898,
29873,
29897,
13,
13,
4706,
363,
432,
29892,
260,
297,
26985,
29898,
5062,
29918,
1761,
1125,
13,
9651,
565,
302,
618,
261,
322,
432,
1275,
7431,
29898,
5062,
29918,
1761,
29897,
448,
29871,
29896,
29901,
13,
18884,
788,
353,
518,
5574,
29962,
13,
9651,
1683,
29901,
13,
18884,
788,
353,
518,
8824,
29962,
13,
13,
9651,
3653,
29918,
3396,
29898,
29873,
29892,
3233,
29918,
1761,
718,
788,
29897,
13,
13,
1678,
396,
10604,
2066,
13,
13,
1678,
363,
474,
29892,
934,
29918,
978,
297,
26985,
29898,
5325,
1125,
13,
4706,
934,
29918,
333,
353,
3847,
29918,
12083,
718,
383,
5607,
8032,
29918,
5550,
29931,
1806,
4945,
718,
934,
29918,
978,
13,
4706,
1596,
29918,
1445,
29898,
1445,
29918,
333,
29892,
3233,
29918,
1761,
29892,
313,
29875,
1275,
934,
29918,
2435,
448,
29871,
29896,
876,
13,
13,
1678,
934,
29918,
20047,
353,
7431,
29898,
5325,
29897,
13,
1678,
565,
934,
29918,
20047,
1405,
29871,
29900,
29901,
13,
4706,
934,
29918,
1949,
29918,
978,
353,
679,
29918,
1445,
29918,
1949,
29918,
978,
29898,
3560,
29918,
12083,
29897,
13,
4706,
1653,
29918,
1445,
29918,
4467,
29882,
29898,
1445,
29918,
1949,
29918,
978,
29897,
13,
4706,
934,
29918,
20047,
29918,
27774,
29961,
3560,
29918,
12083,
29962,
353,
313,
1445,
29918,
1949,
29918,
978,
29892,
934,
29918,
20047,
29897,
13,
13,
1753,
788,
29918,
1989,
2557,
29918,
3149,
29898,
29888,
2764,
345,
29892,
3515,
29892,
995,
1125,
13,
13,
1678,
396,
1284,
1021,
3515,
1820,
2557,
29918,
3149,
13,
1678,
2380,
353,
29871,
29900,
13,
1678,
1284,
29918,
2557,
353,
7700,
13,
1678,
363,
474,
29892,
1298,
297,
26985,
29898,
29888,
2764,
345,
29889,
1989,
2557,
29918,
9748,
1125,
13,
4706,
565,
1298,
29889,
1111,
29961,
29900,
29962,
1275,
3515,
29901,
13,
9651,
2380,
353,
474,
13,
9651,
1284,
29918,
2557,
353,
5852,
13,
9651,
2867,
13,
13,
1678,
565,
1284,
29918,
2557,
1275,
7700,
29901,
13,
4706,
396,
788,
1820,
2557,
29918,
3149,
746,
1021,
3515,
451,
1476,
13,
4706,
285,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29889,
1202,
29898,
29896,
29897,
13,
4706,
2380,
353,
7431,
29898,
29888,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29897,
448,
29871,
29896,
13,
13,
1678,
396,
6230,
1820,
2557,
13,
1678,
285,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29961,
2248,
1822,
1853,
353,
29871,
376,
29933,
1525,
22311,
3970,
16048,
29908,
13,
1678,
285,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29961,
2248,
1822,
1111,
353,
29871,
3515,
29892,
995,
13,
1678,
285,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29961,
2248,
1822,
8411,
29918,
1563,
353,
3515,
448,
29871,
29900,
29889,
29945,
29892,
995,
13,
1678,
285,
2764,
345,
29889,
1989,
2557,
29918,
9748,
29961,
2248,
1822,
8411,
29918,
1266,
353,
3515,
718,
29871,
29900,
29889,
29945,
29892,
995,
13,
13,
13,
1753,
6230,
29943,
1025,
414,
29898,
3317,
29918,
2962,
29918,
2557,
1125,
13,
13,
1678,
396,
10092,
3876,
4138,
2159,
13,
1678,
1044,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
21289,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
1822,
18962,
29918,
1272,
29889,
2467,
13,
1678,
396,
731,
1369,
6287,
13,
1678,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
627,
29889,
29888,
2764,
1960,
29892,
29871,
29896,
29900,
29900,
29900,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29897,
13,
13,
1678,
363,
4138,
29918,
978,
29892,
926,
297,
4138,
29918,
1066,
29918,
27774,
29889,
7076,
7295,
13,
13,
4706,
3847,
29918,
12083,
29918,
978,
29892,
2380,
29892,
3233,
29892,
8380,
29918,
2248,
353,
926,
13,
4706,
4138,
29918,
1949,
29918,
978,
29871,
353,
4138,
29918,
1949,
29918,
978,
29918,
27774,
29961,
12083,
29918,
978,
29962,
13,
13,
4706,
4138,
29918,
2248,
353,
679,
29918,
12083,
29918,
2248,
29898,
12083,
29918,
1949,
29918,
978,
416,
13,
13,
4706,
396,
3789,
786,
4138,
4408,
373,
21597,
29871,
29900,
29892,
29871,
29896,
383,
1025,
414,
13,
4706,
565,
3233,
5277,
29871,
29896,
29901,
13,
9651,
396,
3617,
383,
3194,
4408,
4669,
29915,
29879,
3553,
13,
9651,
4138,
29918,
978,
29918,
333,
353,
383,
5607,
8032,
29918,
5813,
29918,
15094,
25634,
718,
4138,
29918,
1949,
29918,
978,
13,
13,
9651,
396,
3789,
3847,
1203,
13,
9651,
731,
29918,
5415,
29918,
3560,
29898,
12083,
29918,
1949,
29918,
978,
29892,
4138,
29918,
978,
29918,
333,
29897,
13,
13,
9651,
396,
679,
285,
2764,
1960,
13,
9651,
285,
2764,
1960,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
12083,
29918,
978,
29918,
333,
1822,
18962,
29918,
1272,
29889,
2467,
29889,
29888,
2764,
1960,
13,
13,
9651,
396,
17732,
2030,
2867,
9748,
13,
9651,
2821,
29918,
497,
29918,
1025,
29918,
8690,
9748,
29898,
29888,
2764,
1960,
29897,
13,
13,
9651,
396,
788,
17250,
7670,
4308,
13,
9651,
3515,
353,
6850,
8322,
29918,
29943,
4717,
2303,
13,
9651,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
9651,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
9651,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
29892,
320,
13,
18884,
383,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
29892,
383,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
29897,
13,
13,
9651,
396,
788,
25249,
921,
7370,
1820,
12218,
13,
9651,
3515,
4619,
313,
5563,
718,
2380,
29897,
334,
2533,
29898,
12083,
29918,
29885,
8194,
29918,
1761,
29897,
320,
13,
18884,
718,
383,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
13,
9651,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
9651,
396,
788,
25249,
921,
2796,
1820,
12218,
13,
9651,
3515,
4619,
383,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
6720,
12064,
29918,
29990,
13,
9651,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
5813,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
29892,
320,
13,
18884,
383,
5607,
8032,
29918,
5813,
29918,
29979,
29918,
1529,
29934,
29954,
1177,
29892,
29871,
29900,
29897,
13,
13,
9651,
396,
788,
2538,
675,
4480,
1820,
3515,
13,
9651,
3515,
4619,
383,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
13,
9651,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
29892,
320,
13,
18884,
383,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
29892,
383,
5607,
8032,
29918,
5813,
29918,
29903,
5454,
1307,
29918,
1254,
29949,
1525,
1692,
29897,
13,
13,
9651,
396,
788,
2538,
675,
1095,
1820,
3515,
13,
9651,
3515,
4619,
383,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
13,
9651,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
13,
9651,
396,
788,
9664,
362,
4480,
1820,
3515,
13,
9651,
3515,
4619,
383,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1672,
29911,
29918,
12982,
1806,
13,
9651,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
9651,
396,
788,
390,
4616,
291,
1095,
1820,
3515,
13,
9651,
3515,
4619,
383,
5607,
8032,
29918,
5813,
29918,
29943,
4717,
2303,
29918,
1672,
29911,
13,
9651,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
5813,
29918,
1672,
29911,
29918,
29990,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
9651,
285,
2764,
1960,
29889,
5504,
580,
13,
13,
13,
4706,
396,
731,
3847,
1203,
13,
4706,
5443,
29918,
1949,
29918,
978,
353,
679,
29918,
17519,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
29897,
13,
4706,
5443,
29918,
29882,
29918,
1949,
29918,
978,
353,
679,
29918,
17519,
29918,
29882,
29918,
1949,
29918,
978,
29898,
12083,
29918,
978,
29897,
13,
13,
4706,
565,
4138,
29918,
978,
2804,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29901,
13,
9651,
731,
29918,
5415,
29918,
3560,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29961,
3560,
29918,
12083,
29918,
978,
1402,
5443,
29918,
1949,
29918,
978,
29897,
13,
9651,
731,
29918,
5415,
29918,
3560,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29961,
3560,
29918,
12083,
29918,
978,
1402,
5443,
29918,
29882,
29918,
1949,
29918,
978,
29897,
13,
9651,
731,
29918,
5415,
29918,
3560,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29961,
3560,
29918,
12083,
29918,
978,
1402,
4138,
29918,
1949,
29918,
978,
29897,
13,
13,
4706,
396,
3037,
695,
403,
4138,
6198,
2380,
13,
4706,
3847,
29918,
23552,
29918,
2248,
353,
29871,
29900,
13,
13,
4706,
565,
3847,
29918,
12083,
29918,
978,
2804,
376,
1115,
13,
9651,
3847,
29918,
23552,
29918,
2248,
353,
320,
13,
18884,
4138,
29918,
1066,
29918,
27774,
29961,
3560,
29918,
12083,
29918,
978,
3816,
29943,
5607,
8032,
29918,
24815,
29918,
2882,
29903,
5607,
26027,
29918,
27992,
29962,
13,
13,
4706,
6198,
29918,
2248,
353,
8380,
29918,
2248,
448,
3847,
29918,
23552,
29918,
2248,
13,
13,
4706,
565,
6198,
29918,
2248,
1275,
29871,
29900,
29901,
13,
9651,
6198,
29918,
2248,
353,
29871,
29896,
13,
13,
4706,
396,
22235,
1369,
3515,
13,
4706,
3847,
29918,
12083,
29918,
2248,
353,
29871,
29900,
13,
4706,
565,
3847,
29918,
12083,
29918,
978,
2804,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
584,
13,
9651,
3847,
29918,
12083,
29918,
2248,
353,
679,
29918,
12083,
29918,
2248,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29961,
3560,
29918,
12083,
29918,
978,
2314,
13,
13,
4706,
3515,
353,
6850,
8322,
29918,
29943,
4717,
2303,
718,
313,
5563,
718,
2380,
29897,
334,
2533,
29898,
12083,
29918,
29885,
8194,
29918,
1761,
29897,
13,
13,
4706,
396,
679,
285,
2764,
1960,
13,
4706,
5443,
29918,
29888,
2764,
1960,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
17519,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
29889,
29888,
2764,
1960,
13,
4706,
1506,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
17519,
29918,
29882,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
29889,
29888,
2764,
1960,
13,
4706,
4138,
29918,
29888,
2764,
1960,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
12083,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
29889,
29888,
2764,
1960,
13,
13,
4706,
1369,
29918,
2557,
353,
3515,
13,
4706,
396,
788,
4337,
1369,
1820,
29918,
2557,
13,
4706,
3515,
4619,
29871,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
17519,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
4706,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
17519,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
4706,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
1182,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
5844,
29889,
1631,
847,
29871,
29906,
29892,
29871,
29900,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
13,
4706,
396,
788,
7985,
503,
4480,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29999,
29918,
12982,
1806,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
17519,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
1182,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
22235,
29871,
29896,
303,
796,
788,
29918,
5479,
29918,
1989,
29918,
2557,
13,
4706,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
353,
383,
5607,
8032,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
334,
2380,
13,
4706,
565,
4138,
29918,
978,
1275,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29901,
13,
9651,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
353,
383,
5607,
8032,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
334,
29871,
29906,
13,
13,
4706,
396,
788,
7985,
503,
1095,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29999,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
17519,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
334,
29871,
29896,
29900,
29900,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
1182,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
13,
4706,
396,
788,
7985,
921,
4480,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29990,
29918,
12982,
1806,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
1182,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
13,
4706,
396,
788,
7985,
921,
1095,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
5746,
29925,
9468,
29918,
29990,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
1182,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
320,
13,
9651,
383,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
334,
29871,
29896,
29900,
29900,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
29892,
29871,
29900,
29892,
320,
13,
9651,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
13,
4706,
396,
788,
748,
714,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
17080,
29918,
12015,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
320,
13,
9651,
383,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
718,
383,
5607,
8032,
29918,
29990,
29918,
24815,
29918,
25826,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
13,
4706,
396,
788,
19490,
4480,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
13,
9651,
383,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
718,
383,
5607,
8032,
29918,
29990,
29918,
24815,
29918,
25826,
29892,
29871,
29900,
29892,
320,
13,
9651,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
29892,
320,
13,
9651,
383,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
29892,
383,
5607,
8032,
29918,
1254,
1955,
10461,
29918,
29903,
5454,
1307,
29897,
13,
13,
4706,
396,
788,
19490,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
320,
13,
9651,
383,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
718,
383,
5607,
8032,
29918,
29990,
29918,
24815,
29918,
11794,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29896,
29900,
29897,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29892,
320,
13,
9651,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29897,
13,
13,
4706,
396,
788,
4138,
10884,
1095,
3515,
304,
12124,
13,
4706,
4138,
29918,
355,
29918,
2557,
29918,
27774,
29961,
12083,
29918,
978,
29962,
353,
3515,
13,
13,
4706,
396,
788,
796,
4337,
1095,
1820,
3515,
13,
4706,
503,
29918,
2029,
29918,
29900,
29900,
29906,
29900,
353,
383,
5607,
8032,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
334,
6198,
29918,
2248,
13,
4706,
565,
4138,
29918,
978,
1275,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29901,
13,
9651,
503,
29918,
2029,
29918,
29900,
29900,
29906,
29900,
353,
383,
5607,
8032,
29918,
29999,
29918,
1529,
29934,
29954,
1177,
334,
29871,
29906,
13,
13,
4706,
3515,
353,
4236,
29918,
2962,
29918,
2557,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
320,
13,
9651,
383,
5607,
8032,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
718,
383,
5607,
8032,
29918,
29990,
29918,
24815,
29918,
11794,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29906,
29900,
29897,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
1182,
17608,
29918,
29882,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29906,
29900,
29897,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
17519,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
503,
29918,
2029,
29918,
29900,
29900,
29906,
29900,
334,
29871,
29896,
29900,
29900,
29897,
13,
13,
13,
13,
4706,
396,
2436,
1480,
13,
4706,
1426,
29918,
1445,
29889,
3539,
29898,
12083,
29918,
1949,
29918,
978,
718,
376,
18278,
3220,
6160,
718,
851,
29898,
22925,
29918,
2248,
467,
29920,
5589,
29898,
29946,
29897,
320,
13,
9651,
718,
376,
10108,
6160,
718,
851,
29898,
5563,
467,
29920,
5589,
29898,
29941,
29897,
320,
13,
9651,
718,
376,
4763,
4308,
6160,
718,
851,
29898,
2962,
29918,
2557,
29897,
718,
376,
5044,
4308,
6160,
718,
851,
29898,
2557,
29897,
320,
13,
9651,
718,
376,
2248,
6160,
718,
851,
29898,
2248,
467,
29920,
5589,
29898,
29941,
29897,
320,
13,
9651,
718,
376,
9780,
12924,
6160,
718,
29871,
3847,
29918,
12083,
29918,
978,
718,
376,
1619,
1170,
6160,
718,
4138,
29918,
978,
320,
13,
9651,
718,
11297,
29876,
1495,
13,
13,
4706,
396,
2767,
285,
2764,
345,
13,
4706,
5443,
29918,
29888,
2764,
1960,
29889,
5504,
580,
13,
4706,
4138,
29918,
29888,
2764,
1960,
29889,
5504,
580,
13,
13,
13,
13,
1753,
6230,
10547,
7295,
13,
1678,
363,
3847,
29918,
12083,
29892,
659,
297,
934,
29918,
20047,
29918,
27774,
29889,
7076,
7295,
13,
13,
4706,
934,
29918,
1949,
29918,
978,
29892,
934,
29918,
20047,
353,
659,
13,
13,
4706,
4138,
29918,
29500,
29918,
1949,
29918,
978,
353,
679,
29918,
12083,
29918,
29500,
29918,
1949,
29918,
978,
29898,
3560,
29918,
12083,
29897,
13,
13,
4706,
396,
3789,
3847,
1203,
13,
4706,
731,
29918,
5415,
29918,
3560,
29898,
12083,
29918,
1949,
29918,
978,
29918,
27774,
29961,
3560,
29918,
12083,
1402,
934,
29918,
1949,
29918,
978,
29897,
13,
13,
4706,
396,
679,
285,
2764,
1960,
13,
4706,
285,
2764,
1960,
353,
289,
2272,
29889,
1272,
29889,
12650,
29961,
1445,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
29889,
29888,
2764,
1960,
13,
4706,
4138,
29918,
29500,
29918,
29888,
2764,
1960,
353,
320,
13,
9651,
289,
2272,
29889,
1272,
29889,
12650,
29961,
12083,
29918,
29500,
29918,
1949,
29918,
978,
1822,
18962,
29918,
1272,
29889,
2467,
29889,
29888,
2764,
1960,
13,
13,
4706,
396,
679,
1369,
3515,
13,
4706,
3515,
353,
4138,
29918,
355,
29918,
2557,
29918,
27774,
29961,
3560,
29918,
12083,
29962,
13,
13,
4706,
396,
788,
1722,
4480,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
4590,
1430,
29918,
12982,
1806,
13,
4706,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29500,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
788,
1722,
1820,
29918,
2557,
13,
4706,
3515,
4619,
383,
5607,
8032,
29918,
29943,
4717,
2303,
29918,
4590,
1430,
13,
4706,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
12083,
29918,
29500,
29918,
29888,
2764,
1960,
29892,
3515,
29892,
383,
5607,
8032,
29918,
1525,
5098,
29918,
4590,
1430,
29892,
320,
13,
795,
29900,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
788,
4337,
1369,
1820,
3515,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
25826,
29918,
1529,
29934,
29954,
1177,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
788,
503,
7985,
1095,
1820,
4308,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
29999,
29918,
5746,
29925,
9468,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
24080,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
788,
19490,
4480,
1820,
4308,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
29918,
12982,
1806,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29892,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29892,
320,
13,
9651,
317,
5454,
1307,
29918,
1254,
1955,
10461,
29897,
13,
13,
4706,
396,
788,
19490,
1095,
1820,
4308,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
1525,
14226,
13,
4706,
788,
29918,
7052,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29892,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29892,
320,
13,
9651,
317,
5454,
1307,
29918,
29940,
1955,
1529,
29931,
29897,
13,
13,
4706,
396,
788,
921,
5731,
399,
29909,
1806,
1820,
3515,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
29990,
29918,
1672,
29911,
29918,
12982,
1806,
13,
4706,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
788,
921,
5731,
1095,
1820,
3515,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
29990,
29918,
1672,
29911,
13,
4706,
788,
29918,
5479,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
24080,
29918,
29990,
29918,
1529,
29934,
29954,
1177,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
4706,
788,
29918,
5450,
362,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
5844,
29889,
1631,
29892,
5844,
29889,
1631,
847,
29871,
29906,
29892,
29871,
29900,
1723,
13,
13,
4706,
396,
788,
343,
7985,
4480,
1820,
3515,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
29979,
29918,
5746,
29925,
9468,
29918,
12982,
1806,
13,
4706,
788,
29918,
2378,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
29871,
29896,
29897,
13,
13,
4706,
396,
788,
343,
7985,
1095,
1820,
3515,
13,
4706,
3515,
4619,
24080,
29918,
29943,
4717,
2303,
29918,
29979,
29918,
5746,
29925,
9468,
13,
4706,
788,
29918,
2378,
29918,
1989,
29918,
2557,
29898,
29888,
2764,
1960,
29892,
3515,
29892,
934,
29918,
20047,
29897,
13,
13,
4706,
396,
2767,
285,
2764,
345,
13,
4706,
285,
2764,
1960,
29889,
5504,
580,
13,
13,
29937,
6850,
8322,
13,
2158,
703,
2277,
29937,
1369,
835,
1159,
13,
3258,
29918,
12083,
29918,
4467,
29882,
703,
613,
16641,
2891,
29918,
29943,
5607,
8032,
29918,
7068,
8476,
29918,
5813,
29897,
13,
9891,
29918,
3396,
29898,
1445,
29918,
1761,
29889,
7323,
29898,
29900,
511,
518,
2314,
13,
13,
29937,
22235,
4236,
1369,
3515,
13,
3317,
29918,
2962,
29918,
2557,
353,
29871,
29900,
13,
1454,
4138,
29918,
978,
29892,
926,
297,
4138,
29918,
1066,
29918,
27774,
29889,
7076,
7295,
13,
1678,
3847,
29918,
12083,
29918,
978,
29892,
2380,
29892,
3233,
29892,
8380,
29918,
2248,
353,
926,
13,
1678,
3515,
353,
6850,
8322,
29918,
29943,
4717,
2303,
718,
313,
5563,
718,
2380,
29897,
334,
2533,
29898,
12083,
29918,
29885,
8194,
29918,
1761,
29897,
13,
1678,
565,
3515,
1405,
4236,
29918,
2962,
29918,
2557,
29901,
13,
4706,
4236,
29918,
2962,
29918,
2557,
353,
3515,
13,
13,
14669,
29943,
1025,
414,
29898,
3317,
29918,
2962,
29918,
2557,
29897,
13,
14669,
10547,
580,
13,
726,
29918,
1445,
29889,
5358,
580,
13,
2158,
703,
2277,
29937,
1095,
835,
1159,
13,
2
] |
tests/test_gpuctl.py | Ed-Yang/gpuctl | 2 | 117153 | <gh_stars>1-10
#!/usr/bin/env python3
import time
# from re import U
import unittest
from gpuctl import PciDev, GpuCtl, GpuDev, GpuAMD, GpuNV, GpuOk
from gpuctl import GpuOk, GpuNak
class TestGpuCtl(unittest.TestCase):
def test_invalid_key(self):
gpu_ctl = None
try:
gpu_ctl = GpuCtl(slots='aaaa')
self.assertEqual(gpu_ctl, None)
except:
pass
def test_discover_all(self):
pci_devices = PciDev.discovery()
gpu_devices = []
for pdev in pci_devices:
gpu = None
if pdev.is_amd():
gpu = GpuAMD(pdev)
if pdev.is_nvidia():
gpu = GpuNV(pdev)
if gpu and gpu.is_gpu():
gpu_devices.append(gpu)
gpu_ctl = GpuCtl(gpu_devices=gpu_devices)
def test_discover_vendor(self):
vendors = ['AMD', 'NVIDIA']
pci_devices = PciDev.discovery(vendor_filter=vendors)
gpu_devices = []
for pdev in pci_devices:
gpu = None
if pdev.is_amd():
gpu = GpuAMD(pdev)
if pdev.is_nvidia():
gpu = GpuNV(pdev)
if gpu and gpu.is_gpu():
gpu_devices.append(gpu)
gpu_ctl = GpuCtl(gpu_devices=gpu_devices)
def test_add_devices(self):
vendors = ['AMD', 'NVIDIA']
pci_devices = PciDev.discovery(vendor_filter=vendors)
gpu_devices = []
for pdev in pci_devices:
gpu = None
if pdev.is_amd():
gpu = GpuAMD(pdev)
if pdev.is_nvidia():
gpu = GpuNV(pdev)
if gpu and gpu.is_gpu():
gpu_devices.append(gpu)
gpu_ctl = GpuCtl(gpu_devices=gpu_devices)
cnt = gpu_ctl.add_gpu_devices(gpu_devices)
self.assertEqual(cnt, 0)
def test_over_temp(self):
slot_name = '1111:11:11.1'
pci_id = '1111:1111'
pdev = PciDev(slot_name, pci_id, 'mock pci')
self.assertIsNotNone(pdev)
self.assertEqual(pdev.vendor_name(), 'Other')
gpu_dev = GpuNak(pdev)
self.assertIsNotNone(gpu_dev)
gpu_ctl = GpuCtl(gpu_devices=[gpu_dev], fan=10, temp=20, tas='./tests/ok.sh')
self.assertNotEqual(gpu_ctl, None)
rv = gpu_ctl.set_interval(wait_period=10)
self.assertTrue(rv)
gpu_ctl.start()
time.sleep(5)
gpu_ctl.stop()
def test_interval(self):
slot_name = '1111:11:11.1'
pci_id = '1111:1111'
pdev = PciDev(slot_name, pci_id, 'mock pci')
self.assertIsNotNone(pdev)
self.assertEqual(pdev.vendor_name(), 'Other')
gpu_dev = GpuOk(pdev)
self.assertIsNotNone(gpu_dev)
gpu_ctl = GpuCtl(gpu_devices=[gpu_dev])
rv = gpu_ctl.set_interval(intvl=1, wait_period=3)
self.assertTrue(rv)
rv = gpu_ctl.set_interval(intvl=2, wait_period=20)
self.assertTrue(rv)
rv = gpu_ctl.set_interval(intvl=2, wait_period=1)
self.assertFalse(rv)
def test_nak_gpu(self):
slot_name = '1111:11:11.1'
pci_id = '1111:1111'
pdev = PciDev(slot_name, pci_id, 'mock pci')
self.assertIsNotNone(pdev)
self.assertEqual(pdev.vendor_name(), 'Other')
gpu_dev = GpuNak(pdev)
self.assertIsNotNone(gpu_dev)
gpu_ctl = GpuCtl(gpu_devices=[gpu_dev], verbose=True)
rv = gpu_ctl.set_interval(wait_period=10)
self.assertTrue(rv)
gpu_ctl.start()
time.sleep(5)
gpu_ctl.stop()
if __name__ == '__main__':
unittest.main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
5215,
931,
13,
29937,
515,
337,
1053,
501,
13,
5215,
443,
27958,
13,
13,
13,
3166,
330,
3746,
16948,
1053,
349,
455,
16618,
29892,
402,
3746,
29907,
15206,
29892,
402,
3746,
16618,
29892,
402,
3746,
5194,
29928,
29892,
402,
3746,
29940,
29963,
29892,
402,
3746,
20434,
13,
3166,
330,
3746,
16948,
1053,
402,
3746,
20434,
29892,
402,
3746,
29940,
557,
13,
308,
13,
1990,
4321,
29954,
3746,
29907,
15206,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
1243,
29918,
20965,
29918,
1989,
29898,
1311,
1125,
13,
4706,
330,
3746,
29918,
16948,
353,
6213,
13,
4706,
1018,
29901,
13,
9651,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
2536,
1862,
2433,
27137,
1495,
13,
9651,
1583,
29889,
9294,
9843,
29898,
29887,
3746,
29918,
16948,
29892,
6213,
29897,
13,
4706,
5174,
29901,
13,
9651,
1209,
13,
13,
1678,
822,
1243,
29918,
2218,
11911,
29918,
497,
29898,
1311,
1125,
13,
13,
4706,
282,
455,
29918,
3359,
1575,
353,
349,
455,
16618,
29889,
2218,
11911,
29891,
580,
13,
4706,
330,
3746,
29918,
3359,
1575,
353,
5159,
13,
4706,
363,
282,
3359,
297,
282,
455,
29918,
3359,
1575,
29901,
13,
9651,
330,
3746,
353,
6213,
13,
9651,
565,
282,
3359,
29889,
275,
29918,
22490,
7295,
13,
18884,
330,
3746,
353,
402,
3746,
5194,
29928,
29898,
29886,
3359,
29897,
13,
9651,
565,
282,
3359,
29889,
275,
29918,
29876,
28584,
7295,
13,
18884,
330,
3746,
353,
402,
3746,
29940,
29963,
29898,
29886,
3359,
29897,
13,
9651,
565,
330,
3746,
322,
330,
3746,
29889,
275,
29918,
29887,
3746,
7295,
13,
18884,
330,
3746,
29918,
3359,
1575,
29889,
4397,
29898,
29887,
3746,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
29887,
3746,
29918,
3359,
1575,
29922,
29887,
3746,
29918,
3359,
1575,
29897,
13,
13,
1678,
822,
1243,
29918,
2218,
11911,
29918,
19167,
29898,
1311,
1125,
13,
13,
4706,
9691,
943,
353,
6024,
5194,
29928,
742,
525,
29940,
13044,
10764,
2033,
13,
4706,
282,
455,
29918,
3359,
1575,
353,
349,
455,
16618,
29889,
2218,
11911,
29891,
29898,
19167,
29918,
4572,
29922,
29894,
355,
943,
29897,
13,
4706,
330,
3746,
29918,
3359,
1575,
353,
5159,
13,
4706,
363,
282,
3359,
297,
282,
455,
29918,
3359,
1575,
29901,
13,
9651,
330,
3746,
353,
6213,
13,
9651,
565,
282,
3359,
29889,
275,
29918,
22490,
7295,
13,
18884,
330,
3746,
353,
402,
3746,
5194,
29928,
29898,
29886,
3359,
29897,
13,
9651,
565,
282,
3359,
29889,
275,
29918,
29876,
28584,
7295,
13,
18884,
330,
3746,
353,
402,
3746,
29940,
29963,
29898,
29886,
3359,
29897,
13,
9651,
565,
330,
3746,
322,
330,
3746,
29889,
275,
29918,
29887,
3746,
7295,
13,
18884,
330,
3746,
29918,
3359,
1575,
29889,
4397,
29898,
29887,
3746,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
29887,
3746,
29918,
3359,
1575,
29922,
29887,
3746,
29918,
3359,
1575,
29897,
13,
13,
1678,
822,
1243,
29918,
1202,
29918,
3359,
1575,
29898,
1311,
1125,
13,
13,
4706,
9691,
943,
353,
6024,
5194,
29928,
742,
525,
29940,
13044,
10764,
2033,
13,
4706,
282,
455,
29918,
3359,
1575,
353,
349,
455,
16618,
29889,
2218,
11911,
29891,
29898,
19167,
29918,
4572,
29922,
29894,
355,
943,
29897,
13,
4706,
330,
3746,
29918,
3359,
1575,
353,
5159,
13,
4706,
363,
282,
3359,
297,
282,
455,
29918,
3359,
1575,
29901,
13,
9651,
330,
3746,
353,
6213,
13,
9651,
565,
282,
3359,
29889,
275,
29918,
22490,
7295,
13,
18884,
330,
3746,
353,
402,
3746,
5194,
29928,
29898,
29886,
3359,
29897,
13,
9651,
565,
282,
3359,
29889,
275,
29918,
29876,
28584,
7295,
13,
18884,
330,
3746,
353,
402,
3746,
29940,
29963,
29898,
29886,
3359,
29897,
13,
9651,
565,
330,
3746,
322,
330,
3746,
29889,
275,
29918,
29887,
3746,
7295,
13,
18884,
330,
3746,
29918,
3359,
1575,
29889,
4397,
29898,
29887,
3746,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
29887,
3746,
29918,
3359,
1575,
29922,
29887,
3746,
29918,
3359,
1575,
29897,
13,
4706,
274,
593,
353,
330,
3746,
29918,
16948,
29889,
1202,
29918,
29887,
3746,
29918,
3359,
1575,
29898,
29887,
3746,
29918,
3359,
1575,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
20047,
29892,
29871,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
957,
29918,
7382,
29898,
1311,
1125,
13,
4706,
21497,
29918,
978,
353,
525,
29896,
29896,
29896,
29896,
29901,
29896,
29896,
29901,
29896,
29896,
29889,
29896,
29915,
13,
4706,
282,
455,
29918,
333,
353,
525,
29896,
29896,
29896,
29896,
29901,
29896,
29896,
29896,
29896,
29915,
13,
4706,
282,
3359,
353,
349,
455,
16618,
29898,
2536,
327,
29918,
978,
29892,
282,
455,
29918,
333,
29892,
525,
17640,
282,
455,
1495,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
29886,
3359,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29886,
3359,
29889,
19167,
29918,
978,
3285,
525,
16107,
1495,
13,
13,
4706,
330,
3746,
29918,
3359,
353,
402,
3746,
29940,
557,
29898,
29886,
3359,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
29887,
3746,
29918,
3359,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
29887,
3746,
29918,
3359,
1575,
11759,
29887,
3746,
29918,
3359,
1402,
13524,
29922,
29896,
29900,
29892,
5694,
29922,
29906,
29900,
29892,
260,
294,
2433,
6904,
21150,
29914,
554,
29889,
845,
1495,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
29887,
3746,
29918,
16948,
29892,
6213,
29897,
13,
13,
4706,
364,
29894,
353,
330,
3746,
29918,
16948,
29889,
842,
29918,
19207,
29898,
10685,
29918,
19145,
29922,
29896,
29900,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
15291,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
29889,
2962,
580,
13,
4706,
931,
29889,
17059,
29898,
29945,
29897,
13,
4706,
330,
3746,
29918,
16948,
29889,
9847,
580,
13,
13,
1678,
822,
1243,
29918,
19207,
29898,
1311,
1125,
13,
4706,
21497,
29918,
978,
353,
525,
29896,
29896,
29896,
29896,
29901,
29896,
29896,
29901,
29896,
29896,
29889,
29896,
29915,
13,
4706,
282,
455,
29918,
333,
353,
525,
29896,
29896,
29896,
29896,
29901,
29896,
29896,
29896,
29896,
29915,
13,
4706,
282,
3359,
353,
349,
455,
16618,
29898,
2536,
327,
29918,
978,
29892,
282,
455,
29918,
333,
29892,
525,
17640,
282,
455,
1495,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
29886,
3359,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29886,
3359,
29889,
19167,
29918,
978,
3285,
525,
16107,
1495,
13,
13,
4706,
330,
3746,
29918,
3359,
353,
402,
3746,
20434,
29898,
29886,
3359,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
29887,
3746,
29918,
3359,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
29887,
3746,
29918,
3359,
1575,
11759,
29887,
3746,
29918,
3359,
2314,
13,
13,
4706,
364,
29894,
353,
330,
3746,
29918,
16948,
29889,
842,
29918,
19207,
29898,
524,
20901,
29922,
29896,
29892,
4480,
29918,
19145,
29922,
29941,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
15291,
29897,
13,
13,
4706,
364,
29894,
353,
330,
3746,
29918,
16948,
29889,
842,
29918,
19207,
29898,
524,
20901,
29922,
29906,
29892,
4480,
29918,
19145,
29922,
29906,
29900,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
15291,
29897,
13,
13,
4706,
364,
29894,
353,
330,
3746,
29918,
16948,
29889,
842,
29918,
19207,
29898,
524,
20901,
29922,
29906,
29892,
4480,
29918,
19145,
29922,
29896,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
15291,
29897,
13,
13,
1678,
822,
1243,
29918,
8546,
29918,
29887,
3746,
29898,
1311,
1125,
13,
4706,
21497,
29918,
978,
353,
525,
29896,
29896,
29896,
29896,
29901,
29896,
29896,
29901,
29896,
29896,
29889,
29896,
29915,
13,
4706,
282,
455,
29918,
333,
353,
525,
29896,
29896,
29896,
29896,
29901,
29896,
29896,
29896,
29896,
29915,
13,
4706,
282,
3359,
353,
349,
455,
16618,
29898,
2536,
327,
29918,
978,
29892,
282,
455,
29918,
333,
29892,
525,
17640,
282,
455,
1495,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
29886,
3359,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29886,
3359,
29889,
19167,
29918,
978,
3285,
525,
16107,
1495,
13,
13,
4706,
330,
3746,
29918,
3359,
353,
402,
3746,
29940,
557,
29898,
29886,
3359,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
29887,
3746,
29918,
3359,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
353,
402,
3746,
29907,
15206,
29898,
29887,
3746,
29918,
3359,
1575,
11759,
29887,
3746,
29918,
3359,
1402,
26952,
29922,
5574,
29897,
13,
13,
4706,
364,
29894,
353,
330,
3746,
29918,
16948,
29889,
842,
29918,
19207,
29898,
10685,
29918,
19145,
29922,
29896,
29900,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
15291,
29897,
13,
13,
4706,
330,
3746,
29918,
16948,
29889,
2962,
580,
13,
4706,
931,
29889,
17059,
29898,
29945,
29897,
13,
4706,
330,
3746,
29918,
16948,
29889,
9847,
580,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
Legacy/quicksim/strategies/MonthlyRebalancing.py | romanbsd/QuantSoftwareToolkit | 3 | 116872 | '''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Jan 1, 2011
@author:<NAME>
@contact: <EMAIL>
@summary: Contains tutorial for backtester and report.
'''
#
# MonthlyRebalancingExample.py
#
# Usage: python MonthlyRebalancingExample.py 1-1-2004' '1-1-2009' 'alloc.pkl'
#
# A strategy script which creates a monthly allocation table using
# start date and end date along with the first 20 symbols of S&P500.
# It then dumps the allocation table to a pickle file.
#
#
#python imports
import pickle
from pylab import *
from pandas import *
import matplotlib.pyplot as plt
import datetime as dt
import os
#qstk imports
import qstkutil.DataAccess as da
import qstkutil.qsdateutil as du
if __name__ == "__main__":
print("Running Monthly Rebalancing strategy starting "+sys.argv[1]+" and ending "+sys.argv[2]+".")
#Get first 20 S&P Symbols
symbols = list(np.loadtxt(os.environ['QS']+'/quicksim/strategies/S&P500.csv',dtype='str',delimiter=',',comments='#',skiprows=0))
symbols = symbols[0:19]
#Set start and end boundary times
t = list(map(int,sys.argv[1].split('-')))
startday = dt.datetime(t[2],t[0],t[1])
t = list(map(int,sys.argv[2].split('-')))
endday = dt.datetime(t[2],t[0],t[1])
#Get desired timestamps
timeofday=dt.timedelta(hours=16)
timestamps = du.getNYSEdays(startday,endday,timeofday)
# Get the data from the data store
dataobj = da.DataAccess('Norgate')
historic = dataobj.get_data(timestamps, symbols, "close")
# Setup the allocation table
alloc_vals=.8/(len(historic.values[0,:])-1)*ones((1,len(historic.values[0,:])))
alloc=DataMatrix(index=[historic.index[0]], data=alloc_vals, columns=symbols)
for date in range(1, len(historic.index)):
if(historic.index[date].day==1):
alloc=alloc.append(DataMatrix(index=[historic.index[date]], data=alloc_vals, columns=symbols))
alloc[symbols[0]] = .1
alloc['_CASH'] = .1
#Dump to a pkl file
output=open(sys.argv[3],"wb")
pickle.dump(alloc, output)
| [
1,
14550,
13,
29898,
29883,
29897,
29871,
29906,
29900,
29896,
29896,
29892,
29871,
29906,
29900,
29896,
29906,
16762,
1920,
305,
10550,
15025,
13,
4013,
2752,
775,
338,
5492,
1090,
278,
1570,
350,
7230,
19405,
29889,
29871,
3529,
1074,
13,
1124,
597,
4594,
29889,
12150,
20415,
29889,
990,
29914,
2248,
29889,
1961,
29973,
3257,
29922,
29984,
1254,
29968,
29918,
29931,
293,
1947,
13,
1454,
19405,
4902,
29889,
13,
13,
20399,
373,
2627,
29871,
29896,
29892,
29871,
29906,
29900,
29896,
29896,
13,
13,
29992,
8921,
29901,
29966,
5813,
29958,
13,
29992,
12346,
29901,
529,
26862,
6227,
29958,
13,
29992,
7727,
29901,
2866,
2708,
9673,
363,
1250,
1688,
261,
322,
3461,
29889,
13,
13,
12008,
13,
13,
13,
29937,
13,
29937,
23471,
368,
29934,
774,
284,
19985,
14023,
29889,
2272,
13,
29937,
13,
29937,
10783,
482,
29901,
3017,
23471,
368,
29934,
774,
284,
19985,
14023,
29889,
2272,
29871,
29896,
29899,
29896,
29899,
29906,
29900,
29900,
29946,
29915,
525,
29896,
29899,
29896,
29899,
29906,
29900,
29900,
29929,
29915,
525,
15956,
29889,
29886,
6321,
29915,
13,
29937,
13,
29937,
319,
13705,
2471,
607,
10017,
263,
4098,
368,
24082,
1591,
773,
29871,
13,
29937,
1369,
2635,
322,
1095,
2635,
3412,
411,
278,
937,
29871,
29906,
29900,
15072,
310,
317,
29987,
29925,
29945,
29900,
29900,
29889,
13,
29937,
739,
769,
270,
17204,
278,
24082,
1591,
304,
263,
5839,
280,
934,
29889,
13,
29937,
13,
29937,
13,
13,
29937,
4691,
24802,
13,
5215,
5839,
280,
13,
3166,
282,
2904,
370,
1053,
334,
13,
3166,
11701,
1053,
334,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
12865,
408,
11636,
13,
5215,
2897,
13,
13,
29937,
29939,
303,
29895,
24802,
13,
5215,
3855,
303,
29895,
4422,
29889,
1469,
6638,
408,
1146,
13,
5215,
3855,
303,
29895,
4422,
29889,
29939,
29879,
1256,
4422,
408,
868,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
12,
2158,
703,
27795,
23471,
368,
12936,
284,
19985,
13705,
6257,
15691,
9675,
29889,
19218,
29961,
29896,
10062,
29908,
322,
17140,
15691,
9675,
29889,
19218,
29961,
29906,
10062,
1642,
1159,
13,
13,
12,
29937,
2577,
937,
29871,
29906,
29900,
317,
29987,
29925,
23858,
29879,
29871,
13,
12,
18098,
29879,
353,
1051,
29898,
9302,
29889,
1359,
3945,
29898,
359,
29889,
21813,
1839,
29984,
29903,
2033,
23097,
29914,
24561,
3601,
29914,
710,
1845,
583,
29914,
29903,
29987,
29925,
29945,
29900,
29900,
29889,
7638,
742,
29881,
1853,
2433,
710,
742,
6144,
19657,
29922,
742,
742,
21032,
2433,
29937,
742,
11014,
5727,
29922,
29900,
876,
13,
12,
18098,
29879,
353,
15072,
29961,
29900,
29901,
29896,
29929,
29962,
13,
12,
13,
12,
29937,
2697,
1369,
322,
1095,
10452,
3064,
13,
12,
29873,
353,
1051,
29898,
1958,
29898,
524,
29892,
9675,
29889,
19218,
29961,
29896,
1822,
5451,
877,
29899,
29915,
4961,
13,
12,
2962,
3250,
353,
11636,
29889,
12673,
29898,
29873,
29961,
29906,
1402,
29873,
29961,
29900,
1402,
29873,
29961,
29896,
2314,
13,
12,
29873,
353,
1051,
29898,
1958,
29898,
524,
29892,
9675,
29889,
19218,
29961,
29906,
1822,
5451,
877,
29899,
29915,
4961,
13,
12,
355,
3250,
353,
11636,
29889,
12673,
29898,
29873,
29961,
29906,
1402,
29873,
29961,
29900,
1402,
29873,
29961,
29896,
2314,
13,
12,
13,
12,
29937,
2577,
7429,
5335,
342,
15092,
13,
12,
2230,
974,
3250,
29922,
6008,
29889,
9346,
287,
2554,
29898,
29882,
2470,
29922,
29896,
29953,
29897,
13,
12,
9346,
342,
15092,
353,
868,
29889,
657,
29940,
29979,
1660,
16700,
29898,
2962,
3250,
29892,
355,
3250,
29892,
2230,
974,
3250,
29897,
13,
12,
13,
12,
29937,
3617,
278,
848,
515,
278,
848,
3787,
13,
12,
1272,
5415,
353,
1146,
29889,
1469,
6638,
877,
29940,
990,
403,
1495,
13,
12,
16211,
293,
353,
848,
5415,
29889,
657,
29918,
1272,
29898,
9346,
342,
15092,
29892,
15072,
29892,
376,
5358,
1159,
13,
13,
1678,
396,
3789,
786,
278,
24082,
1591,
13,
12,
15956,
29918,
791,
29879,
21098,
29947,
14571,
2435,
29898,
16211,
293,
29889,
5975,
29961,
29900,
29892,
29901,
2314,
29899,
29896,
11877,
2873,
3552,
29896,
29892,
2435,
29898,
16211,
293,
29889,
5975,
29961,
29900,
29892,
17531,
4961,
13,
12,
15956,
29922,
1469,
14609,
29898,
2248,
11759,
16211,
293,
29889,
2248,
29961,
29900,
20526,
848,
29922,
15956,
29918,
791,
29879,
29892,
4341,
29922,
18098,
29879,
29897,
13,
12,
1454,
2635,
297,
3464,
29898,
29896,
29892,
7431,
29898,
16211,
293,
29889,
2248,
22164,
13,
12,
12,
361,
29898,
16211,
293,
29889,
2248,
29961,
1256,
1822,
3250,
1360,
29896,
1125,
13,
12,
12,
12,
15956,
29922,
15956,
29889,
4397,
29898,
1469,
14609,
29898,
2248,
11759,
16211,
293,
29889,
2248,
29961,
1256,
20526,
848,
29922,
15956,
29918,
791,
29879,
29892,
4341,
29922,
18098,
29879,
876,
13,
12,
15956,
29961,
18098,
29879,
29961,
29900,
5262,
353,
869,
29896,
13,
12,
15956,
1839,
29918,
29907,
24943,
2033,
353,
869,
29896,
13,
12,
13,
12,
29937,
29928,
3427,
304,
263,
282,
6321,
934,
13,
12,
4905,
29922,
3150,
29898,
9675,
29889,
19218,
29961,
29941,
1402,
29908,
29893,
29890,
1159,
13,
12,
23945,
280,
29889,
15070,
29898,
15956,
29892,
1962,
29897,
13,
2
] |
cntapp/__init__.py | rgaudin/edupi | 0 | 126465 | <reponame>rgaudin/edupi<filename>cntapp/__init__.py
default_app_config = 'cntapp.apps.CntappConfig' | [
1,
529,
276,
1112,
420,
29958,
29878,
3249,
566,
262,
29914,
287,
786,
29875,
29966,
9507,
29958,
20047,
932,
29914,
1649,
2344,
26914,
2272,
13,
4381,
29918,
932,
29918,
2917,
353,
525,
20047,
932,
29889,
13371,
29889,
29907,
593,
932,
3991,
29915,
2
] |
refinenet/__init__.py | Best-of-ACRV/pytorch-refinenet | 3 | 48930 | from .refinenet import RefineNet
from .__main__ import main as run_from_args
| [
1,
515,
869,
999,
7026,
300,
1053,
9897,
457,
6779,
13,
3166,
869,
1649,
3396,
1649,
1053,
1667,
408,
1065,
29918,
3166,
29918,
5085,
13,
2
] |
src/blog/posts/migrations/0008_post_category.py | ggeop/Django_blog | 1 | 1612629 | <reponame>ggeop/Django_blog
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0007_auto_20181231_0243'),
]
operations = [
migrations.AddField(
model_name='post',
name='category',
field=models.CharField(max_length=6, default='all', choices=[('all', 'ALL'), ('android', 'ANDROID'), ('iphone', 'IPHONE')]),
),
]
| [
1,
529,
276,
1112,
420,
29958,
29887,
479,
459,
29914,
29928,
5364,
29918,
7312,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
9557,
29889,
2585,
1053,
4733,
29892,
9725,
800,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
14080,
742,
525,
29900,
29900,
29900,
29955,
29918,
6921,
29918,
29906,
29900,
29896,
29947,
29896,
29906,
29941,
29896,
29918,
29900,
29906,
29946,
29941,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
2490,
742,
13,
9651,
1024,
2433,
7320,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29953,
29892,
2322,
2433,
497,
742,
19995,
11759,
877,
497,
742,
525,
9818,
5477,
6702,
2843,
742,
525,
9468,
1672,
1367,
5477,
6702,
29875,
6710,
742,
525,
5690,
29950,
12413,
1495,
11724,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
login.py | cuifan1/test1 | 1 | 53995 |
for j in range(1, 9):
for i in range(1,j+1):
print("%d * %d = %d" % (i,j,i*j),end="\t")
print()
| [
1,
29871,
13,
1454,
432,
297,
3464,
29898,
29896,
29892,
29871,
29929,
1125,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29892,
29926,
29974,
29896,
1125,
13,
4706,
1596,
11702,
29881,
334,
1273,
29881,
353,
1273,
29881,
29908,
1273,
313,
29875,
29892,
29926,
29892,
29875,
29930,
29926,
511,
355,
543,
29905,
29873,
1159,
13,
1678,
1596,
580,
13,
2
] |
test.py | IldusTim/QAStudy | 0 | 13452 | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import math
from selenium.webdriver.support.ui import Select
import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
link = "http://suninjuly.github.io/explicit_wait2.html"
opt = webdriver.ChromeOptions()
opt.add_experimental_option('w3c', False)
browser = webdriver.Chrome(chrome_options=opt)
browser.implicitly_wait(5, 0.5)
browser.get(link)
button = browser.find_element_by_id("book")
price = WebDriverWait(browser, 12).until(EC.text_to_be_present_in_element((By.ID, "price"),"10000 RUR"))
button.click()
def calc(x):
return str(math.log(abs(12*math.sin(int(x)))))
browser.find_element_by_class_name("btn-primary").click()
# new_window = browser.window_handles[1]
# browser.switch_to.window(new_window)
x_element = browser.find_element_by_id("input_value")
x = x_element.text
y = calc(x)
browser.find_element_by_id("answer").click()
browser.find_element_by_id("answer").send_keys(y)
browser.find_element_by_id("solve").click() | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
18866,
1053,
1856,
9465,
13,
3166,
18866,
29889,
29813,
29889,
5924,
29889,
1481,
1053,
2563,
12376,
15716,
13,
5215,
5844,
13,
3166,
18866,
29889,
29813,
29889,
5924,
29889,
1481,
1053,
7605,
13,
5215,
2897,
13,
5215,
931,
13,
3166,
18866,
29889,
29813,
29889,
9435,
29889,
1609,
1053,
2648,
13,
3166,
18866,
29889,
29813,
29889,
5924,
1053,
3806,
29918,
1116,
2187,
408,
17522,
13,
13,
13,
2324,
353,
376,
1124,
597,
11445,
262,
29926,
11850,
29889,
3292,
29889,
601,
29914,
4548,
4019,
29918,
10685,
29906,
29889,
1420,
29908,
13,
3670,
353,
1856,
9465,
29889,
1451,
4871,
5856,
580,
13,
3670,
29889,
1202,
29918,
735,
27910,
29918,
3385,
877,
29893,
29941,
29883,
742,
7700,
29897,
13,
15965,
353,
1856,
9465,
29889,
1451,
4871,
29898,
18114,
29918,
6768,
29922,
3670,
29897,
13,
15965,
29889,
6574,
4019,
368,
29918,
10685,
29898,
29945,
29892,
29871,
29900,
29889,
29945,
29897,
13,
15965,
29889,
657,
29898,
2324,
29897,
13,
13,
3092,
353,
4714,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
2909,
1159,
13,
9175,
353,
2563,
12376,
15716,
29898,
15965,
29892,
29871,
29896,
29906,
467,
29305,
29898,
11206,
29889,
726,
29918,
517,
29918,
915,
29918,
6338,
29918,
262,
29918,
5029,
3552,
2059,
29889,
1367,
29892,
376,
9175,
4968,
29908,
29896,
29900,
29900,
29900,
29900,
390,
4574,
5783,
13,
3092,
29889,
3808,
580,
13,
13,
1753,
22235,
29898,
29916,
1125,
13,
1678,
736,
851,
29898,
755,
29889,
1188,
29898,
6897,
29898,
29896,
29906,
29930,
755,
29889,
5223,
29898,
524,
29898,
29916,
876,
4961,
13,
13,
15965,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
1990,
29918,
978,
703,
7290,
29899,
16072,
2564,
3808,
580,
13,
13,
29937,
716,
29918,
7165,
353,
4714,
29889,
7165,
29918,
3179,
793,
29961,
29896,
29962,
13,
29937,
4714,
29889,
15123,
29918,
517,
29889,
7165,
29898,
1482,
29918,
7165,
29897,
13,
13,
29916,
29918,
5029,
353,
4714,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
2080,
29918,
1767,
1159,
13,
29916,
353,
921,
29918,
5029,
29889,
726,
13,
29891,
353,
22235,
29898,
29916,
29897,
13,
15965,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
12011,
2564,
3808,
580,
13,
15965,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
12011,
2564,
6717,
29918,
8149,
29898,
29891,
29897,
13,
15965,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
2929,
345,
2564,
3808,
580,
2
] |
app.py | taropun/nhentaifs-web | 2 | 89252 | #!/usr/bin/python3
import os
import os.path
import sys
from bottle import abort, redirect, request, route, run, static_file, template
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STATIC_DIR = '{}/static'.format(SCRIPT_DIR)
NAVIGATION_SIZE = 7
PREFETCH_SIZE = 5
ROW_COUNT = 5
LARGE_GALLERY_SIZE = 100
def fs_path(path, *args):
return os.path.join(sys.argv[1], path.format(*args))
@route('/static/<path:path>')
def serve_static(path):
return static_file(path, root=STATIC_DIR)
@route('/img/<path:path>')
def serve_image(path):
response = static_file(path, root=sys.argv[1])
response.headers.pop('Content-Length')
return response
@route('/')
def index():
return template('index.html.tpl')
def window(index, width, items):
if len(items) <= width:
return items
left_width = int(width / 2.0) + 1
right_width = width - left_width
start = max(0, index - left_width)
end = min(len(items), index + right_width)
actual_width = end - start
if (index - start) < left_width:
end += width - actual_width
if (end - index) < right_width:
start -= width - actual_width
return items[start:end]
def chunks(items, count):
for i in range(0, len(items), count):
yield items[i:i + count]
def make_nav(page, count):
return {
'first': 1,
'previous': page - 1 if page > 1 else None,
'next': page + 1 if page < count else None,
'last': count,
'window': window(page, NAVIGATION_SIZE, list(range(1, count + 1))),
'current': page
}
def fs_content(path, *args):
with open(fs_path(path, *args), 'r') as f:
return f.read()
def fs_peek(path, *args):
with open(fs_path(path, *args), 'rb') as f:
f.read(1)
def results_metadata(base):
per_page = int(fs_content('{}/per_page', base))
galleries = []
for i in range(per_page):
try:
ID = fs_content('{}/{}/id', base, i)
except FileNotFoundError:
break
title = (fs_content('{}/{}/title/pretty', base, i) or
fs_content('{}/{}/title/english', base, i))
files = os.listdir(fs_path('{}/{}', base, i))
thumb = ['{}/{}/{}'.format(base, i, f) for f in files
if f.startswith('thumb.')][0]
tags = {ID: fs_content('{}/{}/tags/{}', base, i, ID)
for ID in os.listdir(fs_path('{}/{}/tags', base, i))}
grouped_tags = group_tags(tags)
language = 'language--{}'.format(guess_language(grouped_tags))
num_pages = int(fs_content('{}/{}/num_pages', base, i))
is_large = num_pages >= LARGE_GALLERY_SIZE
classes = [language, 'gallery--large'] if is_large else [language]
galleries.append({'id': ID, 'title': title, 'thumb': thumb,
'classes': ' '.join(classes)})
num_pages = int(fs_content('{}/num_pages', base))
return {'num_pages': num_pages, 'galleries': galleries}
@route('/all')
def frontpage():
title = 'Frontpage'
page = int(request.query.page or '1')
metadata = results_metadata('all/{}'.format(page))
num_pages = metadata['num_pages']
galleries = chunks(metadata['galleries'], ROW_COUNT)
nav = make_nav(page, num_pages)
base = '/all?page='
return template('results.html.tpl', title=title, base=base,
galleries=galleries, nav=nav)
@route('/search')
def search():
query = request.query.query
if not query:
redirect('/all')
title = 'Search: {}'.format(query)
page = int(request.query.page or '1')
metadata = results_metadata('search/{}/{}'.format(query, page))
num_pages = metadata['num_pages']
galleries = chunks(metadata['galleries'], ROW_COUNT)
nav = make_nav(page, num_pages)
base = '/search?query={}&page='.format(query)
return template('results.html.tpl', title=title, base=base,
galleries=galleries, nav=nav)
@route('/tagged/<tag_id:int>')
def tagged(tag_id):
title = 'Tag: {}'.format(tag_id)
page = int(request.query.page or '1')
metadata = results_metadata('tagged/{}/{}'.format(tag_id, page))
num_pages = metadata['num_pages']
galleries = chunks(metadata['galleries'], ROW_COUNT)
nav = make_nav(page, num_pages)
base = '/tagged/{}?page='.format(tag_id)
return template('results.html.tpl', title=title, base=base,
galleries=galleries, nav=nav)
def group_tags(tags):
result = {}
for ID, tag in tags.items():
key, value = tag.split(':')
if key not in result:
result[key] = {}
result[key][value] = ID
return result
def guess_language(grouped_tags):
if 'language' not in grouped_tags:
return 'unknown'
candidates = grouped_tags['language']
if 'translated' in candidates:
candidates.pop('translated')
languages = list(candidates.keys())
if 'english' in languages:
return 'english'
elif 'japanese' in languages:
return 'japanese'
elif 'chinese' in languages:
return 'chinese'
elif len(languages) > 0:
return languages[0]
else:
return 'unknown'
def gallery_metadata(gallery_id):
base = 'gallery/{}'.format(gallery_id)
files = os.listdir(fs_path(base))
tags = {ID: fs_content('{}/tags/{}', base, ID)
for ID in os.listdir(fs_path('{}/tags', base))}
return {
'id': gallery_id,
'title': {
'pretty': fs_content('{}/title/pretty', base),
'native': fs_content('{}/title/native', base),
'english': fs_content('{}/title/english', base)
},
'cover': ['{}/{}'.format(base, f) for f in files
if f.startswith('cover.')][0],
'tags': group_tags(tags),
'filenames': fs_content('{}/filenames', base).split('\n'),
'num_pages': int(fs_content('{}/num_pages', base)),
'uploaded': int(fs_content('{}/uploaded', base))
}
def related_metadata(gallery_id):
base = 'related/{}'.format(gallery_id)
directories = os.listdir(fs_path(base))
galleries = []
for directory in directories:
base = 'related/{}/{}'.format(gallery_id, directory)
files = os.listdir(fs_path(base))
ID = fs_content('{}/id', base, directory)
tags = {ID: fs_content('{}/tags/{}', base, ID)
for ID in os.listdir(fs_path('{}/tags', base))}
grouped_tags = group_tags(tags)
language = 'language--{}'.format(guess_language(grouped_tags))
num_pages = int(fs_content('{}/num_pages', base))
is_large = num_pages >= LARGE_GALLERY_SIZE
classes = [language, 'gallery--large'] if is_large else [language]
gallery = {
'id': ID,
'title': fs_content('{}/title/pretty', base),
'cover': ['gallery/{}/{}'.format(ID, f) for f in files
if f.startswith('cover.')][0],
'classes': ' '.join(classes)
}
galleries.append(gallery)
return galleries
@route('/gallery/<gallery_id:int>')
def gallery(gallery_id):
metadata = gallery_metadata(gallery_id)
title = metadata['title']['pretty'] or metadata['title']['english']
filenames = ['/img/gallery/{}/thumbs/{}'.format(gallery_id, f)
for f in metadata['filenames']]
thumbs = chunks(list(enumerate(filenames)), ROW_COUNT)
related = related_metadata(gallery_id)
return template('gallery.html.tpl', title=title,
thumbs=thumbs, metadata=metadata, related=related)
@route('/gallery/<gallery_id:int>/<page:int>')
def gallery_page(gallery_id, page):
index = page - 1
base = 'gallery/{}'.format(gallery_id)
title = fs_content('{}/title/pretty', base)
num_pages = int(fs_content('{}/num_pages', base))
if page < 1 or page > num_pages:
abort(404)
nav = make_nav(page, num_pages)
nav.pop('window')
filenames = fs_content('{}/filenames', base).split('\n')
page_url = '/img/gallery/{}/pages/{}'.format(gallery_id, filenames[index])
base = '/gallery/{}/'.format(gallery_id)
gallery_url = '/gallery/{}'.format(gallery_id)
return template('gallery_page.html.tpl', title=title, base=base,
nav=nav, page_url=page_url, gallery_url=gallery_url)
@route('/gallery/<gallery_id:int>/<page:int>/prefetch')
def gallery_page_prefetch(gallery_id, page):
base = 'gallery/{}'.format(gallery_id)
filenames = fs_content('{}/filenames', base).split('\n')
pages = window(page, PREFETCH_SIZE, filenames)
center = PREFETCH_SIZE // 2
pages.pop(center)
for page in pages:
fs_peek('{}/pages/{}', base, page)
return {'status': 0}
if __name__ == '__main__':
if len(sys.argv) != 2:
print('Usage: {} <mountpoint>'.format(sys.argv[0]))
sys.exit(1)
try:
port = int(os.getenv('PORT') or '8080')
run(port=port)
except FileNotFoundError:
abort(404)
# TODO:
# CSS:
# - [ ] make it dark
# - [X] highlight large galleries
# JS:
# - [X] load thumbs as they scroll into view
# - [X] preload gallery images relative to the current one
# - [X] bind keys in gallery viewer
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
29941,
13,
13,
5215,
2897,
13,
5215,
2897,
29889,
2084,
13,
5215,
10876,
13,
13,
3166,
18046,
280,
1053,
27450,
29892,
6684,
29892,
2009,
29892,
5782,
29892,
1065,
29892,
2294,
29918,
1445,
29892,
4472,
13,
13,
13,
7187,
24290,
29918,
9464,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
6370,
2084,
22168,
1445,
1649,
876,
13,
17816,
2965,
29918,
9464,
353,
22372,
6822,
7959,
4286,
4830,
29898,
7187,
24290,
29918,
9464,
29897,
13,
3521,
29963,
6259,
8098,
29918,
14226,
353,
29871,
29955,
13,
15094,
29943,
2544,
3210,
29918,
14226,
353,
29871,
29945,
13,
25180,
29918,
18736,
353,
29871,
29945,
13,
29931,
1718,
1692,
29918,
29954,
9818,
24422,
29918,
14226,
353,
29871,
29896,
29900,
29900,
13,
13,
13,
1753,
18920,
29918,
2084,
29898,
2084,
29892,
334,
5085,
1125,
13,
1678,
736,
2897,
29889,
2084,
29889,
7122,
29898,
9675,
29889,
19218,
29961,
29896,
1402,
2224,
29889,
4830,
10456,
5085,
876,
13,
13,
13,
29992,
13134,
11219,
7959,
29914,
29966,
2084,
29901,
2084,
29958,
1495,
13,
1753,
9080,
29918,
7959,
29898,
2084,
1125,
13,
1678,
736,
2294,
29918,
1445,
29898,
2084,
29892,
3876,
29922,
17816,
2965,
29918,
9464,
29897,
13,
13,
13,
29992,
13134,
11219,
2492,
29914,
29966,
2084,
29901,
2084,
29958,
1495,
13,
1753,
9080,
29918,
3027,
29898,
2084,
1125,
13,
1678,
2933,
353,
2294,
29918,
1445,
29898,
2084,
29892,
3876,
29922,
9675,
29889,
19218,
29961,
29896,
2314,
13,
1678,
2933,
29889,
13662,
29889,
7323,
877,
3916,
29899,
6513,
1495,
13,
1678,
736,
2933,
13,
13,
13,
29992,
13134,
11219,
1495,
13,
1753,
2380,
7295,
13,
1678,
736,
4472,
877,
2248,
29889,
1420,
29889,
29873,
572,
1495,
13,
13,
13,
1753,
3474,
29898,
2248,
29892,
2920,
29892,
4452,
1125,
13,
1678,
565,
7431,
29898,
7076,
29897,
5277,
2920,
29901,
13,
4706,
736,
4452,
13,
1678,
2175,
29918,
2103,
353,
938,
29898,
2103,
847,
29871,
29906,
29889,
29900,
29897,
718,
29871,
29896,
13,
1678,
1492,
29918,
2103,
353,
2920,
448,
2175,
29918,
2103,
13,
1678,
1369,
353,
4236,
29898,
29900,
29892,
2380,
448,
2175,
29918,
2103,
29897,
13,
1678,
1095,
353,
1375,
29898,
2435,
29898,
7076,
511,
2380,
718,
1492,
29918,
2103,
29897,
13,
1678,
3935,
29918,
2103,
353,
1095,
448,
1369,
13,
1678,
565,
313,
2248,
448,
1369,
29897,
529,
2175,
29918,
2103,
29901,
13,
4706,
1095,
4619,
2920,
448,
3935,
29918,
2103,
13,
1678,
565,
313,
355,
448,
2380,
29897,
529,
1492,
29918,
2103,
29901,
13,
4706,
1369,
22361,
2920,
448,
3935,
29918,
2103,
13,
1678,
736,
4452,
29961,
2962,
29901,
355,
29962,
13,
13,
13,
1753,
521,
18801,
29898,
7076,
29892,
2302,
1125,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
7076,
511,
2302,
1125,
13,
4706,
7709,
4452,
29961,
29875,
29901,
29875,
718,
2302,
29962,
13,
13,
13,
1753,
1207,
29918,
6654,
29898,
3488,
29892,
2302,
1125,
13,
1678,
736,
426,
13,
4706,
525,
4102,
2396,
29871,
29896,
29892,
13,
4706,
525,
24957,
2396,
1813,
448,
29871,
29896,
565,
1813,
1405,
29871,
29896,
1683,
6213,
29892,
13,
4706,
525,
4622,
2396,
1813,
718,
29871,
29896,
565,
1813,
529,
2302,
1683,
6213,
29892,
13,
4706,
525,
4230,
2396,
2302,
29892,
13,
4706,
525,
7165,
2396,
3474,
29898,
3488,
29892,
405,
7520,
6259,
8098,
29918,
14226,
29892,
1051,
29898,
3881,
29898,
29896,
29892,
2302,
718,
29871,
29896,
876,
511,
13,
4706,
525,
3784,
2396,
1813,
13,
1678,
500,
13,
13,
13,
1753,
18920,
29918,
3051,
29898,
2084,
29892,
334,
5085,
1125,
13,
1678,
411,
1722,
29898,
5847,
29918,
2084,
29898,
2084,
29892,
334,
5085,
511,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
736,
285,
29889,
949,
580,
13,
13,
13,
1753,
18920,
29918,
412,
1416,
29898,
2084,
29892,
334,
5085,
1125,
13,
1678,
411,
1722,
29898,
5847,
29918,
2084,
29898,
2084,
29892,
334,
5085,
511,
525,
6050,
1495,
408,
285,
29901,
13,
4706,
285,
29889,
949,
29898,
29896,
29897,
13,
13,
13,
1753,
2582,
29918,
19635,
29898,
3188,
1125,
13,
1678,
639,
29918,
3488,
353,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
546,
29918,
3488,
742,
2967,
876,
13,
1678,
11798,
6358,
353,
5159,
13,
1678,
363,
474,
297,
3464,
29898,
546,
29918,
3488,
1125,
13,
4706,
1018,
29901,
13,
9651,
3553,
353,
18920,
29918,
3051,
877,
29912,
6822,
29912,
6822,
333,
742,
2967,
29892,
474,
29897,
13,
4706,
5174,
3497,
17413,
2392,
29901,
13,
9651,
2867,
13,
4706,
3611,
353,
313,
5847,
29918,
3051,
877,
29912,
6822,
29912,
6822,
3257,
29914,
1457,
4349,
742,
2967,
29892,
474,
29897,
470,
13,
462,
18920,
29918,
3051,
877,
29912,
6822,
29912,
6822,
3257,
29914,
996,
1674,
742,
2967,
29892,
474,
876,
13,
4706,
2066,
353,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
877,
29912,
6822,
8875,
742,
2967,
29892,
474,
876,
13,
4706,
28968,
353,
6024,
29912,
6822,
29912,
6822,
8875,
4286,
4830,
29898,
3188,
29892,
474,
29892,
285,
29897,
363,
285,
297,
2066,
13,
462,
565,
285,
29889,
27382,
2541,
877,
386,
3774,
29889,
1495,
3816,
29900,
29962,
13,
4706,
8282,
353,
426,
1367,
29901,
18920,
29918,
3051,
877,
29912,
6822,
29912,
6822,
11338,
29914,
8875,
742,
2967,
29892,
474,
29892,
3553,
29897,
13,
18884,
363,
3553,
297,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
877,
29912,
6822,
29912,
6822,
11338,
742,
2967,
29892,
474,
876,
29913,
13,
4706,
27831,
29918,
11338,
353,
2318,
29918,
11338,
29898,
11338,
29897,
13,
4706,
4086,
353,
525,
11675,
489,
8875,
4286,
4830,
29898,
2543,
404,
29918,
11675,
29898,
2972,
287,
29918,
11338,
876,
13,
4706,
954,
29918,
12292,
353,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
29912,
6822,
1949,
29918,
12292,
742,
2967,
29892,
474,
876,
13,
4706,
338,
29918,
16961,
353,
954,
29918,
12292,
6736,
365,
1718,
1692,
29918,
29954,
9818,
24422,
29918,
14226,
13,
4706,
4413,
353,
518,
11675,
29892,
525,
29887,
23365,
489,
16961,
2033,
565,
338,
29918,
16961,
1683,
518,
11675,
29962,
13,
4706,
11798,
6358,
29889,
4397,
3319,
29915,
333,
2396,
3553,
29892,
525,
3257,
2396,
3611,
29892,
525,
386,
3774,
2396,
28968,
29892,
13,
462,
3986,
525,
13203,
2396,
525,
15300,
7122,
29898,
13203,
26972,
13,
1678,
954,
29918,
12292,
353,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
1949,
29918,
12292,
742,
2967,
876,
13,
1678,
736,
11117,
1949,
29918,
12292,
2396,
954,
29918,
12292,
29892,
525,
29887,
497,
6358,
2396,
11798,
6358,
29913,
13,
13,
13,
29992,
13134,
11219,
497,
1495,
13,
1753,
4565,
3488,
7295,
13,
1678,
3611,
353,
525,
29348,
3488,
29915,
13,
1678,
1813,
353,
938,
29898,
3827,
29889,
1972,
29889,
3488,
470,
525,
29896,
1495,
13,
1678,
15562,
353,
2582,
29918,
19635,
877,
497,
29914,
8875,
4286,
4830,
29898,
3488,
876,
13,
1678,
954,
29918,
12292,
353,
15562,
1839,
1949,
29918,
12292,
2033,
13,
1678,
11798,
6358,
353,
521,
18801,
29898,
19635,
1839,
29887,
497,
6358,
7464,
390,
9806,
29918,
18736,
29897,
13,
1678,
6283,
353,
1207,
29918,
6654,
29898,
3488,
29892,
954,
29918,
12292,
29897,
13,
1678,
2967,
353,
8207,
497,
29973,
3488,
2433,
13,
1678,
736,
4472,
877,
9902,
29889,
1420,
29889,
29873,
572,
742,
3611,
29922,
3257,
29892,
2967,
29922,
3188,
29892,
13,
462,
1678,
11798,
6358,
29922,
29887,
497,
6358,
29892,
6283,
29922,
6654,
29897,
13,
13,
13,
29992,
13134,
11219,
4478,
1495,
13,
1753,
2740,
7295,
13,
1678,
2346,
353,
2009,
29889,
1972,
29889,
1972,
13,
1678,
565,
451,
2346,
29901,
13,
4706,
6684,
11219,
497,
1495,
13,
1678,
3611,
353,
525,
7974,
29901,
6571,
4286,
4830,
29898,
1972,
29897,
13,
1678,
1813,
353,
938,
29898,
3827,
29889,
1972,
29889,
3488,
470,
525,
29896,
1495,
13,
1678,
15562,
353,
2582,
29918,
19635,
877,
4478,
19248,
6822,
8875,
4286,
4830,
29898,
1972,
29892,
1813,
876,
13,
1678,
954,
29918,
12292,
353,
15562,
1839,
1949,
29918,
12292,
2033,
13,
1678,
11798,
6358,
353,
521,
18801,
29898,
19635,
1839,
29887,
497,
6358,
7464,
390,
9806,
29918,
18736,
29897,
13,
1678,
6283,
353,
1207,
29918,
6654,
29898,
3488,
29892,
954,
29918,
12292,
29897,
13,
1678,
2967,
353,
8207,
4478,
29973,
1972,
3790,
15704,
3488,
2433,
29889,
4830,
29898,
1972,
29897,
13,
1678,
736,
4472,
877,
9902,
29889,
1420,
29889,
29873,
572,
742,
3611,
29922,
3257,
29892,
2967,
29922,
3188,
29892,
13,
462,
1678,
11798,
6358,
29922,
29887,
497,
6358,
29892,
6283,
29922,
6654,
29897,
13,
13,
13,
29992,
13134,
11219,
4039,
3192,
29914,
29966,
4039,
29918,
333,
29901,
524,
29958,
1495,
13,
1753,
4055,
3192,
29898,
4039,
29918,
333,
1125,
13,
1678,
3611,
353,
525,
8176,
29901,
6571,
4286,
4830,
29898,
4039,
29918,
333,
29897,
13,
1678,
1813,
353,
938,
29898,
3827,
29889,
1972,
29889,
3488,
470,
525,
29896,
1495,
13,
1678,
15562,
353,
2582,
29918,
19635,
877,
4039,
3192,
19248,
6822,
8875,
4286,
4830,
29898,
4039,
29918,
333,
29892,
1813,
876,
13,
1678,
954,
29918,
12292,
353,
15562,
1839,
1949,
29918,
12292,
2033,
13,
1678,
11798,
6358,
353,
521,
18801,
29898,
19635,
1839,
29887,
497,
6358,
7464,
390,
9806,
29918,
18736,
29897,
13,
1678,
6283,
353,
1207,
29918,
6654,
29898,
3488,
29892,
954,
29918,
12292,
29897,
13,
1678,
2967,
353,
8207,
4039,
3192,
29914,
8875,
29973,
3488,
2433,
29889,
4830,
29898,
4039,
29918,
333,
29897,
13,
1678,
736,
4472,
877,
9902,
29889,
1420,
29889,
29873,
572,
742,
3611,
29922,
3257,
29892,
2967,
29922,
3188,
29892,
13,
462,
1678,
11798,
6358,
29922,
29887,
497,
6358,
29892,
6283,
29922,
6654,
29897,
13,
13,
13,
1753,
2318,
29918,
11338,
29898,
11338,
1125,
13,
1678,
1121,
353,
6571,
13,
1678,
363,
3553,
29892,
4055,
297,
8282,
29889,
7076,
7295,
13,
4706,
1820,
29892,
995,
353,
4055,
29889,
5451,
877,
29901,
1495,
13,
4706,
565,
1820,
451,
297,
1121,
29901,
13,
9651,
1121,
29961,
1989,
29962,
353,
6571,
13,
4706,
1121,
29961,
1989,
3816,
1767,
29962,
353,
3553,
13,
1678,
736,
1121,
13,
13,
13,
1753,
4140,
29918,
11675,
29898,
2972,
287,
29918,
11338,
1125,
13,
1678,
565,
525,
11675,
29915,
451,
297,
27831,
29918,
11338,
29901,
13,
4706,
736,
525,
26690,
29915,
13,
1678,
21669,
353,
27831,
29918,
11338,
1839,
11675,
2033,
13,
1678,
565,
525,
3286,
29880,
630,
29915,
297,
21669,
29901,
13,
4706,
21669,
29889,
7323,
877,
3286,
29880,
630,
1495,
13,
1678,
10276,
353,
1051,
29898,
29883,
5380,
1078,
29889,
8149,
3101,
13,
1678,
565,
525,
996,
1674,
29915,
297,
10276,
29901,
13,
4706,
736,
525,
996,
1674,
29915,
13,
1678,
25342,
525,
29926,
21419,
968,
29915,
297,
10276,
29901,
13,
4706,
736,
525,
29926,
21419,
968,
29915,
13,
1678,
25342,
525,
305,
8233,
29915,
297,
10276,
29901,
13,
4706,
736,
525,
305,
8233,
29915,
13,
1678,
25342,
7431,
29898,
29880,
8737,
29897,
1405,
29871,
29900,
29901,
13,
4706,
736,
10276,
29961,
29900,
29962,
13,
1678,
1683,
29901,
13,
4706,
736,
525,
26690,
29915,
13,
13,
13,
1753,
23363,
29918,
19635,
29898,
29887,
23365,
29918,
333,
1125,
13,
1678,
2967,
353,
525,
29887,
23365,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
2066,
353,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
29898,
3188,
876,
13,
1678,
8282,
353,
426,
1367,
29901,
18920,
29918,
3051,
877,
29912,
6822,
11338,
29914,
8875,
742,
2967,
29892,
3553,
29897,
13,
9651,
363,
3553,
297,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
877,
29912,
6822,
11338,
742,
2967,
876,
29913,
13,
1678,
736,
426,
13,
4706,
525,
333,
2396,
23363,
29918,
333,
29892,
13,
4706,
525,
3257,
2396,
426,
13,
9651,
525,
1457,
4349,
2396,
18920,
29918,
3051,
877,
29912,
6822,
3257,
29914,
1457,
4349,
742,
2967,
511,
13,
9651,
525,
11487,
2396,
18920,
29918,
3051,
877,
29912,
6822,
3257,
29914,
11487,
742,
2967,
511,
13,
9651,
525,
996,
1674,
2396,
18920,
29918,
3051,
877,
29912,
6822,
3257,
29914,
996,
1674,
742,
2967,
29897,
13,
4706,
2981,
13,
4706,
525,
11911,
2396,
6024,
29912,
6822,
8875,
4286,
4830,
29898,
3188,
29892,
285,
29897,
363,
285,
297,
2066,
13,
462,
29871,
565,
285,
29889,
27382,
2541,
877,
11911,
29889,
1495,
3816,
29900,
1402,
13,
4706,
525,
11338,
2396,
2318,
29918,
11338,
29898,
11338,
511,
13,
4706,
525,
1777,
264,
1280,
2396,
18920,
29918,
3051,
877,
29912,
6822,
1777,
264,
1280,
742,
2967,
467,
5451,
28909,
29876,
5477,
13,
4706,
525,
1949,
29918,
12292,
2396,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
1949,
29918,
12292,
742,
2967,
8243,
13,
4706,
525,
9009,
287,
2396,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
9009,
287,
742,
2967,
876,
13,
1678,
500,
13,
13,
13,
1753,
4475,
29918,
19635,
29898,
29887,
23365,
29918,
333,
1125,
13,
1678,
2967,
353,
525,
12817,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
17525,
353,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
29898,
3188,
876,
13,
1678,
11798,
6358,
353,
5159,
13,
1678,
363,
3884,
297,
17525,
29901,
13,
4706,
2967,
353,
525,
12817,
19248,
6822,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29892,
3884,
29897,
13,
4706,
2066,
353,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
29898,
3188,
876,
13,
4706,
3553,
353,
18920,
29918,
3051,
877,
29912,
6822,
333,
742,
2967,
29892,
3884,
29897,
13,
4706,
8282,
353,
426,
1367,
29901,
18920,
29918,
3051,
877,
29912,
6822,
11338,
29914,
8875,
742,
2967,
29892,
3553,
29897,
13,
18884,
363,
3553,
297,
2897,
29889,
1761,
3972,
29898,
5847,
29918,
2084,
877,
29912,
6822,
11338,
742,
2967,
876,
29913,
13,
4706,
27831,
29918,
11338,
353,
2318,
29918,
11338,
29898,
11338,
29897,
13,
4706,
4086,
353,
525,
11675,
489,
8875,
4286,
4830,
29898,
2543,
404,
29918,
11675,
29898,
2972,
287,
29918,
11338,
876,
13,
4706,
954,
29918,
12292,
353,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
1949,
29918,
12292,
742,
2967,
876,
13,
4706,
338,
29918,
16961,
353,
954,
29918,
12292,
6736,
365,
1718,
1692,
29918,
29954,
9818,
24422,
29918,
14226,
13,
4706,
4413,
353,
518,
11675,
29892,
525,
29887,
23365,
489,
16961,
2033,
565,
338,
29918,
16961,
1683,
518,
11675,
29962,
13,
4706,
23363,
353,
426,
13,
9651,
525,
333,
2396,
3553,
29892,
13,
9651,
525,
3257,
2396,
18920,
29918,
3051,
877,
29912,
6822,
3257,
29914,
1457,
4349,
742,
2967,
511,
13,
9651,
525,
11911,
2396,
6024,
29887,
23365,
19248,
6822,
8875,
4286,
4830,
29898,
1367,
29892,
285,
29897,
363,
285,
297,
2066,
13,
462,
418,
565,
285,
29889,
27382,
2541,
877,
11911,
29889,
1495,
3816,
29900,
1402,
13,
9651,
525,
13203,
2396,
525,
15300,
7122,
29898,
13203,
29897,
13,
4706,
500,
13,
4706,
11798,
6358,
29889,
4397,
29898,
29887,
23365,
29897,
13,
1678,
736,
11798,
6358,
13,
13,
13,
29992,
13134,
11219,
29887,
23365,
29914,
29966,
29887,
23365,
29918,
333,
29901,
524,
29958,
1495,
13,
1753,
23363,
29898,
29887,
23365,
29918,
333,
1125,
13,
1678,
15562,
353,
23363,
29918,
19635,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
3611,
353,
15562,
1839,
3257,
16215,
1457,
4349,
2033,
470,
15562,
1839,
3257,
16215,
996,
1674,
2033,
13,
1678,
977,
264,
1280,
353,
6024,
29914,
2492,
29914,
29887,
23365,
19248,
6822,
386,
3774,
29879,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29892,
285,
29897,
13,
462,
363,
285,
297,
15562,
1839,
1777,
264,
1280,
2033,
29962,
13,
1678,
28968,
29879,
353,
521,
18801,
29898,
1761,
29898,
15172,
29898,
1777,
264,
1280,
8243,
390,
9806,
29918,
18736,
29897,
13,
1678,
4475,
353,
4475,
29918,
19635,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
736,
4472,
877,
29887,
23365,
29889,
1420,
29889,
29873,
572,
742,
3611,
29922,
3257,
29892,
13,
462,
1678,
28968,
29879,
29922,
386,
3774,
29879,
29892,
15562,
29922,
19635,
29892,
4475,
29922,
12817,
29897,
13,
13,
13,
29992,
13134,
11219,
29887,
23365,
29914,
29966,
29887,
23365,
29918,
333,
29901,
524,
20690,
29966,
3488,
29901,
524,
29958,
1495,
13,
1753,
23363,
29918,
3488,
29898,
29887,
23365,
29918,
333,
29892,
1813,
1125,
13,
1678,
2380,
353,
1813,
448,
29871,
29896,
13,
1678,
2967,
353,
525,
29887,
23365,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
3611,
353,
18920,
29918,
3051,
877,
29912,
6822,
3257,
29914,
1457,
4349,
742,
2967,
29897,
13,
1678,
954,
29918,
12292,
353,
938,
29898,
5847,
29918,
3051,
877,
29912,
6822,
1949,
29918,
12292,
742,
2967,
876,
13,
1678,
565,
1813,
529,
29871,
29896,
470,
1813,
1405,
954,
29918,
12292,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29946,
29897,
13,
1678,
6283,
353,
1207,
29918,
6654,
29898,
3488,
29892,
954,
29918,
12292,
29897,
13,
1678,
6283,
29889,
7323,
877,
7165,
1495,
13,
1678,
977,
264,
1280,
353,
18920,
29918,
3051,
877,
29912,
6822,
1777,
264,
1280,
742,
2967,
467,
5451,
28909,
29876,
1495,
13,
1678,
1813,
29918,
2271,
353,
8207,
2492,
29914,
29887,
23365,
19248,
6822,
12292,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29892,
977,
264,
1280,
29961,
2248,
2314,
13,
1678,
2967,
353,
8207,
29887,
23365,
19248,
6822,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
23363,
29918,
2271,
353,
8207,
29887,
23365,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
736,
4472,
877,
29887,
23365,
29918,
3488,
29889,
1420,
29889,
29873,
572,
742,
3611,
29922,
3257,
29892,
2967,
29922,
3188,
29892,
13,
462,
1678,
6283,
29922,
6654,
29892,
1813,
29918,
2271,
29922,
3488,
29918,
2271,
29892,
23363,
29918,
2271,
29922,
29887,
23365,
29918,
2271,
29897,
13,
13,
13,
29992,
13134,
11219,
29887,
23365,
29914,
29966,
29887,
23365,
29918,
333,
29901,
524,
20690,
29966,
3488,
29901,
524,
20690,
29886,
999,
3486,
1495,
13,
1753,
23363,
29918,
3488,
29918,
29886,
999,
3486,
29898,
29887,
23365,
29918,
333,
29892,
1813,
1125,
13,
1678,
2967,
353,
525,
29887,
23365,
29914,
8875,
4286,
4830,
29898,
29887,
23365,
29918,
333,
29897,
13,
1678,
977,
264,
1280,
353,
18920,
29918,
3051,
877,
29912,
6822,
1777,
264,
1280,
742,
2967,
467,
5451,
28909,
29876,
1495,
13,
1678,
6515,
353,
3474,
29898,
3488,
29892,
349,
25866,
2544,
3210,
29918,
14226,
29892,
977,
264,
1280,
29897,
13,
1678,
4818,
353,
349,
25866,
2544,
3210,
29918,
14226,
849,
29871,
29906,
13,
1678,
6515,
29889,
7323,
29898,
5064,
29897,
13,
1678,
363,
1813,
297,
6515,
29901,
13,
4706,
18920,
29918,
412,
1416,
877,
29912,
6822,
12292,
29914,
8875,
742,
2967,
29892,
1813,
29897,
13,
1678,
736,
11117,
4882,
2396,
29871,
29900,
29913,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
2804,
29871,
29906,
29901,
13,
4706,
1596,
877,
27573,
29901,
6571,
529,
16476,
3149,
29958,
4286,
4830,
29898,
9675,
29889,
19218,
29961,
29900,
12622,
13,
4706,
10876,
29889,
13322,
29898,
29896,
29897,
13,
1678,
1018,
29901,
13,
4706,
2011,
353,
938,
29898,
359,
29889,
657,
6272,
877,
15082,
1495,
470,
525,
29947,
29900,
29947,
29900,
1495,
13,
4706,
1065,
29898,
637,
29922,
637,
29897,
13,
1678,
5174,
3497,
17413,
2392,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29946,
29897,
13,
13,
29937,
14402,
29901,
13,
13,
29937,
6783,
29901,
13,
29937,
448,
518,
4514,
1207,
372,
6501,
13,
29937,
448,
518,
29990,
29962,
12141,
2919,
11798,
6358,
13,
13,
29937,
7649,
29901,
13,
29937,
448,
518,
29990,
29962,
2254,
28968,
29879,
408,
896,
6355,
964,
1776,
13,
29937,
448,
518,
29990,
29962,
758,
1359,
23363,
4558,
6198,
304,
278,
1857,
697,
13,
29937,
448,
518,
29990,
29962,
7868,
6611,
297,
23363,
6316,
556,
13,
2
] |
tests/test_box.py | mjclarke94/lammps-cython | 6 | 65172 | <gh_stars>1-10
from math import pi
import pytest
import numpy as np
import lammps
def test_lattice_const_to_lammps_box_cubic():
lengths = (5, 5, 5)
angles = (pi/2, pi/2, pi/2)
origin = (0, 0, 0)
a, b, c = lengths
xlo, ylo, zlo = origin
bounds, tilts, rotation_matrix = lammps.core.lattice_const_to_lammps_box(lengths, angles)
assert np.all(np.isclose(bounds, [[xlo, xlo+a], [ylo, ylo+b], [zlo, zlo+c]]))
assert np.all(np.isclose(tilts, (0, 0, 0)))
assert np.all(np.isclose(rotation_matrix, np.eye(3)))
def test_lattice_const_to_lammps_box_cubic_offset_origin():
lengths = (5, 5, 5)
angles = (pi/2, pi/2, pi/2)
origin = (4, 3, 2)
a, b, c = lengths
xlo, ylo, zlo = origin
bounds, tilts, rotation_matrix = lammps.core.lattice_const_to_lammps_box(lengths, angles, origin=origin)
assert np.all(np.isclose(bounds, [[xlo, xlo+a], [ylo, ylo+b], [zlo, zlo+c]]))
assert np.all(np.isclose(tilts, (0, 0, 0)))
assert np.all(np.isclose(rotation_matrix, np.eye(3)))
def test_lattice_to_lammps_box_cubic_transform():
lengths = (5, 5, 5)
angles = (pi/2, pi/2, pi/2)
origin = (4, 3, 2)
a, b, c = lengths
xlo, ylo, zlo = origin
bounds, tilts, rotation_matrix = lammps.core.lattice_const_to_lammps_box(lengths, angles, origin=origin)
assert np.all(np.isclose(bounds, [[xlo, xlo+a], [ylo, ylo+b], [zlo, zlo+c]]))
assert np.all(np.isclose(tilts, (0, 0, 0)))
assert np.all(np.isclose(rotation_matrix, np.eye(3)))
points = np.random.random((10, 3))
points_new_1 = lammps.core.transform_cartesian_vector_to_lammps_vector(points, rotation_matrix)
assert np.all(np.isclose(points, points_new_1))
points_new_2 = lammps.core.transform_cartesian_vector_to_lammps_vector(points, rotation_matrix, origin)
assert np.all(np.isclose(points + origin, points_new_2))
def test_lattice_const_to_lammps_box_rhomb():
# 3C-SiC
lengths = (3.0968, 3.0968, 3.0968)
angles = (pi/3, pi/3, pi/3)
bounds, tilts, rotation_matrix = lammps.core.lattice_const_to_lammps_box(lengths, angles)
assert np.all(np.isclose(bounds, ((0, 3.0968), (0, 2.6819074704396493), (0, 2.528526611816982)), atol=1e-3))
assert np.all(np.isclose(tilts, (1.5484000000000004, 1.5484000000000004, 0.8939691568132165)))
def test_lammps_box_to_lattice_const_cubic():
bounds = [[0, 5], [0, 5], [0, 5]]
tilts = (0, 0, 0)
origin = (0, 0, 0)
lengths, angles, origin = lammps.core.lammps_box_to_lattice_const(bounds, tilts)
assert np.all(np.isclose(lengths, (5, 5, 5)))
assert np.all(np.isclose(angles, (pi/2, pi/2, pi/2)))
def test_lammps_box_orthogonal_reversible():
lengths = (4, 4, 4)
angles = (pi/2, pi/2, pi/2)
origin = (1, 2, 3)
bounds, tilts, rotation_matrix = lammps.core.lattice_const_to_lammps_box(lengths, angles, origin=origin)
lengths_r, angles_r, origin_r = lammps.core.lammps_box_to_lattice_const(bounds, tilts)
assert np.all(np.isclose(lengths, lengths_r))
assert np.all(np.isclose(angles, angles_r))
assert np.all(np.isclose(origin, origin_r))
def test_lammps_box_tetrahedral_reversible():
# LiTaO3
lengths = (5.5338, 5.5338, 5.5338)
angles = (56.14486291 * pi/180, 56.14486291 * pi/180, 56.14486291 * pi/180)
origin = (1, 2, 3)
bounds, tilts, rotation_matrix = lammps.core.lattice_const_to_lammps_box(lengths, angles, origin=origin)
lengths_r, angles_r, origin_r = lammps.core.lammps_box_to_lattice_const(bounds, tilts)
assert np.all(np.isclose(lengths, lengths_r))
assert np.all(np.isclose(angles, angles_r))
assert np.all(np.isclose(origin, origin_r))
def test_lammps_initial_box(lmp):
assert lmp.box.dimension == 3
assert np.all(np.isclose(lmp.box.lengths, (1., 1., 1.)))
assert np.all(np.isclose(lmp.box.angles, (pi/2., pi/2., pi/2.)))
assert np.all(np.isclose(lmp.box.bounds, [[-0.5, 0.5], [-0.5, 0.5], [-0.5, 0.5]]))
assert np.all(np.isclose(lmp.box.tilts, [0, 0, 0]))
assert np.all(np.isclose(lmp.box.lengths_angles, [[1, 1, 1], [pi/2, pi/2, pi/2]]))
# lammps has some seriously weird initial behavior
# has unit cell 1x1x1 with volume 0 ???
# actually has non-deterministic behavior 0 or inf
# assert np.isclose(lmp.box.volume, 0.)
def test_lammps_set_box_from_lattice_const(lmp):
atom_types = 5
lengths = (10, 10, 10)
angles = (pi/2., pi/2., pi/2.)
lmp.box.from_lattice_const(atom_types, lengths, angles)
assert np.all(np.isclose(lmp.box.lengths, lengths))
assert np.all(np.isclose(lmp.box.angles, angles))
assert lmp.system.total == 0
assert len(lmp.system.atom_types) == atom_types
assert np.isclose(lmp.box.volume, 10**3)
def test_lammps_update_lattice_const(lmp):
lengths = (10, 10, 10)
angles = (pi/2., pi/2., pi/2.)
lmp.box.update_lattice_const(lengths, angles)
assert np.all(np.isclose(lmp.box.lengths, lengths))
assert np.all(np.isclose(lmp.box.angles, angles))
assert np.isclose(lmp.box.volume, 10**3)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
5844,
1053,
2930,
13,
13,
5215,
11451,
1688,
13,
5215,
12655,
408,
7442,
13,
13,
5215,
301,
4850,
567,
13,
13,
13,
1753,
1243,
29918,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29918,
29883,
431,
293,
7295,
13,
1678,
27497,
353,
313,
29945,
29892,
29871,
29945,
29892,
29871,
29945,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29906,
29892,
2930,
29914,
29906,
29892,
2930,
29914,
29906,
29897,
13,
1678,
3978,
353,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
263,
29892,
289,
29892,
274,
353,
27497,
13,
1678,
921,
417,
29892,
343,
417,
29892,
503,
417,
353,
3978,
13,
1678,
13451,
29892,
6928,
1372,
29892,
13733,
29918,
5344,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29898,
2848,
29879,
29892,
23619,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
23687,
29892,
5519,
29916,
417,
29892,
921,
417,
29974,
29874,
1402,
518,
29891,
417,
29892,
343,
417,
29974,
29890,
1402,
518,
29920,
417,
29892,
503,
417,
29974,
29883,
5262,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
1376,
1372,
29892,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
4961,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
5450,
362,
29918,
5344,
29892,
7442,
29889,
1032,
29872,
29898,
29941,
4961,
13,
13,
13,
1753,
1243,
29918,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29918,
29883,
431,
293,
29918,
10289,
29918,
12574,
7295,
13,
1678,
27497,
353,
313,
29945,
29892,
29871,
29945,
29892,
29871,
29945,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29906,
29892,
2930,
29914,
29906,
29892,
2930,
29914,
29906,
29897,
13,
1678,
3978,
353,
313,
29946,
29892,
29871,
29941,
29892,
29871,
29906,
29897,
13,
1678,
263,
29892,
289,
29892,
274,
353,
27497,
13,
1678,
921,
417,
29892,
343,
417,
29892,
503,
417,
353,
3978,
13,
1678,
13451,
29892,
6928,
1372,
29892,
13733,
29918,
5344,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29898,
2848,
29879,
29892,
23619,
29892,
3978,
29922,
12574,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
23687,
29892,
5519,
29916,
417,
29892,
921,
417,
29974,
29874,
1402,
518,
29891,
417,
29892,
343,
417,
29974,
29890,
1402,
518,
29920,
417,
29892,
503,
417,
29974,
29883,
5262,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
1376,
1372,
29892,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
4961,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
5450,
362,
29918,
5344,
29892,
7442,
29889,
1032,
29872,
29898,
29941,
4961,
13,
13,
13,
1753,
1243,
29918,
29880,
19704,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29918,
29883,
431,
293,
29918,
9067,
7295,
13,
1678,
27497,
353,
313,
29945,
29892,
29871,
29945,
29892,
29871,
29945,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29906,
29892,
2930,
29914,
29906,
29892,
2930,
29914,
29906,
29897,
13,
1678,
3978,
353,
313,
29946,
29892,
29871,
29941,
29892,
29871,
29906,
29897,
13,
1678,
263,
29892,
289,
29892,
274,
353,
27497,
13,
1678,
921,
417,
29892,
343,
417,
29892,
503,
417,
353,
3978,
13,
1678,
13451,
29892,
6928,
1372,
29892,
13733,
29918,
5344,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29898,
2848,
29879,
29892,
23619,
29892,
3978,
29922,
12574,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
23687,
29892,
5519,
29916,
417,
29892,
921,
417,
29974,
29874,
1402,
518,
29891,
417,
29892,
343,
417,
29974,
29890,
1402,
518,
29920,
417,
29892,
503,
417,
29974,
29883,
5262,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
1376,
1372,
29892,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
4961,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
5450,
362,
29918,
5344,
29892,
7442,
29889,
1032,
29872,
29898,
29941,
4961,
13,
13,
1678,
3291,
353,
7442,
29889,
8172,
29889,
8172,
3552,
29896,
29900,
29892,
29871,
29941,
876,
13,
1678,
3291,
29918,
1482,
29918,
29896,
353,
301,
4850,
567,
29889,
3221,
29889,
9067,
29918,
13823,
18970,
29918,
8111,
29918,
517,
29918,
29880,
4850,
567,
29918,
8111,
29898,
9748,
29892,
13733,
29918,
5344,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
9748,
29892,
3291,
29918,
1482,
29918,
29896,
876,
13,
1678,
3291,
29918,
1482,
29918,
29906,
353,
301,
4850,
567,
29889,
3221,
29889,
9067,
29918,
13823,
18970,
29918,
8111,
29918,
517,
29918,
29880,
4850,
567,
29918,
8111,
29898,
9748,
29892,
13733,
29918,
5344,
29892,
3978,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
9748,
718,
3978,
29892,
3291,
29918,
1482,
29918,
29906,
876,
13,
13,
13,
13,
13,
1753,
1243,
29918,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29918,
19046,
3424,
7295,
13,
1678,
396,
29871,
29941,
29907,
29899,
25598,
29907,
13,
1678,
27497,
353,
313,
29941,
29889,
29900,
29929,
29953,
29947,
29892,
29871,
29941,
29889,
29900,
29929,
29953,
29947,
29892,
29871,
29941,
29889,
29900,
29929,
29953,
29947,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29941,
29892,
2930,
29914,
29941,
29892,
2930,
29914,
29941,
29897,
13,
1678,
13451,
29892,
6928,
1372,
29892,
13733,
29918,
5344,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29898,
2848,
29879,
29892,
23619,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
23687,
29892,
5135,
29900,
29892,
29871,
29941,
29889,
29900,
29929,
29953,
29947,
511,
313,
29900,
29892,
29871,
29906,
29889,
29953,
29947,
29896,
29929,
29900,
29955,
29946,
29955,
29900,
29946,
29941,
29929,
29953,
29946,
29929,
29941,
511,
313,
29900,
29892,
29871,
29906,
29889,
29945,
29906,
29947,
29945,
29906,
29953,
29953,
29896,
29896,
29947,
29896,
29953,
29929,
29947,
29906,
8243,
472,
324,
29922,
29896,
29872,
29899,
29941,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
1376,
1372,
29892,
313,
29896,
29889,
29945,
29946,
29947,
29946,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29946,
29892,
29871,
29896,
29889,
29945,
29946,
29947,
29946,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29946,
29892,
29871,
29900,
29889,
29947,
29929,
29941,
29929,
29953,
29929,
29896,
29945,
29953,
29947,
29896,
29941,
29906,
29896,
29953,
29945,
4961,
13,
13,
13,
1753,
1243,
29918,
29880,
4850,
567,
29918,
1884,
29918,
517,
29918,
29880,
19704,
29918,
3075,
29918,
29883,
431,
293,
7295,
13,
1678,
13451,
353,
5519,
29900,
29892,
29871,
29945,
1402,
518,
29900,
29892,
29871,
29945,
1402,
518,
29900,
29892,
29871,
29945,
5262,
13,
1678,
6928,
1372,
353,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
3978,
353,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
27497,
29892,
23619,
29892,
3978,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
4850,
567,
29918,
1884,
29918,
517,
29918,
29880,
19704,
29918,
3075,
29898,
23687,
29892,
6928,
1372,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
2848,
29879,
29892,
313,
29945,
29892,
29871,
29945,
29892,
29871,
29945,
4961,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
19536,
29892,
313,
1631,
29914,
29906,
29892,
2930,
29914,
29906,
29892,
2930,
29914,
29906,
4961,
13,
13,
13,
1753,
1243,
29918,
29880,
4850,
567,
29918,
1884,
29918,
2072,
23419,
29918,
276,
874,
1821,
7295,
13,
1678,
27497,
353,
313,
29946,
29892,
29871,
29946,
29892,
29871,
29946,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29906,
29892,
2930,
29914,
29906,
29892,
2930,
29914,
29906,
29897,
13,
1678,
3978,
353,
313,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29897,
13,
1678,
13451,
29892,
6928,
1372,
29892,
13733,
29918,
5344,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29898,
2848,
29879,
29892,
23619,
29892,
3978,
29922,
12574,
29897,
13,
1678,
27497,
29918,
29878,
29892,
23619,
29918,
29878,
29892,
3978,
29918,
29878,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
4850,
567,
29918,
1884,
29918,
517,
29918,
29880,
19704,
29918,
3075,
29898,
23687,
29892,
6928,
1372,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
2848,
29879,
29892,
27497,
29918,
29878,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
19536,
29892,
23619,
29918,
29878,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
12574,
29892,
3978,
29918,
29878,
876,
13,
13,
13,
1753,
1243,
29918,
29880,
4850,
567,
29918,
1884,
29918,
29873,
27280,
17143,
1705,
29918,
276,
874,
1821,
7295,
13,
1678,
396,
2718,
29911,
29874,
29949,
29941,
13,
1678,
27497,
353,
313,
29945,
29889,
29945,
29941,
29941,
29947,
29892,
29871,
29945,
29889,
29945,
29941,
29941,
29947,
29892,
29871,
29945,
29889,
29945,
29941,
29941,
29947,
29897,
13,
1678,
23619,
353,
313,
29945,
29953,
29889,
29896,
29946,
29946,
29947,
29953,
29906,
29929,
29896,
334,
2930,
29914,
29896,
29947,
29900,
29892,
29871,
29945,
29953,
29889,
29896,
29946,
29946,
29947,
29953,
29906,
29929,
29896,
334,
2930,
29914,
29896,
29947,
29900,
29892,
29871,
29945,
29953,
29889,
29896,
29946,
29946,
29947,
29953,
29906,
29929,
29896,
334,
2930,
29914,
29896,
29947,
29900,
29897,
13,
1678,
3978,
353,
313,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29897,
13,
1678,
13451,
29892,
6928,
1372,
29892,
13733,
29918,
5344,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
19704,
29918,
3075,
29918,
517,
29918,
29880,
4850,
567,
29918,
1884,
29898,
2848,
29879,
29892,
23619,
29892,
3978,
29922,
12574,
29897,
13,
1678,
27497,
29918,
29878,
29892,
23619,
29918,
29878,
29892,
3978,
29918,
29878,
353,
301,
4850,
567,
29889,
3221,
29889,
29880,
4850,
567,
29918,
1884,
29918,
517,
29918,
29880,
19704,
29918,
3075,
29898,
23687,
29892,
6928,
1372,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
2848,
29879,
29892,
27497,
29918,
29878,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
19536,
29892,
23619,
29918,
29878,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
12574,
29892,
3978,
29918,
29878,
876,
13,
13,
13,
13,
1753,
1243,
29918,
29880,
4850,
567,
29918,
11228,
29918,
1884,
29898,
29880,
1526,
1125,
13,
1678,
4974,
301,
1526,
29889,
1884,
29889,
6229,
2673,
1275,
29871,
29941,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
2848,
29879,
29892,
313,
29896,
1696,
29871,
29896,
1696,
29871,
29896,
29889,
4961,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
19536,
29892,
313,
1631,
29914,
29906,
1696,
2930,
29914,
29906,
1696,
2930,
29914,
29906,
29889,
4961,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
23687,
29892,
5519,
29899,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
1402,
21069,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
1402,
21069,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
5262,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
1376,
1372,
29892,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
12622,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
2848,
29879,
29918,
19536,
29892,
5519,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
1402,
518,
1631,
29914,
29906,
29892,
2930,
29914,
29906,
29892,
2930,
29914,
29906,
5262,
876,
13,
1678,
396,
301,
4850,
567,
756,
777,
25798,
13543,
2847,
6030,
13,
1678,
396,
756,
5190,
3038,
29871,
29896,
29916,
29896,
29916,
29896,
411,
7977,
29871,
29900,
1577,
8773,
13,
1678,
396,
2869,
756,
1661,
29899,
4801,
837,
262,
4695,
6030,
29871,
29900,
470,
3041,
13,
1678,
396,
4974,
7442,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
24623,
29892,
29871,
29900,
1846,
13,
13,
13,
1753,
1243,
29918,
29880,
4850,
567,
29918,
842,
29918,
1884,
29918,
3166,
29918,
29880,
19704,
29918,
3075,
29898,
29880,
1526,
1125,
13,
1678,
12301,
29918,
8768,
353,
29871,
29945,
13,
1678,
27497,
353,
313,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29906,
1696,
2930,
29914,
29906,
1696,
2930,
29914,
29906,
1846,
13,
1678,
301,
1526,
29889,
1884,
29889,
3166,
29918,
29880,
19704,
29918,
3075,
29898,
8678,
29918,
8768,
29892,
27497,
29892,
23619,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
2848,
29879,
29892,
27497,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
19536,
29892,
23619,
876,
13,
1678,
4974,
301,
1526,
29889,
5205,
29889,
7827,
1275,
29871,
29900,
13,
1678,
4974,
7431,
29898,
29880,
1526,
29889,
5205,
29889,
8678,
29918,
8768,
29897,
1275,
12301,
29918,
8768,
13,
1678,
4974,
7442,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
24623,
29892,
29871,
29896,
29900,
1068,
29941,
29897,
13,
13,
13,
1753,
1243,
29918,
29880,
4850,
567,
29918,
5504,
29918,
29880,
19704,
29918,
3075,
29898,
29880,
1526,
1125,
13,
1678,
27497,
353,
313,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29897,
13,
1678,
23619,
353,
313,
1631,
29914,
29906,
1696,
2930,
29914,
29906,
1696,
2930,
29914,
29906,
1846,
13,
1678,
301,
1526,
29889,
1884,
29889,
5504,
29918,
29880,
19704,
29918,
3075,
29898,
2848,
29879,
29892,
23619,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
2848,
29879,
29892,
27497,
876,
13,
1678,
4974,
7442,
29889,
497,
29898,
9302,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
19536,
29892,
23619,
876,
13,
1678,
4974,
7442,
29889,
275,
5358,
29898,
29880,
1526,
29889,
1884,
29889,
24623,
29892,
29871,
29896,
29900,
1068,
29941,
29897,
13,
2
] |
hello-python/hello-world.py | florianbussmann/hello-world | 2 | 89340 | <filename>hello-python/hello-world.py<gh_stars>1-10
#!/usr/bin/python
print "Hello, World." | [
1,
529,
9507,
29958,
12199,
29899,
4691,
29914,
12199,
29899,
11526,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
2158,
376,
10994,
29892,
2787,
1213,
2
] |
wz.py | DrGFreeman/multi-dash | 0 | 101479 |
"""
An alternative to wsgi.py to run with the werkzeug server for local development.
Run with :
$ python wg.py
"""
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from flask_app import flask_app
from app1 import app as app1
from app2 import app as app2
application = DispatcherMiddleware(flask_app, {
'/app1': app1.server,
'/app2': app2.server,
})
run_simple('localhost', 8080, application, use_reloader=True) | [
1,
29871,
13,
15945,
29908,
13,
2744,
8671,
304,
16904,
3146,
29889,
2272,
304,
1065,
411,
278,
23085,
13289,
1923,
363,
1887,
5849,
29889,
13,
13,
6558,
411,
584,
13,
13,
29938,
3017,
281,
29887,
29889,
2272,
13,
13,
15945,
29908,
13,
13,
3166,
23085,
13289,
29889,
643,
1747,
1053,
1065,
29918,
12857,
13,
3166,
23085,
13289,
29889,
5652,
3146,
1053,
3295,
5041,
261,
25411,
2519,
13,
3166,
29784,
29918,
932,
1053,
29784,
29918,
932,
13,
13,
3166,
623,
29896,
1053,
623,
408,
623,
29896,
13,
3166,
623,
29906,
1053,
623,
408,
623,
29906,
13,
13,
6214,
353,
3295,
5041,
261,
25411,
2519,
29898,
1579,
1278,
29918,
932,
29892,
426,
13,
1678,
8207,
932,
29896,
2396,
623,
29896,
29889,
2974,
29892,
13,
1678,
8207,
932,
29906,
2396,
623,
29906,
29889,
2974,
29892,
13,
1800,
13,
3389,
29918,
12857,
877,
7640,
742,
29871,
29947,
29900,
29947,
29900,
29892,
2280,
29892,
671,
29918,
276,
12657,
29922,
5574,
29897,
2
] |
tests/test_auth_models.py | hydrobase/core_app | 0 | 175238 | <reponame>hydrobase/core_app
import unittest
from app import app
from app.auth.models import User
class TestAuthModels(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.user = User('admin')
def tearDown(self):
pass
def test_is_authenticated(self):
self.assertEquals(True, self.user.is_authenticated())
def test_is_active(self):
self.assertEquals(True, self.user.is_active())
def test_is_anonyous(self):
self.assertEquals(False, self.user.is_anonymous())
def test_get_id(self):
self.assertEquals('admin', self.user.get_id())
if __name__ == '__main__':
unittest.main()
| [
1,
529,
276,
1112,
420,
29958,
29882,
11279,
3188,
29914,
3221,
29918,
932,
13,
5215,
443,
27958,
13,
13,
3166,
623,
1053,
623,
13,
3166,
623,
29889,
5150,
29889,
9794,
1053,
4911,
13,
13,
1990,
4321,
6444,
23785,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
932,
353,
623,
29889,
1688,
29918,
4645,
580,
13,
4706,
1583,
29889,
1792,
353,
4911,
877,
6406,
1495,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
1243,
29918,
275,
29918,
27218,
630,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
5574,
29892,
1583,
29889,
1792,
29889,
275,
29918,
27218,
630,
3101,
13,
13,
1678,
822,
1243,
29918,
275,
29918,
4925,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
5574,
29892,
1583,
29889,
1792,
29889,
275,
29918,
4925,
3101,
13,
13,
1678,
822,
1243,
29918,
275,
29918,
273,
2592,
681,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
8824,
29892,
1583,
29889,
1792,
29889,
275,
29918,
25772,
3101,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
333,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
877,
6406,
742,
1583,
29889,
1792,
29889,
657,
29918,
333,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
12,
348,
27958,
29889,
3396,
580,
13,
2
] |
glinklater/watershed/watershed.py | RhodesCS2016/image-processing | 0 | 1603306 | <filename>glinklater/watershed/watershed.py<gh_stars>0
import numpy as np
import cv2 as cv
import sys
from matplotlib import pyplot as plt
def debug_display(image):
cv.imshow('Debug', image)
cv.waitKey(0)
cv.destroyAllWindows()
file = None
try:
print sys.argv[1]
file = sys.argv[1]
except:
print 'Please specify an input file'
sys.exit(1)
img = cv.imread(file)
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
ret, thresh = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV+cv.THRESH_OTSU)
debug_display(thresh)
kernel = np.ones((3, 3), np.uint8)
opening = cv.morphologyEx(thresh, cv.MORPH_OPEN, kernel, iterations=2)
sure_bg = cv.dilate(opening, kernel, iterations=3)
dist_transform = cv.distanceTransform(opening, cv.DIST_L2, 5)
ret, sure_fg = cv.threshold(dist_transform, 0.7*dist_transform.max(), 255, 0)
sure_fg = np.uint8(sure_fg)
unknown = cv.subtract(sure_bg, sure_fg)
debug_display(sure_bg)
debug_display(sure_fg)
debug_display(unknown)
ret, markers = cv.connectedComponents(sure_fg)
markers = markers + 1
markers[unknown==255] = 0
markers = cv.watershed(img, markers)
img[markers == -1] = [255, 0, 0]
debug_display(img)
| [
1,
529,
9507,
29958,
29887,
2324,
29880,
1008,
29914,
29893,
10412,
17143,
29914,
29893,
10412,
17143,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
408,
13850,
13,
5215,
10876,
13,
3166,
22889,
1053,
11451,
5317,
408,
14770,
13,
13,
1753,
4744,
29918,
4990,
29898,
3027,
1125,
13,
12,
11023,
29889,
326,
4294,
877,
11862,
742,
1967,
29897,
13,
12,
11023,
29889,
10685,
2558,
29898,
29900,
29897,
13,
12,
11023,
29889,
20524,
3596,
7685,
580,
13,
13,
1445,
353,
6213,
13,
2202,
29901,
13,
12,
2158,
10876,
29889,
19218,
29961,
29896,
29962,
13,
12,
1445,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
19499,
29901,
13,
12,
2158,
525,
12148,
6084,
385,
1881,
934,
29915,
13,
12,
9675,
29889,
13322,
29898,
29896,
29897,
13,
13,
2492,
353,
13850,
29889,
326,
949,
29898,
1445,
29897,
13,
21012,
353,
13850,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
29897,
13,
2267,
29892,
266,
3781,
353,
13850,
29889,
386,
12268,
29898,
21012,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
13850,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
29918,
1177,
29963,
29974,
11023,
29889,
4690,
1525,
7068,
29918,
2891,
14605,
29897,
13,
13,
8382,
29918,
4990,
29898,
386,
3781,
29897,
13,
13,
17460,
353,
7442,
29889,
2873,
3552,
29941,
29892,
29871,
29941,
511,
7442,
29889,
13470,
29947,
29897,
13,
3150,
292,
353,
13850,
29889,
29885,
5676,
3002,
1252,
29898,
386,
3781,
29892,
13850,
29889,
29924,
1955,
19689,
29918,
4590,
1430,
29892,
8466,
29892,
24372,
29922,
29906,
29897,
13,
13,
29879,
545,
29918,
16264,
353,
13850,
29889,
29881,
309,
403,
29898,
3150,
292,
29892,
8466,
29892,
24372,
29922,
29941,
29897,
13,
13,
5721,
29918,
9067,
353,
13850,
29889,
19244,
13372,
29898,
3150,
292,
29892,
13850,
29889,
4571,
1254,
29918,
29931,
29906,
29892,
29871,
29945,
29897,
13,
2267,
29892,
1854,
29918,
16434,
353,
13850,
29889,
386,
12268,
29898,
5721,
29918,
9067,
29892,
29871,
29900,
29889,
29955,
29930,
5721,
29918,
9067,
29889,
3317,
3285,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
29897,
13,
13,
29879,
545,
29918,
16434,
353,
7442,
29889,
13470,
29947,
29898,
29879,
545,
29918,
16434,
29897,
13,
26690,
353,
13850,
29889,
1491,
29873,
1461,
29898,
29879,
545,
29918,
16264,
29892,
1854,
29918,
16434,
29897,
13,
13,
8382,
29918,
4990,
29898,
29879,
545,
29918,
16264,
29897,
13,
8382,
29918,
4990,
29898,
29879,
545,
29918,
16434,
29897,
13,
8382,
29918,
4990,
29898,
26690,
29897,
13,
13,
2267,
29892,
29320,
353,
13850,
29889,
18045,
25503,
29898,
29879,
545,
29918,
16434,
29897,
13,
3502,
414,
353,
29320,
718,
29871,
29896,
13,
3502,
414,
29961,
26690,
1360,
29906,
29945,
29945,
29962,
353,
29871,
29900,
13,
3502,
414,
353,
13850,
29889,
29893,
10412,
17143,
29898,
2492,
29892,
29320,
29897,
13,
2492,
29961,
3502,
414,
1275,
448,
29896,
29962,
353,
518,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29962,
13,
13,
8382,
29918,
4990,
29898,
2492,
29897,
13,
2
] |
PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/pixel_transform.py | frederica07/Dragon_Programming_Process | 0 | 169653 | <reponame>frederica07/Dragon_Programming_Process
'''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_pixel_transform'
def _f( function ):
return _p.createFunction( function,_p.GL,'GL_EXT_pixel_transform',False)
_p.unpack_constants( """GL_PIXEL_TRANSFORM_2D_EXT 0x8330
GL_PIXEL_MAG_FILTER_EXT 0x8331
GL_PIXEL_MIN_FILTER_EXT 0x8332
GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
GL_CUBIC_EXT 0x8334
GL_AVERAGE_EXT 0x8335
GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338""", globals())
glget.addGLGetConstant( GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT, (1,) )
glget.addGLGetConstant( GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT, (1,) )
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLint)
def glPixelTransformParameteriEXT( target,pname,param ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLfloat)
def glPixelTransformParameterfEXT( target,pname,param ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLintArray)
def glPixelTransformParameterivEXT( target,pname,params ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLfloatArray)
def glPixelTransformParameterfvEXT( target,pname,params ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLintArray)
def glGetPixelTransformParameterivEXT( target,pname,params ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLfloatArray)
def glGetPixelTransformParameterfvEXT( target,pname,params ):pass
def glInitPixelTransformEXT():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( EXTENSION_NAME )
| [
1,
529,
276,
1112,
420,
29958,
10745,
672,
983,
29900,
29955,
29914,
23978,
265,
29918,
9283,
4056,
29918,
7032,
13,
12008,
6147,
468,
759,
630,
491,
679,
29918,
3820,
29918,
24299,
2471,
29892,
437,
451,
3863,
29991,
12008,
13,
3166,
29508,
1053,
7481,
408,
903,
29886,
29892,
17727,
408,
903,
2395,
29892,
7049,
13,
3166,
29508,
29889,
7239,
1053,
3144,
657,
13,
5215,
274,
8768,
13,
12194,
1430,
13381,
29918,
5813,
353,
525,
7239,
29918,
12194,
29918,
29886,
15711,
29918,
9067,
29915,
13,
1753,
903,
29888,
29898,
740,
29871,
1125,
13,
1678,
736,
903,
29886,
29889,
3258,
6678,
29898,
740,
29892,
29918,
29886,
29889,
7239,
5501,
7239,
29918,
12194,
29918,
29886,
15711,
29918,
9067,
742,
8824,
29897,
13,
29918,
29886,
29889,
348,
4058,
29918,
3075,
1934,
29898,
9995,
7239,
29918,
2227,
29990,
6670,
29918,
26813,
29903,
19094,
29918,
29906,
29928,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29900,
13,
7239,
29918,
2227,
29990,
6670,
29918,
1529,
29954,
29918,
3738,
29931,
4945,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29896,
13,
7239,
29918,
2227,
29990,
6670,
29918,
16173,
29918,
3738,
29931,
4945,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29906,
13,
7239,
29918,
2227,
29990,
6670,
29918,
29907,
7466,
2965,
29918,
8851,
22530,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29941,
13,
7239,
29918,
29907,
7466,
2965,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29946,
13,
7239,
29918,
29909,
5348,
10461,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29945,
13,
7239,
29918,
2227,
29990,
6670,
29918,
26813,
29903,
19094,
29918,
29906,
29928,
29918,
1254,
11375,
29918,
2287,
29925,
4690,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29953,
13,
7239,
29918,
12648,
29918,
2227,
29990,
6670,
29918,
26813,
29903,
19094,
29918,
29906,
29928,
29918,
1254,
11375,
29918,
2287,
29925,
4690,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29955,
13,
7239,
29918,
2227,
29990,
6670,
29918,
26813,
29903,
19094,
29918,
29906,
29928,
29918,
29924,
1299,
3960,
29990,
29918,
12194,
29871,
29900,
29916,
29947,
29941,
29941,
29947,
15945,
613,
13149,
1338,
3101,
13,
3820,
657,
29889,
1202,
7239,
2577,
12075,
424,
29898,
12729,
29918,
2227,
29990,
6670,
29918,
26813,
29903,
19094,
29918,
29906,
29928,
29918,
1254,
11375,
29918,
2287,
29925,
4690,
29918,
12194,
29892,
313,
29896,
29892,
29897,
1723,
13,
3820,
657,
29889,
1202,
7239,
2577,
12075,
424,
29898,
12729,
29918,
12648,
29918,
2227,
29990,
6670,
29918,
26813,
29903,
19094,
29918,
29906,
29928,
29918,
1254,
11375,
29918,
2287,
29925,
4690,
29918,
12194,
29892,
313,
29896,
29892,
29897,
1723,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
524,
29897,
13,
1753,
3144,
29637,
13372,
9329,
29875,
12194,
29898,
3646,
29892,
29886,
978,
29892,
3207,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
7411,
29897,
13,
1753,
3144,
29637,
13372,
9329,
29888,
12194,
29898,
3646,
29892,
29886,
978,
29892,
3207,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
524,
2588,
29897,
13,
1753,
3144,
29637,
13372,
9329,
440,
12194,
29898,
3646,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
7411,
2588,
29897,
13,
1753,
3144,
29637,
13372,
9329,
29888,
29894,
12194,
29898,
3646,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
524,
2588,
29897,
13,
1753,
3144,
2577,
29637,
13372,
9329,
440,
12194,
29898,
3646,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
7411,
2588,
29897,
13,
1753,
3144,
2577,
29637,
13372,
9329,
29888,
29894,
12194,
29898,
3646,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
13,
13,
1753,
3144,
6644,
29637,
13372,
12194,
7295,
13,
1678,
14550,
11609,
7223,
23941,
3692,
445,
6081,
338,
3625,
12008,
13,
1678,
515,
29508,
1053,
17752,
13,
1678,
736,
17752,
29889,
5349,
29954,
1307,
486,
2673,
29898,
8528,
29911,
1430,
13381,
29918,
5813,
1723,
13,
2
] |
tests/mem/test_magic_memset_tlb_miss.py | capt-hb/cheritest | 0 | 93174 | <filename>tests/mem/test_magic_memset_tlb_miss.py
#-
# Copyright (c) 2018 <NAME>
# All rights reserved.
#
# This software was developed by the University of Cambridge Computer
# Laboratory as part of the Rigorous Engineering of Mainstream Systems (REMS)
# project, funded by EPSRC grant EP/K008528/1.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. BERI licenses this
# file to you under the BERI Hardware-Software License, Version 1.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.beri-open-systems.org/legal/license-1-0.txt
#
# Unless required by applicable law or agreed to in writing, Work 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.
#
# @BERI_LICENSE_HEADER_END@
#
from beritest_tools import BaseBERITestCase, attr, HexInt
@attr("qemu_magic_nops")
class test_magic_memset_tlb_miss(BaseBERITestCase):
EXPECTED_EXCEPTIONS = 1
def test_badvaddr(self):
self.assertRegisterEqual(self.MIPS.s0, self.MIPS.a4, "Wrong BadVaddr")
def test_context(self):
self.assertRegisterEqual(self.MIPS.s1, (self.MIPS.a4 & 0xffffe000)>>9, "Wrong Context") # TODO test page table base
def test_xcontext(self):
self.assertRegisterEqual(self.MIPS.s2, (self.MIPS.a4 & 0xffffe000)>>9, "Wrong XContext") # TODO test page table base
def test_entryhi(self):
self.assertRegisterMaskEqual(self.MIPS.a4, 0xfffff000, self.MIPS.s3, "Wrong EntryHi")
def test_status(self):
self.assertRegisterMaskEqual(self.MIPS.s4, 2, 2, "Wrong EXL")
def test_epc(self):
'''Test EPC after TLB Invalid exception'''
# plus 12 since check_instruction_traps uses 3 instructions before invoking the actual insn
self.assertRegisterEqual(self.MIPS.a6 + 12, self.MIPS.s6, "Wrong EPC")
def test_testdata(self):
self.assertRegisterEqual(self.MIPS.a7, 0xfedcba9876543210, "Wrong testdata")
def test_trap_info(self):
self.assertCompressedTrapInfo(self.MIPS.s5, mips_cause=self.MIPS.Cause.TLB_Store, trap_count=1)
| [
1,
529,
9507,
29958,
21150,
29914,
6954,
29914,
1688,
29918,
11082,
293,
29918,
6954,
842,
29918,
15206,
29890,
29918,
9894,
29889,
2272,
13,
29937,
29899,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29947,
529,
5813,
29958,
13,
29937,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
910,
7047,
471,
8906,
491,
278,
3014,
310,
12585,
20972,
13,
29937,
16715,
7606,
408,
760,
310,
278,
390,
335,
20657,
22557,
310,
4241,
5461,
23985,
313,
1525,
4345,
29897,
13,
29937,
2060,
29892,
5220,
287,
491,
382,
7024,
10363,
16690,
16502,
29914,
29968,
29900,
29900,
29947,
29945,
29906,
29947,
29914,
29896,
29889,
13,
29937,
13,
29937,
732,
13635,
29902,
29918,
27888,
1430,
1660,
29918,
23252,
1001,
29918,
25826,
29992,
13,
29937,
13,
29937,
10413,
21144,
304,
350,
1001,
29902,
4673,
23985,
315,
29889,
29902,
29889,
29907,
29889,
313,
13635,
29902,
29897,
1090,
697,
470,
901,
17737,
3406,
13,
29937,
19405,
8571,
4110,
29889,
29871,
2823,
278,
6058,
12107,
934,
13235,
411,
445,
664,
363,
13,
29937,
5684,
2472,
11211,
3509,
1266,
27428,
29889,
29871,
350,
1001,
29902,
7794,
11259,
445,
13,
29937,
934,
304,
366,
1090,
278,
350,
1001,
29902,
10999,
2519,
29899,
6295,
14093,
19245,
29892,
10079,
29871,
29896,
29889,
29900,
313,
1552,
13,
29937,
376,
29931,
293,
1947,
1496,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
13,
29937,
19245,
29889,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
29901,
13,
29937,
13,
29937,
259,
1732,
597,
1636,
29889,
495,
29875,
29899,
3150,
29899,
5205,
29879,
29889,
990,
29914,
12018,
29914,
506,
1947,
29899,
29896,
29899,
29900,
29889,
3945,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
5244,
13235,
13,
29937,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
13,
29937,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
29871,
2823,
278,
19245,
363,
278,
13,
29937,
2702,
4086,
14765,
1076,
11239,
322,
27028,
1090,
278,
19245,
29889,
13,
29937,
13,
29937,
732,
13635,
29902,
29918,
27888,
1430,
1660,
29918,
23252,
1001,
29918,
11794,
29992,
13,
29937,
13,
13,
3166,
7655,
277,
342,
29918,
8504,
1053,
7399,
13635,
1806,
342,
8259,
29892,
12421,
29892,
379,
735,
2928,
13,
13,
29992,
5552,
703,
29939,
24425,
29918,
11082,
293,
29918,
29876,
3554,
1159,
13,
1990,
1243,
29918,
11082,
293,
29918,
6954,
842,
29918,
15206,
29890,
29918,
9894,
29898,
5160,
13635,
1806,
342,
8259,
1125,
13,
1678,
8528,
4162,
1783,
3352,
29918,
5746,
4741,
7982,
27946,
353,
29871,
29896,
13,
13,
1678,
822,
1243,
29918,
12313,
29894,
10030,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
15213,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29879,
29900,
29892,
1583,
29889,
29924,
5690,
29903,
29889,
29874,
29946,
29892,
376,
29956,
29373,
9178,
29963,
10030,
1159,
13,
13,
1678,
822,
1243,
29918,
4703,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
15213,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29879,
29896,
29892,
313,
1311,
29889,
29924,
5690,
29903,
29889,
29874,
29946,
669,
29871,
29900,
29916,
17156,
29872,
29900,
29900,
29900,
29897,
6778,
29929,
29892,
376,
29956,
29373,
15228,
1159,
396,
14402,
1243,
1813,
1591,
2967,
13,
13,
1678,
822,
1243,
29918,
29916,
4703,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
15213,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29879,
29906,
29892,
313,
1311,
29889,
29924,
5690,
29903,
29889,
29874,
29946,
669,
29871,
29900,
29916,
17156,
29872,
29900,
29900,
29900,
29897,
6778,
29929,
29892,
376,
29956,
29373,
1060,
2677,
1159,
396,
14402,
1243,
1813,
1591,
2967,
13,
13,
1678,
822,
1243,
29918,
8269,
2918,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
15213,
19832,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29874,
29946,
29892,
29871,
29900,
29916,
17156,
29888,
29900,
29900,
29900,
29892,
1583,
29889,
29924,
5690,
29903,
29889,
29879,
29941,
29892,
376,
29956,
29373,
28236,
18567,
1159,
13,
13,
1678,
822,
1243,
29918,
4882,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
15213,
19832,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29879,
29946,
29892,
29871,
29906,
29892,
29871,
29906,
29892,
376,
29956,
29373,
8528,
29931,
1159,
13,
13,
1678,
822,
1243,
29918,
1022,
29883,
29898,
1311,
1125,
13,
4706,
14550,
3057,
382,
9026,
1156,
323,
29931,
29933,
21403,
3682,
12008,
13,
4706,
396,
2298,
29871,
29896,
29906,
1951,
1423,
29918,
2611,
4080,
29918,
3018,
567,
3913,
29871,
29941,
11994,
1434,
2437,
17223,
278,
3935,
1663,
29876,
13,
4706,
1583,
29889,
9294,
15213,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29874,
29953,
718,
29871,
29896,
29906,
29892,
1583,
29889,
29924,
5690,
29903,
29889,
29879,
29953,
29892,
376,
29956,
29373,
382,
9026,
1159,
13,
13,
1678,
822,
1243,
29918,
1688,
1272,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
15213,
9843,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29874,
29955,
29892,
29871,
29900,
24660,
287,
29883,
2291,
29929,
29947,
29955,
29953,
29945,
29946,
29941,
29906,
29896,
29900,
29892,
376,
29956,
29373,
1243,
1272,
1159,
13,
13,
1678,
822,
1243,
29918,
29873,
2390,
29918,
3888,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
1523,
13120,
29911,
2390,
3401,
29898,
1311,
29889,
29924,
5690,
29903,
29889,
29879,
29945,
29892,
3737,
567,
29918,
29883,
1071,
29922,
1311,
29889,
29924,
5690,
29903,
29889,
29907,
1071,
29889,
14632,
29933,
29918,
9044,
29892,
26505,
29918,
2798,
29922,
29896,
29897,
13,
2
] |
handtracking/src/app/utils/CoordenateConverter.py | rafaeltoyo/unity-vr-server | 3 | 1613999 | <gh_stars>1-10
from copy import deepcopy
class CoordenateConverter:
"""
Cordenate Converter
"""
bones = [(0, 1, 2, 3, 4),
(0, 5, 6, 7, 8),
(0, 9, 10, 11, 12),
(0, 13, 14, 15, 16),
(0, 17, 18, 19, 20)]
def convert_to_relative(self, absolute_coordenates):
relative_coordenates = deepcopy(absolute_coordenates)
for hand_index in range(len(relative_coordenates)):
for finger_connections in self.bones:
for connection in finger_connections[1:]:
coord = absolute_coordenates[hand_index].landmark[connection]
if (connection - 1) % 4 == 0:
last_finger_coordenates = absolute_coordenates[hand_index].landmark[0]
else:
last_finger_coordenates = absolute_coordenates[hand_index].landmark[connection - 1]
coord_x = coord.x - last_finger_coordenates.x
coord_y = coord.y - last_finger_coordenates.y
coord_z = coord.z - last_finger_coordenates.z
if connection != 0:
relative_coordenates[hand_index].landmark[connection].x = coord_x
relative_coordenates[hand_index].landmark[connection].y = coord_y
relative_coordenates[hand_index].landmark[connection].z = coord_z
return relative_coordenates
def convert_to_absolute(self, relative_coordenates):
absolute_coordenates = deepcopy(relative_coordenates)
for hand_index in range(len(relative_coordenates)):
for finger_connections in self.bones:
last_finger_coordenates = deepcopy(relative_coordenates[hand_index].landmark[0])
last_finger_coordenates.x = 0
last_finger_coordenates.y = 0
last_finger_coordenates.z = 0
for connection in finger_connections:
coord = relative_coordenates[hand_index].landmark[connection]
coord_x = round(coord.x + last_finger_coordenates.x, 9)
coord_y = round(coord.y + last_finger_coordenates.y, 9)
coord_z = round(coord.z + last_finger_coordenates.z, 9)
if connection != 0:
absolute_coordenates[hand_index].landmark[connection].x = coord_x
absolute_coordenates[hand_index].landmark[connection].y = coord_y
absolute_coordenates[hand_index].landmark[connection].z = coord_z
last_finger_coordenates.x = coord_x
last_finger_coordenates.y = coord_y
last_finger_coordenates.z = coord_z
return absolute_coordenates
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
3509,
1053,
6483,
8552,
13,
13,
13,
1990,
3189,
10934,
403,
18545,
29901,
13,
1678,
9995,
13,
1678,
315,
10934,
403,
1281,
13549,
13,
1678,
9995,
13,
1678,
289,
2873,
353,
17288,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
511,
13,
13,
632,
313,
29900,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
511,
13,
13,
632,
313,
29900,
29892,
29871,
29929,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29906,
511,
13,
13,
632,
313,
29900,
29892,
29871,
29896,
29941,
29892,
29871,
29896,
29946,
29892,
29871,
29896,
29945,
29892,
29871,
29896,
29953,
511,
13,
13,
632,
313,
29900,
29892,
29871,
29896,
29955,
29892,
29871,
29896,
29947,
29892,
29871,
29896,
29929,
29892,
29871,
29906,
29900,
4638,
13,
13,
1678,
822,
3588,
29918,
517,
29918,
22925,
29898,
1311,
29892,
8380,
29918,
1111,
10934,
1078,
1125,
13,
4706,
6198,
29918,
1111,
10934,
1078,
353,
6483,
8552,
29898,
23552,
29918,
1111,
10934,
1078,
29897,
13,
13,
4706,
363,
1361,
29918,
2248,
297,
3464,
29898,
2435,
29898,
22925,
29918,
1111,
10934,
1078,
22164,
13,
9651,
363,
19917,
29918,
11958,
1953,
297,
1583,
29889,
29890,
2873,
29901,
13,
18884,
363,
3957,
297,
19917,
29918,
11958,
1953,
29961,
29896,
29901,
5387,
13,
462,
1678,
29311,
353,
8380,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
29962,
13,
13,
462,
1678,
565,
313,
9965,
448,
29871,
29896,
29897,
1273,
29871,
29946,
1275,
29871,
29900,
29901,
13,
462,
4706,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
353,
8380,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
29900,
29962,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
353,
8380,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
448,
29871,
29896,
29962,
13,
13,
462,
1678,
29311,
29918,
29916,
353,
29311,
29889,
29916,
448,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29916,
13,
462,
1678,
29311,
29918,
29891,
353,
29311,
29889,
29891,
448,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29891,
13,
462,
1678,
29311,
29918,
29920,
353,
29311,
29889,
29920,
448,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29920,
13,
13,
462,
1678,
565,
3957,
2804,
29871,
29900,
29901,
13,
462,
4706,
6198,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
1822,
29916,
353,
29311,
29918,
29916,
13,
462,
4706,
6198,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
1822,
29891,
353,
29311,
29918,
29891,
13,
462,
4706,
6198,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
1822,
29920,
353,
29311,
29918,
29920,
13,
13,
4706,
736,
6198,
29918,
1111,
10934,
1078,
13,
13,
1678,
822,
3588,
29918,
517,
29918,
23552,
29898,
1311,
29892,
6198,
29918,
1111,
10934,
1078,
1125,
13,
4706,
8380,
29918,
1111,
10934,
1078,
353,
6483,
8552,
29898,
22925,
29918,
1111,
10934,
1078,
29897,
13,
13,
4706,
363,
1361,
29918,
2248,
297,
3464,
29898,
2435,
29898,
22925,
29918,
1111,
10934,
1078,
22164,
13,
9651,
363,
19917,
29918,
11958,
1953,
297,
1583,
29889,
29890,
2873,
29901,
13,
18884,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
353,
6483,
8552,
29898,
22925,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
29900,
2314,
13,
18884,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29916,
353,
29871,
29900,
13,
18884,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29891,
353,
29871,
29900,
13,
18884,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29920,
353,
29871,
29900,
13,
13,
18884,
363,
3957,
297,
19917,
29918,
11958,
1953,
29901,
13,
462,
1678,
29311,
353,
6198,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
29962,
13,
13,
462,
1678,
29311,
29918,
29916,
353,
4513,
29898,
1111,
536,
29889,
29916,
718,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29916,
29892,
29871,
29929,
29897,
13,
462,
1678,
29311,
29918,
29891,
353,
4513,
29898,
1111,
536,
29889,
29891,
718,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29891,
29892,
29871,
29929,
29897,
13,
462,
1678,
29311,
29918,
29920,
353,
4513,
29898,
1111,
536,
29889,
29920,
718,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29920,
29892,
29871,
29929,
29897,
13,
13,
462,
1678,
565,
3957,
2804,
29871,
29900,
29901,
13,
462,
4706,
8380,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
1822,
29916,
353,
29311,
29918,
29916,
13,
462,
4706,
8380,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
1822,
29891,
353,
29311,
29918,
29891,
13,
462,
4706,
8380,
29918,
1111,
10934,
1078,
29961,
3179,
29918,
2248,
1822,
1049,
3502,
29961,
9965,
1822,
29920,
353,
29311,
29918,
29920,
13,
13,
462,
1678,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29916,
353,
29311,
29918,
29916,
13,
462,
1678,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29891,
353,
29311,
29918,
29891,
13,
462,
1678,
1833,
29918,
29888,
5621,
29918,
1111,
10934,
1078,
29889,
29920,
353,
29311,
29918,
29920,
13,
13,
4706,
736,
8380,
29918,
1111,
10934,
1078,
13,
2
] |
plugins/train/model/_base.py | oveis/DeepVideoFaceSwap | 5 | 1609927 | #!/usr/bin/env python3
""" Base class for Models. ALL Models should at least inherit from this class
When inheriting model_data should be a list of NNMeta objects.
See the class for details.
"""
import logging
import os
import sys
import time
from json import JSONDecodeError
from shutil import copyfile, copytree
import keras
from keras import losses
from keras import backend as K
from keras.models import load_model, Model
from keras.optimizers import Adam
from keras.utils import get_custom_objects, multi_gpu_model
from lib import Serializer
from lib.model.losses import DSSIMObjective, PenalizedLoss
from lib.model.nn_blocks import NNBlocks
from lib.multithreading import MultiThread
from lib.utils import get_folder
from plugins.train._config import Config
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
_CONFIG = None
class ModelBase():
""" Base class that all models should inherit from """
def __init__(self,
model_dir,
gpus,
no_logs=False,
warp_to_landmarks=False,
no_flip=False,
training_image_size=256,
alignments_paths=None,
preview_scale=100,
input_shape=None,
encoder_dim=None,
trainer="original",
pingpong=False,
memory_saving_gradients=False,
predict=False):
logger.debug("Initializing ModelBase (%s): (model_dir: '%s', gpus: %s, no_logs: %s"
"training_image_size, %s, alignments_paths: %s, preview_scale: %s, "
"input_shape: %s, encoder_dim: %s, trainer: %s, pingpong: %s, "
"memory_saving_gradients: %s, predict: %s)",
self.__class__.__name__, model_dir, gpus, no_logs, training_image_size,
alignments_paths, preview_scale, input_shape, encoder_dim, trainer,
pingpong, memory_saving_gradients, predict)
self.predict = predict
self.model_dir = model_dir
self.gpus = gpus
self.blocks = NNBlocks(use_subpixel=self.config["subpixel_upscaling"],
use_icnr_init=self.config["icnr_init"],
use_reflect_padding=self.config["reflect_padding"])
self.input_shape = input_shape
self.output_shape = None # set after model is compiled
self.encoder_dim = encoder_dim
self.trainer = trainer
self.state = State(self.model_dir,
self.name,
self.config_changeable_items,
no_logs,
pingpong,
training_image_size)
self.is_legacy = False
self.rename_legacy()
self.load_state_info()
self.networks = dict() # Networks for the model
self.predictors = dict() # Predictors for model
self.history = dict() # Loss history per save iteration)
# Training information specific to the model should be placed in this
# dict for reference by the trainer.
self.training_opts = {"alignments": alignments_paths,
"preview_scaling": preview_scale / 100,
"warp_to_landmarks": warp_to_landmarks,
"no_flip": no_flip,
"pingpong": pingpong}
self.set_gradient_type(memory_saving_gradients)
self.build()
self.set_training_data()
logger.debug("Initialized ModelBase (%s)", self.__class__.__name__)
@property
def config_section(self):
""" The section name for loading config """
retval = ".".join(self.__module__.split(".")[-2:])
logger.debug(retval)
return retval
@property
def config(self):
""" Return config dict for current plugin """
global _CONFIG # pylint: disable=global-statement
if not _CONFIG:
model_name = self.config_section
logger.debug("Loading config for: %s", model_name)
_CONFIG = Config(model_name).config_dict
return _CONFIG
@property
def config_changeable_items(self):
""" Return the dict of config items that can be updated after the model
has been created """
return Config(self.config_section).changeable_items
@property
def name(self):
""" Set the model name based on the subclass """
basename = os.path.basename(sys.modules[self.__module__].__file__)
retval = os.path.splitext(basename)[0].lower()
logger.debug("model name: '%s'", retval)
return retval
@property
def models_exist(self):
""" Return if all files exist and clear session """
retval = all([os.path.isfile(model.filename) for model in self.networks.values()])
logger.debug("Pre-existing models exist: %s", retval)
return retval
@staticmethod
def set_gradient_type(memory_saving_gradients):
""" Monkeypatch Memory Saving Gradients if requested """
if not memory_saving_gradients:
return
logger.info("Using Memory Saving Gradients")
from lib.model import memory_saving_gradients
K.__dict__["gradients"] = memory_saving_gradients.gradients_memory
def set_training_data(self):
""" Override to set model specific training data.
super() this method for defaults otherwise be sure to add """
logger.debug("Setting training data")
self.training_opts["training_size"] = self.state.training_size
self.training_opts["no_logs"] = self.state.current_session["no_logs"]
self.training_opts["mask_type"] = self.config.get("mask_type", None)
self.training_opts["coverage_ratio"] = self.calculate_coverage_ratio()
self.training_opts["preview_images"] = 14
logger.debug("Set training data: %s", self.training_opts)
def calculate_coverage_ratio(self):
""" Coverage must be a ratio, leading to a cropped shape divisible by 2 """
coverage_ratio = self.config.get("coverage", 62.5) / 100
logger.debug("Requested coverage_ratio: %s", coverage_ratio)
cropped_size = (self.state.training_size * coverage_ratio) // 2 * 2
coverage_ratio = cropped_size / self.state.training_size
logger.debug("Final coverage_ratio: %s", coverage_ratio)
return coverage_ratio
def build(self):
""" Build the model. Override for custom build methods """
self.add_networks()
self.load_models(swapped=False)
self.build_autoencoders()
self.log_summary()
self.compile_predictors(initialize=True)
def build_autoencoders(self):
""" Override for Model Specific autoencoder builds
NB! ENSURE YOU NAME YOUR INPUTS. At least the following input names
are expected:
face (the input for image)
mask (the input for mask if it is used)
"""
raise NotImplementedError
def add_networks(self):
""" Override to add neural networks """
raise NotImplementedError
def load_state_info(self):
""" Load the input shape from state file if it exists """
logger.debug("Loading Input Shape from State file")
if not self.state.inputs:
logger.debug("No input shapes saved. Using model config")
return
if not self.state.face_shapes:
logger.warning("Input shapes stored in State file, but no matches for 'face'."
"Using model config")
return
input_shape = self.state.face_shapes[0]
logger.debug("Setting input shape from state file: %s", input_shape)
self.input_shape = input_shape
def add_network(self, network_type, side, network):
""" Add a NNMeta object """
logger.debug("network_type: '%s', side: '%s', network: '%s'", network_type, side, network)
filename = "{}_{}".format(self.name, network_type.lower())
name = network_type.lower()
if side:
side = side.lower()
filename += "_{}".format(side.upper())
name += "_{}".format(side)
filename += ".h5"
logger.debug("name: '%s', filename: '%s'", name, filename)
self.networks[name] = NNMeta(str(self.model_dir / filename), network_type, side, network)
def add_predictor(self, side, model):
""" Add a predictor to the predictors dictionary """
logger.debug("Adding predictor: (side: '%s', model: %s)", side, model)
if self.gpus > 1:
logger.debug("Converting to multi-gpu: side %s", side)
model = multi_gpu_model(model, self.gpus)
self.predictors[side] = model
if not self.state.inputs:
self.store_input_shapes(model)
if not self.output_shape:
self.set_output_shape(model)
def store_input_shapes(self, model):
""" Store the input and output shapes to state """
logger.debug("Adding input shapes to state for model")
inputs = {tensor.name: K.int_shape(tensor)[-3:] for tensor in model.inputs}
if not any(inp for inp in inputs.keys() if inp.startswith("face")):
raise ValueError("No input named 'face' was found. Check your input naming. "
"Current input names: {}".format(inputs))
self.state.inputs = inputs
logger.debug("Added input shapes: %s", self.state.inputs)
def set_output_shape(self, model):
""" Set the output shape for use in training and convert """
logger.debug("Setting output shape")
out = [K.int_shape(tensor)[-3:] for tensor in model.outputs]
if not out:
raise ValueError("No outputs found! Check your model.")
self.output_shape = tuple(out[0])
logger.debug("Added output shape: %s", self.output_shape)
def reset_pingpong(self):
""" Reset the models for pingpong training """
logger.debug("Resetting models")
# Clear models and graph
self.predictors = dict()
self.adversarial_autoencoders = dict()
K.clear_session()
# Load Models for current training run
for model in self.networks.values():
model.network = Model.from_config(model.config)
model.network.set_weights(model.weights)
self.build_autoencoders()
self.compile_predictors(initialize=False)
logger.debug("Reset models")
def compile_predictors(self, initialize=True):
""" Compile the predictors """
logger.debug("Compiling Predictors")
learning_rate = self.config.get("learning_rate", 5e-5)
optimizer = self.get_optimizer(lr=learning_rate, beta_1=0.5, beta_2=0.999)
for side, model in self.predictors.items():
mask = [inp for inp in model.inputs if inp.name.startswith("mask")]
loss_names = ["loss"]
loss_funcs = [self.loss_function(mask, side, initialize)]
if mask:
loss_names.append("mask_loss")
loss_funcs.append(self.mask_loss_function(side, initialize))
model.compile(optimizer=optimizer, loss=loss_funcs)
if len(loss_names) > 1:
loss_names.insert(0, "total_loss")
if initialize:
self.state.add_session_loss_names(side, loss_names)
self.history[side] = list()
logger.debug("Compiled Predictors. Losses: %s", loss_names)
def get_optimizer(self, lr=5e-5, beta_1=0.5, beta_2=0.999): # pylint: disable=invalid-name
""" Build and return Optimizer """
opt_kwargs = dict(lr=lr, beta_1=beta_1, beta_2=beta_2)
if (self.config.get("clipnorm", False) and
keras.backend.backend() != "plaidml.keras.backend"):
# NB: Clipnorm is ballooning VRAM useage, which is not expected behaviour
# and may be a bug in Keras/TF.
# PlaidML has a bug regarding the clipnorm parameter
# See: https://github.com/plaidml/plaidml/issues/228
# Workaround by simply removing it.
# TODO: Remove this as soon it is fixed in PlaidML.
opt_kwargs["clipnorm"] = 1.0
logger.debug("Optimizer kwargs: %s", opt_kwargs)
return Adam(**opt_kwargs)
def loss_function(self, mask, side, initialize):
""" Set the loss function
Side is input so we only log once """
if self.config.get("dssim_loss", False):
if side == "a" and not self.predict and initialize:
logger.verbose("Using DSSIM Loss")
loss_func = DSSIMObjective()
else:
if side == "a" and not self.predict and initialize:
logger.verbose("Using Mean Absolute Error Loss")
loss_func = losses.mean_absolute_error
if mask and self.config.get("penalized_mask_loss", False):
loss_mask = mask[0]
if side == "a" and not self.predict and initialize:
logger.verbose("Penalizing mask for Loss")
loss_func = PenalizedLoss(loss_mask, loss_func)
return loss_func
def mask_loss_function(self, side, initialize):
""" Set the mask loss function
Side is input so we only log once """
if side == "a" and not self.predict and initialize:
logger.verbose("Using Mean Squared Error Loss for mask")
mask_loss_func = losses.mean_squared_error
return mask_loss_func
def converter(self, swap):
""" Converter for autoencoder models """
logger.debug("Getting Converter: (swap: %s)", swap)
if swap:
model = self.predictors["a"]
else:
model = self.predictors["b"]
if self.predict:
# Must compile the model to be thread safe
model._make_predict_function() # pylint: disable=protected-access
retval = model.predict
logger.debug("Got Converter: %s", retval)
return retval
@property
def iterations(self):
"Get current training iteration number"
return self.state.iterations
def map_models(self, swapped):
""" Map the models for A/B side for swapping """
logger.debug("Map models: (swapped: %s)", swapped)
models_map = {"a": dict(), "b": dict()}
sides = ("a", "b") if not swapped else ("b", "a")
for network in self.networks.values():
if network.side == sides[0]:
models_map["a"][network.type] = network.filename
if network.side == sides[1]:
models_map["b"][network.type] = network.filename
logger.debug("Mapped models: (models_map: %s)", models_map)
return models_map
def log_summary(self):
""" Verbose log the model summaries """
if self.predict:
return
for side in sorted(list(self.predictors.keys())):
logger.verbose("[%s %s Summary]:", self.name.title(), side.upper())
self.predictors[side].summary(print_fn=lambda x: logger.verbose("R|%s", x))
for name, nnmeta in self.networks.items():
if nnmeta.side is not None and nnmeta.side != side:
continue
logger.verbose("%s:", name.title())
nnmeta.network.summary(print_fn=lambda x: logger.verbose("R|%s", x))
def load_models(self, swapped):
""" Load models from file """
logger.debug("Load model: (swapped: %s)", swapped)
if not self.models_exist and not self.predict:
logger.info("Creating new '%s' model in folder: '%s'", self.name, self.model_dir)
return None
if not self.models_exist and self.predict:
logger.error("Model could not be found in folder '%s'. Exiting", self.model_dir)
exit(0)
if not self.is_legacy:
K.clear_session()
model_mapping = self.map_models(swapped)
for network in self.networks.values():
if not network.side:
is_loaded = network.load()
else:
is_loaded = network.load(fullpath=model_mapping[network.side][network.type])
if not is_loaded:
break
if is_loaded:
logger.info("Loaded model from disk: '%s'", self.model_dir)
return is_loaded
def save_models(self, snapshot_iteration):
""" Backup and save the models """
logger.debug("Backing up and saving models")
should_backup = self.get_save_averages()
save_threads = list()
for network in self.networks.values():
name = "save_{}".format(network.name)
save_threads.append(MultiThread(network.save,
name=name,
should_backup=should_backup))
save_threads.append(MultiThread(self.state.save,
name="save_state",
should_backup=should_backup))
for thread in save_threads:
thread.start()
for thread in save_threads:
if thread.has_error:
logger.error(thread.errors[0])
thread.join()
logger.info("saved models")
if snapshot_iteration:
self.snapshot_models()
def snapshot_models(self):
""" Take a snapshot of the model at current state and back up """
logger.info("Saving snapshot")
src = self.model_dir
dst = get_folder("{}_{}".format(self.model_dir, self.iterations))
for filename in os.listdir(src):
if filename.endswith(".bk"):
continue
srcfile = os.path.join(src, filename)
dstfile = os.path.join(dst, filename)
copyfunc = copytree if os.path.isdir(srcfile) else copyfile
logger.debug("Saving snapshot: '%s' > '%s'", srcfile, dstfile)
copyfunc(srcfile, dstfile)
logger.info("Saved snapshot")
def get_save_averages(self):
""" Return the loss averages since last save and reset historical losses
This protects against model corruption by only backing up the model
if any of the loss values have fallen.
TODO This is not a perfect system. If the model corrupts on save_iteration - 1
then model may still backup
"""
logger.debug("Getting Average loss since last save")
avgs = dict()
backup = True
for side, loss in self.history.items():
if not loss:
backup = False
break
avgs[side] = sum(loss) / len(loss)
self.history[side] = list() # Reset historical loss
if not self.state.lowest_avg_loss.get(side, None):
logger.debug("Setting initial save iteration loss average for '%s': %s",
side, avgs[side])
self.state.lowest_avg_loss[side] = avgs[side]
continue
if backup:
# Only run this if backup is true. All losses must have dropped for a valid backup
backup = self.check_loss_drop(side, avgs[side])
logger.debug("Lowest historical save iteration loss average: %s",
self.state.lowest_avg_loss)
logger.debug("Average loss since last save: %s", avgs)
if backup: # Update lowest loss values to the state
for side, avg_loss in avgs.items():
logger.debug("Updating lowest save iteration average for '%s': %s", side, avg_loss)
self.state.lowest_avg_loss[side] = avg_loss
logger.debug("Backing up: %s", backup)
return backup
def check_loss_drop(self, side, avg):
""" Check whether total loss has dropped since lowest loss """
if avg < self.state.lowest_avg_loss[side]:
logger.debug("Loss for '%s' has dropped", side)
return True
logger.debug("Loss for '%s' has not dropped", side)
return False
def rename_legacy(self):
""" Legacy Original, LowMem and IAE models had inconsistent naming conventions
Rename them if they are found and update """
legacy_mapping = {"iae": [("IAE_decoder.h5", "iae_decoder.h5"),
("IAE_encoder.h5", "iae_encoder.h5"),
("IAE_inter_A.h5", "iae_intermediate_A.h5"),
("IAE_inter_B.h5", "iae_intermediate_B.h5"),
("IAE_inter_both.h5", "iae_inter.h5")],
"original": [("encoder.h5", "original_encoder.h5"),
("decoder_A.h5", "original_decoder_A.h5"),
("decoder_B.h5", "original_decoder_B.h5"),
("lowmem_encoder.h5", "original_encoder.h5"),
("lowmem_decoder_A.h5", "original_decoder_A.h5"),
("lowmem_decoder_B.h5", "original_decoder_B.h5")]}
if self.name not in legacy_mapping.keys():
return
logger.debug("Renaming legacy files")
set_lowmem = False
updated = False
for old_name, new_name in legacy_mapping[self.name]:
old_path = os.path.join(str(self.model_dir), old_name)
new_path = os.path.join(str(self.model_dir), new_name)
if os.path.exists(old_path) and not os.path.exists(new_path):
logger.info("Updating legacy model name from: '%s' to '%s'", old_name, new_name)
os.rename(old_path, new_path)
if old_name.startswith("lowmem"):
set_lowmem = True
updated = True
if not updated:
logger.debug("No legacy files to rename")
return
self.is_legacy = True
logger.debug("Creating state file for legacy model")
self.state.inputs = {"face:0": [64, 64, 3]}
self.state.training_size = 256
self.state.config["coverage"] = 62.5
self.state.config["subpixel_upscaling"] = False
self.state.config["reflect_padding"] = False
self.state.config["mask_type"] = None
self.state.config["lowmem"] = False
self.encoder_dim = 1024
if set_lowmem:
logger.debug("Setting encoder_dim and lowmem flag for legacy lowmem model")
self.encoder_dim = 512
self.state.config["lowmem"] = True
self.state.replace_config(self.config_changeable_items)
self.state.save()
class NNMeta():
""" Class to hold a neural network and it's meta data
filename: The full path and filename of the model file for this network.
type: The type of network. For networks that can be swapped
The type should be identical for the corresponding
A and B networks, and should be unique for every A/B pair.
Otherwise the type should be completely unique.
side: A, B or None. Used to identify which networks can
be swapped.
network: Define network to this.
"""
def __init__(self, filename, network_type, side, network):
logger.debug("Initializing %s: (filename: '%s', network_type: '%s', side: '%s', "
"network: %s", self.__class__.__name__, filename, network_type,
side, network)
self.filename = filename
self.type = network_type.lower()
self.side = side
self.name = self.set_name()
self.network = network
self.network.name = self.name
self.config = network.get_config() # For pingpong restore
self.weights = network.get_weights() # For pingpong restore
logger.debug("Initialized %s", self.__class__.__name__)
def set_name(self):
""" Set the network name """
name = self.type
if self.side:
name += "_{}".format(self.side)
return name
def load(self, fullpath=None):
""" Load model """
fullpath = fullpath if fullpath else self.filename
logger.debug("Loading model: '%s'", fullpath)
try:
network = load_model(self.filename, custom_objects=get_custom_objects())
except ValueError as err:
if str(err).lower().startswith("cannot create group in read only mode"):
self.convert_legacy_weights()
return True
logger.warning("Failed loading existing training data. Generating new models")
logger.debug("Exception: %s", str(err))
return False
except OSError as err: # pylint: disable=broad-except
logger.warning("Failed loading existing training data. Generating new models")
logger.debug("Exception: %s", str(err))
return False
self.config = network.get_config()
self.network = network # Update network with saved model
self.network.name = self.type
return True
def save(self, fullpath=None, should_backup=False):
""" Save model """
fullpath = fullpath if fullpath else self.filename
if should_backup:
self.backup(fullpath=fullpath)
logger.debug("Saving model: '%s'", fullpath)
self.weights = self.network.get_weights()
self.network.save(fullpath)
def backup(self, fullpath=None):
""" Backup Model """
origfile = fullpath if fullpath else self.filename
backupfile = origfile + ".bk"
logger.debug("Backing up: '%s' to '%s'", origfile, backupfile)
if os.path.exists(backupfile):
os.remove(backupfile)
if os.path.exists(origfile):
os.rename(origfile, backupfile)
def convert_legacy_weights(self):
""" Convert legacy weights files to hold the model topology """
logger.info("Adding model topology to legacy weights file: '%s'", self.filename)
self.network.load_weights(self.filename)
self.save(should_backup=False)
self.network.name = self.type
class State():
""" Class to hold the model's current state and autoencoder structure """
def __init__(self, model_dir, model_name, config_changeable_items,
no_logs, pingpong, training_image_size):
logger.debug("Initializing %s: (model_dir: '%s', model_name: '%s', "
"config_changeable_items: '%s', no_logs: %s, pingpong: %s, "
"training_image_size: '%s'", self.__class__.__name__, model_dir, model_name,
config_changeable_items, no_logs, pingpong, training_image_size)
self.serializer = Serializer.get_serializer("json")
filename = "{}_state.{}".format(model_name, self.serializer.ext)
self.filename = str(model_dir / filename)
self.name = model_name
self.iterations = 0
self.session_iterations = 0
self.training_size = training_image_size
self.sessions = dict()
self.lowest_avg_loss = dict()
self.inputs = dict()
self.config = dict()
self.load(config_changeable_items)
self.session_id = self.new_session_id()
self.create_new_session(no_logs, pingpong)
logger.debug("Initialized %s:", self.__class__.__name__)
@property
def face_shapes(self):
""" Return a list of stored face shape inputs """
return [tuple(val) for key, val in self.inputs.items() if key.startswith("face")]
@property
def mask_shapes(self):
""" Return a list of stored mask shape inputs """
return [tuple(val) for key, val in self.inputs.items() if key.startswith("mask")]
@property
def loss_names(self):
""" Return the loss names for this session """
return self.sessions[self.session_id]["loss_names"]
@property
def current_session(self):
""" Return the current session dict """
return self.sessions[self.session_id]
def new_session_id(self):
""" Return new session_id """
if not self.sessions:
session_id = 1
else:
session_id = max(int(key) for key in self.sessions.keys()) + 1
logger.debug(session_id)
return session_id
def create_new_session(self, no_logs, pingpong):
""" Create a new session """
logger.debug("Creating new session. id: %s", self.session_id)
self.sessions[self.session_id] = {"timestamp": time.time(),
"no_logs": no_logs,
"pingpong": pingpong,
"loss_names": dict(),
"batchsize": 0,
"iterations": 0}
def add_session_loss_names(self, side, loss_names):
""" Add the session loss names to the sessions dictionary """
logger.debug("Adding session loss_names. (side: '%s', loss_names: %s", side, loss_names)
self.sessions[self.session_id]["loss_names"][side] = loss_names
def add_session_batchsize(self, batchsize):
""" Add the session batchsize to the sessions dictionary """
logger.debug("Adding session batchsize: %s", batchsize)
self.sessions[self.session_id]["batchsize"] = batchsize
def increment_iterations(self):
""" Increment total and session iterations """
self.iterations += 1
self.sessions[self.session_id]["iterations"] += 1
def load(self, config_changeable_items):
""" Load state file """
logger.debug("Loading State")
try:
with open(self.filename, "rb") as inp:
state = self.serializer.unmarshal(inp.read().decode("utf-8"))
self.name = state.get("name", self.name)
self.sessions = state.get("sessions", dict())
self.lowest_avg_loss = state.get("lowest_avg_loss", dict())
self.iterations = state.get("iterations", 0)
self.training_size = state.get("training_size", 256)
self.inputs = state.get("inputs", dict())
self.config = state.get("config", dict())
logger.debug("Loaded state: %s", state)
self.replace_config(config_changeable_items)
except IOError as err:
logger.warning("No existing state file found. Generating.")
logger.debug("IOError: %s", str(err))
except JSONDecodeError as err:
logger.debug("JSONDecodeError: %s:", str(err))
def save(self, should_backup=False):
""" Save iteration number to state file """
logger.debug("Saving State")
if should_backup:
self.backup()
try:
with open(self.filename, "wb") as out:
state = {"name": self.name,
"sessions": self.sessions,
"lowest_avg_loss": self.lowest_avg_loss,
"iterations": self.iterations,
"inputs": self.inputs,
"training_size": self.training_size,
"config": _CONFIG}
state_json = self.serializer.marshal(state)
out.write(state_json.encode("utf-8"))
except IOError as err:
logger.error("Unable to save model state: %s", str(err.strerror))
logger.debug("Saved State")
def backup(self):
""" Backup state file """
origfile = self.filename
backupfile = origfile + ".bk"
logger.debug("Backing up: '%s' to '%s'", origfile, backupfile)
if os.path.exists(backupfile):
os.remove(backupfile)
if os.path.exists(origfile):
os.rename(origfile, backupfile)
def replace_config(self, config_changeable_items):
""" Replace the loaded config with the one contained within the state file
Check for any fixed=False parameters changes and log info changes
"""
global _CONFIG # pylint: disable=global-statement
# Add any new items to state config for legacy purposes
for key, val in _CONFIG.items():
if key not in self.config.keys():
logger.info("Adding new config item to state file: '%s': '%s'", key, val)
self.config[key] = val
self.update_changed_config_items(config_changeable_items)
logger.debug("Replacing config. Old config: %s", _CONFIG)
_CONFIG = self.config
logger.debug("Replaced config. New config: %s", _CONFIG)
logger.info("Using configuration saved in state file")
def update_changed_config_items(self, config_changeable_items):
""" Update any parameters which are not fixed and have been changed """
if not config_changeable_items:
logger.debug("No changeable parameters have been updated")
return
for key, val in config_changeable_items.items():
old_val = self.config[key]
if old_val == val:
continue
self.config[key] = val
logger.info("Config item: '%s' has been updated from '%s' to '%s'", key, old_val, val)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
15945,
29908,
7399,
770,
363,
3382,
1379,
29889,
15149,
3382,
1379,
881,
472,
3203,
13125,
515,
445,
770,
13,
13,
1678,
1932,
7846,
11407,
1904,
29918,
1272,
881,
367,
263,
1051,
310,
405,
29940,
19346,
3618,
29889,
13,
1678,
2823,
278,
770,
363,
4902,
29889,
13,
15945,
29908,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
931,
13,
13,
3166,
4390,
1053,
4663,
2772,
401,
2392,
13,
3166,
528,
4422,
1053,
3509,
1445,
29892,
3509,
8336,
13,
13,
5215,
13023,
294,
13,
3166,
13023,
294,
1053,
28495,
13,
3166,
13023,
294,
1053,
14998,
408,
476,
13,
3166,
13023,
294,
29889,
9794,
1053,
2254,
29918,
4299,
29892,
8125,
13,
3166,
13023,
294,
29889,
20640,
19427,
1053,
11783,
13,
3166,
13023,
294,
29889,
13239,
1053,
679,
29918,
6341,
29918,
12650,
29892,
2473,
29918,
29887,
3746,
29918,
4299,
13,
13,
3166,
4303,
1053,
18896,
3950,
13,
3166,
4303,
29889,
4299,
29889,
6758,
267,
1053,
360,
1799,
7833,
2061,
573,
29892,
7363,
284,
1891,
29931,
2209,
13,
3166,
4303,
29889,
4299,
29889,
15755,
29918,
1271,
29879,
1053,
405,
29940,
7445,
29879,
13,
3166,
4303,
29889,
4713,
389,
19715,
1053,
14974,
4899,
13,
3166,
4303,
29889,
13239,
1053,
679,
29918,
12083,
13,
3166,
18224,
29889,
14968,
3032,
2917,
1053,
12782,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
978,
13,
29918,
25903,
353,
6213,
13,
13,
13,
1990,
8125,
5160,
7295,
13,
1678,
9995,
7399,
770,
393,
599,
4733,
881,
13125,
515,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1904,
29918,
3972,
29892,
13,
462,
330,
13364,
29892,
13,
462,
694,
29918,
20756,
29922,
8824,
29892,
13,
462,
1370,
29886,
29918,
517,
29918,
1049,
22848,
29922,
8824,
29892,
13,
462,
694,
29918,
29888,
3466,
29922,
8824,
29892,
13,
462,
6694,
29918,
3027,
29918,
2311,
29922,
29906,
29945,
29953,
29892,
13,
462,
7595,
1860,
29918,
24772,
29922,
8516,
29892,
13,
462,
25267,
29918,
7052,
29922,
29896,
29900,
29900,
29892,
13,
462,
1881,
29918,
12181,
29922,
8516,
29892,
13,
462,
2094,
6119,
29918,
6229,
29922,
8516,
29892,
13,
462,
1020,
4983,
543,
13492,
613,
13,
462,
24543,
29886,
549,
29922,
8824,
29892,
13,
462,
3370,
29918,
29879,
5555,
29918,
5105,
10070,
29922,
8824,
29892,
13,
462,
8500,
29922,
8824,
1125,
13,
4706,
17927,
29889,
8382,
703,
15514,
5281,
8125,
5160,
313,
29995,
29879,
1125,
313,
4299,
29918,
3972,
29901,
14210,
29879,
742,
330,
13364,
29901,
1273,
29879,
29892,
694,
29918,
20756,
29901,
1273,
29879,
29908,
13,
462,
268,
376,
26495,
29918,
3027,
29918,
2311,
29892,
1273,
29879,
29892,
7595,
1860,
29918,
24772,
29901,
1273,
29879,
29892,
25267,
29918,
7052,
29901,
1273,
29879,
29892,
376,
13,
462,
268,
376,
2080,
29918,
12181,
29901,
1273,
29879,
29892,
2094,
6119,
29918,
6229,
29901,
1273,
29879,
29892,
1020,
4983,
29901,
1273,
29879,
29892,
24543,
29886,
549,
29901,
1273,
29879,
29892,
376,
13,
462,
268,
376,
14834,
29918,
29879,
5555,
29918,
5105,
10070,
29901,
1273,
29879,
29892,
8500,
29901,
1273,
29879,
19123,
13,
462,
268,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29892,
1904,
29918,
3972,
29892,
330,
13364,
29892,
694,
29918,
20756,
29892,
6694,
29918,
3027,
29918,
2311,
29892,
13,
462,
268,
7595,
1860,
29918,
24772,
29892,
25267,
29918,
7052,
29892,
1881,
29918,
12181,
29892,
2094,
6119,
29918,
6229,
29892,
1020,
4983,
29892,
13,
462,
268,
24543,
29886,
549,
29892,
3370,
29918,
29879,
5555,
29918,
5105,
10070,
29892,
8500,
29897,
13,
13,
4706,
1583,
29889,
27711,
353,
8500,
13,
4706,
1583,
29889,
4299,
29918,
3972,
353,
1904,
29918,
3972,
13,
4706,
1583,
29889,
29887,
13364,
353,
330,
13364,
13,
4706,
1583,
29889,
1271,
29879,
353,
405,
29940,
7445,
29879,
29898,
1509,
29918,
1491,
29886,
15711,
29922,
1311,
29889,
2917,
3366,
1491,
29886,
15711,
29918,
14340,
1052,
292,
12436,
13,
462,
1669,
671,
29918,
293,
22230,
29918,
2344,
29922,
1311,
29889,
2917,
3366,
293,
22230,
29918,
2344,
12436,
13,
462,
1669,
671,
29918,
13191,
29918,
12791,
29922,
1311,
29889,
2917,
3366,
13191,
29918,
12791,
20068,
13,
4706,
1583,
29889,
2080,
29918,
12181,
353,
1881,
29918,
12181,
13,
4706,
1583,
29889,
4905,
29918,
12181,
353,
6213,
29871,
396,
731,
1156,
1904,
338,
13126,
13,
4706,
1583,
29889,
3977,
6119,
29918,
6229,
353,
2094,
6119,
29918,
6229,
13,
4706,
1583,
29889,
3018,
4983,
353,
1020,
4983,
13,
13,
4706,
1583,
29889,
3859,
353,
4306,
29898,
1311,
29889,
4299,
29918,
3972,
29892,
13,
462,
965,
1583,
29889,
978,
29892,
13,
462,
965,
1583,
29889,
2917,
29918,
3167,
519,
29918,
7076,
29892,
13,
462,
965,
694,
29918,
20756,
29892,
13,
462,
965,
24543,
29886,
549,
29892,
13,
462,
965,
6694,
29918,
3027,
29918,
2311,
29897,
13,
4706,
1583,
29889,
275,
29918,
1397,
4135,
353,
7700,
13,
4706,
1583,
29889,
1267,
420,
29918,
1397,
4135,
580,
13,
4706,
1583,
29889,
1359,
29918,
3859,
29918,
3888,
580,
13,
13,
4706,
1583,
29889,
11618,
29879,
353,
9657,
580,
29871,
396,
8527,
29879,
363,
278,
1904,
13,
4706,
1583,
29889,
27711,
943,
353,
9657,
580,
29871,
396,
21099,
919,
943,
363,
1904,
13,
13,
4706,
1583,
29889,
18434,
353,
9657,
580,
29871,
396,
365,
2209,
4955,
639,
4078,
12541,
29897,
13,
13,
4706,
396,
26101,
2472,
2702,
304,
278,
1904,
881,
367,
7180,
297,
445,
13,
4706,
396,
9657,
363,
3407,
491,
278,
1020,
4983,
29889,
13,
4706,
1583,
29889,
26495,
29918,
25707,
353,
8853,
2520,
1860,
1115,
7595,
1860,
29918,
24772,
29892,
13,
462,
795,
376,
25347,
29918,
19529,
292,
1115,
25267,
29918,
7052,
847,
29871,
29896,
29900,
29900,
29892,
13,
462,
795,
376,
4495,
29886,
29918,
517,
29918,
1049,
22848,
1115,
1370,
29886,
29918,
517,
29918,
1049,
22848,
29892,
13,
462,
795,
376,
1217,
29918,
29888,
3466,
1115,
694,
29918,
29888,
3466,
29892,
13,
462,
795,
376,
15702,
29886,
549,
1115,
24543,
29886,
549,
29913,
13,
13,
4706,
1583,
29889,
842,
29918,
24970,
29918,
1853,
29898,
14834,
29918,
29879,
5555,
29918,
5105,
10070,
29897,
13,
4706,
1583,
29889,
4282,
580,
13,
4706,
1583,
29889,
842,
29918,
26495,
29918,
1272,
580,
13,
4706,
17927,
29889,
8382,
703,
15514,
1891,
8125,
5160,
313,
29995,
29879,
19123,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29897,
13,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2295,
29918,
2042,
29898,
1311,
1125,
13,
4706,
9995,
450,
4004,
1024,
363,
8363,
2295,
9995,
13,
4706,
3240,
791,
353,
376,
1213,
29889,
7122,
29898,
1311,
17255,
5453,
26914,
5451,
17350,
1159,
14352,
29906,
29901,
2314,
13,
4706,
17927,
29889,
8382,
29898,
2267,
791,
29897,
13,
4706,
736,
3240,
791,
13,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2295,
29898,
1311,
1125,
13,
4706,
9995,
7106,
2295,
9657,
363,
1857,
7079,
9995,
13,
4706,
5534,
903,
25903,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
10945,
29899,
20788,
13,
4706,
565,
451,
903,
25903,
29901,
13,
9651,
1904,
29918,
978,
353,
1583,
29889,
2917,
29918,
2042,
13,
9651,
17927,
29889,
8382,
703,
23456,
2295,
363,
29901,
1273,
29879,
613,
1904,
29918,
978,
29897,
13,
9651,
903,
25903,
353,
12782,
29898,
4299,
29918,
978,
467,
2917,
29918,
8977,
13,
4706,
736,
903,
25903,
13,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2295,
29918,
3167,
519,
29918,
7076,
29898,
1311,
1125,
13,
4706,
9995,
7106,
278,
9657,
310,
2295,
4452,
393,
508,
367,
4784,
1156,
278,
1904,
13,
9651,
756,
1063,
2825,
9995,
13,
4706,
736,
12782,
29898,
1311,
29889,
2917,
29918,
2042,
467,
3167,
519,
29918,
7076,
13,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1024,
29898,
1311,
1125,
13,
4706,
9995,
3789,
278,
1904,
1024,
2729,
373,
278,
19481,
9995,
13,
4706,
2362,
3871,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
9675,
29889,
7576,
29961,
1311,
17255,
5453,
1649,
1822,
1649,
1445,
1649,
29897,
13,
4706,
3240,
791,
353,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
6500,
3871,
9601,
29900,
1822,
13609,
580,
13,
4706,
17927,
29889,
8382,
703,
4299,
1024,
29901,
14210,
29879,
29915,
613,
3240,
791,
29897,
13,
4706,
736,
3240,
791,
13,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4733,
29918,
28997,
29898,
1311,
1125,
13,
4706,
9995,
7106,
565,
599,
2066,
1863,
322,
2821,
4867,
9995,
13,
4706,
3240,
791,
353,
599,
4197,
359,
29889,
2084,
29889,
275,
1445,
29898,
4299,
29889,
9507,
29897,
363,
1904,
297,
1583,
29889,
11618,
29879,
29889,
5975,
580,
2314,
13,
4706,
17927,
29889,
8382,
703,
6572,
29899,
735,
15423,
4733,
1863,
29901,
1273,
29879,
613,
3240,
791,
29897,
13,
4706,
736,
3240,
791,
13,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
731,
29918,
24970,
29918,
1853,
29898,
14834,
29918,
29879,
5555,
29918,
5105,
10070,
1125,
13,
4706,
9995,
2598,
446,
1478,
905,
18914,
317,
5555,
19295,
10070,
565,
13877,
9995,
13,
4706,
565,
451,
3370,
29918,
29879,
5555,
29918,
5105,
10070,
29901,
13,
9651,
736,
13,
4706,
17927,
29889,
3888,
703,
15156,
18914,
317,
5555,
19295,
10070,
1159,
13,
4706,
515,
4303,
29889,
4299,
1053,
3370,
29918,
29879,
5555,
29918,
5105,
10070,
13,
4706,
476,
17255,
8977,
1649,
3366,
5105,
10070,
3108,
353,
3370,
29918,
29879,
5555,
29918,
5105,
10070,
29889,
5105,
10070,
29918,
14834,
13,
13,
13,
1678,
822,
731,
29918,
26495,
29918,
1272,
29898,
1311,
1125,
13,
4706,
9995,
6811,
2426,
304,
731,
1904,
2702,
6694,
848,
29889,
13,
13,
9651,
2428,
580,
445,
1158,
363,
21274,
6467,
367,
1854,
304,
788,
9995,
13,
4706,
17927,
29889,
8382,
703,
29020,
6694,
848,
1159,
13,
4706,
1583,
29889,
26495,
29918,
25707,
3366,
26495,
29918,
2311,
3108,
353,
1583,
29889,
3859,
29889,
26495,
29918,
2311,
13,
4706,
1583,
29889,
26495,
29918,
25707,
3366,
1217,
29918,
20756,
3108,
353,
1583,
29889,
3859,
29889,
3784,
29918,
7924,
3366,
1217,
29918,
20756,
3108,
13,
4706,
1583,
29889,
26495,
29918,
25707,
3366,
13168,
29918,
1853,
3108,
353,
1583,
29889,
2917,
29889,
657,
703,
13168,
29918,
1853,
613,
6213,
29897,
13,
4706,
1583,
29889,
26495,
29918,
25707,
3366,
11911,
482,
29918,
3605,
601,
3108,
353,
1583,
29889,
15807,
403,
29918,
11911,
482,
29918,
3605,
601,
580,
13,
4706,
1583,
29889,
26495,
29918,
25707,
3366,
25347,
29918,
8346,
3108,
353,
29871,
29896,
29946,
13,
4706,
17927,
29889,
8382,
703,
2697,
6694,
848,
29901,
1273,
29879,
613,
1583,
29889,
26495,
29918,
25707,
29897,
13,
13,
13,
1678,
822,
8147,
29918,
11911,
482,
29918,
3605,
601,
29898,
1311,
1125,
13,
4706,
9995,
26428,
482,
1818,
367,
263,
11959,
29892,
8236,
304,
263,
8182,
2986,
8267,
8572,
1821,
491,
29871,
29906,
9995,
13,
4706,
23746,
29918,
3605,
601,
353,
1583,
29889,
2917,
29889,
657,
703,
11911,
482,
613,
29871,
29953,
29906,
29889,
29945,
29897,
847,
29871,
29896,
29900,
29900,
13,
4706,
17927,
29889,
8382,
703,
3089,
287,
23746,
29918,
3605,
601,
29901,
1273,
29879,
613,
23746,
29918,
3605,
601,
29897,
13,
4706,
8182,
2986,
29918,
2311,
353,
313,
1311,
29889,
3859,
29889,
26495,
29918,
2311,
334,
23746,
29918,
3605,
601,
29897,
849,
29871,
29906,
334,
29871,
29906,
13,
4706,
23746,
29918,
3605,
601,
353,
8182,
2986,
29918,
2311,
847,
1583,
29889,
3859,
29889,
26495,
29918,
2311,
13,
4706,
17927,
29889,
8382,
703,
15790,
23746,
29918,
3605,
601,
29901,
1273,
29879,
613,
23746,
29918,
3605,
601,
29897,
13,
4706,
736,
23746,
29918,
3605,
601,
13,
13,
13,
1678,
822,
2048,
29898,
1311,
1125,
13,
4706,
9995,
8878,
278,
1904,
29889,
6811,
2426,
363,
2888,
2048,
3519,
9995,
13,
4706,
1583,
29889,
1202,
29918,
11618,
29879,
580,
13,
4706,
1583,
29889,
1359,
29918,
9794,
29898,
2774,
17280,
29922,
8824,
29897,
13,
4706,
1583,
29889,
4282,
29918,
6921,
3977,
397,
414,
580,
13,
4706,
1583,
29889,
1188,
29918,
7727,
580,
13,
4706,
1583,
29889,
12198,
29918,
27711,
943,
29898,
24926,
29922,
5574,
29897,
13,
13,
13,
1678,
822,
2048,
29918,
6921,
3977,
397,
414,
29898,
1311,
1125,
13,
4706,
9995,
6811,
2426,
363,
8125,
21220,
4469,
3977,
6119,
23315,
13,
13,
9651,
405,
29933,
29991,
382,
3059,
11499,
612,
27269,
27085,
612,
22970,
2672,
12336,
29903,
29889,
2180,
3203,
278,
1494,
1881,
2983,
13,
9651,
526,
3806,
29901,
13,
18884,
3700,
313,
1552,
1881,
363,
1967,
29897,
13,
18884,
11105,
313,
1552,
1881,
363,
11105,
565,
372,
338,
1304,
29897,
13,
13,
4706,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
13,
1678,
822,
788,
29918,
11618,
29879,
29898,
1311,
1125,
13,
4706,
9995,
6811,
2426,
304,
788,
19677,
14379,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
13,
1678,
822,
2254,
29918,
3859,
29918,
3888,
29898,
1311,
1125,
13,
4706,
9995,
16012,
278,
1881,
8267,
515,
2106,
934,
565,
372,
4864,
9995,
13,
4706,
17927,
29889,
8382,
703,
23456,
10567,
1383,
4085,
515,
4306,
934,
1159,
13,
4706,
565,
451,
1583,
29889,
3859,
29889,
2080,
29879,
29901,
13,
9651,
17927,
29889,
8382,
703,
3782,
1881,
25834,
7160,
29889,
5293,
1904,
2295,
1159,
13,
9651,
736,
13,
4706,
565,
451,
1583,
29889,
3859,
29889,
2161,
29918,
845,
11603,
29901,
13,
9651,
17927,
29889,
27392,
703,
4290,
25834,
6087,
297,
4306,
934,
29892,
541,
694,
7087,
363,
525,
2161,
29915,
1213,
13,
462,
965,
376,
15156,
1904,
2295,
1159,
13,
9651,
736,
13,
4706,
1881,
29918,
12181,
353,
1583,
29889,
3859,
29889,
2161,
29918,
845,
11603,
29961,
29900,
29962,
13,
4706,
17927,
29889,
8382,
703,
29020,
1881,
8267,
515,
2106,
934,
29901,
1273,
29879,
613,
1881,
29918,
12181,
29897,
13,
4706,
1583,
29889,
2080,
29918,
12181,
353,
1881,
29918,
12181,
13,
13,
13,
1678,
822,
788,
29918,
11618,
29898,
1311,
29892,
3564,
29918,
1853,
29892,
2625,
29892,
3564,
1125,
13,
4706,
9995,
3462,
263,
405,
29940,
19346,
1203,
9995,
13,
4706,
17927,
29889,
8382,
703,
11618,
29918,
1853,
29901,
14210,
29879,
742,
2625,
29901,
14210,
29879,
742,
3564,
29901,
14210,
29879,
29915,
613,
3564,
29918,
1853,
29892,
2625,
29892,
3564,
29897,
13,
4706,
10422,
353,
29850,
3227,
29913,
1642,
4830,
29898,
1311,
29889,
978,
29892,
3564,
29918,
1853,
29889,
13609,
3101,
13,
4706,
1024,
353,
3564,
29918,
1853,
29889,
13609,
580,
13,
4706,
565,
2625,
29901,
13,
9651,
2625,
353,
2625,
29889,
13609,
580,
13,
9651,
10422,
4619,
376,
648,
29913,
1642,
4830,
29898,
2975,
29889,
21064,
3101,
13,
9651,
1024,
4619,
376,
648,
29913,
1642,
4830,
29898,
2975,
29897,
13,
4706,
10422,
4619,
11393,
29882,
29945,
29908,
13,
4706,
17927,
29889,
8382,
703,
978,
29901,
14210,
29879,
742,
10422,
29901,
14210,
29879,
29915,
613,
1024,
29892,
10422,
29897,
13,
4706,
1583,
29889,
11618,
29879,
29961,
978,
29962,
353,
405,
29940,
19346,
29898,
710,
29898,
1311,
29889,
4299,
29918,
3972,
847,
10422,
511,
3564,
29918,
1853,
29892,
2625,
29892,
3564,
29897,
13,
13,
13,
1678,
822,
788,
29918,
27711,
272,
29898,
1311,
29892,
2625,
29892,
1904,
1125,
13,
4706,
9995,
3462,
263,
8500,
272,
304,
278,
8500,
943,
8600,
9995,
13,
4706,
17927,
29889,
8382,
703,
2528,
292,
8500,
272,
29901,
313,
2975,
29901,
14210,
29879,
742,
1904,
29901,
1273,
29879,
19123,
2625,
29892,
1904,
29897,
13,
4706,
565,
1583,
29889,
29887,
13364,
1405,
29871,
29896,
29901,
13,
9651,
17927,
29889,
8382,
703,
1168,
369,
1259,
304,
2473,
29899,
29887,
3746,
29901,
2625,
1273,
29879,
613,
2625,
29897,
13,
9651,
1904,
353,
2473,
29918,
29887,
3746,
29918,
4299,
29898,
4299,
29892,
1583,
29889,
29887,
13364,
29897,
13,
4706,
1583,
29889,
27711,
943,
29961,
2975,
29962,
353,
1904,
13,
4706,
565,
451,
1583,
29889,
3859,
29889,
2080,
29879,
29901,
13,
9651,
1583,
29889,
8899,
29918,
2080,
29918,
845,
11603,
29898,
4299,
29897,
13,
4706,
565,
451,
1583,
29889,
4905,
29918,
12181,
29901,
13,
9651,
1583,
29889,
842,
29918,
4905,
29918,
12181,
29898,
4299,
29897,
13,
13,
1678,
822,
3787,
29918,
2080,
29918,
845,
11603,
29898,
1311,
29892,
1904,
1125,
13,
4706,
9995,
14491,
278,
1881,
322,
1962,
25834,
304,
2106,
9995,
13,
4706,
17927,
29889,
8382,
703,
2528,
292,
1881,
25834,
304,
2106,
363,
1904,
1159,
13,
4706,
10970,
353,
426,
20158,
29889,
978,
29901,
476,
29889,
524,
29918,
12181,
29898,
20158,
9601,
29899,
29941,
17531,
363,
12489,
297,
1904,
29889,
2080,
29879,
29913,
13,
4706,
565,
451,
738,
29898,
262,
29886,
363,
297,
29886,
297,
10970,
29889,
8149,
580,
565,
297,
29886,
29889,
27382,
2541,
703,
2161,
5783,
29901,
13,
9651,
12020,
7865,
2392,
703,
3782,
1881,
4257,
525,
2161,
29915,
471,
1476,
29889,
5399,
596,
1881,
22006,
29889,
376,
13,
462,
632,
376,
7583,
1881,
2983,
29901,
6571,
1642,
4830,
29898,
2080,
29879,
876,
13,
4706,
1583,
29889,
3859,
29889,
2080,
29879,
353,
10970,
13,
4706,
17927,
29889,
8382,
703,
2528,
287,
1881,
25834,
29901,
1273,
29879,
613,
1583,
29889,
3859,
29889,
2080,
29879,
29897,
13,
13,
13,
1678,
822,
731,
29918,
4905,
29918,
12181,
29898,
1311,
29892,
1904,
1125,
13,
4706,
9995,
3789,
278,
1962,
8267,
363,
671,
297,
6694,
322,
3588,
9995,
13,
4706,
17927,
29889,
8382,
703,
29020,
1962,
8267,
1159,
13,
4706,
714,
353,
518,
29968,
29889,
524,
29918,
12181,
29898,
20158,
9601,
29899,
29941,
17531,
363,
12489,
297,
1904,
29889,
4905,
29879,
29962,
13,
4706,
565,
451,
714,
29901,
13,
9651,
12020,
7865,
2392,
703,
3782,
14391,
1476,
29991,
5399,
596,
1904,
23157,
13,
4706,
1583,
29889,
4905,
29918,
12181,
353,
18761,
29898,
449,
29961,
29900,
2314,
13,
4706,
17927,
29889,
8382,
703,
2528,
287,
1962,
8267,
29901,
1273,
29879,
613,
1583,
29889,
4905,
29918,
12181,
29897,
13,
13,
13,
1678,
822,
10092,
29918,
15702,
29886,
549,
29898,
1311,
1125,
13,
4706,
9995,
2538,
300,
278,
4733,
363,
24543,
29886,
549,
6694,
9995,
13,
4706,
17927,
29889,
8382,
703,
27175,
1259,
4733,
1159,
13,
13,
4706,
396,
17732,
4733,
322,
3983,
13,
4706,
1583,
29889,
27711,
943,
353,
9657,
580,
13,
4706,
1583,
29889,
328,
874,
27521,
29918,
6921,
3977,
397,
414,
353,
9657,
580,
13,
4706,
476,
29889,
8551,
29918,
7924,
580,
13,
13,
4706,
396,
16012,
3382,
1379,
363,
1857,
6694,
1065,
13,
4706,
363,
1904,
297,
1583,
29889,
11618,
29879,
29889,
5975,
7295,
13,
9651,
1904,
29889,
11618,
353,
8125,
29889,
3166,
29918,
2917,
29898,
4299,
29889,
2917,
29897,
13,
9651,
1904,
29889,
11618,
29889,
842,
29918,
705,
5861,
29898,
4299,
29889,
705,
5861,
29897,
13,
13,
4706,
1583,
29889,
4282,
29918,
6921,
3977,
397,
414,
580,
13,
4706,
1583,
29889,
12198,
29918,
27711,
943,
29898,
24926,
29922,
8824,
29897,
13,
4706,
17927,
29889,
8382,
703,
27175,
4733,
1159,
13,
13,
13,
1678,
822,
6633,
29918,
27711,
943,
29898,
1311,
29892,
11905,
29922,
5574,
1125,
13,
4706,
9995,
3831,
488,
278,
8500,
943,
9995,
13,
4706,
17927,
29889,
8382,
703,
6843,
6504,
21099,
919,
943,
1159,
13,
4706,
6509,
29918,
10492,
353,
1583,
29889,
2917,
29889,
657,
703,
21891,
29918,
10492,
613,
29871,
29945,
29872,
29899,
29945,
29897,
13,
4706,
5994,
3950,
353,
1583,
29889,
657,
29918,
20640,
3950,
29898,
29212,
29922,
21891,
29918,
10492,
29892,
21762,
29918,
29896,
29922,
29900,
29889,
29945,
29892,
21762,
29918,
29906,
29922,
29900,
29889,
29929,
29929,
29929,
29897,
13,
13,
4706,
363,
2625,
29892,
1904,
297,
1583,
29889,
27711,
943,
29889,
7076,
7295,
13,
9651,
11105,
353,
518,
262,
29886,
363,
297,
29886,
297,
1904,
29889,
2080,
29879,
565,
297,
29886,
29889,
978,
29889,
27382,
2541,
703,
13168,
13531,
13,
9651,
6410,
29918,
7039,
353,
6796,
6758,
3108,
13,
9651,
6410,
29918,
7692,
2395,
353,
518,
1311,
29889,
6758,
29918,
2220,
29898,
13168,
29892,
2625,
29892,
11905,
4638,
13,
9651,
565,
11105,
29901,
13,
18884,
6410,
29918,
7039,
29889,
4397,
703,
13168,
29918,
6758,
1159,
13,
18884,
6410,
29918,
7692,
2395,
29889,
4397,
29898,
1311,
29889,
13168,
29918,
6758,
29918,
2220,
29898,
2975,
29892,
11905,
876,
13,
9651,
1904,
29889,
12198,
29898,
20640,
3950,
29922,
20640,
3950,
29892,
6410,
29922,
6758,
29918,
7692,
2395,
29897,
13,
13,
9651,
565,
7431,
29898,
6758,
29918,
7039,
29897,
1405,
29871,
29896,
29901,
13,
18884,
6410,
29918,
7039,
29889,
7851,
29898,
29900,
29892,
376,
7827,
29918,
6758,
1159,
13,
9651,
565,
11905,
29901,
13,
18884,
1583,
29889,
3859,
29889,
1202,
29918,
7924,
29918,
6758,
29918,
7039,
29898,
2975,
29892,
6410,
29918,
7039,
29897,
13,
18884,
1583,
29889,
18434,
29961,
2975,
29962,
353,
1051,
580,
13,
4706,
17927,
29889,
8382,
703,
6843,
2356,
21099,
919,
943,
29889,
365,
2209,
267,
29901,
1273,
29879,
613,
6410,
29918,
7039,
29897,
13,
13,
13,
1678,
822,
679,
29918,
20640,
3950,
29898,
1311,
29892,
301,
29878,
29922,
29945,
29872,
29899,
29945,
29892,
21762,
29918,
29896,
29922,
29900,
29889,
29945,
29892,
21762,
29918,
29906,
29922,
29900,
29889,
29929,
29929,
29929,
1125,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
978,
13,
4706,
9995,
8878,
322,
736,
20693,
326,
3950,
9995,
13,
4706,
3523,
29918,
19290,
353,
9657,
29898,
29212,
29922,
29212,
29892,
21762,
29918,
29896,
29922,
3571,
29918,
29896,
29892,
21762,
29918,
29906,
29922,
3571,
29918,
29906,
29897,
13,
4706,
565,
313,
1311,
29889,
2917,
29889,
657,
703,
24049,
12324,
613,
7700,
29897,
322,
13,
18884,
13023,
294,
29889,
27852,
29889,
27852,
580,
2804,
376,
13974,
333,
828,
29889,
3946,
294,
29889,
27852,
29908,
1125,
13,
9651,
396,
405,
29933,
29901,
315,
3466,
12324,
338,
6411,
417,
28259,
478,
25058,
671,
482,
29892,
607,
338,
451,
3806,
10468,
13,
9651,
396,
322,
1122,
367,
263,
6494,
297,
12693,
294,
29914,
8969,
29889,
13,
9651,
396,
13494,
333,
1988,
756,
263,
6494,
11211,
278,
20102,
12324,
3443,
13,
9651,
396,
2823,
29901,
2045,
597,
3292,
29889,
510,
29914,
13974,
333,
828,
29914,
13974,
333,
828,
29914,
12175,
29914,
29906,
29906,
29947,
13,
9651,
396,
5244,
11316,
491,
3763,
11077,
372,
29889,
13,
9651,
396,
14402,
29901,
15154,
445,
408,
4720,
372,
338,
4343,
297,
13494,
333,
1988,
29889,
13,
9651,
3523,
29918,
19290,
3366,
24049,
12324,
3108,
353,
29871,
29896,
29889,
29900,
13,
4706,
17927,
29889,
8382,
703,
20624,
326,
3950,
9049,
5085,
29901,
1273,
29879,
613,
3523,
29918,
19290,
29897,
13,
4706,
736,
11783,
29898,
1068,
3670,
29918,
19290,
29897,
13,
13,
13,
1678,
822,
6410,
29918,
2220,
29898,
1311,
29892,
11105,
29892,
2625,
29892,
11905,
1125,
13,
4706,
9995,
3789,
278,
6410,
740,
13,
9651,
19160,
338,
1881,
577,
591,
871,
1480,
2748,
9995,
13,
4706,
565,
1583,
29889,
2917,
29889,
657,
703,
29881,
893,
326,
29918,
6758,
613,
7700,
1125,
13,
9651,
565,
2625,
1275,
376,
29874,
29908,
322,
451,
1583,
29889,
27711,
322,
11905,
29901,
13,
18884,
17927,
29889,
369,
15828,
703,
15156,
360,
1799,
7833,
365,
2209,
1159,
13,
9651,
6410,
29918,
9891,
353,
360,
1799,
7833,
2061,
573,
580,
13,
4706,
1683,
29901,
13,
9651,
565,
2625,
1275,
376,
29874,
29908,
322,
451,
1583,
29889,
27711,
322,
11905,
29901,
13,
18884,
17927,
29889,
369,
15828,
703,
15156,
16316,
1976,
14977,
4829,
365,
2209,
1159,
13,
9651,
6410,
29918,
9891,
353,
28495,
29889,
12676,
29918,
23552,
29918,
2704,
13,
13,
4706,
565,
11105,
322,
1583,
29889,
2917,
29889,
657,
703,
2238,
284,
1891,
29918,
13168,
29918,
6758,
613,
7700,
1125,
13,
9651,
6410,
29918,
13168,
353,
11105,
29961,
29900,
29962,
13,
9651,
565,
2625,
1275,
376,
29874,
29908,
322,
451,
1583,
29889,
27711,
322,
11905,
29901,
13,
18884,
17927,
29889,
369,
15828,
703,
29925,
264,
284,
5281,
11105,
363,
365,
2209,
1159,
13,
9651,
6410,
29918,
9891,
353,
7363,
284,
1891,
29931,
2209,
29898,
6758,
29918,
13168,
29892,
6410,
29918,
9891,
29897,
13,
4706,
736,
6410,
29918,
9891,
13,
13,
13,
1678,
822,
11105,
29918,
6758,
29918,
2220,
29898,
1311,
29892,
2625,
29892,
11905,
1125,
13,
4706,
9995,
3789,
278,
11105,
6410,
740,
13,
9651,
19160,
338,
1881,
577,
591,
871,
1480,
2748,
9995,
13,
4706,
565,
2625,
1275,
376,
29874,
29908,
322,
451,
1583,
29889,
27711,
322,
11905,
29901,
13,
9651,
17927,
29889,
369,
15828,
703,
15156,
16316,
317,
339,
1965,
4829,
365,
2209,
363,
11105,
1159,
13,
4706,
11105,
29918,
6758,
29918,
9891,
353,
28495,
29889,
12676,
29918,
26613,
1965,
29918,
2704,
13,
4706,
736,
11105,
29918,
6758,
29918,
9891,
13,
13,
13,
1678,
822,
29105,
29898,
1311,
29892,
17945,
1125,
13,
4706,
9995,
1281,
13549,
363,
4469,
3977,
6119,
4733,
9995,
13,
4706,
17927,
29889,
8382,
703,
2577,
1259,
1281,
13549,
29901,
313,
26276,
29901,
1273,
29879,
19123,
17945,
29897,
13,
4706,
565,
17945,
29901,
13,
9651,
1904,
353,
1583,
29889,
27711,
943,
3366,
29874,
3108,
13,
4706,
1683,
29901,
13,
9651,
1904,
353,
1583,
29889,
27711,
943,
3366,
29890,
3108,
13,
4706,
565,
1583,
29889,
27711,
29901,
13,
9651,
396,
19928,
6633,
278,
1904,
304,
367,
3244,
9109,
13,
9651,
1904,
3032,
5675,
29918,
27711,
29918,
2220,
580,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
24681,
29899,
5943,
13,
4706,
3240,
791,
353,
1904,
29889,
27711,
13,
4706,
17927,
29889,
8382,
703,
29954,
327,
1281,
13549,
29901,
1273,
29879,
613,
3240,
791,
29897,
13,
4706,
736,
3240,
791,
13,
13,
13,
1678,
732,
6799,
13,
1678,
822,
24372,
29898,
1311,
1125,
13,
4706,
376,
2577,
1857,
6694,
12541,
1353,
29908,
13,
4706,
736,
1583,
29889,
3859,
29889,
1524,
800,
13,
13,
13,
1678,
822,
2910,
29918,
9794,
29898,
1311,
29892,
2381,
17280,
1125,
13,
4706,
9995,
7315,
278,
4733,
363,
319,
29914,
29933,
2625,
363,
2381,
20304,
9995,
13,
4706,
17927,
29889,
8382,
703,
3388,
4733,
29901,
313,
2774,
17280,
29901,
1273,
29879,
19123,
2381,
17280,
29897,
13,
4706,
4733,
29918,
1958,
353,
8853,
29874,
1115,
9657,
3285,
376,
29890,
1115,
9657,
28296,
13,
4706,
11192,
353,
4852,
29874,
613,
376,
29890,
1159,
565,
451,
2381,
17280,
1683,
4852,
29890,
613,
376,
29874,
1159,
13,
4706,
363,
3564,
297,
1583,
29889,
11618,
29879,
29889,
5975,
7295,
13,
9651,
565,
3564,
29889,
2975,
1275,
11192,
29961,
29900,
5387,
13,
18884,
4733,
29918,
1958,
3366,
29874,
3108,
29961,
11618,
29889,
1853,
29962,
353,
3564,
29889,
9507,
13,
9651,
565,
3564,
29889,
2975,
1275,
11192,
29961,
29896,
5387,
13,
18884,
4733,
29918,
1958,
3366,
29890,
3108,
29961,
11618,
29889,
1853,
29962,
353,
3564,
29889,
9507,
13,
4706,
17927,
29889,
8382,
703,
9689,
287,
4733,
29901,
313,
9794,
29918,
1958,
29901,
1273,
29879,
19123,
4733,
29918,
1958,
29897,
13,
4706,
736,
4733,
29918,
1958,
13,
13,
13,
1678,
822,
1480,
29918,
7727,
29898,
1311,
1125,
13,
4706,
9995,
1798,
15828,
1480,
278,
1904,
19138,
583,
9995,
13,
4706,
565,
1583,
29889,
27711,
29901,
13,
9651,
736,
13,
4706,
363,
2625,
297,
12705,
29898,
1761,
29898,
1311,
29889,
27711,
943,
29889,
8149,
22130,
29901,
13,
9651,
17927,
29889,
369,
15828,
703,
29961,
29995,
29879,
1273,
29879,
6991,
5219,
5387,
613,
1583,
29889,
978,
29889,
3257,
3285,
2625,
29889,
21064,
3101,
13,
9651,
1583,
29889,
27711,
943,
29961,
2975,
1822,
7727,
29898,
2158,
29918,
9144,
29922,
2892,
921,
29901,
17927,
29889,
369,
15828,
703,
29934,
29989,
29995,
29879,
613,
921,
876,
13,
9651,
363,
1024,
29892,
302,
29876,
7299,
297,
1583,
29889,
11618,
29879,
29889,
7076,
7295,
13,
18884,
565,
302,
29876,
7299,
29889,
2975,
338,
451,
6213,
322,
302,
29876,
7299,
29889,
2975,
2804,
2625,
29901,
13,
462,
1678,
6773,
13,
18884,
17927,
29889,
369,
15828,
11702,
29879,
29901,
613,
1024,
29889,
3257,
3101,
13,
18884,
302,
29876,
7299,
29889,
11618,
29889,
7727,
29898,
2158,
29918,
9144,
29922,
2892,
921,
29901,
17927,
29889,
369,
15828,
703,
29934,
29989,
29995,
29879,
613,
921,
876,
13,
13,
13,
1678,
822,
2254,
29918,
9794,
29898,
1311,
29892,
2381,
17280,
1125,
13,
4706,
9995,
16012,
4733,
515,
934,
9995,
13,
4706,
17927,
29889,
8382,
703,
5896,
1904,
29901,
313,
2774,
17280,
29901,
1273,
29879,
19123,
2381,
17280,
29897,
13,
13,
4706,
565,
451,
1583,
29889,
9794,
29918,
28997,
322,
451,
1583,
29889,
27711,
29901,
13,
9651,
17927,
29889,
3888,
703,
9832,
1218,
716,
14210,
29879,
29915,
1904,
297,
4138,
29901,
14210,
29879,
29915,
613,
1583,
29889,
978,
29892,
1583,
29889,
4299,
29918,
3972,
29897,
13,
9651,
736,
6213,
13,
4706,
565,
451,
1583,
29889,
9794,
29918,
28997,
322,
1583,
29889,
27711,
29901,
13,
9651,
17927,
29889,
2704,
703,
3195,
1033,
451,
367,
1476,
297,
4138,
14210,
29879,
4286,
1222,
11407,
613,
1583,
29889,
4299,
29918,
3972,
29897,
13,
9651,
6876,
29898,
29900,
29897,
13,
13,
4706,
565,
451,
1583,
29889,
275,
29918,
1397,
4135,
29901,
13,
9651,
476,
29889,
8551,
29918,
7924,
580,
13,
4706,
1904,
29918,
20698,
353,
1583,
29889,
1958,
29918,
9794,
29898,
2774,
17280,
29897,
13,
4706,
363,
3564,
297,
1583,
29889,
11618,
29879,
29889,
5975,
7295,
13,
9651,
565,
451,
3564,
29889,
2975,
29901,
13,
18884,
338,
29918,
15638,
353,
3564,
29889,
1359,
580,
13,
9651,
1683,
29901,
13,
18884,
338,
29918,
15638,
353,
3564,
29889,
1359,
29898,
8159,
2084,
29922,
4299,
29918,
20698,
29961,
11618,
29889,
2975,
3816,
11618,
29889,
1853,
2314,
13,
9651,
565,
451,
338,
29918,
15638,
29901,
13,
18884,
2867,
13,
4706,
565,
338,
29918,
15638,
29901,
13,
9651,
17927,
29889,
3888,
703,
29147,
1904,
515,
8086,
29901,
14210,
29879,
29915,
613,
1583,
29889,
4299,
29918,
3972,
29897,
13,
4706,
736,
338,
29918,
15638,
13,
13,
13,
1678,
822,
4078,
29918,
9794,
29898,
1311,
29892,
22395,
29918,
1524,
362,
1125,
13,
4706,
9995,
7437,
786,
322,
4078,
278,
4733,
9995,
13,
4706,
17927,
29889,
8382,
703,
5841,
292,
701,
322,
14238,
4733,
1159,
13,
4706,
881,
29918,
1627,
786,
353,
1583,
29889,
657,
29918,
7620,
29918,
12483,
1179,
580,
13,
4706,
4078,
29918,
28993,
353,
1051,
580,
13,
4706,
363,
3564,
297,
1583,
29889,
11618,
29879,
29889,
5975,
7295,
13,
9651,
1024,
353,
376,
7620,
648,
29913,
1642,
4830,
29898,
11618,
29889,
978,
29897,
13,
9651,
4078,
29918,
28993,
29889,
4397,
29898,
15329,
4899,
29898,
11618,
29889,
7620,
29892,
13,
462,
462,
9651,
1024,
29922,
978,
29892,
13,
462,
462,
9651,
881,
29918,
1627,
786,
29922,
9344,
29918,
1627,
786,
876,
13,
4706,
4078,
29918,
28993,
29889,
4397,
29898,
15329,
4899,
29898,
1311,
29889,
3859,
29889,
7620,
29892,
13,
462,
462,
4706,
1024,
543,
7620,
29918,
3859,
613,
13,
462,
462,
4706,
881,
29918,
1627,
786,
29922,
9344,
29918,
1627,
786,
876,
13,
4706,
363,
3244,
297,
4078,
29918,
28993,
29901,
13,
9651,
3244,
29889,
2962,
580,
13,
4706,
363,
3244,
297,
4078,
29918,
28993,
29901,
13,
9651,
565,
3244,
29889,
5349,
29918,
2704,
29901,
13,
18884,
17927,
29889,
2704,
29898,
7097,
29889,
12523,
29961,
29900,
2314,
13,
9651,
3244,
29889,
7122,
580,
13,
4706,
17927,
29889,
3888,
703,
17314,
4733,
1159,
13,
4706,
565,
22395,
29918,
1524,
362,
29901,
13,
9651,
1583,
29889,
29879,
14551,
29918,
9794,
580,
13,
13,
13,
1678,
822,
22395,
29918,
9794,
29898,
1311,
1125,
13,
4706,
9995,
11190,
263,
22395,
310,
278,
1904,
472,
1857,
2106,
322,
1250,
701,
9995,
13,
4706,
17927,
29889,
3888,
703,
29903,
5555,
22395,
1159,
13,
4706,
4765,
353,
1583,
29889,
4299,
29918,
3972,
13,
4706,
29743,
353,
679,
29918,
12083,
703,
29912,
3227,
29913,
1642,
4830,
29898,
1311,
29889,
4299,
29918,
3972,
29892,
1583,
29889,
1524,
800,
876,
13,
4706,
363,
10422,
297,
2897,
29889,
1761,
3972,
29898,
4351,
1125,
13,
9651,
565,
10422,
29889,
1975,
2541,
17350,
29890,
29895,
29908,
1125,
13,
18884,
6773,
13,
9651,
4765,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4351,
29892,
10422,
29897,
13,
9651,
29743,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
22992,
29892,
10422,
29897,
13,
9651,
3509,
9891,
353,
3509,
8336,
565,
2897,
29889,
2084,
29889,
275,
3972,
29898,
4351,
1445,
29897,
1683,
3509,
1445,
13,
9651,
17927,
29889,
8382,
703,
29903,
5555,
22395,
29901,
14210,
29879,
29915,
1405,
14210,
29879,
29915,
613,
4765,
1445,
29892,
29743,
1445,
29897,
13,
9651,
3509,
9891,
29898,
4351,
1445,
29892,
29743,
1445,
29897,
13,
4706,
17927,
29889,
3888,
703,
29903,
10511,
22395,
1159,
13,
13,
13,
1678,
822,
679,
29918,
7620,
29918,
12483,
1179,
29898,
1311,
1125,
13,
4706,
9995,
7106,
278,
6410,
4759,
1179,
1951,
1833,
4078,
322,
10092,
15839,
28495,
13,
13,
9651,
910,
12566,
29879,
2750,
1904,
1034,
18953,
491,
871,
27436,
701,
278,
1904,
13,
9651,
565,
738,
310,
278,
6410,
1819,
505,
19225,
29889,
13,
9651,
14402,
910,
338,
451,
263,
4922,
1788,
29889,
960,
278,
1904,
1034,
6685,
29879,
373,
4078,
29918,
1524,
362,
448,
29871,
29896,
13,
9651,
769,
1904,
1122,
1603,
16199,
13,
4706,
9995,
13,
4706,
17927,
29889,
8382,
703,
2577,
1259,
319,
19698,
6410,
1951,
1833,
4078,
1159,
13,
4706,
1029,
3174,
353,
9657,
580,
13,
4706,
16199,
353,
5852,
13,
13,
4706,
363,
2625,
29892,
6410,
297,
1583,
29889,
18434,
29889,
7076,
7295,
13,
9651,
565,
451,
6410,
29901,
13,
18884,
16199,
353,
7700,
13,
18884,
2867,
13,
13,
9651,
1029,
3174,
29961,
2975,
29962,
353,
2533,
29898,
6758,
29897,
847,
7431,
29898,
6758,
29897,
13,
9651,
1583,
29889,
18434,
29961,
2975,
29962,
353,
1051,
580,
29871,
396,
2538,
300,
15839,
6410,
13,
13,
9651,
565,
451,
1583,
29889,
3859,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
29889,
657,
29898,
2975,
29892,
6213,
1125,
13,
18884,
17927,
29889,
8382,
703,
29020,
2847,
4078,
12541,
6410,
6588,
363,
14210,
29879,
2396,
1273,
29879,
613,
13,
462,
632,
2625,
29892,
1029,
3174,
29961,
2975,
2314,
13,
18884,
1583,
29889,
3859,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
29961,
2975,
29962,
353,
1029,
3174,
29961,
2975,
29962,
13,
18884,
6773,
13,
13,
9651,
565,
16199,
29901,
13,
18884,
396,
9333,
1065,
445,
565,
16199,
338,
1565,
29889,
2178,
28495,
1818,
505,
13700,
363,
263,
2854,
16199,
13,
18884,
16199,
353,
1583,
29889,
3198,
29918,
6758,
29918,
8865,
29898,
2975,
29892,
1029,
3174,
29961,
2975,
2314,
13,
13,
4706,
17927,
29889,
8382,
703,
29931,
340,
342,
15839,
4078,
12541,
6410,
6588,
29901,
1273,
29879,
613,
13,
462,
268,
1583,
29889,
3859,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
29897,
13,
4706,
17927,
29889,
8382,
703,
29909,
19698,
6410,
1951,
1833,
4078,
29901,
1273,
29879,
613,
1029,
3174,
29897,
13,
13,
4706,
565,
16199,
29901,
29871,
396,
10318,
19604,
6410,
1819,
304,
278,
2106,
13,
9651,
363,
2625,
29892,
1029,
29887,
29918,
6758,
297,
1029,
3174,
29889,
7076,
7295,
13,
18884,
17927,
29889,
8382,
703,
3373,
26747,
19604,
4078,
12541,
6588,
363,
14210,
29879,
2396,
1273,
29879,
613,
2625,
29892,
1029,
29887,
29918,
6758,
29897,
13,
18884,
1583,
29889,
3859,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
29961,
2975,
29962,
353,
1029,
29887,
29918,
6758,
13,
13,
4706,
17927,
29889,
8382,
703,
5841,
292,
701,
29901,
1273,
29879,
613,
16199,
29897,
13,
4706,
736,
16199,
13,
13,
13,
1678,
822,
1423,
29918,
6758,
29918,
8865,
29898,
1311,
29892,
2625,
29892,
1029,
29887,
1125,
13,
4706,
9995,
5399,
3692,
3001,
6410,
756,
13700,
1951,
19604,
6410,
9995,
13,
4706,
565,
1029,
29887,
529,
1583,
29889,
3859,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
29961,
2975,
5387,
13,
9651,
17927,
29889,
8382,
703,
29931,
2209,
363,
14210,
29879,
29915,
756,
13700,
613,
2625,
29897,
13,
9651,
736,
5852,
13,
4706,
17927,
29889,
8382,
703,
29931,
2209,
363,
14210,
29879,
29915,
756,
451,
13700,
613,
2625,
29897,
13,
4706,
736,
7700,
13,
13,
13,
1678,
822,
19508,
29918,
1397,
4135,
29898,
1311,
1125,
13,
4706,
9995,
5682,
4135,
8533,
29892,
17511,
11442,
322,
306,
16036,
4733,
750,
22435,
9696,
22006,
13064,
1080,
13,
9651,
390,
3871,
963,
565,
896,
526,
1476,
322,
2767,
9995,
13,
4706,
25000,
29918,
20698,
353,
8853,
23395,
1115,
518,
703,
10764,
29923,
29918,
7099,
6119,
29889,
29882,
29945,
613,
376,
23395,
29918,
7099,
6119,
29889,
29882,
29945,
4968,
13,
462,
462,
29871,
4852,
10764,
29923,
29918,
3977,
6119,
29889,
29882,
29945,
613,
376,
23395,
29918,
3977,
6119,
29889,
29882,
29945,
4968,
13,
462,
462,
29871,
4852,
10764,
29923,
29918,
1639,
29918,
29909,
29889,
29882,
29945,
613,
376,
23395,
29918,
1639,
13847,
29918,
29909,
29889,
29882,
29945,
4968,
13,
462,
462,
29871,
4852,
10764,
29923,
29918,
1639,
29918,
29933,
29889,
29882,
29945,
613,
376,
23395,
29918,
1639,
13847,
29918,
29933,
29889,
29882,
29945,
4968,
13,
462,
462,
29871,
4852,
10764,
29923,
29918,
1639,
29918,
20313,
29889,
29882,
29945,
613,
376,
23395,
29918,
1639,
29889,
29882,
29945,
1159,
1402,
13,
462,
3986,
376,
13492,
1115,
518,
703,
3977,
6119,
29889,
29882,
29945,
613,
376,
13492,
29918,
3977,
6119,
29889,
29882,
29945,
4968,
13,
462,
462,
539,
4852,
7099,
6119,
29918,
29909,
29889,
29882,
29945,
613,
376,
13492,
29918,
7099,
6119,
29918,
29909,
29889,
29882,
29945,
4968,
13,
462,
462,
539,
4852,
7099,
6119,
29918,
29933,
29889,
29882,
29945,
613,
376,
13492,
29918,
7099,
6119,
29918,
29933,
29889,
29882,
29945,
4968,
13,
462,
462,
539,
4852,
677,
6954,
29918,
3977,
6119,
29889,
29882,
29945,
613,
376,
13492,
29918,
3977,
6119,
29889,
29882,
29945,
4968,
13,
462,
462,
539,
4852,
677,
6954,
29918,
7099,
6119,
29918,
29909,
29889,
29882,
29945,
613,
376,
13492,
29918,
7099,
6119,
29918,
29909,
29889,
29882,
29945,
4968,
13,
462,
462,
539,
4852,
677,
6954,
29918,
7099,
6119,
29918,
29933,
29889,
29882,
29945,
613,
376,
13492,
29918,
7099,
6119,
29918,
29933,
29889,
29882,
29945,
1159,
12258,
13,
4706,
565,
1583,
29889,
978,
451,
297,
25000,
29918,
20698,
29889,
8149,
7295,
13,
9651,
736,
13,
4706,
17927,
29889,
8382,
703,
29934,
264,
11500,
25000,
2066,
1159,
13,
13,
4706,
731,
29918,
677,
6954,
353,
7700,
13,
4706,
4784,
353,
7700,
13,
4706,
363,
2030,
29918,
978,
29892,
716,
29918,
978,
297,
25000,
29918,
20698,
29961,
1311,
29889,
978,
5387,
13,
9651,
2030,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
710,
29898,
1311,
29889,
4299,
29918,
3972,
511,
2030,
29918,
978,
29897,
13,
9651,
716,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
710,
29898,
1311,
29889,
4299,
29918,
3972,
511,
716,
29918,
978,
29897,
13,
9651,
565,
2897,
29889,
2084,
29889,
9933,
29898,
1025,
29918,
2084,
29897,
322,
451,
2897,
29889,
2084,
29889,
9933,
29898,
1482,
29918,
2084,
1125,
13,
18884,
17927,
29889,
3888,
703,
3373,
26747,
25000,
1904,
1024,
515,
29901,
14210,
29879,
29915,
304,
14210,
29879,
29915,
613,
2030,
29918,
978,
29892,
716,
29918,
978,
29897,
13,
18884,
2897,
29889,
1267,
420,
29898,
1025,
29918,
2084,
29892,
716,
29918,
2084,
29897,
13,
18884,
565,
2030,
29918,
978,
29889,
27382,
2541,
703,
677,
6954,
29908,
1125,
13,
462,
1678,
731,
29918,
677,
6954,
353,
5852,
13,
18884,
4784,
353,
5852,
13,
13,
4706,
565,
451,
4784,
29901,
13,
9651,
17927,
29889,
8382,
703,
3782,
25000,
2066,
304,
19508,
1159,
13,
9651,
736,
13,
13,
4706,
1583,
29889,
275,
29918,
1397,
4135,
353,
5852,
13,
4706,
17927,
29889,
8382,
703,
9832,
1218,
2106,
934,
363,
25000,
1904,
1159,
13,
4706,
1583,
29889,
3859,
29889,
2080,
29879,
353,
8853,
2161,
29901,
29900,
1115,
518,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
12258,
13,
4706,
1583,
29889,
3859,
29889,
26495,
29918,
2311,
353,
29871,
29906,
29945,
29953,
13,
4706,
1583,
29889,
3859,
29889,
2917,
3366,
11911,
482,
3108,
353,
29871,
29953,
29906,
29889,
29945,
13,
4706,
1583,
29889,
3859,
29889,
2917,
3366,
1491,
29886,
15711,
29918,
14340,
1052,
292,
3108,
353,
7700,
13,
4706,
1583,
29889,
3859,
29889,
2917,
3366,
13191,
29918,
12791,
3108,
353,
7700,
13,
4706,
1583,
29889,
3859,
29889,
2917,
3366,
13168,
29918,
1853,
3108,
353,
6213,
13,
4706,
1583,
29889,
3859,
29889,
2917,
3366,
677,
6954,
3108,
353,
7700,
13,
4706,
1583,
29889,
3977,
6119,
29918,
6229,
353,
29871,
29896,
29900,
29906,
29946,
13,
13,
4706,
565,
731,
29918,
677,
6954,
29901,
13,
9651,
17927,
29889,
8382,
703,
29020,
2094,
6119,
29918,
6229,
322,
4482,
6954,
7353,
363,
25000,
4482,
6954,
1904,
1159,
13,
9651,
1583,
29889,
3977,
6119,
29918,
6229,
353,
29871,
29945,
29896,
29906,
13,
9651,
1583,
29889,
3859,
29889,
2917,
3366,
677,
6954,
3108,
353,
5852,
13,
13,
4706,
1583,
29889,
3859,
29889,
6506,
29918,
2917,
29898,
1311,
29889,
2917,
29918,
3167,
519,
29918,
7076,
29897,
13,
4706,
1583,
29889,
3859,
29889,
7620,
580,
13,
13,
13,
1990,
405,
29940,
19346,
7295,
13,
1678,
9995,
4134,
304,
4808,
263,
19677,
3564,
322,
372,
29915,
29879,
12700,
848,
13,
13,
1678,
10422,
29901,
259,
450,
2989,
2224,
322,
10422,
310,
278,
1904,
934,
363,
445,
3564,
29889,
13,
1678,
1134,
29901,
539,
450,
1134,
310,
3564,
29889,
1152,
14379,
393,
508,
367,
2381,
17280,
13,
18884,
450,
1134,
881,
367,
13557,
363,
278,
6590,
13,
18884,
319,
322,
350,
14379,
29892,
322,
881,
367,
5412,
363,
1432,
319,
29914,
29933,
5101,
29889,
13,
18884,
13466,
278,
1134,
881,
367,
6446,
5412,
29889,
13,
1678,
2625,
29901,
539,
319,
29892,
350,
470,
6213,
29889,
501,
8485,
304,
12439,
607,
14379,
508,
13,
18884,
367,
2381,
17280,
29889,
13,
1678,
3564,
29901,
418,
22402,
3564,
304,
445,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10422,
29892,
3564,
29918,
1853,
29892,
2625,
29892,
3564,
1125,
13,
4706,
17927,
29889,
8382,
703,
15514,
5281,
1273,
29879,
29901,
313,
9507,
29901,
14210,
29879,
742,
3564,
29918,
1853,
29901,
14210,
29879,
742,
2625,
29901,
14210,
29879,
742,
376,
13,
462,
268,
376,
11618,
29901,
1273,
29879,
613,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29892,
10422,
29892,
3564,
29918,
1853,
29892,
13,
462,
268,
2625,
29892,
3564,
29897,
13,
4706,
1583,
29889,
9507,
353,
10422,
13,
4706,
1583,
29889,
1853,
353,
3564,
29918,
1853,
29889,
13609,
580,
13,
4706,
1583,
29889,
2975,
353,
2625,
13,
4706,
1583,
29889,
978,
353,
1583,
29889,
842,
29918,
978,
580,
13,
4706,
1583,
29889,
11618,
353,
3564,
13,
4706,
1583,
29889,
11618,
29889,
978,
353,
1583,
29889,
978,
13,
4706,
1583,
29889,
2917,
353,
3564,
29889,
657,
29918,
2917,
580,
29871,
396,
1152,
24543,
29886,
549,
17749,
13,
4706,
1583,
29889,
705,
5861,
353,
3564,
29889,
657,
29918,
705,
5861,
580,
29871,
396,
1152,
24543,
29886,
549,
17749,
13,
4706,
17927,
29889,
8382,
703,
15514,
1891,
1273,
29879,
613,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29897,
13,
13,
1678,
822,
731,
29918,
978,
29898,
1311,
1125,
13,
4706,
9995,
3789,
278,
3564,
1024,
9995,
13,
4706,
1024,
353,
1583,
29889,
1853,
13,
4706,
565,
1583,
29889,
2975,
29901,
13,
9651,
1024,
4619,
376,
648,
29913,
1642,
4830,
29898,
1311,
29889,
2975,
29897,
13,
4706,
736,
1024,
13,
13,
1678,
822,
2254,
29898,
1311,
29892,
2989,
2084,
29922,
8516,
1125,
13,
4706,
9995,
16012,
1904,
9995,
13,
4706,
2989,
2084,
353,
2989,
2084,
565,
2989,
2084,
1683,
1583,
29889,
9507,
13,
4706,
17927,
29889,
8382,
703,
23456,
1904,
29901,
14210,
29879,
29915,
613,
2989,
2084,
29897,
13,
4706,
1018,
29901,
13,
9651,
3564,
353,
2254,
29918,
4299,
29898,
1311,
29889,
9507,
29892,
2888,
29918,
12650,
29922,
657,
29918,
6341,
29918,
12650,
3101,
13,
4706,
5174,
7865,
2392,
408,
4589,
29901,
13,
9651,
565,
851,
29898,
3127,
467,
13609,
2141,
27382,
2541,
703,
29883,
6735,
1653,
2318,
297,
1303,
871,
4464,
29908,
1125,
13,
18884,
1583,
29889,
13441,
29918,
1397,
4135,
29918,
705,
5861,
580,
13,
18884,
736,
5852,
13,
9651,
17927,
29889,
27392,
703,
17776,
8363,
5923,
6694,
848,
29889,
3251,
1218,
716,
4733,
1159,
13,
9651,
17927,
29889,
8382,
703,
2451,
29901,
1273,
29879,
613,
851,
29898,
3127,
876,
13,
9651,
736,
7700,
13,
4706,
5174,
438,
29173,
408,
4589,
29901,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
6729,
328,
29899,
19499,
13,
9651,
17927,
29889,
27392,
703,
17776,
8363,
5923,
6694,
848,
29889,
3251,
1218,
716,
4733,
1159,
13,
9651,
17927,
29889,
8382,
703,
2451,
29901,
1273,
29879,
613,
851,
29898,
3127,
876,
13,
9651,
736,
7700,
13,
4706,
1583,
29889,
2917,
353,
3564,
29889,
657,
29918,
2917,
580,
13,
4706,
1583,
29889,
11618,
353,
3564,
29871,
396,
10318,
3564,
411,
7160,
1904,
13,
4706,
1583,
29889,
11618,
29889,
978,
353,
1583,
29889,
1853,
13,
4706,
736,
5852,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
2989,
2084,
29922,
8516,
29892,
881,
29918,
1627,
786,
29922,
8824,
1125,
13,
4706,
9995,
16913,
1904,
9995,
13,
4706,
2989,
2084,
353,
2989,
2084,
565,
2989,
2084,
1683,
1583,
29889,
9507,
13,
4706,
565,
881,
29918,
1627,
786,
29901,
13,
9651,
1583,
29889,
1627,
786,
29898,
8159,
2084,
29922,
8159,
2084,
29897,
13,
4706,
17927,
29889,
8382,
703,
29903,
5555,
1904,
29901,
14210,
29879,
29915,
613,
2989,
2084,
29897,
13,
4706,
1583,
29889,
705,
5861,
353,
1583,
29889,
11618,
29889,
657,
29918,
705,
5861,
580,
13,
4706,
1583,
29889,
11618,
29889,
7620,
29898,
8159,
2084,
29897,
13,
13,
1678,
822,
16199,
29898,
1311,
29892,
2989,
2084,
29922,
8516,
1125,
13,
4706,
9995,
7437,
786,
8125,
9995,
13,
4706,
1677,
1445,
353,
2989,
2084,
565,
2989,
2084,
1683,
1583,
29889,
9507,
13,
4706,
16199,
1445,
353,
1677,
1445,
718,
11393,
29890,
29895,
29908,
13,
4706,
17927,
29889,
8382,
703,
5841,
292,
701,
29901,
14210,
29879,
29915,
304,
14210,
29879,
29915,
613,
1677,
1445,
29892,
16199,
1445,
29897,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
1627,
786,
1445,
1125,
13,
9651,
2897,
29889,
5992,
29898,
1627,
786,
1445,
29897,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
12683,
1445,
1125,
13,
9651,
2897,
29889,
1267,
420,
29898,
12683,
1445,
29892,
16199,
1445,
29897,
13,
13,
1678,
822,
3588,
29918,
1397,
4135,
29918,
705,
5861,
29898,
1311,
1125,
13,
4706,
9995,
14806,
25000,
18177,
2066,
304,
4808,
278,
1904,
20159,
9995,
13,
4706,
17927,
29889,
3888,
703,
2528,
292,
1904,
20159,
304,
25000,
18177,
934,
29901,
14210,
29879,
29915,
613,
1583,
29889,
9507,
29897,
13,
4706,
1583,
29889,
11618,
29889,
1359,
29918,
705,
5861,
29898,
1311,
29889,
9507,
29897,
13,
4706,
1583,
29889,
7620,
29898,
9344,
29918,
1627,
786,
29922,
8824,
29897,
13,
4706,
1583,
29889,
11618,
29889,
978,
353,
1583,
29889,
1853,
13,
13,
13,
1990,
4306,
7295,
13,
1678,
9995,
4134,
304,
4808,
278,
1904,
29915,
29879,
1857,
2106,
322,
4469,
3977,
6119,
3829,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1904,
29918,
3972,
29892,
1904,
29918,
978,
29892,
2295,
29918,
3167,
519,
29918,
7076,
29892,
13,
462,
694,
29918,
20756,
29892,
24543,
29886,
549,
29892,
6694,
29918,
3027,
29918,
2311,
1125,
13,
4706,
17927,
29889,
8382,
703,
15514,
5281,
1273,
29879,
29901,
313,
4299,
29918,
3972,
29901,
14210,
29879,
742,
1904,
29918,
978,
29901,
14210,
29879,
742,
376,
13,
462,
268,
376,
2917,
29918,
3167,
519,
29918,
7076,
29901,
14210,
29879,
742,
694,
29918,
20756,
29901,
1273,
29879,
29892,
24543,
29886,
549,
29901,
1273,
29879,
29892,
376,
13,
462,
268,
376,
26495,
29918,
3027,
29918,
2311,
29901,
14210,
29879,
29915,
613,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29892,
1904,
29918,
3972,
29892,
1904,
29918,
978,
29892,
13,
462,
268,
2295,
29918,
3167,
519,
29918,
7076,
29892,
694,
29918,
20756,
29892,
24543,
29886,
549,
29892,
6694,
29918,
3027,
29918,
2311,
29897,
13,
4706,
1583,
29889,
15550,
3950,
353,
18896,
3950,
29889,
657,
29918,
15550,
3950,
703,
3126,
1159,
13,
4706,
10422,
353,
29850,
2403,
3859,
29889,
8875,
1642,
4830,
29898,
4299,
29918,
978,
29892,
1583,
29889,
15550,
3950,
29889,
1062,
29897,
13,
4706,
1583,
29889,
9507,
353,
851,
29898,
4299,
29918,
3972,
847,
10422,
29897,
13,
4706,
1583,
29889,
978,
353,
1904,
29918,
978,
13,
4706,
1583,
29889,
1524,
800,
353,
29871,
29900,
13,
4706,
1583,
29889,
7924,
29918,
1524,
800,
353,
29871,
29900,
13,
4706,
1583,
29889,
26495,
29918,
2311,
353,
6694,
29918,
3027,
29918,
2311,
13,
4706,
1583,
29889,
29879,
10964,
353,
9657,
580,
13,
4706,
1583,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
353,
9657,
580,
13,
4706,
1583,
29889,
2080,
29879,
353,
9657,
580,
13,
4706,
1583,
29889,
2917,
353,
9657,
580,
13,
4706,
1583,
29889,
1359,
29898,
2917,
29918,
3167,
519,
29918,
7076,
29897,
13,
4706,
1583,
29889,
7924,
29918,
333,
353,
1583,
29889,
1482,
29918,
7924,
29918,
333,
580,
13,
4706,
1583,
29889,
3258,
29918,
1482,
29918,
7924,
29898,
1217,
29918,
20756,
29892,
24543,
29886,
549,
29897,
13,
4706,
17927,
29889,
8382,
703,
15514,
1891,
1273,
29879,
29901,
613,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3700,
29918,
845,
11603,
29898,
1311,
1125,
13,
4706,
9995,
7106,
263,
1051,
310,
6087,
3700,
8267,
10970,
9995,
13,
4706,
736,
518,
23583,
29898,
791,
29897,
363,
1820,
29892,
659,
297,
1583,
29889,
2080,
29879,
29889,
7076,
580,
565,
1820,
29889,
27382,
2541,
703,
2161,
13531,
13,
13,
1678,
732,
6799,
13,
1678,
822,
11105,
29918,
845,
11603,
29898,
1311,
1125,
13,
4706,
9995,
7106,
263,
1051,
310,
6087,
11105,
8267,
10970,
9995,
13,
4706,
736,
518,
23583,
29898,
791,
29897,
363,
1820,
29892,
659,
297,
1583,
29889,
2080,
29879,
29889,
7076,
580,
565,
1820,
29889,
27382,
2541,
703,
13168,
13531,
13,
13,
1678,
732,
6799,
13,
1678,
822,
6410,
29918,
7039,
29898,
1311,
1125,
13,
4706,
9995,
7106,
278,
6410,
2983,
363,
445,
4867,
9995,
13,
4706,
736,
1583,
29889,
29879,
10964,
29961,
1311,
29889,
7924,
29918,
333,
29962,
3366,
6758,
29918,
7039,
3108,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1857,
29918,
7924,
29898,
1311,
1125,
13,
4706,
9995,
7106,
278,
1857,
4867,
9657,
9995,
13,
4706,
736,
1583,
29889,
29879,
10964,
29961,
1311,
29889,
7924,
29918,
333,
29962,
13,
13,
1678,
822,
716,
29918,
7924,
29918,
333,
29898,
1311,
1125,
13,
4706,
9995,
7106,
716,
4867,
29918,
333,
9995,
13,
4706,
565,
451,
1583,
29889,
29879,
10964,
29901,
13,
9651,
4867,
29918,
333,
353,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
4867,
29918,
333,
353,
4236,
29898,
524,
29898,
1989,
29897,
363,
1820,
297,
1583,
29889,
29879,
10964,
29889,
8149,
3101,
718,
29871,
29896,
13,
4706,
17927,
29889,
8382,
29898,
7924,
29918,
333,
29897,
13,
4706,
736,
4867,
29918,
333,
13,
13,
1678,
822,
1653,
29918,
1482,
29918,
7924,
29898,
1311,
29892,
694,
29918,
20756,
29892,
24543,
29886,
549,
1125,
13,
4706,
9995,
6204,
263,
716,
4867,
9995,
13,
4706,
17927,
29889,
8382,
703,
9832,
1218,
716,
4867,
29889,
1178,
29901,
1273,
29879,
613,
1583,
29889,
7924,
29918,
333,
29897,
13,
4706,
1583,
29889,
29879,
10964,
29961,
1311,
29889,
7924,
29918,
333,
29962,
353,
8853,
16394,
1115,
931,
29889,
2230,
3285,
13,
462,
462,
3986,
376,
1217,
29918,
20756,
1115,
694,
29918,
20756,
29892,
13,
462,
462,
3986,
376,
15702,
29886,
549,
1115,
24543,
29886,
549,
29892,
13,
462,
462,
3986,
376,
6758,
29918,
7039,
1115,
9657,
3285,
13,
462,
462,
3986,
376,
16175,
2311,
1115,
29871,
29900,
29892,
13,
462,
462,
3986,
376,
1524,
800,
1115,
29871,
29900,
29913,
13,
13,
1678,
822,
788,
29918,
7924,
29918,
6758,
29918,
7039,
29898,
1311,
29892,
2625,
29892,
6410,
29918,
7039,
1125,
13,
4706,
9995,
3462,
278,
4867,
6410,
2983,
304,
278,
21396,
8600,
9995,
13,
4706,
17927,
29889,
8382,
703,
2528,
292,
4867,
6410,
29918,
7039,
29889,
313,
2975,
29901,
14210,
29879,
742,
6410,
29918,
7039,
29901,
1273,
29879,
613,
2625,
29892,
6410,
29918,
7039,
29897,
13,
4706,
1583,
29889,
29879,
10964,
29961,
1311,
29889,
7924,
29918,
333,
29962,
3366,
6758,
29918,
7039,
3108,
29961,
2975,
29962,
353,
6410,
29918,
7039,
13,
13,
1678,
822,
788,
29918,
7924,
29918,
16175,
2311,
29898,
1311,
29892,
9853,
2311,
1125,
13,
4706,
9995,
3462,
278,
4867,
9853,
2311,
304,
278,
21396,
8600,
9995,
13,
4706,
17927,
29889,
8382,
703,
2528,
292,
4867,
9853,
2311,
29901,
1273,
29879,
613,
9853,
2311,
29897,
13,
4706,
1583,
29889,
29879,
10964,
29961,
1311,
29889,
7924,
29918,
333,
29962,
3366,
16175,
2311,
3108,
353,
9853,
2311,
13,
13,
1678,
822,
11924,
29918,
1524,
800,
29898,
1311,
1125,
13,
4706,
9995,
512,
17053,
3001,
322,
4867,
24372,
9995,
13,
4706,
1583,
29889,
1524,
800,
4619,
29871,
29896,
13,
4706,
1583,
29889,
29879,
10964,
29961,
1311,
29889,
7924,
29918,
333,
29962,
3366,
1524,
800,
3108,
4619,
29871,
29896,
13,
13,
1678,
822,
2254,
29898,
1311,
29892,
2295,
29918,
3167,
519,
29918,
7076,
1125,
13,
4706,
9995,
16012,
2106,
934,
9995,
13,
4706,
17927,
29889,
8382,
703,
23456,
4306,
1159,
13,
4706,
1018,
29901,
13,
9651,
411,
1722,
29898,
1311,
29889,
9507,
29892,
376,
6050,
1159,
408,
297,
29886,
29901,
13,
18884,
2106,
353,
1583,
29889,
15550,
3950,
29889,
348,
3034,
23258,
29898,
262,
29886,
29889,
949,
2141,
13808,
703,
9420,
29899,
29947,
5783,
13,
18884,
1583,
29889,
978,
353,
2106,
29889,
657,
703,
978,
613,
1583,
29889,
978,
29897,
13,
18884,
1583,
29889,
29879,
10964,
353,
2106,
29889,
657,
703,
29879,
10964,
613,
9657,
3101,
13,
18884,
1583,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
353,
2106,
29889,
657,
703,
677,
342,
29918,
485,
29887,
29918,
6758,
613,
9657,
3101,
13,
18884,
1583,
29889,
1524,
800,
353,
2106,
29889,
657,
703,
1524,
800,
613,
29871,
29900,
29897,
13,
18884,
1583,
29889,
26495,
29918,
2311,
353,
2106,
29889,
657,
703,
26495,
29918,
2311,
613,
29871,
29906,
29945,
29953,
29897,
13,
18884,
1583,
29889,
2080,
29879,
353,
2106,
29889,
657,
703,
2080,
29879,
613,
9657,
3101,
13,
18884,
1583,
29889,
2917,
353,
2106,
29889,
657,
703,
2917,
613,
9657,
3101,
13,
18884,
17927,
29889,
8382,
703,
29147,
2106,
29901,
1273,
29879,
613,
2106,
29897,
13,
18884,
1583,
29889,
6506,
29918,
2917,
29898,
2917,
29918,
3167,
519,
29918,
7076,
29897,
13,
4706,
5174,
10663,
2392,
408,
4589,
29901,
13,
9651,
17927,
29889,
27392,
703,
3782,
5923,
2106,
934,
1476,
29889,
3251,
1218,
23157,
13,
9651,
17927,
29889,
8382,
703,
5971,
2392,
29901,
1273,
29879,
613,
851,
29898,
3127,
876,
13,
4706,
5174,
4663,
2772,
401,
2392,
408,
4589,
29901,
13,
9651,
17927,
29889,
8382,
703,
7249,
2772,
401,
2392,
29901,
1273,
29879,
29901,
613,
851,
29898,
3127,
876,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
881,
29918,
1627,
786,
29922,
8824,
1125,
13,
4706,
9995,
16913,
12541,
1353,
304,
2106,
934,
9995,
13,
4706,
17927,
29889,
8382,
703,
29903,
5555,
4306,
1159,
13,
4706,
565,
881,
29918,
1627,
786,
29901,
13,
9651,
1583,
29889,
1627,
786,
580,
13,
4706,
1018,
29901,
13,
9651,
411,
1722,
29898,
1311,
29889,
9507,
29892,
376,
29893,
29890,
1159,
408,
714,
29901,
13,
18884,
2106,
353,
8853,
978,
1115,
1583,
29889,
978,
29892,
13,
462,
308,
376,
29879,
10964,
1115,
1583,
29889,
29879,
10964,
29892,
13,
462,
308,
376,
677,
342,
29918,
485,
29887,
29918,
6758,
1115,
1583,
29889,
677,
342,
29918,
485,
29887,
29918,
6758,
29892,
13,
462,
308,
376,
1524,
800,
1115,
1583,
29889,
1524,
800,
29892,
13,
462,
308,
376,
2080,
29879,
1115,
1583,
29889,
2080,
29879,
29892,
13,
462,
308,
376,
26495,
29918,
2311,
1115,
1583,
29889,
26495,
29918,
2311,
29892,
13,
462,
308,
376,
2917,
1115,
903,
25903,
29913,
13,
18884,
2106,
29918,
3126,
353,
1583,
29889,
15550,
3950,
29889,
3034,
23258,
29898,
3859,
29897,
13,
18884,
714,
29889,
3539,
29898,
3859,
29918,
3126,
29889,
12508,
703,
9420,
29899,
29947,
5783,
13,
4706,
5174,
10663,
2392,
408,
4589,
29901,
13,
9651,
17927,
29889,
2704,
703,
2525,
519,
304,
4078,
1904,
2106,
29901,
1273,
29879,
613,
851,
29898,
3127,
29889,
710,
2704,
876,
13,
4706,
17927,
29889,
8382,
703,
29903,
10511,
4306,
1159,
13,
13,
1678,
822,
16199,
29898,
1311,
1125,
13,
4706,
9995,
7437,
786,
2106,
934,
9995,
13,
4706,
1677,
1445,
353,
1583,
29889,
9507,
13,
4706,
16199,
1445,
353,
1677,
1445,
718,
11393,
29890,
29895,
29908,
13,
4706,
17927,
29889,
8382,
703,
5841,
292,
701,
29901,
14210,
29879,
29915,
304,
14210,
29879,
29915,
613,
1677,
1445,
29892,
16199,
1445,
29897,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
1627,
786,
1445,
1125,
13,
9651,
2897,
29889,
5992,
29898,
1627,
786,
1445,
29897,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
12683,
1445,
1125,
13,
9651,
2897,
29889,
1267,
420,
29898,
12683,
1445,
29892,
16199,
1445,
29897,
13,
13,
1678,
822,
5191,
29918,
2917,
29898,
1311,
29892,
2295,
29918,
3167,
519,
29918,
7076,
1125,
13,
4706,
9995,
22108,
278,
7500,
2295,
411,
278,
697,
11122,
2629,
278,
2106,
934,
13,
9651,
5399,
363,
738,
4343,
29922,
8824,
4128,
3620,
322,
1480,
5235,
3620,
13,
4706,
9995,
13,
4706,
5534,
903,
25903,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
10945,
29899,
20788,
13,
4706,
396,
3462,
738,
716,
4452,
304,
2106,
2295,
363,
25000,
11976,
13,
4706,
363,
1820,
29892,
659,
297,
903,
25903,
29889,
7076,
7295,
13,
9651,
565,
1820,
451,
297,
1583,
29889,
2917,
29889,
8149,
7295,
13,
18884,
17927,
29889,
3888,
703,
2528,
292,
716,
2295,
2944,
304,
2106,
934,
29901,
14210,
29879,
2396,
14210,
29879,
29915,
613,
1820,
29892,
659,
29897,
13,
18884,
1583,
29889,
2917,
29961,
1989,
29962,
353,
659,
13,
4706,
1583,
29889,
5504,
29918,
15033,
29918,
2917,
29918,
7076,
29898,
2917,
29918,
3167,
519,
29918,
7076,
29897,
13,
4706,
17927,
29889,
8382,
703,
5612,
433,
3277,
2295,
29889,
8198,
2295,
29901,
1273,
29879,
613,
903,
25903,
29897,
13,
4706,
903,
25903,
353,
1583,
29889,
2917,
13,
4706,
17927,
29889,
8382,
703,
5612,
433,
1133,
2295,
29889,
1570,
2295,
29901,
1273,
29879,
613,
903,
25903,
29897,
13,
4706,
17927,
29889,
3888,
703,
15156,
5285,
7160,
297,
2106,
934,
1159,
13,
13,
1678,
822,
2767,
29918,
15033,
29918,
2917,
29918,
7076,
29898,
1311,
29892,
2295,
29918,
3167,
519,
29918,
7076,
1125,
13,
4706,
9995,
10318,
738,
4128,
607,
526,
451,
4343,
322,
505,
1063,
3939,
9995,
13,
4706,
565,
451,
2295,
29918,
3167,
519,
29918,
7076,
29901,
13,
9651,
17927,
29889,
8382,
703,
3782,
1735,
519,
4128,
505,
1063,
4784,
1159,
13,
9651,
736,
13,
4706,
363,
1820,
29892,
659,
297,
2295,
29918,
3167,
519,
29918,
7076,
29889,
7076,
7295,
13,
9651,
2030,
29918,
791,
353,
1583,
29889,
2917,
29961,
1989,
29962,
13,
9651,
565,
2030,
29918,
791,
1275,
659,
29901,
13,
18884,
6773,
13,
9651,
1583,
29889,
2917,
29961,
1989,
29962,
353,
659,
13,
9651,
17927,
29889,
3888,
703,
3991,
2944,
29901,
14210,
29879,
29915,
756,
1063,
4784,
515,
14210,
29879,
29915,
304,
14210,
29879,
29915,
613,
1820,
29892,
2030,
29918,
791,
29892,
659,
29897,
13,
2
] |
cuberoot_of_a_number.py | matosBrent/PythonScripts | 3 | 142078 | <filename>cuberoot_of_a_number.py
def diff(n, mid) :
if (n > (mid * mid * mid)) :
return (n - (mid * mid * mid))
else :
return ((mid * mid * mid) - n)
# Returns cube root of a no n
def cubicRoot(n) :
# Set start and end for binary
# search
start = 0
end = n
# Set precision
e = 0.0000001
while (True) :
mid = (start + end) / 2
error = diff(n, mid)
# If error is less than e
# then mid is our answer
# so return mid
if (error <= e) :
return mid
# If mid*mid*mid is greater
# than n set end = mid
if ((mid * mid * mid) > n) :
end = mid
# If mid*mid*mid is less
# than n set start = mid
else :
start = mid
# Driver code
n = 3
print("Cubic root of", n, "is",
round(cubicRoot(n),6)) | [
1,
529,
9507,
29958,
29883,
431,
1489,
327,
29918,
974,
29918,
29874,
29918,
4537,
29889,
2272,
13,
1753,
2923,
29898,
29876,
29892,
7145,
29897,
584,
29871,
13,
1678,
565,
313,
29876,
1405,
313,
6563,
334,
7145,
334,
7145,
876,
584,
29871,
13,
4706,
736,
313,
29876,
448,
313,
6563,
334,
7145,
334,
7145,
876,
29871,
13,
1678,
1683,
584,
29871,
13,
4706,
736,
5135,
6563,
334,
7145,
334,
7145,
29897,
448,
302,
29897,
29871,
13,
965,
13,
29937,
16969,
28704,
3876,
310,
263,
694,
302,
29871,
13,
1753,
13630,
293,
10303,
29898,
29876,
29897,
584,
29871,
13,
539,
13,
1678,
396,
3789,
1369,
322,
1095,
363,
7581,
259,
13,
1678,
396,
2740,
29871,
13,
1678,
1369,
353,
29871,
29900,
13,
1678,
1095,
353,
302,
29871,
13,
539,
13,
1678,
396,
3789,
16716,
29871,
13,
1678,
321,
353,
29871,
29900,
29889,
29900,
29900,
29900,
29900,
29900,
29900,
29896,
13,
1678,
1550,
313,
5574,
29897,
584,
29871,
13,
965,
13,
4706,
7145,
353,
313,
2962,
718,
1095,
29897,
847,
29871,
29906,
13,
4706,
1059,
353,
2923,
29898,
29876,
29892,
7145,
29897,
29871,
13,
259,
13,
4706,
396,
960,
1059,
338,
3109,
1135,
321,
259,
13,
4706,
396,
769,
7145,
338,
1749,
1234,
29871,
13,
4706,
396,
577,
736,
7145,
29871,
13,
4706,
565,
313,
2704,
5277,
321,
29897,
584,
29871,
13,
9651,
736,
7145,
29871,
13,
1669,
13,
4706,
396,
960,
7145,
29930,
6563,
29930,
6563,
338,
7621,
29871,
13,
4706,
396,
1135,
302,
731,
1095,
353,
7145,
29871,
13,
4706,
565,
5135,
6563,
334,
7145,
334,
7145,
29897,
1405,
302,
29897,
584,
29871,
13,
9651,
1095,
353,
7145,
29871,
13,
1669,
13,
4706,
396,
960,
7145,
29930,
6563,
29930,
6563,
338,
3109,
259,
13,
4706,
396,
1135,
302,
731,
1369,
353,
7145,
29871,
13,
4706,
1683,
584,
29871,
13,
9651,
1369,
353,
7145,
29871,
13,
1669,
13,
29937,
26391,
775,
29871,
13,
29876,
353,
29871,
29941,
13,
2158,
703,
29907,
431,
293,
3876,
310,
613,
302,
29892,
376,
275,
613,
259,
13,
418,
4513,
29898,
29883,
431,
293,
10303,
29898,
29876,
511,
29953,
876,
2
] |
protonets/config.py | filangelos/protonets | 2 | 76336 | import os
import yaml
class Config(object):
"""Script configuration file parser.
Attributes
----------
dataset: str
Name of the dataset to train on (i.e., 'omniglot').
num_epochs: int
Number of training epochs.
num_episodes: int
Number of episodes per epoch.
num_ways_train: int
Number of random classes per episode for training.
num_support_train: int
Number of samples per class to use as support for training.
num_query_train: int
Number of samples per class to use as query for training.
num_ways_val: int
Number of random classes per episode for validation.
num_support_val: int
Number of samples per class to use as support for validation.
num_query_val: int
Number of samples per class to use as query for validation.
seed: int
Random seed.
"""
def __init__(self, config_yaml: str) -> None:
if not os.path.exists(config_yaml):
raise ValueError(
f"The config file at {config_yaml} is missing.")
config = yaml.load(open(config_yaml, "r"))
self.dataset = config["dataset"]
self.num_epochs = config.get("num_epochs", 100)
self.num_episodes = config.get("num_episodes", 100)
self.num_ways_train = config.get("num_ways_train", 60)
self.num_support_train = config.get("num_support_train", 5)
self.num_query_train = config.get("num_query_train", 5)
self.num_ways_val = config.get("num_ways_val", 5)
self.num_support_val = config.get("num_support_val", 5)
self.num_query_val = config.get("num_query_val", 15)
self.seed = config.get("seed", 0)
| [
1,
1053,
2897,
13,
5215,
343,
8807,
13,
13,
13,
1990,
12782,
29898,
3318,
1125,
13,
1678,
9995,
4081,
5285,
934,
13812,
29889,
13,
13,
1678,
6212,
5026,
13,
1678,
448,
1378,
29899,
13,
1678,
8783,
29901,
851,
13,
4706,
4408,
310,
278,
8783,
304,
7945,
373,
313,
29875,
29889,
29872,
1696,
525,
290,
22234,
8276,
2824,
13,
1678,
954,
29918,
1022,
2878,
29879,
29901,
938,
13,
4706,
9681,
310,
6694,
21502,
12168,
29889,
13,
1678,
954,
29918,
1022,
275,
2631,
29901,
938,
13,
4706,
9681,
310,
23238,
639,
21502,
305,
29889,
13,
1678,
954,
29918,
1994,
29918,
14968,
29901,
938,
13,
4706,
9681,
310,
4036,
4413,
639,
12720,
363,
6694,
29889,
13,
1678,
954,
29918,
5924,
29918,
14968,
29901,
938,
13,
4706,
9681,
310,
11916,
639,
770,
304,
671,
408,
2304,
363,
6694,
29889,
13,
1678,
954,
29918,
1972,
29918,
14968,
29901,
938,
13,
4706,
9681,
310,
11916,
639,
770,
304,
671,
408,
2346,
363,
6694,
29889,
13,
1678,
954,
29918,
1994,
29918,
791,
29901,
938,
13,
4706,
9681,
310,
4036,
4413,
639,
12720,
363,
8845,
29889,
13,
1678,
954,
29918,
5924,
29918,
791,
29901,
938,
13,
4706,
9681,
310,
11916,
639,
770,
304,
671,
408,
2304,
363,
8845,
29889,
13,
1678,
954,
29918,
1972,
29918,
791,
29901,
938,
13,
4706,
9681,
310,
11916,
639,
770,
304,
671,
408,
2346,
363,
8845,
29889,
13,
1678,
16717,
29901,
938,
13,
4706,
16968,
16717,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2295,
29918,
25162,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
2917,
29918,
25162,
1125,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
285,
29908,
1576,
2295,
934,
472,
426,
2917,
29918,
25162,
29913,
338,
4567,
23157,
13,
4706,
2295,
353,
343,
8807,
29889,
1359,
29898,
3150,
29898,
2917,
29918,
25162,
29892,
376,
29878,
5783,
13,
4706,
1583,
29889,
24713,
353,
2295,
3366,
24713,
3108,
13,
4706,
1583,
29889,
1949,
29918,
1022,
2878,
29879,
353,
2295,
29889,
657,
703,
1949,
29918,
1022,
2878,
29879,
613,
29871,
29896,
29900,
29900,
29897,
13,
4706,
1583,
29889,
1949,
29918,
1022,
275,
2631,
353,
2295,
29889,
657,
703,
1949,
29918,
1022,
275,
2631,
613,
29871,
29896,
29900,
29900,
29897,
13,
4706,
1583,
29889,
1949,
29918,
1994,
29918,
14968,
353,
2295,
29889,
657,
703,
1949,
29918,
1994,
29918,
14968,
613,
29871,
29953,
29900,
29897,
13,
4706,
1583,
29889,
1949,
29918,
5924,
29918,
14968,
353,
2295,
29889,
657,
703,
1949,
29918,
5924,
29918,
14968,
613,
29871,
29945,
29897,
13,
4706,
1583,
29889,
1949,
29918,
1972,
29918,
14968,
353,
2295,
29889,
657,
703,
1949,
29918,
1972,
29918,
14968,
613,
29871,
29945,
29897,
13,
4706,
1583,
29889,
1949,
29918,
1994,
29918,
791,
353,
2295,
29889,
657,
703,
1949,
29918,
1994,
29918,
791,
613,
29871,
29945,
29897,
13,
4706,
1583,
29889,
1949,
29918,
5924,
29918,
791,
353,
2295,
29889,
657,
703,
1949,
29918,
5924,
29918,
791,
613,
29871,
29945,
29897,
13,
4706,
1583,
29889,
1949,
29918,
1972,
29918,
791,
353,
2295,
29889,
657,
703,
1949,
29918,
1972,
29918,
791,
613,
29871,
29896,
29945,
29897,
13,
4706,
1583,
29889,
26776,
353,
2295,
29889,
657,
703,
26776,
613,
29871,
29900,
29897,
13,
2
] |
scripts/ingest.py | adjspecies/sfdata | 1 | 170589 | import beautifulsoup4
import cookielib
import mechanize
br = mechanize.Browser()
jar = cookielib.LWPCookieJar()
br.set_cookiejar(jar)
br.set_handle_equiv( True )
br.set_handle_gzip( True )
br.set_handle_redirect( True )
br.set_handle_referer( True )
br.set_handle_robots( False )
| [
1,
1053,
9560,
29879,
1132,
29946,
13,
5215,
7984,
709,
747,
13,
5215,
7208,
675,
13,
13,
13,
1182,
353,
7208,
675,
29889,
21537,
580,
13,
4758,
353,
7984,
709,
747,
29889,
29931,
29956,
9026,
2550,
347,
29967,
279,
580,
13,
1182,
29889,
842,
29918,
21509,
4758,
29898,
4758,
29897,
13,
13,
1182,
29889,
842,
29918,
8411,
29918,
9402,
29898,
5852,
1723,
29871,
13,
1182,
29889,
842,
29918,
8411,
29918,
29887,
7554,
29898,
5852,
1723,
29871,
13,
1182,
29889,
842,
29918,
8411,
29918,
17886,
29898,
5852,
1723,
29871,
13,
1182,
29889,
842,
29918,
8411,
29918,
20275,
261,
29898,
5852,
1723,
29871,
13,
1182,
29889,
842,
29918,
8411,
29918,
13716,
1862,
29898,
7700,
1723,
29871,
13,
13,
13,
2
] |
polling_stations/apps/data_collection/management/commands/import_torbay.py | chris48s/UK-Polling-Stations | 0 | 24 | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E06000027'
addresses_name = 'parl.2017-06-08/Version 1/Torbay Democracy_Club__08June2017.tsv'
stations_name = 'parl.2017-06-08/Version 1/Torbay Democracy_Club__08June2017.tsv'
elections = ['parl.2017-06-08']
csv_delimiter = '\t'
| [
1,
515,
848,
29918,
10855,
29889,
21895,
29889,
26381,
1053,
7399,
29990,
2139,
29928,
331,
25804,
6821,
431,
29907,
4501,
24192,
9555,
13,
13,
1990,
10516,
29898,
5160,
29990,
2139,
29928,
331,
25804,
6821,
431,
29907,
4501,
24192,
9555,
1125,
13,
1678,
18701,
29918,
333,
353,
525,
29923,
29900,
29953,
29900,
29900,
29900,
29900,
29906,
29955,
29915,
13,
1678,
14157,
29918,
978,
353,
525,
862,
29880,
29889,
29906,
29900,
29896,
29955,
29899,
29900,
29953,
29899,
29900,
29947,
29914,
6594,
29871,
29896,
29914,
29911,
11831,
388,
4432,
25804,
29918,
6821,
431,
1649,
29900,
29947,
29967,
1540,
29906,
29900,
29896,
29955,
29889,
1372,
29894,
29915,
13,
1678,
16355,
29918,
978,
353,
525,
862,
29880,
29889,
29906,
29900,
29896,
29955,
29899,
29900,
29953,
29899,
29900,
29947,
29914,
6594,
29871,
29896,
29914,
29911,
11831,
388,
4432,
25804,
29918,
6821,
431,
1649,
29900,
29947,
29967,
1540,
29906,
29900,
29896,
29955,
29889,
1372,
29894,
29915,
13,
1678,
20209,
353,
6024,
862,
29880,
29889,
29906,
29900,
29896,
29955,
29899,
29900,
29953,
29899,
29900,
29947,
2033,
13,
1678,
11799,
29918,
6144,
19657,
353,
11297,
29873,
29915,
13,
2
] |
cinder/volume/drivers/violin/v6000_common.py | rlucio/cinder-violin-driver-icehouse | 0 | 183302 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# 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.
"""
Violin Memory 6000 Series All-Flash Array Common Driver for Openstack Cinder
Uses Violin REST API via XG-Tools to manage a standard V6000 series
flash array to provide network block-storage services.
by <NAME>
Senior Software Engineer
Violin Memory
"""
import re
import time
from oslo.config import cfg
from cinder import context
from cinder import exception
from cinder.openstack.common import log as logging
from cinder import utils
from cinder.volume.drivers.san import san
from cinder.volume import volume_types
LOG = logging.getLogger(__name__)
# support vmos versions V6.3.0.4 or newer
# support vmos versions V6.3.1 or newer
VMOS_SUPPORTED_VERSION_PATTERNS = ['V6.3.0.[4-9]', 'V6.3.[1-9].?[0-9]?']
try:
import vxg
except ImportError:
LOG.exception(
_("The Violin V6000 driver for Cinder requires the presence of "
"the Violin 'XG-Tools', python libraries for facilitating "
"communication between applications and the v6000 XML API. "
"The libraries can be downloaded from the Violin Memory "
"support website at http://www.violin-memory.com/support"))
raise
else:
LOG.info(_("Running with xg-tools version: %s"), vxg.__version__)
violin_opts = [
cfg.StrOpt('gateway_vip',
default='',
help='IP address or hostname of the v6000 master VIP'),
cfg.StrOpt('gateway_mga',
default='',
help='IP address or hostname of mg-a'),
cfg.StrOpt('gateway_mgb',
default='',
help='IP address or hostname of mg-b'),
cfg.StrOpt('gateway_user',
default='admin',
help='User name for connecting to the Memory Gateway'),
cfg.StrOpt('gateway_password',
default='',
help='User name for connecting to the Memory Gateway',
secret=True),
cfg.BoolOpt('use_igroups',
default=False,
help='Use igroups to manage targets and initiators'),
cfg.BoolOpt('use_thin_luns',
default=False,
help='Use thin luns instead of thick luns'), ]
CONF = cfg.CONF
CONF.register_opts(violin_opts)
class InvalidBackendConfig(exception.CinderException):
message = _("Volume backend config is invalid: %(reason)s")
class RequestRetryTimeout(exception.CinderException):
message = _("Backend service retry timeout hit: %(timeout)s sec")
class ViolinBackendErr(exception.CinderException):
message = _("Backend reports: %(message)s")
class ViolinBackendErrExists(exception.CinderException):
message = _("Backend reports: item already exists")
class ViolinBackendErrNotFound(exception.CinderException):
message = _("Backend reports: item not found")
class V6000CommonDriver(san.SanDriver):
"""Executes commands relating to Violin Memory Arrays."""
def __init__(self, *args, **kwargs):
super(V6000CommonDriver, self).__init__(*args, **kwargs)
self.request_timeout = 300
self.vmem_vip = None
self.vmem_mga = None
self.vmem_mgb = None
self.container = ""
self.stats = {}
self.config = kwargs.get('configuration', None)
self.context = None
self.lun_tracker = LunIdList(self.db)
if self.config:
self.config.append_config_values(violin_opts)
def do_setup(self, context):
"""Any initialization the driver does while starting."""
if not self.config.gateway_vip:
raise exception.InvalidInput(
reason=_('Gateway VIP is not set'))
if not self.config.gateway_mga:
raise exception.InvalidInput(
reason=_('Gateway IP for mg-a is not set'))
if not self.config.gateway_mgb:
raise exception.InvalidInput(
reason=_('Gateway IP for mg-b is not set'))
self.vmem_vip = vxg.open(self.config.gateway_vip,
self.config.gateway_user,
self.config.gateway_password,
keepalive=True)
self.vmem_mga = vxg.open(self.config.gateway_mga,
self.config.gateway_user,
self.config.gateway_password,
keepalive=True)
self.vmem_mgb = vxg.open(self.config.gateway_mgb,
self.config.gateway_user,
self.config.gateway_password,
keepalive=True)
self.context = context
vip = self.vmem_vip.basic
ret_dict = vip.get_node_values("/vshare/state/local/container/*")
if ret_dict:
self.container = ret_dict.items()[0][1]
ret_dict = vip.get_node_values(
"/vshare/state/local/container/%s/lun/*"
% self.container)
if ret_dict:
self.lun_tracker.update_from_volume_ids(ret_dict.values())
ret_dict = vip.get_node_values(
"/vshare/state/snapshot/container/%s/lun/*"
% self.container)
if ret_dict:
for vol_id in ret_dict.values():
snaps = vip.get_node_values(
"/vshare/state/snapshot/container/%s/lun/%s/snap/*"
% (self.container, vol_id))
self.lun_tracker.update_from_snapshot_ids(snaps.values())
def check_for_setup_error(self):
"""Returns an error if prerequisites aren't met."""
vip = self.vmem_vip.basic
if len(self.container) == 0:
raise InvalidBackendConfig(reason=_('container is missing'))
if not self._is_supported_vmos_version(self.vmem_vip.version):
msg = _('VMOS version is not supported')
raise InvalidBackendConfig(reason=msg)
bn1 = ("/vshare/state/local/container/%s/threshold/usedspace"
"/threshold_hard_val" % self.container)
bn2 = ("/vshare/state/local/container/%s/threshold/provision"
"/threshold_hard_val" % self.container)
ret_dict = vip.get_node_values([bn1, bn2])
for node in ret_dict:
# The infrastructure does not support space reclamation so
# ensure it is disabled. When used space exceeds the hard
# limit, snapshot space reclamation begins. Default is 0
# => no space reclamation.
#
if node.endswith('/usedspace/threshold_hard_val'):
if ret_dict[node] != 0:
msg = _('space reclamation threshold is enabled')
raise InvalidBackendConfig(reason=msg)
# The infrastructure does not support overprovisioning so
# ensure it is disabled. When provisioned space exceeds
# the hard limit, further provisioning is stopped.
# Default is 100 => provisioned space equals usable space.
#
elif node.endswith('/provision/threshold_hard_val'):
if ret_dict[node] != 100:
msg = _('provisioned space threshold not equal to '
'usable space')
raise InvalidBackendConfig(reason=msg)
def create_volume(self, volume):
"""Creates a volume."""
self._create_lun(volume)
def delete_volume(self, volume):
"""Deletes a volume."""
self._delete_lun(volume)
def create_snapshot(self, snapshot):
"""Creates a snapshot from an existing volume."""
self._create_lun_snapshot(snapshot)
def delete_snapshot(self, snapshot):
"""Deletes a snapshot."""
self._delete_lun_snapshot(snapshot)
def create_volume_from_snapshot(self, volume, snapshot):
"""Creates a volume from a snapshot."""
snapshot['size'] = snapshot['volume']['size']
self._create_lun(volume)
self.copy_volume_data(self.context, snapshot, volume)
def create_cloned_volume(self, volume, src_vref):
"""Creates a full clone of the specified volume."""
self._create_lun(volume)
self.copy_volume_data(self.context, src_vref, volume)
def extend_volume(self, volume, new_size):
"""Extend an existing volume's size.
The equivalent CLI command is "lun resize container
<container_name> name <lun_name> size <gb>"
Arguments:
volume -- volume object provided by the Manager
new_size -- new (increased) size in GB to be applied
"""
v = self.vmem_vip
LOG.info(_("Extending lun %(id)s, from %(size)s to %(new_size)s GB") %
{'id': volume['id'], 'size': volume['size'],
'new_size': new_size})
try:
self._send_cmd(v.lun.resize_lun, 'Success',
self.container, volume['id'], new_size)
except Exception:
LOG.exception(_("LUN extend failed!"))
raise
@utils.synchronized('vmem-lun')
def _create_lun(self, volume):
"""Creates a new lun.
The equivalent CLI command is "lun create container
<container_name> name <lun_name> size <gb>"
Arguments:
volume -- volume object provided by the Manager
"""
lun_type = '0'
v = self.vmem_vip
LOG.info(_("Creating lun %(name)s, %(size)s GB") % volume)
if self.config.use_thin_luns:
lun_type = '1'
# using the defaults for fields: quantity, nozero,
# readonly, startnum, blksize, naca, alua, preferredport
#
try:
self._send_cmd(v.lun.create_lun,
'LUN create: success!',
self.container, volume['id'],
volume['size'], 1, '0', lun_type, 'w',
1, 512, False, False, None)
except ViolinBackendErrExists:
LOG.info(_("Lun %s already exists, continuing"), volume['id'])
except Exception:
LOG.warn(_("Lun create failed!"))
raise
@utils.synchronized('vmem-lun')
def _delete_lun(self, volume):
"""Deletes a lun.
The equivalent CLI command is "no lun create container
<container_name> name <lun_name>"
Arguments:
volume -- volume object provided by the Manager
"""
v = self.vmem_vip
success_msgs = ['lun deletion started', '']
LOG.info(_("Deleting lun %s"), volume['id'])
try:
self._send_cmd(v.lun.bulk_delete_luns,
success_msgs,
self.container, volume['id'])
except ViolinBackendErrNotFound:
LOG.info(_("Lun %s already deleted, continuing"), volume['id'])
except ViolinBackendErrExists:
LOG.warn(_("Lun %s has dependent snapshots, skipping"),
volume['id'])
raise exception.VolumeIsBusy(volume_name=volume['id'])
except Exception:
LOG.exception(_("Lun delete failed!"))
raise
self.lun_tracker.free_lun_id_for_volume(volume)
@utils.synchronized('vmem-snap')
def _create_lun_snapshot(self, snapshot):
"""Creates a new snapshot for a lun.
The equivalent CLI command is "snapshot create container
<container> lun <volume_name> name <snapshot_name>"
Arguments:
snapshot -- snapshot object provided by the Manager
"""
v = self.vmem_vip
LOG.info(_("Creating snapshot %s"), snapshot['id'])
try:
self._send_cmd(v.snapshot.create_lun_snapshot,
'Snapshot create: success!',
self.container, snapshot['volume_id'],
snapshot['id'])
except ViolinBackendErrExists:
LOG.info(_("Snapshot %s already exists, continuing"),
snapshot['id'])
except Exception:
LOG.exception(_("LUN snapshot create failed!"))
raise
@utils.synchronized('vmem-snap')
def _delete_lun_snapshot(self, snapshot):
"""Deletes an existing snapshot for a lun.
The equivalent CLI command is "no snapshot create container
<container> lun <volume_name> name <snapshot_name>"
Arguments:
snapshot -- snapshot object provided by the Manager
"""
v = self.vmem_vip
LOG.info(_("Deleting snapshot %s"), snapshot['id'])
try:
self._send_cmd(v.snapshot.delete_lun_snapshot,
'Snapshot delete: success!',
self.container, snapshot['volume_id'],
snapshot['id'])
except ViolinBackendErrNotFound:
LOG.info(_("Snapshot %s already deleted, continuing"),
snapshot['id'])
except Exception:
LOG.exception(_("LUN snapshot delete failed!"))
raise
self.lun_tracker.free_lun_id_for_snapshot(snapshot)
def _send_cmd(self, request_func, success_msgs, *args):
"""Run an XG request function, and retry until the request
returns a success message, a failure message, or the global
request timeout is hit.
This wrapper is meant to deal with backend requests that can
fail for any variety of reasons, for instance, when the system
is already busy handling other LUN requests. It is also smart
enough to give up if clustering is down (eg no HA available),
there is no space left, or other "fatal" errors are returned
(see _fatal_error_code() for a list of all known error
conditions).
Arguments:
request_func -- XG api method to call
success_msgs -- Success messages expected from the backend
*args -- argument array to be passed to the request_func
Returns:
The response dict from the last XG call.
"""
resp = {}
start = time.time()
done = False
if isinstance(success_msgs, basestring):
success_msgs = [success_msgs]
while not done:
if time.time() - start >= self.request_timeout:
raise RequestRetryTimeout(timeout=self.request_timeout)
resp = request_func(*args)
if not resp['message']:
# XG requests will return None for a message if no message
# string is passed int the raw response
resp['message'] = ''
for msg in success_msgs:
if not resp['code'] and msg in resp['message']:
done = True
break
self._fatal_error_code(resp)
return resp
def _send_cmd_and_verify(self, request_func, verify_func,
request_success_msgs='', rargs=[], vargs=[]):
"""Run an XG request function, and verify success using an
additional verify function. If the verification fails, then
retry the request/verify cycle until both functions are
successful, the request function returns a failure message, or
the global request timeout is hit.
This wrapper is meant to deal with backend requests that can
fail for any variety of reasons, for instance, when the system
is already busy handling other LUN requests. It is also smart
enough to give up if clustering is down (eg no HA available),
there is no space left, or other "fatal" errors are returned
(see _fatal_error_code() for a list of all known error
conditions).
Arguments:
request_func -- XG api method to call
verify_func -- function to call to verify request was
completed successfully (eg for export)
request_success_msg -- Success message expected from the backend
for the request_func
*rargs -- argument array to be passed to the
request_func
*vargs -- argument array to be passed to the
verify_func
Returns:
The response dict from the last XG call.
"""
resp = {}
start = time.time()
request_needed = True
verify_needed = True
if isinstance(request_success_msgs, basestring):
request_success_msgs = [request_success_msgs]
while request_needed or verify_needed:
if time.time() - start >= self.request_timeout:
raise RequestRetryTimeout(timeout=self.request_timeout)
if request_needed:
resp = request_func(*rargs)
if not resp['message']:
# XG requests will return None for a message if no message
# string is passed int the raw response
resp['message'] = ''
for msg in request_success_msgs:
if not resp['code'] and msg in resp['message']:
# XG request func was completed
request_needed = False
break
self._fatal_error_code(resp)
elif verify_needed:
success = verify_func(*vargs)
if success:
# XG verify func was completed
verify_needed = False
else:
# try sending the request again
request_needed = True
return resp
def _get_igroup(self, volume, connector):
"""Gets the igroup that should be used when configuring a volume.
Arguments:
volume -- volume object used to determine the igroup name
Returns:
igroup_name -- name of igroup (for configuring targets &
initiators)
"""
v = self.vmem_vip
# Use the connector's primary hostname and use that as the
# name of the igroup. The name must follow syntax rules
# required by the array: "must contain only alphanumeric
# characters, dashes, and underscores. The first character
# must be alphanumeric".
#
igroup_name = re.sub(r'[\W]', '_', connector['host'])
# verify that the igroup has been created on the backend, and
# if it doesn't exist, create it!
#
bn = "/vshare/config/igroup/%s" % igroup_name
resp = v.basic.get_node_values(bn)
if not len(resp):
v.igroup.create_igroup(igroup_name)
return igroup_name
def _get_volume_type_extra_spec(self, volume, spec_key):
"""Parse data stored in a volume_type's extra_specs table.
Code adapted from examples in
cinder/volume/drivers/solidfire.py and
cinder/openstack/common/scheduler/filters/capabilities_filter.py.
Arguments:
volume -- volume object containing volume_type to query
spec_key -- the metadata key to search for
Returns:
spec_value -- string value associated with spec_key
"""
spec_value = None
ctxt = context.get_admin_context()
typeid = volume['volume_type_id']
if typeid:
volume_type = volume_types.get_volume_type(ctxt, typeid)
volume_specs = volume_type.get('extra_specs')
for key, val in volume_specs.iteritems():
# Havana release altered extra_specs to require a
# prefix on all non-host-capability related extra
# specs, so that prefix is stripped here before
# checking the key.
#
if ':' in key:
scope = key.split(':')
key = scope[1]
if key == spec_key:
spec_value = val
break
return spec_value
def _wait_for_exportstate(self, volume_name, state=False):
"""Polls backend to verify volume's export configuration.
XG sets/queries following a request to create or delete a lun
export may fail on the backend if vshared is still processing
the export action (or times out). We can check whether it is
done by polling the export binding for a lun to ensure it is
created or deleted.
This function will try to verify the creation or removal of
export state on both gateway nodes of the array every 5
seconds for up to 30 seconds.
Arguments:
volume_name -- name of volume to be polled
state -- True to poll for existence, False for lack of
Returns:
True if the export state was correctly added or removed
(depending on 'state' param)
"""
status = [False, False]
mg_conns = [self.vmem_mga.basic, self.vmem_mgb.basic]
success = False
bn = "/vshare/config/export/container/%s/lun/%s" \
% (self.container, volume_name)
for i in xrange(6):
for node_id in xrange(2):
if not status[node_id]:
resp = mg_conns[node_id].get_node_values(bn)
if state and len(resp.keys()):
status[node_id] = True
elif (not state) and (not len(resp.keys())):
status[node_id] = True
if status[0] and status[1]:
success = True
break
else:
time.sleep(5)
return success
def _is_supported_vmos_version(self, version_string):
"""Check that the version of VMOS running on the gateways is
valid for use with the OpenStack drivers."""
for pattern in VMOS_SUPPORTED_VERSION_PATTERNS:
if re.match(pattern, version_string):
LOG.debug("Verified VMOS version %s is supported" %
version_string)
return True
return False
def _fatal_error_code(self, response):
"""Check the error code in a XG response for a fatal error,
and returns an appropriate exception. Error codes extracted
from vdmd_mgmt.c.
Arguments:
response -- a response dict result from an XG request
"""
# known non-fatal response codes
#
retry_codes = {1024: 'lun deletion in progress, try again later',
14032: 'lc_err_lock_busy'}
if response['code'] == 14000:
# lc_generic_error
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14002:
# lc_err_assertion_failed
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14004:
# lc_err_not_found
raise ViolinBackendErrNotFound()
elif response['code'] == 14005:
# lc_err_exists
raise ViolinBackendErrExists()
elif response['code'] == 14008:
# lc_err_unexpected_arg
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14014:
# lc_err_io_error
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14016:
# lc_err_io_closed
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14017:
# lc_err_io_timeout
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14021:
# lc_err_unexpected_case
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14025:
# lc_err_no_fs_space
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14035:
# lc_err_range
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14036:
# lc_err_invalid_param
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 14121:
# lc_err_cancelled_err
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 512:
# Not enough free space in container (vdmd bug)
raise ViolinBackendErr(message=response['message'])
elif response['code'] == 1 and 'LUN ID conflict' \
in response['message']:
# lun id conflict while attempting to export
raise ViolinBackendErr(message=response['message'])
class LunIdList(object):
"""Tracks available lun_ids for use when exporting a new lun for the
first time. After instantiating a new LunIdList object, it should
be updated (basically quiescing volumes/snapshot lun ID allocation
between the array and the corresponding Openstack DB metadata).
After that, the object can be queried to capture the next
'available' lun ID for use with exporting a new volume or
snapshot. Only when the volume/snapshot is deleted entirely, the
lun ID should be freed.
Lun IDs are montonically increasing up to a max value of 16k,
after which the selection will loop around to lun ID 1 and will
continue to increment until an available ID is found.
"""
def __init__(self, db, *args, **kwargs):
self.max_lun_id = 16000
self.lun_id_list = [0] * self.max_lun_id
self.lun_id_list[0] = 1
self.prev_index = 1
self.free_index = 1
self.context = context.get_admin_context()
self.db = db
def update_from_volume_ids(self, id_list=[]):
"""Walk a list of volumes collected that the array knows about and
check for any saved lun_id metadata for each of those volumes to
fully sync the list. Note that the metadata keys are stored as
strings.
Arguments:
id_list -- array containing names of volumes that exist on the
backend (volume 'names' are UUIDs if they were made
via the VMEM driver API)
"""
for item in id_list:
try:
metadata = self.db.volume_metadata_get(self.context, item)
except exception.VolumeNotFound:
LOG.warn(_("No db state for lun %s, skipping lun_id update"),
item)
else:
if metadata and 'lun_id' in metadata:
index = int(metadata['lun_id'])
self.lun_id_list[index] = 1
LOG.debug("Set lun_id=%d for volume_id=%s" % (index, item))
self.update_free_index(index)
def update_from_snapshot_ids(self, id_list=[]):
"""Walk a list of snapshots collected that the array knows about and
check for any saved lun_id metadata for each of those snapshots to
fully sync the list. Note that the metadata keys are stored as
strings.
Arguments:
id_list -- array containing names of snapshots that exist on the
backend (snapshot 'names' are UUIDs if they were made
via the VMEM driver API)
"""
for item in id_list:
try:
metadata = self.db.snapshot_metadata_get(self.context, item)
except exception.SnapshotNotFound:
LOG.warn(_("No db state for snap %s, skipping lun_id update"),
item)
else:
if metadata and 'lun_id' in metadata:
index = int(metadata['lun_id'])
self.lun_id_list[index] = 1
LOG.debug("Set lun_id=%d for snapshot_id=%s" %
(index, item))
self.update_free_index(index)
def get_lun_id_for_volume(self, volume):
"""Allocate a free a lun ID to a volume and create a lun_id tag
in the volume's metadata.
Arguments:
volume -- the volume object to allocate a lun_id to
"""
metadata = self.db.volume_metadata_get(self.context, volume['id'])
if not metadata or 'lun_id' not in metadata:
metadata = {}
metadata['lun_id'] = self.get_next_lun_id_str()
self.db.volume_metadata_update(self.context, volume['id'],
metadata, False)
LOG.debug("Assigned lun_id %s to volume %s" %
(metadata['lun_id'], volume['id']))
return metadata['lun_id']
def get_lun_id_for_snapshot(self, snapshot):
"""Allocate a free a lun ID to a snapshot and create a lun_id tag
in the snapshot's metadata.
Arguments:
snapshot -- the snapshot object to allocate a lun_id to
"""
metadata = self.db.snapshot_metadata_get(self.context, snapshot['id'])
if not metadata or 'lun_id' not in metadata:
metadata = {}
metadata['lun_id'] = self.get_next_lun_id_str()
self.db.snapshot_metadata_update(self.context, snapshot['id'],
metadata, False)
LOG.debug("Assigned lun_id %s to volume %s" %
(metadata['lun_id'], snapshot['id']))
return metadata['lun_id']
def free_lun_id_for_volume(self, volume):
"""Remove the lun_id tag saved in the volume's metadata and
free the lun ID in the internal tracking array.
Arguments:
volume -- the volume object with a lun ID to be free'd
"""
metadata = self.db.volume_metadata_get(self.context, volume['id'])
if metadata and 'lun_id' in metadata:
self.free_lun_id_str(metadata['lun_id'])
def free_lun_id_for_snapshot(self, snapshot):
"""Remove the lun_id tag saved in the snapshot's metadata and
free the lun ID in the internal tracking array.
Arguments:
snapshot -- the snapshot object with a lun ID to be free'd
"""
metadata = self.db.snapshot_metadata_get(self.context, snapshot['id'])
if metadata and 'lun_id' in metadata:
self.free_lun_id_str(metadata['lun_id'])
def get_next_lun_id_str(self):
"""Mark the next available lun_id as allocated and return
it to the caller.
Returns:
next_id -- the lun ID that being allocated to the caller
"""
next_id = self.free_index
self.lun_id_list[next_id] = 1
self.update_free_index()
return str(next_id)
def free_lun_id_str(self, value_str):
"""Mark a lun_id as now available, as if the lun was de-allocated.
Arguments:
value_str -- lun ID to free (in string format)
"""
value = int(value_str)
self.lun_id_list[value] = 0
self.update_free_index()
def update_free_index(self, index=None):
"""Update the free index, monotonically increasing, and
looping back to 1 after the max lun ID value is hit.
Arguments:
index -- assume that all values below this number may be already
allocated, so start searching at that value if it is
higher than the free_index
"""
i = 0
count = 0
max_size = len(self.lun_id_list)
if index and index > self.free_index:
i = index + 1
else:
i = self.free_index
# avoid possibility of indexError
if i >= max_size:
i = 1
while self.lun_id_list[i] == 1 and count < max_size:
count += 1
i += 1
if i >= max_size:
i = 1
self.free_index = i
if count == max_size:
raise exception.Error("Cannot find free lun_id, giving up!")
| [
1,
396,
325,
326,
29901,
4434,
9847,
29922,
29946,
9500,
2103,
29922,
29946,
4964,
3891,
9847,
29922,
29946,
13,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29946,
10630,
22878,
18914,
29892,
9266,
29889,
13,
29937,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
13,
29937,
1678,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
887,
1122,
4017,
13,
29937,
1678,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
308,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
1678,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
1678,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
13,
29937,
1678,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
13,
29937,
1678,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1678,
1090,
278,
19245,
29889,
13,
13,
15945,
29908,
13,
29963,
29875,
22878,
18914,
29871,
29953,
29900,
29900,
29900,
10488,
2178,
29899,
8754,
1161,
4398,
13103,
26391,
363,
4673,
1429,
315,
4995,
13,
13,
15922,
267,
10630,
22878,
16759,
3450,
3025,
1060,
29954,
29899,
24183,
304,
10933,
263,
3918,
478,
29953,
29900,
29900,
29900,
3652,
13,
28041,
1409,
304,
3867,
3564,
2908,
29899,
12925,
5786,
29889,
13,
13,
1609,
529,
5813,
29958,
13,
29903,
264,
1611,
18540,
10863,
261,
13,
29963,
29875,
22878,
18914,
13,
15945,
29908,
13,
13,
5215,
337,
13,
5215,
931,
13,
13,
3166,
2897,
417,
29889,
2917,
1053,
274,
16434,
13,
13,
3166,
274,
4995,
1053,
3030,
13,
3166,
274,
4995,
1053,
3682,
13,
3166,
274,
4995,
29889,
3150,
1429,
29889,
9435,
1053,
1480,
408,
12183,
13,
3166,
274,
4995,
1053,
3667,
29879,
13,
3166,
274,
4995,
29889,
24623,
29889,
24477,
874,
29889,
28455,
1053,
9753,
13,
3166,
274,
4995,
29889,
24623,
1053,
7977,
29918,
8768,
13,
13,
14480,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
29937,
2304,
325,
7681,
6910,
478,
29953,
29889,
29941,
29889,
29900,
29889,
29946,
470,
20687,
13,
29937,
2304,
325,
7681,
6910,
478,
29953,
29889,
29941,
29889,
29896,
470,
20687,
13,
9219,
3267,
29918,
29903,
4897,
15082,
3352,
29918,
16358,
29918,
29925,
1299,
4945,
3059,
353,
6024,
29963,
29953,
29889,
29941,
29889,
29900,
7226,
29946,
29899,
29929,
29962,
742,
525,
29963,
29953,
29889,
29941,
7226,
29896,
29899,
29929,
1822,
29973,
29961,
29900,
29899,
29929,
29962,
29973,
2033,
13,
13,
2202,
29901,
13,
1678,
1053,
325,
29916,
29887,
13,
19499,
16032,
2392,
29901,
13,
1678,
25401,
29889,
11739,
29898,
13,
4706,
903,
703,
1576,
10630,
22878,
478,
29953,
29900,
29900,
29900,
7156,
363,
315,
4995,
6858,
278,
10122,
310,
376,
13,
3986,
376,
1552,
10630,
22878,
525,
29990,
29954,
29899,
24183,
742,
3017,
9562,
363,
16089,
277,
1218,
376,
13,
3986,
376,
27820,
362,
1546,
8324,
322,
278,
325,
29953,
29900,
29900,
29900,
6560,
3450,
29889,
376,
13,
3986,
376,
1576,
9562,
508,
367,
16532,
515,
278,
10630,
22878,
18914,
376,
13,
3986,
376,
5924,
4700,
472,
1732,
597,
1636,
29889,
1403,
22878,
29899,
14834,
29889,
510,
29914,
5924,
5783,
13,
1678,
12020,
13,
2870,
29901,
13,
1678,
25401,
29889,
3888,
7373,
703,
27795,
411,
921,
29887,
29899,
8504,
1873,
29901,
1273,
29879,
4968,
325,
29916,
29887,
17255,
3259,
1649,
29897,
13,
13,
1403,
22878,
29918,
25707,
353,
518,
13,
1678,
274,
16434,
29889,
5015,
20624,
877,
17062,
1582,
29918,
29894,
666,
742,
13,
1669,
2322,
2433,
742,
13,
1669,
1371,
2433,
5690,
3211,
470,
3495,
978,
310,
278,
325,
29953,
29900,
29900,
29900,
5835,
5473,
29925,
5477,
13,
1678,
274,
16434,
29889,
5015,
20624,
877,
17062,
1582,
29918,
29885,
3249,
742,
13,
1669,
2322,
2433,
742,
13,
1669,
1371,
2433,
5690,
3211,
470,
3495,
978,
310,
286,
29887,
29899,
29874,
5477,
13,
1678,
274,
16434,
29889,
5015,
20624,
877,
17062,
1582,
29918,
29885,
26300,
742,
13,
1669,
2322,
2433,
742,
13,
1669,
1371,
2433,
5690,
3211,
470,
3495,
978,
310,
286,
29887,
29899,
29890,
5477,
13,
1678,
274,
16434,
29889,
5015,
20624,
877,
17062,
1582,
29918,
1792,
742,
13,
1669,
2322,
2433,
6406,
742,
13,
1669,
1371,
2433,
2659,
1024,
363,
16791,
304,
278,
18914,
22510,
1582,
5477,
13,
1678,
274,
16434,
29889,
5015,
20624,
877,
17062,
1582,
29918,
5630,
742,
13,
1669,
2322,
2433,
742,
13,
1669,
1371,
2433,
2659,
1024,
363,
16791,
304,
278,
18914,
22510,
1582,
742,
13,
1669,
7035,
29922,
5574,
511,
13,
1678,
274,
16434,
29889,
24693,
20624,
877,
1509,
29918,
4481,
4410,
742,
13,
18884,
2322,
29922,
8824,
29892,
13,
18884,
1371,
2433,
11403,
29871,
4481,
4410,
304,
10933,
22525,
322,
14511,
4097,
5477,
13,
1678,
274,
16434,
29889,
24693,
20624,
877,
1509,
29918,
386,
262,
29918,
29880,
6948,
742,
13,
18884,
2322,
29922,
8824,
29892,
13,
18884,
1371,
2433,
11403,
16835,
301,
6948,
2012,
310,
12003,
301,
6948,
5477,
4514,
13,
13,
6007,
29943,
353,
274,
16434,
29889,
6007,
29943,
13,
6007,
29943,
29889,
9573,
29918,
25707,
29898,
1403,
22878,
29918,
25707,
29897,
13,
13,
13,
1990,
21403,
5841,
355,
3991,
29898,
11739,
29889,
29907,
4995,
2451,
1125,
13,
1678,
2643,
353,
903,
703,
24679,
14998,
2295,
338,
8340,
29901,
1273,
29898,
23147,
29897,
29879,
1159,
13,
13,
13,
1990,
10729,
8015,
719,
10851,
29898,
11739,
29889,
29907,
4995,
2451,
1125,
13,
1678,
2643,
353,
903,
703,
5841,
355,
2669,
337,
2202,
11815,
7124,
29901,
1273,
29898,
15619,
29897,
29879,
5226,
1159,
13,
13,
13,
1990,
10630,
22878,
5841,
355,
19212,
29898,
11739,
29889,
29907,
4995,
2451,
1125,
13,
1678,
2643,
353,
903,
703,
5841,
355,
13676,
29901,
1273,
29898,
4906,
29897,
29879,
1159,
13,
13,
13,
1990,
10630,
22878,
5841,
355,
19212,
24217,
29898,
11739,
29889,
29907,
4995,
2451,
1125,
13,
1678,
2643,
353,
903,
703,
5841,
355,
13676,
29901,
2944,
2307,
4864,
1159,
13,
13,
13,
1990,
10630,
22878,
5841,
355,
19212,
17413,
29898,
11739,
29889,
29907,
4995,
2451,
1125,
13,
1678,
2643,
353,
903,
703,
5841,
355,
13676,
29901,
2944,
451,
1476,
1159,
13,
13,
13,
1990,
478,
29953,
29900,
29900,
29900,
18877,
12376,
29898,
28455,
29889,
22509,
12376,
1125,
13,
1678,
9995,
5379,
2667,
8260,
1104,
1218,
304,
10630,
22878,
18914,
4398,
29879,
1213,
15945,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
29963,
29953,
29900,
29900,
29900,
18877,
12376,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
3827,
29918,
15619,
353,
29871,
29941,
29900,
29900,
13,
4706,
1583,
29889,
6925,
331,
29918,
29894,
666,
353,
6213,
13,
4706,
1583,
29889,
6925,
331,
29918,
29885,
3249,
353,
6213,
13,
4706,
1583,
29889,
6925,
331,
29918,
29885,
26300,
353,
6213,
13,
4706,
1583,
29889,
7611,
353,
5124,
13,
4706,
1583,
29889,
16202,
353,
6571,
13,
4706,
1583,
29889,
2917,
353,
9049,
5085,
29889,
657,
877,
13305,
742,
6213,
29897,
13,
4706,
1583,
29889,
4703,
353,
6213,
13,
4706,
1583,
29889,
29880,
348,
29918,
3018,
4937,
353,
365,
348,
1204,
1293,
29898,
1311,
29889,
2585,
29897,
13,
4706,
565,
1583,
29889,
2917,
29901,
13,
9651,
1583,
29889,
2917,
29889,
4397,
29918,
2917,
29918,
5975,
29898,
1403,
22878,
29918,
25707,
29897,
13,
13,
1678,
822,
437,
29918,
14669,
29898,
1311,
29892,
3030,
1125,
13,
4706,
9995,
10773,
17865,
278,
7156,
947,
1550,
6257,
1213,
15945,
13,
4706,
565,
451,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
29894,
666,
29901,
13,
9651,
12020,
3682,
29889,
13919,
4290,
29898,
13,
18884,
2769,
29922,
29918,
877,
29954,
403,
1582,
5473,
29925,
338,
451,
731,
8785,
13,
4706,
565,
451,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
29885,
3249,
29901,
13,
9651,
12020,
3682,
29889,
13919,
4290,
29898,
13,
18884,
2769,
29922,
29918,
877,
29954,
403,
1582,
5641,
363,
286,
29887,
29899,
29874,
338,
451,
731,
8785,
13,
4706,
565,
451,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
29885,
26300,
29901,
13,
9651,
12020,
3682,
29889,
13919,
4290,
29898,
13,
18884,
2769,
29922,
29918,
877,
29954,
403,
1582,
5641,
363,
286,
29887,
29899,
29890,
338,
451,
731,
8785,
13,
13,
4706,
1583,
29889,
6925,
331,
29918,
29894,
666,
353,
325,
29916,
29887,
29889,
3150,
29898,
1311,
29889,
2917,
29889,
17062,
1582,
29918,
29894,
666,
29892,
13,
462,
462,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
1792,
29892,
13,
462,
462,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
5630,
29892,
13,
462,
462,
3013,
284,
573,
29922,
5574,
29897,
13,
4706,
1583,
29889,
6925,
331,
29918,
29885,
3249,
353,
325,
29916,
29887,
29889,
3150,
29898,
1311,
29889,
2917,
29889,
17062,
1582,
29918,
29885,
3249,
29892,
13,
462,
462,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
1792,
29892,
13,
462,
462,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
5630,
29892,
13,
462,
462,
3013,
284,
573,
29922,
5574,
29897,
13,
4706,
1583,
29889,
6925,
331,
29918,
29885,
26300,
353,
325,
29916,
29887,
29889,
3150,
29898,
1311,
29889,
2917,
29889,
17062,
1582,
29918,
29885,
26300,
29892,
13,
462,
462,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
1792,
29892,
13,
462,
462,
1583,
29889,
2917,
29889,
17062,
1582,
29918,
5630,
29892,
13,
462,
462,
3013,
284,
573,
29922,
5574,
29897,
13,
4706,
1583,
29889,
4703,
353,
3030,
13,
13,
4706,
325,
666,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
29889,
16121,
13,
13,
4706,
3240,
29918,
8977,
353,
325,
666,
29889,
657,
29918,
3177,
29918,
5975,
11974,
29894,
13653,
29914,
3859,
29914,
2997,
29914,
7611,
5515,
1159,
13,
4706,
565,
3240,
29918,
8977,
29901,
13,
9651,
1583,
29889,
7611,
353,
3240,
29918,
8977,
29889,
7076,
580,
29961,
29900,
3816,
29896,
29962,
13,
13,
4706,
3240,
29918,
8977,
353,
325,
666,
29889,
657,
29918,
3177,
29918,
5975,
29898,
13,
9651,
5591,
29894,
13653,
29914,
3859,
29914,
2997,
29914,
7611,
22584,
29879,
29914,
29880,
348,
5515,
29908,
13,
9651,
1273,
1583,
29889,
7611,
29897,
13,
4706,
565,
3240,
29918,
8977,
29901,
13,
9651,
1583,
29889,
29880,
348,
29918,
3018,
4937,
29889,
5504,
29918,
3166,
29918,
24623,
29918,
4841,
29898,
2267,
29918,
8977,
29889,
5975,
3101,
13,
13,
4706,
3240,
29918,
8977,
353,
325,
666,
29889,
657,
29918,
3177,
29918,
5975,
29898,
13,
9651,
5591,
29894,
13653,
29914,
3859,
29914,
29879,
14551,
29914,
7611,
22584,
29879,
29914,
29880,
348,
5515,
29908,
13,
9651,
1273,
1583,
29889,
7611,
29897,
13,
4706,
565,
3240,
29918,
8977,
29901,
13,
9651,
363,
1700,
29918,
333,
297,
3240,
29918,
8977,
29889,
5975,
7295,
13,
18884,
5807,
2547,
353,
325,
666,
29889,
657,
29918,
3177,
29918,
5975,
29898,
13,
462,
1678,
5591,
29894,
13653,
29914,
3859,
29914,
29879,
14551,
29914,
7611,
22584,
29879,
29914,
29880,
348,
22584,
29879,
29914,
29879,
8971,
5515,
29908,
13,
462,
1678,
1273,
313,
1311,
29889,
7611,
29892,
1700,
29918,
333,
876,
13,
18884,
1583,
29889,
29880,
348,
29918,
3018,
4937,
29889,
5504,
29918,
3166,
29918,
29879,
14551,
29918,
4841,
29898,
16586,
2547,
29889,
5975,
3101,
13,
13,
1678,
822,
1423,
29918,
1454,
29918,
14669,
29918,
2704,
29898,
1311,
1125,
13,
4706,
9995,
11609,
29879,
385,
1059,
565,
544,
406,
7680,
3246,
9455,
29915,
29873,
1539,
1213,
15945,
13,
4706,
325,
666,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
29889,
16121,
13,
13,
4706,
565,
7431,
29898,
1311,
29889,
7611,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
21403,
5841,
355,
3991,
29898,
23147,
29922,
29918,
877,
7611,
338,
4567,
8785,
13,
13,
4706,
565,
451,
1583,
3032,
275,
29918,
23765,
29918,
6925,
359,
29918,
3259,
29898,
1311,
29889,
6925,
331,
29918,
29894,
666,
29889,
3259,
1125,
13,
9651,
10191,
353,
903,
877,
9219,
3267,
1873,
338,
451,
6969,
1495,
13,
9651,
12020,
21403,
5841,
355,
3991,
29898,
23147,
29922,
7645,
29897,
13,
13,
4706,
289,
29876,
29896,
353,
4852,
29914,
29894,
13653,
29914,
3859,
29914,
2997,
29914,
7611,
22584,
29879,
29914,
386,
12268,
29914,
3880,
3493,
29908,
13,
1669,
5591,
386,
12268,
29918,
6800,
29918,
791,
29908,
1273,
1583,
29889,
7611,
29897,
13,
4706,
289,
29876,
29906,
353,
4852,
29914,
29894,
13653,
29914,
3859,
29914,
2997,
29914,
7611,
22584,
29879,
29914,
386,
12268,
29914,
771,
4924,
29908,
13,
1669,
5591,
386,
12268,
29918,
6800,
29918,
791,
29908,
1273,
1583,
29889,
7611,
29897,
13,
4706,
3240,
29918,
8977,
353,
325,
666,
29889,
657,
29918,
3177,
29918,
5975,
4197,
11197,
29896,
29892,
289,
29876,
29906,
2314,
13,
13,
4706,
363,
2943,
297,
3240,
29918,
8977,
29901,
13,
9651,
396,
450,
22035,
12425,
947,
451,
2304,
2913,
337,
15719,
362,
577,
13,
9651,
396,
9801,
372,
338,
12708,
29889,
29871,
1932,
1304,
2913,
13461,
29879,
278,
2898,
13,
9651,
396,
4046,
29892,
22395,
2913,
337,
15719,
362,
16410,
29889,
29871,
13109,
338,
29871,
29900,
13,
9651,
396,
1149,
694,
2913,
337,
15719,
362,
29889,
13,
9651,
396,
13,
9651,
565,
2943,
29889,
1975,
2541,
11219,
3880,
3493,
29914,
386,
12268,
29918,
6800,
29918,
791,
29374,
13,
18884,
565,
3240,
29918,
8977,
29961,
3177,
29962,
2804,
29871,
29900,
29901,
13,
462,
1678,
10191,
353,
903,
877,
3493,
337,
15719,
362,
16897,
338,
9615,
1495,
13,
462,
1678,
12020,
21403,
5841,
355,
3991,
29898,
23147,
29922,
7645,
29897,
13,
13,
9651,
396,
450,
22035,
12425,
947,
451,
2304,
975,
771,
4924,
292,
577,
13,
9651,
396,
9801,
372,
338,
12708,
29889,
29871,
1932,
25161,
287,
2913,
13461,
29879,
13,
9651,
396,
278,
2898,
4046,
29892,
4340,
25161,
292,
338,
11084,
29889,
13,
9651,
396,
13109,
338,
29871,
29896,
29900,
29900,
1149,
25161,
287,
2913,
15743,
502,
519,
2913,
29889,
13,
9651,
396,
13,
9651,
25342,
2943,
29889,
1975,
2541,
11219,
771,
4924,
29914,
386,
12268,
29918,
6800,
29918,
791,
29374,
13,
18884,
565,
3240,
29918,
8977,
29961,
3177,
29962,
2804,
29871,
29896,
29900,
29900,
29901,
13,
462,
1678,
10191,
353,
903,
877,
771,
4924,
287,
2913,
16897,
451,
5186,
304,
525,
13,
462,
965,
525,
27979,
2913,
1495,
13,
462,
1678,
12020,
21403,
5841,
355,
3991,
29898,
23147,
29922,
7645,
29897,
13,
13,
1678,
822,
1653,
29918,
24623,
29898,
1311,
29892,
7977,
1125,
13,
4706,
9995,
9832,
1078,
263,
7977,
1213,
15945,
13,
4706,
1583,
3032,
3258,
29918,
29880,
348,
29898,
24623,
29897,
13,
13,
1678,
822,
5217,
29918,
24623,
29898,
1311,
29892,
7977,
1125,
13,
4706,
9995,
2772,
1026,
267,
263,
7977,
1213,
15945,
13,
4706,
1583,
3032,
8143,
29918,
29880,
348,
29898,
24623,
29897,
13,
13,
1678,
822,
1653,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
1125,
13,
4706,
9995,
9832,
1078,
263,
22395,
515,
385,
5923,
7977,
1213,
15945,
13,
4706,
1583,
3032,
3258,
29918,
29880,
348,
29918,
29879,
14551,
29898,
29879,
14551,
29897,
13,
13,
1678,
822,
5217,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
1125,
13,
4706,
9995,
2772,
1026,
267,
263,
22395,
1213,
15945,
13,
4706,
1583,
3032,
8143,
29918,
29880,
348,
29918,
29879,
14551,
29898,
29879,
14551,
29897,
13,
13,
1678,
822,
1653,
29918,
24623,
29918,
3166,
29918,
29879,
14551,
29898,
1311,
29892,
7977,
29892,
22395,
1125,
13,
4706,
9995,
9832,
1078,
263,
7977,
515,
263,
22395,
1213,
15945,
13,
4706,
22395,
1839,
2311,
2033,
353,
22395,
1839,
24623,
16215,
2311,
2033,
13,
4706,
1583,
3032,
3258,
29918,
29880,
348,
29898,
24623,
29897,
13,
4706,
1583,
29889,
8552,
29918,
24623,
29918,
1272,
29898,
1311,
29889,
4703,
29892,
22395,
29892,
7977,
29897,
13,
13,
1678,
822,
1653,
29918,
695,
22367,
29918,
24623,
29898,
1311,
29892,
7977,
29892,
4765,
29918,
29894,
999,
1125,
13,
4706,
9995,
9832,
1078,
263,
2989,
17432,
310,
278,
6790,
7977,
1213,
15945,
13,
4706,
1583,
3032,
3258,
29918,
29880,
348,
29898,
24623,
29897,
13,
4706,
1583,
29889,
8552,
29918,
24623,
29918,
1272,
29898,
1311,
29889,
4703,
29892,
4765,
29918,
29894,
999,
29892,
7977,
29897,
13,
13,
1678,
822,
10985,
29918,
24623,
29898,
1311,
29892,
7977,
29892,
716,
29918,
2311,
1125,
13,
4706,
9995,
5647,
355,
385,
5923,
7977,
29915,
29879,
2159,
29889,
13,
13,
4706,
450,
7126,
24492,
1899,
338,
376,
29880,
348,
19490,
5639,
13,
4706,
529,
7611,
29918,
978,
29958,
1024,
529,
29880,
348,
29918,
978,
29958,
2159,
529,
26300,
11903,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
259,
1192,
7977,
1203,
4944,
491,
278,
15629,
13,
9651,
716,
29918,
2311,
1192,
716,
313,
262,
1037,
1463,
29897,
2159,
297,
19289,
304,
367,
7436,
13,
4706,
9995,
13,
4706,
325,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
13,
13,
4706,
25401,
29889,
3888,
7373,
703,
5647,
2548,
25081,
1273,
29898,
333,
29897,
29879,
29892,
515,
1273,
29898,
2311,
29897,
29879,
304,
1273,
29898,
1482,
29918,
2311,
29897,
29879,
19289,
1159,
1273,
13,
462,
11117,
333,
2396,
7977,
1839,
333,
7464,
525,
2311,
2396,
7977,
1839,
2311,
7464,
13,
462,
29871,
525,
1482,
29918,
2311,
2396,
716,
29918,
2311,
1800,
13,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
6717,
29918,
9006,
29898,
29894,
29889,
29880,
348,
29889,
21476,
29918,
29880,
348,
29892,
525,
14191,
742,
13,
462,
965,
1583,
29889,
7611,
29892,
7977,
1839,
333,
7464,
716,
29918,
2311,
29897,
13,
13,
4706,
5174,
8960,
29901,
13,
9651,
25401,
29889,
11739,
7373,
703,
29931,
3904,
10985,
5229,
3850,
876,
13,
9651,
12020,
13,
13,
1678,
732,
13239,
29889,
29879,
9524,
1891,
877,
6925,
331,
29899,
29880,
348,
1495,
13,
1678,
822,
903,
3258,
29918,
29880,
348,
29898,
1311,
29892,
7977,
1125,
13,
4706,
9995,
9832,
1078,
263,
716,
25081,
29889,
13,
13,
4706,
450,
7126,
24492,
1899,
338,
376,
29880,
348,
1653,
5639,
13,
4706,
529,
7611,
29918,
978,
29958,
1024,
529,
29880,
348,
29918,
978,
29958,
2159,
529,
26300,
11903,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
1192,
7977,
1203,
4944,
491,
278,
15629,
13,
4706,
9995,
13,
4706,
25081,
29918,
1853,
353,
525,
29900,
29915,
13,
4706,
325,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
13,
13,
4706,
25401,
29889,
3888,
7373,
703,
9832,
1218,
25081,
1273,
29898,
978,
29897,
29879,
29892,
1273,
29898,
2311,
29897,
29879,
19289,
1159,
1273,
7977,
29897,
13,
13,
4706,
565,
1583,
29889,
2917,
29889,
1509,
29918,
386,
262,
29918,
29880,
6948,
29901,
13,
9651,
25081,
29918,
1853,
353,
525,
29896,
29915,
13,
13,
4706,
396,
773,
278,
21274,
363,
4235,
29901,
14728,
29892,
694,
9171,
29892,
13,
4706,
396,
20623,
29892,
1369,
1949,
29892,
1999,
2039,
675,
29892,
302,
11989,
29892,
394,
3357,
29892,
16389,
637,
13,
4706,
396,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
6717,
29918,
9006,
29898,
29894,
29889,
29880,
348,
29889,
3258,
29918,
29880,
348,
29892,
13,
462,
965,
525,
29931,
3904,
1653,
29901,
2551,
29991,
742,
13,
462,
965,
1583,
29889,
7611,
29892,
7977,
1839,
333,
7464,
13,
462,
965,
7977,
1839,
2311,
7464,
29871,
29896,
29892,
525,
29900,
742,
25081,
29918,
1853,
29892,
525,
29893,
742,
13,
462,
9651,
29896,
29892,
29871,
29945,
29896,
29906,
29892,
7700,
29892,
7700,
29892,
6213,
29897,
13,
13,
4706,
5174,
10630,
22878,
5841,
355,
19212,
24217,
29901,
13,
9651,
25401,
29889,
3888,
7373,
703,
29931,
348,
1273,
29879,
2307,
4864,
29892,
3133,
292,
4968,
7977,
1839,
333,
11287,
13,
13,
4706,
5174,
8960,
29901,
13,
9651,
25401,
29889,
25442,
7373,
703,
29931,
348,
1653,
5229,
3850,
876,
13,
9651,
12020,
13,
13,
1678,
732,
13239,
29889,
29879,
9524,
1891,
877,
6925,
331,
29899,
29880,
348,
1495,
13,
1678,
822,
903,
8143,
29918,
29880,
348,
29898,
1311,
29892,
7977,
1125,
13,
4706,
9995,
2772,
1026,
267,
263,
25081,
29889,
13,
13,
4706,
450,
7126,
24492,
1899,
338,
376,
1217,
25081,
1653,
5639,
13,
4706,
529,
7611,
29918,
978,
29958,
1024,
529,
29880,
348,
29918,
978,
11903,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
1192,
7977,
1203,
4944,
491,
278,
15629,
13,
4706,
9995,
13,
4706,
325,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
13,
4706,
2551,
29918,
1516,
3174,
353,
6024,
29880,
348,
7374,
291,
4687,
742,
525,
2033,
13,
13,
4706,
25401,
29889,
3888,
7373,
703,
2772,
1026,
292,
25081,
1273,
29879,
4968,
7977,
1839,
333,
11287,
13,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
6717,
29918,
9006,
29898,
29894,
29889,
29880,
348,
29889,
8645,
29895,
29918,
8143,
29918,
29880,
6948,
29892,
13,
462,
965,
2551,
29918,
1516,
3174,
29892,
13,
462,
965,
1583,
29889,
7611,
29892,
7977,
1839,
333,
11287,
13,
13,
4706,
5174,
10630,
22878,
5841,
355,
19212,
17413,
29901,
13,
9651,
25401,
29889,
3888,
7373,
703,
29931,
348,
1273,
29879,
2307,
11132,
29892,
3133,
292,
4968,
7977,
1839,
333,
11287,
13,
13,
4706,
5174,
10630,
22878,
5841,
355,
19212,
24217,
29901,
13,
9651,
25401,
29889,
25442,
7373,
703,
29931,
348,
1273,
29879,
756,
14278,
15101,
845,
1862,
29892,
14993,
3262,
4968,
13,
462,
268,
7977,
1839,
333,
11287,
13,
9651,
12020,
3682,
29889,
24679,
3624,
16890,
29891,
29898,
24623,
29918,
978,
29922,
24623,
1839,
333,
11287,
13,
13,
4706,
5174,
8960,
29901,
13,
9651,
25401,
29889,
11739,
7373,
703,
29931,
348,
5217,
5229,
3850,
876,
13,
9651,
12020,
13,
13,
4706,
1583,
29889,
29880,
348,
29918,
3018,
4937,
29889,
9021,
29918,
29880,
348,
29918,
333,
29918,
1454,
29918,
24623,
29898,
24623,
29897,
13,
13,
1678,
732,
13239,
29889,
29879,
9524,
1891,
877,
6925,
331,
29899,
29879,
8971,
1495,
13,
1678,
822,
903,
3258,
29918,
29880,
348,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
1125,
13,
4706,
9995,
9832,
1078,
263,
716,
22395,
363,
263,
25081,
29889,
13,
13,
4706,
450,
7126,
24492,
1899,
338,
376,
29879,
14551,
1653,
5639,
13,
4706,
529,
7611,
29958,
25081,
529,
24623,
29918,
978,
29958,
1024,
529,
29879,
14551,
29918,
978,
11903,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
22395,
1192,
22395,
1203,
4944,
491,
278,
15629,
13,
4706,
9995,
13,
4706,
325,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
13,
13,
4706,
25401,
29889,
3888,
7373,
703,
9832,
1218,
22395,
1273,
29879,
4968,
22395,
1839,
333,
11287,
13,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
6717,
29918,
9006,
29898,
29894,
29889,
29879,
14551,
29889,
3258,
29918,
29880,
348,
29918,
29879,
14551,
29892,
13,
462,
965,
525,
21913,
1653,
29901,
2551,
29991,
742,
13,
462,
965,
1583,
29889,
7611,
29892,
22395,
1839,
24623,
29918,
333,
7464,
13,
462,
965,
22395,
1839,
333,
11287,
13,
13,
4706,
5174,
10630,
22878,
5841,
355,
19212,
24217,
29901,
13,
9651,
25401,
29889,
3888,
7373,
703,
21913,
1273,
29879,
2307,
4864,
29892,
3133,
292,
4968,
13,
462,
268,
22395,
1839,
333,
11287,
13,
13,
4706,
5174,
8960,
29901,
13,
9651,
25401,
29889,
11739,
7373,
703,
29931,
3904,
22395,
1653,
5229,
3850,
876,
13,
9651,
12020,
13,
13,
1678,
732,
13239,
29889,
29879,
9524,
1891,
877,
6925,
331,
29899,
29879,
8971,
1495,
13,
1678,
822,
903,
8143,
29918,
29880,
348,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
1125,
13,
4706,
9995,
2772,
1026,
267,
385,
5923,
22395,
363,
263,
25081,
29889,
13,
13,
4706,
450,
7126,
24492,
1899,
338,
376,
1217,
22395,
1653,
5639,
13,
4706,
529,
7611,
29958,
25081,
529,
24623,
29918,
978,
29958,
1024,
529,
29879,
14551,
29918,
978,
11903,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
22395,
1192,
22395,
1203,
4944,
491,
278,
15629,
13,
4706,
9995,
13,
4706,
325,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
13,
13,
4706,
25401,
29889,
3888,
7373,
703,
2772,
1026,
292,
22395,
1273,
29879,
4968,
22395,
1839,
333,
11287,
13,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
6717,
29918,
9006,
29898,
29894,
29889,
29879,
14551,
29889,
8143,
29918,
29880,
348,
29918,
29879,
14551,
29892,
13,
462,
965,
525,
21913,
5217,
29901,
2551,
29991,
742,
13,
462,
965,
1583,
29889,
7611,
29892,
22395,
1839,
24623,
29918,
333,
7464,
13,
462,
965,
22395,
1839,
333,
11287,
13,
13,
4706,
5174,
10630,
22878,
5841,
355,
19212,
17413,
29901,
13,
9651,
25401,
29889,
3888,
7373,
703,
21913,
1273,
29879,
2307,
11132,
29892,
3133,
292,
4968,
13,
462,
268,
22395,
1839,
333,
11287,
13,
13,
4706,
5174,
8960,
29901,
13,
9651,
25401,
29889,
11739,
7373,
703,
29931,
3904,
22395,
5217,
5229,
3850,
876,
13,
9651,
12020,
13,
13,
4706,
1583,
29889,
29880,
348,
29918,
3018,
4937,
29889,
9021,
29918,
29880,
348,
29918,
333,
29918,
1454,
29918,
29879,
14551,
29898,
29879,
14551,
29897,
13,
13,
1678,
822,
903,
6717,
29918,
9006,
29898,
1311,
29892,
2009,
29918,
9891,
29892,
2551,
29918,
1516,
3174,
29892,
334,
5085,
1125,
13,
4706,
9995,
6558,
385,
1060,
29954,
2009,
740,
29892,
322,
337,
2202,
2745,
278,
2009,
13,
4706,
3639,
263,
2551,
2643,
29892,
263,
10672,
2643,
29892,
470,
278,
5534,
13,
4706,
2009,
11815,
338,
7124,
29889,
13,
13,
4706,
910,
14476,
338,
6839,
304,
5376,
411,
14998,
7274,
393,
508,
13,
4706,
4418,
363,
738,
12875,
310,
9590,
29892,
363,
2777,
29892,
746,
278,
1788,
13,
4706,
338,
2307,
19587,
11415,
916,
365,
3904,
7274,
29889,
29871,
739,
338,
884,
15040,
13,
4706,
3307,
304,
2367,
701,
565,
16993,
3241,
338,
1623,
313,
387,
694,
379,
29909,
3625,
511,
13,
4706,
727,
338,
694,
2913,
2175,
29892,
470,
916,
376,
29888,
2075,
29908,
4436,
526,
4133,
13,
4706,
313,
4149,
903,
29888,
2075,
29918,
2704,
29918,
401,
580,
363,
263,
1051,
310,
599,
2998,
1059,
13,
4706,
5855,
467,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
2009,
29918,
9891,
1678,
1192,
1060,
29954,
7882,
1158,
304,
1246,
13,
9651,
2551,
29918,
1516,
3174,
1678,
1192,
21397,
7191,
3806,
515,
278,
14998,
13,
9651,
334,
5085,
965,
1192,
2980,
1409,
304,
367,
4502,
304,
278,
2009,
29918,
9891,
13,
13,
4706,
16969,
29901,
13,
9651,
450,
2933,
9657,
515,
278,
1833,
1060,
29954,
1246,
29889,
13,
4706,
9995,
13,
4706,
4613,
353,
6571,
13,
4706,
1369,
353,
931,
29889,
2230,
580,
13,
4706,
2309,
353,
7700,
13,
13,
4706,
565,
338,
8758,
29898,
8698,
29918,
1516,
3174,
29892,
2362,
342,
5393,
1125,
13,
9651,
2551,
29918,
1516,
3174,
353,
518,
8698,
29918,
1516,
3174,
29962,
13,
13,
4706,
1550,
451,
2309,
29901,
13,
9651,
565,
931,
29889,
2230,
580,
448,
1369,
6736,
1583,
29889,
3827,
29918,
15619,
29901,
13,
18884,
12020,
10729,
8015,
719,
10851,
29898,
15619,
29922,
1311,
29889,
3827,
29918,
15619,
29897,
13,
13,
9651,
4613,
353,
2009,
29918,
9891,
10456,
5085,
29897,
13,
13,
9651,
565,
451,
4613,
1839,
4906,
2033,
29901,
13,
18884,
396,
1060,
29954,
7274,
674,
736,
6213,
363,
263,
2643,
565,
694,
2643,
13,
18884,
396,
1347,
338,
4502,
938,
278,
10650,
2933,
13,
18884,
4613,
1839,
4906,
2033,
353,
6629,
13,
13,
9651,
363,
10191,
297,
2551,
29918,
1516,
3174,
29901,
13,
18884,
565,
451,
4613,
1839,
401,
2033,
322,
10191,
297,
4613,
1839,
4906,
2033,
29901,
13,
462,
1678,
2309,
353,
5852,
13,
462,
1678,
2867,
13,
13,
9651,
1583,
3032,
29888,
2075,
29918,
2704,
29918,
401,
29898,
13713,
29897,
13,
13,
4706,
736,
4613,
13,
13,
1678,
822,
903,
6717,
29918,
9006,
29918,
392,
29918,
27902,
29898,
1311,
29892,
2009,
29918,
9891,
29892,
11539,
29918,
9891,
29892,
13,
462,
632,
2009,
29918,
8698,
29918,
1516,
3174,
2433,
742,
364,
5085,
11759,
1402,
722,
3174,
29922,
2636,
1125,
13,
4706,
9995,
6558,
385,
1060,
29954,
2009,
740,
29892,
322,
11539,
2551,
773,
385,
13,
4706,
5684,
11539,
740,
29889,
29871,
960,
278,
1147,
2450,
8465,
29892,
769,
13,
4706,
337,
2202,
278,
2009,
29914,
27902,
11412,
2745,
1716,
3168,
526,
13,
4706,
9150,
29892,
278,
2009,
740,
3639,
263,
10672,
2643,
29892,
470,
13,
4706,
278,
5534,
2009,
11815,
338,
7124,
29889,
13,
13,
4706,
910,
14476,
338,
6839,
304,
5376,
411,
14998,
7274,
393,
508,
13,
4706,
4418,
363,
738,
12875,
310,
9590,
29892,
363,
2777,
29892,
746,
278,
1788,
13,
4706,
338,
2307,
19587,
11415,
916,
365,
3904,
7274,
29889,
29871,
739,
338,
884,
15040,
13,
4706,
3307,
304,
2367,
701,
565,
16993,
3241,
338,
1623,
313,
387,
694,
379,
29909,
3625,
511,
13,
4706,
727,
338,
694,
2913,
2175,
29892,
470,
916,
376,
29888,
2075,
29908,
4436,
526,
4133,
13,
4706,
313,
4149,
903,
29888,
2075,
29918,
2704,
29918,
401,
580,
363,
263,
1051,
310,
599,
2998,
1059,
13,
4706,
5855,
467,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
2009,
29918,
9891,
4706,
1192,
1060,
29954,
7882,
1158,
304,
1246,
13,
9651,
11539,
29918,
9891,
308,
1192,
740,
304,
1246,
304,
11539,
2009,
471,
13,
462,
462,
259,
8676,
8472,
313,
387,
363,
5609,
29897,
13,
9651,
2009,
29918,
8698,
29918,
7645,
1192,
21397,
2643,
3806,
515,
278,
14998,
13,
462,
462,
259,
363,
278,
2009,
29918,
9891,
13,
9651,
334,
29878,
5085,
795,
1192,
2980,
1409,
304,
367,
4502,
304,
278,
13,
462,
462,
259,
2009,
29918,
9891,
13,
9651,
334,
29894,
5085,
795,
1192,
2980,
1409,
304,
367,
4502,
304,
278,
13,
462,
462,
259,
11539,
29918,
9891,
13,
13,
4706,
16969,
29901,
13,
9651,
450,
2933,
9657,
515,
278,
1833,
1060,
29954,
1246,
29889,
13,
4706,
9995,
13,
4706,
4613,
353,
6571,
13,
4706,
1369,
353,
931,
29889,
2230,
580,
13,
4706,
2009,
29918,
484,
19226,
353,
5852,
13,
4706,
11539,
29918,
484,
19226,
353,
5852,
13,
13,
4706,
565,
338,
8758,
29898,
3827,
29918,
8698,
29918,
1516,
3174,
29892,
2362,
342,
5393,
1125,
13,
9651,
2009,
29918,
8698,
29918,
1516,
3174,
353,
518,
3827,
29918,
8698,
29918,
1516,
3174,
29962,
13,
13,
4706,
1550,
2009,
29918,
484,
19226,
470,
11539,
29918,
484,
19226,
29901,
13,
9651,
565,
931,
29889,
2230,
580,
448,
1369,
6736,
1583,
29889,
3827,
29918,
15619,
29901,
13,
18884,
12020,
10729,
8015,
719,
10851,
29898,
15619,
29922,
1311,
29889,
3827,
29918,
15619,
29897,
13,
13,
9651,
565,
2009,
29918,
484,
19226,
29901,
13,
18884,
4613,
353,
2009,
29918,
9891,
10456,
29878,
5085,
29897,
13,
18884,
565,
451,
4613,
1839,
4906,
2033,
29901,
13,
462,
1678,
396,
1060,
29954,
7274,
674,
736,
6213,
363,
263,
2643,
565,
694,
2643,
13,
462,
1678,
396,
1347,
338,
4502,
938,
278,
10650,
2933,
13,
462,
1678,
4613,
1839,
4906,
2033,
353,
6629,
13,
462,
1678,
363,
10191,
297,
2009,
29918,
8698,
29918,
1516,
3174,
29901,
13,
462,
4706,
565,
451,
4613,
1839,
401,
2033,
322,
10191,
297,
4613,
1839,
4906,
2033,
29901,
13,
462,
9651,
396,
1060,
29954,
2009,
3653,
471,
8676,
13,
462,
9651,
2009,
29918,
484,
19226,
353,
7700,
13,
462,
9651,
2867,
13,
18884,
1583,
3032,
29888,
2075,
29918,
2704,
29918,
401,
29898,
13713,
29897,
13,
13,
9651,
25342,
11539,
29918,
484,
19226,
29901,
13,
18884,
2551,
353,
11539,
29918,
9891,
10456,
29894,
5085,
29897,
13,
18884,
565,
2551,
29901,
13,
462,
1678,
396,
1060,
29954,
11539,
3653,
471,
8676,
13,
462,
1678,
11539,
29918,
484,
19226,
353,
7700,
13,
18884,
1683,
29901,
13,
462,
1678,
396,
1018,
9348,
278,
2009,
1449,
13,
462,
1678,
2009,
29918,
484,
19226,
353,
5852,
13,
13,
4706,
736,
4613,
13,
13,
1678,
822,
903,
657,
29918,
4481,
1132,
29898,
1311,
29892,
7977,
29892,
1826,
2801,
1125,
13,
4706,
9995,
29954,
1691,
278,
29871,
4481,
1132,
393,
881,
367,
1304,
746,
2295,
3864,
263,
7977,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
1192,
7977,
1203,
1304,
304,
8161,
278,
29871,
4481,
1132,
1024,
13,
13,
4706,
16969,
29901,
13,
632,
4481,
1132,
29918,
978,
1192,
1024,
310,
29871,
4481,
1132,
313,
1454,
2295,
3864,
22525,
669,
13,
462,
965,
14511,
4097,
29897,
13,
4706,
9995,
13,
4706,
325,
353,
1583,
29889,
6925,
331,
29918,
29894,
666,
13,
13,
4706,
396,
4803,
278,
1826,
2801,
29915,
29879,
7601,
3495,
978,
322,
671,
393,
408,
278,
13,
4706,
396,
1024,
310,
278,
29871,
4481,
1132,
29889,
29871,
450,
1024,
1818,
1101,
5877,
6865,
13,
4706,
396,
3734,
491,
278,
1409,
29901,
376,
21969,
1712,
871,
394,
16711,
25099,
13,
4706,
396,
4890,
29892,
12569,
267,
29892,
322,
23400,
29883,
2361,
29889,
29871,
450,
937,
2931,
13,
4706,
396,
1818,
367,
394,
16711,
25099,
1642,
13,
4706,
396,
13,
308,
4481,
1132,
29918,
978,
353,
337,
29889,
1491,
29898,
29878,
29915,
7110,
29956,
29962,
742,
22868,
742,
1826,
2801,
1839,
3069,
11287,
13,
13,
4706,
396,
11539,
393,
278,
29871,
4481,
1132,
756,
1063,
2825,
373,
278,
14998,
29892,
322,
13,
4706,
396,
565,
372,
1838,
29915,
29873,
1863,
29892,
1653,
372,
29991,
13,
4706,
396,
13,
4706,
289,
29876,
353,
5591,
29894,
13653,
29914,
2917,
29914,
4481,
1132,
22584,
29879,
29908,
1273,
29871,
4481,
1132,
29918,
978,
13,
4706,
4613,
353,
325,
29889,
16121,
29889,
657,
29918,
3177,
29918,
5975,
29898,
11197,
29897,
13,
13,
4706,
565,
451,
7431,
29898,
13713,
1125,
13,
9651,
325,
29889,
4481,
1132,
29889,
3258,
29918,
4481,
1132,
29898,
4481,
1132,
29918,
978,
29897,
13,
13,
4706,
736,
29871,
4481,
1132,
29918,
978,
13,
13,
1678,
822,
903,
657,
29918,
24623,
29918,
1853,
29918,
17833,
29918,
6550,
29898,
1311,
29892,
7977,
29892,
1580,
29918,
1989,
1125,
13,
4706,
9995,
12914,
848,
6087,
297,
263,
7977,
29918,
1853,
29915,
29879,
4805,
29918,
5965,
2395,
1591,
29889,
13,
13,
4706,
5920,
23430,
515,
6455,
297,
13,
4706,
274,
4995,
29914,
24623,
29914,
24477,
874,
29914,
2929,
333,
8696,
29889,
2272,
322,
13,
4706,
274,
4995,
29914,
3150,
1429,
29914,
9435,
29914,
816,
14952,
29914,
26705,
29914,
5030,
11614,
29918,
4572,
29889,
2272,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
259,
1192,
7977,
1203,
6943,
7977,
29918,
1853,
304,
2346,
13,
9651,
1580,
29918,
1989,
1192,
278,
15562,
1820,
304,
2740,
363,
13,
13,
4706,
16969,
29901,
13,
9651,
1580,
29918,
1767,
1192,
1347,
995,
6942,
411,
1580,
29918,
1989,
13,
4706,
9995,
13,
4706,
1580,
29918,
1767,
353,
6213,
13,
4706,
274,
3945,
353,
3030,
29889,
657,
29918,
6406,
29918,
4703,
580,
13,
4706,
1134,
333,
353,
7977,
1839,
24623,
29918,
1853,
29918,
333,
2033,
13,
4706,
565,
1134,
333,
29901,
13,
9651,
7977,
29918,
1853,
353,
7977,
29918,
8768,
29889,
657,
29918,
24623,
29918,
1853,
29898,
312,
486,
29892,
1134,
333,
29897,
13,
9651,
7977,
29918,
5965,
2395,
353,
7977,
29918,
1853,
29889,
657,
877,
17833,
29918,
5965,
2395,
1495,
13,
9651,
363,
1820,
29892,
659,
297,
7977,
29918,
5965,
2395,
29889,
1524,
7076,
7295,
13,
13,
18884,
396,
21480,
1648,
6507,
10551,
287,
4805,
29918,
5965,
2395,
304,
1996,
263,
13,
18884,
396,
10944,
373,
599,
1661,
29899,
3069,
29899,
5030,
3097,
4475,
4805,
13,
18884,
396,
1580,
29879,
29892,
577,
393,
10944,
338,
10076,
2986,
1244,
1434,
13,
18884,
396,
8454,
278,
1820,
29889,
13,
18884,
396,
13,
18884,
565,
525,
11283,
297,
1820,
29901,
13,
462,
1678,
6874,
353,
1820,
29889,
5451,
877,
29901,
1495,
13,
462,
1678,
1820,
353,
6874,
29961,
29896,
29962,
13,
18884,
565,
1820,
1275,
1580,
29918,
1989,
29901,
13,
462,
1678,
1580,
29918,
1767,
353,
659,
13,
462,
1678,
2867,
13,
13,
4706,
736,
1580,
29918,
1767,
13,
13,
1678,
822,
903,
10685,
29918,
1454,
29918,
15843,
3859,
29898,
1311,
29892,
7977,
29918,
978,
29892,
2106,
29922,
8824,
1125,
13,
4706,
9995,
29925,
3028,
29879,
14998,
304,
11539,
7977,
29915,
29879,
5609,
5285,
29889,
13,
13,
4706,
1060,
29954,
6166,
29914,
339,
6358,
1494,
263,
2009,
304,
1653,
470,
5217,
263,
25081,
13,
4706,
5609,
1122,
4418,
373,
278,
14998,
565,
325,
12366,
338,
1603,
9068,
13,
4706,
278,
5609,
3158,
313,
272,
3064,
714,
467,
29871,
1334,
508,
1423,
3692,
372,
338,
13,
4706,
2309,
491,
1248,
1847,
278,
5609,
9956,
363,
263,
25081,
304,
9801,
372,
338,
13,
4706,
2825,
470,
11132,
29889,
13,
13,
4706,
910,
740,
674,
1018,
304,
11539,
278,
11265,
470,
28744,
310,
13,
4706,
5609,
2106,
373,
1716,
28646,
7573,
310,
278,
1409,
1432,
29871,
29945,
13,
4706,
6923,
363,
701,
304,
29871,
29941,
29900,
6923,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
29918,
978,
1192,
1024,
310,
7977,
304,
367,
1248,
839,
13,
9651,
2106,
539,
1192,
5852,
304,
21180,
363,
10379,
29892,
7700,
363,
10225,
310,
13,
13,
4706,
16969,
29901,
13,
9651,
5852,
565,
278,
5609,
2106,
471,
5149,
2715,
470,
6206,
13,
9651,
313,
2716,
2548,
373,
525,
3859,
29915,
1828,
29897,
13,
4706,
9995,
13,
4706,
4660,
353,
518,
8824,
29892,
7700,
29962,
13,
4706,
286,
29887,
29918,
535,
1983,
353,
518,
1311,
29889,
6925,
331,
29918,
29885,
3249,
29889,
16121,
29892,
1583,
29889,
6925,
331,
29918,
29885,
26300,
29889,
16121,
29962,
13,
4706,
2551,
353,
7700,
13,
13,
4706,
289,
29876,
353,
5591,
29894,
13653,
29914,
2917,
29914,
15843,
29914,
7611,
22584,
29879,
29914,
29880,
348,
22584,
29879,
29908,
320,
13,
9651,
1273,
313,
1311,
29889,
7611,
29892,
7977,
29918,
978,
29897,
13,
13,
4706,
363,
474,
297,
921,
3881,
29898,
29953,
1125,
13,
9651,
363,
2943,
29918,
333,
297,
921,
3881,
29898,
29906,
1125,
13,
18884,
565,
451,
4660,
29961,
3177,
29918,
333,
5387,
13,
462,
1678,
4613,
353,
286,
29887,
29918,
535,
1983,
29961,
3177,
29918,
333,
1822,
657,
29918,
3177,
29918,
5975,
29898,
11197,
29897,
13,
462,
1678,
565,
2106,
322,
7431,
29898,
13713,
29889,
8149,
580,
1125,
13,
462,
4706,
4660,
29961,
3177,
29918,
333,
29962,
353,
5852,
13,
462,
1678,
25342,
313,
1333,
2106,
29897,
322,
313,
1333,
7431,
29898,
13713,
29889,
8149,
22130,
29901,
13,
462,
4706,
4660,
29961,
3177,
29918,
333,
29962,
353,
5852,
13,
13,
9651,
565,
4660,
29961,
29900,
29962,
322,
4660,
29961,
29896,
5387,
13,
18884,
2551,
353,
5852,
13,
18884,
2867,
13,
9651,
1683,
29901,
13,
18884,
931,
29889,
17059,
29898,
29945,
29897,
13,
13,
4706,
736,
2551,
13,
13,
1678,
822,
903,
275,
29918,
23765,
29918,
6925,
359,
29918,
3259,
29898,
1311,
29892,
1873,
29918,
1807,
1125,
13,
4706,
9995,
5596,
393,
278,
1873,
310,
11400,
3267,
2734,
373,
278,
12417,
1994,
338,
13,
4706,
2854,
363,
671,
411,
278,
4673,
7264,
18563,
1213,
15945,
13,
4706,
363,
4766,
297,
11400,
3267,
29918,
29903,
4897,
15082,
3352,
29918,
16358,
29918,
29925,
1299,
4945,
3059,
29901,
13,
9651,
565,
337,
29889,
4352,
29898,
11037,
29892,
1873,
29918,
1807,
1125,
13,
18884,
25401,
29889,
8382,
703,
6565,
2164,
11400,
3267,
1873,
1273,
29879,
338,
6969,
29908,
1273,
13,
462,
3986,
1873,
29918,
1807,
29897,
13,
18884,
736,
5852,
13,
4706,
736,
7700,
13,
13,
1678,
822,
903,
29888,
2075,
29918,
2704,
29918,
401,
29898,
1311,
29892,
2933,
1125,
13,
4706,
9995,
5596,
278,
1059,
775,
297,
263,
1060,
29954,
2933,
363,
263,
18409,
1059,
29892,
13,
4706,
322,
3639,
385,
8210,
3682,
29889,
29871,
4829,
11561,
23892,
13,
4706,
515,
325,
29881,
3487,
29918,
29885,
29887,
4378,
29889,
29883,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
2933,
1192,
263,
2933,
9657,
1121,
515,
385,
1060,
29954,
2009,
13,
4706,
9995,
13,
4706,
396,
2998,
1661,
29899,
29888,
2075,
2933,
11561,
13,
4706,
396,
13,
4706,
337,
2202,
29918,
18137,
353,
426,
29896,
29900,
29906,
29946,
29901,
525,
29880,
348,
7374,
291,
297,
6728,
29892,
1018,
1449,
2678,
742,
13,
462,
4706,
29896,
29946,
29900,
29941,
29906,
29901,
525,
29880,
29883,
29918,
3127,
29918,
908,
29918,
8262,
29891,
10827,
13,
13,
4706,
565,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29900,
29900,
29901,
13,
9651,
396,
301,
29883,
29918,
19206,
29918,
2704,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29900,
29906,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
9294,
291,
29918,
26061,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29900,
29946,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
1333,
29918,
11940,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
17413,
580,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29900,
29945,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
9933,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
24217,
580,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29900,
29947,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
348,
9684,
29918,
1191,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29896,
29946,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
601,
29918,
2704,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29896,
29953,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
601,
29918,
15603,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29896,
29955,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
601,
29918,
15619,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29906,
29896,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
348,
9684,
29918,
4878,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29906,
29945,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
1217,
29918,
5847,
29918,
3493,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29941,
29945,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
3881,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29900,
29941,
29953,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
20965,
29918,
3207,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
29946,
29896,
29906,
29896,
29901,
13,
9651,
396,
301,
29883,
29918,
3127,
29918,
20713,
839,
29918,
3127,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29945,
29896,
29906,
29901,
13,
9651,
396,
2216,
3307,
3889,
2913,
297,
5639,
313,
27491,
3487,
6494,
29897,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
4706,
25342,
2933,
1839,
401,
2033,
1275,
29871,
29896,
322,
525,
29931,
3904,
3553,
14529,
29915,
320,
13,
18884,
297,
2933,
1839,
4906,
2033,
29901,
13,
9651,
396,
25081,
1178,
14529,
1550,
15661,
304,
5609,
13,
9651,
12020,
10630,
22878,
5841,
355,
19212,
29898,
4906,
29922,
5327,
1839,
4906,
11287,
13,
13,
13,
1990,
365,
348,
1204,
1293,
29898,
3318,
1125,
13,
1678,
9995,
5323,
4684,
3625,
25081,
29918,
4841,
363,
671,
746,
5609,
292,
263,
716,
25081,
363,
278,
13,
1678,
937,
931,
29889,
29871,
2860,
13213,
1218,
263,
716,
365,
348,
1204,
1293,
1203,
29892,
372,
881,
13,
1678,
367,
4784,
313,
6500,
1711,
439,
583,
3277,
18167,
29914,
29879,
14551,
25081,
3553,
24082,
13,
1678,
1546,
278,
1409,
322,
278,
6590,
4673,
1429,
6535,
15562,
467,
13,
13,
1678,
2860,
393,
29892,
278,
1203,
508,
367,
22320,
1000,
304,
10446,
278,
2446,
13,
1678,
525,
16515,
29915,
25081,
3553,
363,
671,
411,
5609,
292,
263,
716,
7977,
470,
13,
1678,
22395,
29889,
29871,
9333,
746,
278,
7977,
29914,
29879,
14551,
338,
11132,
9186,
29892,
278,
13,
1678,
25081,
3553,
881,
367,
3005,
287,
29889,
13,
13,
1678,
365,
348,
23481,
526,
7629,
265,
1711,
10231,
701,
304,
263,
4236,
995,
310,
29871,
29896,
29953,
29895,
29892,
13,
1678,
1156,
607,
278,
9262,
674,
2425,
2820,
304,
25081,
3553,
29871,
29896,
322,
674,
13,
1678,
6773,
304,
11924,
2745,
385,
3625,
3553,
338,
1476,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4833,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
1583,
29889,
3317,
29918,
29880,
348,
29918,
333,
353,
29871,
29896,
29953,
29900,
29900,
29900,
13,
4706,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
353,
518,
29900,
29962,
334,
1583,
29889,
3317,
29918,
29880,
348,
29918,
333,
13,
4706,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
29961,
29900,
29962,
353,
29871,
29896,
13,
4706,
1583,
29889,
16304,
29918,
2248,
353,
29871,
29896,
13,
4706,
1583,
29889,
9021,
29918,
2248,
353,
29871,
29896,
13,
4706,
1583,
29889,
4703,
353,
3030,
29889,
657,
29918,
6406,
29918,
4703,
580,
13,
4706,
1583,
29889,
2585,
353,
4833,
13,
13,
1678,
822,
2767,
29918,
3166,
29918,
24623,
29918,
4841,
29898,
1311,
29892,
1178,
29918,
1761,
29922,
2636,
1125,
13,
4706,
9995,
29956,
2235,
263,
1051,
310,
18167,
16531,
393,
278,
1409,
9906,
1048,
322,
13,
4706,
1423,
363,
738,
7160,
25081,
29918,
333,
15562,
363,
1269,
310,
1906,
18167,
304,
13,
4706,
8072,
16523,
278,
1051,
29889,
29871,
3940,
393,
278,
15562,
6611,
526,
6087,
408,
13,
4706,
6031,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
1178,
29918,
1761,
1192,
1409,
6943,
2983,
310,
18167,
393,
1863,
373,
278,
13,
462,
539,
14998,
313,
24623,
525,
7039,
29915,
526,
501,
11150,
29879,
565,
896,
892,
1754,
13,
462,
539,
3025,
278,
478,
2303,
29924,
7156,
3450,
29897,
13,
4706,
9995,
13,
4706,
363,
2944,
297,
1178,
29918,
1761,
29901,
13,
9651,
1018,
29901,
13,
18884,
15562,
353,
1583,
29889,
2585,
29889,
24623,
29918,
19635,
29918,
657,
29898,
1311,
29889,
4703,
29892,
2944,
29897,
13,
9651,
5174,
3682,
29889,
24679,
17413,
29901,
13,
18884,
25401,
29889,
25442,
7373,
703,
3782,
4833,
2106,
363,
25081,
1273,
29879,
29892,
14993,
3262,
25081,
29918,
333,
2767,
4968,
13,
462,
308,
2944,
29897,
13,
9651,
1683,
29901,
13,
18884,
565,
15562,
322,
525,
29880,
348,
29918,
333,
29915,
297,
15562,
29901,
13,
462,
1678,
2380,
353,
938,
29898,
19635,
1839,
29880,
348,
29918,
333,
11287,
13,
462,
1678,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
29961,
2248,
29962,
353,
29871,
29896,
13,
462,
1678,
25401,
29889,
8382,
703,
2697,
25081,
29918,
333,
16328,
29881,
363,
7977,
29918,
333,
16328,
29879,
29908,
1273,
313,
2248,
29892,
2944,
876,
13,
462,
1678,
1583,
29889,
5504,
29918,
9021,
29918,
2248,
29898,
2248,
29897,
13,
13,
1678,
822,
2767,
29918,
3166,
29918,
29879,
14551,
29918,
4841,
29898,
1311,
29892,
1178,
29918,
1761,
29922,
2636,
1125,
13,
4706,
9995,
29956,
2235,
263,
1051,
310,
15101,
845,
1862,
16531,
393,
278,
1409,
9906,
1048,
322,
13,
4706,
1423,
363,
738,
7160,
25081,
29918,
333,
15562,
363,
1269,
310,
1906,
15101,
845,
1862,
304,
13,
4706,
8072,
16523,
278,
1051,
29889,
29871,
3940,
393,
278,
15562,
6611,
526,
6087,
408,
13,
4706,
6031,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
1178,
29918,
1761,
1192,
1409,
6943,
2983,
310,
15101,
845,
1862,
393,
1863,
373,
278,
13,
462,
539,
14998,
313,
29879,
14551,
525,
7039,
29915,
526,
501,
11150,
29879,
565,
896,
892,
1754,
13,
462,
539,
3025,
278,
478,
2303,
29924,
7156,
3450,
29897,
13,
4706,
9995,
13,
4706,
363,
2944,
297,
1178,
29918,
1761,
29901,
13,
9651,
1018,
29901,
13,
18884,
15562,
353,
1583,
29889,
2585,
29889,
29879,
14551,
29918,
19635,
29918,
657,
29898,
1311,
29889,
4703,
29892,
2944,
29897,
13,
9651,
5174,
3682,
29889,
21913,
17413,
29901,
13,
18884,
25401,
29889,
25442,
7373,
703,
3782,
4833,
2106,
363,
15101,
1273,
29879,
29892,
14993,
3262,
25081,
29918,
333,
2767,
4968,
13,
462,
308,
2944,
29897,
13,
9651,
1683,
29901,
13,
18884,
565,
15562,
322,
525,
29880,
348,
29918,
333,
29915,
297,
15562,
29901,
13,
462,
1678,
2380,
353,
938,
29898,
19635,
1839,
29880,
348,
29918,
333,
11287,
13,
462,
1678,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
29961,
2248,
29962,
353,
29871,
29896,
13,
462,
1678,
25401,
29889,
8382,
703,
2697,
25081,
29918,
333,
16328,
29881,
363,
22395,
29918,
333,
16328,
29879,
29908,
1273,
13,
462,
795,
313,
2248,
29892,
2944,
876,
13,
462,
1678,
1583,
29889,
5504,
29918,
9021,
29918,
2248,
29898,
2248,
29897,
13,
13,
1678,
822,
679,
29918,
29880,
348,
29918,
333,
29918,
1454,
29918,
24623,
29898,
1311,
29892,
7977,
1125,
13,
4706,
9995,
2499,
2029,
403,
263,
3889,
263,
25081,
3553,
304,
263,
7977,
322,
1653,
263,
25081,
29918,
333,
4055,
13,
4706,
297,
278,
7977,
29915,
29879,
15562,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
1192,
278,
7977,
1203,
304,
23632,
263,
25081,
29918,
333,
304,
13,
4706,
9995,
13,
4706,
15562,
353,
1583,
29889,
2585,
29889,
24623,
29918,
19635,
29918,
657,
29898,
1311,
29889,
4703,
29892,
7977,
1839,
333,
11287,
13,
4706,
565,
451,
15562,
470,
525,
29880,
348,
29918,
333,
29915,
451,
297,
15562,
29901,
13,
9651,
15562,
353,
6571,
13,
9651,
15562,
1839,
29880,
348,
29918,
333,
2033,
353,
1583,
29889,
657,
29918,
4622,
29918,
29880,
348,
29918,
333,
29918,
710,
580,
13,
9651,
1583,
29889,
2585,
29889,
24623,
29918,
19635,
29918,
5504,
29898,
1311,
29889,
4703,
29892,
7977,
1839,
333,
7464,
13,
462,
462,
965,
15562,
29892,
7700,
29897,
13,
9651,
25401,
29889,
8382,
703,
7900,
12961,
25081,
29918,
333,
1273,
29879,
304,
7977,
1273,
29879,
29908,
1273,
13,
462,
418,
313,
19635,
1839,
29880,
348,
29918,
333,
7464,
7977,
1839,
333,
25901,
13,
4706,
736,
15562,
1839,
29880,
348,
29918,
333,
2033,
13,
13,
1678,
822,
679,
29918,
29880,
348,
29918,
333,
29918,
1454,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
1125,
13,
4706,
9995,
2499,
2029,
403,
263,
3889,
263,
25081,
3553,
304,
263,
22395,
322,
1653,
263,
25081,
29918,
333,
4055,
13,
4706,
297,
278,
22395,
29915,
29879,
15562,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
22395,
1192,
278,
22395,
1203,
304,
23632,
263,
25081,
29918,
333,
304,
13,
4706,
9995,
13,
4706,
15562,
353,
1583,
29889,
2585,
29889,
29879,
14551,
29918,
19635,
29918,
657,
29898,
1311,
29889,
4703,
29892,
22395,
1839,
333,
11287,
13,
4706,
565,
451,
15562,
470,
525,
29880,
348,
29918,
333,
29915,
451,
297,
15562,
29901,
13,
9651,
15562,
353,
6571,
13,
9651,
15562,
1839,
29880,
348,
29918,
333,
2033,
353,
1583,
29889,
657,
29918,
4622,
29918,
29880,
348,
29918,
333,
29918,
710,
580,
13,
9651,
1583,
29889,
2585,
29889,
29879,
14551,
29918,
19635,
29918,
5504,
29898,
1311,
29889,
4703,
29892,
22395,
1839,
333,
7464,
13,
462,
462,
632,
15562,
29892,
7700,
29897,
13,
9651,
25401,
29889,
8382,
703,
7900,
12961,
25081,
29918,
333,
1273,
29879,
304,
7977,
1273,
29879,
29908,
1273,
13,
462,
418,
313,
19635,
1839,
29880,
348,
29918,
333,
7464,
22395,
1839,
333,
25901,
13,
4706,
736,
15562,
1839,
29880,
348,
29918,
333,
2033,
13,
13,
1678,
822,
3889,
29918,
29880,
348,
29918,
333,
29918,
1454,
29918,
24623,
29898,
1311,
29892,
7977,
1125,
13,
4706,
9995,
15941,
278,
25081,
29918,
333,
4055,
7160,
297,
278,
7977,
29915,
29879,
15562,
322,
13,
4706,
3889,
278,
25081,
3553,
297,
278,
7463,
23110,
1409,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
7977,
1192,
278,
7977,
1203,
411,
263,
25081,
3553,
304,
367,
3889,
29915,
29881,
13,
4706,
9995,
13,
4706,
15562,
353,
1583,
29889,
2585,
29889,
24623,
29918,
19635,
29918,
657,
29898,
1311,
29889,
4703,
29892,
7977,
1839,
333,
11287,
13,
4706,
565,
15562,
322,
525,
29880,
348,
29918,
333,
29915,
297,
15562,
29901,
13,
9651,
1583,
29889,
9021,
29918,
29880,
348,
29918,
333,
29918,
710,
29898,
19635,
1839,
29880,
348,
29918,
333,
11287,
13,
13,
1678,
822,
3889,
29918,
29880,
348,
29918,
333,
29918,
1454,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
1125,
13,
4706,
9995,
15941,
278,
25081,
29918,
333,
4055,
7160,
297,
278,
22395,
29915,
29879,
15562,
322,
13,
4706,
3889,
278,
25081,
3553,
297,
278,
7463,
23110,
1409,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
22395,
1192,
278,
22395,
1203,
411,
263,
25081,
3553,
304,
367,
3889,
29915,
29881,
13,
4706,
9995,
13,
4706,
15562,
353,
1583,
29889,
2585,
29889,
29879,
14551,
29918,
19635,
29918,
657,
29898,
1311,
29889,
4703,
29892,
22395,
1839,
333,
11287,
13,
4706,
565,
15562,
322,
525,
29880,
348,
29918,
333,
29915,
297,
15562,
29901,
13,
9651,
1583,
29889,
9021,
29918,
29880,
348,
29918,
333,
29918,
710,
29898,
19635,
1839,
29880,
348,
29918,
333,
11287,
13,
13,
1678,
822,
679,
29918,
4622,
29918,
29880,
348,
29918,
333,
29918,
710,
29898,
1311,
1125,
13,
4706,
9995,
9802,
278,
2446,
3625,
25081,
29918,
333,
408,
19591,
322,
736,
13,
4706,
372,
304,
278,
24959,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
2446,
29918,
333,
1192,
278,
25081,
3553,
393,
1641,
19591,
304,
278,
24959,
13,
4706,
9995,
13,
4706,
2446,
29918,
333,
353,
1583,
29889,
9021,
29918,
2248,
13,
4706,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
29961,
4622,
29918,
333,
29962,
353,
29871,
29896,
13,
4706,
1583,
29889,
5504,
29918,
9021,
29918,
2248,
580,
13,
4706,
736,
851,
29898,
4622,
29918,
333,
29897,
13,
13,
1678,
822,
3889,
29918,
29880,
348,
29918,
333,
29918,
710,
29898,
1311,
29892,
995,
29918,
710,
1125,
13,
4706,
9995,
9802,
263,
25081,
29918,
333,
408,
1286,
3625,
29892,
408,
565,
278,
25081,
471,
316,
29899,
15956,
630,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
995,
29918,
710,
1192,
25081,
3553,
304,
3889,
313,
262,
1347,
3402,
29897,
13,
4706,
9995,
13,
4706,
995,
353,
938,
29898,
1767,
29918,
710,
29897,
13,
4706,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
29961,
1767,
29962,
353,
29871,
29900,
13,
4706,
1583,
29889,
5504,
29918,
9021,
29918,
2248,
580,
13,
13,
1678,
822,
2767,
29918,
9021,
29918,
2248,
29898,
1311,
29892,
2380,
29922,
8516,
1125,
13,
4706,
9995,
6422,
278,
3889,
2380,
29892,
21196,
265,
1711,
10231,
29892,
322,
13,
4706,
26113,
1250,
304,
29871,
29896,
1156,
278,
4236,
25081,
3553,
995,
338,
7124,
29889,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
2380,
1192,
5251,
393,
599,
1819,
2400,
445,
1353,
1122,
367,
2307,
13,
462,
268,
19591,
29892,
577,
1369,
11975,
472,
393,
995,
565,
372,
338,
13,
462,
268,
6133,
1135,
278,
3889,
29918,
2248,
13,
4706,
9995,
13,
4706,
474,
353,
29871,
29900,
13,
4706,
2302,
353,
29871,
29900,
13,
4706,
4236,
29918,
2311,
353,
7431,
29898,
1311,
29889,
29880,
348,
29918,
333,
29918,
1761,
29897,
13,
4706,
565,
2380,
322,
2380,
1405,
1583,
29889,
9021,
29918,
2248,
29901,
13,
9651,
474,
353,
2380,
718,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
474,
353,
1583,
29889,
9021,
29918,
2248,
13,
4706,
396,
4772,
13331,
310,
2380,
2392,
13,
4706,
565,
474,
6736,
4236,
29918,
2311,
29901,
13,
9651,
474,
353,
29871,
29896,
13,
4706,
1550,
1583,
29889,
29880,
348,
29918,
333,
29918,
1761,
29961,
29875,
29962,
1275,
29871,
29896,
322,
2302,
529,
4236,
29918,
2311,
29901,
13,
9651,
2302,
4619,
29871,
29896,
13,
9651,
474,
4619,
29871,
29896,
13,
9651,
565,
474,
6736,
4236,
29918,
2311,
29901,
13,
18884,
474,
353,
29871,
29896,
13,
4706,
1583,
29889,
9021,
29918,
2248,
353,
474,
13,
4706,
565,
2302,
1275,
4236,
29918,
2311,
29901,
13,
9651,
12020,
3682,
29889,
2392,
703,
29089,
1284,
3889,
25081,
29918,
333,
29892,
6820,
701,
29991,
1159,
13,
2
] |
design-patterns/structural/interpreter.py | verthais/exercise-python | 0 | 109653 | <filename>design-patterns/structural/interpreter.py
from abc import abstractmethod
class AbstractExpression():
@abstractmethod
def interpret(self):
pass
class NonterminalExpression(AbstractExpression):
def __init__(self, expression):
self._expression = expression
def interpret(self):
print("Non-terminal expression being interpreted ...")
self._expression.interpret()
class TerminalExpression(AbstractExpression):
def interpret(self):
print("Terminal expression being interpreted ...")
def main():
ast = NonterminalExpression(NonterminalExpression(TerminalExpression()))
ast.interpret()
if __name__ == "__main__":
main()
| [
1,
529,
9507,
29958,
13892,
29899,
11037,
29879,
29914,
4984,
3631,
29914,
1639,
1457,
357,
29889,
2272,
13,
3166,
25638,
1053,
9846,
5696,
30004,
13,
30004,
13,
30004,
13,
1990,
25513,
10960,
7295,
30004,
13,
30004,
13,
12,
29992,
16595,
5696,
30004,
13,
12,
1753,
6613,
29898,
1311,
1125,
30004,
13,
12,
12,
3364,
30004,
13,
30004,
13,
30004,
13,
1990,
10050,
8489,
979,
10960,
29898,
9118,
10960,
1125,
30004,
13,
30004,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4603,
1125,
30004,
13,
12,
12,
1311,
3032,
17471,
353,
4603,
30004,
13,
30004,
13,
12,
1753,
6613,
29898,
1311,
1125,
30004,
13,
12,
12,
2158,
703,
12283,
29899,
8489,
979,
4603,
1641,
21551,
2023,
1159,
30004,
13,
12,
12,
1311,
3032,
17471,
29889,
1639,
19819,
26471,
13,
30004,
13,
30004,
13,
1990,
29175,
10960,
29898,
9118,
10960,
1125,
30004,
13,
30004,
13,
12,
1753,
6613,
29898,
1311,
1125,
30004,
13,
12,
12,
2158,
703,
14343,
979,
4603,
1641,
21551,
2023,
1159,
30004,
13,
30004,
13,
30004,
13,
1753,
1667,
7295,
30004,
13,
12,
579,
353,
10050,
8489,
979,
10960,
29898,
12283,
8489,
979,
10960,
29898,
14343,
979,
10960,
22130,
30004,
13,
12,
579,
29889,
1639,
19819,
26471,
13,
30004,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
30004,
13,
12,
3396,
26471,
13,
2
] |
lib/Protocol/NVRDriverCLIProtocol.py | multi-service-fabric/element-manager | 0 | 46317 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
# Filename: NVRDriverCLIProtocol.py
import traceback
import re
import GlobalModule
from EmCommonLog import decorater_log
from CgwshDriverCLIProtocol import CgwshDriverCLIProtocol
class NVRDriverCLIProtocol(CgwshDriverCLIProtocol):
'''
Class for processing NVR driver protocol(CLI)
'''
@decorater_log
def __init__(self, error_recv_message=[], connected_recv_message="~"):
super(NVRDriverCLIProtocol, self).__init__(error_recv_message,
connected_recv_message)
@decorater_log
def _exit_configuration_mode(self):
'''
Release of configuration mode is forced.
'''
re_txt_save_conf = "Save new configuration \? \(Y/N\)"
send_message = [("quit", "{0}|{1}".format(">", re_txt_save_conf))]
GlobalModule.EM_LOGGER.debug(
"start exit command :\n%s" % (send_message,))
try:
output = self._exec_interactive(send_message,
self.error_recv_message)
if re.search(re_txt_save_conf, output):
self._send_command_no_save()
except Exception as ex:
GlobalModule.EM_LOGGER.debug("Error exit command:%s", ex)
GlobalModule.EM_LOGGER.debug("Traceback:%s",
traceback.format_exc())
else:
GlobalModule.EM_LOGGER.debug("Success configuration exit")
self._is_mode_configuration = False
@decorater_log
def _send_command_no_save(self):
'''
Save new configuration ? n is set as reponse to question(Y/N).
Return value:
Received message
'''
GlobalModule.EM_LOGGER.debug(
"Send n for 'Save new configuration ? (Y/N)'")
shell_obj = self._ssh_shell
send_message = "n"
receive_keyword = ">"
shell_obj.send(send_message)
return self._recv_message(shell_obj, receive_keyword)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
30004,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
29937,
14187,
1266,
29898,
29883,
29897,
29871,
29906,
29900,
29896,
29929,
405,
8377,
265,
1920,
27333,
322,
9699,
6710,
15025,
30004,
13,
29937,
2514,
3871,
29901,
405,
29963,
29934,
12376,
27205,
17830,
29889,
2272,
30004,
13,
30004,
13,
5215,
9637,
1627,
30004,
13,
5215,
337,
30004,
13,
5215,
12002,
7355,
30004,
13,
3166,
2812,
18877,
3403,
1053,
10200,
1008,
29918,
1188,
30004,
13,
3166,
315,
29887,
29893,
845,
12376,
27205,
17830,
1053,
315,
29887,
29893,
845,
12376,
27205,
17830,
30004,
13,
30004,
13,
30004,
13,
1990,
405,
29963,
29934,
12376,
27205,
17830,
29898,
29907,
29887,
29893,
845,
12376,
27205,
17830,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
4134,
363,
9068,
405,
29963,
29934,
7156,
9608,
29898,
27205,
8443,
13,
1678,
14550,
30004,
13,
30004,
13,
1678,
732,
19557,
1008,
29918,
1188,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1059,
29918,
3757,
29894,
29918,
4906,
11759,
1402,
6631,
29918,
3757,
29894,
29918,
4906,
543,
30022,
29908,
1125,
30004,
13,
4706,
2428,
29898,
29940,
29963,
29934,
12376,
27205,
17830,
29892,
1583,
467,
1649,
2344,
12035,
2704,
29918,
3757,
29894,
29918,
4906,
11167,
13,
462,
462,
462,
259,
6631,
29918,
3757,
29894,
29918,
4906,
8443,
13,
30004,
13,
1678,
732,
19557,
1008,
29918,
1188,
30004,
13,
1678,
822,
903,
13322,
29918,
13305,
29918,
8513,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
23708,
310,
5285,
4464,
338,
11826,
22993,
13,
4706,
14550,
30004,
13,
4706,
6756,
13,
4706,
337,
29918,
3945,
29918,
7620,
29918,
5527,
353,
376,
11371,
716,
5285,
320,
29973,
4269,
29979,
29914,
29940,
29905,
5513,
30004,
13,
30004,
13,
4706,
3638,
29918,
4906,
353,
518,
703,
28358,
613,
29850,
29900,
11079,
29912,
29896,
29913,
1642,
4830,
703,
28341,
337,
29918,
3945,
29918,
7620,
29918,
5527,
28166,
30004,
13,
4706,
12002,
7355,
29889,
12665,
29918,
14480,
17070,
29889,
8382,
29898,
30004,
13,
9651,
376,
2962,
6876,
1899,
584,
29905,
29876,
29995,
29879,
29908,
1273,
313,
6717,
29918,
4906,
29892,
876,
30004,
13,
4706,
1018,
29901,
30004,
13,
9651,
1962,
353,
1583,
3032,
4258,
29918,
1639,
4925,
29898,
6717,
29918,
4906,
11167,
13,
462,
462,
9651,
1583,
29889,
2704,
29918,
3757,
29894,
29918,
4906,
8443,
13,
9651,
565,
337,
29889,
4478,
29898,
276,
29918,
3945,
29918,
7620,
29918,
5527,
29892,
1962,
1125,
30004,
13,
18884,
1583,
3032,
6717,
29918,
6519,
29918,
1217,
29918,
7620,
26471,
13,
4706,
5174,
8960,
408,
429,
29901,
30004,
13,
9651,
12002,
7355,
29889,
12665,
29918,
14480,
17070,
29889,
8382,
703,
2392,
6876,
1899,
16664,
29879,
613,
429,
8443,
13,
9651,
12002,
7355,
29889,
12665,
29918,
14480,
17070,
29889,
8382,
703,
11591,
1627,
16664,
29879,
15231,
13,
462,
462,
308,
9637,
1627,
29889,
4830,
29918,
735,
29883,
3101,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
12002,
7355,
29889,
12665,
29918,
14480,
17070,
29889,
8382,
703,
14191,
5285,
6876,
1159,
30004,
13,
9651,
1583,
3032,
275,
29918,
8513,
29918,
13305,
353,
7700,
30004,
13,
30004,
13,
1678,
732,
19557,
1008,
29918,
1188,
30004,
13,
1678,
822,
903,
6717,
29918,
6519,
29918,
1217,
29918,
7620,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
16913,
716,
5285,
1577,
302,
338,
731,
408,
337,
1713,
304,
1139,
29898,
29979,
29914,
29940,
467,
30004,
13,
4706,
7106,
995,
29901,
30004,
13,
9651,
24328,
2347,
2643,
30004,
13,
4706,
14550,
30004,
13,
4706,
12002,
7355,
29889,
12665,
29918,
14480,
17070,
29889,
8382,
29898,
30004,
13,
9651,
376,
12600,
302,
363,
525,
11371,
716,
5285,
1577,
313,
29979,
29914,
29940,
16029,
1159,
30004,
13,
4706,
6473,
29918,
5415,
353,
1583,
3032,
15269,
29918,
15903,
30004,
13,
4706,
3638,
29918,
4906,
353,
376,
29876,
19451,
13,
4706,
7150,
29918,
26766,
353,
376,
11903,
30004,
13,
4706,
6473,
29918,
5415,
29889,
6717,
29898,
6717,
29918,
4906,
8443,
13,
4706,
736,
1583,
3032,
3757,
29894,
29918,
4906,
29898,
15903,
29918,
5415,
29892,
7150,
29918,
26766,
8443,
13,
2
] |
csvjoin/__main__.py | walkerever/csv-join | 0 | 1614680 | <reponame>walkerever/csv-join<gh_stars>0
from . import csvjoin_main
if __name__ == "__main__" :
csvjoin_main()
| [
1,
529,
276,
1112,
420,
29958,
20919,
406,
369,
29914,
7638,
29899,
7122,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
869,
1053,
11799,
7122,
29918,
3396,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
29908,
584,
13,
1678,
11799,
7122,
29918,
3396,
580,
13,
2
] |
pyvttbl/tests/test_stats_ttest_paired.py | yk/pyvttbl | 0 | 58264 |
# Copyright (c) 2011, <NAME> [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
import unittest
import warnings
import os
import math
from random import shuffle, random
from collections import Counter,OrderedDict
from dictset import DictSet,_rep_generator
from math import isnan, isinf, floor
import numpy as np
from pprint import pprint as pp
from pyvttbl import PyvtTbl
from pyvttbl import DataFrame
from pyvttbl.plotting import *
from pyvttbl.stats import *
from pyvttbl.misc.support import *
class Test_ttest_paired(unittest.TestCase):
def test0(self):
"""paired ttest"""
R=Ttest([('t', -1.4106912317171967),
('p2tail', 0.19601578492449323),
('p1tail', 0.09800789246224662),
('n1', 9),
('n2', 9),
('r', 0.10182008678393427),
('df', 8),
('mu1', 4.555555555555555),
('mu2', 7.888888888888889),
('var1', 6.777777777777778),
('var2', 47.111111111111114),
('tc2tail', 1.8595480375228424),
('tc1tail', 2.3060041350333704),
('cohen_d', 0.47023041057239895),
('delta', 1.410691231717197),
('power1tail', 0.36186192660269623),
('power2tail', 0.23741605057147952)],
paired=True,
aname='A', bname='B',
type='t-Test: Paired Two Sample for means')
A=[3,4, 5,8,9, 1,2,4, 5]
B=[6,19,3,2,14,4,5,17,1]
D=Ttest()
D.run(A,B,paired=True)
## print(D)
for k in list(R.keys()):
self.assertTrue(D[k],R[k])
def test01(self):
"""paired ttest"""
R="""t-Test: Paired Two Sample for means
A B
=========================================
Mean 4.556 7.889
Variance 6.778 47.111
Observations 9 9
Pearson Correlation 0.102
df 8
t Stat -1.411
alpha 0.050
P(T<=t) one-tail 0.098
t Critical one-tail 2.306
P(T<=t) two-tail 0.196
t Critical two-tail 1.860
P(T<=t) two-tail 0.196
Effect size dz 0.470
delta 1.411
Observed power one-tail 0.362
Observed power two-tail 0.237 """
A=[3,4, 5,8,9, 1,2,4, 5]
B=[6,19,3,2,14,4,5,17,1]
D=Ttest()
D.run(A,B,paired=True)
self.assertEqual(str(D),R)
def test4(self):
R="""t-Test: Paired Two Sample for means
PRE POST
=============================================
Mean 87.250 87.083
Variance 1207.659 1166.629
Observations 12 12
Pearson Correlation 0.995
df 11
t Stat 0.163
alpha 0.050
P(T<=t) one-tail 0.437
t Critical one-tail 2.201
P(T<=t) two-tail 0.873
t Critical two-tail 1.796
P(T<=t) two-tail 0.873
Effect size dz 0.047
delta 0.163
Observed power one-tail 0.068
Observed power two-tail 0.035 """
df = DataFrame()
df.read_tbl('data/example2_prepost.csv')
D = df.ttest('PRE','POST',paired=True)
self.assertEqual(str(D),R)
def test__repr__(self):
R=Ttest([('t', 2.310889197854228), ('p2tail', 0.026382412254338405), ('p1tail', 0.013191206127169203), ('n1', 21), ('n2', 23), ('df', 37.855400659439084), ('mu1', 51.476190476190474), ('mu2', 41.52173913043478), ('var1', 121.16190476190475), ('var2', 294.0790513833993), ('tc2tail', 1.6861153650443554), ('tc1tail', 2.0246481352107009), ('cohen_d', 0.6908475708680588), ('delta', 2.1846518399376538), ('power1tail', 0.6916337616595899), ('power2tail', 0.56712772561445368)], equal_variance=False, aname='A', bname='B', type='t-Test: Two-Sample Assuming Unequal Variances')
A=[24,61,59,46,43,44,52,43,58,67,62,57,71,49,54,43,53,57,49,56,33]
B=[42,33,46,37,43,41,10,42,55,19,17,55,26,54,60,28,62,20,53,48,37,85,42]
D=Ttest()
D.run(A,B,equal_variance=False)
for key in list(R.keys()):
self.assertAlmostEqual(D[key],R[key])
def suite():
return unittest.TestSuite((
unittest.makeSuite(Test_ttest_paired)
))
if __name__ == "__main__":
# run tests
runner = unittest.TextTestRunner()
runner.run(suite())
| [
1,
29871,
13,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29896,
29892,
529,
5813,
29958,
518,
4149,
365,
2965,
1430,
1660,
29889,
3945,
29962,
13,
29937,
910,
7047,
338,
5220,
287,
297,
760,
491,
405,
29902,
29950,
18102,
349,
29906,
29900,
390,
29934,
29900,
29896,
29953,
29946,
29945,
29946,
29889,
13,
13,
5215,
443,
27958,
13,
5215,
18116,
13,
5215,
2897,
13,
5215,
5844,
13,
3166,
4036,
1053,
528,
21897,
29892,
4036,
13,
3166,
16250,
1053,
315,
5336,
29892,
7514,
287,
21533,
13,
3166,
9657,
842,
1053,
360,
919,
2697,
29892,
29918,
3445,
29918,
27959,
13,
3166,
5844,
1053,
3508,
273,
29892,
338,
7192,
29892,
11904,
13,
5215,
12655,
408,
7442,
13,
3166,
282,
2158,
1053,
282,
2158,
408,
6499,
13,
13,
3166,
11451,
29894,
698,
2204,
1053,
10772,
21908,
29911,
2204,
13,
3166,
11451,
29894,
698,
2204,
1053,
3630,
4308,
13,
3166,
11451,
29894,
698,
2204,
29889,
5317,
1259,
1053,
334,
13,
3166,
11451,
29894,
698,
2204,
29889,
16202,
1053,
334,
13,
3166,
11451,
29894,
698,
2204,
29889,
29885,
10669,
29889,
5924,
1053,
334,
13,
13,
1990,
4321,
29918,
698,
342,
29918,
3274,
2859,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
1243,
29900,
29898,
1311,
1125,
13,
4706,
9995,
3274,
2859,
260,
1688,
15945,
29908,
13,
4706,
390,
29922,
29911,
1688,
4197,
877,
29873,
742,
448,
29896,
29889,
29946,
29896,
29900,
29953,
29929,
29896,
29906,
29941,
29896,
29955,
29896,
29955,
29896,
29929,
29953,
29955,
511,
13,
462,
6702,
29886,
29906,
18237,
742,
29871,
29900,
29889,
29896,
29929,
29953,
29900,
29896,
29945,
29955,
29947,
29946,
29929,
29906,
29946,
29946,
29929,
29941,
29906,
29941,
511,
13,
462,
6702,
29886,
29896,
18237,
742,
29871,
29900,
29889,
29900,
29929,
29947,
29900,
29900,
29955,
29947,
29929,
29906,
29946,
29953,
29906,
29906,
29946,
29953,
29953,
29906,
511,
13,
462,
6702,
29876,
29896,
742,
29871,
29929,
511,
13,
462,
6702,
29876,
29906,
742,
29871,
29929,
511,
13,
462,
6702,
29878,
742,
29871,
29900,
29889,
29896,
29900,
29896,
29947,
29906,
29900,
29900,
29947,
29953,
29955,
29947,
29941,
29929,
29941,
29946,
29906,
29955,
511,
13,
462,
6702,
2176,
742,
29871,
29947,
511,
13,
462,
6702,
2589,
29896,
742,
29871,
29946,
29889,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
29945,
511,
13,
462,
6702,
2589,
29906,
742,
29871,
29955,
29889,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29947,
29929,
511,
13,
462,
6702,
1707,
29896,
742,
29871,
29953,
29889,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29947,
511,
13,
462,
6702,
1707,
29906,
742,
29871,
29946,
29955,
29889,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
29946,
511,
13,
462,
6702,
14246,
29906,
18237,
742,
29871,
29896,
29889,
29947,
29945,
29929,
29945,
29946,
29947,
29900,
29941,
29955,
29945,
29906,
29906,
29947,
29946,
29906,
29946,
511,
13,
462,
6702,
14246,
29896,
18237,
742,
29871,
29906,
29889,
29941,
29900,
29953,
29900,
29900,
29946,
29896,
29941,
29945,
29900,
29941,
29941,
29941,
29955,
29900,
29946,
511,
13,
462,
6702,
1111,
3169,
29918,
29881,
742,
29871,
29900,
29889,
29946,
29955,
29900,
29906,
29941,
29900,
29946,
29896,
29900,
29945,
29955,
29906,
29941,
29929,
29947,
29929,
29945,
511,
13,
462,
6702,
4181,
742,
29871,
29896,
29889,
29946,
29896,
29900,
29953,
29929,
29896,
29906,
29941,
29896,
29955,
29896,
29955,
29896,
29929,
29955,
511,
13,
462,
6702,
13519,
29896,
18237,
742,
29871,
29900,
29889,
29941,
29953,
29896,
29947,
29953,
29896,
29929,
29906,
29953,
29953,
29900,
29906,
29953,
29929,
29953,
29906,
29941,
511,
13,
462,
6702,
13519,
29906,
18237,
742,
29871,
29900,
29889,
29906,
29941,
29955,
29946,
29896,
29953,
29900,
29945,
29900,
29945,
29955,
29896,
29946,
29955,
29929,
29945,
29906,
29897,
1402,
13,
18884,
3300,
2859,
29922,
5574,
29892,
13,
18884,
385,
420,
2433,
29909,
742,
289,
978,
2433,
29933,
742,
13,
18884,
1134,
2433,
29873,
29899,
3057,
29901,
2621,
2859,
7803,
21029,
363,
2794,
1495,
13,
308,
13,
4706,
319,
11759,
29941,
29892,
29946,
29892,
29871,
29945,
29892,
29947,
29892,
29929,
29892,
29871,
29896,
29892,
29906,
29892,
29946,
29892,
29871,
29945,
29962,
13,
4706,
350,
11759,
29953,
29892,
29896,
29929,
29892,
29941,
29892,
29906,
29892,
29896,
29946,
29892,
29946,
29892,
29945,
29892,
29896,
29955,
29892,
29896,
29962,
13,
539,
13,
4706,
360,
29922,
29911,
1688,
580,
13,
4706,
360,
29889,
3389,
29898,
29909,
29892,
29933,
29892,
3274,
2859,
29922,
5574,
29897,
13,
2277,
4706,
1596,
29898,
29928,
29897,
13,
308,
13,
4706,
363,
413,
297,
1051,
29898,
29934,
29889,
8149,
580,
1125,
13,
9651,
1583,
29889,
9294,
5574,
29898,
29928,
29961,
29895,
1402,
29934,
29961,
29895,
2314,
13,
632,
13,
1678,
822,
1243,
29900,
29896,
29898,
1311,
1125,
13,
4706,
9995,
3274,
2859,
260,
1688,
15945,
29908,
13,
4706,
390,
13776,
29908,
29873,
29899,
3057,
29901,
2621,
2859,
7803,
21029,
363,
2794,
13,
462,
9651,
319,
4706,
350,
268,
13,
9166,
9166,
4936,
29922,
13,
6816,
273,
462,
4706,
29946,
29889,
29945,
29945,
29953,
268,
29955,
29889,
29947,
29947,
29929,
29871,
13,
9037,
8837,
462,
1678,
29953,
29889,
29955,
29955,
29947,
1678,
29946,
29955,
29889,
29896,
29896,
29896,
29871,
13,
6039,
2140,
800,
462,
1678,
29929,
308,
29929,
29871,
13,
29925,
799,
1100,
2994,
23445,
308,
29900,
29889,
29896,
29900,
29906,
965,
13,
2176,
462,
795,
29947,
965,
13,
29873,
6666,
462,
1678,
448,
29896,
29889,
29946,
29896,
29896,
965,
13,
2312,
462,
539,
29900,
29889,
29900,
29945,
29900,
965,
13,
29925,
29898,
29911,
14065,
29873,
29897,
697,
29899,
18237,
9651,
29900,
29889,
29900,
29929,
29947,
965,
13,
29873,
15976,
936,
697,
29899,
18237,
308,
29906,
29889,
29941,
29900,
29953,
965,
13,
29925,
29898,
29911,
14065,
29873,
29897,
1023,
29899,
18237,
9651,
29900,
29889,
29896,
29929,
29953,
965,
13,
29873,
15976,
936,
1023,
29899,
18237,
308,
29896,
29889,
29947,
29953,
29900,
965,
13,
29925,
29898,
29911,
14065,
29873,
29897,
1023,
29899,
18237,
9651,
29900,
29889,
29896,
29929,
29953,
965,
13,
13971,
2159,
9275,
795,
29900,
29889,
29946,
29955,
29900,
965,
13,
4181,
462,
539,
29896,
29889,
29946,
29896,
29896,
965,
13,
6039,
643,
1490,
3081,
697,
29899,
18237,
268,
29900,
29889,
29941,
29953,
29906,
965,
13,
6039,
643,
1490,
3081,
1023,
29899,
18237,
268,
29900,
29889,
29906,
29941,
29955,
3986,
9995,
13,
308,
13,
4706,
319,
11759,
29941,
29892,
29946,
29892,
29871,
29945,
29892,
29947,
29892,
29929,
29892,
29871,
29896,
29892,
29906,
29892,
29946,
29892,
29871,
29945,
29962,
13,
4706,
350,
11759,
29953,
29892,
29896,
29929,
29892,
29941,
29892,
29906,
29892,
29896,
29946,
29892,
29946,
29892,
29945,
29892,
29896,
29955,
29892,
29896,
29962,
13,
539,
13,
4706,
360,
29922,
29911,
1688,
580,
13,
4706,
360,
29889,
3389,
29898,
29909,
29892,
29933,
29892,
3274,
2859,
29922,
5574,
29897,
13,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
710,
29898,
29928,
511,
29934,
29897,
13,
13,
1678,
822,
1243,
29946,
29898,
1311,
1125,
13,
4706,
390,
13776,
29908,
29873,
29899,
3057,
29901,
2621,
2859,
7803,
21029,
363,
2794,
13,
462,
9651,
349,
1525,
4706,
11971,
1678,
13,
9166,
9166,
4936,
2751,
29922,
13,
6816,
273,
462,
308,
29947,
29955,
29889,
29906,
29945,
29900,
418,
29947,
29955,
29889,
29900,
29947,
29941,
29871,
13,
9037,
8837,
462,
259,
29896,
29906,
29900,
29955,
29889,
29953,
29945,
29929,
1678,
29896,
29896,
29953,
29953,
29889,
29953,
29906,
29929,
29871,
13,
6039,
2140,
800,
462,
268,
29896,
29906,
3986,
29896,
29906,
29871,
13,
29925,
799,
1100,
2994,
23445,
965,
29900,
29889,
29929,
29929,
29945,
632,
13,
2176,
462,
1669,
29896,
29896,
632,
13,
29873,
6666,
462,
4706,
29900,
29889,
29896,
29953,
29941,
632,
13,
2312,
462,
308,
29900,
29889,
29900,
29945,
29900,
632,
13,
29925,
29898,
29911,
14065,
29873,
29897,
697,
29899,
18237,
795,
29900,
29889,
29946,
29941,
29955,
632,
13,
29873,
15976,
936,
697,
29899,
18237,
965,
29906,
29889,
29906,
29900,
29896,
632,
13,
29925,
29898,
29911,
14065,
29873,
29897,
1023,
29899,
18237,
795,
29900,
29889,
29947,
29955,
29941,
632,
13,
29873,
15976,
936,
1023,
29899,
18237,
965,
29896,
29889,
29955,
29929,
29953,
632,
13,
29925,
29898,
29911,
14065,
29873,
29897,
1023,
29899,
18237,
795,
29900,
29889,
29947,
29955,
29941,
632,
13,
13971,
2159,
9275,
18884,
29900,
29889,
29900,
29946,
29955,
632,
13,
4181,
462,
308,
29900,
29889,
29896,
29953,
29941,
632,
13,
6039,
643,
1490,
3081,
697,
29899,
18237,
539,
29900,
29889,
29900,
29953,
29947,
632,
13,
6039,
643,
1490,
3081,
1023,
29899,
18237,
539,
29900,
29889,
29900,
29941,
29945,
9651,
9995,
13,
4706,
4489,
353,
3630,
4308,
580,
13,
4706,
4489,
29889,
949,
29918,
16400,
877,
1272,
29914,
4773,
29906,
29918,
1457,
2490,
29889,
7638,
1495,
13,
4706,
360,
353,
4489,
29889,
698,
342,
877,
15094,
3788,
5438,
742,
3274,
2859,
29922,
5574,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
710,
29898,
29928,
511,
29934,
29897,
13,
308,
13,
1678,
822,
1243,
1649,
276,
558,
12035,
1311,
1125,
13,
4706,
390,
29922,
29911,
1688,
4197,
877,
29873,
742,
29871,
29906,
29889,
29941,
29896,
29900,
29947,
29947,
29929,
29896,
29929,
29955,
29947,
29945,
29946,
29906,
29906,
29947,
511,
6702,
29886,
29906,
18237,
742,
29871,
29900,
29889,
29900,
29906,
29953,
29941,
29947,
29906,
29946,
29896,
29906,
29906,
29945,
29946,
29941,
29941,
29947,
29946,
29900,
29945,
511,
6702,
29886,
29896,
18237,
742,
29871,
29900,
29889,
29900,
29896,
29941,
29896,
29929,
29896,
29906,
29900,
29953,
29896,
29906,
29955,
29896,
29953,
29929,
29906,
29900,
29941,
511,
6702,
29876,
29896,
742,
29871,
29906,
29896,
511,
6702,
29876,
29906,
742,
29871,
29906,
29941,
511,
6702,
2176,
742,
29871,
29941,
29955,
29889,
29947,
29945,
29945,
29946,
29900,
29900,
29953,
29945,
29929,
29946,
29941,
29929,
29900,
29947,
29946,
511,
6702,
2589,
29896,
742,
29871,
29945,
29896,
29889,
29946,
29955,
29953,
29896,
29929,
29900,
29946,
29955,
29953,
29896,
29929,
29900,
29946,
29955,
29946,
511,
6702,
2589,
29906,
742,
29871,
29946,
29896,
29889,
29945,
29906,
29896,
29955,
29941,
29929,
29896,
29941,
29900,
29946,
29941,
29946,
29955,
29947,
511,
6702,
1707,
29896,
742,
29871,
29896,
29906,
29896,
29889,
29896,
29953,
29896,
29929,
29900,
29946,
29955,
29953,
29896,
29929,
29900,
29946,
29955,
29945,
511,
6702,
1707,
29906,
742,
29871,
29906,
29929,
29946,
29889,
29900,
29955,
29929,
29900,
29945,
29896,
29941,
29947,
29941,
29941,
29929,
29929,
29941,
511,
6702,
14246,
29906,
18237,
742,
29871,
29896,
29889,
29953,
29947,
29953,
29896,
29896,
29945,
29941,
29953,
29945,
29900,
29946,
29946,
29941,
29945,
29945,
29946,
511,
6702,
14246,
29896,
18237,
742,
29871,
29906,
29889,
29900,
29906,
29946,
29953,
29946,
29947,
29896,
29941,
29945,
29906,
29896,
29900,
29955,
29900,
29900,
29929,
511,
6702,
1111,
3169,
29918,
29881,
742,
29871,
29900,
29889,
29953,
29929,
29900,
29947,
29946,
29955,
29945,
29955,
29900,
29947,
29953,
29947,
29900,
29945,
29947,
29947,
511,
6702,
4181,
742,
29871,
29906,
29889,
29896,
29947,
29946,
29953,
29945,
29896,
29947,
29941,
29929,
29929,
29941,
29955,
29953,
29945,
29941,
29947,
511,
6702,
13519,
29896,
18237,
742,
29871,
29900,
29889,
29953,
29929,
29896,
29953,
29941,
29941,
29955,
29953,
29896,
29953,
29945,
29929,
29945,
29947,
29929,
29929,
511,
6702,
13519,
29906,
18237,
742,
29871,
29900,
29889,
29945,
29953,
29955,
29896,
29906,
29955,
29955,
29906,
29945,
29953,
29896,
29946,
29946,
29945,
29941,
29953,
29947,
29897,
1402,
5186,
29918,
1707,
8837,
29922,
8824,
29892,
385,
420,
2433,
29909,
742,
289,
978,
2433,
29933,
742,
1134,
2433,
29873,
29899,
3057,
29901,
7803,
29899,
17708,
17090,
10016,
15380,
11681,
713,
778,
1495,
13,
308,
13,
4706,
319,
11759,
29906,
29946,
29892,
29953,
29896,
29892,
29945,
29929,
29892,
29946,
29953,
29892,
29946,
29941,
29892,
29946,
29946,
29892,
29945,
29906,
29892,
29946,
29941,
29892,
29945,
29947,
29892,
29953,
29955,
29892,
29953,
29906,
29892,
29945,
29955,
29892,
29955,
29896,
29892,
29946,
29929,
29892,
29945,
29946,
29892,
29946,
29941,
29892,
29945,
29941,
29892,
29945,
29955,
29892,
29946,
29929,
29892,
29945,
29953,
29892,
29941,
29941,
29962,
13,
4706,
350,
11759,
29946,
29906,
29892,
29941,
29941,
29892,
29946,
29953,
29892,
29941,
29955,
29892,
29946,
29941,
29892,
29946,
29896,
29892,
29896,
29900,
29892,
29946,
29906,
29892,
29945,
29945,
29892,
29896,
29929,
29892,
29896,
29955,
29892,
29945,
29945,
29892,
29906,
29953,
29892,
29945,
29946,
29892,
29953,
29900,
29892,
29906,
29947,
29892,
29953,
29906,
29892,
29906,
29900,
29892,
29945,
29941,
29892,
29946,
29947,
29892,
29941,
29955,
29892,
29947,
29945,
29892,
29946,
29906,
29962,
13,
308,
13,
4706,
360,
29922,
29911,
1688,
580,
13,
4706,
360,
29889,
3389,
29898,
29909,
29892,
29933,
29892,
11745,
29918,
1707,
8837,
29922,
8824,
29897,
13,
13,
4706,
363,
1820,
297,
1051,
29898,
29934,
29889,
8149,
580,
1125,
13,
9651,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
29928,
29961,
1989,
1402,
29934,
29961,
1989,
2314,
13,
308,
13,
13,
13,
632,
13,
1753,
9460,
7295,
13,
1678,
736,
443,
27958,
29889,
3057,
5091,
568,
3552,
13,
9651,
443,
27958,
29889,
5675,
5091,
568,
29898,
3057,
29918,
698,
342,
29918,
3274,
2859,
29897,
13,
462,
1669,
876,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
396,
1065,
6987,
13,
1678,
28877,
353,
443,
27958,
29889,
1626,
3057,
16802,
580,
13,
1678,
28877,
29889,
3389,
29898,
13495,
3101,
13,
268,
13,
2
] |
gensim/gensim/test/svd_error.py | Abas-Khan/thesis | 3 | 134302 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 <NAME> <<EMAIL>>
"""USAGE: %(program)s MATRIX.mm [CLIP_DOCS] [CLIP_TERMS]
Check truncated SVD error for the algo in gensim, using a given corpus. This script
runs the decomposition with several internal parameters (number of requested factors,
iterative chunk size) and reports error for each parameter combination.
The number of input documents is clipped to the first CLIP_DOCS. Similarly,
only the first CLIP_TERMS are considered (features with id >= CLIP_TERMS are
ignored, effectively restricting the vocabulary size). If you don't specify them,
the entire matrix will be used.
Example: ./svd_error.py ~/gensim/results/wiki_en_v10k.mm.bz2 100000 10000
"""
from __future__ import print_function, with_statement
import logging
import os
import sys
import time
import bz2
import itertools
import numpy as np
import scipy.linalg
import gensim
try:
from sparsesvd import sparsesvd
except ImportError:
# no SVDLIBC: install with `easy_install sparsesvd` if you want SVDLIBC results as well
sparsesvd = None
sparsesvd = None # don't use SVDLIBC
FACTORS = [300] # which num_topics to try
CHUNKSIZE = [10000, 1000] # which chunksize to try
POWER_ITERS = [0, 1, 2, 4, 6] # extra power iterations for the randomized algo
# when reporting reconstruction error, also report spectral norm error? (very slow)
COMPUTE_NORM2 = False
def norm2(a):
"""Spectral norm ("norm 2") of a symmetric matrix `a`."""
if COMPUTE_NORM2:
logging.info("computing spectral norm of a %s matrix", str(a.shape))
return scipy.linalg.eigvalsh(a).max() # much faster than np.linalg.norm(2)
else:
return np.nan
def rmse(diff):
return np.sqrt(1.0 * np.multiply(diff, diff).sum() / diff.size)
def print_error(name, aat, u, s, ideal_nf, ideal_n2):
err = -np.dot(u, np.dot(np.diag(s), u.T))
err += aat
nf, n2 = np.linalg.norm(err), norm2(err)
print(
'%s error: norm_frobenius=%f (/ideal=%g), norm2=%f (/ideal=%g), RMSE=%g' %
(name, nf, nf / ideal_nf, n2, n2 / ideal_n2, rmse(err))
)
sys.stdout.flush()
class ClippedCorpus(object):
def __init__(self, corpus, max_docs, max_terms):
self.corpus = corpus
self.max_docs, self.max_terms = max_docs, max_terms
def __iter__(self):
for doc in itertools.islice(self.corpus, self.max_docs):
yield [(f, w) for f, w in doc if f < self.max_terms]
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
logging.info("running %s", " ".join(sys.argv))
program = os.path.basename(sys.argv[0])
# do we have enough cmd line arguments?
if len(sys.argv) < 2:
print(globals()["__doc__"] % locals())
sys.exit(1)
fname = sys.argv[1]
if fname.endswith('bz2'):
mm = gensim.corpora.MmCorpus(bz2.BZ2File(fname))
else:
mm = gensim.corpora.MmCorpus(fname)
# extra cmd parameters = use a subcorpus (fewer docs, smaller vocab)
if len(sys.argv) > 2:
n = int(sys.argv[2])
else:
n = mm.num_docs
if len(sys.argv) > 3:
m = int(sys.argv[3])
else:
m = mm.num_terms
logging.info("using %i documents and %i features", n, m)
corpus = ClippedCorpus(mm, n, m)
id2word = gensim.utils.FakeDict(m)
logging.info("computing corpus * corpus^T") # eigenvalues of this matrix are singular values of `corpus`, squared
aat = np.zeros((m, m), dtype=np.float64)
for chunk in gensim.utils.grouper(corpus, chunksize=5000):
num_nnz = sum(len(doc) for doc in chunk)
chunk = gensim.matutils.corpus2csc(chunk, num_nnz=num_nnz, num_terms=m, num_docs=len(chunk), dtype=np.float32)
chunk = chunk * chunk.T
chunk = chunk.toarray()
aat += chunk
del chunk
logging.info("computing full decomposition of corpus * corpus^t")
aat = aat.astype(np.float32)
spectrum_s, spectrum_u = scipy.linalg.eigh(aat)
spectrum_s = spectrum_s[::-1] # re-order to descending eigenvalue order
spectrum_u = spectrum_u.T[::-1].T
np.save(fname + '.spectrum.npy', spectrum_s)
for factors in FACTORS:
err = -np.dot(spectrum_u[:, :factors], np.dot(np.diag(spectrum_s[:factors]), spectrum_u[:, :factors].T))
err += aat
ideal_fro = np.linalg.norm(err)
del err
ideal_n2 = spectrum_s[factors + 1]
print('*' * 40, "%i factors, ideal error norm_frobenius=%f, norm_2=%f" % (factors, ideal_fro, ideal_n2))
print("*" * 30, end="")
print_error("baseline", aat,
np.zeros((m, factors)), np.zeros((factors)), ideal_fro, ideal_n2)
if sparsesvd:
logging.info("computing SVDLIBC SVD for %i factors", factors)
taken = time.time()
corpus_ram = gensim.matutils.corpus2csc(corpus, num_terms=m)
ut, s, vt = sparsesvd(corpus_ram, factors)
taken = time.time() - taken
del corpus_ram
del vt
u, s = ut.T.astype(np.float32), s.astype(np.float32)**2 # convert singular values to eigenvalues
del ut
print("SVDLIBC SVD for %i factors took %s s (spectrum %f .. %f)"
% (factors, taken, s[0], s[-1]))
print_error("SVDLIBC", aat, u, s, ideal_fro, ideal_n2)
del u
for power_iters in POWER_ITERS:
for chunksize in CHUNKSIZE:
logging.info(
"computing incremental SVD for %i factors, %i power iterations, chunksize %i",
factors, power_iters, chunksize
)
taken = time.time()
gensim.models.lsimodel.P2_EXTRA_ITERS = power_iters
model = gensim.models.LsiModel(
corpus, id2word=id2word, num_topics=factors,
chunksize=chunksize, power_iters=power_iters
)
taken = time.time() - taken
u, s = model.projection.u.astype(np.float32), model.projection.s.astype(np.float32)**2
del model
print(
"incremental SVD for %i factors, %i power iterations, "
"chunksize %i took %s s (spectrum %f .. %f)" %
(factors, power_iters, chunksize, taken, s[0], s[-1])
)
print_error('incremental SVD', aat, u, s, ideal_fro, ideal_n2)
del u
logging.info("computing multipass SVD for %i factors, %i power iterations", factors, power_iters)
taken = time.time()
model = gensim.models.LsiModel(
corpus, id2word=id2word, num_topics=factors, chunksize=2000,
onepass=False, power_iters=power_iters
)
taken = time.time() - taken
u, s = model.projection.u.astype(np.float32), model.projection.s.astype(np.float32)**2
del model
print(
"multipass SVD for %i factors, "
"%i power iterations took %s s (spectrum %f .. %f)" %
(factors, power_iters, taken, s[0], s[-1])
)
print_error('multipass SVD', aat, u, s, ideal_fro, ideal_n2)
del u
logging.info("finished running %s", program)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29896,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
13,
13,
15945,
29908,
3308,
10461,
29901,
1273,
29898,
8860,
29897,
29879,
341,
1299,
3960,
29990,
29889,
4317,
518,
27205,
29925,
29918,
3970,
9295,
29962,
518,
27205,
29925,
29918,
4945,
4345,
29962,
13,
13,
5596,
21022,
630,
317,
10699,
1059,
363,
278,
24673,
297,
26943,
326,
29892,
773,
263,
2183,
1034,
13364,
29889,
910,
2471,
13,
3389,
29879,
278,
26227,
411,
3196,
7463,
4128,
313,
4537,
310,
13877,
13879,
29892,
13,
1524,
1230,
19875,
2159,
29897,
322,
13676,
1059,
363,
1269,
3443,
10296,
29889,
13,
13,
1576,
1353,
310,
1881,
10701,
338,
9335,
2986,
304,
278,
937,
24492,
29925,
29918,
3970,
9295,
29889,
20175,
29892,
13,
6194,
278,
937,
24492,
29925,
29918,
4945,
4345,
526,
5545,
313,
22100,
411,
1178,
6736,
24492,
29925,
29918,
4945,
4345,
526,
13,
647,
4395,
29892,
17583,
9250,
292,
278,
7931,
370,
352,
653,
2159,
467,
960,
366,
1016,
29915,
29873,
6084,
963,
29892,
13,
1552,
4152,
4636,
674,
367,
1304,
29889,
13,
13,
14023,
29901,
11431,
4501,
29881,
29918,
2704,
29889,
2272,
3695,
29914,
17397,
326,
29914,
9902,
29914,
4594,
29918,
264,
29918,
29894,
29896,
29900,
29895,
29889,
4317,
29889,
29890,
29920,
29906,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29871,
29896,
29900,
29900,
29900,
29900,
13,
15945,
29908,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
29892,
411,
29918,
20788,
13,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
931,
13,
5215,
289,
29920,
29906,
13,
5215,
4256,
8504,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
4560,
2272,
29889,
29880,
979,
29887,
13,
13,
5215,
26943,
326,
13,
13,
2202,
29901,
13,
1678,
515,
805,
1503,
267,
27491,
1053,
805,
1503,
267,
27491,
13,
19499,
16032,
2392,
29901,
13,
1678,
396,
694,
317,
10699,
5265,
5371,
29901,
2601,
411,
421,
29872,
8995,
29918,
6252,
805,
1503,
267,
27491,
29952,
565,
366,
864,
317,
10699,
5265,
5371,
2582,
408,
1532,
13,
1678,
805,
1503,
267,
27491,
353,
6213,
13,
13,
29879,
862,
29879,
267,
27491,
353,
6213,
29871,
396,
1016,
29915,
29873,
671,
317,
10699,
5265,
5371,
13,
13,
4519,
1783,
24125,
353,
518,
29941,
29900,
29900,
29962,
29871,
396,
607,
954,
29918,
3332,
1199,
304,
1018,
13,
3210,
3904,
29968,
14226,
353,
518,
29896,
29900,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
29962,
29871,
396,
607,
521,
18801,
675,
304,
1018,
13,
29925,
9806,
1001,
29918,
1806,
23598,
353,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29953,
29962,
29871,
396,
4805,
3081,
24372,
363,
278,
4036,
1891,
24673,
13,
13,
29937,
746,
23415,
17789,
4080,
1059,
29892,
884,
3461,
23161,
6056,
1059,
29973,
313,
1201,
5232,
29897,
13,
21514,
26027,
29918,
29940,
12054,
29906,
353,
7700,
13,
13,
13,
1753,
6056,
29906,
29898,
29874,
1125,
13,
1678,
9995,
29903,
1103,
1705,
6056,
4852,
12324,
29871,
29906,
1159,
310,
263,
18348,
4636,
421,
29874,
29952,
1213,
15945,
13,
1678,
565,
4810,
3580,
26027,
29918,
29940,
12054,
29906,
29901,
13,
4706,
12183,
29889,
3888,
703,
12097,
292,
23161,
6056,
310,
263,
1273,
29879,
4636,
613,
851,
29898,
29874,
29889,
12181,
876,
13,
4706,
736,
4560,
2272,
29889,
29880,
979,
29887,
29889,
29872,
335,
791,
845,
29898,
29874,
467,
3317,
580,
29871,
396,
1568,
8473,
1135,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
29906,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
7442,
29889,
13707,
13,
13,
13,
1753,
20241,
344,
29898,
12765,
1125,
13,
1678,
736,
7442,
29889,
3676,
29898,
29896,
29889,
29900,
334,
7442,
29889,
18056,
368,
29898,
12765,
29892,
2923,
467,
2083,
580,
847,
2923,
29889,
2311,
29897,
13,
13,
13,
1753,
1596,
29918,
2704,
29898,
978,
29892,
263,
271,
29892,
318,
29892,
269,
29892,
10839,
29918,
29876,
29888,
29892,
10839,
29918,
29876,
29906,
1125,
13,
1678,
4589,
353,
448,
9302,
29889,
6333,
29898,
29884,
29892,
7442,
29889,
6333,
29898,
9302,
29889,
6051,
351,
29898,
29879,
511,
318,
29889,
29911,
876,
13,
1678,
4589,
4619,
263,
271,
13,
1678,
302,
29888,
29892,
302,
29906,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
3127,
511,
6056,
29906,
29898,
3127,
29897,
13,
1678,
1596,
29898,
13,
4706,
14210,
29879,
1059,
29901,
6056,
29918,
29888,
307,
1785,
2482,
16328,
29888,
20374,
680,
284,
16328,
29887,
511,
6056,
29906,
16328,
29888,
20374,
680,
284,
16328,
29887,
511,
390,
29924,
1660,
16328,
29887,
29915,
1273,
13,
4706,
313,
978,
29892,
302,
29888,
29892,
302,
29888,
847,
10839,
29918,
29876,
29888,
29892,
302,
29906,
29892,
302,
29906,
847,
10839,
29918,
29876,
29906,
29892,
20241,
344,
29898,
3127,
876,
13,
1678,
1723,
13,
1678,
10876,
29889,
25393,
29889,
23126,
580,
13,
13,
13,
1990,
315,
492,
2986,
12521,
13364,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1034,
13364,
29892,
4236,
29918,
2640,
29892,
4236,
29918,
357,
1516,
1125,
13,
4706,
1583,
29889,
2616,
13364,
353,
1034,
13364,
13,
4706,
1583,
29889,
3317,
29918,
2640,
29892,
1583,
29889,
3317,
29918,
357,
1516,
353,
4236,
29918,
2640,
29892,
4236,
29918,
357,
1516,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
363,
1574,
297,
4256,
8504,
29889,
275,
5897,
29898,
1311,
29889,
2616,
13364,
29892,
1583,
29889,
3317,
29918,
2640,
1125,
13,
9651,
7709,
17288,
29888,
29892,
281,
29897,
363,
285,
29892,
281,
297,
1574,
565,
285,
529,
1583,
29889,
3317,
29918,
357,
1516,
29962,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
12183,
29889,
16121,
3991,
29898,
4830,
2433,
29995,
29898,
294,
312,
603,
29897,
29879,
584,
1273,
29898,
5563,
978,
29897,
29879,
584,
1273,
29898,
4906,
29897,
29879,
742,
3233,
29922,
21027,
29889,
11690,
29897,
13,
1678,
12183,
29889,
3888,
703,
21094,
1273,
29879,
613,
376,
11393,
7122,
29898,
9675,
29889,
19218,
876,
13,
13,
1678,
1824,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
9675,
29889,
19218,
29961,
29900,
2314,
13,
1678,
396,
437,
591,
505,
3307,
9920,
1196,
6273,
29973,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
529,
29871,
29906,
29901,
13,
4706,
1596,
29898,
23705,
1338,
580,
3366,
1649,
1514,
1649,
3108,
1273,
1180,
1338,
3101,
13,
4706,
10876,
29889,
13322,
29898,
29896,
29897,
13,
13,
1678,
285,
978,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
1678,
565,
285,
978,
29889,
1975,
2541,
877,
29890,
29920,
29906,
29374,
13,
4706,
5654,
353,
26943,
326,
29889,
2616,
1971,
29874,
29889,
29924,
29885,
12521,
13364,
29898,
29890,
29920,
29906,
29889,
29933,
29999,
29906,
2283,
29898,
29888,
978,
876,
13,
1678,
1683,
29901,
13,
4706,
5654,
353,
26943,
326,
29889,
2616,
1971,
29874,
29889,
29924,
29885,
12521,
13364,
29898,
29888,
978,
29897,
13,
13,
1678,
396,
4805,
9920,
4128,
353,
671,
263,
1014,
2616,
13364,
313,
1725,
556,
10561,
29892,
7968,
7931,
370,
29897,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1405,
29871,
29906,
29901,
13,
4706,
302,
353,
938,
29898,
9675,
29889,
19218,
29961,
29906,
2314,
13,
1678,
1683,
29901,
13,
4706,
302,
353,
5654,
29889,
1949,
29918,
2640,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1405,
29871,
29941,
29901,
13,
4706,
286,
353,
938,
29898,
9675,
29889,
19218,
29961,
29941,
2314,
13,
1678,
1683,
29901,
13,
4706,
286,
353,
5654,
29889,
1949,
29918,
357,
1516,
13,
1678,
12183,
29889,
3888,
703,
4746,
1273,
29875,
10701,
322,
1273,
29875,
5680,
613,
302,
29892,
286,
29897,
13,
1678,
1034,
13364,
353,
315,
492,
2986,
12521,
13364,
29898,
4317,
29892,
302,
29892,
286,
29897,
13,
1678,
1178,
29906,
1742,
353,
26943,
326,
29889,
13239,
29889,
29943,
1296,
21533,
29898,
29885,
29897,
13,
13,
1678,
12183,
29889,
3888,
703,
12097,
292,
1034,
13364,
334,
1034,
13364,
29985,
29911,
1159,
29871,
396,
25973,
310,
445,
4636,
526,
13512,
1819,
310,
421,
2616,
13364,
1673,
10674,
1965,
13,
1678,
263,
271,
353,
7442,
29889,
3298,
359,
3552,
29885,
29892,
286,
511,
26688,
29922,
9302,
29889,
7411,
29953,
29946,
29897,
13,
1678,
363,
19875,
297,
26943,
326,
29889,
13239,
29889,
629,
283,
546,
29898,
2616,
13364,
29892,
521,
18801,
675,
29922,
29945,
29900,
29900,
29900,
1125,
13,
4706,
954,
29918,
15755,
29920,
353,
2533,
29898,
2435,
29898,
1514,
29897,
363,
1574,
297,
19875,
29897,
13,
4706,
19875,
353,
26943,
326,
29889,
2922,
13239,
29889,
2616,
13364,
29906,
29883,
1557,
29898,
29812,
29892,
954,
29918,
15755,
29920,
29922,
1949,
29918,
15755,
29920,
29892,
954,
29918,
357,
1516,
29922,
29885,
29892,
954,
29918,
2640,
29922,
2435,
29898,
29812,
511,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
4706,
19875,
353,
19875,
334,
19875,
29889,
29911,
13,
4706,
19875,
353,
19875,
29889,
517,
2378,
580,
13,
4706,
263,
271,
4619,
19875,
13,
4706,
628,
19875,
13,
13,
1678,
12183,
29889,
3888,
703,
12097,
292,
2989,
26227,
310,
1034,
13364,
334,
1034,
13364,
29985,
29873,
1159,
13,
1678,
263,
271,
353,
263,
271,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
18272,
29918,
29879,
29892,
18272,
29918,
29884,
353,
4560,
2272,
29889,
29880,
979,
29887,
29889,
29872,
1141,
29898,
29874,
271,
29897,
13,
1678,
18272,
29918,
29879,
353,
18272,
29918,
29879,
29961,
1057,
29899,
29896,
29962,
29871,
396,
337,
29899,
2098,
304,
5153,
2548,
7388,
1767,
1797,
13,
1678,
18272,
29918,
29884,
353,
18272,
29918,
29884,
29889,
29911,
29961,
1057,
29899,
29896,
1822,
29911,
13,
1678,
7442,
29889,
7620,
29898,
29888,
978,
718,
15300,
21494,
5848,
29889,
29876,
2272,
742,
18272,
29918,
29879,
29897,
13,
13,
1678,
363,
13879,
297,
13515,
1783,
24125,
29901,
13,
4706,
4589,
353,
448,
9302,
29889,
6333,
29898,
21494,
5848,
29918,
29884,
7503,
29892,
584,
17028,
943,
1402,
7442,
29889,
6333,
29898,
9302,
29889,
6051,
351,
29898,
21494,
5848,
29918,
29879,
7503,
17028,
943,
11724,
18272,
29918,
29884,
7503,
29892,
584,
17028,
943,
1822,
29911,
876,
13,
4706,
4589,
4619,
263,
271,
13,
4706,
10839,
29918,
29888,
307,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
3127,
29897,
13,
4706,
628,
4589,
13,
4706,
10839,
29918,
29876,
29906,
353,
18272,
29918,
29879,
29961,
17028,
943,
718,
29871,
29896,
29962,
13,
4706,
1596,
877,
29930,
29915,
334,
29871,
29946,
29900,
29892,
11860,
29875,
13879,
29892,
10839,
1059,
6056,
29918,
29888,
307,
1785,
2482,
16328,
29888,
29892,
6056,
29918,
29906,
16328,
29888,
29908,
1273,
313,
17028,
943,
29892,
10839,
29918,
29888,
307,
29892,
10839,
29918,
29876,
29906,
876,
13,
4706,
1596,
703,
20605,
334,
29871,
29941,
29900,
29892,
1095,
543,
1159,
13,
4706,
1596,
29918,
2704,
703,
6500,
5570,
613,
263,
271,
29892,
13,
462,
1678,
7442,
29889,
3298,
359,
3552,
29885,
29892,
13879,
8243,
7442,
29889,
3298,
359,
3552,
17028,
943,
8243,
10839,
29918,
29888,
307,
29892,
10839,
29918,
29876,
29906,
29897,
13,
4706,
565,
805,
1503,
267,
27491,
29901,
13,
9651,
12183,
29889,
3888,
703,
12097,
292,
317,
10699,
5265,
5371,
317,
10699,
363,
1273,
29875,
13879,
613,
13879,
29897,
13,
9651,
4586,
353,
931,
29889,
2230,
580,
13,
9651,
1034,
13364,
29918,
2572,
353,
26943,
326,
29889,
2922,
13239,
29889,
2616,
13364,
29906,
29883,
1557,
29898,
2616,
13364,
29892,
954,
29918,
357,
1516,
29922,
29885,
29897,
13,
9651,
3477,
29892,
269,
29892,
325,
29873,
353,
805,
1503,
267,
27491,
29898,
2616,
13364,
29918,
2572,
29892,
13879,
29897,
13,
9651,
4586,
353,
931,
29889,
2230,
580,
448,
4586,
13,
9651,
628,
1034,
13364,
29918,
2572,
13,
9651,
628,
325,
29873,
13,
9651,
318,
29892,
269,
353,
3477,
29889,
29911,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
511,
269,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
1068,
29906,
29871,
396,
3588,
13512,
1819,
304,
25973,
13,
9651,
628,
3477,
13,
9651,
1596,
703,
7597,
29928,
5265,
5371,
317,
10699,
363,
1273,
29875,
13879,
3614,
1273,
29879,
269,
313,
21494,
5848,
1273,
29888,
6317,
1273,
29888,
5513,
13,
462,
29871,
1273,
313,
17028,
943,
29892,
4586,
29892,
269,
29961,
29900,
1402,
269,
14352,
29896,
12622,
13,
9651,
1596,
29918,
2704,
703,
7597,
29928,
5265,
5371,
613,
263,
271,
29892,
318,
29892,
269,
29892,
10839,
29918,
29888,
307,
29892,
10839,
29918,
29876,
29906,
29897,
13,
9651,
628,
318,
13,
4706,
363,
3081,
29918,
277,
414,
297,
349,
9806,
1001,
29918,
1806,
23598,
29901,
13,
9651,
363,
521,
18801,
675,
297,
5868,
3904,
29968,
14226,
29901,
13,
18884,
12183,
29889,
3888,
29898,
13,
462,
1678,
376,
12097,
292,
11924,
284,
317,
10699,
363,
1273,
29875,
13879,
29892,
1273,
29875,
3081,
24372,
29892,
521,
18801,
675,
1273,
29875,
613,
13,
462,
1678,
13879,
29892,
3081,
29918,
277,
414,
29892,
521,
18801,
675,
13,
18884,
1723,
13,
18884,
4586,
353,
931,
29889,
2230,
580,
13,
18884,
26943,
326,
29889,
9794,
29889,
3137,
326,
27224,
29889,
29925,
29906,
29918,
12194,
4717,
29918,
1806,
23598,
353,
3081,
29918,
277,
414,
13,
18884,
1904,
353,
26943,
326,
29889,
9794,
29889,
29931,
1039,
3195,
29898,
13,
462,
1678,
1034,
13364,
29892,
1178,
29906,
1742,
29922,
333,
29906,
1742,
29892,
954,
29918,
3332,
1199,
29922,
17028,
943,
29892,
13,
462,
1678,
521,
18801,
675,
29922,
305,
18801,
675,
29892,
3081,
29918,
277,
414,
29922,
13519,
29918,
277,
414,
13,
18884,
1723,
13,
18884,
4586,
353,
931,
29889,
2230,
580,
448,
4586,
13,
18884,
318,
29892,
269,
353,
1904,
29889,
771,
6929,
29889,
29884,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
511,
1904,
29889,
771,
6929,
29889,
29879,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
1068,
29906,
13,
18884,
628,
1904,
13,
18884,
1596,
29898,
13,
462,
1678,
376,
25629,
284,
317,
10699,
363,
1273,
29875,
13879,
29892,
1273,
29875,
3081,
24372,
29892,
376,
13,
462,
1678,
376,
305,
18801,
675,
1273,
29875,
3614,
1273,
29879,
269,
313,
21494,
5848,
1273,
29888,
6317,
1273,
29888,
5513,
1273,
13,
462,
1678,
313,
17028,
943,
29892,
3081,
29918,
277,
414,
29892,
521,
18801,
675,
29892,
4586,
29892,
269,
29961,
29900,
1402,
269,
14352,
29896,
2314,
13,
18884,
1723,
13,
18884,
1596,
29918,
2704,
877,
25629,
284,
317,
10699,
742,
263,
271,
29892,
318,
29892,
269,
29892,
10839,
29918,
29888,
307,
29892,
10839,
29918,
29876,
29906,
29897,
13,
18884,
628,
318,
13,
9651,
12183,
29889,
3888,
703,
12097,
292,
6674,
465,
317,
10699,
363,
1273,
29875,
13879,
29892,
1273,
29875,
3081,
24372,
613,
13879,
29892,
3081,
29918,
277,
414,
29897,
13,
9651,
4586,
353,
931,
29889,
2230,
580,
13,
9651,
1904,
353,
26943,
326,
29889,
9794,
29889,
29931,
1039,
3195,
29898,
13,
18884,
1034,
13364,
29892,
1178,
29906,
1742,
29922,
333,
29906,
1742,
29892,
954,
29918,
3332,
1199,
29922,
17028,
943,
29892,
521,
18801,
675,
29922,
29906,
29900,
29900,
29900,
29892,
13,
18884,
697,
3364,
29922,
8824,
29892,
3081,
29918,
277,
414,
29922,
13519,
29918,
277,
414,
13,
9651,
1723,
13,
9651,
4586,
353,
931,
29889,
2230,
580,
448,
4586,
13,
9651,
318,
29892,
269,
353,
1904,
29889,
771,
6929,
29889,
29884,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
511,
1904,
29889,
771,
6929,
29889,
29879,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
1068,
29906,
13,
9651,
628,
1904,
13,
9651,
1596,
29898,
13,
18884,
376,
18056,
465,
317,
10699,
363,
1273,
29875,
13879,
29892,
376,
13,
18884,
11860,
29875,
3081,
24372,
3614,
1273,
29879,
269,
313,
21494,
5848,
1273,
29888,
6317,
1273,
29888,
5513,
1273,
13,
18884,
313,
17028,
943,
29892,
3081,
29918,
277,
414,
29892,
4586,
29892,
269,
29961,
29900,
1402,
269,
14352,
29896,
2314,
13,
9651,
1723,
13,
9651,
1596,
29918,
2704,
877,
18056,
465,
317,
10699,
742,
263,
271,
29892,
318,
29892,
269,
29892,
10839,
29918,
29888,
307,
29892,
10839,
29918,
29876,
29906,
29897,
13,
9651,
628,
318,
13,
13,
1678,
12183,
29889,
3888,
703,
4951,
3276,
2734,
1273,
29879,
613,
1824,
29897,
13,
2
] |
foodgram/migrations/0008_auto_20210303_2022.py | valkhmyrov/foodgram-project | 0 | 42209 | <reponame>valkhmyrov/foodgram-project
# Generated by Django 3.1.6 on 2021-03-03 20:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('foodgram', '0007_recipe_pub_date'),
]
operations = [
migrations.AlterModelOptions(
name='recipe',
options={'ordering': ['-pub_date']},
),
migrations.AlterModelOptions(
name='tag',
options={},
),
migrations.CreateModel(
name='Follow',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('author', models.ForeignKey(help_text='Публицист', on_delete=django.db.models.deletion.CASCADE, related_name='following', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(help_text='Подписчик', on_delete=django.db.models.deletion.CASCADE, related_name='follower', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['user', 'author'],
},
),
migrations.AddConstraint(
model_name='follow',
constraint=models.UniqueConstraint(fields=('user', 'author'), name='unique together'),
),
]
| [
1,
529,
276,
1112,
420,
29958,
791,
15339,
1357,
10139,
29914,
1181,
397,
1393,
29899,
4836,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29896,
29889,
29953,
373,
29871,
29906,
29900,
29906,
29896,
29899,
29900,
29941,
29899,
29900,
29941,
29871,
29906,
29900,
29901,
29906,
29906,
13,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
9725,
800,
29889,
2774,
932,
519,
29918,
10836,
29898,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
511,
13,
4706,
6702,
1181,
397,
1393,
742,
525,
29900,
29900,
29900,
29955,
29918,
4361,
412,
29918,
5467,
29918,
1256,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2499,
357,
3195,
5856,
29898,
13,
9651,
1024,
2433,
4361,
412,
742,
13,
9651,
3987,
3790,
29915,
2098,
292,
2396,
6024,
29899,
5467,
29918,
1256,
2033,
1118,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3195,
5856,
29898,
13,
9651,
1024,
2433,
4039,
742,
13,
9651,
3987,
3790,
1118,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
29943,
2952,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
8921,
742,
4733,
29889,
27755,
2558,
29898,
8477,
29918,
726,
2433,
30013,
29960,
5116,
1138,
464,
742,
373,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
23031,
292,
742,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
8243,
13,
18884,
6702,
1792,
742,
4733,
29889,
27755,
2558,
29898,
8477,
29918,
726,
2433,
30013,
10285,
8993,
28407,
742,
373,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
23031,
261,
742,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
8243,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
2098,
292,
2396,
6024,
1792,
742,
525,
8921,
7464,
13,
9651,
2981,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
21529,
29898,
13,
9651,
1904,
29918,
978,
2433,
23031,
742,
13,
9651,
7276,
29922,
9794,
29889,
8110,
802,
21529,
29898,
9621,
29922,
877,
1792,
742,
525,
8921,
5477,
1024,
2433,
13092,
4208,
5477,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
tests/ut/python/parallel/test_onehot.py | ythlml/mindspore | 7 | 66407 | # Copyright 2019 Huawei Technologies 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.
import numpy as np
import mindspore as ms
import mindspore.nn as nn
from mindspore import Tensor
from mindspore import context
from mindspore.common.api import _executor
from mindspore.ops import composite as C
from mindspore.ops import operations as P
from mindspore.ops.operations.comm_ops import _VirtualDataset
context.set_context(mode=context.GRAPH_MODE)
class NetWithLoss(nn.Cell):
def __init__(self, network, strategy3, strategy4, axis):
super(NetWithLoss, self).__init__()
self.virtual_dataset = _VirtualDataset()
self.one_hot = P.OneHot(axis=axis).set_strategy(strategy3)
self.on_value = Tensor(2.0, ms.float32)
self.off_value = Tensor(1.0, ms.float32)
self.loss = P.SoftmaxCrossEntropyWithLogits().set_strategy(strategy4)
self.network = network
def construct(self, x, y, b):
b_virtual = self.virtual_dataset(b)
predict = self.network(x, y)
label = self.one_hot(b_virtual, 64, self.on_value, self.off_value)
return self.loss(predict, label)[0]
class GradWrap(nn.Cell):
def __init__(self, network):
super(GradWrap, self).__init__()
self.network = network
def construct(self, x, y, b):
return C.grad_all(self.network)(x, y, b)
class Net(nn.Cell):
def __init__(self, strategy1, strategy2):
super().__init__()
self.matmul = P.MatMul().set_strategy(strategy1)
self.gelu = P.Gelu().set_strategy(strategy2)
def construct(self, x, y):
out = self.matmul(x, y)
out = self.gelu(out)
return out
def compile_graph(strategy1, strategy2, strategy3, strategy4, auto=False, onthot_axis=-1):
net = GradWrap(NetWithLoss(Net(strategy1, strategy2), strategy3, strategy4, axis=onthot_axis))
net.set_auto_parallel()
if auto:
context.set_auto_parallel_context(parallel_mode="auto_parallel")
else:
context.set_auto_parallel_context(parallel_mode="semi_auto_parallel")
x = Tensor(np.ones([64, 32]), dtype=ms.float32)
y = Tensor(np.ones([32, 64]), dtype=ms.float32)
b = Tensor(np.ones([64]), dtype=ms.int32)
_executor.compile(net, x, y, b)
def test_onehot_model_parallel():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = ((1, 16), (), ())
strategy4 = ((16, 1), (16, 1))
compile_graph(strategy1, strategy2, strategy3, strategy4)
def test_onehot_batch_parallel():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = ((16, 1), (), ())
strategy4 = ((16, 1), (16, 1))
compile_graph(strategy1, strategy2, strategy3, strategy4)
def test_onehot_batch_parallel_invalid_strategy():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = ((16,), (), ())
strategy4 = ((16, 1), (16, 1))
try:
compile_graph(strategy1, strategy2, strategy3, strategy4)
except:
pass
def test_onehot_repeated_calculation():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = ((4, 1), (), ())
strategy4 = ((16, 1), (16, 1))
compile_graph(strategy1, strategy2, strategy3, strategy4)
def test_onehot_auto():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = None
strategy2 = None
strategy3 = None
strategy4 = None
compile_graph(strategy1, strategy2, strategy3, strategy4, auto=True)
def test_onehot_batch_parallel_axis0():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = ((16, 1), (), ())
strategy4 = ((16, 1), (16, 1))
compile_graph(strategy1, strategy2, strategy3, strategy4, onthot_axis=0)
# auto parallel for onehot axis equal to 0 has not been supported yet
def test_onehot_batch_parallel_invalid_strategy_axis0():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = None
strategy4 = ((16, 1), (16, 1))
try:
compile_graph(strategy1, strategy2, strategy3, strategy4, onthot_axis=0)
except:
pass
def test_onehot_repeated_calculation_axis0():
context.set_auto_parallel_context(device_num=16, global_rank=0)
strategy1 = ((2, 4), (4, 2))
strategy2 = ((2, 8),)
strategy3 = ((4, 1), (), ())
strategy4 = ((16, 1), (16, 1))
compile_graph(strategy1, strategy2, strategy3, strategy4, onthot_axis=0)
def test_onehot_auto_axis0():
context.set_auto_parallel_context(device_num=16, global_rank=14)
strategy1 = None
strategy2 = None
strategy3 = None
strategy4 = None
compile_graph(strategy1, strategy2, strategy3, strategy4, auto=True, onthot_axis=0)
| [
1,
396,
14187,
1266,
29871,
29906,
29900,
29896,
29929,
379,
3357,
26599,
8364,
11763,
3189,
1696,
19806,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
5215,
12655,
408,
7442,
13,
13,
5215,
3458,
1028,
487,
408,
10887,
13,
5215,
3458,
1028,
487,
29889,
15755,
408,
302,
29876,
13,
3166,
3458,
1028,
487,
1053,
323,
6073,
13,
3166,
3458,
1028,
487,
1053,
3030,
13,
3166,
3458,
1028,
487,
29889,
9435,
29889,
2754,
1053,
903,
4258,
3406,
13,
3166,
3458,
1028,
487,
29889,
3554,
1053,
20842,
408,
315,
13,
3166,
3458,
1028,
487,
29889,
3554,
1053,
6931,
408,
349,
13,
3166,
3458,
1028,
487,
29889,
3554,
29889,
3372,
800,
29889,
2055,
29918,
3554,
1053,
903,
21287,
16390,
24541,
13,
13,
4703,
29889,
842,
29918,
4703,
29898,
8513,
29922,
4703,
29889,
14345,
3301,
29950,
29918,
20387,
29897,
13,
13,
13,
1990,
12670,
3047,
29931,
2209,
29898,
15755,
29889,
4617,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3564,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
9685,
1125,
13,
4706,
2428,
29898,
6779,
3047,
29931,
2209,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
18714,
29918,
24713,
353,
903,
21287,
16390,
24541,
580,
13,
4706,
1583,
29889,
650,
29918,
8711,
353,
349,
29889,
6716,
28917,
29898,
8990,
29922,
8990,
467,
842,
29918,
710,
8963,
29898,
710,
8963,
29941,
29897,
13,
4706,
1583,
29889,
265,
29918,
1767,
353,
323,
6073,
29898,
29906,
29889,
29900,
29892,
10887,
29889,
7411,
29941,
29906,
29897,
13,
4706,
1583,
29889,
2696,
29918,
1767,
353,
323,
6073,
29898,
29896,
29889,
29900,
29892,
10887,
29889,
7411,
29941,
29906,
29897,
13,
4706,
1583,
29889,
6758,
353,
349,
29889,
6295,
615,
3317,
29907,
2124,
5292,
14441,
3047,
3403,
1169,
2141,
842,
29918,
710,
8963,
29898,
710,
8963,
29946,
29897,
13,
4706,
1583,
29889,
11618,
353,
3564,
13,
13,
1678,
822,
3386,
29898,
1311,
29892,
921,
29892,
343,
29892,
289,
1125,
13,
4706,
289,
29918,
18714,
353,
1583,
29889,
18714,
29918,
24713,
29898,
29890,
29897,
13,
4706,
8500,
353,
1583,
29889,
11618,
29898,
29916,
29892,
343,
29897,
13,
4706,
3858,
353,
1583,
29889,
650,
29918,
8711,
29898,
29890,
29918,
18714,
29892,
29871,
29953,
29946,
29892,
1583,
29889,
265,
29918,
1767,
29892,
1583,
29889,
2696,
29918,
1767,
29897,
13,
4706,
736,
1583,
29889,
6758,
29898,
27711,
29892,
3858,
9601,
29900,
29962,
13,
13,
13,
1990,
19295,
29956,
2390,
29898,
15755,
29889,
4617,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3564,
1125,
13,
4706,
2428,
29898,
25584,
29956,
2390,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
11618,
353,
3564,
13,
13,
1678,
822,
3386,
29898,
1311,
29892,
921,
29892,
343,
29892,
289,
1125,
13,
4706,
736,
315,
29889,
5105,
29918,
497,
29898,
1311,
29889,
11618,
5033,
29916,
29892,
343,
29892,
289,
29897,
13,
13,
13,
1990,
12670,
29898,
15755,
29889,
4617,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13705,
29896,
29892,
13705,
29906,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
2922,
16109,
353,
349,
29889,
9782,
29924,
352,
2141,
842,
29918,
710,
8963,
29898,
710,
8963,
29896,
29897,
13,
4706,
1583,
29889,
7467,
29884,
353,
349,
29889,
29954,
295,
29884,
2141,
842,
29918,
710,
8963,
29898,
710,
8963,
29906,
29897,
13,
13,
1678,
822,
3386,
29898,
1311,
29892,
921,
29892,
343,
1125,
13,
4706,
714,
353,
1583,
29889,
2922,
16109,
29898,
29916,
29892,
343,
29897,
13,
4706,
714,
353,
1583,
29889,
7467,
29884,
29898,
449,
29897,
13,
4706,
736,
714,
13,
13,
13,
1753,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
4469,
29922,
8824,
29892,
373,
386,
327,
29918,
8990,
10457,
29896,
1125,
13,
1678,
7787,
353,
19295,
29956,
2390,
29898,
6779,
3047,
29931,
2209,
29898,
6779,
29898,
710,
8963,
29896,
29892,
13705,
29906,
511,
13705,
29941,
29892,
13705,
29946,
29892,
9685,
29922,
265,
386,
327,
29918,
8990,
876,
13,
1678,
7787,
29889,
842,
29918,
6921,
29918,
23482,
580,
13,
1678,
565,
4469,
29901,
13,
4706,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
23482,
29918,
8513,
543,
6921,
29918,
23482,
1159,
13,
1678,
1683,
29901,
13,
4706,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
23482,
29918,
8513,
543,
12846,
29875,
29918,
6921,
29918,
23482,
1159,
13,
13,
1678,
921,
353,
323,
6073,
29898,
9302,
29889,
2873,
4197,
29953,
29946,
29892,
29871,
29941,
29906,
11724,
26688,
29922,
1516,
29889,
7411,
29941,
29906,
29897,
13,
1678,
343,
353,
323,
6073,
29898,
9302,
29889,
2873,
4197,
29941,
29906,
29892,
29871,
29953,
29946,
11724,
26688,
29922,
1516,
29889,
7411,
29941,
29906,
29897,
13,
1678,
289,
353,
323,
6073,
29898,
9302,
29889,
2873,
4197,
29953,
29946,
11724,
26688,
29922,
1516,
29889,
524,
29941,
29906,
29897,
13,
1678,
903,
4258,
3406,
29889,
12198,
29898,
1212,
29892,
921,
29892,
343,
29892,
289,
29897,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
4299,
29918,
23482,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
5135,
29896,
29892,
29871,
29896,
29953,
511,
313,
511,
313,
876,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29897,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
16175,
29918,
23482,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
511,
313,
876,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29897,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
16175,
29918,
23482,
29918,
20965,
29918,
710,
8963,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
5135,
29896,
29953,
29892,
511,
313,
511,
313,
876,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
1018,
29901,
13,
4706,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29897,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
276,
412,
630,
29918,
15807,
362,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
5135,
29946,
29892,
29871,
29896,
511,
313,
511,
313,
876,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29897,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
6921,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
6213,
13,
1678,
13705,
29906,
353,
6213,
13,
1678,
13705,
29941,
353,
6213,
13,
1678,
13705,
29946,
353,
6213,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
4469,
29922,
5574,
29897,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
16175,
29918,
23482,
29918,
8990,
29900,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
511,
313,
876,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
373,
386,
327,
29918,
8990,
29922,
29900,
29897,
13,
13,
13,
29937,
4469,
8943,
363,
697,
8711,
9685,
5186,
304,
29871,
29900,
756,
451,
1063,
6969,
3447,
13,
1753,
1243,
29918,
650,
8711,
29918,
16175,
29918,
23482,
29918,
20965,
29918,
710,
8963,
29918,
8990,
29900,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
6213,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
1018,
29901,
13,
4706,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
373,
386,
327,
29918,
8990,
29922,
29900,
29897,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
276,
412,
630,
29918,
15807,
362,
29918,
8990,
29900,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29900,
29897,
13,
1678,
13705,
29896,
353,
5135,
29906,
29892,
29871,
29946,
511,
313,
29946,
29892,
29871,
29906,
876,
13,
1678,
13705,
29906,
353,
5135,
29906,
29892,
29871,
29947,
511,
29897,
13,
1678,
13705,
29941,
353,
5135,
29946,
29892,
29871,
29896,
511,
313,
511,
313,
876,
13,
1678,
13705,
29946,
353,
5135,
29896,
29953,
29892,
29871,
29896,
511,
313,
29896,
29953,
29892,
29871,
29896,
876,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
373,
386,
327,
29918,
8990,
29922,
29900,
29897,
13,
13,
13,
1753,
1243,
29918,
650,
8711,
29918,
6921,
29918,
8990,
29900,
7295,
13,
1678,
3030,
29889,
842,
29918,
6921,
29918,
23482,
29918,
4703,
29898,
10141,
29918,
1949,
29922,
29896,
29953,
29892,
5534,
29918,
10003,
29922,
29896,
29946,
29897,
13,
1678,
13705,
29896,
353,
6213,
13,
1678,
13705,
29906,
353,
6213,
13,
1678,
13705,
29941,
353,
6213,
13,
1678,
13705,
29946,
353,
6213,
13,
1678,
6633,
29918,
4262,
29898,
710,
8963,
29896,
29892,
13705,
29906,
29892,
13705,
29941,
29892,
13705,
29946,
29892,
4469,
29922,
5574,
29892,
373,
386,
327,
29918,
8990,
29922,
29900,
29897,
13,
2
] |
forest_lite/server/lib/palette.py | uk-gov-mirror/MetOffice.forest-lite | 6 | 15001 | import bokeh.palettes
def all_palettes():
"""List of palette definitions"""
for name in bokeh.palettes.all_palettes:
for number in bokeh.palettes.all_palettes[name]:
yield {
"name": name,
"number": number,
"palette": bokeh.palettes.all_palettes[name][number]
}
| [
1,
1053,
1045,
446,
29882,
29889,
29886,
744,
698,
267,
13,
13,
13,
1753,
599,
29918,
29886,
744,
698,
267,
7295,
13,
1678,
9995,
1293,
310,
282,
26456,
15848,
15945,
29908,
13,
1678,
363,
1024,
297,
1045,
446,
29882,
29889,
29886,
744,
698,
267,
29889,
497,
29918,
29886,
744,
698,
267,
29901,
13,
4706,
363,
1353,
297,
1045,
446,
29882,
29889,
29886,
744,
698,
267,
29889,
497,
29918,
29886,
744,
698,
267,
29961,
978,
5387,
13,
9651,
7709,
426,
13,
18884,
376,
978,
1115,
1024,
29892,
13,
18884,
376,
4537,
1115,
1353,
29892,
13,
18884,
376,
29886,
26456,
1115,
1045,
446,
29882,
29889,
29886,
744,
698,
267,
29889,
497,
29918,
29886,
744,
698,
267,
29961,
978,
3816,
4537,
29962,
13,
9651,
500,
13,
2
] |
src/features/build_features.py | helldragger/MetaWatch | 1 | 193330 | #%%
import cv2;
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
# not used in this stub but often useful for finding various files
#project_dir = Path(__file__).resolve().parents[2]
# find .env automagically by walking up directories until it's found, then
# load up the .env entries as environment variables
load_dotenv(find_dotenv())
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
import seaborn as sns
import pandas as pd
from scipy import ndimage
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib import colors
import seaborn as sns
img = cv2.imread("C:\\Users\\Helldragger\\Documents\\projects\\MetaWatch\\MetaWatch\\src\\features\\original.jpg");
# we cut the image to keep only the interesting part: the overlay.
#%%
bgdModel = np.zeros((1,65),np.float64)
fgdModel = np.zeros((1,65),np.float64)
newmask = cv.imread('C:\\Users\\Helldragger\\Documents\\projects\\MetaWatch\\MetaWatch\\src\\features\\overlaymaskheroes.png',0)
# wherever it is marked white (sure foreground), change mask=1
# wherever it is marked black (sure background), change mask=0
mask[newmask == 0] = 0
mask[newmask == 255] = 1
mask, bgdModel, fgdModel = cv.grabCut(img,mask,None,bgdModel,fgdModel,5,cv.GC_INIT_WITH_MASK)
mask = np.where((mask==2)|(mask==0),0,1).astype('uint8')
img2 = img*mask[:,:,np.newaxis]
#%%
plt.imshow(img),plt.colorbar(),plt.show()
plt.imshow(img2),plt.colorbar(),plt.show()
cv2.imshow("cut", img2);
cv2.imshow("original", img);
cv2.waitKey(0)
croppedImg = img2[125:210, 35:1892];
plt.imshow(croppedImg),plt.colorbar(),plt.show()
cv2.imshow("cropped", croppedImg);
cv2.waitKey(0)
#%%
# read data about a single hero
src1_mask = cv2.imread('C:\\Users\\Helldragger\\Documents\\projects\\MetaWatch\\MetaWatch\\src\\features\\maskheroA1.png',0);
src1_mask = cv2.cvtColor(src1_mask,cv2.COLOR_GRAY2RGB)
masked_image = cv2.bitwise_and(img, src1_mask)
cv2.imshow("hero maked", masked_image);
cv2.waitKey(0)
#%%
#cropping the hhero image
y,x = masked_image[:,:,1].nonzero() # get the nonzero alpha coordinates
minx = np.min(x)
miny = np.min(y)
maxx = np.max(x)
maxy = np.max(y)
cropImg = masked_image[miny:maxy, minx:maxx]
#cv2.imwrite("cropped.png", cropImg)
cv2.imshow("cropped", cropImg)
cv2.waitKey(0)
#%%
# here we load various health bars and try to quantify their content: health, shield, armor, death symbol.
imgs = {};
srcs = [
"frame377_hero_A1_health",
"frame377_hero_A2_health",
"frame377_hero_A3_health",
"frame377_hero_A4_health",
"frame377_hero_A5_health",
"frame377_hero_A6_health",
"frame377_hero_B1_health",
"frame377_hero_B2_health",
"frame377_hero_B3_health",
"frame377_hero_B4_health",
"frame377_hero_B5_health",
"frame377_hero_B6_health",
]
for src in srcs:
imgs[src] = cv2.imread('C:\\Users\\Helldragger\\Documents\\projects\\MetaWatch\\MetaWatch\\src\\data\\tests\\'+src+'.jpg',-1);
#src1_mask = cv2.imread('C:\\Users\\Helldragger\\Documents\\projects\\MetaWatch\\MetaWatch\\src\\features\\maskheroA1.png',0);
#%%
# here we create an histogram for each image
# idea: counting the amount of health using the percentage of specific colours in the health zone.
img = imgs["frame377_hero_B1_health"];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
img = cv2.cvtColor(img, cv2.COLOR_RGB2HLS )
channels = ('H','L','S')
colors = ("B", 'G', 'R')
for i,chann in enumerate(channels):
histr = cv2.calcHist(img, [i], None, [256], [1, 256], True, False)
histr /= max(histr)
plt.plot(histr,color = colors[i])
plt.xlim([0,256])
plt.show()
plt.imshow(img),plt.colorbar(),plt.show()
#for img in imgs.values():
#%%
# Reducing the amount of colors to 5 colors:
reducedimg = imgs["frame377_hero_B1_health"];
#cv2.cvtColor(reducedimg, cv2.COLOR_HLS2BGR )
plt.imshow(reducedimg),plt.colorbar(),plt.show()
reducedimg = reducedimg // 64
reducedimg = reducedimg * 64
plt.imshow(reducedimg),plt.colorbar(),plt.show()
#%%
img = imgs["frame377_hero_B1_health"];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
pixel_colors = img.reshape((np.shape(img)[0]*np.shape(img)[1], 3))
norm = colors.Normalize(vmin=-1.,vmax=1.)
norm.autoscale(pixel_colors)
pixel_colors = norm(pixel_colors).tolist()
hlsImg = cv2.cvtColor(img, cv2.COLOR_RGB2HLS)
h, l, s = cv2.split(hlsImg);
#plt.imshow(img),plt.colorbar()
fig = plt.figure()
ax1 = fig.add_subplot(2, 1, 1, projection="3d")
ax1.scatter(h.flatten(), l.flatten(), s.flatten(), facecolors=pixel_colors, marker=".")
ax1.set_xlabel("Hue")
ax1.set_ylabel("Luminosity")
ax1.set_zlabel("Saturation")
ax2 = fig.add_subplot(2, 1, 2)
ax2.imshow(img)
plt.show()
#%%
# trying to filter out noise colors:
img = imgs["frame377_hero_B1_health"];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
hlsImg = cv2.cvtColor(img, cv2.COLOR_RGB2HLS)
h, l, s = cv2.split(hlsImg);
fig = plt.figure()
ax = fig.add_subplot(4, 1, 1)
ax.imshow(img)
ax.set_label("pre filtering");
h, l, s = cv2.split(hlsImg);
ax = fig.add_subplot(4, 1, 2)
ax.imshow(h)
ax.set_label("Hue");
ax = fig.add_subplot(4, 1, 3)
ax.imshow(l)
ax.set_label("Luminance");
ax = fig.add_subplot(4, 1, 4)
ax.imshow(s)
ax.set_label("Saturation");
plt.show()
#%%
def getRGBImg(name):
return cv2.cvtColor(imgs[name], cv2.COLOR_BGR2RGB)
def showHealthDetected(img):
hlsImg = cv2.cvtColor(img, cv2.COLOR_RGB2HLS)
hlsImg[hlsImg[:,:,1] < 100] = 0
#hlsImg[:,:,0] = 126
h, l, s = cv2.split(hlsImg);
fig = plt.figure()
ax = fig.add_subplot(5, 1, 1)
ax.imshow(img)
ax = fig.add_subplot(5, 1, 2)
ax.imshow(h)
ax.set_label("Hue");
ax = fig.add_subplot(5, 1, 3)
ax.imshow(l)
ax.set_label("Luminance");
ax = fig.add_subplot(5, 1, 4)
ax.imshow(s)
ax.set_label("Saturation");
resultimg = cv2.cvtColor(hlsImg, cv2.COLOR_HLS2RGB)
ax = fig.add_subplot(5, 1, 5)
ax.imshow(resultimg)
plt.show()
return resultimg
analyzedImgs = {}
for imgSrc in imgs.keys():
analyzedImgs[imgSrc] = showHealthDetected(getRGBImg(imgSrc))
#%%
# recenter every img.
# calculate the histogram of pixels > 0 per line.
def showLineHistograms(img):
img[img > 0] = 1
Ysize = len(img[:,0,0])
hist = img.sum(axis=1)
fig = plt.figure()
plt.plot(hist)
plt.show()
hist = np.zeros((22));
observations = np.array([]);
for imgSrc in imgs.keys():
img = cv.cvtColor(analyzedImgs[imgSrc], cv2.COLOR_RGB2GRAY)
imgSum = img.sum(axis=1);
hist[: len(imgSum)] += imgSum
observations = np.concatenate((observations, np.where(imgSum > 0)[0]) );
hist /= max(hist)
fig = plt.figure()
plt.plot(hist)
plt.show()
sns.distplot(observations)
plt.show()
#%%
# here we try to detect the correct amount of notches on any image
# the image is passed through a gradient filter to show only the variations.
# this gradient filter is then
def detectLabels(img):
return ndimage.measurements.label(imgGrad)
def calculateLabellingErrorRate(gradImg, expected):
return detectLabels(gradImg)[1] - expected;
notchesExpected = {
"frame377_hero_A1_health":23,
"frame377_hero_A2_health":24,
"frame377_hero_A3_health":8,
"frame377_hero_A4_health":10,
"frame377_hero_A5_health":2,
"frame377_hero_A6_health":6,
"frame377_hero_B1_health":24,
"frame377_hero_B2_health":8,
"frame377_hero_B3_health":10,
"frame377_hero_B4_health":8,
"frame377_hero_B5_health":1,
"frame377_hero_B6_health":8,
}
gradientThreshold = 30
bin_amount = abs(min(256, 256))
gradientThresholds = np.linspace(0,256,bin_amount) // 1
#%%
errors = np.zeros(shape=(len(notchesExpected), bin_amount))
j = 0
for lowGradientThreshold in gradientThresholds:
i = 0
for src in imgs.keys():
expected = notchesExpected[src];
img = imgs[src];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
imgGrad = ndimage.morphology.morphological_gradient(img[:,:,0], size=(1,2))
imgGrad[imgGrad<lowGradientThreshold] = 0
labels, count = ndimage.measurements.label(imgGrad)
errors[i, j] = abs(calculateLabellingErrorRate(img, expected))
i += 1
j+=1
sns.heatmap(errors)
plt.plot()
plt.figure()
errorsSummed = errors.sum(axis=0);
errorsSummed
sns.lineplot(data=errorsSummed)
plt.plot()
#plot.figure()
bestThreshold = np.where(errorsSummed == min(errorsSummed))[0][-1];
print("best high pass gradient threshold: ",bestThreshold, "\n\terror count:", errorsSummed[bestThreshold])
# low pass gradient gave a best score of 60 errors, not enough. combining both systems gave a best score of 38. we will keep the simple high pass.
#%%
# best system, simple high filter, with a threshold of 52 or around 50
#%%
img = imgs["frame377_hero_B1_health"];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
plt.imshow(img),plt.colorbar(),plt.show()
imgGrad = ndimage.morphology.morphological_gradient(img[:,:,0], size=(1,2))
plt.imshow(imgGrad),plt.colorbar(),plt.show()
imgGrad[imgGrad<30] = 0
plt.imshow(imgGrad),plt.colorbar(),plt.show()
label, num_features = ndimage.measurements.label(imgGrad)
print("###RGB mode on gradient")
print(num_features, " features detected / 24.")
HLSImg = cv.cvtColor(analyzedImgs[imgSrc], cv.COLOR_RGB2HLS)
label, num_features = ndimage.measurements.label(HLSImg[:,:,0])
print("###HLSImg using Hue")
print(num_features, " features detected / 24.")
label, num_features = ndimage.measurements.label(HLSImg[:,:,1])
print("###HLSImg using Luminosity")
print(num_features, " features detected / 24.")
label, num_features = ndimage.measurements.label(HLSImg[:,:,2])
print("###HLSImg using Saturation")
print(num_features, " features detected / 24.")
#%%
# here we try to differentiate notches types.
notchesTypesExpected = {
"frame377_hero_A1_health":{"white":20,"yellow":3, "blue":0, "red":0},
"frame377_hero_A2_health":{"white":17,"yellow":7, "blue":0, "red":0},
"frame377_hero_A3_health":{"white":8,"yellow":0, "blue":0, "red":0},
"frame377_hero_A4_health":{"white":8,"yellow":2, "blue":0, "red":0},
"frame377_hero_A5_health":{"white":2,"yellow":0, "blue":0, "red":0},
"frame377_hero_A6_health":{"white":2,"yellow":0, "blue":4, "red":0},
"frame377_hero_B1_health":{"white":20,"yellow":4, "blue":0, "red":0},
"frame377_hero_B2_health":{"white":8,"yellow":0, "blue":0, "red":0},
"frame377_hero_B3_health":{"white":8,"yellow":2, "blue":0, "red":0},
"frame377_hero_B4_health":{"white":8,"yellow":0, "blue":0, "red":0},
"frame377_hero_B5_health":{"white":0,"yellow":0, "blue":0, "red":1},
"frame377_hero_B6_health":{"white":8,"yellow":0, "blue":0, "red":0},
}
#%%
img = imgs["frame377_hero_A6_health"];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
originalimg = img
#plt.imshow(img),plt.colorbar(),plt.show()
imgHLS = cv2.cvtColor(img, cv2.COLOR_RGB2HLS )
#plt.imshow(imgHLS[:,:,1]),plt.colorbar(),plt.show()
#imgHLS[:,:,1] = ndimage.grey_erosion(imgHLS[:,:,1], size=(1,2));
imgGrad = ndimage.morphology.morphological_gradient(imgHLS[:,:,1], size=(1,4))
#plt.imshow(imgGrad),plt.colorbar(),plt.show()
imgGrad = ndimage.grey_erosion(imgGrad, size=(2,2));
#plt.imshow(imgGrad),plt.colorbar(),plt.show()
imgGrad = ndimage.grey_dilation(imgGrad, size=(2,2));
#plt.imshow(imgGrad),plt.colorbar(),plt.show()
imgGrad[imgGrad<52] = 0
#plt.imshow(imgGrad),plt.colorbar(),plt.show()
imgHLS[:,:,1] = imgGrad;
imgHLS[imgHLS[:,:,1] == 0] = 0
img = cv2.cvtColor(imgHLS, cv2.COLOR_HLS2RGB )
#plt.imshow(img),plt.colorbar(),plt.show()
labels, count = ndimage.label(imgGrad)
#plt.imshow(labels),plt.colorbar(),plt.show()
#detect colors
#plt.imshow(imgHLS[:,:,0]),plt.colorbar(),plt.show()
#plt.imshow(imgHLS[:,:,1]),plt.colorbar(),plt.show()
#plt.imshow(imgHLS[:,:,2]),plt.colorbar(),plt.show()
colors = {"white":0,"yellow":0, "blue":0, "red":0}
errors = np.zeros((len(notchesTypesExpected.keys()), 4))
i = 0
for imgKey in notchesTypesExpected.keys():
colors = {"white":0,"yellow":0, "blue":0, "red":0}
expectedColors = notchesTypesExpected[imgKey]
img = imgs[imgKey];
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB )
imgGrad = ndimage.morphology.morphological_gradient(img[:,:,0], size=(1,2))
imgGrad[imgGrad<52] = 0
labels, count = ndimage.measurements.label(imgGrad)
for label in range(1, count+1):
labelMeanRGB = np.array(img[labels==label, :].mean(axis=0))
best_dist = -1
best_color = ""
for color in COLOR_VALUES.keys():
curr_dist = np.sqrt(np.sum((COLOR_VALUES[color] - labelMeanRGB) ** 2))
if best_dist == -1 or curr_dist < best_dist:
best_dist = curr_dist
best_color = color
print(i,": ",labelMeanRGB," => ", best_color)
colors[best_color] += 1
# error detection
j=0
for color in colors.keys():
errors[i, j] += abs(expectedColors[color] - colors[color])
print(j,"=",color)
j+=1
i+=1
sns.heatmap(data=errors)
print("total errors:", errors.sum(axis=0))
#%%
#objective: find the best color codes to diminish errors in their case.
#%%
for i in range(1, count+1):
labelRGB = originalimg[labels==i, :]
labelMeanRGB = np.array(labelRGB.mean(axis=0))
best_dist = -1
best_color = ""
print("cluster ",i)
for color in COLOR_VALUES.keys():
curr_dist = np.sqrt(np.sum((COLOR_VALUES[color] - labelMeanRGB) ** 2))
print(color," => ",curr_dist)
if best_dist == -1 or curr_dist < best_dist:
best_dist = curr_dist
best_color = color
colors[best_color] += 1
print(colors)
#detectedimg = np.zeros(originalimg.shape)
#detectedimg = originalimg[labels != 0]
#plt.imshow(detectedimg),plt.colorbar(),plt.show()
#showHealthDetected(img)
#%%
labelHLS = imgHLS[labels==1, :]
labelMeanHLS = np.array(labelHLS.mean(axis=0))
labelMeanHLS[1] = labelMeanHLS[1]/256
plt.imshow(labelHLS),plt.colorbar(),plt.show()
plt.imshow([labelMeanHLS]),plt.colorbar(),plt.show()
distToRed = abs(labelMeanHLS[0] - RED_HUE)
distToYellow = abs(labelMeanHLS[0] - ORANGE_HUE)
distToBlue = abs(labelMeanHLS[0] - BLUE_HUE)
distToWhite = abs(labelMeanHLS[1] - 100)
#%%
labelRGB = originalimg[labels==1]
#plt.imshow(labelRGB),plt.colorbar(),plt.show()
labelMeanRGB = np.array([labelRGB.mean(axis=0)])
labelMeanRGB = labelMeanRGB / 255
#plt.imshow(labelMeanRGB),plt.colorbar(),plt.show()
plt.imshow([labelMeanRGB]),plt.colorbar(),plt.show()
#%%
# # reading the current results.
results = pd.read_csv("C:\\Users\\Helldragger\\Documents\\projects\\MetaWatch\\MetaWatch\\data\\temp\\2.csv")
# barlett, kinda clean (4-6 anomalies)
# bohman, blackmanharris, nuttall = same
# rolling window:
# [2.s] 120 clean( 1 anomaly)
# [1.5] 90 semi clean (3 anomalies).
# [1.s] 60 semi clean ( 4 - 6 death anomalies)
# [.5s] 30 ugly (10+)
res2 = results.groupby(['team', "hero"])["health", "armor", "shield", "death"].rolling(120).mean().reset_index()#.unstack(['team', "hero"])
res2["frame"] = res2["level_2"] // 12
res2.loc[res2.death > 0, "death"] = 1
res2 = res2.drop("level_2", axis=1)
res3 = pd.melt(res2, ['team', "hero", "frame", "death"])
#sns.relplot(x="frame", y="value", hue='variable', col="team", kind="line", data=res3, row="hero")
plt.style.use("seaborn-colorblind")
fig, axes = plt.subplots(6,2, figsize=(1920,1080), dpi=400)
i = 0
for team in res2.team.unique():
j = 0
for hero in res2.hero.unique():
frames = res2.loc[(res2.team==team) & (res2.hero == hero), "frame"]
health = res2.loc[(res2.team==team) & (res2.hero == hero), "health"]
shield = res2.loc[(res2.team==team) & (res2.hero == hero), "shield"]
armor = res2.loc[(res2.team==team) & (res2.hero == hero), "armor"]
axes[j,i].stackplot(frames,
health,
armor,
shield,cmap=plt.get_cmap("Accent"))
j+=1
i+=1
#plt.title('Recorded Game Statistics')
plt.show()
fig, axes = plt.subplots(6,2)
i = 0
for team in res2.team.unique():
j = 0
for hero in res2.hero.unique():
current_data = res2.loc[(res2.team==team) & (res2.hero == hero)]
frames = current_data.frame
daed_frames = (current_data.health < 25) & (current_data.armor < 25) & (current_data.death == 1)
axes[j,i].stackplot(frames,daed_frames, cmap=plt.get_cmap("Accent"))
j+=1
i+=1
#%%
# merging
class DeathInterval:
def __init__(self, start:int, previous=None, next=None):
self.end = self.start = start
self.previous = previous
self.next = next
def span(self):
return self.end - self.start
fig, axes = plt.subplots(6,2)
i = 0
for team in res2.team.unique():
j = 0
for hero in res2.hero.unique():
current_data = res2.loc[(res2.team==team) & (res2.hero == hero)]
frames = current_data.frame
# daed_frames = (current_data.health < 25) & (current_data.armor < 25) & (current_data.death == 1)
spawned_frames = (current_data.health >= 25)
axes[j,i].stackplot(frames,spawned_frames)
for frame in daed_frames:
pass # TODO merge small intervals with little distance together, in order to clean the death reports.
j+=1
i+=1
#%%
# reading ultimate values
import pytesseract
def ocr_core(filename):
"""
This function will handle the core OCR processing of images.
"""
text = pytesseract.image_to_string(cv2.cvtColor(cv2.imread(filename), cv2.COLOR_BGR2GRAY ), lang="Koverwatch") # We'll use Pillow's Image class to open the image and pytesseract to detect the string in the image
return text
#%%
import pytesseract
path = "C:/Users/Helldragger/Documents/projects/MetaWatch/MetaWatch/src/features/OCRTEST.png"
img = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2GRAY )
plt.imshow(img)
plt.show()
srcTri = np.array( [[0, 0], [img.shape[1] - 1, 0], [0, img.shape[0] - 1]] ).astype(np.float32)
dstTri = np.array( [[0, 0], [img.shape[1] - 1, 0], [img.shape[1]*0.08, img.shape[0] - 1]] ).astype(np.float32)
warp_mat = cv.getAffineTransform(srcTri, dstTri)
img = cv.warpAffine(img, warp_mat, (img.shape[1], img.shape[0]))
plt.imshow(img)
plt.show()
thresh = 200
maxValue = 255
img = cv2.threshold(img, thresh, maxValue, cv2.THRESH_BINARY )[1]
plt.imshow(img)
plt.show()
text = pytesseract.image_to_string(img, config="digits", lang="Koverwatch")
print("img text: '{}'".format(text))
#%%
import pytesseract
import numpy as np
import cv2
from matplotlib import pyplot as plt
import seaborn as sns
def convertUltimateImgToText(img):
plt.imshow(img);
plt.show();
img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY )
plt.imshow(img);
plt.show();
srcTri = np.array( [[0, 0], [img.shape[1] - 1, 0], [0, img.shape[0] - 1]] ).astype(np.float32)
dstTri = np.array( [[0, 0], [img.shape[1] - 1, 0], [img.shape[1]*0.19, img.shape[0] - 1]] ).astype(np.float32)
warp_mat = cv2.getAffineTransform(srcTri, dstTri)
img = cv2.warpAffine(img, warp_mat, (img.shape[1], img.shape[0]))
plt.imshow(img);
plt.show();
thresh = 200
maxValue = 255
img = cv2.threshold(img, thresh, maxValue, cv2.THRESH_BINARY )[1]
plt.imshow(img);
plt.show();
text = pytesseract.image_to_string(img, config="digits", lang="Koverwatch")
print("img ult text: '{}'".format(text))
return text
def test_UltimateParsing(testSources):
# test format: COLOR_expectedValue.png
expected = {}
testedColors = set();
testedValues = set();
colorToIndex = {}
valueToIndex = {}
colorLabels = []
valueLabels = []
for src in testSources:
color, value = src.split("_");
expected[src] = {"value":value, "color":color};
if color not in testedColors:
colorToIndex[color] = len(testedColors)
testedColors.add(color)
colorLabels.append(color)
if value not in testedValues:
valueToIndex[value] = len(testedValues)
testedValues.add(value)
valueLabels.append(value)
imgs = {}
errors = np.zeros((len(testedValues), len(testedColors)))
i = 0
legendPrinted = False
for src in expected.keys():
ultimateImg = cv2.imread('src/data/tests/Ultimate/'+src+'.png',-1);
ultimateImg = cv2.cvtColor(ultimateImg, cv2.COLOR_BGR2RGB )
assert ultimateImg is not None
value = convertUltimateImgToText(ultimateImg)
if value != expected[src]["value"]:
errors[valueToIndex[expected[src]["value"]], colorToIndex[expected[src]["color"]]] += 1
sns.heatmap(data=errors, xticklabels=colorLabels, yticklabels=valueLabels)#.get_figure()#.savefig("src/data/tests/Ultimate/Tests_ErrorHeatmap.png")
plt.show()
totalErrors = errors.sum(axis=0).sum()
print("total color errors:", errors.sum(axis=0))
print("total values errors:", errors.sum(axis=1))
print("total errors:", errors.sum(axis=0).sum())
ultimateAcc = 1 - (totalErrors / len(testSources))
print("Ultimate detection accuracy: ", ultimateAcc)
#assert ultimateAcc >= 0.90 # 10% d'erreur
FULL_TEST_SOURCES = [
"BLUE_0",
"BLUE_1",
"BLUE_14",
"BLUE_15",
"BLUE_16",
"BLUE_24",
"BLUE_25",
"GREEN_13",
"GREEN_16",
"GREEN_21",
"GREEN_22",
"GREEN_39",
"GREEN_42",
"GREY_0",
"GREY_11",
"GREY_13",
"GREY_34",
"ORANGE_0",
"RED_10",
"RED_26",
"WHITE_0",
"WHITE_1",
"WHITE_8",
"WHITE_21",
"WHITE_24",
"WHITE_34"
]
ACTUAL_TEST_SOURCES = [
"BLUE_0",
"BLUE_1",
"BLUE_14",
"BLUE_15",
"BLUE_16",
"BLUE_24",
"BLUE_25",
]
test_UltimateParsing(ACTUAL_TEST_SOURCES)
#%%
from os import listdir
from os.path import isfile, join
imgDir = "src/data/tests/Ultimate/"
onlyfiles = [f for f in listdir(imgDir) if isfile(join(imgDir, f))]
imgHeatmap = None;
lastImg = None;
for fileSrc in onlyfiles:
img = cv.imread(imgDir+"/"+fileSrc)
img = cv.cvtColor(img, cv.COLOR_BGR2GRAY);
if imgHeatmap is None:
imgHeatmap=np.zeros(img.shape)
lastImg = img
if img.shape != imgHeatmap.shape:
continue
else:
imgHeatmap = imgHeatmap + img
sns.heatmap(imgHeatmap);
plt.show();
thresholedHeatmap = imgHeatmap
thresholedHeatmap[thresholedHeatmap> 110000] = 0
sns.heatmap(thresholedHeatmap);
plt.show();
#%%
plt.show();
cv.imshow("heatmap",imgHeatmap)
cv.waitKey(0) | [
1,
396,
7686,
13,
13,
13,
5215,
13850,
29906,
29936,
13,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
8329,
6272,
1053,
1284,
29918,
6333,
6272,
29892,
2254,
29918,
6333,
6272,
13,
13,
29937,
451,
1304,
297,
445,
19281,
541,
4049,
5407,
363,
9138,
5164,
2066,
13,
29937,
4836,
29918,
3972,
353,
10802,
22168,
1445,
1649,
467,
17863,
2141,
862,
1237,
29961,
29906,
29962,
13,
13,
29937,
1284,
869,
6272,
3345,
351,
1711,
491,
22049,
701,
17525,
2745,
372,
29915,
29879,
1476,
29892,
769,
13,
29937,
2254,
701,
278,
869,
6272,
9976,
408,
5177,
3651,
13,
1359,
29918,
6333,
6272,
29898,
2886,
29918,
6333,
6272,
3101,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
408,
13850,
13,
3166,
22889,
1053,
11451,
5317,
408,
14770,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
5215,
11701,
408,
10518,
29871,
13,
3166,
4560,
2272,
1053,
29871,
299,
3027,
13,
3166,
286,
572,
29918,
10154,
29895,
1169,
29889,
29885,
5317,
29941,
29881,
1053,
319,
9100,
29941,
29928,
13,
3166,
22889,
1053,
7477,
13,
3166,
22889,
1053,
11955,
13,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
2492,
353,
13850,
29906,
29889,
326,
949,
703,
29907,
22298,
5959,
1966,
7658,
430,
1431,
914,
1966,
20128,
1966,
16418,
1966,
19346,
24709,
1966,
19346,
24709,
1966,
4351,
1966,
22100,
1966,
13492,
29889,
6173,
1496,
13,
29937,
591,
5700,
278,
1967,
304,
3013,
871,
278,
8031,
760,
29901,
278,
27292,
29889,
13,
13,
29937,
7686,
13,
13,
13,
16264,
29881,
3195,
353,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29953,
29945,
511,
9302,
29889,
7411,
29953,
29946,
29897,
13,
16434,
29881,
3195,
353,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29953,
29945,
511,
9302,
29889,
7411,
29953,
29946,
29897,
13,
13,
1482,
13168,
353,
13850,
29889,
326,
949,
877,
29907,
22298,
5959,
1966,
7658,
430,
1431,
914,
1966,
20128,
1966,
16418,
1966,
19346,
24709,
1966,
19346,
24709,
1966,
4351,
1966,
22100,
1966,
957,
8387,
13168,
29882,
1489,
267,
29889,
2732,
742,
29900,
29897,
13,
29937,
29693,
372,
338,
10902,
4796,
313,
29879,
545,
363,
18128,
511,
1735,
11105,
29922,
29896,
13,
29937,
29693,
372,
338,
10902,
4628,
313,
29879,
545,
3239,
511,
1735,
11105,
29922,
29900,
13,
13168,
29961,
1482,
13168,
1275,
29871,
29900,
29962,
353,
29871,
29900,
13,
13168,
29961,
1482,
13168,
1275,
29871,
29906,
29945,
29945,
29962,
353,
29871,
29896,
13,
13168,
29892,
25989,
29881,
3195,
29892,
285,
29887,
29881,
3195,
353,
13850,
29889,
3874,
29890,
29907,
329,
29898,
2492,
29892,
13168,
29892,
8516,
29892,
16264,
29881,
3195,
29892,
16434,
29881,
3195,
29892,
29945,
29892,
11023,
29889,
8766,
29918,
26019,
29918,
29956,
13054,
29918,
1529,
16033,
29897,
13,
13168,
353,
7442,
29889,
3062,
3552,
13168,
1360,
29906,
10531,
29898,
13168,
1360,
29900,
511,
29900,
29892,
29896,
467,
579,
668,
877,
13470,
29947,
1495,
13,
2492,
29906,
353,
10153,
29930,
13168,
7503,
29892,
29901,
29892,
9302,
29889,
1482,
8990,
29962,
13,
29937,
7686,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
29906,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
11023,
29906,
29889,
326,
4294,
703,
7582,
613,
10153,
29906,
416,
13,
11023,
29906,
29889,
326,
4294,
703,
13492,
613,
10153,
416,
13,
11023,
29906,
29889,
10685,
2558,
29898,
29900,
29897,
13,
13,
13,
24077,
2986,
25518,
353,
10153,
29906,
29961,
29896,
29906,
29945,
29901,
29906,
29896,
29900,
29892,
29871,
29941,
29945,
29901,
29896,
29947,
29929,
29906,
1385,
13,
572,
29873,
29889,
326,
4294,
29898,
24077,
2986,
25518,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
11023,
29906,
29889,
326,
4294,
703,
24077,
2986,
613,
8182,
2986,
25518,
416,
13,
11023,
29906,
29889,
10685,
2558,
29898,
29900,
29897,
13,
13,
29937,
7686,
13,
29937,
1303,
848,
1048,
263,
2323,
13444,
13,
4351,
29896,
29918,
13168,
353,
13850,
29906,
29889,
326,
949,
877,
29907,
22298,
5959,
1966,
7658,
430,
1431,
914,
1966,
20128,
1966,
16418,
1966,
19346,
24709,
1966,
19346,
24709,
1966,
4351,
1966,
22100,
1966,
13168,
29882,
1489,
29909,
29896,
29889,
2732,
742,
29900,
416,
13,
4351,
29896,
29918,
13168,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
4351,
29896,
29918,
13168,
29892,
11023,
29906,
29889,
15032,
1955,
29918,
29954,
22800,
29906,
28212,
29897,
268,
13,
13168,
287,
29918,
3027,
353,
13850,
29906,
29889,
2966,
3538,
29918,
392,
29898,
2492,
29892,
4765,
29896,
29918,
13168,
29897,
13,
11023,
29906,
29889,
326,
4294,
703,
29882,
1489,
2136,
287,
613,
11105,
287,
29918,
3027,
416,
13,
11023,
29906,
29889,
10685,
2558,
29898,
29900,
29897,
13,
13,
29937,
7686,
13,
29937,
24077,
3262,
278,
298,
29882,
1489,
1967,
13,
13,
29891,
29892,
29916,
353,
11105,
287,
29918,
3027,
7503,
29892,
29901,
29892,
29896,
1822,
5464,
9171,
580,
396,
679,
278,
1661,
9171,
15595,
10350,
13,
1195,
29916,
353,
7442,
29889,
1195,
29898,
29916,
29897,
13,
1195,
29891,
353,
7442,
29889,
1195,
29898,
29891,
29897,
13,
3317,
29916,
353,
7442,
29889,
3317,
29898,
29916,
29897,
13,
3317,
29891,
353,
7442,
29889,
3317,
29898,
29891,
29897,
29871,
13,
13,
29883,
1336,
25518,
353,
11105,
287,
29918,
3027,
29961,
1195,
29891,
29901,
3317,
29891,
29892,
1375,
29916,
29901,
3317,
29916,
29962,
13,
13,
29937,
11023,
29906,
29889,
326,
3539,
703,
24077,
2986,
29889,
2732,
613,
274,
1336,
25518,
29897,
13,
11023,
29906,
29889,
326,
4294,
703,
24077,
2986,
613,
274,
1336,
25518,
29897,
13,
11023,
29906,
29889,
10685,
2558,
29898,
29900,
29897,
13,
13,
13,
29937,
7686,
13,
13,
29937,
1244,
591,
2254,
5164,
29871,
9045,
22306,
322,
1018,
304,
4323,
1598,
1009,
2793,
29901,
9045,
29892,
28761,
29892,
5075,
272,
29892,
4892,
5829,
29889,
13,
13,
2492,
29879,
353,
15739,
13,
4351,
29879,
353,
518,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29896,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29906,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29941,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29946,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29945,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29953,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
613,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29906,
29918,
354,
4298,
613,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29941,
29918,
354,
4298,
613,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29946,
29918,
354,
4298,
613,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29945,
29918,
354,
4298,
613,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29953,
29918,
354,
4298,
613,
13,
1678,
4514,
13,
1454,
4765,
297,
4765,
29879,
29901,
13,
1678,
527,
3174,
29961,
4351,
29962,
353,
13850,
29906,
29889,
326,
949,
877,
29907,
22298,
5959,
1966,
7658,
430,
1431,
914,
1966,
20128,
1966,
16418,
1966,
19346,
24709,
1966,
19346,
24709,
1966,
4351,
1966,
1272,
1966,
21150,
1966,
18717,
4351,
29974,
4286,
6173,
742,
29899,
29896,
416,
13,
29937,
4351,
29896,
29918,
13168,
353,
13850,
29906,
29889,
326,
949,
877,
29907,
22298,
5959,
1966,
7658,
430,
1431,
914,
1966,
20128,
1966,
16418,
1966,
19346,
24709,
1966,
19346,
24709,
1966,
4351,
1966,
22100,
1966,
13168,
29882,
1489,
29909,
29896,
29889,
2732,
742,
29900,
416,
13,
13,
29937,
7686,
13,
13,
29937,
1244,
591,
1653,
385,
9825,
13342,
363,
1269,
1967,
13,
29937,
2969,
29901,
21248,
278,
5253,
310,
9045,
773,
278,
19649,
310,
2702,
28061,
297,
278,
9045,
10640,
29889,
13,
2492,
353,
527,
3174,
3366,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
10370,
13,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
1723,
13,
13,
305,
12629,
353,
6702,
29950,
3788,
29931,
3788,
29903,
1495,
13,
27703,
353,
4852,
29933,
613,
525,
29954,
742,
525,
29934,
1495,
13,
1454,
474,
29892,
305,
812,
297,
26985,
29898,
305,
12629,
1125,
13,
1678,
298,
2132,
353,
13850,
29906,
29889,
28667,
29950,
391,
29898,
2492,
29892,
518,
29875,
1402,
6213,
29892,
518,
29906,
29945,
29953,
1402,
518,
29896,
29892,
29871,
29906,
29945,
29953,
1402,
5852,
29892,
7700,
29897,
13,
1678,
298,
2132,
847,
29922,
4236,
29898,
29882,
2132,
29897,
13,
1678,
14770,
29889,
5317,
29898,
29882,
2132,
29892,
2780,
353,
11955,
29961,
29875,
2314,
13,
1678,
14770,
29889,
29916,
2576,
4197,
29900,
29892,
29906,
29945,
29953,
2314,
13,
13,
572,
29873,
29889,
4294,
580,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
29937,
1454,
10153,
297,
527,
3174,
29889,
5975,
7295,
13,
13,
29937,
7686,
13,
29937,
4367,
1682,
292,
278,
5253,
310,
11955,
304,
29871,
29945,
11955,
29901,
13,
9313,
1133,
2492,
353,
527,
3174,
3366,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
10370,
13,
29937,
11023,
29906,
29889,
11023,
29873,
3306,
29898,
9313,
1133,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29950,
8547,
29906,
29933,
14345,
1723,
13,
572,
29873,
29889,
326,
4294,
29898,
9313,
1133,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
9313,
1133,
2492,
353,
12212,
2492,
849,
29871,
29953,
29946,
13,
9313,
1133,
2492,
353,
12212,
2492,
334,
29871,
29953,
29946,
13,
572,
29873,
29889,
326,
4294,
29898,
9313,
1133,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
29937,
7686,
13,
2492,
353,
527,
3174,
3366,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
10370,
13,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
13,
29886,
15711,
29918,
27703,
353,
10153,
29889,
690,
14443,
3552,
9302,
29889,
12181,
29898,
2492,
9601,
29900,
14178,
9302,
29889,
12181,
29898,
2492,
9601,
29896,
1402,
29871,
29941,
876,
13,
12324,
353,
11955,
29889,
19077,
675,
29898,
29894,
1195,
10457,
29896,
1696,
29894,
3317,
29922,
29896,
1846,
13,
12324,
29889,
1300,
14174,
744,
29898,
29886,
15711,
29918,
27703,
29897,
13,
29886,
15711,
29918,
27703,
353,
6056,
29898,
29886,
15711,
29918,
27703,
467,
25027,
391,
580,
13,
13,
29882,
3137,
25518,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
29897,
13,
29882,
29892,
301,
29892,
269,
353,
13850,
29906,
29889,
5451,
29898,
29882,
3137,
25518,
416,
13,
13,
13,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
511,
572,
29873,
29889,
2780,
1646,
580,
13,
1003,
353,
14770,
29889,
4532,
580,
13,
1165,
29896,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
18246,
543,
29941,
29881,
1159,
13,
1165,
29896,
29889,
1557,
2620,
29898,
29882,
29889,
1579,
8606,
3285,
301,
29889,
1579,
8606,
3285,
269,
29889,
1579,
8606,
3285,
3700,
27703,
29922,
29886,
15711,
29918,
27703,
29892,
17456,
543,
23157,
13,
1165,
29896,
29889,
842,
29918,
29916,
1643,
703,
29950,
434,
1159,
13,
1165,
29896,
29889,
842,
29918,
29891,
1643,
703,
29931,
398,
8226,
537,
1159,
13,
1165,
29896,
29889,
842,
29918,
29920,
1643,
703,
29903,
1337,
362,
1159,
13,
13,
1165,
29906,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
1165,
29906,
29889,
326,
4294,
29898,
2492,
29897,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
7686,
13,
29937,
1811,
304,
4175,
714,
11462,
11955,
29901,
13,
2492,
353,
527,
3174,
3366,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
10370,
13,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
13,
29882,
3137,
25518,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
29897,
13,
29882,
29892,
301,
29892,
269,
353,
13850,
29906,
29889,
5451,
29898,
29882,
3137,
25518,
416,
13,
13,
1003,
353,
14770,
29889,
4532,
580,
13,
13,
1165,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29946,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
1165,
29889,
326,
4294,
29898,
2492,
29897,
13,
1165,
29889,
842,
29918,
1643,
703,
1457,
21166,
1496,
13,
13,
29882,
29892,
301,
29892,
269,
353,
13850,
29906,
29889,
5451,
29898,
29882,
3137,
25518,
416,
13,
13,
13,
1165,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29946,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
1165,
29889,
326,
4294,
29898,
29882,
29897,
13,
1165,
29889,
842,
29918,
1643,
703,
29950,
434,
1496,
13,
13,
1165,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29946,
29892,
29871,
29896,
29892,
29871,
29941,
29897,
13,
1165,
29889,
326,
4294,
29898,
29880,
29897,
13,
1165,
29889,
842,
29918,
1643,
703,
29931,
9735,
749,
1496,
13,
13,
1165,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29946,
29892,
29871,
29896,
29892,
29871,
29946,
29897,
13,
1165,
29889,
326,
4294,
29898,
29879,
29897,
13,
1165,
29889,
842,
29918,
1643,
703,
29903,
1337,
362,
1496,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
7686,
13,
13,
1753,
679,
28212,
25518,
29898,
978,
1125,
13,
1678,
736,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29879,
29961,
978,
1402,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
29897,
13,
13,
1753,
1510,
3868,
4298,
6362,
26458,
29898,
2492,
1125,
13,
1678,
298,
3137,
25518,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
29897,
13,
1678,
298,
3137,
25518,
29961,
29882,
3137,
25518,
7503,
29892,
29901,
29892,
29896,
29962,
529,
29871,
29896,
29900,
29900,
29962,
353,
29871,
29900,
13,
1678,
396,
29882,
3137,
25518,
7503,
29892,
29901,
29892,
29900,
29962,
353,
29871,
29896,
29906,
29953,
13,
1678,
298,
29892,
301,
29892,
269,
353,
13850,
29906,
29889,
5451,
29898,
29882,
3137,
25518,
416,
13,
13,
13,
1678,
2537,
353,
14770,
29889,
4532,
580,
13,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29945,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
1678,
4853,
29889,
326,
4294,
29898,
2492,
29897,
13,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29945,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
1678,
4853,
29889,
326,
4294,
29898,
29882,
29897,
13,
1678,
4853,
29889,
842,
29918,
1643,
703,
29950,
434,
1496,
13,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29945,
29892,
29871,
29896,
29892,
29871,
29941,
29897,
13,
1678,
4853,
29889,
326,
4294,
29898,
29880,
29897,
13,
1678,
4853,
29889,
842,
29918,
1643,
703,
29931,
9735,
749,
1496,
13,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29945,
29892,
29871,
29896,
29892,
29871,
29946,
29897,
13,
1678,
4853,
29889,
326,
4294,
29898,
29879,
29897,
13,
1678,
4853,
29889,
842,
29918,
1643,
703,
29903,
1337,
362,
1496,
13,
13,
1678,
1121,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
29882,
3137,
25518,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29950,
8547,
29906,
28212,
29897,
13,
13,
1678,
4853,
353,
2537,
29889,
1202,
29918,
1491,
5317,
29898,
29945,
29892,
29871,
29896,
29892,
29871,
29945,
29897,
13,
1678,
4853,
29889,
326,
4294,
29898,
2914,
2492,
29897,
13,
1678,
14770,
29889,
4294,
580,
13,
13,
1678,
736,
1121,
2492,
13,
13,
7054,
12339,
287,
1888,
3174,
353,
6571,
13,
1454,
10153,
29903,
2214,
297,
527,
3174,
29889,
8149,
7295,
13,
1678,
29537,
287,
1888,
3174,
29961,
2492,
29903,
2214,
29962,
353,
1510,
3868,
4298,
6362,
26458,
29898,
657,
28212,
25518,
29898,
2492,
29903,
2214,
876,
13,
13,
29937,
7686,
13,
29937,
1162,
5893,
1432,
10153,
29889,
13,
29937,
8147,
278,
9825,
13342,
310,
17036,
1405,
29871,
29900,
29871,
639,
1196,
29889,
13,
1753,
1510,
3542,
29950,
391,
468,
25402,
29898,
2492,
1125,
13,
1678,
10153,
29961,
2492,
1405,
29871,
29900,
29962,
353,
29871,
29896,
13,
1678,
612,
2311,
353,
7431,
29898,
2492,
7503,
29892,
29900,
29892,
29900,
2314,
13,
1678,
9825,
353,
10153,
29889,
2083,
29898,
8990,
29922,
29896,
29897,
13,
1678,
2537,
353,
14770,
29889,
4532,
580,
13,
1678,
14770,
29889,
5317,
29898,
29882,
391,
29897,
13,
1678,
14770,
29889,
4294,
580,
13,
13,
13,
13,
13,
29882,
391,
353,
7442,
29889,
3298,
359,
3552,
29906,
29906,
2483,
13,
26739,
800,
353,
7442,
29889,
2378,
29898,
2636,
416,
13,
1454,
10153,
29903,
2214,
297,
527,
3174,
29889,
8149,
7295,
13,
1678,
10153,
353,
13850,
29889,
11023,
29873,
3306,
29898,
7054,
12339,
287,
1888,
3174,
29961,
2492,
29903,
2214,
1402,
29871,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29954,
22800,
29897,
13,
1678,
10153,
11139,
353,
10153,
29889,
2083,
29898,
8990,
29922,
29896,
416,
13,
1678,
9825,
7503,
7431,
29898,
2492,
11139,
4638,
4619,
10153,
11139,
13,
1678,
13917,
353,
7442,
29889,
535,
29883,
2579,
403,
3552,
26739,
800,
29892,
7442,
29889,
3062,
29898,
2492,
11139,
1405,
29871,
29900,
9601,
29900,
2314,
3482,
13,
13,
13,
29882,
391,
847,
29922,
4236,
29898,
29882,
391,
29897,
13,
1003,
353,
14770,
29889,
4532,
580,
13,
572,
29873,
29889,
5317,
29898,
29882,
391,
29897,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29879,
1983,
29889,
5721,
5317,
29898,
26739,
800,
29897,
1678,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
7686,
13,
29937,
1244,
591,
1018,
304,
6459,
278,
1959,
5253,
310,
451,
6609,
373,
738,
1967,
13,
29937,
278,
1967,
338,
4502,
1549,
263,
16030,
4175,
304,
1510,
871,
278,
21833,
29889,
13,
29937,
445,
16030,
4175,
338,
769,
29871,
13,
1753,
6459,
4775,
29879,
29898,
2492,
1125,
13,
1678,
736,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
2492,
25584,
29897,
13,
13,
1753,
8147,
28632,
7807,
2392,
19907,
29898,
5105,
25518,
29892,
3806,
1125,
13,
1678,
736,
6459,
4775,
29879,
29898,
5105,
25518,
9601,
29896,
29962,
448,
3806,
29936,
13,
13,
1333,
6609,
1252,
6021,
353,
426,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29896,
29918,
354,
4298,
1115,
29906,
29941,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29906,
29918,
354,
4298,
1115,
29906,
29946,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29941,
29918,
354,
4298,
1115,
29947,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29946,
29918,
354,
4298,
1115,
29896,
29900,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29945,
29918,
354,
4298,
1115,
29906,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29953,
29918,
354,
4298,
1115,
29953,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
1115,
29906,
29946,
29892,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29906,
29918,
354,
4298,
1115,
29947,
29892,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29941,
29918,
354,
4298,
1115,
29896,
29900,
29892,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29946,
29918,
354,
4298,
1115,
29947,
29892,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29945,
29918,
354,
4298,
1115,
29896,
29892,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29953,
29918,
354,
4298,
1115,
29947,
29892,
13,
29913,
13,
24970,
1349,
12268,
353,
29871,
29941,
29900,
13,
2109,
29918,
14506,
353,
6425,
29898,
1195,
29898,
29906,
29945,
29953,
29892,
29871,
29906,
29945,
29953,
876,
13,
24970,
1349,
3781,
3361,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
29906,
29945,
29953,
29892,
2109,
29918,
14506,
29897,
849,
29871,
29896,
13,
13,
13,
29937,
7686,
13,
12523,
353,
7442,
29889,
3298,
359,
29898,
12181,
7607,
2435,
29898,
1333,
6609,
1252,
6021,
511,
9016,
29918,
14506,
876,
13,
29926,
353,
29871,
29900,
13,
1454,
4482,
25584,
993,
1349,
12268,
297,
16030,
1349,
3781,
3361,
29901,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
363,
4765,
297,
527,
3174,
29889,
8149,
7295,
13,
4706,
3806,
353,
451,
6609,
1252,
6021,
29961,
4351,
1385,
13,
4706,
10153,
353,
527,
3174,
29961,
4351,
1385,
13,
4706,
10153,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
4706,
10153,
25584,
353,
29871,
299,
3027,
29889,
29885,
5676,
3002,
29889,
29885,
5676,
5996,
29918,
24970,
29898,
2492,
7503,
29892,
29901,
29892,
29900,
1402,
2159,
7607,
29896,
29892,
29906,
876,
13,
4706,
10153,
25584,
29961,
2492,
25584,
29966,
677,
25584,
993,
1349,
12268,
29962,
353,
29871,
29900,
13,
4706,
11073,
29892,
2302,
353,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
2492,
25584,
29897,
13,
4706,
4436,
29961,
29875,
29892,
432,
29962,
353,
6425,
29898,
15807,
403,
28632,
7807,
2392,
19907,
29898,
2492,
29892,
3806,
876,
13,
4706,
474,
4619,
29871,
29896,
13,
1678,
432,
23661,
29896,
13,
13,
29879,
1983,
29889,
354,
271,
1958,
29898,
12523,
29897,
13,
572,
29873,
29889,
5317,
580,
13,
572,
29873,
29889,
4532,
580,
13,
12523,
11139,
2168,
353,
4436,
29889,
2083,
29898,
8990,
29922,
29900,
416,
13,
12523,
11139,
2168,
13,
29879,
1983,
29889,
1220,
5317,
29898,
1272,
29922,
12523,
11139,
2168,
29897,
13,
572,
29873,
29889,
5317,
580,
13,
29937,
5317,
29889,
4532,
580,
13,
13318,
1349,
12268,
353,
7442,
29889,
3062,
29898,
12523,
11139,
2168,
1275,
1375,
29898,
12523,
11139,
2168,
876,
29961,
29900,
3816,
29899,
29896,
1385,
13,
2158,
703,
13318,
1880,
1209,
16030,
16897,
29901,
9162,
13318,
1349,
12268,
29892,
6634,
29876,
29905,
357,
729,
2302,
29901,
613,
4436,
11139,
2168,
29961,
13318,
1349,
12268,
2314,
13,
29937,
4482,
1209,
16030,
4846,
263,
1900,
8158,
310,
29871,
29953,
29900,
4436,
29892,
451,
3307,
29889,
29299,
1716,
6757,
4846,
263,
1900,
8158,
310,
29871,
29941,
29947,
29889,
591,
674,
3013,
278,
2560,
1880,
1209,
29889,
13,
29937,
7686,
13,
13,
13,
29937,
1900,
1788,
29892,
2560,
1880,
4175,
29892,
411,
263,
16897,
310,
29871,
29945,
29906,
470,
2820,
29871,
29945,
29900,
13,
13,
13,
13,
13,
29937,
7686,
13,
2492,
353,
527,
3174,
3366,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
10370,
13,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
2492,
25584,
353,
29871,
299,
3027,
29889,
29885,
5676,
3002,
29889,
29885,
5676,
5996,
29918,
24970,
29898,
2492,
7503,
29892,
29901,
29892,
29900,
1402,
2159,
7607,
29896,
29892,
29906,
876,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
25584,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
2492,
25584,
29961,
2492,
25584,
29966,
29941,
29900,
29962,
353,
29871,
29900,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
25584,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
1643,
29892,
954,
29918,
22100,
353,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
2492,
25584,
29897,
13,
2158,
703,
2277,
29937,
28212,
4464,
373,
16030,
1159,
13,
2158,
29898,
1949,
29918,
22100,
29892,
376,
5680,
17809,
847,
29871,
29906,
29946,
23157,
13,
13,
13,
29950,
8547,
25518,
353,
13850,
29889,
11023,
29873,
3306,
29898,
7054,
12339,
287,
1888,
3174,
29961,
2492,
29903,
2214,
1402,
29871,
13850,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
29897,
13,
13,
13,
1643,
29892,
954,
29918,
22100,
353,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
29950,
8547,
25518,
7503,
29892,
29901,
29892,
29900,
2314,
13,
2158,
703,
2277,
29937,
29950,
8547,
25518,
773,
379,
434,
1159,
13,
2158,
29898,
1949,
29918,
22100,
29892,
376,
5680,
17809,
847,
29871,
29906,
29946,
23157,
13,
1643,
29892,
954,
29918,
22100,
353,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
29950,
8547,
25518,
7503,
29892,
29901,
29892,
29896,
2314,
13,
2158,
703,
2277,
29937,
29950,
8547,
25518,
773,
365,
398,
8226,
537,
1159,
13,
2158,
29898,
1949,
29918,
22100,
29892,
376,
5680,
17809,
847,
29871,
29906,
29946,
23157,
13,
1643,
29892,
954,
29918,
22100,
353,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
29950,
8547,
25518,
7503,
29892,
29901,
29892,
29906,
2314,
13,
2158,
703,
2277,
29937,
29950,
8547,
25518,
773,
317,
1337,
362,
1159,
13,
2158,
29898,
1949,
29918,
22100,
29892,
376,
5680,
17809,
847,
29871,
29906,
29946,
23157,
13,
29937,
7686,
13,
29937,
1244,
591,
1018,
304,
17473,
403,
451,
6609,
4072,
29889,
13,
13,
1333,
6609,
10562,
1252,
6021,
353,
426,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29896,
29918,
354,
4298,
28819,
10921,
1115,
29906,
29900,
1699,
29136,
1115,
29941,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29906,
29918,
354,
4298,
28819,
10921,
1115,
29896,
29955,
1699,
29136,
1115,
29955,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29941,
29918,
354,
4298,
28819,
10921,
1115,
29947,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29946,
29918,
354,
4298,
28819,
10921,
1115,
29947,
1699,
29136,
1115,
29906,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29945,
29918,
354,
4298,
28819,
10921,
1115,
29906,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29953,
29918,
354,
4298,
28819,
10921,
1115,
29906,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29946,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29896,
29918,
354,
4298,
28819,
10921,
1115,
29906,
29900,
1699,
29136,
1115,
29946,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29906,
29918,
354,
4298,
28819,
10921,
1115,
29947,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29941,
29918,
354,
4298,
28819,
10921,
1115,
29947,
1699,
29136,
1115,
29906,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29946,
29918,
354,
4298,
28819,
10921,
1115,
29947,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29945,
29918,
354,
4298,
28819,
10921,
1115,
29900,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29896,
1118,
29871,
13,
1678,
376,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29933,
29953,
29918,
354,
4298,
28819,
10921,
1115,
29947,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
1118,
13,
29913,
13,
29937,
7686,
13,
13,
13,
13,
2492,
353,
527,
3174,
3366,
2557,
29941,
29955,
29955,
29918,
29882,
1489,
29918,
29909,
29953,
29918,
354,
4298,
10370,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
13492,
2492,
353,
10153,
13,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
2492,
29950,
8547,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
1723,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
11724,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
29962,
353,
29871,
299,
3027,
29889,
7979,
29891,
29918,
9672,
291,
29898,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
1402,
2159,
7607,
29896,
29892,
29906,
2483,
13,
2492,
25584,
353,
29871,
299,
3027,
29889,
29885,
5676,
3002,
29889,
29885,
5676,
5996,
29918,
24970,
29898,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
1402,
2159,
7607,
29896,
29892,
29946,
876,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
25584,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
2492,
25584,
353,
29871,
299,
3027,
29889,
7979,
29891,
29918,
9672,
291,
29898,
2492,
25584,
29892,
2159,
7607,
29906,
29892,
29906,
2483,
29871,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
25584,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
2492,
25584,
353,
29871,
299,
3027,
29889,
7979,
29891,
29918,
29881,
8634,
29898,
2492,
25584,
29892,
2159,
7607,
29906,
29892,
29906,
2483,
29871,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
25584,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
2492,
25584,
29961,
2492,
25584,
29966,
29945,
29906,
29962,
353,
29871,
29900,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
25584,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
29962,
353,
10153,
25584,
29936,
13,
2492,
29950,
8547,
29961,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
29962,
1275,
29871,
29900,
29962,
353,
29871,
29900,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29950,
8547,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29950,
8547,
29906,
28212,
1723,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
13,
21134,
29892,
2302,
353,
29871,
299,
3027,
29889,
1643,
29898,
2492,
25584,
29897,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
21134,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
29937,
4801,
522,
11955,
13,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29900,
11724,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29896,
11724,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
2492,
29950,
8547,
7503,
29892,
29901,
29892,
29906,
11724,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
27703,
353,
8853,
10921,
1115,
29900,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
29913,
13,
13,
13,
13,
13,
12523,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
1333,
6609,
10562,
1252,
6021,
29889,
8149,
25739,
29871,
29946,
876,
13,
29875,
353,
29871,
29900,
13,
1454,
10153,
2558,
297,
451,
6609,
10562,
1252,
6021,
29889,
8149,
7295,
13,
1678,
11955,
353,
29871,
8853,
10921,
1115,
29900,
1699,
29136,
1115,
29900,
29892,
376,
9539,
1115,
29900,
29892,
376,
1127,
1115,
29900,
29913,
13,
1678,
3806,
1625,
943,
353,
451,
6609,
10562,
1252,
6021,
29961,
2492,
2558,
29962,
13,
1678,
10153,
353,
527,
3174,
29961,
2492,
2558,
1385,
13,
1678,
10153,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
1678,
10153,
25584,
353,
29871,
299,
3027,
29889,
29885,
5676,
3002,
29889,
29885,
5676,
5996,
29918,
24970,
29898,
2492,
7503,
29892,
29901,
29892,
29900,
1402,
2159,
7607,
29896,
29892,
29906,
876,
13,
1678,
10153,
25584,
29961,
2492,
25584,
29966,
29945,
29906,
29962,
353,
29871,
29900,
13,
1678,
11073,
29892,
2302,
353,
29871,
299,
3027,
29889,
26658,
1860,
29889,
1643,
29898,
2492,
25584,
29897,
13,
1678,
363,
3858,
297,
3464,
29898,
29896,
29892,
2302,
29974,
29896,
1125,
13,
4706,
3858,
6816,
273,
28212,
353,
7442,
29889,
2378,
29898,
2492,
29961,
21134,
1360,
1643,
29892,
584,
1822,
12676,
29898,
8990,
29922,
29900,
876,
13,
4706,
1900,
29918,
5721,
353,
448,
29896,
13,
4706,
1900,
29918,
2780,
353,
5124,
13,
4706,
363,
2927,
297,
23958,
1955,
29918,
8932,
12996,
29889,
8149,
7295,
13,
9651,
16256,
29918,
5721,
353,
7442,
29889,
3676,
29898,
9302,
29889,
2083,
3552,
15032,
1955,
29918,
8932,
12996,
29961,
2780,
29962,
448,
3858,
6816,
273,
28212,
29897,
3579,
29871,
29906,
876,
13,
9651,
565,
1900,
29918,
5721,
1275,
448,
29896,
470,
16256,
29918,
5721,
529,
1900,
29918,
5721,
29901,
13,
18884,
1900,
29918,
5721,
353,
16256,
29918,
5721,
13,
18884,
1900,
29918,
2780,
353,
2927,
13,
4706,
1596,
29898,
29875,
29892,
1115,
9162,
1643,
6816,
273,
28212,
1699,
1149,
9162,
1900,
29918,
2780,
29897,
13,
4706,
11955,
29961,
13318,
29918,
2780,
29962,
4619,
29871,
29896,
13,
1678,
396,
1059,
15326,
13,
1678,
432,
29922,
29900,
13,
1678,
363,
2927,
297,
11955,
29889,
8149,
7295,
13,
4706,
4436,
29961,
29875,
29892,
432,
29962,
4619,
6425,
29898,
9684,
1625,
943,
29961,
2780,
29962,
448,
11955,
29961,
2780,
2314,
13,
4706,
1596,
29898,
29926,
1699,
543,
29892,
2780,
29897,
13,
4706,
432,
23661,
29896,
13,
1678,
474,
23661,
29896,
13,
13,
29879,
1983,
29889,
354,
271,
1958,
29898,
1272,
29922,
12523,
29897,
13,
2158,
703,
7827,
4436,
29901,
613,
4436,
29889,
2083,
29898,
8990,
29922,
29900,
876,
13,
13,
29937,
7686,
13,
13,
29937,
3318,
573,
29901,
1284,
278,
1900,
2927,
11561,
304,
22964,
728,
4436,
297,
1009,
1206,
29889,
13,
29937,
7686,
13,
1454,
474,
297,
3464,
29898,
29896,
29892,
2302,
29974,
29896,
1125,
13,
1678,
3858,
28212,
353,
2441,
2492,
29961,
21134,
1360,
29875,
29892,
584,
29962,
13,
1678,
3858,
6816,
273,
28212,
353,
7442,
29889,
2378,
29898,
1643,
28212,
29889,
12676,
29898,
8990,
29922,
29900,
876,
13,
1678,
1900,
29918,
5721,
353,
448,
29896,
13,
1678,
1900,
29918,
2780,
353,
5124,
13,
1678,
1596,
703,
19594,
9162,
29875,
29897,
13,
1678,
363,
2927,
297,
23958,
1955,
29918,
8932,
12996,
29889,
8149,
7295,
13,
4706,
16256,
29918,
5721,
353,
7442,
29889,
3676,
29898,
9302,
29889,
2083,
3552,
15032,
1955,
29918,
8932,
12996,
29961,
2780,
29962,
448,
3858,
6816,
273,
28212,
29897,
3579,
29871,
29906,
876,
13,
4706,
1596,
29898,
2780,
1699,
1149,
9162,
21962,
29918,
5721,
29897,
13,
4706,
565,
1900,
29918,
5721,
1275,
448,
29896,
470,
16256,
29918,
5721,
529,
1900,
29918,
5721,
29901,
13,
9651,
1900,
29918,
5721,
353,
16256,
29918,
5721,
13,
9651,
1900,
29918,
2780,
353,
2927,
13,
1678,
11955,
29961,
13318,
29918,
2780,
29962,
4619,
29871,
29896,
13,
13,
2158,
29898,
27703,
29897,
13,
29937,
4801,
26458,
2492,
353,
7442,
29889,
3298,
359,
29898,
13492,
2492,
29889,
12181,
29897,
13,
29937,
4801,
26458,
2492,
353,
2441,
2492,
29961,
21134,
2804,
29871,
29900,
29962,
29871,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
4801,
26458,
2492,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
29937,
4294,
3868,
4298,
6362,
26458,
29898,
2492,
29897,
13,
13,
13,
13,
29937,
7686,
13,
1643,
29950,
8547,
353,
10153,
29950,
8547,
29961,
21134,
1360,
29896,
29892,
584,
29962,
13,
1643,
6816,
273,
29950,
8547,
353,
7442,
29889,
2378,
29898,
1643,
29950,
8547,
29889,
12676,
29898,
8990,
29922,
29900,
876,
13,
1643,
6816,
273,
29950,
8547,
29961,
29896,
29962,
353,
3858,
6816,
273,
29950,
8547,
29961,
29896,
16261,
29906,
29945,
29953,
13,
572,
29873,
29889,
326,
4294,
29898,
1643,
29950,
8547,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
572,
29873,
29889,
326,
4294,
4197,
1643,
6816,
273,
29950,
8547,
11724,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
5721,
1762,
9039,
353,
6425,
29898,
1643,
6816,
273,
29950,
8547,
29961,
29900,
29962,
448,
390,
3352,
29918,
29950,
4462,
29897,
13,
5721,
1762,
29979,
4743,
353,
6425,
29898,
1643,
6816,
273,
29950,
8547,
29961,
29900,
29962,
448,
6323,
24336,
29918,
29950,
4462,
29897,
13,
5721,
1762,
21319,
353,
6425,
29898,
1643,
6816,
273,
29950,
8547,
29961,
29900,
29962,
448,
350,
29931,
4462,
29918,
29950,
4462,
29897,
13,
13,
5721,
1762,
21823,
353,
6425,
29898,
1643,
6816,
273,
29950,
8547,
29961,
29896,
29962,
448,
29871,
29896,
29900,
29900,
29897,
13,
13,
29937,
7686,
13,
1643,
28212,
353,
2441,
2492,
29961,
21134,
1360,
29896,
29962,
13,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
1643,
28212,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
1643,
6816,
273,
28212,
353,
7442,
29889,
2378,
4197,
1643,
28212,
29889,
12676,
29898,
8990,
29922,
29900,
29897,
2314,
13,
1643,
6816,
273,
28212,
353,
3858,
6816,
273,
28212,
847,
29871,
29906,
29945,
29945,
13,
29937,
572,
29873,
29889,
326,
4294,
29898,
1643,
6816,
273,
28212,
511,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
572,
29873,
29889,
326,
4294,
4197,
1643,
6816,
273,
28212,
11724,
572,
29873,
29889,
2780,
1646,
3285,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
7686,
13,
29937,
396,
5183,
278,
1857,
2582,
29889,
13,
13,
13,
9902,
353,
10518,
29889,
949,
29918,
7638,
703,
29907,
22298,
5959,
1966,
7658,
430,
1431,
914,
1966,
20128,
1966,
16418,
1966,
19346,
24709,
1966,
19346,
24709,
1966,
1272,
1966,
7382,
1966,
29906,
29889,
7638,
1159,
13,
13,
29937,
2594,
13650,
29892,
2924,
29874,
5941,
313,
29946,
29899,
29953,
29342,
284,
583,
29897,
13,
29937,
1045,
29882,
1171,
29892,
4628,
1171,
29882,
2749,
275,
29892,
302,
4774,
497,
353,
1021,
13,
29937,
27777,
3474,
29901,
13,
29937,
518,
29906,
29889,
29879,
29962,
29871,
29896,
29906,
29900,
5941,
29898,
29871,
29896,
29342,
14997,
29897,
13,
29937,
518,
29896,
29889,
29945,
29962,
29871,
29929,
29900,
12647,
5941,
313,
29941,
29342,
284,
583,
467,
13,
29937,
518,
29896,
29889,
29879,
29962,
29871,
29953,
29900,
12647,
5941,
313,
29871,
29946,
448,
29871,
29953,
4892,
29342,
284,
583,
29897,
13,
29937,
518,
29889,
29945,
29879,
29962,
29871,
29941,
29900,
22769,
313,
29896,
29900,
28135,
13,
690,
29906,
353,
2582,
29889,
27789,
18959,
14318,
742,
376,
29882,
1489,
20068,
3366,
354,
4298,
613,
376,
2817,
272,
613,
376,
845,
969,
613,
376,
311,
493,
16862,
22155,
29898,
29896,
29906,
29900,
467,
12676,
2141,
12071,
29918,
2248,
580,
29937,
29889,
348,
1429,
18959,
14318,
742,
376,
29882,
1489,
20068,
13,
13,
690,
29906,
3366,
2557,
3108,
353,
620,
29906,
3366,
5563,
29918,
29906,
3108,
849,
29871,
29896,
29906,
13,
13,
690,
29906,
29889,
2029,
29961,
690,
29906,
29889,
311,
493,
1405,
29871,
29900,
29892,
376,
311,
493,
3108,
353,
29871,
29896,
29871,
13,
690,
29906,
353,
620,
29906,
29889,
8865,
703,
5563,
29918,
29906,
613,
9685,
29922,
29896,
29897,
13,
690,
29941,
353,
10518,
29889,
29885,
2152,
29898,
690,
29906,
29892,
6024,
14318,
742,
376,
29882,
1489,
613,
376,
2557,
613,
376,
311,
493,
20068,
13,
13,
29937,
29879,
1983,
29889,
2674,
5317,
29898,
29916,
543,
2557,
613,
343,
543,
1767,
613,
298,
434,
2433,
11918,
742,
784,
543,
14318,
613,
2924,
543,
1220,
613,
848,
29922,
690,
29941,
29892,
1948,
543,
29882,
1489,
1159,
13,
572,
29873,
29889,
3293,
29889,
1509,
703,
344,
370,
1398,
29899,
2780,
2204,
513,
1159,
13,
13,
1003,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29953,
29892,
29906,
29892,
2537,
2311,
7607,
29896,
29929,
29906,
29900,
29892,
29896,
29900,
29947,
29900,
511,
270,
1631,
29922,
29946,
29900,
29900,
29897,
13,
13,
13,
29875,
353,
29871,
29900,
13,
1454,
3815,
297,
620,
29906,
29889,
14318,
29889,
13092,
7295,
13,
1678,
432,
353,
29871,
29900,
13,
1678,
363,
13444,
297,
620,
29906,
29889,
29882,
1489,
29889,
13092,
7295,
13,
4706,
16608,
353,
620,
29906,
29889,
2029,
15625,
690,
29906,
29889,
14318,
1360,
14318,
29897,
669,
313,
690,
29906,
29889,
29882,
1489,
1275,
13444,
511,
376,
2557,
3108,
13,
4706,
9045,
353,
620,
29906,
29889,
2029,
15625,
690,
29906,
29889,
14318,
1360,
14318,
29897,
669,
313,
690,
29906,
29889,
29882,
1489,
1275,
13444,
511,
376,
354,
4298,
3108,
13,
4706,
28761,
353,
620,
29906,
29889,
2029,
15625,
690,
29906,
29889,
14318,
1360,
14318,
29897,
669,
313,
690,
29906,
29889,
29882,
1489,
1275,
13444,
511,
376,
845,
969,
3108,
13,
4706,
5075,
272,
353,
620,
29906,
29889,
2029,
15625,
690,
29906,
29889,
14318,
1360,
14318,
29897,
669,
313,
690,
29906,
29889,
29882,
1489,
1275,
13444,
511,
376,
2817,
272,
3108,
13,
4706,
27815,
29961,
29926,
29892,
29875,
1822,
1429,
5317,
29898,
19935,
29892,
29871,
13,
462,
4706,
9045,
29892,
29871,
13,
462,
4706,
5075,
272,
29892,
13,
462,
4706,
28761,
29892,
29883,
1958,
29922,
572,
29873,
29889,
657,
29918,
29883,
1958,
703,
7504,
296,
5783,
13,
308,
13,
4706,
432,
23661,
29896,
13,
1678,
474,
23661,
29896,
13,
13,
29937,
572,
29873,
29889,
3257,
877,
9182,
287,
8448,
27098,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
13,
1003,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29953,
29892,
29906,
29897,
13,
29875,
353,
29871,
29900,
13,
1454,
3815,
297,
620,
29906,
29889,
14318,
29889,
13092,
7295,
13,
1678,
432,
353,
29871,
29900,
13,
1678,
363,
13444,
297,
620,
29906,
29889,
29882,
1489,
29889,
13092,
7295,
13,
4706,
1857,
29918,
1272,
353,
620,
29906,
29889,
2029,
15625,
690,
29906,
29889,
14318,
1360,
14318,
29897,
669,
313,
690,
29906,
29889,
29882,
1489,
1275,
13444,
4638,
13,
4706,
16608,
353,
1857,
29918,
1272,
29889,
2557,
13,
4706,
1146,
287,
29918,
19935,
353,
313,
3784,
29918,
1272,
29889,
354,
4298,
529,
29871,
29906,
29945,
29897,
669,
313,
3784,
29918,
1272,
29889,
2817,
272,
529,
29871,
29906,
29945,
29897,
669,
313,
3784,
29918,
1272,
29889,
311,
493,
1275,
29871,
29896,
29897,
13,
4706,
27815,
29961,
29926,
29892,
29875,
1822,
1429,
5317,
29898,
19935,
29892,
1388,
287,
29918,
19935,
29892,
274,
1958,
29922,
572,
29873,
29889,
657,
29918,
29883,
1958,
703,
7504,
296,
5783,
13,
4706,
432,
23661,
29896,
13,
1678,
474,
23661,
29896,
13,
13,
29937,
7686,
13,
13,
29937,
2778,
3460,
13,
1990,
14450,
12506,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1369,
29901,
524,
29892,
3517,
29922,
8516,
29892,
2446,
29922,
8516,
1125,
13,
4706,
1583,
29889,
355,
353,
1583,
29889,
2962,
353,
1369,
13,
4706,
1583,
29889,
24957,
353,
3517,
13,
4706,
1583,
29889,
4622,
353,
2446,
13,
268,
13,
1678,
822,
10638,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
355,
448,
1583,
29889,
2962,
13,
1003,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29953,
29892,
29906,
29897,
13,
29875,
353,
29871,
29900,
13,
1454,
3815,
297,
620,
29906,
29889,
14318,
29889,
13092,
7295,
13,
1678,
432,
353,
29871,
29900,
13,
1678,
363,
13444,
297,
620,
29906,
29889,
29882,
1489,
29889,
13092,
7295,
13,
4706,
1857,
29918,
1272,
353,
620,
29906,
29889,
2029,
15625,
690,
29906,
29889,
14318,
1360,
14318,
29897,
669,
313,
690,
29906,
29889,
29882,
1489,
1275,
13444,
4638,
13,
4706,
16608,
353,
1857,
29918,
1272,
29889,
2557,
13,
29937,
4706,
1146,
287,
29918,
19935,
353,
313,
3784,
29918,
1272,
29889,
354,
4298,
529,
29871,
29906,
29945,
29897,
669,
313,
3784,
29918,
1272,
29889,
2817,
272,
529,
29871,
29906,
29945,
29897,
669,
313,
3784,
29918,
1272,
29889,
311,
493,
1275,
29871,
29896,
29897,
13,
4706,
29178,
287,
29918,
19935,
353,
313,
3784,
29918,
1272,
29889,
354,
4298,
6736,
29871,
29906,
29945,
29897,
13,
4706,
27815,
29961,
29926,
29892,
29875,
1822,
1429,
5317,
29898,
19935,
29892,
1028,
18101,
287,
29918,
19935,
29897,
13,
4706,
363,
3515,
297,
1146,
287,
29918,
19935,
29901,
13,
9651,
1209,
396,
14402,
10366,
2319,
18747,
411,
2217,
5418,
4208,
29892,
297,
1797,
304,
5941,
278,
4892,
13676,
29889,
13,
4706,
432,
23661,
29896,
13,
1678,
474,
23661,
29896,
13,
308,
13,
13,
13,
29937,
7686,
13,
13,
29937,
5183,
8494,
6490,
1819,
13,
5215,
282,
3637,
16136,
627,
13,
1753,
288,
7283,
29918,
3221,
29898,
9507,
1125,
13,
1678,
9995,
13,
1678,
910,
740,
674,
4386,
278,
7136,
438,
11341,
9068,
310,
4558,
29889,
13,
1678,
9995,
13,
1678,
1426,
353,
282,
3637,
16136,
627,
29889,
3027,
29918,
517,
29918,
1807,
29898,
11023,
29906,
29889,
11023,
29873,
3306,
29898,
11023,
29906,
29889,
326,
949,
29898,
9507,
511,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
10353,
29871,
6361,
543,
29968,
957,
12344,
1159,
29871,
396,
1334,
29915,
645,
671,
349,
453,
340,
29915,
29879,
7084,
770,
304,
1722,
278,
1967,
322,
282,
3637,
16136,
627,
304,
6459,
278,
1347,
297,
278,
1967,
13,
1678,
736,
1426,
13,
13,
29937,
7686,
13,
5215,
282,
3637,
16136,
627,
13,
2084,
353,
376,
29907,
8419,
5959,
29914,
7658,
430,
1431,
914,
29914,
20128,
29914,
16418,
29914,
19346,
24709,
29914,
19346,
24709,
29914,
4351,
29914,
22100,
29914,
29949,
11341,
18267,
29889,
2732,
29908,
13,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
11023,
29906,
29889,
326,
949,
29898,
2084,
511,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
1723,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
29897,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
13,
4351,
29565,
353,
7442,
29889,
2378,
29898,
5519,
29900,
29892,
29871,
29900,
1402,
518,
2492,
29889,
12181,
29961,
29896,
29962,
448,
29871,
29896,
29892,
29871,
29900,
1402,
518,
29900,
29892,
10153,
29889,
12181,
29961,
29900,
29962,
448,
29871,
29896,
5262,
13742,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
22992,
29565,
353,
7442,
29889,
2378,
29898,
5519,
29900,
29892,
29871,
29900,
1402,
518,
2492,
29889,
12181,
29961,
29896,
29962,
448,
29871,
29896,
29892,
29871,
29900,
1402,
518,
2492,
29889,
12181,
29961,
29896,
14178,
29900,
29889,
29900,
29947,
29892,
10153,
29889,
12181,
29961,
29900,
29962,
448,
29871,
29896,
5262,
13742,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
4495,
29886,
29918,
2922,
353,
13850,
29889,
657,
27867,
457,
13372,
29898,
4351,
29565,
29892,
29743,
29565,
29897,
13,
2492,
353,
13850,
29889,
4495,
29886,
27867,
457,
29898,
2492,
29892,
1370,
29886,
29918,
2922,
29892,
313,
2492,
29889,
12181,
29961,
29896,
1402,
10153,
29889,
12181,
29961,
29900,
12622,
13,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
29897,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
386,
3781,
353,
29871,
29906,
29900,
29900,
13,
3317,
1917,
353,
29871,
29906,
29945,
29945,
13,
2492,
353,
13850,
29906,
29889,
386,
12268,
29898,
2492,
29892,
266,
3781,
29892,
4236,
1917,
29892,
13850,
29906,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
1723,
29961,
29896,
29962,
13,
572,
29873,
29889,
326,
4294,
29898,
2492,
29897,
13,
572,
29873,
29889,
4294,
580,
13,
726,
353,
282,
3637,
16136,
627,
29889,
3027,
29918,
517,
29918,
1807,
29898,
2492,
29892,
2295,
543,
7501,
1169,
613,
6361,
543,
29968,
957,
12344,
1159,
13,
13,
2158,
703,
2492,
1426,
29901,
525,
8875,
29915,
1642,
4830,
29898,
726,
876,
13,
29937,
7686,
13,
13,
5215,
282,
3637,
16136,
627,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
29871,
13,
3166,
22889,
1053,
11451,
5317,
408,
14770,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
13,
1753,
3588,
29965,
1896,
6490,
25518,
1762,
1626,
29898,
2492,
1125,
13,
1678,
14770,
29889,
326,
4294,
29898,
2492,
416,
13,
1678,
14770,
29889,
4294,
890,
13,
1678,
10153,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29954,
22800,
1723,
13,
268,
13,
1678,
14770,
29889,
326,
4294,
29898,
2492,
416,
13,
1678,
14770,
29889,
4294,
890,
13,
268,
13,
1678,
4765,
29565,
353,
7442,
29889,
2378,
29898,
5519,
29900,
29892,
29871,
29900,
1402,
518,
2492,
29889,
12181,
29961,
29896,
29962,
448,
29871,
29896,
29892,
29871,
29900,
1402,
518,
29900,
29892,
10153,
29889,
12181,
29961,
29900,
29962,
448,
29871,
29896,
5262,
13742,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
29743,
29565,
353,
7442,
29889,
2378,
29898,
5519,
29900,
29892,
29871,
29900,
1402,
518,
2492,
29889,
12181,
29961,
29896,
29962,
448,
29871,
29896,
29892,
29871,
29900,
1402,
518,
2492,
29889,
12181,
29961,
29896,
14178,
29900,
29889,
29896,
29929,
29892,
10153,
29889,
12181,
29961,
29900,
29962,
448,
29871,
29896,
5262,
13742,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
1370,
29886,
29918,
2922,
353,
13850,
29906,
29889,
657,
27867,
457,
13372,
29898,
4351,
29565,
29892,
29743,
29565,
29897,
13,
1678,
10153,
353,
13850,
29906,
29889,
4495,
29886,
27867,
457,
29898,
2492,
29892,
1370,
29886,
29918,
2922,
29892,
313,
2492,
29889,
12181,
29961,
29896,
1402,
10153,
29889,
12181,
29961,
29900,
12622,
13,
1678,
14770,
29889,
326,
4294,
29898,
2492,
416,
13,
1678,
14770,
29889,
4294,
890,
13,
268,
13,
1678,
266,
3781,
353,
29871,
29906,
29900,
29900,
13,
1678,
4236,
1917,
353,
29871,
29906,
29945,
29945,
13,
1678,
10153,
353,
13850,
29906,
29889,
386,
12268,
29898,
2492,
29892,
266,
3781,
29892,
4236,
1917,
29892,
13850,
29906,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
1723,
29961,
29896,
29962,
13,
1678,
14770,
29889,
326,
4294,
29898,
2492,
416,
13,
1678,
14770,
29889,
4294,
890,
13,
1678,
1426,
353,
282,
3637,
16136,
627,
29889,
3027,
29918,
517,
29918,
1807,
29898,
2492,
29892,
2295,
543,
7501,
1169,
613,
6361,
543,
29968,
957,
12344,
1159,
13,
13,
1678,
1596,
703,
2492,
8494,
1426,
29901,
525,
8875,
29915,
1642,
4830,
29898,
726,
876,
13,
1678,
736,
1426,
13,
13,
13,
1753,
1243,
29918,
29965,
1896,
6490,
29925,
1503,
292,
29898,
1688,
29903,
2863,
1125,
13,
1678,
396,
1243,
3402,
29901,
23958,
1955,
29918,
9684,
1917,
29889,
2732,
13,
268,
13,
1678,
3806,
353,
6571,
13,
1678,
9528,
1625,
943,
353,
731,
890,
13,
1678,
9528,
9065,
353,
731,
890,
13,
1678,
2927,
1762,
3220,
353,
6571,
13,
1678,
995,
1762,
3220,
353,
6571,
13,
1678,
2927,
4775,
29879,
353,
5159,
13,
1678,
995,
4775,
29879,
353,
5159,
13,
1678,
363,
4765,
297,
1243,
29903,
2863,
29901,
13,
4706,
2927,
29892,
995,
29871,
353,
4765,
29889,
5451,
703,
29918,
1496,
13,
4706,
3806,
29961,
4351,
29962,
353,
8853,
1767,
1115,
1767,
29892,
376,
2780,
1115,
2780,
3400,
13,
4706,
565,
2927,
451,
297,
9528,
1625,
943,
29901,
13,
9651,
2927,
1762,
3220,
29961,
2780,
29962,
353,
7431,
29898,
1688,
287,
1625,
943,
29897,
13,
9651,
9528,
1625,
943,
29889,
1202,
29898,
2780,
29897,
13,
9651,
2927,
4775,
29879,
29889,
4397,
29898,
2780,
29897,
13,
4706,
565,
995,
451,
297,
9528,
9065,
29901,
13,
9651,
995,
1762,
3220,
29961,
1767,
29962,
353,
7431,
29898,
1688,
287,
9065,
29897,
13,
9651,
9528,
9065,
29889,
1202,
29898,
1767,
29897,
13,
9651,
995,
4775,
29879,
29889,
4397,
29898,
1767,
29897,
13,
13,
13,
1678,
527,
3174,
353,
6571,
13,
308,
13,
1678,
4436,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
1688,
287,
9065,
511,
29871,
7431,
29898,
1688,
287,
1625,
943,
4961,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
15983,
11816,
287,
353,
7700,
13,
1678,
363,
4765,
297,
3806,
29889,
8149,
7295,
13,
4706,
8494,
6490,
25518,
353,
13850,
29906,
29889,
326,
949,
877,
4351,
29914,
1272,
29914,
21150,
29914,
29965,
1896,
6490,
29914,
18717,
4351,
29974,
4286,
2732,
742,
29899,
29896,
416,
13,
4706,
8494,
6490,
25518,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
499,
6490,
25518,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
1723,
13,
4706,
4974,
8494,
6490,
25518,
338,
451,
6213,
13,
308,
13,
4706,
995,
353,
3588,
29965,
1896,
6490,
25518,
1762,
1626,
29898,
499,
6490,
25518,
29897,
13,
462,
1678,
13,
4706,
565,
995,
2804,
3806,
29961,
4351,
29962,
3366,
1767,
3108,
29901,
13,
9651,
4436,
29961,
1767,
1762,
3220,
29961,
9684,
29961,
4351,
29962,
3366,
1767,
3108,
1402,
2927,
1762,
3220,
29961,
9684,
29961,
4351,
29962,
3366,
2780,
3108,
5262,
4619,
29871,
29896,
13,
268,
13,
13,
1678,
269,
1983,
29889,
354,
271,
1958,
29898,
1272,
29922,
12523,
29892,
29871,
486,
860,
21134,
29922,
2780,
4775,
29879,
29892,
343,
24667,
21134,
29922,
1767,
4775,
29879,
29897,
29937,
29889,
657,
29918,
4532,
580,
29937,
29889,
7620,
1003,
703,
4351,
29914,
1272,
29914,
21150,
29914,
29965,
1896,
6490,
29914,
24376,
29918,
2392,
3868,
271,
1958,
29889,
2732,
1159,
13,
1678,
14770,
29889,
4294,
580,
13,
1678,
3001,
22463,
353,
4436,
29889,
2083,
29898,
8990,
29922,
29900,
467,
2083,
580,
13,
1678,
1596,
703,
7827,
2927,
4436,
29901,
613,
4436,
29889,
2083,
29898,
8990,
29922,
29900,
876,
13,
1678,
1596,
703,
7827,
1819,
4436,
29901,
613,
4436,
29889,
2083,
29898,
8990,
29922,
29896,
876,
13,
1678,
1596,
703,
7827,
4436,
29901,
613,
4436,
29889,
2083,
29898,
8990,
29922,
29900,
467,
2083,
3101,
13,
13,
1678,
8494,
6490,
7504,
353,
29871,
29896,
448,
313,
7827,
22463,
847,
7431,
29898,
1688,
29903,
2863,
876,
13,
1678,
1596,
703,
29965,
1896,
6490,
15326,
13600,
29901,
9162,
8494,
6490,
7504,
29897,
13,
1678,
396,
9294,
8494,
6490,
7504,
6736,
29871,
29900,
29889,
29929,
29900,
396,
29871,
29896,
29900,
29995,
270,
29915,
261,
276,
332,
13,
13,
13,
13,
29943,
3299,
29918,
18267,
29918,
27839,
27266,
353,
518,
13,
4706,
376,
13367,
4462,
29918,
29900,
613,
13,
4706,
376,
13367,
4462,
29918,
29896,
613,
13,
4706,
376,
13367,
4462,
29918,
29896,
29946,
613,
13,
4706,
376,
13367,
4462,
29918,
29896,
29945,
613,
13,
4706,
376,
13367,
4462,
29918,
29896,
29953,
613,
13,
4706,
376,
13367,
4462,
29918,
29906,
29946,
613,
13,
4706,
376,
13367,
4462,
29918,
29906,
29945,
613,
13,
4706,
376,
29954,
1525,
1430,
29918,
29896,
29941,
613,
13,
4706,
376,
29954,
1525,
1430,
29918,
29896,
29953,
613,
13,
4706,
376,
29954,
1525,
1430,
29918,
29906,
29896,
613,
13,
4706,
376,
29954,
1525,
1430,
29918,
29906,
29906,
613,
13,
4706,
376,
29954,
1525,
1430,
29918,
29941,
29929,
613,
13,
4706,
376,
29954,
1525,
1430,
29918,
29946,
29906,
613,
13,
4706,
376,
29954,
1525,
29979,
29918,
29900,
613,
13,
4706,
376,
29954,
1525,
29979,
29918,
29896,
29896,
613,
13,
4706,
376,
29954,
1525,
29979,
29918,
29896,
29941,
613,
13,
4706,
376,
29954,
1525,
29979,
29918,
29941,
29946,
613,
13,
4706,
376,
1955,
24336,
29918,
29900,
613,
13,
4706,
376,
19386,
29918,
29896,
29900,
613,
13,
4706,
376,
19386,
29918,
29906,
29953,
613,
13,
4706,
376,
25039,
9094,
29918,
29900,
613,
13,
4706,
376,
25039,
9094,
29918,
29896,
613,
13,
4706,
376,
25039,
9094,
29918,
29947,
613,
13,
4706,
376,
25039,
9094,
29918,
29906,
29896,
613,
13,
4706,
376,
25039,
9094,
29918,
29906,
29946,
613,
13,
4706,
376,
25039,
9094,
29918,
29941,
29946,
29908,
13,
1678,
4514,
13,
13,
17923,
29965,
1964,
29918,
18267,
29918,
27839,
27266,
353,
518,
13,
1678,
376,
13367,
4462,
29918,
29900,
613,
13,
1678,
376,
13367,
4462,
29918,
29896,
613,
13,
1678,
376,
13367,
4462,
29918,
29896,
29946,
613,
13,
1678,
376,
13367,
4462,
29918,
29896,
29945,
613,
13,
1678,
376,
13367,
4462,
29918,
29896,
29953,
613,
13,
1678,
376,
13367,
4462,
29918,
29906,
29946,
613,
13,
1678,
376,
13367,
4462,
29918,
29906,
29945,
613,
13,
29962,
13,
13,
1688,
29918,
29965,
1896,
6490,
29925,
1503,
292,
29898,
17923,
29965,
1964,
29918,
18267,
29918,
27839,
27266,
29897,
13,
29937,
7686,
13,
3166,
2897,
1053,
1051,
3972,
13,
3166,
2897,
29889,
2084,
1053,
338,
1445,
29892,
5988,
13,
2492,
9170,
353,
376,
4351,
29914,
1272,
29914,
21150,
29914,
29965,
1896,
6490,
12975,
13,
6194,
5325,
353,
518,
29888,
363,
285,
297,
1051,
3972,
29898,
2492,
9170,
29897,
565,
338,
1445,
29898,
7122,
29898,
2492,
9170,
29892,
285,
28166,
13,
13,
13,
2492,
3868,
271,
1958,
353,
6213,
29936,
13,
4230,
25518,
353,
6213,
29936,
13,
1454,
934,
29903,
2214,
297,
871,
5325,
29901,
13,
1678,
10153,
353,
13850,
29889,
326,
949,
29898,
2492,
9170,
13578,
12975,
29974,
1445,
29903,
2214,
29897,
13,
1678,
10153,
353,
13850,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
416,
13,
1678,
565,
10153,
3868,
271,
1958,
338,
6213,
29901,
13,
4706,
10153,
3868,
271,
1958,
29922,
9302,
29889,
3298,
359,
29898,
2492,
29889,
12181,
29897,
13,
4706,
1833,
25518,
353,
10153,
13,
268,
13,
1678,
565,
10153,
29889,
12181,
2804,
10153,
3868,
271,
1958,
29889,
12181,
29901,
13,
4706,
6773,
13,
1678,
1683,
29901,
13,
4706,
10153,
3868,
271,
1958,
353,
10153,
3868,
271,
1958,
718,
10153,
13,
13,
29879,
1983,
29889,
354,
271,
1958,
29898,
2492,
3868,
271,
1958,
416,
13,
572,
29873,
29889,
4294,
890,
13,
386,
690,
1251,
839,
3868,
271,
1958,
353,
10153,
3868,
271,
1958,
13,
386,
690,
1251,
839,
3868,
271,
1958,
29961,
386,
690,
1251,
839,
3868,
271,
1958,
29958,
29871,
29896,
29896,
29900,
29900,
29900,
29900,
29962,
353,
29871,
29900,
13,
29879,
1983,
29889,
354,
271,
1958,
29898,
386,
690,
1251,
839,
3868,
271,
1958,
416,
13,
13,
572,
29873,
29889,
4294,
890,
13,
29937,
7686,
13,
572,
29873,
29889,
4294,
890,
13,
11023,
29889,
326,
4294,
703,
354,
271,
1958,
613,
2492,
3868,
271,
1958,
29897,
13,
11023,
29889,
10685,
2558,
29898,
29900,
29897,
2
] |
venv/lib/python3.6/site-packages/ansible_collections/netbox/netbox/plugins/doc_fragments/common.py | usegalaxy-no/usegalaxy | 38 | 189193 | # -*- coding: utf-8 -*-
# Copyright: (c) 2021, <NAME> (@devon-mar)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class ModuleDocFragment(object):
DOCUMENTATION = r"""
---
options:
netbox_url:
description:
- The URL of the NetBox instance.
- Must be accessible by the Ansible control host.
required: true
type: str
netbox_token:
description:
- The NetBox API token.
required: true
type: str
state:
description:
- The state of the object.
choices:
- present
- absent
default: present
type: str
query_params:
description:
- This can be used to override the specified values in ALLOWED_QUERY_PARAMS that are defined
- in plugins/module_utils/netbox_utils.py and provides control to users on what may make
- an object unique in their environment.
required: false
type: list
elements: str
validate_certs:
description:
- If C(no), SSL certificates will not be validated.
- This should only be used on personally controlled sites using a self-signed certificates.
default: true
type: raw
cert:
description:
- Certificate path
required: false
type: raw
"""
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
14187,
1266,
29901,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
29892,
529,
5813,
29958,
20164,
3359,
265,
29899,
3034,
29897,
13,
29937,
15143,
4593,
5236,
19245,
325,
29941,
29889,
29900,
29974,
313,
4149,
315,
4590,
29979,
4214,
470,
2045,
597,
1636,
29889,
18713,
29889,
990,
29914,
506,
11259,
29914,
29887,
572,
29899,
29941,
29889,
29900,
29889,
3945,
29897,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
8542,
29892,
1596,
29918,
2220,
13,
13,
1649,
2527,
562,
605,
1649,
353,
1134,
13,
13,
13,
1990,
15591,
14526,
8752,
29898,
3318,
1125,
13,
1678,
11662,
29907,
5005,
3919,
8098,
353,
364,
15945,
29908,
13,
5634,
13,
6768,
29901,
13,
29871,
7787,
1884,
29918,
2271,
29901,
13,
1678,
6139,
29901,
13,
418,
448,
450,
3988,
310,
278,
12670,
3313,
2777,
29889,
13,
418,
448,
19928,
367,
15579,
491,
278,
530,
1687,
2761,
3495,
29889,
13,
1678,
3734,
29901,
1565,
13,
1678,
1134,
29901,
851,
13,
29871,
7787,
1884,
29918,
6979,
29901,
13,
1678,
6139,
29901,
13,
418,
448,
450,
12670,
3313,
3450,
5993,
29889,
13,
1678,
3734,
29901,
1565,
13,
1678,
1134,
29901,
851,
13,
29871,
2106,
29901,
13,
1678,
6139,
29901,
13,
418,
448,
450,
2106,
310,
278,
1203,
29889,
13,
1678,
19995,
29901,
13,
418,
448,
2198,
13,
418,
448,
29207,
13,
1678,
2322,
29901,
2198,
13,
1678,
1134,
29901,
851,
13,
29871,
2346,
29918,
7529,
29901,
13,
1678,
6139,
29901,
13,
418,
448,
910,
508,
367,
1304,
304,
5712,
278,
6790,
1819,
297,
15149,
9806,
3352,
29918,
13356,
24422,
29918,
16320,
29909,
4345,
393,
526,
3342,
13,
418,
448,
297,
18224,
29914,
5453,
29918,
13239,
29914,
1212,
1884,
29918,
13239,
29889,
2272,
322,
8128,
2761,
304,
4160,
373,
825,
1122,
1207,
13,
418,
448,
385,
1203,
5412,
297,
1009,
5177,
29889,
13,
1678,
3734,
29901,
2089,
13,
1678,
1134,
29901,
1051,
13,
1678,
3161,
29901,
851,
13,
29871,
12725,
29918,
6327,
29879,
29901,
13,
1678,
6139,
29901,
13,
418,
448,
960,
315,
29898,
1217,
511,
17122,
23199,
1078,
674,
451,
367,
2854,
630,
29889,
13,
418,
448,
910,
881,
871,
367,
1304,
373,
22345,
20704,
11840,
773,
263,
1583,
29899,
7433,
23199,
1078,
29889,
13,
1678,
2322,
29901,
1565,
13,
1678,
1134,
29901,
10650,
13,
29871,
2284,
29901,
13,
1678,
6139,
29901,
13,
418,
448,
18410,
8021,
2224,
13,
1678,
3734,
29901,
2089,
13,
1678,
1134,
29901,
10650,
13,
15945,
29908,
13,
2
] |
utils/saver.py | dawnchen123/VS-Net | 55 | 116899 | import os.path as osp
import shutil
import torch
from collections import OrderedDict
import json
class Saver(object):
def __init__(self, cfg):
self.cfg = cfg
self.checkpoint_dir = cfg["checkpoint_dir"]
self.export_dir = cfg["export_dir"]
def save_checkpoint(self, state, is_best, filename="checkpoint.pth.tar", save_model=True):
"""Saves checkpoint to disk"""
filename = osp.join(self.checkpoint_dir, filename)
if save_model: torch.save(state, filename)
if is_best:
best_pred = state["best_pred"]
with open(osp.join(self.export_dir, "best_pred.txt"), "w") as f:
json.dump(best_pred, f)
if save_model: shutil.copyfile(filename, osp.join(self.export_dir, "model_best.pth.tar")) | [
1,
1053,
2897,
29889,
2084,
408,
288,
1028,
13,
5215,
528,
4422,
13,
5215,
4842,
305,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
5215,
4390,
13,
13,
1990,
5701,
369,
29898,
3318,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
274,
16434,
1125,
13,
4706,
1583,
29889,
16859,
353,
274,
16434,
13,
4706,
1583,
29889,
3198,
3149,
29918,
3972,
353,
274,
16434,
3366,
3198,
3149,
29918,
3972,
3108,
13,
4706,
1583,
29889,
15843,
29918,
3972,
353,
274,
16434,
3366,
15843,
29918,
3972,
3108,
13,
13,
1678,
822,
4078,
29918,
3198,
3149,
29898,
1311,
29892,
2106,
29892,
338,
29918,
13318,
29892,
10422,
543,
3198,
3149,
29889,
29886,
386,
29889,
12637,
613,
4078,
29918,
4299,
29922,
5574,
1125,
13,
4706,
9995,
29903,
5989,
1423,
3149,
304,
8086,
15945,
29908,
13,
4706,
10422,
353,
288,
1028,
29889,
7122,
29898,
1311,
29889,
3198,
3149,
29918,
3972,
29892,
10422,
29897,
13,
4706,
565,
4078,
29918,
4299,
29901,
4842,
305,
29889,
7620,
29898,
3859,
29892,
10422,
29897,
13,
4706,
565,
338,
29918,
13318,
29901,
13,
9651,
1900,
29918,
11965,
353,
2106,
3366,
13318,
29918,
11965,
3108,
13,
9651,
411,
1722,
29898,
4705,
29889,
7122,
29898,
1311,
29889,
15843,
29918,
3972,
29892,
376,
13318,
29918,
11965,
29889,
3945,
4968,
376,
29893,
1159,
408,
285,
29901,
13,
18884,
4390,
29889,
15070,
29898,
13318,
29918,
11965,
29892,
285,
29897,
13,
9651,
565,
4078,
29918,
4299,
29901,
528,
4422,
29889,
8552,
1445,
29898,
9507,
29892,
288,
1028,
29889,
7122,
29898,
1311,
29889,
15843,
29918,
3972,
29892,
376,
4299,
29918,
13318,
29889,
29886,
386,
29889,
12637,
5783,
2
] |
tutorials/W0D1_PythonWorkshop1/solutions/W0D1_Tutorial1_Solution_93456241.py | eduardojdiniz/CompNeuro | 2,294 | 23683 |
# Set random number generator
np.random.seed(2020)
# Initialize step_end, n, t_range, v and i
step_end = int(t_max / dt)
n = 50
t_range = np.linspace(0, t_max, num=step_end)
v_n = el * np.ones([n, step_end])
i = i_mean * (1 + 0.1 * (t_max / dt)**(0.5) * (2 * np.random.random([n, step_end]) - 1))
# Loop for step_end - 1 steps
for step in range(1, step_end):
# Compute v_n
v_n[:, step] = v_n[:, step - 1] + (dt / tau) * (el - v_n[:, step - 1] + r * i[:, step])
# Plot figure
with plt.xkcd():
plt.figure()
plt.title('Multiple realizations of $V_m$')
plt.xlabel('time (s)')
plt.ylabel('$V_m$ (V)')
plt.plot(t_range, v_n.T, 'k', alpha=0.3)
plt.show() | [
1,
29871,
13,
29937,
3789,
4036,
1353,
15299,
13,
9302,
29889,
8172,
29889,
26776,
29898,
29906,
29900,
29906,
29900,
29897,
13,
13,
29937,
25455,
4331,
29918,
355,
29892,
302,
29892,
260,
29918,
3881,
29892,
325,
322,
474,
13,
10568,
29918,
355,
353,
938,
29898,
29873,
29918,
3317,
847,
11636,
29897,
13,
29876,
353,
29871,
29945,
29900,
13,
29873,
29918,
3881,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
260,
29918,
3317,
29892,
954,
29922,
10568,
29918,
355,
29897,
13,
29894,
29918,
29876,
353,
560,
334,
7442,
29889,
2873,
4197,
29876,
29892,
4331,
29918,
355,
2314,
13,
29875,
353,
474,
29918,
12676,
334,
313,
29896,
718,
29871,
29900,
29889,
29896,
334,
313,
29873,
29918,
3317,
847,
11636,
29897,
1068,
29898,
29900,
29889,
29945,
29897,
334,
313,
29906,
334,
7442,
29889,
8172,
29889,
8172,
4197,
29876,
29892,
4331,
29918,
355,
2314,
448,
29871,
29896,
876,
13,
13,
29937,
21493,
363,
4331,
29918,
355,
448,
29871,
29896,
6576,
13,
1454,
4331,
297,
3464,
29898,
29896,
29892,
4331,
29918,
355,
1125,
13,
13,
259,
396,
11796,
29872,
325,
29918,
29876,
13,
259,
325,
29918,
29876,
7503,
29892,
4331,
29962,
353,
325,
29918,
29876,
7503,
29892,
4331,
448,
29871,
29896,
29962,
718,
313,
6008,
847,
260,
585,
29897,
334,
313,
295,
448,
325,
29918,
29876,
7503,
29892,
4331,
448,
29871,
29896,
29962,
718,
364,
334,
474,
7503,
29892,
4331,
2314,
13,
13,
29937,
18399,
4377,
13,
2541,
14770,
29889,
29916,
29895,
2252,
7295,
13,
29871,
14770,
29889,
4532,
580,
13,
29871,
14770,
29889,
3257,
877,
15329,
552,
8869,
800,
310,
395,
29963,
29918,
29885,
29938,
1495,
13,
29871,
14770,
29889,
29916,
1643,
877,
2230,
313,
29879,
29897,
1495,
13,
29871,
14770,
29889,
29891,
1643,
877,
29938,
29963,
29918,
29885,
29938,
313,
29963,
29897,
1495,
13,
13,
29871,
14770,
29889,
5317,
29898,
29873,
29918,
3881,
29892,
325,
29918,
29876,
29889,
29911,
29892,
525,
29895,
742,
15595,
29922,
29900,
29889,
29941,
29897,
13,
29871,
14770,
29889,
4294,
580,
2
] |
models/utils.py | Jintao-Huang/EfficientNet_PyTorch | 8 | 59146 | <filename>models/utils.py
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
import torch
import torch.nn.functional as F
import math
def freeze_layers(model, layers):
"""冻结层"""
for name, parameter in model.named_parameters():
for layer in layers:
if layer in name: # 只要含有名字即可
parameter.requires_grad_(False)
break
else:
parameter.requires_grad_(True)
def model_info(model, img_size):
img_size = img_size if isinstance(img_size, (tuple, list)) else (img_size, img_size)
num_params = sum(x.numel() for x in model.parameters()) # number parameters
num_grads = sum(x.numel() for x in model.parameters() if x.requires_grad) # number gradients
try: # FLOPS
from thop import profile
p = next(model.parameters())
x = torch.rand((1, 3, 32, 32), dtype=p.dtype, device=p.device)
macs, num_params = profile(model, inputs=(x,), verbose=False)
flops = 2 * macs
flops_str = ", %.1f GFLOPS" % (flops * img_size[0] * img_size[1] / 32 / 32 / 1e9) # 640x640 GFLOPS
except (ImportError, Exception):
flops_str = ""
print("Model Summary: %d layers, %d parameters, %d gradients%s" %
(len(list(model.modules())), num_params, num_grads, flops_str))
def label_smoothing_cross_entropy(pred, target, smoothing: float = 0.1):
"""reference: https://github.com/seominseok0429/label-smoothing-visualization-pytorch
:param pred: shape(N, In). 未过softmax
:param target: shape(N,)
:param smoothing: float
:return: shape()
"""
pred = F.log_softmax(pred, dim=-1)
ce_loss = F.nll_loss(pred, target)
smooth_loss = -torch.mean(pred)
return (1 - smoothing) * ce_loss + smoothing * smooth_loss
def cosine_annealing_lr(epoch, T_max, min_lr, max_lr):
return min_lr + (max_lr - min_lr) * (1 + math.cos(epoch / T_max * math.pi)) / 2 | [
1,
529,
9507,
29958,
9794,
29914,
13239,
29889,
2272,
13,
2202,
29901,
13,
1678,
515,
4842,
305,
29889,
29882,
431,
1053,
2254,
29918,
3859,
29918,
8977,
29918,
3166,
29918,
2271,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
4842,
305,
29889,
13239,
29889,
4299,
29918,
2502,
29877,
1053,
2254,
29918,
2271,
408,
2254,
29918,
3859,
29918,
8977,
29918,
3166,
29918,
2271,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
5215,
5844,
13,
13,
1753,
3889,
911,
29918,
29277,
29898,
4299,
29892,
15359,
1125,
13,
1678,
9995,
232,
137,
190,
31320,
232,
180,
133,
15945,
29908,
13,
1678,
363,
1024,
29892,
3443,
297,
1904,
29889,
17514,
29918,
16744,
7295,
13,
4706,
363,
7546,
297,
15359,
29901,
13,
9651,
565,
7546,
297,
1024,
29901,
29871,
396,
29871,
31557,
30698,
232,
147,
174,
30417,
30548,
30578,
232,
144,
182,
30682,
13,
18884,
3443,
29889,
276,
339,
2658,
29918,
5105,
23538,
8824,
29897,
13,
18884,
2867,
13,
4706,
1683,
29901,
13,
9651,
3443,
29889,
276,
339,
2658,
29918,
5105,
23538,
5574,
29897,
13,
13,
13,
1753,
1904,
29918,
3888,
29898,
4299,
29892,
10153,
29918,
2311,
1125,
13,
1678,
10153,
29918,
2311,
353,
10153,
29918,
2311,
565,
338,
8758,
29898,
2492,
29918,
2311,
29892,
313,
23583,
29892,
1051,
876,
1683,
313,
2492,
29918,
2311,
29892,
10153,
29918,
2311,
29897,
13,
1678,
954,
29918,
7529,
353,
2533,
29898,
29916,
29889,
1949,
295,
580,
363,
921,
297,
1904,
29889,
16744,
3101,
29871,
396,
1353,
4128,
13,
1678,
954,
29918,
5105,
29879,
353,
2533,
29898,
29916,
29889,
1949,
295,
580,
363,
921,
297,
1904,
29889,
16744,
580,
565,
921,
29889,
276,
339,
2658,
29918,
5105,
29897,
29871,
396,
1353,
4656,
10070,
13,
1678,
1018,
29901,
29871,
396,
383,
3927,
7024,
13,
4706,
515,
266,
459,
1053,
8722,
13,
4706,
282,
353,
2446,
29898,
4299,
29889,
16744,
3101,
13,
4706,
921,
353,
4842,
305,
29889,
9502,
3552,
29896,
29892,
29871,
29941,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29906,
511,
26688,
29922,
29886,
29889,
29881,
1853,
29892,
4742,
29922,
29886,
29889,
10141,
29897,
13,
4706,
5825,
29879,
29892,
954,
29918,
7529,
353,
8722,
29898,
4299,
29892,
10970,
7607,
29916,
29892,
511,
26952,
29922,
8824,
29897,
13,
4706,
5685,
567,
353,
29871,
29906,
334,
5825,
29879,
13,
4706,
5685,
567,
29918,
710,
353,
9162,
18695,
29896,
29888,
402,
29943,
3927,
7024,
29908,
1273,
313,
29888,
417,
567,
334,
10153,
29918,
2311,
29961,
29900,
29962,
334,
10153,
29918,
2311,
29961,
29896,
29962,
847,
29871,
29941,
29906,
847,
29871,
29941,
29906,
847,
29871,
29896,
29872,
29929,
29897,
29871,
396,
29871,
29953,
29946,
29900,
29916,
29953,
29946,
29900,
402,
29943,
3927,
7024,
13,
1678,
5174,
313,
17518,
2392,
29892,
8960,
1125,
13,
4706,
5685,
567,
29918,
710,
353,
5124,
13,
13,
1678,
1596,
703,
3195,
6991,
5219,
29901,
1273,
29881,
15359,
29892,
1273,
29881,
4128,
29892,
1273,
29881,
4656,
10070,
29995,
29879,
29908,
1273,
13,
3986,
313,
2435,
29898,
1761,
29898,
4299,
29889,
7576,
3101,
511,
954,
29918,
7529,
29892,
954,
29918,
5105,
29879,
29892,
5685,
567,
29918,
710,
876,
13,
13,
13,
1753,
3858,
29918,
3844,
29877,
6046,
29918,
19128,
29918,
296,
14441,
29898,
11965,
29892,
3646,
29892,
1560,
29877,
6046,
29901,
5785,
353,
29871,
29900,
29889,
29896,
1125,
13,
1678,
9995,
5679,
29901,
2045,
597,
3292,
29889,
510,
29914,
344,
5817,
344,
554,
29900,
29946,
29906,
29929,
29914,
1643,
29899,
3844,
29877,
6046,
29899,
20119,
2133,
29899,
2272,
7345,
305,
13,
13,
1678,
584,
3207,
4450,
29901,
8267,
29898,
29940,
29892,
512,
467,
29871,
31295,
31138,
2695,
3317,
13,
1678,
584,
3207,
3646,
29901,
8267,
29898,
29940,
29892,
29897,
13,
1678,
584,
3207,
1560,
29877,
6046,
29901,
5785,
13,
1678,
584,
2457,
29901,
8267,
580,
13,
1678,
9995,
13,
1678,
4450,
353,
383,
29889,
1188,
29918,
2695,
3317,
29898,
11965,
29892,
3964,
10457,
29896,
29897,
13,
1678,
2257,
29918,
6758,
353,
383,
29889,
29876,
645,
29918,
6758,
29898,
11965,
29892,
3646,
29897,
13,
1678,
10597,
29918,
6758,
353,
448,
7345,
305,
29889,
12676,
29898,
11965,
29897,
13,
1678,
736,
313,
29896,
448,
1560,
29877,
6046,
29897,
334,
2257,
29918,
6758,
718,
1560,
29877,
6046,
334,
10597,
29918,
6758,
13,
13,
13,
1753,
6776,
457,
29918,
11276,
12818,
29918,
29212,
29898,
1022,
2878,
29892,
323,
29918,
3317,
29892,
1375,
29918,
29212,
29892,
4236,
29918,
29212,
1125,
13,
1678,
736,
1375,
29918,
29212,
718,
313,
3317,
29918,
29212,
448,
1375,
29918,
29212,
29897,
334,
313,
29896,
718,
5844,
29889,
3944,
29898,
1022,
2878,
847,
323,
29918,
3317,
334,
5844,
29889,
1631,
876,
847,
29871,
29906,
2
] |
src/tracker/main.py | ralphribeiro/lab | 0 | 130005 | <gh_stars>0
from datetime import datetime
import matplotlib.pyplot as plt
import pandas as pd
import pvlib
latitude = -23.313602
longitude = -46.221382
altitude = 655
tmz = 'America/Sao_Paulo'
temperatura = 20
pressao = 94000
agora = datetime.now()
dia = agora.today().day
mes = agora.today().month
ano = agora.today().year
hora = agora.today().hour
minuto = agora.today().minute
segundo = agora.today().second
data_inicio = datetime(ano, mes, dia, 0, 0, 0)
data_fim = datetime(ano, mes, dia, 23, 59, 59)
datas = pd.date_range(start=data_inicio, end=data_fim, freq='1Min', tz=tmz)
posicao_sol = pvlib.solarposition.get_solarposition(
datas,
latitude,
longitude,
altitude,
temperature=temperatura,
pressure=pressao
)
posicao_sol.plot()
dt = pd.DatetimeIndex([agora.isoformat()])
posicao_sol_atual = pvlib.solarposition.get_solarposition(
dt,
latitude,
longitude,
altitude,
temperature=temperatura,
pressure=pressao,
tz=tmz)
plt.scatter(posicao_sol_atual.index.values[0],
posicao_sol_atual['elevation'][0], linewidths=20, c='y')
plt.show() | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
12865,
1053,
12865,
13,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
11701,
408,
10518,
13,
5215,
282,
29894,
1982,
13,
13,
13,
5066,
4279,
353,
448,
29906,
29941,
29889,
29941,
29896,
29941,
29953,
29900,
29906,
13,
5426,
4279,
353,
448,
29946,
29953,
29889,
29906,
29906,
29896,
29941,
29947,
29906,
13,
1997,
4279,
353,
29871,
29953,
29945,
29945,
13,
18276,
29920,
353,
525,
29048,
29914,
29903,
6241,
29918,
11868,
7207,
29915,
13,
12863,
7969,
353,
29871,
29906,
29900,
13,
2139,
6241,
353,
29871,
29929,
29946,
29900,
29900,
29900,
13,
13,
351,
2207,
353,
12865,
29889,
3707,
580,
13,
13,
15321,
353,
946,
2207,
29889,
27765,
2141,
3250,
13,
4467,
353,
946,
2207,
29889,
27765,
2141,
10874,
13,
1562,
353,
946,
2207,
29889,
27765,
2141,
6360,
13,
15255,
353,
946,
2207,
29889,
27765,
2141,
18721,
13,
1195,
3066,
353,
946,
2207,
29889,
27765,
2141,
1195,
1082,
13,
10199,
6201,
353,
946,
2207,
29889,
27765,
2141,
7496,
13,
13,
1272,
29918,
262,
11088,
353,
12865,
29898,
1562,
29892,
4883,
29892,
9766,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1272,
29918,
29888,
326,
353,
12865,
29898,
1562,
29892,
4883,
29892,
9766,
29892,
29871,
29906,
29941,
29892,
29871,
29945,
29929,
29892,
29871,
29945,
29929,
29897,
13,
13,
14538,
353,
10518,
29889,
1256,
29918,
3881,
29898,
2962,
29922,
1272,
29918,
262,
11088,
29892,
1095,
29922,
1272,
29918,
29888,
326,
29892,
3005,
29939,
2433,
29896,
8140,
742,
260,
29920,
29922,
18276,
29920,
29897,
13,
13,
1066,
983,
29877,
29918,
2929,
353,
282,
29894,
1982,
29889,
2929,
279,
3283,
29889,
657,
29918,
2929,
279,
3283,
29898,
13,
1678,
6155,
29892,
13,
1678,
26271,
29892,
13,
1678,
28745,
29892,
13,
1678,
5272,
4279,
29892,
13,
1678,
10430,
29922,
12863,
7969,
29892,
13,
1678,
12959,
29922,
2139,
6241,
13,
29897,
13,
1066,
983,
29877,
29918,
2929,
29889,
5317,
580,
13,
13,
6008,
353,
10518,
29889,
16390,
5410,
3220,
4197,
351,
2207,
29889,
10718,
4830,
580,
2314,
13,
1066,
983,
29877,
29918,
2929,
29918,
271,
950,
353,
282,
29894,
1982,
29889,
2929,
279,
3283,
29889,
657,
29918,
2929,
279,
3283,
29898,
13,
1678,
11636,
29892,
13,
1678,
26271,
29892,
13,
1678,
28745,
29892,
13,
1678,
5272,
4279,
29892,
13,
1678,
10430,
29922,
12863,
7969,
29892,
13,
1678,
12959,
29922,
2139,
6241,
29892,
13,
1678,
260,
29920,
29922,
18276,
29920,
29897,
13,
13,
572,
29873,
29889,
1557,
2620,
29898,
1066,
983,
29877,
29918,
2929,
29918,
271,
950,
29889,
2248,
29889,
5975,
29961,
29900,
1402,
13,
9651,
926,
983,
29877,
29918,
2929,
29918,
271,
950,
1839,
29872,
2608,
362,
2033,
29961,
29900,
1402,
1196,
2103,
29879,
29922,
29906,
29900,
29892,
274,
2433,
29891,
1495,
13,
13,
572,
29873,
29889,
4294,
580,
2
] |
dl_papers/common/data/batch_iterator.py | 4Catalyzer/dl-papers | 2 | 162980 | import sys
import threading
from tqdm import tqdm
import numpy as np
import pandas as pd
import six
from six.moves.queue import Queue
from ..utils import if_none
__all__ = ('BatchIterator',)
# -----------------------------------------------------------------------------
DONE = object()
# -----------------------------------------------------------------------------
class BufferedIterator(six.Iterator):
def __init__(self, source, buffer_size=2):
assert buffer_size >= 2, "minimum buffer size is 2"
# The effective buffer size is one larger, because the generation
# process will generate one extra element and block until there is room
# in the buffer.
self.buffer = Queue(maxsize=buffer_size - 1)
def populate_buffer():
try:
for item in source:
self.buffer.put((None, item))
except:
self.buffer.put((sys.exc_info(), None))
else:
self.buffer.put(DONE)
thread = threading.Thread(target=populate_buffer)
thread.daemon = True
thread.start()
def __iter__(self):
return self
def __next__(self):
value = self.buffer.get()
if value is DONE:
raise StopIteration()
exc_info, data = value
if exc_info:
six.reraise(*exc_info)
return data
# -----------------------------------------------------------------------------
class BatchIterator(object):
def __init__(
self,
batch_size,
training_epoch_size=None,
no_stub_batch=False,
shuffle=None,
seed=None,
buffer_size=2,
):
self.batch_size = batch_size
self.training_epoch_size = training_epoch_size
self.no_stub_batch = no_stub_batch
self.shuffle = shuffle
if seed is not None:
self.random = np.random.RandomState(seed)
else:
self.random = np.random
self.buffer_size = buffer_size
def __call__(self, data, *args, **kwargs):
if if_none(self.shuffle, kwargs.get('training', False)):
shuffled_data = self.shuffle_data(data, *args)
if args:
data = shuffled_data[0]
args = shuffled_data[1:]
else:
data = shuffled_data
if self.training_epoch_size is not None:
data = data[:self.training_epoch_size]
args = tuple(
arg[:self.training_epoch_size] if arg is not None else arg
for arg in args,
)
batches, epoch_size, batch_size = self.create_batches(
data, *args, **kwargs
)
if self.buffer_size:
batches = BufferedIterator(batches, buffer_size=self.buffer_size)
# Don't wrap the batches with tqdm until after buffering, to avoid
# displaying a progress bar whilst eagerly generating batches.
return self.tqdm(batches, epoch_size, batch_size)
def shuffle_data(self, *args):
state = self.random.get_state()
shuffled_data = tuple(
self.shuffle_array(array, state) for array in args,
)
if len(shuffled_data) == 1:
return shuffled_data[0]
else:
return shuffled_data
def shuffle_array(self, array, state):
if array is None:
return None
self.random.set_state(state)
if isinstance(array, pd.DataFrame):
# Can't use sample because it's not consistent behavior for numpy
# arrays.
return array.iloc[self.random.permutation(len(array))]
elif hasattr(array, 'shuffle'):
# Handle e.g. DeferredArray, which has custom logic.
return array.permutation(self.random)
else:
return self.random.permutation(array)
def create_batches(self, data, *args, **kwargs):
batch_size = self.batch_size
if self.no_stub_batch:
epoch_size = len(data) // batch_size * batch_size
else:
epoch_size = len(data)
def batches():
for i in range(0, epoch_size, batch_size):
batch_slice = slice(i, i + batch_size)
x_batch = data[batch_slice]
args_batch = tuple(
arg[batch_slice] if arg is not None else arg
for arg in args,
)
yield self.transform(x_batch, *args_batch, **kwargs)
return batches(), epoch_size, batch_size
def transform(self, data, *args):
return (data,) + args if args else data
def tqdm(self, batches, epoch_size, batch_size):
with tqdm(
total=epoch_size, leave=False, disable=None, unit='ex',
) as pbar:
for batch in batches:
yield batch
pbar.update(batch_size)
| [
1,
1053,
10876,
13,
5215,
3244,
292,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
5215,
4832,
13,
3166,
4832,
29889,
13529,
267,
29889,
9990,
1053,
5462,
434,
13,
13,
3166,
6317,
13239,
1053,
565,
29918,
9290,
13,
13,
1649,
497,
1649,
353,
6702,
23145,
20277,
742,
29897,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
13,
13,
29928,
12413,
353,
1203,
580,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
13,
13,
13,
1990,
22217,
20277,
29898,
28319,
29889,
20277,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2752,
29892,
6835,
29918,
2311,
29922,
29906,
1125,
13,
4706,
4974,
6835,
29918,
2311,
6736,
29871,
29906,
29892,
376,
1195,
12539,
6835,
2159,
338,
29871,
29906,
29908,
13,
13,
4706,
396,
450,
11828,
6835,
2159,
338,
697,
7200,
29892,
1363,
278,
12623,
13,
4706,
396,
1889,
674,
5706,
697,
4805,
1543,
322,
2908,
2745,
727,
338,
5716,
13,
4706,
396,
297,
278,
6835,
29889,
13,
4706,
1583,
29889,
9040,
353,
5462,
434,
29898,
3317,
2311,
29922,
9040,
29918,
2311,
448,
29871,
29896,
29897,
13,
13,
4706,
822,
19450,
29918,
9040,
7295,
13,
9651,
1018,
29901,
13,
18884,
363,
2944,
297,
2752,
29901,
13,
462,
1678,
1583,
29889,
9040,
29889,
649,
3552,
8516,
29892,
2944,
876,
13,
9651,
5174,
29901,
13,
18884,
1583,
29889,
9040,
29889,
649,
3552,
9675,
29889,
735,
29883,
29918,
3888,
3285,
6213,
876,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
9040,
29889,
649,
29898,
29928,
12413,
29897,
13,
13,
4706,
3244,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
7323,
5987,
29918,
9040,
29897,
13,
4706,
3244,
29889,
1388,
9857,
353,
5852,
13,
4706,
3244,
29889,
2962,
580,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
4622,
12035,
1311,
1125,
13,
4706,
995,
353,
1583,
29889,
9040,
29889,
657,
580,
13,
4706,
565,
995,
338,
360,
12413,
29901,
13,
9651,
12020,
22303,
13463,
362,
580,
13,
13,
4706,
5566,
29918,
3888,
29892,
848,
353,
995,
13,
4706,
565,
5566,
29918,
3888,
29901,
13,
9651,
4832,
29889,
13941,
895,
10456,
735,
29883,
29918,
3888,
29897,
13,
4706,
736,
848,
13,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
13,
13,
13,
1990,
350,
905,
20277,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
9853,
29918,
2311,
29892,
13,
4706,
6694,
29918,
1022,
2878,
29918,
2311,
29922,
8516,
29892,
13,
4706,
694,
29918,
303,
431,
29918,
16175,
29922,
8824,
29892,
13,
4706,
528,
21897,
29922,
8516,
29892,
13,
4706,
16717,
29922,
8516,
29892,
13,
4706,
6835,
29918,
2311,
29922,
29906,
29892,
13,
268,
1125,
13,
4706,
1583,
29889,
16175,
29918,
2311,
353,
9853,
29918,
2311,
13,
4706,
1583,
29889,
26495,
29918,
1022,
2878,
29918,
2311,
353,
6694,
29918,
1022,
2878,
29918,
2311,
13,
4706,
1583,
29889,
1217,
29918,
303,
431,
29918,
16175,
353,
694,
29918,
303,
431,
29918,
16175,
13,
13,
4706,
1583,
29889,
845,
21897,
353,
528,
21897,
13,
4706,
565,
16717,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
8172,
353,
7442,
29889,
8172,
29889,
17875,
2792,
29898,
26776,
29897,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
8172,
353,
7442,
29889,
8172,
13,
13,
4706,
1583,
29889,
9040,
29918,
2311,
353,
6835,
29918,
2311,
13,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
848,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
565,
565,
29918,
9290,
29898,
1311,
29889,
845,
21897,
29892,
9049,
5085,
29889,
657,
877,
26495,
742,
7700,
22164,
13,
9651,
528,
3096,
839,
29918,
1272,
353,
1583,
29889,
845,
21897,
29918,
1272,
29898,
1272,
29892,
334,
5085,
29897,
13,
9651,
565,
6389,
29901,
13,
18884,
848,
353,
528,
3096,
839,
29918,
1272,
29961,
29900,
29962,
13,
18884,
6389,
353,
528,
3096,
839,
29918,
1272,
29961,
29896,
17531,
13,
9651,
1683,
29901,
13,
18884,
848,
353,
528,
3096,
839,
29918,
1272,
13,
13,
9651,
565,
1583,
29889,
26495,
29918,
1022,
2878,
29918,
2311,
338,
451,
6213,
29901,
13,
18884,
848,
353,
848,
7503,
1311,
29889,
26495,
29918,
1022,
2878,
29918,
2311,
29962,
13,
18884,
6389,
353,
18761,
29898,
13,
462,
1678,
1852,
7503,
1311,
29889,
26495,
29918,
1022,
2878,
29918,
2311,
29962,
565,
1852,
338,
451,
6213,
1683,
1852,
13,
462,
1678,
363,
1852,
297,
6389,
29892,
13,
18884,
1723,
13,
13,
4706,
9853,
267,
29892,
21502,
305,
29918,
2311,
29892,
9853,
29918,
2311,
353,
1583,
29889,
3258,
29918,
16175,
267,
29898,
13,
9651,
848,
29892,
334,
5085,
29892,
3579,
19290,
13,
4706,
1723,
13,
4706,
565,
1583,
29889,
9040,
29918,
2311,
29901,
13,
9651,
9853,
267,
353,
22217,
20277,
29898,
16175,
267,
29892,
6835,
29918,
2311,
29922,
1311,
29889,
9040,
29918,
2311,
29897,
13,
13,
4706,
396,
3872,
29915,
29873,
12244,
278,
9853,
267,
411,
260,
29939,
18933,
2745,
1156,
6835,
292,
29892,
304,
4772,
13,
4706,
396,
16384,
263,
6728,
2594,
21109,
19888,
368,
14655,
9853,
267,
29889,
13,
4706,
736,
1583,
29889,
29873,
29939,
18933,
29898,
16175,
267,
29892,
21502,
305,
29918,
2311,
29892,
9853,
29918,
2311,
29897,
13,
13,
1678,
822,
528,
21897,
29918,
1272,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
2106,
353,
1583,
29889,
8172,
29889,
657,
29918,
3859,
580,
13,
4706,
528,
3096,
839,
29918,
1272,
353,
18761,
29898,
13,
9651,
1583,
29889,
845,
21897,
29918,
2378,
29898,
2378,
29892,
2106,
29897,
363,
1409,
297,
6389,
29892,
13,
4706,
1723,
13,
4706,
565,
7431,
29898,
845,
3096,
839,
29918,
1272,
29897,
1275,
29871,
29896,
29901,
13,
9651,
736,
528,
3096,
839,
29918,
1272,
29961,
29900,
29962,
13,
4706,
1683,
29901,
13,
9651,
736,
528,
3096,
839,
29918,
1272,
13,
13,
1678,
822,
528,
21897,
29918,
2378,
29898,
1311,
29892,
1409,
29892,
2106,
1125,
13,
4706,
565,
1409,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
13,
4706,
1583,
29889,
8172,
29889,
842,
29918,
3859,
29898,
3859,
29897,
13,
13,
4706,
565,
338,
8758,
29898,
2378,
29892,
10518,
29889,
17271,
1125,
13,
9651,
396,
1815,
29915,
29873,
671,
4559,
1363,
372,
29915,
29879,
451,
13747,
6030,
363,
12655,
13,
9651,
396,
7049,
29889,
13,
9651,
736,
1409,
29889,
309,
542,
29961,
1311,
29889,
8172,
29889,
546,
6149,
362,
29898,
2435,
29898,
2378,
28166,
13,
4706,
25342,
756,
5552,
29898,
2378,
29892,
525,
845,
21897,
29374,
13,
9651,
396,
29273,
321,
29889,
29887,
29889,
897,
14373,
2588,
29892,
607,
756,
2888,
5900,
29889,
13,
9651,
736,
1409,
29889,
546,
6149,
362,
29898,
1311,
29889,
8172,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
29889,
8172,
29889,
546,
6149,
362,
29898,
2378,
29897,
13,
13,
1678,
822,
1653,
29918,
16175,
267,
29898,
1311,
29892,
848,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9853,
29918,
2311,
353,
1583,
29889,
16175,
29918,
2311,
13,
4706,
565,
1583,
29889,
1217,
29918,
303,
431,
29918,
16175,
29901,
13,
9651,
21502,
305,
29918,
2311,
353,
7431,
29898,
1272,
29897,
849,
9853,
29918,
2311,
334,
9853,
29918,
2311,
13,
4706,
1683,
29901,
13,
9651,
21502,
305,
29918,
2311,
353,
7431,
29898,
1272,
29897,
13,
13,
4706,
822,
9853,
267,
7295,
13,
9651,
363,
474,
297,
3464,
29898,
29900,
29892,
21502,
305,
29918,
2311,
29892,
9853,
29918,
2311,
1125,
13,
18884,
9853,
29918,
18337,
353,
22780,
29898,
29875,
29892,
474,
718,
9853,
29918,
2311,
29897,
13,
18884,
921,
29918,
16175,
353,
848,
29961,
16175,
29918,
18337,
29962,
13,
18884,
6389,
29918,
16175,
353,
18761,
29898,
13,
462,
1678,
1852,
29961,
16175,
29918,
18337,
29962,
565,
1852,
338,
451,
6213,
1683,
1852,
13,
462,
1678,
363,
1852,
297,
6389,
29892,
13,
18884,
1723,
13,
13,
18884,
7709,
1583,
29889,
9067,
29898,
29916,
29918,
16175,
29892,
334,
5085,
29918,
16175,
29892,
3579,
19290,
29897,
13,
13,
4706,
736,
9853,
267,
3285,
21502,
305,
29918,
2311,
29892,
9853,
29918,
2311,
13,
13,
1678,
822,
4327,
29898,
1311,
29892,
848,
29892,
334,
5085,
1125,
13,
4706,
736,
313,
1272,
29892,
29897,
718,
6389,
565,
6389,
1683,
848,
13,
13,
1678,
822,
260,
29939,
18933,
29898,
1311,
29892,
9853,
267,
29892,
21502,
305,
29918,
2311,
29892,
9853,
29918,
2311,
1125,
13,
4706,
411,
260,
29939,
18933,
29898,
13,
9651,
3001,
29922,
1022,
2878,
29918,
2311,
29892,
5967,
29922,
8824,
29892,
11262,
29922,
8516,
29892,
5190,
2433,
735,
742,
13,
4706,
1723,
408,
282,
1646,
29901,
13,
9651,
363,
9853,
297,
9853,
267,
29901,
13,
18884,
7709,
9853,
13,
18884,
282,
1646,
29889,
5504,
29898,
16175,
29918,
2311,
29897,
13,
2
] |
backend/main_app/migrations/0005_rename_inn_user_company.py | RTUITLab/Energomach-Hack-2021-RealityGang | 0 | 56199 | <reponame>RTUITLab/Energomach-Hack-2021-RealityGang
# Generated by Django 3.2 on 2021-05-22 10:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main_app', '0004_auto_20210522_1349'),
]
operations = [
migrations.RenameField(
model_name='user',
old_name='inn',
new_name='company',
),
]
| [
1,
529,
276,
1112,
420,
29958,
13079,
29965,
1806,
28632,
29914,
29923,
1089,
27157,
496,
29899,
29950,
547,
29899,
29906,
29900,
29906,
29896,
29899,
1123,
2877,
29954,
574,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29906,
373,
29871,
29906,
29900,
29906,
29896,
29899,
29900,
29945,
29899,
29906,
29906,
29871,
29896,
29900,
29901,
29945,
29900,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
3396,
29918,
932,
742,
525,
29900,
29900,
29900,
29946,
29918,
6921,
29918,
29906,
29900,
29906,
29896,
29900,
29945,
29906,
29906,
29918,
29896,
29941,
29946,
29929,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
29934,
3871,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1792,
742,
13,
9651,
2030,
29918,
978,
2433,
2559,
742,
13,
9651,
716,
29918,
978,
2433,
14518,
742,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
f3dasm/abaqus/run/run_model.py | bessagroup/F3DASM | 26 | 107957 | <gh_stars>10-100
'''
Created on 2020-04-22 14:53:01
Last modified on 2020-09-30 14:37:32
Python 2.7.16
v0.1
@author: <NAME> (<EMAIL>)
Main goal
---------
Run a model sequentially.
Notes
-----
-abaqus cae is kept open during simulation time (appropriate if running time
is low).
'''
# imports
# abaqus
from abaqus import session
# standard library
import os
import glob
import pickle
from collections import OrderedDict
import time
import traceback
# local library
from .utils import convert_dict_unicode_str
from .stats import get_wait_time_from_log
from ..modelling.model import BasicModel
from ..modelling.model import WrapperModel
from ...utils.file_handling import get_unique_file_by_ext
from ...utils.utils import import_abstract_obj
# object definition
class RunModel(object):
def __init__(self):
'''
Notes
-----
-assumes the same data is required to instantiate each model of the
sequence.
'''
# performance related
self.init_time = time.time()
self.time = OrderedDict([('total', None),
('running', OrderedDict()),
('waiting', OrderedDict()),
('post_processing', None)])
# read data
self.filename, data = _read_data()
self.pickle_dict = data
# store variables
self.variables = data['variables']
self.sim_info = data['sim_info']
self.keep_odb = data['keep_odb']
self.dump_py_objs = data['dump_py_objs']
# initialize variables
self.models = OrderedDict()
self.post_processing = OrderedDict()
def execute(self):
# instantiate models
self._instantiate_models()
# run models
self._run_models()
# post-processing
start_time = time.time()
self._perform_post_processing()
self.time['post_processing'] = time.time() - start_time
# dump results
self._dump_results()
# delete unnecessary files
self._clean_dir()
def _instantiate_models(self):
for i, (model_name, info) in enumerate(self.sim_info.items()):
# abstract objects
abstract_model = import_abstract_obj(info['abstract_model'])
pp_fnc_loc = info.get('post_processing_fnc', None)
post_processing_fnc = import_abstract_obj(pp_fnc_loc) if pp_fnc_loc is not None else None
for key in ['abstract_model', 'post_processing_fnc']:
info.pop(key, None)
# get args
args = self.variables.copy()
args.update(info)
# instantiate model
if i:
args.update({'previous_model': list(self.models.values())[i - 1]})
if issubclass(abstract_model, BasicModel):
model = abstract_model(name=model_name, **args)
else:
model = WrapperModel(name=model_name, abstract_model=abstract_model,
post_processing_fnc=post_processing_fnc,
**args)
self.models[model_name] = model
def _run_models(self):
for model in self.models.values():
start_time = time.time()
# run and create model
model.create_model()
model.write_inp(submit=True)
# store times
wait_time = get_wait_time_from_log(model.job_info['name']) if not model.abort else 0.
self.time['running'][model.name] = time.time() - start_time - wait_time
self.time['waiting'][model.name] = wait_time
def _perform_post_processing(self):
for model_name, model in reversed(self.models.items()):
# avoid doing again post-processing
if model_name in self.post_processing.keys():
continue
# do post-processing of current model
if isinstance(model, WrapperModel) and not callable(model.post_processing_fnc) or model.abort:
self.post_processing[model_name] = None
else:
odb_name = '%s.odb' % model.job_info['name']
odb = session.openOdb(name=odb_name)
self.post_processing[model_name] = model.perform_post_processing(odb)
odb.close()
# save post-processing of previous model (if applicable)
if model.previous_model_results is not None and model.previous_model.name not in self.post_processing.keys():
self.post_processing[model.previous_model.name] = model.previous_model_results
self.post_processing = OrderedDict(reversed(list(self.post_processing.items())))
def _dump_results(self):
# results readable outside abaqus
self.pickle_dict['post-processing'] = self.post_processing
# TODO: update success to be less permissive (e.g. subroutine location)
self.pickle_dict['success'] = True
self.time['total'] = time.time() - self.init_time
self.pickle_dict['time'] = self.time
with open(self.filename, 'wb') as file:
pickle.dump(self.pickle_dict, file, protocol=2)
# more complete results readable within abaqus
if self.dump_py_objs:
# prepare models to be dumped
for model in self.models.values():
model.dump(create_file=False)
# dump models
with open('%s_abq' % self.filename, 'wb') as file:
pickle.dump(self.models, file, protocol=2)
def _clean_dir(self):
# return if is to keep odb
if self.keep_odb:
return
job_names = [model.job_name for model in self.models.values()]
for name in job_names:
for filename in glob.glob('%s*' % name):
if not filename.endswith(('.pkl', '.pkl_abq')):
try:
os.remove(filename)
except:
pass
def _read_data():
# get pickle filename
filename = get_unique_file_by_ext(ext='.pkl')
# read file
with open(filename, 'rb') as file:
data = convert_dict_unicode_str(pickle.load(file))
return filename, data
if __name__ == '__main__':
try: # to avoid to stop running due to one simulation error
# create run model
run_model = RunModel()
# run models
run_model.execute()
except:
# create error file
with open('error.txt', 'w') as file:
traceback.print_exc(file=file)
# update success flag
filename, data = _read_data()
with open(filename, 'rb') as file:
data = pickle.load(file)
data['success'] = False
with open(filename, 'wb') as file:
data = pickle.dump(data, file, protocol=2)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
12008,
13,
20399,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29946,
29899,
29906,
29906,
29871,
29896,
29946,
29901,
29945,
29941,
29901,
29900,
29896,
13,
8897,
9120,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29929,
29899,
29941,
29900,
29871,
29896,
29946,
29901,
29941,
29955,
29901,
29941,
29906,
13,
11980,
29871,
29906,
29889,
29955,
29889,
29896,
29953,
13,
29894,
29900,
29889,
29896,
13,
13,
29992,
8921,
29901,
529,
5813,
29958,
313,
29966,
26862,
6227,
12948,
13,
13,
6330,
7306,
13,
1378,
29899,
13,
6558,
263,
1904,
8617,
9247,
29889,
13,
13,
13,
3664,
267,
13,
23648,
13,
29899,
5363,
339,
29879,
274,
3660,
338,
8126,
1722,
2645,
17402,
931,
313,
932,
6649,
403,
565,
2734,
931,
13,
275,
4482,
467,
13,
12008,
13,
13,
13,
29937,
24802,
13,
13,
29937,
633,
18463,
29879,
13,
3166,
633,
18463,
29879,
1053,
4867,
13,
13,
29937,
3918,
3489,
13,
5215,
2897,
13,
5215,
13149,
13,
5215,
5839,
280,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
5215,
931,
13,
5215,
9637,
1627,
13,
13,
29937,
1887,
3489,
13,
3166,
869,
13239,
1053,
3588,
29918,
8977,
29918,
2523,
356,
29918,
710,
13,
3166,
869,
16202,
1053,
679,
29918,
10685,
29918,
2230,
29918,
3166,
29918,
1188,
13,
3166,
6317,
1545,
7807,
29889,
4299,
1053,
19219,
3195,
13,
3166,
6317,
1545,
7807,
29889,
4299,
1053,
399,
6794,
3195,
13,
3166,
2023,
13239,
29889,
1445,
29918,
3179,
1847,
1053,
679,
29918,
13092,
29918,
1445,
29918,
1609,
29918,
1062,
13,
3166,
2023,
13239,
29889,
13239,
1053,
1053,
29918,
16595,
29918,
5415,
13,
13,
13,
29937,
1203,
5023,
13,
13,
1990,
7525,
3195,
29898,
3318,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
14550,
13,
4706,
8695,
13,
4706,
448,
807,
13,
4706,
448,
465,
9351,
278,
1021,
848,
338,
3734,
304,
25112,
1269,
1904,
310,
278,
13,
4706,
5665,
29889,
13,
4706,
14550,
13,
4706,
396,
4180,
4475,
13,
4706,
1583,
29889,
2344,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
4706,
1583,
29889,
2230,
353,
8170,
287,
21533,
4197,
877,
7827,
742,
6213,
511,
13,
462,
462,
6702,
21094,
742,
8170,
287,
21533,
25739,
13,
462,
462,
6702,
10685,
292,
742,
8170,
287,
21533,
25739,
13,
462,
462,
6702,
2490,
29918,
19170,
742,
6213,
29897,
2314,
13,
4706,
396,
1303,
848,
13,
4706,
1583,
29889,
9507,
29892,
848,
353,
903,
949,
29918,
1272,
580,
13,
4706,
1583,
29889,
23945,
280,
29918,
8977,
353,
848,
13,
4706,
396,
3787,
3651,
13,
4706,
1583,
29889,
20897,
353,
848,
1839,
20897,
2033,
13,
4706,
1583,
29889,
3601,
29918,
3888,
353,
848,
1839,
3601,
29918,
3888,
2033,
13,
4706,
1583,
29889,
17462,
29918,
10396,
353,
848,
1839,
17462,
29918,
10396,
2033,
13,
4706,
1583,
29889,
15070,
29918,
2272,
29918,
711,
1315,
353,
848,
1839,
15070,
29918,
2272,
29918,
711,
1315,
2033,
13,
4706,
396,
11905,
3651,
13,
4706,
1583,
29889,
9794,
353,
8170,
287,
21533,
580,
13,
4706,
1583,
29889,
2490,
29918,
19170,
353,
8170,
287,
21533,
580,
13,
13,
1678,
822,
6222,
29898,
1311,
1125,
13,
13,
4706,
396,
25112,
4733,
13,
4706,
1583,
3032,
2611,
3656,
403,
29918,
9794,
580,
13,
13,
4706,
396,
1065,
4733,
13,
4706,
1583,
3032,
3389,
29918,
9794,
580,
13,
13,
4706,
396,
1400,
29899,
19170,
13,
4706,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
4706,
1583,
3032,
19826,
29918,
2490,
29918,
19170,
580,
13,
4706,
1583,
29889,
2230,
1839,
2490,
29918,
19170,
2033,
353,
931,
29889,
2230,
580,
448,
1369,
29918,
2230,
13,
13,
4706,
396,
16766,
2582,
13,
4706,
1583,
3032,
15070,
29918,
9902,
580,
13,
13,
4706,
396,
5217,
19039,
2066,
13,
4706,
1583,
3032,
14941,
29918,
3972,
580,
13,
13,
1678,
822,
903,
2611,
3656,
403,
29918,
9794,
29898,
1311,
1125,
13,
13,
4706,
363,
474,
29892,
313,
4299,
29918,
978,
29892,
5235,
29897,
297,
26985,
29898,
1311,
29889,
3601,
29918,
3888,
29889,
7076,
580,
1125,
13,
13,
9651,
396,
9846,
3618,
13,
9651,
9846,
29918,
4299,
353,
1053,
29918,
16595,
29918,
5415,
29898,
3888,
1839,
16595,
29918,
4299,
11287,
13,
9651,
6499,
29918,
9144,
29883,
29918,
2029,
353,
5235,
29889,
657,
877,
2490,
29918,
19170,
29918,
9144,
29883,
742,
6213,
29897,
13,
9651,
1400,
29918,
19170,
29918,
9144,
29883,
353,
1053,
29918,
16595,
29918,
5415,
29898,
407,
29918,
9144,
29883,
29918,
2029,
29897,
565,
6499,
29918,
9144,
29883,
29918,
2029,
338,
451,
6213,
1683,
6213,
13,
9651,
363,
1820,
297,
6024,
16595,
29918,
4299,
742,
525,
2490,
29918,
19170,
29918,
9144,
29883,
2033,
29901,
13,
18884,
5235,
29889,
7323,
29898,
1989,
29892,
6213,
29897,
13,
13,
9651,
396,
679,
6389,
13,
9651,
6389,
353,
1583,
29889,
20897,
29889,
8552,
580,
13,
9651,
6389,
29889,
5504,
29898,
3888,
29897,
13,
13,
9651,
396,
25112,
1904,
13,
9651,
565,
474,
29901,
13,
18884,
6389,
29889,
5504,
3319,
29915,
24957,
29918,
4299,
2396,
1051,
29898,
1311,
29889,
9794,
29889,
5975,
3101,
29961,
29875,
448,
29871,
29896,
29962,
1800,
13,
9651,
565,
338,
1491,
1990,
29898,
16595,
29918,
4299,
29892,
19219,
3195,
1125,
13,
18884,
1904,
353,
9846,
29918,
4299,
29898,
978,
29922,
4299,
29918,
978,
29892,
3579,
5085,
29897,
13,
9651,
1683,
29901,
13,
18884,
1904,
353,
399,
6794,
3195,
29898,
978,
29922,
4299,
29918,
978,
29892,
9846,
29918,
4299,
29922,
16595,
29918,
4299,
29892,
13,
462,
462,
268,
1400,
29918,
19170,
29918,
9144,
29883,
29922,
2490,
29918,
19170,
29918,
9144,
29883,
29892,
13,
462,
462,
268,
3579,
5085,
29897,
13,
13,
9651,
1583,
29889,
9794,
29961,
4299,
29918,
978,
29962,
353,
1904,
13,
13,
1678,
822,
903,
3389,
29918,
9794,
29898,
1311,
1125,
13,
13,
4706,
363,
1904,
297,
1583,
29889,
9794,
29889,
5975,
7295,
13,
9651,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
13,
9651,
396,
1065,
322,
1653,
1904,
13,
9651,
1904,
29889,
3258,
29918,
4299,
580,
13,
9651,
1904,
29889,
3539,
29918,
262,
29886,
29898,
7892,
29922,
5574,
29897,
13,
13,
9651,
396,
3787,
3064,
13,
9651,
4480,
29918,
2230,
353,
679,
29918,
10685,
29918,
2230,
29918,
3166,
29918,
1188,
29898,
4299,
29889,
9057,
29918,
3888,
1839,
978,
11287,
565,
451,
1904,
29889,
370,
441,
1683,
29871,
29900,
29889,
13,
9651,
1583,
29889,
2230,
1839,
21094,
2033,
29961,
4299,
29889,
978,
29962,
353,
931,
29889,
2230,
580,
448,
1369,
29918,
2230,
448,
4480,
29918,
2230,
13,
9651,
1583,
29889,
2230,
1839,
10685,
292,
2033,
29961,
4299,
29889,
978,
29962,
353,
4480,
29918,
2230,
13,
13,
1678,
822,
903,
19826,
29918,
2490,
29918,
19170,
29898,
1311,
1125,
13,
13,
4706,
363,
1904,
29918,
978,
29892,
1904,
297,
18764,
287,
29898,
1311,
29889,
9794,
29889,
7076,
580,
1125,
13,
13,
9651,
396,
4772,
2599,
1449,
1400,
29899,
19170,
13,
9651,
565,
1904,
29918,
978,
297,
1583,
29889,
2490,
29918,
19170,
29889,
8149,
7295,
13,
18884,
6773,
13,
13,
9651,
396,
437,
1400,
29899,
19170,
310,
1857,
1904,
13,
9651,
565,
338,
8758,
29898,
4299,
29892,
399,
6794,
3195,
29897,
322,
451,
1246,
519,
29898,
4299,
29889,
2490,
29918,
19170,
29918,
9144,
29883,
29897,
470,
1904,
29889,
370,
441,
29901,
13,
18884,
1583,
29889,
2490,
29918,
19170,
29961,
4299,
29918,
978,
29962,
353,
6213,
13,
9651,
1683,
29901,
13,
13,
18884,
2413,
29890,
29918,
978,
353,
14210,
29879,
29889,
10396,
29915,
1273,
1904,
29889,
9057,
29918,
3888,
1839,
978,
2033,
13,
18884,
2413,
29890,
353,
4867,
29889,
3150,
29949,
2585,
29898,
978,
29922,
10396,
29918,
978,
29897,
13,
18884,
1583,
29889,
2490,
29918,
19170,
29961,
4299,
29918,
978,
29962,
353,
1904,
29889,
19826,
29918,
2490,
29918,
19170,
29898,
10396,
29897,
13,
18884,
2413,
29890,
29889,
5358,
580,
13,
13,
9651,
396,
4078,
1400,
29899,
19170,
310,
3517,
1904,
313,
361,
22903,
29897,
13,
9651,
565,
1904,
29889,
24957,
29918,
4299,
29918,
9902,
338,
451,
6213,
322,
1904,
29889,
24957,
29918,
4299,
29889,
978,
451,
297,
1583,
29889,
2490,
29918,
19170,
29889,
8149,
7295,
13,
18884,
1583,
29889,
2490,
29918,
19170,
29961,
4299,
29889,
24957,
29918,
4299,
29889,
978,
29962,
353,
1904,
29889,
24957,
29918,
4299,
29918,
9902,
13,
4706,
1583,
29889,
2490,
29918,
19170,
353,
8170,
287,
21533,
29898,
276,
874,
287,
29898,
1761,
29898,
1311,
29889,
2490,
29918,
19170,
29889,
7076,
580,
4961,
13,
13,
1678,
822,
903,
15070,
29918,
9902,
29898,
1311,
1125,
13,
13,
4706,
396,
2582,
19909,
5377,
633,
18463,
29879,
13,
4706,
1583,
29889,
23945,
280,
29918,
8977,
1839,
2490,
29899,
19170,
2033,
353,
1583,
29889,
2490,
29918,
19170,
13,
4706,
396,
14402,
29901,
2767,
2551,
304,
367,
3109,
3635,
790,
573,
313,
29872,
29889,
29887,
29889,
1014,
14608,
457,
4423,
29897,
13,
4706,
1583,
29889,
23945,
280,
29918,
8977,
1839,
8698,
2033,
353,
5852,
13,
4706,
1583,
29889,
2230,
1839,
7827,
2033,
353,
931,
29889,
2230,
580,
448,
1583,
29889,
2344,
29918,
2230,
13,
4706,
1583,
29889,
23945,
280,
29918,
8977,
1839,
2230,
2033,
353,
1583,
29889,
2230,
13,
4706,
411,
1722,
29898,
1311,
29889,
9507,
29892,
525,
29893,
29890,
1495,
408,
934,
29901,
13,
9651,
5839,
280,
29889,
15070,
29898,
1311,
29889,
23945,
280,
29918,
8977,
29892,
934,
29892,
9608,
29922,
29906,
29897,
13,
13,
4706,
396,
901,
4866,
2582,
19909,
2629,
633,
18463,
29879,
13,
4706,
565,
1583,
29889,
15070,
29918,
2272,
29918,
711,
1315,
29901,
13,
9651,
396,
19012,
4733,
304,
367,
16766,
287,
13,
9651,
363,
1904,
297,
1583,
29889,
9794,
29889,
5975,
7295,
13,
18884,
1904,
29889,
15070,
29898,
3258,
29918,
1445,
29922,
8824,
29897,
13,
9651,
396,
16766,
4733,
13,
9651,
411,
1722,
877,
29995,
29879,
29918,
370,
29939,
29915,
1273,
1583,
29889,
9507,
29892,
525,
29893,
29890,
1495,
408,
934,
29901,
13,
18884,
5839,
280,
29889,
15070,
29898,
1311,
29889,
9794,
29892,
934,
29892,
9608,
29922,
29906,
29897,
13,
13,
1678,
822,
903,
14941,
29918,
3972,
29898,
1311,
1125,
13,
4706,
396,
736,
565,
338,
304,
3013,
2413,
29890,
13,
4706,
565,
1583,
29889,
17462,
29918,
10396,
29901,
13,
9651,
736,
13,
13,
4706,
4982,
29918,
7039,
353,
518,
4299,
29889,
9057,
29918,
978,
363,
1904,
297,
1583,
29889,
9794,
29889,
5975,
580,
29962,
13,
4706,
363,
1024,
297,
4982,
29918,
7039,
29901,
13,
9651,
363,
10422,
297,
13149,
29889,
23705,
877,
29995,
29879,
29930,
29915,
1273,
1024,
1125,
13,
18884,
565,
451,
10422,
29889,
1975,
2541,
29898,
12839,
29886,
6321,
742,
15300,
29886,
6321,
29918,
370,
29939,
8785,
29901,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
2897,
29889,
5992,
29898,
9507,
29897,
13,
462,
1678,
5174,
29901,
13,
462,
4706,
1209,
13,
13,
13,
1753,
903,
949,
29918,
1272,
7295,
13,
13,
1678,
396,
679,
5839,
280,
10422,
13,
1678,
10422,
353,
679,
29918,
13092,
29918,
1445,
29918,
1609,
29918,
1062,
29898,
1062,
2433,
29889,
29886,
6321,
1495,
13,
13,
1678,
396,
1303,
934,
13,
1678,
411,
1722,
29898,
9507,
29892,
525,
6050,
1495,
408,
934,
29901,
13,
4706,
848,
353,
3588,
29918,
8977,
29918,
2523,
356,
29918,
710,
29898,
23945,
280,
29889,
1359,
29898,
1445,
876,
13,
13,
1678,
736,
10422,
29892,
848,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
13,
1678,
1018,
29901,
29871,
396,
304,
4772,
304,
5040,
2734,
2861,
304,
697,
17402,
1059,
13,
4706,
396,
1653,
1065,
1904,
13,
4706,
1065,
29918,
4299,
353,
7525,
3195,
580,
13,
13,
4706,
396,
1065,
4733,
13,
4706,
1065,
29918,
4299,
29889,
7978,
580,
13,
13,
1678,
5174,
29901,
13,
13,
4706,
396,
1653,
1059,
934,
13,
4706,
411,
1722,
877,
2704,
29889,
3945,
742,
525,
29893,
1495,
408,
934,
29901,
13,
9651,
9637,
1627,
29889,
2158,
29918,
735,
29883,
29898,
1445,
29922,
1445,
29897,
13,
13,
4706,
396,
2767,
2551,
7353,
13,
4706,
10422,
29892,
848,
353,
903,
949,
29918,
1272,
580,
13,
4706,
411,
1722,
29898,
9507,
29892,
525,
6050,
1495,
408,
934,
29901,
13,
9651,
848,
353,
5839,
280,
29889,
1359,
29898,
1445,
29897,
13,
4706,
848,
1839,
8698,
2033,
353,
7700,
13,
4706,
411,
1722,
29898,
9507,
29892,
525,
29893,
29890,
1495,
408,
934,
29901,
13,
9651,
848,
353,
5839,
280,
29889,
15070,
29898,
1272,
29892,
934,
29892,
9608,
29922,
29906,
29897,
13,
2
] |
cogs/oekaki.py | Zenrac/CS-Pound | 1 | 102041 | import discord
from discord.ext import commands
from chickensmoothie import _get_web_data
class Oekaki:
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.guild_only()
async def oekaki(self, ctx, link: str = ''):
data = await _get_web_data(link) # Get Oekaki data
if data[0]: # If data is valid
base_link = 'http://www.chickensmoothie.com/Forum/'
oekaki_title = data[1].xpath('//h3[@class="first"]/a/text()')[0] # Title of drawing
image = 'https://www.chickensmoothie.com' + data[1].xpath('//li[@class="ok-topic-head-image large"]/img/@src')[0] # Image of drawing
user_icon = base_link[:-1] + data[1].xpath('//dl[@class="postprofile"]')[0].xpath('dt/a/img/@src')[0][1:] # The profile picture of the artist
warning_text = 'Reminder!! Copying another person\'s art without permission to reproduce their work is a form of art-theft!' # General warning text regarding Oekaki art
if data[1].xpath('//table[@class="ok-drawing-info"]/tr')[0].xpath('td')[1].xpath('a/text()')[0] == 'Click to view': # If drawing is based off another drawing
artist_links = data[1].xpath('//table[@class="ok-drawing-info"]/tr')[1].xpath('td')[1].xpath('a/@href') # Drawing information titles
artist_values = data[1].xpath('//table[@class="ok-drawing-info"]/tr')[1].xpath('td')[1].xpath('a/text()') # Drawing information values
else: # If drawing is not based off another drawing
artist_links = data[1].xpath('//table[@class="ok-drawing-info"]/tr')[0].xpath('td')[1].xpath('a/@href') # Drawing information titles
artist_values = data[1].xpath('//table[@class="ok-drawing-info"]/tr')[0].xpath('td')[1].xpath('a/text()') # Drawing information values
artist_text = '[' + artist_values[0] + '](' + base_link + artist_links[0][1:] + ') [' + artist_values[1] + '(' + base_link + artist_links[1][1:] + ')]' # [Artist Name](Link to Artist) [gallery](Link to Artist gallery) | Formats to Artist Name [gallery]
embed = discord.Embed(title=oekaki_title, colour=0x4ba139, url=link) # Create embed
embed.add_field(name='Artist', value=artist_text) # Add Artist field
embed.set_footer(text=warning_text, icon_url="https://vignette.wikia.nocookie.net/pufflescp/images/6/68/Red_Warning_Triangle.png/revision/latest?cb=20160718024653&format=original") # Add warning text to footer
embed.set_image(url=image) # Add drawing to embed
embed.set_thumbnail(url=user_icon) # Set thumbnail as user profile picture
await ctx.send(embed=embed) # Send embed
else: # If data is not valid
await ctx.send(embed=data[1]) # Send embed
def setup(bot):
bot.add_cog(Oekaki(bot))
| [
1,
1053,
2313,
536,
13,
3166,
2313,
536,
29889,
1062,
1053,
8260,
13,
13,
3166,
521,
860,
575,
4346,
720,
347,
1053,
903,
657,
29918,
2676,
29918,
1272,
13,
13,
13,
1990,
438,
1416,
9940,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9225,
1125,
13,
4706,
1583,
29889,
7451,
353,
9225,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
7465,
822,
288,
1416,
9940,
29898,
1311,
29892,
12893,
29892,
1544,
29901,
851,
353,
6629,
1125,
13,
4706,
848,
353,
7272,
903,
657,
29918,
2676,
29918,
1272,
29898,
2324,
29897,
29871,
396,
3617,
438,
1416,
9940,
848,
13,
4706,
565,
848,
29961,
29900,
5387,
29871,
396,
960,
848,
338,
2854,
13,
9651,
2967,
29918,
2324,
353,
525,
1124,
597,
1636,
29889,
305,
860,
575,
4346,
720,
347,
29889,
510,
29914,
2831,
398,
22208,
13,
13,
9651,
288,
1416,
9940,
29918,
3257,
353,
848,
29961,
29896,
1822,
23635,
877,
458,
29882,
29941,
17548,
1990,
543,
4102,
3108,
29914,
29874,
29914,
726,
580,
29861,
29900,
29962,
29871,
396,
18527,
310,
11580,
13,
9651,
1967,
353,
525,
991,
597,
1636,
29889,
305,
860,
575,
4346,
720,
347,
29889,
510,
29915,
718,
848,
29961,
29896,
1822,
23635,
877,
458,
492,
17548,
1990,
543,
554,
29899,
13010,
29899,
2813,
29899,
3027,
2919,
3108,
29914,
2492,
29368,
4351,
29861,
29900,
29962,
29871,
396,
7084,
310,
11580,
13,
9651,
1404,
29918,
4144,
353,
2967,
29918,
2324,
7503,
29899,
29896,
29962,
718,
848,
29961,
29896,
1822,
23635,
877,
458,
11671,
17548,
1990,
543,
2490,
10185,
3108,
29861,
29900,
1822,
23635,
877,
6008,
29914,
29874,
29914,
2492,
29368,
4351,
29861,
29900,
3816,
29896,
17531,
29871,
396,
450,
8722,
7623,
310,
278,
7664,
13,
9651,
9177,
29918,
726,
353,
525,
7301,
4995,
6824,
14187,
292,
1790,
2022,
20333,
29879,
1616,
1728,
10751,
304,
18532,
1009,
664,
338,
263,
883,
310,
1616,
29899,
1552,
615,
20714,
29871,
396,
4593,
9177,
1426,
11211,
438,
1416,
9940,
1616,
13,
13,
9651,
565,
848,
29961,
29896,
1822,
23635,
877,
458,
2371,
17548,
1990,
543,
554,
29899,
4012,
292,
29899,
3888,
3108,
29914,
509,
29861,
29900,
1822,
23635,
877,
1594,
29861,
29896,
1822,
23635,
877,
29874,
29914,
726,
580,
29861,
29900,
29962,
1275,
525,
4164,
304,
1776,
2396,
29871,
396,
960,
11580,
338,
2729,
1283,
1790,
11580,
13,
18884,
7664,
29918,
4965,
353,
848,
29961,
29896,
1822,
23635,
877,
458,
2371,
17548,
1990,
543,
554,
29899,
4012,
292,
29899,
3888,
3108,
29914,
509,
29861,
29896,
1822,
23635,
877,
1594,
29861,
29896,
1822,
23635,
877,
29874,
29368,
12653,
1495,
29871,
396,
18492,
292,
2472,
17735,
13,
18884,
7664,
29918,
5975,
353,
848,
29961,
29896,
1822,
23635,
877,
458,
2371,
17548,
1990,
543,
554,
29899,
4012,
292,
29899,
3888,
3108,
29914,
509,
29861,
29896,
1822,
23635,
877,
1594,
29861,
29896,
1822,
23635,
877,
29874,
29914,
726,
580,
1495,
29871,
396,
18492,
292,
2472,
1819,
13,
9651,
1683,
29901,
29871,
396,
960,
11580,
338,
451,
2729,
1283,
1790,
11580,
13,
18884,
7664,
29918,
4965,
353,
848,
29961,
29896,
1822,
23635,
877,
458,
2371,
17548,
1990,
543,
554,
29899,
4012,
292,
29899,
3888,
3108,
29914,
509,
29861,
29900,
1822,
23635,
877,
1594,
29861,
29896,
1822,
23635,
877,
29874,
29368,
12653,
1495,
29871,
396,
18492,
292,
2472,
17735,
13,
18884,
7664,
29918,
5975,
353,
848,
29961,
29896,
1822,
23635,
877,
458,
2371,
17548,
1990,
543,
554,
29899,
4012,
292,
29899,
3888,
3108,
29914,
509,
29861,
29900,
1822,
23635,
877,
1594,
29861,
29896,
1822,
23635,
877,
29874,
29914,
726,
580,
1495,
29871,
396,
18492,
292,
2472,
1819,
13,
13,
9651,
7664,
29918,
726,
353,
525,
1839,
718,
7664,
29918,
5975,
29961,
29900,
29962,
718,
525,
850,
29915,
718,
2967,
29918,
2324,
718,
7664,
29918,
4965,
29961,
29900,
3816,
29896,
17531,
718,
25710,
6024,
718,
7664,
29918,
5975,
29961,
29896,
29962,
718,
525,
877,
718,
2967,
29918,
2324,
718,
7664,
29918,
4965,
29961,
29896,
3816,
29896,
17531,
718,
525,
4638,
29915,
29871,
396,
518,
9986,
391,
4408,
850,
6595,
304,
3012,
391,
29897,
518,
29887,
23365,
850,
6595,
304,
3012,
391,
23363,
29897,
891,
3812,
1446,
304,
3012,
391,
4408,
518,
29887,
23365,
29962,
13,
13,
9651,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
3257,
29922,
29877,
1416,
9940,
29918,
3257,
29892,
12384,
29922,
29900,
29916,
29946,
2291,
29896,
29941,
29929,
29892,
3142,
29922,
2324,
29897,
29871,
396,
6204,
8297,
13,
9651,
8297,
29889,
1202,
29918,
2671,
29898,
978,
2433,
9986,
391,
742,
995,
29922,
442,
391,
29918,
726,
29897,
29871,
396,
3462,
3012,
391,
1746,
13,
9651,
8297,
29889,
842,
29918,
21720,
29898,
726,
29922,
27392,
29918,
726,
29892,
9849,
29918,
2271,
543,
991,
597,
29894,
647,
2353,
29889,
2851,
423,
29889,
10763,
2550,
347,
29889,
1212,
29914,
29886,
3096,
793,
6814,
29914,
8346,
29914,
29953,
29914,
29953,
29947,
29914,
9039,
29918,
22709,
29918,
29565,
2521,
29889,
2732,
29914,
276,
4924,
29914,
12333,
29973,
10702,
29922,
29906,
29900,
29896,
29953,
29900,
29955,
29896,
29947,
29900,
29906,
29946,
29953,
29945,
29941,
29987,
4830,
29922,
13492,
1159,
29871,
396,
3462,
9177,
1426,
304,
24166,
13,
9651,
8297,
29889,
842,
29918,
3027,
29898,
2271,
29922,
3027,
29897,
29871,
396,
3462,
11580,
304,
8297,
13,
9651,
8297,
29889,
842,
29918,
386,
21145,
29898,
2271,
29922,
1792,
29918,
4144,
29897,
29871,
396,
3789,
266,
21145,
408,
1404,
8722,
7623,
13,
13,
9651,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
29871,
396,
15076,
8297,
13,
4706,
1683,
29901,
29871,
396,
960,
848,
338,
451,
2854,
13,
9651,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
1272,
29961,
29896,
2314,
29871,
396,
15076,
8297,
13,
13,
13,
1753,
6230,
29898,
7451,
1125,
13,
1678,
9225,
29889,
1202,
29918,
29883,
468,
29898,
29949,
1416,
9940,
29898,
7451,
876,
13,
2
] |
desafios/desafio#17.py | thiagocanabarro/PythonProjects | 0 | 187048 | #Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triângulo retângulo, calcule e mostre o comprimento da hipotenusa.
from math import hypot
co = float(input("Digite o valor do cateto oposto: "))
ca = float(input("Digite o valor do cateto adjacente: "))
hi = hypot (co,ca)
print("O valor da hipotenusa é: {:.2f}".format(hi)) | [
1,
396,
14206,
4277,
1922,
16914,
712,
454,
423,
288,
7199,
6174,
437,
6635,
10896,
1015,
5548,
321,
437,
6635,
10896,
12109,
562,
2016,
316,
1922,
3367,
30057,
865,
7207,
3240,
30057,
865,
7207,
29892,
22235,
1297,
321,
1556,
276,
288,
7199,
6174,
29871,
1146,
21464,
16368,
11326,
29889,
13,
13,
3166,
5844,
1053,
10163,
327,
13,
13,
1111,
353,
5785,
29898,
2080,
703,
14991,
568,
288,
16497,
437,
6635,
10896,
1015,
5548,
29901,
376,
876,
13,
1113,
353,
5785,
29898,
2080,
703,
14991,
568,
288,
16497,
437,
6635,
10896,
12109,
562,
2016,
29901,
376,
876,
13,
13,
2918,
353,
10163,
327,
313,
1111,
29892,
1113,
29897,
13,
13,
2158,
703,
29949,
16497,
1146,
21464,
16368,
11326,
904,
29901,
12365,
29889,
29906,
29888,
29913,
1642,
4830,
29898,
2918,
876,
2
] |
deepspeech_pytorch/testing.py | Chudbrochil/deepspeech.pytorch-2.1 | 13 | 18503 | <reponame>Chudbrochil/deepspeech.pytorch-2.1
import hydra
import torch
from tqdm import tqdm
from deepspeech_pytorch.configs.inference_config import EvalConfig
from deepspeech_pytorch.decoder import GreedyDecoder
from deepspeech_pytorch.loader.data_loader import SpectrogramDataset, AudioDataLoader
from deepspeech_pytorch.utils import load_model, load_decoder
@torch.no_grad()
def evaluate(cfg: EvalConfig):
device = torch.device("cuda" if cfg.model.cuda else "cpu")
model = load_model(device=device,
model_path=cfg.model.model_path,
use_half=cfg.model.use_half)
decoder = load_decoder(labels=model.labels,
cfg=cfg.lm)
target_decoder = GreedyDecoder(model.labels,
blank_index=model.labels.index('_'))
test_dataset = SpectrogramDataset(audio_conf=model.audio_conf,
manifest_filepath=hydra.utils.to_absolute_path(cfg.test_manifest),
labels=model.labels,
normalize=True)
test_loader = AudioDataLoader(test_dataset,
batch_size=cfg.batch_size,
num_workers=cfg.num_workers)
wer, cer, output_data = run_evaluation(test_loader=test_loader,
device=device,
model=model,
decoder=decoder,
target_decoder=target_decoder,
save_output=cfg.save_output,
verbose=cfg.verbose,
use_half=cfg.model.use_half)
print('Test Summary \t'
'Average WER {wer:.3f}\t'
'Average CER {cer:.3f}\t'.format(wer=wer, cer=cer))
if cfg.save_output:
torch.save(output_data, hydra.utils.to_absolute_path(cfg.save_output))
@torch.no_grad()
def run_evaluation(test_loader,
device,
model,
decoder,
target_decoder,
save_output=None,
verbose=False,
use_half=False):
model.eval()
total_cer, total_wer, num_tokens, num_chars = 0, 0, 0, 0
output_data = []
for i, (data) in tqdm(enumerate(test_loader), total=len(test_loader)):
inputs, targets, input_percentages, target_sizes = data
input_sizes = input_percentages.mul_(int(inputs.size(3))).int()
inputs = inputs.to(device)
if use_half:
inputs = inputs.half()
# unflatten targets
split_targets = []
offset = 0
for size in target_sizes:
split_targets.append(targets[offset:offset + size])
offset += size
out, output_sizes = model(inputs, input_sizes)
decoded_output, _ = decoder.decode(out, output_sizes)
target_strings = target_decoder.convert_to_strings(split_targets)
if save_output is not None:
# add output to data array, and continue
output_data.append((out.cpu(), output_sizes, target_strings))
for x in range(len(target_strings)):
transcript, reference = decoded_output[x][0], target_strings[x][0]
wer_inst = decoder.wer(transcript, reference)
cer_inst = decoder.cer(transcript, reference)
total_wer += wer_inst
total_cer += cer_inst
num_tokens += len(reference.split())
num_chars += len(reference.replace(' ', ''))
if verbose:
print("Ref:", reference.lower())
print("Hyp:", transcript.lower())
print("WER:", float(wer_inst) / len(reference.split()),
"CER:", float(cer_inst) / len(reference.replace(' ', '')), "\n")
wer = float(total_wer) / num_tokens
cer = float(total_cer) / num_chars
return wer * 100, cer * 100, output_data
| [
1,
529,
276,
1112,
420,
29958,
1451,
566,
6729,
305,
309,
29914,
311,
8961,
412,
5309,
29889,
2272,
7345,
305,
29899,
29906,
29889,
29896,
13,
5215,
27246,
336,
13,
5215,
4842,
305,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
13,
3166,
316,
8961,
412,
5309,
29918,
2272,
7345,
305,
29889,
2917,
29879,
29889,
262,
1659,
29918,
2917,
1053,
382,
791,
3991,
13,
3166,
316,
8961,
412,
5309,
29918,
2272,
7345,
305,
29889,
7099,
6119,
1053,
4122,
7584,
6185,
6119,
13,
3166,
316,
8961,
412,
5309,
29918,
2272,
7345,
305,
29889,
12657,
29889,
1272,
29918,
12657,
1053,
27738,
307,
1393,
16390,
24541,
29892,
21764,
1469,
10036,
13,
3166,
316,
8961,
412,
5309,
29918,
2272,
7345,
305,
29889,
13239,
1053,
2254,
29918,
4299,
29892,
2254,
29918,
7099,
6119,
13,
13,
13,
29992,
7345,
305,
29889,
1217,
29918,
5105,
580,
13,
1753,
14707,
29898,
16859,
29901,
382,
791,
3991,
1125,
13,
1678,
4742,
353,
4842,
305,
29889,
10141,
703,
29883,
6191,
29908,
565,
274,
16434,
29889,
4299,
29889,
29883,
6191,
1683,
376,
21970,
1159,
13,
13,
1678,
1904,
353,
2254,
29918,
4299,
29898,
10141,
29922,
10141,
29892,
13,
462,
539,
1904,
29918,
2084,
29922,
16859,
29889,
4299,
29889,
4299,
29918,
2084,
29892,
13,
462,
539,
671,
29918,
24498,
29922,
16859,
29889,
4299,
29889,
1509,
29918,
24498,
29897,
13,
13,
1678,
1602,
6119,
353,
2254,
29918,
7099,
6119,
29898,
21134,
29922,
4299,
29889,
21134,
29892,
13,
462,
965,
274,
16434,
29922,
16859,
29889,
21457,
29897,
13,
1678,
3646,
29918,
7099,
6119,
353,
4122,
7584,
6185,
6119,
29898,
4299,
29889,
21134,
29892,
13,
462,
462,
259,
9654,
29918,
2248,
29922,
4299,
29889,
21134,
29889,
2248,
877,
29918,
8785,
13,
1678,
1243,
29918,
24713,
353,
27738,
307,
1393,
16390,
24541,
29898,
18494,
29918,
5527,
29922,
4299,
29889,
18494,
29918,
5527,
29892,
13,
462,
462,
418,
10419,
29918,
1445,
2084,
29922,
29882,
2941,
336,
29889,
13239,
29889,
517,
29918,
23552,
29918,
2084,
29898,
16859,
29889,
1688,
29918,
29135,
511,
13,
462,
462,
418,
11073,
29922,
4299,
29889,
21134,
29892,
13,
462,
462,
418,
4226,
675,
29922,
5574,
29897,
13,
1678,
1243,
29918,
12657,
353,
21764,
1469,
10036,
29898,
1688,
29918,
24713,
29892,
13,
462,
462,
29871,
9853,
29918,
2311,
29922,
16859,
29889,
16175,
29918,
2311,
29892,
13,
462,
462,
29871,
954,
29918,
1287,
414,
29922,
16859,
29889,
1949,
29918,
1287,
414,
29897,
13,
1678,
2949,
29892,
5147,
29892,
1962,
29918,
1272,
353,
1065,
29918,
24219,
362,
29898,
1688,
29918,
12657,
29922,
1688,
29918,
12657,
29892,
13,
462,
462,
965,
4742,
29922,
10141,
29892,
13,
462,
462,
965,
1904,
29922,
4299,
29892,
13,
462,
462,
965,
1602,
6119,
29922,
7099,
6119,
29892,
13,
462,
462,
965,
3646,
29918,
7099,
6119,
29922,
5182,
29918,
7099,
6119,
29892,
13,
462,
462,
965,
4078,
29918,
4905,
29922,
16859,
29889,
7620,
29918,
4905,
29892,
13,
462,
462,
965,
26952,
29922,
16859,
29889,
369,
15828,
29892,
13,
462,
462,
965,
671,
29918,
24498,
29922,
16859,
29889,
4299,
29889,
1509,
29918,
24498,
29897,
13,
13,
1678,
1596,
877,
3057,
6991,
5219,
320,
29873,
29915,
13,
3986,
525,
29909,
19698,
399,
1001,
426,
556,
29901,
29889,
29941,
29888,
1012,
29873,
29915,
13,
3986,
525,
29909,
19698,
315,
1001,
426,
2265,
29901,
29889,
29941,
29888,
1012,
29873,
4286,
4830,
29898,
556,
29922,
556,
29892,
5147,
29922,
2265,
876,
13,
1678,
565,
274,
16434,
29889,
7620,
29918,
4905,
29901,
13,
4706,
4842,
305,
29889,
7620,
29898,
4905,
29918,
1272,
29892,
27246,
336,
29889,
13239,
29889,
517,
29918,
23552,
29918,
2084,
29898,
16859,
29889,
7620,
29918,
4905,
876,
13,
13,
13,
29992,
7345,
305,
29889,
1217,
29918,
5105,
580,
13,
1753,
1065,
29918,
24219,
362,
29898,
1688,
29918,
12657,
29892,
13,
462,
259,
4742,
29892,
13,
462,
259,
1904,
29892,
13,
462,
259,
1602,
6119,
29892,
13,
462,
259,
3646,
29918,
7099,
6119,
29892,
13,
462,
259,
4078,
29918,
4905,
29922,
8516,
29892,
13,
462,
259,
26952,
29922,
8824,
29892,
13,
462,
259,
671,
29918,
24498,
29922,
8824,
1125,
13,
1678,
1904,
29889,
14513,
580,
13,
1678,
3001,
29918,
2265,
29892,
3001,
29918,
556,
29892,
954,
29918,
517,
12360,
29892,
954,
29918,
305,
1503,
353,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
13,
1678,
1962,
29918,
1272,
353,
5159,
13,
1678,
363,
474,
29892,
313,
1272,
29897,
297,
260,
29939,
18933,
29898,
15172,
29898,
1688,
29918,
12657,
511,
3001,
29922,
2435,
29898,
1688,
29918,
12657,
22164,
13,
4706,
10970,
29892,
22525,
29892,
1881,
29918,
25376,
1179,
29892,
3646,
29918,
29879,
7093,
353,
848,
13,
4706,
1881,
29918,
29879,
7093,
353,
1881,
29918,
25376,
1179,
29889,
16109,
23538,
524,
29898,
2080,
29879,
29889,
2311,
29898,
29941,
876,
467,
524,
580,
13,
4706,
10970,
353,
10970,
29889,
517,
29898,
10141,
29897,
13,
4706,
565,
671,
29918,
24498,
29901,
13,
9651,
10970,
353,
10970,
29889,
24498,
580,
13,
4706,
396,
443,
1579,
8606,
22525,
13,
4706,
6219,
29918,
5182,
29879,
353,
5159,
13,
4706,
9210,
353,
29871,
29900,
13,
4706,
363,
2159,
297,
3646,
29918,
29879,
7093,
29901,
13,
9651,
6219,
29918,
5182,
29879,
29889,
4397,
29898,
5182,
29879,
29961,
10289,
29901,
10289,
718,
2159,
2314,
13,
9651,
9210,
4619,
2159,
13,
13,
4706,
714,
29892,
1962,
29918,
29879,
7093,
353,
1904,
29898,
2080,
29879,
29892,
1881,
29918,
29879,
7093,
29897,
13,
13,
4706,
1602,
6797,
29918,
4905,
29892,
903,
353,
1602,
6119,
29889,
13808,
29898,
449,
29892,
1962,
29918,
29879,
7093,
29897,
13,
4706,
3646,
29918,
19651,
353,
3646,
29918,
7099,
6119,
29889,
13441,
29918,
517,
29918,
19651,
29898,
5451,
29918,
5182,
29879,
29897,
13,
13,
4706,
565,
4078,
29918,
4905,
338,
451,
6213,
29901,
13,
9651,
396,
788,
1962,
304,
848,
1409,
29892,
322,
6773,
13,
9651,
1962,
29918,
1272,
29889,
4397,
3552,
449,
29889,
21970,
3285,
1962,
29918,
29879,
7093,
29892,
3646,
29918,
19651,
876,
13,
4706,
363,
921,
297,
3464,
29898,
2435,
29898,
5182,
29918,
19651,
22164,
13,
9651,
1301,
924,
29892,
3407,
353,
1602,
6797,
29918,
4905,
29961,
29916,
3816,
29900,
1402,
3646,
29918,
19651,
29961,
29916,
3816,
29900,
29962,
13,
9651,
2949,
29918,
2611,
353,
1602,
6119,
29889,
556,
29898,
3286,
924,
29892,
3407,
29897,
13,
9651,
5147,
29918,
2611,
353,
1602,
6119,
29889,
2265,
29898,
3286,
924,
29892,
3407,
29897,
13,
9651,
3001,
29918,
556,
4619,
2949,
29918,
2611,
13,
9651,
3001,
29918,
2265,
4619,
5147,
29918,
2611,
13,
9651,
954,
29918,
517,
12360,
4619,
7431,
29898,
5679,
29889,
5451,
3101,
13,
9651,
954,
29918,
305,
1503,
4619,
7431,
29898,
5679,
29889,
6506,
877,
13420,
6629,
876,
13,
9651,
565,
26952,
29901,
13,
18884,
1596,
703,
5620,
29901,
613,
3407,
29889,
13609,
3101,
13,
18884,
1596,
703,
29950,
1478,
29901,
613,
1301,
924,
29889,
13609,
3101,
13,
18884,
1596,
703,
29956,
1001,
29901,
613,
5785,
29898,
556,
29918,
2611,
29897,
847,
7431,
29898,
5679,
29889,
5451,
25739,
13,
462,
418,
376,
29907,
1001,
29901,
613,
5785,
29898,
2265,
29918,
2611,
29897,
847,
7431,
29898,
5679,
29889,
6506,
877,
13420,
27255,
511,
6634,
29876,
1159,
13,
1678,
2949,
353,
5785,
29898,
7827,
29918,
556,
29897,
847,
954,
29918,
517,
12360,
13,
1678,
5147,
353,
5785,
29898,
7827,
29918,
2265,
29897,
847,
954,
29918,
305,
1503,
13,
1678,
736,
2949,
334,
29871,
29896,
29900,
29900,
29892,
5147,
334,
29871,
29896,
29900,
29900,
29892,
1962,
29918,
1272,
13,
2
] |
scripts/obix/get_obix_history_config.py | rmay-intwine/volttron | 1 | 78473 | # Copyright (c) 2018, Battelle Memorial Institute
# 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 Battelle,
# 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,
# r favoring by the United States Government or any agency thereof,
# or Battelle Memorial 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.
#
# PACIFIC NORTHWEST NATIONAL LABORATORY
# operated by BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY
# under Contract DE-AC05-76RL01830
from xml.dom.minidom import parseString
import requests
import argparse
import getpass
import csv
import sys
import json
parser = argparse.ArgumentParser(description='Create Obix driver configurations for site.')
parser.add_argument('url', default="", help='Url of the exports on the site')
parser.add_argument('csvfile', nargs='?', type=argparse.FileType('w'),
default=sys.stdout, help="Output file for register CSV configuration.")
parser.add_argument('devicefile', nargs='?', type=argparse.FileType('w'),
default=sys.stdout, help="Output file for device configuration.")
parser.add_argument('-u', '--username', default="",
help='Username for site log in.')
parser.add_argument('-p', '--password', default="",
help='Password for site log in.')
parser.add_argument('-d', '--device-name', default="",
help="Default device name for 'Device Name' column.")
args = parser.parse_args()
username=args.username
password=<PASSWORD>
url=args.url
device_name = args.device_name
while not username:
username = raw_input("Username: ")
while not password:
password = getpass.getpass("Password: ")
if not url.endswith("/"):
url += '/'
csv_file = csv.DictWriter(args.csvfile,
["Device Name", "Volttron Point Name", "Obix Name"])
csv_file.writeheader()
result = requests.get(url,
auth=(username, password))
document = parseString(result.text)
elements = document.getElementsByTagName("ref")
def get_csv_row(element):
result = {}
name = element.getAttribute("name").replace("$20", " ").replace("$2d", "-")
result["Volttron Point Name"] = result["Obix Name"] = name
result["Device Name"] = device_name
return result
for e in elements:
row = get_csv_row(e)
csv_file.writerow(row)
config = {
"url": url,
"username": username,
"password": password,
# Interval to query interface for updates in minutes.
# History points are only published if new data is available
# config points are gathered and published at this interval.
"check_interval": 15,
# Path prefix for all publishes
"path_prefix": "devices/obix/history/",
"register_config": "config://obix_h.csv"
}
json.dump(config, args.devicefile, indent=4)
| [
1,
396,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29947,
29892,
14077,
1808,
19722,
8907,
13,
29937,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
4367,
391,
3224,
322,
671,
297,
2752,
322,
7581,
7190,
29892,
411,
470,
1728,
13,
29937,
21733,
29892,
526,
21905,
4944,
393,
278,
1494,
5855,
526,
1539,
29901,
13,
29937,
13,
29937,
29871,
29896,
29889,
4367,
391,
3224,
29879,
310,
2752,
775,
1818,
11551,
278,
2038,
3509,
1266,
8369,
29892,
445,
13,
29937,
1678,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
29889,
13,
29937,
29871,
29906,
29889,
4367,
391,
3224,
29879,
297,
7581,
883,
1818,
18532,
278,
2038,
3509,
1266,
8369,
29892,
13,
29937,
1678,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
297,
278,
5106,
13,
29937,
1678,
322,
29914,
272,
916,
17279,
4944,
411,
278,
4978,
29889,
13,
29937,
13,
29937,
3446,
3235,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
6770,
6093,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
5300,
8707,
29911,
3960,
29933,
2692,
24125,
376,
3289,
8519,
29908,
5300,
13,
29937,
13764,
29979,
8528,
15094,
1799,
6323,
306,
3580,
5265,
3352,
399,
1718,
29934,
13566,
29059,
29892,
2672,
6154,
15789,
4214,
29892,
350,
2692,
6058,
27848,
3352,
7495,
29892,
6093,
306,
3580,
5265,
3352,
13,
29937,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
5300,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
319,
1525,
13,
29937,
28657,
13875,
8890,
29928,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
315,
4590,
29979,
22789,
3912,
438,
29956,
13865,
6323,
8707,
29911,
3960,
29933,
2692,
24125,
20700,
17705,
6181,
15842,
13,
29937,
13764,
29979,
22471,
26282,
29892,
2672,
4571,
26282,
29892,
2672,
29907,
1367,
3919,
1964,
29892,
317,
4162,
8426,
1964,
29892,
8528,
29923,
3580,
29931,
19926,
29892,
6323,
8707,
1660,
13356,
3919,
25758,
21330,
1529,
1692,
29903,
13,
29937,
313,
1177,
6154,
15789,
4214,
29892,
350,
2692,
6058,
27848,
3352,
7495,
29892,
13756,
29907,
11499,
13780,
8079,
27092,
1254,
1806,
26027,
21947,
29949,
8452,
6323,
26996,
29963,
2965,
2890,
29936,
13,
29937,
11247,
1799,
8079,
501,
1660,
29892,
360,
8254,
29892,
6323,
13756,
29943,
1806,
29903,
29936,
6323,
350,
3308,
8895,
1799,
2672,
4945,
29934,
4897,
29911,
2725,
29897,
29832,
8851,
5348,
12766,
17171,
29928,
5300,
13,
29937,
6732,
13764,
29979,
6093,
18929,
8079,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
8707,
29911,
4717,
1783,
29892,
6850,
3960,
1783,
17705,
2882,
6227,
11937,
29892,
6323,
323,
8476,
13,
29937,
313,
1177,
6154,
15789,
4214,
405,
11787,
5265,
24647,
4741,
6323,
438,
29911,
4448,
22119,
1660,
29897,
9033,
3235,
4214,
2672,
13764,
29979,
399,
29909,
29979,
19474,
8079,
6093,
501,
1660,
8079,
3446,
3235,
13,
29937,
7791,
7818,
12982,
1525,
29892,
382,
29963,
1430,
10762,
11033,
18118,
1660,
29928,
8079,
6093,
21521,
1799,
8979,
6227,
11937,
8079,
20134,
3210,
21330,
1529,
1692,
29889,
13,
29937,
13,
29937,
450,
8386,
322,
21204,
1080,
11122,
297,
278,
7047,
322,
5106,
526,
1906,
13,
29937,
310,
278,
15717,
322,
881,
451,
367,
21551,
408,
15783,
6221,
24833,
29892,
13,
29937,
2845,
13384,
470,
2411,
2957,
29892,
310,
278,
12362,
29933,
7230,
8010,
29889,
13,
29937,
13,
29937,
910,
5518,
471,
13240,
408,
385,
3633,
310,
664,
21955,
4395,
491,
385,
13,
29937,
946,
3819,
310,
278,
3303,
3900,
10354,
29889,
29871,
2448,
2121,
278,
3303,
3900,
13,
29937,
10354,
3643,
278,
3303,
3900,
10317,
310,
24836,
29892,
3643,
14077,
1808,
29892,
13,
29937,
3643,
738,
310,
1009,
22873,
29892,
3643,
738,
24894,
29467,
470,
13013,
13,
29937,
393,
756,
1302,
3372,
630,
297,
278,
5849,
310,
1438,
17279,
29892,
3732,
13,
29937,
738,
1370,
21867,
29891,
29892,
4653,
470,
2411,
2957,
29892,
470,
15894,
738,
11706,
619,
3097,
13,
29937,
470,
23134,
363,
278,
13600,
29892,
1614,
841,
404,
29892,
470,
5407,
2264,
470,
13,
29937,
738,
2472,
29892,
7132,
2389,
29892,
3234,
29892,
7047,
29892,
470,
1889,
766,
15603,
29892,
13,
29937,
470,
11524,
393,
967,
671,
723,
451,
297,
1341,
19144,
5999,
2486,
15205,
10462,
29889,
13,
29937,
13,
29937,
12105,
1244,
262,
304,
738,
2702,
12128,
3234,
29892,
1889,
29892,
470,
13,
29937,
2669,
491,
11302,
1024,
29892,
1020,
2310,
935,
29892,
12012,
9945,
29892,
470,
6467,
947,
13,
29937,
451,
12695,
1040,
12356,
470,
22366,
967,
1095,
943,
882,
29892,
29303,
29892,
13,
29937,
364,
7853,
292,
491,
278,
3303,
3900,
10354,
470,
738,
946,
3819,
727,
974,
29892,
13,
29937,
470,
14077,
1808,
19722,
8907,
29889,
450,
8386,
322,
26971,
310,
15717,
13,
29937,
13384,
1244,
262,
437,
451,
12695,
2106,
470,
9432,
1906,
310,
278,
13,
29937,
3303,
3900,
10354,
470,
738,
946,
3819,
727,
974,
29889,
13,
29937,
13,
29937,
349,
2477,
6545,
2965,
405,
1955,
4690,
8851,
1254,
405,
8098,
1964,
365,
2882,
1955,
1299,
18929,
13,
29937,
19623,
491,
350,
1299,
4330,
29931,
1307,
363,
278,
8291,
1806,
3352,
6850,
1299,
2890,
5012,
26092,
13780,
8079,
12524,
1001,
29954,
29979,
13,
29937,
1090,
2866,
1461,
5012,
29899,
2477,
29900,
29945,
29899,
29955,
29953,
2241,
29900,
29896,
29947,
29941,
29900,
13,
13,
3166,
4903,
29889,
3129,
29889,
1195,
333,
290,
1053,
6088,
1231,
13,
5215,
7274,
13,
5215,
1852,
5510,
13,
5215,
679,
3364,
13,
5215,
11799,
13,
5215,
10876,
13,
5215,
4390,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
4391,
4250,
861,
7156,
22920,
363,
3268,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
2271,
742,
2322,
543,
613,
1371,
2433,
5983,
310,
278,
29586,
373,
278,
3268,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
7638,
1445,
742,
302,
5085,
2433,
29973,
742,
1134,
29922,
1191,
5510,
29889,
2283,
1542,
877,
29893,
5477,
13,
462,
1678,
2322,
29922,
9675,
29889,
25393,
29892,
1371,
543,
6466,
934,
363,
6036,
16874,
5285,
23157,
13,
16680,
29889,
1202,
29918,
23516,
877,
10141,
1445,
742,
302,
5085,
2433,
29973,
742,
1134,
29922,
1191,
5510,
29889,
2283,
1542,
877,
29893,
5477,
13,
462,
1678,
2322,
29922,
9675,
29889,
25393,
29892,
1371,
543,
6466,
934,
363,
4742,
5285,
23157,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29884,
742,
525,
489,
6786,
742,
2322,
543,
613,
13,
462,
1678,
1371,
2433,
20249,
363,
3268,
1480,
297,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29886,
742,
525,
489,
5630,
742,
2322,
543,
613,
13,
462,
1678,
1371,
2433,
10048,
363,
3268,
1480,
297,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29881,
742,
525,
489,
10141,
29899,
978,
742,
2322,
543,
613,
13,
462,
1678,
1371,
543,
4592,
4742,
1024,
363,
525,
11501,
4408,
29915,
1897,
23157,
13,
13,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
6786,
29922,
5085,
29889,
6786,
13,
5630,
29922,
29966,
25711,
17013,
29958,
13,
2271,
29922,
5085,
29889,
2271,
13,
10141,
29918,
978,
353,
6389,
29889,
10141,
29918,
978,
13,
13,
8000,
451,
8952,
29901,
13,
1678,
8952,
353,
10650,
29918,
2080,
703,
20249,
29901,
16521,
13,
13,
8000,
451,
4800,
29901,
13,
1678,
4800,
353,
679,
3364,
29889,
657,
3364,
703,
10048,
29901,
16521,
13,
13,
361,
451,
3142,
29889,
1975,
2541,
11974,
29908,
1125,
13,
1678,
3142,
4619,
8207,
29915,
13,
13,
7638,
29918,
1445,
353,
11799,
29889,
21533,
10507,
29898,
5085,
29889,
7638,
1445,
29892,
13,
462,
3986,
6796,
11501,
4408,
613,
376,
13072,
29873,
509,
265,
8984,
4408,
613,
376,
6039,
861,
4408,
20068,
13,
13,
7638,
29918,
1445,
29889,
3539,
6672,
580,
13,
13,
2914,
353,
7274,
29889,
657,
29898,
2271,
29892,
13,
462,
418,
4817,
7607,
6786,
29892,
4800,
876,
13,
13,
3225,
353,
6088,
1231,
29898,
2914,
29889,
726,
29897,
13,
17664,
353,
1842,
29889,
22266,
29269,
703,
999,
1159,
13,
13,
1753,
679,
29918,
7638,
29918,
798,
29898,
5029,
1125,
13,
1678,
1121,
353,
6571,
13,
13,
1678,
1024,
353,
1543,
29889,
657,
6708,
703,
978,
2564,
6506,
703,
29938,
29906,
29900,
613,
376,
376,
467,
6506,
703,
29938,
29906,
29881,
613,
11663,
1159,
13,
1678,
1121,
3366,
13072,
29873,
509,
265,
8984,
4408,
3108,
353,
1121,
3366,
6039,
861,
4408,
3108,
353,
1024,
13,
13,
1678,
1121,
3366,
11501,
4408,
3108,
353,
4742,
29918,
978,
13,
13,
1678,
736,
1121,
13,
13,
13,
1454,
321,
297,
3161,
29901,
13,
1678,
1948,
353,
679,
29918,
7638,
29918,
798,
29898,
29872,
29897,
13,
13,
1678,
11799,
29918,
1445,
29889,
13236,
340,
29898,
798,
29897,
13,
13,
13,
2917,
353,
426,
13,
29871,
376,
2271,
1115,
3142,
29892,
13,
29871,
376,
6786,
1115,
8952,
29892,
13,
29871,
376,
5630,
1115,
4800,
29892,
13,
29871,
396,
4124,
791,
304,
2346,
5067,
363,
11217,
297,
6233,
29889,
13,
29871,
396,
5298,
3291,
526,
871,
6369,
565,
716,
848,
338,
3625,
13,
29871,
396,
2295,
3291,
526,
22229,
322,
6369,
472,
445,
7292,
29889,
13,
29871,
376,
3198,
29918,
19207,
1115,
29871,
29896,
29945,
29892,
13,
29871,
396,
10802,
10944,
363,
599,
9805,
267,
13,
29871,
376,
2084,
29918,
13506,
1115,
376,
3359,
1575,
29914,
711,
861,
29914,
18434,
29914,
613,
13,
29871,
376,
9573,
29918,
2917,
1115,
376,
2917,
597,
711,
861,
29918,
29882,
29889,
7638,
29908,
13,
29913,
13,
13,
3126,
29889,
15070,
29898,
2917,
29892,
6389,
29889,
10141,
1445,
29892,
29536,
29922,
29946,
29897,
13,
13,
13,
2
] |
overwatch/base/dataTransfer.py | ostr00000/OVERWATCH | 11 | 109175 | #!/usr/bin/env python
""" Handle and move files from the receiver(s) to Overwatch sites and EOS.
This simple module is responsible for moving data which is provided by the receiver to other
sites. It will retry a few times if sites are unavailable.
We take a simple approach of determine which files to transfer, and then moving them to the
appropriate locations. We could try to use something like ``watchdog`` to do something more
clever when a file changes. However, we want to batch transfer files to take advantage of
``rsync``, so such an approach would require much more complicated bookkeeping (for example,
what happens if a file shows up when transferring data, etc). The much simpler approach that
we use solves our problem just as well, but is also much easier to write and maintain.
.. codeauthor:: <NAME> <<EMAIL>>, Yale University
"""
# Python 2/3 support
from __future__ import print_function
from future.utils import iteritems
from future.utils import itervalues
# General
import os
import math
import time
import shutil
import subprocess
import tempfile
import functools
import ROOT
# Logging
import logging
logger = logging.getLogger(__name__)
# Config
from . import config
(parameters, filesRead) = config.readConfig(config.configurationType.processing)
def retry(tries, delay = 3, backoff = 2):
""" Retries a function or method until it returns ``True`` or runs out of retries.
Retries are performed at a specific delay with an additional back off term. The retries go
as
.. math::
t = delay * backoff^(nTry)
where :math:`nTry` is the trial that we are on. Note that 2 retries corresponds to three function
calls - the original call, and then up to two retries if the calls fail.
Original decorator from the `Python wiki <https://wiki.python.org/moin/PythonDecoratorLibrary#Retry>`__,
and using some additional improvements `here <https://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/>`__,
and some ideas `here <https://www.calazan.com/retry-decorator-for-python-3/>`__.
Args:
tries (int): Number of times to retry.
delay (float): Delay in seconds for the initial retry. Default: 3.
backoff (float): Amount to multiply the delay by between each retry. See the formula above.
Returns:
bool: True if the function succeeded.
"""
# Argument validation
if backoff <= 1:
raise ValueError("Backoff must be greater than 1.")
tries = math.floor(tries)
if tries < 0:
raise ValueError("Tries must be 0 or greater.")
if delay <= 0:
raise ValueError("Delay must be greater than 0.")
def deco_retry(f):
@functools.wraps(f)
def f_retry(*args, **kwargs):
# Make mutable
mtries, mdelay = tries, delay
# First attempt at calling the function
rv = f(*args, **kwargs)
while mtries > 0:
# If we ever get a return value of `True`, we are done.
if rv is True:
return True
# Setup for the next attempt and wait before the next attempt
mtries -= 1
time.sleep(mdelay)
mdelay *= backoff
# Try again
rv = f(*args, **kwargs)
# Ran out of tries. Return failure.
return False
# true decorator -> decorated function
return f_retry
# @retry(arg[, ...]) -> true decorator
return deco_retry
def determineFilesToMove(directory):
""" Determine the files which are available to be moved or otherwise transferred.
Since there could be additional directories which we want to ignore, we want to use avoid
using ``os.walk()``, which will include subdirectories. Instead, we use a simpler solution
with ``os.listdir()`` and verify that we include only files.
Note:
These files are required to be ROOT files by requring that they end with the ``.root`` extension.
Note:
We explicitly have to select the filenames on ``endswith(".root")`` rather than just ``"root" in f``
because ROOT creates temporary files of the form ``.desiredFilename.root.randomString`` where
``randomString`` is usually 6 characters long. The files disappear almost immediately (and the
desired filename shows up). This is presumably to ensure that writes are atomic when writing new
objects. Thus, we want to avoid these temporary files. And we can do that be selecting that it ends
with ".root".
The temporary ROOT files (detailed in the comments) failed with the following error:
.. code-block:: none
rsync: stat "data/.EMChistos_294832_C_2018_10_22_9_53_55.root.izUVHA" failed: No such file or directory (2)
rsync: rename "data/.EMChistos_294832_C_2018_10_22_9_53_55.root.izUVHA" -> "EMChistos_294832_C_2018_10_22_9_53_55.root": No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
Thanks to the retry capabilities, it will immediately retry, so this shouldn't cause a major problem
on the transfer side. However, it will cause problems on the receiver side because the malformed
filenames won't be handled properly by Overwatch.
Args:
directory (str): Path to the directory where the files are stored.
Returns:
list: List of the files available to be moved. Note that just the filenames are stored,
so it's the callers responsibility to include the directory when using the filename.
"""
# NOTE: See the information above about why we explicitly select on ``endswith("root")``.
return [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f)) and f.endswith(".root")]
@retry(tries = parameters["dataTransferRetries"])
def rsyncFilesFromFilelist(directory, destination, filelistFilename, transferredFilenames):
""" Transfer files via rsync based on a list of filenames in a given file.
Note:
This must be a separate function which returns a bool to work properly with the retry wrapper.
Consequently, we return any transferred filenames by reference via ``transferredFilenames``.
Args:
directory (str): Path to the directory where the files are stored locally.
destination (str): Path to the remote directory where the files are stored. Since the
files are being transferred with rsync via ssh, this path should be of the form
``user@host:/dir/path``.
filelistFilename (str): Filename of the file which contains the list of files to transfer.
transferredFilenames (list): List of filenames which were transfer. Used to return this information
because we have to return ``True`` or ``False`` with the retry wrapper.
Returns:
bool: True if the files were transferred successfully.
"""
# Check destination value. If we are testing, it doesn't need to have the ":", but for normal operation,
# it usually will.
if ":" not in destination:
logger.warning("Expected, but did not find, \":\" in the destination path \"{destination}\".".format(destination = destination))
# Needed so that rsync will transfer to that directory!
if not destination.endswith("/"):
destination = destination + "/"
# Define the rsync command itself.
rsync = [
"rsync",
# -l preserves symlinks.
# -t preserves timestamps.
# -h presents human readable information.
# -v is verbose. (Not currently included).
"-lth",
# This outputs just the name of the file that is transferred.
r"--out-format=%n",
# Files from is relative to the remote path.
"--files-from={name}".format(name = filelistFilename),
# Source
directory,
# Destination
destination,
]
logger.debug("Args: {rsync}".format(rsync = rsync))
try:
result = subprocess.check_output(args = rsync, universal_newlines = True)
except subprocess.CalledProcessError:
# The call failed for some reason. We want to handle it.
logger.debug("rsync call failed!")
return False
# NOTE: Getting to this point is equivalent to having a return code of 0.
# Change: "hello\nworld\n" -> ["hello", "world"]
parsedResult = result.strip("\n").split("\n")
# Extend so we don't entirely reassign the reference.
transferredFilenames.extend(parsedResult)
logger.debug("Result: {}".format(result))
logger.debug("Result parsed: {}".format(parsedResult))
return True
def copyFilesToOverwatchSites(directory, destination, filenames):
""" Copy the given files to the Overwatch deployment sites.
The Overwatch sites and where the files should be stored at those sites is determined
in the configuration. Retries should usually not be necessary here, but are included
as an additional assurance.
Args:
directory (str): Path to the directory where the files are stored locally.
destination (str): Path to the remote directory where the files are stored. Since the
files are being transferred with rsync via ssh, this path should be of the form
``user@host:/dir/path``.
filenames (list): Paths to files to copy to each Overwatch site.
Returns:
list: Filenames for all of the files which **failed**.
"""
# First write the filenames out to a temp file so we can pass them to rsync.
with tempfile.NamedTemporaryFile() as f:
# Need encode because the file is written as bytes.
f.write("\n".join(filenames).encode())
# Move back to the front so it can be read.
f.seek(0)
# Perform the actual files transfer.
transferredFilenames = []
success = rsyncFilesFromFilelist(directory = directory,
destination = destination,
filelistFilename = f.name,
transferredFilenames = transferredFilenames)
logger.debug("transferredFilenames: {}".format(transferredFilenames))
# We want to return the files that _failed_, so if the files were transferred,
# we return an empty list. Otherwise, we return the files that were not transferred.
failedFilenames = list(set(filenames) - set(transferredFilenames))
return [] if success else failedFilenames
@retry(tries = parameters["dataTransferRetries"])
def copyFileToEOSWithRoot(directory, destination, filename):
""" Copy a given file to EOS using ROOT capabilities.
We include the possibility to show the ROOT ``cp`` progress bar if we are in debug mode.
Args:
directory (str): Path to the directory where the files are stored locally.
destination (str): Directory on EOS to which the file should be copied.
filename (str): Local filename of the string to be copied. This will be used for setting
the path where it will be copied.
Returns:
bool: True if the file was copied successfully
"""
source = os.path.join(directory, filename)
destination = os.path.join(destination, filename)
# We only want to see such information if we are debugging. Otherwise, it will just clog up the logs.
showProgressBar = parameters["debug"]
logger.debug("Copying file from {source} to {destination}".format(source = source, destination = destination))
return ROOT.TFile.Cp(source, destination, showProgressBar)
def copyFilesToEOS(directory, destination, filenames):
""" Copy the given filenames to EOS.
Files which failed are returned so that these files can be saved and the admin can be alerted to take
additional actions.
Args:
directory (str): Path to the directory where the files are stored locally.
destination (str): Directory on EOS to which the file should be copied.
filenames (list): Files to copy to EOS.
Returns:
list: Filenames for all of the files which **failed**.
"""
failedFilenames = []
for f in filenames:
# This function will automatically retry.
res = copyFileToEOSWithRoot(directory = directory, destination = destination, filename = f)
# Store the failed files so we can notify the admin that something went wrong.
if res is False:
failedFilenames.append(f)
return failedFilenames
def storeFailedFiles(siteName, filenames):
""" Store failed files in a safe place for later transfer.
This function should be called for each site. Each site maintains a different directory as different
files could fail for different sites.
Args:
siteName (str): Name of the site for which the files failed to transfer.
filenames (list): Filenames which failed to transfer.
Returns:
None.
"""
# Create the storage location if necessary and copy the files to it.
storagePath = os.path.join(parameters["receiverDataTempStorage"], siteName)
if not os.path.exists(storagePath):
os.makedirs(storagePath)
for f in filenames:
try:
shutil.copy2(os.path.join(parameters["receiverData"], f), os.path.join(storagePath, f))
except shutil.Error as e:
# Log the exception (so it will get logged and sent via mail when appropriate), and then
# re-raise it so it doesn't get lost.
logger.critical("Error in copying the failed transfer files. Error: {e}".format(e = e))
# raise with no arguments re-raises the last exception.
raise
# Sanity check that the files were successfully copied.
# There can be other files in the directory, so we just need to be certain that the filenames
# that we are handling here are actually copied.
assert set(filenames).issubset(os.listdir(storagePath))
# By logging, it will be sent to the admins when appropriate.
# To ensure that we don't get overwhelmed by messages which only vary by the filename used, we
# only include the sitename in the error. However, by printing the information at the info level,
# it will be included via sentry, so we'll still have information the filenames which failed.
logger.info("Files failed to copy for site {siteName}. Filenames: {filenames}".format(siteName = siteName, filenames = filenames))
logger.error("Files failed to copy for site {siteName}".format(siteName = siteName))
def processReceivedFiles():
""" Main driver function for receiver file processing and moving.
This function relies on the values of "receiverData", "receiverDataTempStorage", "dataTransferLocations".
Note:
Configuration is controlled via the Overwatch YAML configuration system. In particular,
the options relevant here are defined in the base module.
Args:
None.
Returns:
tuple: (successfullyTransferred, failedFilenames) where successfullyTransferred (list) is the
filenames of the files which were successfully transferred, and failedFilenames (dict) is the
filenames which failed to be transferred, with the keys as the site names and the values as the
filenames.
"""
# These are just raw filenames.
filenamesToTransfer = determineFilesToMove(directory = parameters["receiverData"])
if not filenamesToTransfer:
logger.info("No new files found. Returning.")
return None, None
logger.info("Transfering data to sites: {sites}".format(sites = ", ".join(parameters["dataTransferLocations"])))
failedFilenames = {}
for siteName, destination in iteritems(parameters["dataTransferLocations"]):
transferFunc = copyFilesToOverwatchSites
if "EOS" in siteName.upper():
transferFunc = copyFilesToEOS
# Perform the actual transfer for each configured location.
# We need to keep track of which files failed to transfer to which sites.
failedFilenames[siteName] = transferFunc(directory = parameters["receiverData"],
destination = destination,
filenames = filenamesToTransfer)
# Handle filenames which haven't been deleted.
# We only need to do this if there are some which failed.
# We also keep track of which failed for logging.
totalFailedFilenames = set()
if any(itervalues(failedFilenames)):
# Copy to a safe temporary location for storage until they can be dealt with.
# We make a copy and store them separately because the same file could have failed for multiple
# transfers. However, we shouldn't lose much in storage because these aren't intended to stay a
# long time.
for siteName, filenames in iteritems(failedFilenames):
totalFailedFilenames.update(filenames)
# Only attempt to store the failed files if some files actually failed.
if filenames:
storeFailedFiles(siteName = siteName, filenames = filenames)
# Log which filenames were transferred successfully.
# We will eventually want to return a list instead of a set, so we just convert it here.
successfullyTransferred = list(set(filenamesToTransfer) - totalFailedFilenames)
logger.info("Fully successfully transferred: {successfullyTransferred}".format(successfullyTransferred = successfullyTransferred))
# Now we can safely remove all files, because any that have failed have already been copied.
# Protect from data loss when debugging.
if parameters["debug"] is False:
for f in filenamesToTransfer:
os.remove(os.path.join(parameters["receiverData"], f))
else:
logger.debug("Files to remove: {filenamesToTransfer}".format(filenamesToTransfer = filenamesToTransfer))
return (successfullyTransferred, failedFilenames)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
15945,
29908,
29273,
322,
4337,
2066,
515,
278,
19870,
29898,
29879,
29897,
304,
6811,
12344,
11840,
322,
382,
3267,
29889,
13,
13,
4013,
2560,
3883,
338,
14040,
363,
8401,
848,
607,
338,
4944,
491,
278,
19870,
304,
916,
13,
16315,
29889,
739,
674,
337,
2202,
263,
2846,
3064,
565,
11840,
526,
443,
16515,
29889,
13,
13,
4806,
2125,
263,
2560,
2948,
310,
8161,
607,
2066,
304,
6782,
29892,
322,
769,
8401,
963,
304,
278,
13,
932,
6649,
403,
14354,
29889,
1334,
1033,
1018,
304,
671,
1554,
763,
4954,
12344,
26169,
16159,
304,
437,
1554,
901,
13,
2841,
369,
746,
263,
934,
3620,
29889,
2398,
29892,
591,
864,
304,
9853,
6782,
2066,
304,
2125,
10631,
310,
13,
16159,
2288,
2720,
29952,
1673,
577,
1316,
385,
2948,
723,
1996,
1568,
901,
12092,
3143,
17462,
292,
313,
1454,
1342,
29892,
13,
5816,
5930,
565,
263,
934,
3697,
701,
746,
6782,
5393,
848,
29892,
2992,
467,
450,
1568,
13682,
2948,
393,
13,
705,
671,
24307,
1749,
1108,
925,
408,
1532,
29892,
541,
338,
884,
1568,
6775,
304,
2436,
322,
7344,
29889,
13,
13,
636,
775,
8921,
1057,
529,
5813,
29958,
3532,
26862,
6227,
6778,
29892,
612,
744,
3014,
13,
15945,
29908,
13,
13,
29937,
5132,
29871,
29906,
29914,
29941,
2304,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
3166,
5434,
29889,
13239,
1053,
4256,
7076,
13,
3166,
5434,
29889,
13239,
1053,
4256,
5975,
13,
13,
29937,
4593,
13,
5215,
2897,
13,
5215,
5844,
13,
5215,
931,
13,
5215,
528,
4422,
13,
5215,
1014,
5014,
13,
5215,
5694,
1445,
13,
5215,
2090,
312,
8789,
13,
13,
5215,
16641,
2891,
13,
13,
29937,
4522,
3460,
13,
5215,
12183,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
29937,
12782,
13,
3166,
869,
1053,
2295,
13,
29898,
16744,
29892,
2066,
6359,
29897,
353,
2295,
29889,
949,
3991,
29898,
2917,
29889,
13305,
1542,
29889,
19170,
29897,
13,
13,
1753,
337,
2202,
29898,
29873,
2722,
29892,
9055,
353,
29871,
29941,
29892,
1250,
2696,
353,
29871,
29906,
1125,
13,
1678,
9995,
4649,
2722,
263,
740,
470,
1158,
2745,
372,
3639,
4954,
5574,
16159,
470,
6057,
714,
310,
3240,
2722,
29889,
13,
13,
1678,
4649,
2722,
526,
8560,
472,
263,
2702,
9055,
411,
385,
5684,
1250,
1283,
1840,
29889,
450,
3240,
2722,
748,
13,
1678,
408,
13,
13,
1678,
6317,
5844,
1057,
13,
13,
4706,
260,
353,
9055,
334,
1250,
2696,
23733,
29876,
15870,
29897,
13,
13,
1678,
988,
584,
755,
18078,
29876,
15870,
29952,
338,
278,
14260,
393,
591,
526,
373,
29889,
3940,
393,
29871,
29906,
3240,
2722,
16161,
304,
2211,
740,
13,
1678,
5717,
448,
278,
2441,
1246,
29892,
322,
769,
701,
304,
1023,
3240,
2722,
565,
278,
5717,
4418,
29889,
13,
13,
1678,
8533,
10200,
1061,
515,
278,
421,
11980,
281,
10058,
529,
991,
597,
4594,
29889,
4691,
29889,
990,
29914,
4346,
262,
29914,
11980,
6185,
272,
1061,
12284,
29937,
8015,
719,
13885,
1649,
29892,
13,
1678,
322,
773,
777,
5684,
28473,
421,
4150,
529,
991,
597,
1636,
29889,
29879,
18745,
29883,
10800,
29889,
510,
29914,
7312,
29914,
29906,
29900,
29900,
29929,
29914,
29896,
29896,
29914,
2202,
292,
29899,
449,
29899,
276,
2202,
29899,
19557,
1061,
29899,
4691,
3779,
29952,
1649,
29892,
13,
1678,
322,
777,
7014,
421,
4150,
529,
991,
597,
1636,
29889,
1052,
834,
273,
29889,
510,
29914,
276,
2202,
29899,
19557,
1061,
29899,
1454,
29899,
4691,
29899,
29941,
3779,
29952,
26914,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
14335,
313,
524,
1125,
9681,
310,
3064,
304,
337,
2202,
29889,
13,
4706,
9055,
313,
7411,
1125,
5556,
388,
297,
6923,
363,
278,
2847,
337,
2202,
29889,
13109,
29901,
29871,
29941,
29889,
13,
4706,
1250,
2696,
313,
7411,
1125,
1913,
792,
304,
22932,
278,
9055,
491,
1546,
1269,
337,
2202,
29889,
2823,
278,
7063,
2038,
29889,
13,
1678,
16969,
29901,
13,
4706,
6120,
29901,
5852,
565,
278,
740,
14792,
29889,
13,
1678,
9995,
13,
1678,
396,
23125,
8845,
13,
1678,
565,
1250,
2696,
5277,
29871,
29896,
29901,
13,
4706,
12020,
7865,
2392,
703,
5841,
2696,
1818,
367,
7621,
1135,
29871,
29896,
23157,
13,
1678,
14335,
353,
5844,
29889,
14939,
29898,
29873,
2722,
29897,
13,
1678,
565,
14335,
529,
29871,
29900,
29901,
13,
4706,
12020,
7865,
2392,
703,
29911,
2722,
1818,
367,
29871,
29900,
470,
7621,
23157,
13,
1678,
565,
9055,
5277,
29871,
29900,
29901,
13,
4706,
12020,
7865,
2392,
703,
24996,
1818,
367,
7621,
1135,
29871,
29900,
23157,
13,
13,
1678,
822,
316,
1111,
29918,
276,
2202,
29898,
29888,
1125,
13,
4706,
732,
7692,
312,
8789,
29889,
29893,
336,
567,
29898,
29888,
29897,
13,
4706,
822,
285,
29918,
276,
2202,
10456,
5085,
29892,
3579,
19290,
1125,
13,
9651,
396,
8561,
26691,
13,
9651,
286,
29873,
2722,
29892,
286,
18829,
353,
14335,
29892,
9055,
13,
13,
9651,
396,
3824,
4218,
472,
5432,
278,
740,
13,
9651,
364,
29894,
353,
285,
10456,
5085,
29892,
3579,
19290,
29897,
13,
9651,
1550,
286,
29873,
2722,
1405,
29871,
29900,
29901,
13,
18884,
396,
960,
591,
3926,
679,
263,
736,
995,
310,
421,
5574,
1673,
591,
526,
2309,
29889,
13,
18884,
565,
364,
29894,
338,
5852,
29901,
13,
462,
1678,
736,
5852,
13,
13,
18884,
396,
3789,
786,
363,
278,
2446,
4218,
322,
4480,
1434,
278,
2446,
4218,
13,
18884,
286,
29873,
2722,
22361,
29871,
29896,
13,
18884,
931,
29889,
17059,
29898,
3487,
295,
388,
29897,
13,
18884,
286,
18829,
334,
29922,
1250,
2696,
13,
13,
18884,
396,
3967,
1449,
13,
18884,
364,
29894,
353,
285,
10456,
5085,
29892,
3579,
19290,
29897,
13,
13,
9651,
396,
22392,
714,
310,
14335,
29889,
7106,
10672,
29889,
13,
9651,
736,
7700,
13,
13,
4706,
396,
1565,
10200,
1061,
1599,
10200,
630,
740,
13,
4706,
736,
285,
29918,
276,
2202,
13,
1678,
396,
732,
276,
2202,
29898,
1191,
21939,
2023,
2314,
1599,
1565,
10200,
1061,
13,
1678,
736,
316,
1111,
29918,
276,
2202,
13,
13,
1753,
8161,
10547,
1762,
16619,
29898,
12322,
1125,
13,
1678,
9995,
5953,
837,
457,
278,
2066,
607,
526,
3625,
304,
367,
6153,
470,
6467,
18440,
29889,
13,
13,
1678,
4001,
727,
1033,
367,
5684,
17525,
607,
591,
864,
304,
11455,
29892,
591,
864,
304,
671,
4772,
13,
1678,
773,
4954,
359,
29889,
20919,
2555,
1673,
607,
674,
3160,
1014,
11851,
3842,
29889,
8669,
29892,
591,
671,
263,
13682,
1650,
13,
1678,
411,
4954,
359,
29889,
1761,
3972,
2555,
29952,
322,
11539,
393,
591,
3160,
871,
2066,
29889,
13,
13,
1678,
3940,
29901,
13,
4706,
4525,
2066,
526,
3734,
304,
367,
16641,
2891,
2066,
491,
12428,
3864,
393,
896,
1095,
411,
278,
421,
1412,
4632,
16159,
6081,
29889,
13,
13,
1678,
3940,
29901,
13,
4706,
1334,
9479,
505,
304,
1831,
278,
977,
264,
1280,
373,
4954,
1975,
2541,
17350,
4632,
1159,
16159,
3265,
1135,
925,
4954,
29908,
4632,
29908,
297,
285,
16159,
13,
4706,
1363,
16641,
2891,
10017,
13201,
2066,
310,
278,
883,
421,
1412,
2783,
2859,
3434,
3871,
29889,
4632,
29889,
8172,
1231,
16159,
988,
13,
4706,
4954,
8172,
1231,
16159,
338,
5491,
29871,
29953,
4890,
1472,
29889,
450,
2066,
25417,
4359,
7389,
313,
392,
278,
13,
4706,
7429,
10422,
3697,
701,
467,
910,
338,
2225,
24873,
304,
9801,
393,
15873,
526,
23489,
746,
5007,
716,
13,
4706,
3618,
29889,
6549,
29892,
591,
864,
304,
4772,
1438,
13201,
2066,
29889,
1126,
591,
508,
437,
393,
367,
18851,
393,
372,
10614,
13,
4706,
411,
11393,
4632,
1642,
13,
13,
4706,
450,
13201,
16641,
2891,
2066,
313,
29881,
11881,
297,
278,
6589,
29897,
5229,
411,
278,
1494,
1059,
29901,
13,
13,
4706,
6317,
775,
29899,
1271,
1057,
5642,
13,
13,
9651,
364,
16593,
29901,
1002,
376,
1272,
6294,
12665,
1451,
391,
359,
29918,
29906,
29929,
29946,
29947,
29941,
29906,
29918,
29907,
29918,
29906,
29900,
29896,
29947,
29918,
29896,
29900,
29918,
29906,
29906,
29918,
29929,
29918,
29945,
29941,
29918,
29945,
29945,
29889,
4632,
29889,
466,
29965,
29963,
15715,
29908,
5229,
29901,
1939,
1316,
934,
470,
3884,
313,
29906,
29897,
13,
9651,
364,
16593,
29901,
19508,
376,
1272,
6294,
12665,
1451,
391,
359,
29918,
29906,
29929,
29946,
29947,
29941,
29906,
29918,
29907,
29918,
29906,
29900,
29896,
29947,
29918,
29896,
29900,
29918,
29906,
29906,
29918,
29929,
29918,
29945,
29941,
29918,
29945,
29945,
29889,
4632,
29889,
466,
29965,
29963,
15715,
29908,
1599,
376,
12665,
1451,
391,
359,
29918,
29906,
29929,
29946,
29947,
29941,
29906,
29918,
29907,
29918,
29906,
29900,
29896,
29947,
29918,
29896,
29900,
29918,
29906,
29906,
29918,
29929,
29918,
29945,
29941,
29918,
29945,
29945,
29889,
4632,
1115,
1939,
1316,
934,
470,
3884,
313,
29906,
29897,
13,
9651,
364,
16593,
1059,
29901,
777,
2066,
29914,
5552,
29879,
892,
451,
18440,
313,
4149,
3517,
4436,
29897,
313,
401,
29871,
29906,
29941,
29897,
472,
1667,
29889,
29883,
29898,
29896,
29896,
29929,
29953,
29897,
518,
15452,
29922,
29941,
29889,
29896,
29889,
29906,
29962,
13,
13,
4706,
1834,
304,
278,
337,
2202,
27108,
29892,
372,
674,
7389,
337,
2202,
29892,
577,
445,
9273,
29915,
29873,
4556,
263,
4655,
1108,
13,
4706,
373,
278,
6782,
2625,
29889,
2398,
29892,
372,
674,
4556,
4828,
373,
278,
19870,
2625,
1363,
278,
4439,
15628,
13,
4706,
977,
264,
1280,
2113,
29915,
29873,
367,
16459,
6284,
491,
6811,
12344,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
3884,
313,
710,
1125,
10802,
304,
278,
3884,
988,
278,
2066,
526,
6087,
29889,
13,
1678,
16969,
29901,
13,
4706,
1051,
29901,
2391,
310,
278,
2066,
3625,
304,
367,
6153,
29889,
3940,
393,
925,
278,
977,
264,
1280,
526,
6087,
29892,
13,
9651,
577,
372,
29915,
29879,
278,
1246,
414,
23134,
304,
3160,
278,
3884,
746,
773,
278,
10422,
29889,
13,
1678,
9995,
13,
1678,
396,
6058,
29923,
29901,
2823,
278,
2472,
2038,
1048,
2020,
591,
9479,
1831,
373,
4954,
1975,
2541,
703,
4632,
20933,
1412,
13,
1678,
736,
518,
29888,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
12322,
29897,
565,
2897,
29889,
2084,
29889,
275,
1445,
29898,
359,
29889,
2084,
29889,
7122,
29898,
12322,
29892,
285,
876,
322,
285,
29889,
1975,
2541,
17350,
4632,
13531,
13,
13,
29992,
276,
2202,
29898,
29873,
2722,
353,
4128,
3366,
1272,
4300,
571,
8015,
2722,
20068,
13,
1753,
364,
16593,
10547,
4591,
2283,
1761,
29898,
12322,
29892,
12551,
29892,
934,
1761,
3434,
3871,
29892,
18440,
3434,
264,
1280,
1125,
13,
1678,
9995,
17934,
2066,
3025,
364,
16593,
2729,
373,
263,
1051,
310,
977,
264,
1280,
297,
263,
2183,
934,
29889,
13,
13,
1678,
3940,
29901,
13,
4706,
910,
1818,
367,
263,
5004,
740,
607,
3639,
263,
6120,
304,
664,
6284,
411,
278,
337,
2202,
14476,
29889,
13,
4706,
1281,
27284,
29892,
591,
736,
738,
18440,
977,
264,
1280,
491,
3407,
3025,
4954,
3286,
14373,
3434,
264,
1280,
29952,
1412,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
3884,
313,
710,
1125,
10802,
304,
278,
3884,
988,
278,
2066,
526,
6087,
12430,
29889,
13,
4706,
12551,
313,
710,
1125,
10802,
304,
278,
7592,
3884,
988,
278,
2066,
526,
6087,
29889,
4001,
278,
13,
9651,
2066,
526,
1641,
18440,
411,
364,
16593,
3025,
13927,
29892,
445,
2224,
881,
367,
310,
278,
883,
13,
9651,
4954,
1792,
29992,
3069,
8419,
3972,
29914,
2084,
29952,
1412,
13,
4706,
934,
1761,
3434,
3871,
313,
710,
1125,
2514,
3871,
310,
278,
934,
607,
3743,
278,
1051,
310,
2066,
304,
6782,
29889,
13,
4706,
18440,
3434,
264,
1280,
313,
1761,
1125,
2391,
310,
977,
264,
1280,
607,
892,
6782,
29889,
501,
8485,
304,
736,
445,
2472,
13,
9651,
1363,
591,
505,
304,
736,
4954,
5574,
16159,
470,
4954,
8824,
16159,
411,
278,
337,
2202,
14476,
29889,
13,
1678,
16969,
29901,
13,
4706,
6120,
29901,
5852,
565,
278,
2066,
892,
18440,
8472,
29889,
13,
1678,
9995,
13,
1678,
396,
5399,
12551,
995,
29889,
960,
591,
526,
6724,
29892,
372,
1838,
29915,
29873,
817,
304,
505,
278,
29242,
613,
541,
363,
4226,
5858,
29892,
13,
1678,
396,
372,
5491,
674,
29889,
13,
1678,
565,
376,
6160,
451,
297,
12551,
29901,
13,
4706,
17927,
29889,
27392,
703,
1252,
6021,
29892,
541,
1258,
451,
1284,
29892,
320,
1115,
5931,
297,
278,
12551,
2224,
13218,
29912,
23848,
1012,
29908,
1213,
29889,
4830,
29898,
23848,
353,
12551,
876,
13,
13,
1678,
396,
2448,
19226,
577,
393,
364,
16593,
674,
6782,
304,
393,
3884,
29991,
13,
1678,
565,
451,
12551,
29889,
1975,
2541,
11974,
29908,
1125,
13,
4706,
12551,
353,
12551,
718,
5591,
29908,
13,
13,
1678,
396,
22402,
278,
364,
16593,
1899,
3528,
29889,
13,
1678,
364,
16593,
353,
518,
13,
4706,
376,
2288,
2720,
613,
13,
4706,
396,
448,
29880,
2225,
20098,
9878,
828,
19363,
29889,
13,
4706,
396,
448,
29873,
2225,
20098,
5335,
342,
15092,
29889,
13,
4706,
396,
448,
29882,
22981,
5199,
19909,
2472,
29889,
13,
4706,
396,
448,
29894,
338,
26952,
29889,
313,
3664,
5279,
5134,
467,
13,
4706,
11663,
29880,
386,
613,
13,
4706,
396,
910,
14391,
925,
278,
1024,
310,
278,
934,
393,
338,
18440,
29889,
13,
4706,
364,
29908,
489,
449,
29899,
4830,
16328,
29876,
613,
13,
4706,
396,
12745,
515,
338,
6198,
304,
278,
7592,
2224,
29889,
13,
4706,
376,
489,
5325,
29899,
3166,
3790,
978,
29913,
1642,
4830,
29898,
978,
353,
934,
1761,
3434,
3871,
511,
13,
4706,
396,
7562,
13,
4706,
3884,
29892,
13,
4706,
396,
15435,
3381,
13,
4706,
12551,
29892,
13,
1678,
4514,
13,
13,
1678,
17927,
29889,
8382,
703,
7883,
29901,
426,
2288,
2720,
29913,
1642,
4830,
29898,
2288,
2720,
353,
364,
16593,
876,
13,
1678,
1018,
29901,
13,
4706,
1121,
353,
1014,
5014,
29889,
3198,
29918,
4905,
29898,
5085,
353,
364,
16593,
29892,
15968,
29918,
1482,
9012,
353,
5852,
29897,
13,
1678,
5174,
1014,
5014,
29889,
29907,
4212,
7032,
2392,
29901,
13,
4706,
396,
450,
1246,
5229,
363,
777,
2769,
29889,
1334,
864,
304,
4386,
372,
29889,
13,
4706,
17927,
29889,
8382,
703,
2288,
2720,
1246,
5229,
29991,
1159,
13,
4706,
736,
7700,
13,
13,
1678,
396,
6058,
29923,
29901,
24162,
304,
445,
1298,
338,
7126,
304,
2534,
263,
736,
775,
310,
29871,
29900,
29889,
13,
1678,
396,
10726,
29901,
376,
12199,
29905,
29876,
11526,
29905,
29876,
29908,
1599,
6796,
12199,
613,
376,
11526,
3108,
13,
1678,
21213,
3591,
353,
1121,
29889,
17010,
14182,
29876,
2564,
5451,
14182,
29876,
1159,
13,
1678,
396,
7338,
355,
577,
591,
1016,
29915,
29873,
9186,
337,
16645,
278,
3407,
29889,
13,
1678,
18440,
3434,
264,
1280,
29889,
21843,
29898,
862,
8485,
3591,
29897,
13,
13,
1678,
17927,
29889,
8382,
703,
3591,
29901,
6571,
1642,
4830,
29898,
2914,
876,
13,
1678,
17927,
29889,
8382,
703,
3591,
21213,
29901,
6571,
1642,
4830,
29898,
862,
8485,
3591,
876,
13,
13,
1678,
736,
5852,
13,
13,
1753,
3509,
10547,
1762,
3563,
12344,
29903,
3246,
29898,
12322,
29892,
12551,
29892,
977,
264,
1280,
1125,
13,
1678,
9995,
14187,
278,
2183,
2066,
304,
278,
6811,
12344,
18209,
11840,
29889,
13,
13,
1678,
450,
6811,
12344,
11840,
322,
988,
278,
2066,
881,
367,
6087,
472,
1906,
11840,
338,
10087,
13,
1678,
297,
278,
5285,
29889,
4649,
2722,
881,
5491,
451,
367,
5181,
1244,
29892,
541,
526,
5134,
13,
1678,
408,
385,
5684,
1223,
18541,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
3884,
313,
710,
1125,
10802,
304,
278,
3884,
988,
278,
2066,
526,
6087,
12430,
29889,
13,
4706,
12551,
313,
710,
1125,
10802,
304,
278,
7592,
3884,
988,
278,
2066,
526,
6087,
29889,
4001,
278,
13,
9651,
2066,
526,
1641,
18440,
411,
364,
16593,
3025,
13927,
29892,
445,
2224,
881,
367,
310,
278,
883,
13,
9651,
4954,
1792,
29992,
3069,
8419,
3972,
29914,
2084,
29952,
1412,
13,
4706,
977,
264,
1280,
313,
1761,
1125,
10802,
29879,
304,
2066,
304,
3509,
304,
1269,
6811,
12344,
3268,
29889,
13,
1678,
16969,
29901,
13,
4706,
1051,
29901,
2514,
264,
1280,
363,
599,
310,
278,
2066,
607,
3579,
26061,
1068,
29889,
13,
1678,
9995,
13,
1678,
396,
3824,
2436,
278,
977,
264,
1280,
714,
304,
263,
5694,
934,
577,
591,
508,
1209,
963,
304,
364,
16593,
29889,
13,
1678,
411,
5694,
1445,
29889,
22175,
5776,
1971,
653,
2283,
580,
408,
285,
29901,
13,
4706,
396,
20768,
19750,
1363,
278,
934,
338,
3971,
408,
6262,
29889,
13,
4706,
285,
29889,
3539,
14182,
29876,
1642,
7122,
29898,
1777,
264,
1280,
467,
12508,
3101,
13,
4706,
396,
25249,
1250,
304,
278,
4565,
577,
372,
508,
367,
1303,
29889,
13,
4706,
285,
29889,
344,
1416,
29898,
29900,
29897,
13,
13,
4706,
396,
27313,
278,
3935,
2066,
6782,
29889,
13,
4706,
18440,
3434,
264,
1280,
353,
5159,
13,
4706,
2551,
353,
364,
16593,
10547,
4591,
2283,
1761,
29898,
12322,
353,
3884,
29892,
13,
462,
462,
308,
12551,
353,
12551,
29892,
13,
462,
462,
308,
934,
1761,
3434,
3871,
353,
285,
29889,
978,
29892,
13,
462,
462,
308,
18440,
3434,
264,
1280,
353,
18440,
3434,
264,
1280,
29897,
13,
13,
4706,
17927,
29889,
8382,
703,
3286,
14373,
3434,
264,
1280,
29901,
6571,
1642,
4830,
29898,
3286,
14373,
3434,
264,
1280,
876,
13,
13,
4706,
396,
1334,
864,
304,
736,
278,
2066,
393,
903,
26061,
3383,
577,
565,
278,
2066,
892,
18440,
29892,
13,
4706,
396,
591,
736,
385,
4069,
1051,
29889,
13466,
29892,
591,
736,
278,
2066,
393,
892,
451,
18440,
29889,
13,
4706,
5229,
3434,
264,
1280,
353,
1051,
29898,
842,
29898,
1777,
264,
1280,
29897,
448,
731,
29898,
3286,
14373,
3434,
264,
1280,
876,
13,
4706,
736,
5159,
565,
2551,
1683,
5229,
3434,
264,
1280,
13,
13,
29992,
276,
2202,
29898,
29873,
2722,
353,
4128,
3366,
1272,
4300,
571,
8015,
2722,
20068,
13,
1753,
3509,
2283,
1762,
29923,
3267,
3047,
10303,
29898,
12322,
29892,
12551,
29892,
10422,
1125,
13,
1678,
9995,
14187,
263,
2183,
934,
304,
382,
3267,
773,
16641,
2891,
27108,
29889,
13,
13,
1678,
1334,
3160,
278,
13331,
304,
1510,
278,
16641,
2891,
4954,
6814,
16159,
6728,
2594,
565,
591,
526,
297,
4744,
4464,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
3884,
313,
710,
1125,
10802,
304,
278,
3884,
988,
278,
2066,
526,
6087,
12430,
29889,
13,
4706,
12551,
313,
710,
1125,
18862,
373,
382,
3267,
304,
607,
278,
934,
881,
367,
13746,
29889,
13,
4706,
10422,
313,
710,
1125,
9959,
10422,
310,
278,
1347,
304,
367,
13746,
29889,
910,
674,
367,
1304,
363,
4444,
13,
9651,
278,
2224,
988,
372,
674,
367,
13746,
29889,
13,
1678,
16969,
29901,
13,
4706,
6120,
29901,
5852,
565,
278,
934,
471,
13746,
8472,
13,
1678,
9995,
13,
1678,
2752,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12322,
29892,
10422,
29897,
13,
1678,
12551,
353,
2897,
29889,
2084,
29889,
7122,
29898,
23848,
29892,
10422,
29897,
13,
1678,
396,
1334,
871,
864,
304,
1074,
1316,
2472,
565,
591,
526,
13490,
29889,
13466,
29892,
372,
674,
925,
274,
1188,
701,
278,
10748,
29889,
13,
1678,
1510,
14470,
4297,
353,
4128,
3366,
8382,
3108,
13,
1678,
17927,
29889,
8382,
703,
11882,
292,
934,
515,
426,
4993,
29913,
304,
426,
23848,
29913,
1642,
4830,
29898,
4993,
353,
2752,
29892,
12551,
353,
12551,
876,
13,
1678,
736,
16641,
2891,
29889,
29911,
2283,
29889,
29907,
29886,
29898,
4993,
29892,
12551,
29892,
1510,
14470,
4297,
29897,
13,
13,
1753,
3509,
10547,
1762,
29923,
3267,
29898,
12322,
29892,
12551,
29892,
977,
264,
1280,
1125,
13,
1678,
9995,
14187,
278,
2183,
977,
264,
1280,
304,
382,
3267,
29889,
13,
13,
1678,
12745,
607,
5229,
526,
4133,
577,
393,
1438,
2066,
508,
367,
7160,
322,
278,
4113,
508,
367,
6655,
287,
304,
2125,
13,
1678,
5684,
8820,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
3884,
313,
710,
1125,
10802,
304,
278,
3884,
988,
278,
2066,
526,
6087,
12430,
29889,
13,
4706,
12551,
313,
710,
1125,
18862,
373,
382,
3267,
304,
607,
278,
934,
881,
367,
13746,
29889,
13,
4706,
977,
264,
1280,
313,
1761,
1125,
12745,
304,
3509,
304,
382,
3267,
29889,
13,
1678,
16969,
29901,
13,
4706,
1051,
29901,
2514,
264,
1280,
363,
599,
310,
278,
2066,
607,
3579,
26061,
1068,
29889,
13,
1678,
9995,
13,
1678,
5229,
3434,
264,
1280,
353,
5159,
13,
1678,
363,
285,
297,
977,
264,
1280,
29901,
13,
4706,
396,
910,
740,
674,
6336,
337,
2202,
29889,
13,
4706,
620,
353,
3509,
2283,
1762,
29923,
3267,
3047,
10303,
29898,
12322,
353,
3884,
29892,
12551,
353,
12551,
29892,
10422,
353,
285,
29897,
13,
4706,
396,
14491,
278,
5229,
2066,
577,
591,
508,
26051,
278,
4113,
393,
1554,
3512,
2743,
29889,
13,
4706,
565,
620,
338,
7700,
29901,
13,
9651,
5229,
3434,
264,
1280,
29889,
4397,
29898,
29888,
29897,
13,
13,
1678,
736,
5229,
3434,
264,
1280,
13,
13,
1753,
3787,
17776,
10547,
29898,
2746,
1170,
29892,
977,
264,
1280,
1125,
13,
1678,
9995,
14491,
5229,
2066,
297,
263,
9109,
2058,
363,
2678,
6782,
29889,
13,
13,
1678,
910,
740,
881,
367,
2000,
363,
1269,
3268,
29889,
7806,
3268,
7344,
29879,
263,
1422,
3884,
408,
1422,
13,
1678,
2066,
1033,
4418,
363,
1422,
11840,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
3268,
1170,
313,
710,
1125,
4408,
310,
278,
3268,
363,
607,
278,
2066,
5229,
304,
6782,
29889,
13,
4706,
977,
264,
1280,
313,
1761,
1125,
2514,
264,
1280,
607,
5229,
304,
6782,
29889,
13,
1678,
16969,
29901,
13,
4706,
6213,
29889,
13,
1678,
9995,
13,
1678,
396,
6204,
278,
8635,
4423,
565,
5181,
322,
3509,
278,
2066,
304,
372,
29889,
13,
1678,
8635,
2605,
353,
2897,
29889,
2084,
29889,
7122,
29898,
16744,
3366,
13556,
2147,
1469,
15637,
10486,
12436,
3268,
1170,
29897,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
12925,
2605,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
12925,
2605,
29897,
13,
13,
1678,
363,
285,
297,
977,
264,
1280,
29901,
13,
4706,
1018,
29901,
13,
9651,
528,
4422,
29889,
8552,
29906,
29898,
359,
29889,
2084,
29889,
7122,
29898,
16744,
3366,
13556,
2147,
1469,
12436,
285,
511,
2897,
29889,
2084,
29889,
7122,
29898,
12925,
2605,
29892,
285,
876,
13,
4706,
5174,
528,
4422,
29889,
2392,
408,
321,
29901,
13,
9651,
396,
4522,
278,
3682,
313,
578,
372,
674,
679,
13817,
322,
2665,
3025,
10524,
746,
8210,
511,
322,
769,
13,
9651,
396,
337,
29899,
22692,
372,
577,
372,
1838,
29915,
29873,
679,
5714,
29889,
13,
9651,
17927,
29889,
9695,
936,
703,
2392,
297,
17596,
278,
5229,
6782,
2066,
29889,
4829,
29901,
426,
29872,
29913,
1642,
4830,
29898,
29872,
353,
321,
876,
13,
9651,
396,
12020,
411,
694,
6273,
337,
29899,
336,
4637,
278,
1833,
3682,
29889,
13,
9651,
12020,
13,
13,
1678,
396,
3087,
537,
1423,
393,
278,
2066,
892,
8472,
13746,
29889,
13,
1678,
396,
1670,
508,
367,
916,
2066,
297,
278,
3884,
29892,
577,
591,
925,
817,
304,
367,
3058,
393,
278,
977,
264,
1280,
13,
1678,
396,
393,
591,
526,
11415,
1244,
526,
2869,
13746,
29889,
13,
1678,
4974,
731,
29898,
1777,
264,
1280,
467,
790,
431,
842,
29898,
359,
29889,
1761,
3972,
29898,
12925,
2605,
876,
13,
13,
1678,
396,
2648,
12183,
29892,
372,
674,
367,
2665,
304,
278,
7336,
1144,
746,
8210,
29889,
13,
1678,
396,
1763,
9801,
393,
591,
1016,
29915,
29873,
679,
975,
1332,
295,
2168,
491,
7191,
607,
871,
13100,
491,
278,
10422,
1304,
29892,
591,
13,
1678,
396,
871,
3160,
278,
269,
3537,
420,
297,
278,
1059,
29889,
2398,
29892,
491,
14010,
278,
2472,
472,
278,
5235,
3233,
29892,
13,
1678,
396,
372,
674,
367,
5134,
3025,
2665,
719,
29892,
577,
591,
29915,
645,
1603,
505,
2472,
278,
977,
264,
1280,
607,
5229,
29889,
13,
1678,
17927,
29889,
3888,
703,
10547,
5229,
304,
3509,
363,
3268,
426,
2746,
1170,
1836,
2514,
264,
1280,
29901,
426,
1777,
264,
1280,
29913,
1642,
4830,
29898,
2746,
1170,
353,
3268,
1170,
29892,
977,
264,
1280,
353,
977,
264,
1280,
876,
13,
1678,
17927,
29889,
2704,
703,
10547,
5229,
304,
3509,
363,
3268,
426,
2746,
1170,
29913,
1642,
4830,
29898,
2746,
1170,
353,
3268,
1170,
876,
13,
13,
1753,
1889,
29816,
10547,
7295,
13,
1678,
9995,
4241,
7156,
740,
363,
19870,
934,
9068,
322,
8401,
29889,
13,
13,
1678,
910,
740,
337,
3687,
373,
278,
1819,
310,
376,
13556,
2147,
1469,
613,
376,
13556,
2147,
1469,
15637,
10486,
613,
376,
1272,
4300,
571,
3524,
800,
1642,
13,
13,
1678,
3940,
29901,
13,
4706,
20999,
338,
20704,
3025,
278,
6811,
12344,
612,
23956,
5285,
1788,
29889,
512,
3153,
29892,
13,
4706,
278,
3987,
8018,
1244,
526,
3342,
297,
278,
2967,
3883,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
6213,
29889,
13,
1678,
16969,
29901,
13,
4706,
18761,
29901,
313,
8698,
3730,
4300,
14373,
29892,
5229,
3434,
264,
1280,
29897,
988,
8472,
4300,
14373,
313,
1761,
29897,
338,
278,
13,
9651,
977,
264,
1280,
310,
278,
2066,
607,
892,
8472,
18440,
29892,
322,
5229,
3434,
264,
1280,
313,
8977,
29897,
338,
278,
13,
9651,
977,
264,
1280,
607,
5229,
304,
367,
18440,
29892,
411,
278,
6611,
408,
278,
3268,
2983,
322,
278,
1819,
408,
278,
13,
9651,
977,
264,
1280,
29889,
13,
1678,
9995,
13,
1678,
396,
4525,
526,
925,
10650,
977,
264,
1280,
29889,
13,
1678,
977,
264,
1280,
1762,
4300,
571,
353,
8161,
10547,
1762,
16619,
29898,
12322,
353,
4128,
3366,
13556,
2147,
1469,
20068,
13,
13,
1678,
565,
451,
977,
264,
1280,
1762,
4300,
571,
29901,
13,
4706,
17927,
29889,
3888,
703,
3782,
716,
2066,
1476,
29889,
7106,
292,
23157,
13,
4706,
736,
6213,
29892,
6213,
13,
13,
1678,
17927,
29889,
3888,
703,
4300,
571,
292,
848,
304,
11840,
29901,
426,
16315,
29913,
1642,
4830,
29898,
16315,
353,
9162,
11393,
7122,
29898,
16744,
3366,
1272,
4300,
571,
3524,
800,
3108,
4961,
13,
13,
1678,
5229,
3434,
264,
1280,
353,
6571,
13,
1678,
363,
3268,
1170,
29892,
12551,
297,
4256,
7076,
29898,
16744,
3366,
1272,
4300,
571,
3524,
800,
3108,
1125,
13,
4706,
6782,
14400,
353,
3509,
10547,
1762,
3563,
12344,
29903,
3246,
13,
4706,
565,
376,
29923,
3267,
29908,
297,
3268,
1170,
29889,
21064,
7295,
13,
9651,
6782,
14400,
353,
3509,
10547,
1762,
29923,
3267,
13,
4706,
396,
27313,
278,
3935,
6782,
363,
1269,
13252,
4423,
29889,
13,
4706,
396,
1334,
817,
304,
3013,
5702,
310,
607,
2066,
5229,
304,
6782,
304,
607,
11840,
29889,
13,
4706,
5229,
3434,
264,
1280,
29961,
2746,
1170,
29962,
353,
6782,
14400,
29898,
12322,
353,
4128,
3366,
13556,
2147,
1469,
12436,
13,
462,
462,
462,
12551,
353,
12551,
29892,
13,
462,
462,
462,
977,
264,
1280,
353,
977,
264,
1280,
1762,
4300,
571,
29897,
13,
13,
1678,
396,
29273,
977,
264,
1280,
607,
7359,
29915,
29873,
1063,
11132,
29889,
13,
1678,
396,
1334,
871,
817,
304,
437,
445,
565,
727,
526,
777,
607,
5229,
29889,
13,
1678,
396,
1334,
884,
3013,
5702,
310,
607,
5229,
363,
12183,
29889,
13,
1678,
3001,
17776,
3434,
264,
1280,
353,
731,
580,
13,
1678,
565,
738,
29898,
1524,
5975,
29898,
26061,
3434,
264,
1280,
22164,
13,
4706,
396,
14187,
304,
263,
9109,
13201,
4423,
363,
8635,
2745,
896,
508,
367,
316,
1997,
411,
29889,
13,
4706,
396,
1334,
1207,
263,
3509,
322,
3787,
963,
16949,
1363,
278,
1021,
934,
1033,
505,
5229,
363,
2999,
13,
4706,
396,
1301,
25534,
29889,
2398,
29892,
591,
9273,
29915,
29873,
14074,
1568,
297,
8635,
1363,
1438,
9455,
29915,
29873,
9146,
304,
7952,
263,
13,
4706,
396,
1472,
931,
29889,
13,
4706,
363,
3268,
1170,
29892,
977,
264,
1280,
297,
4256,
7076,
29898,
26061,
3434,
264,
1280,
1125,
13,
9651,
3001,
17776,
3434,
264,
1280,
29889,
5504,
29898,
1777,
264,
1280,
29897,
13,
9651,
396,
9333,
4218,
304,
3787,
278,
5229,
2066,
565,
777,
2066,
2869,
5229,
29889,
13,
9651,
565,
977,
264,
1280,
29901,
13,
18884,
3787,
17776,
10547,
29898,
2746,
1170,
353,
3268,
1170,
29892,
977,
264,
1280,
353,
977,
264,
1280,
29897,
13,
13,
1678,
396,
4522,
607,
977,
264,
1280,
892,
18440,
8472,
29889,
13,
1678,
396,
1334,
674,
10201,
864,
304,
736,
263,
1051,
2012,
310,
263,
731,
29892,
577,
591,
925,
3588,
372,
1244,
29889,
13,
1678,
8472,
4300,
14373,
353,
1051,
29898,
842,
29898,
1777,
264,
1280,
1762,
4300,
571,
29897,
448,
3001,
17776,
3434,
264,
1280,
29897,
13,
1678,
17927,
29889,
3888,
703,
29943,
352,
368,
8472,
18440,
29901,
426,
8698,
3730,
4300,
14373,
29913,
1642,
4830,
29898,
8698,
3730,
4300,
14373,
353,
8472,
4300,
14373,
876,
13,
13,
1678,
396,
2567,
591,
508,
23511,
3349,
599,
2066,
29892,
1363,
738,
393,
505,
5229,
505,
2307,
1063,
13746,
29889,
13,
1678,
396,
14409,
312,
515,
848,
6410,
746,
13490,
29889,
13,
1678,
565,
4128,
3366,
8382,
3108,
338,
7700,
29901,
13,
4706,
363,
285,
297,
977,
264,
1280,
1762,
4300,
571,
29901,
13,
9651,
2897,
29889,
5992,
29898,
359,
29889,
2084,
29889,
7122,
29898,
16744,
3366,
13556,
2147,
1469,
12436,
285,
876,
13,
1678,
1683,
29901,
13,
4706,
17927,
29889,
8382,
703,
10547,
304,
3349,
29901,
426,
1777,
264,
1280,
1762,
4300,
571,
29913,
1642,
4830,
29898,
1777,
264,
1280,
1762,
4300,
571,
353,
977,
264,
1280,
1762,
4300,
571,
876,
13,
13,
1678,
736,
313,
8698,
3730,
4300,
14373,
29892,
5229,
3434,
264,
1280,
29897,
13,
13,
2
] |
raylab/utils/types.py | angelolovatto/raylab | 29 | 150037 | """Collection of type annotations."""
from typing import Callable, Dict, Tuple, Union
from torch import Tensor
DynamicsFn = Callable[[Tensor, Tensor], Tuple[Tensor, Tensor]]
RewardFn = Callable[[Tensor, Tensor, Tensor], Tensor]
StatDict = Dict[str, Union[float, int]]
TerminationFn = Callable[[Tensor, Tensor, Tensor], Tensor]
| [
1,
9995,
7196,
310,
1134,
25495,
1213,
15945,
13,
3166,
19229,
1053,
8251,
519,
29892,
360,
919,
29892,
12603,
552,
29892,
7761,
13,
13,
3166,
4842,
305,
1053,
323,
6073,
13,
13,
29928,
2926,
1199,
29137,
353,
8251,
519,
8999,
29911,
6073,
29892,
323,
6073,
1402,
12603,
552,
29961,
29911,
6073,
29892,
323,
6073,
5262,
13,
13,
29934,
809,
538,
29137,
353,
8251,
519,
8999,
29911,
6073,
29892,
323,
6073,
29892,
323,
6073,
1402,
323,
6073,
29962,
13,
13,
9513,
21533,
353,
360,
919,
29961,
710,
29892,
7761,
29961,
7411,
29892,
938,
5262,
13,
13,
14343,
3381,
29137,
353,
8251,
519,
8999,
29911,
6073,
29892,
323,
6073,
29892,
323,
6073,
1402,
323,
6073,
29962,
13,
2
] |
gsa_module/samples/lhs_opt.py | damar-wicaksono/gsa-module | 4 | 188975 | # -*- coding: utf-8 -*-
"""lhs_opt.py: Module to generate design matrix from an optimized
Latin Hypercube design
"""
import numpy as np
from . import lhs
__author__ = "<NAME>"
def create_ese(n: int, d: int, seed: int, max_outer: int,
obj_function: str="w2_discrepancy",
threshold_init: float=0,
num_exchanges: int=0,
max_inner: int = 0,
improving_params: list = [0.1, 0.8],
exploring_params: list = [0.1, 0.8, 0.9, 0.7]) -> np.ndarray:
"""Generate an optimized LHS using Enhanced Stochastic Evolutionary Alg.
The default parameters of the optimization can be overridden, if necessary.
:param n: the number of samples
:param d: the number of dimension
:param seed: the random seed number
:param max_outer: the maximum number of outer iterations
:param obj_function: the objective function to optimize
:param threshold_init: the initial threshold
:param num_exchanges: the number of candidates in perturbation step
:param max_inner: the maximum number of inner iterations
:param improving_params: the 2 parameters used in improve process
(a) the cut-off value to decrease the threshold
(b) the multiplier to decrease or increase the threshold
:param exploring_params: the 4 parameters used in explore process
(a) the cut-off value of acceptance, start increasing the threshold
(b) the cut-off value of acceptance, start decreasing the threshold
(c) the cooling multiplier for the threshold
(d) the warming multiplier for the threshold
"""
from .opt_alg.stochastic_evolutionary import optimize
# If dimension is less than 2, abort optimization
if d < 2:
raise ValueError("Dimension less than 2, optimization irrelevant!")
if seed is not None:
np.random.seed(seed)
# Create initial LHD sample
dm = lhs.create(n, d, seed=seed)
# Optimize the LHD sample
dm_opt = optimize(dm, obj_function, threshold_init, num_exchanges,
max_inner, max_outer, improving_params, exploring_params)
return dm_opt.dm_best
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
29880,
9499,
29918,
3670,
29889,
2272,
29901,
15591,
304,
5706,
2874,
4636,
515,
385,
27545,
13,
13992,
262,
26078,
29883,
4003,
2874,
13,
15945,
29908,
13,
5215,
12655,
408,
7442,
13,
3166,
869,
1053,
301,
9499,
13,
13,
1649,
8921,
1649,
353,
9872,
5813,
11903,
13,
13,
13,
1753,
1653,
29918,
968,
29898,
29876,
29901,
938,
29892,
270,
29901,
938,
29892,
16717,
29901,
938,
29892,
4236,
29918,
5561,
29901,
938,
29892,
13,
1669,
5446,
29918,
2220,
29901,
851,
543,
29893,
29906,
29918,
2218,
1037,
29886,
6906,
613,
13,
1669,
16897,
29918,
2344,
29901,
5785,
29922,
29900,
29892,
13,
1669,
954,
29918,
735,
25990,
29901,
938,
29922,
29900,
29892,
13,
1669,
4236,
29918,
3993,
29901,
938,
353,
29871,
29900,
29892,
13,
1669,
4857,
1747,
29918,
7529,
29901,
1051,
353,
518,
29900,
29889,
29896,
29892,
29871,
29900,
29889,
29947,
1402,
13,
1669,
3902,
8253,
29918,
7529,
29901,
1051,
353,
518,
29900,
29889,
29896,
29892,
29871,
29900,
29889,
29947,
29892,
29871,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29955,
2314,
1599,
7442,
29889,
299,
2378,
29901,
13,
1678,
9995,
5631,
403,
385,
27545,
365,
14851,
773,
1174,
29308,
6639,
305,
6288,
382,
4068,
653,
11545,
29889,
13,
13,
1678,
450,
2322,
4128,
310,
278,
13883,
508,
367,
20831,
1145,
29892,
565,
5181,
29889,
13,
13,
1678,
584,
3207,
302,
29901,
278,
1353,
310,
11916,
13,
1678,
584,
3207,
270,
29901,
278,
1353,
310,
9927,
13,
1678,
584,
3207,
16717,
29901,
278,
4036,
16717,
1353,
13,
1678,
584,
3207,
4236,
29918,
5561,
29901,
278,
7472,
1353,
310,
11420,
24372,
13,
1678,
584,
3207,
5446,
29918,
2220,
29901,
278,
12091,
740,
304,
24656,
13,
1678,
584,
3207,
16897,
29918,
2344,
29901,
278,
2847,
16897,
13,
1678,
584,
3207,
954,
29918,
735,
25990,
29901,
278,
1353,
310,
21669,
297,
22786,
362,
4331,
13,
1678,
584,
3207,
4236,
29918,
3993,
29901,
278,
7472,
1353,
310,
6426,
24372,
13,
1678,
584,
3207,
4857,
1747,
29918,
7529,
29901,
278,
29871,
29906,
4128,
1304,
297,
11157,
1889,
13,
4706,
313,
29874,
29897,
278,
5700,
29899,
2696,
995,
304,
23806,
278,
16897,
13,
4706,
313,
29890,
29897,
278,
6674,
4926,
304,
23806,
470,
7910,
278,
16897,
13,
1678,
584,
3207,
3902,
8253,
29918,
7529,
29901,
278,
29871,
29946,
4128,
1304,
297,
26987,
1889,
13,
4706,
313,
29874,
29897,
278,
5700,
29899,
2696,
995,
310,
3544,
749,
29892,
1369,
10231,
278,
16897,
13,
4706,
313,
29890,
29897,
278,
5700,
29899,
2696,
995,
310,
3544,
749,
29892,
1369,
9263,
5832,
278,
16897,
13,
4706,
313,
29883,
29897,
278,
12528,
292,
6674,
4926,
363,
278,
16897,
13,
4706,
313,
29881,
29897,
278,
1370,
4056,
6674,
4926,
363,
278,
16897,
13,
1678,
9995,
13,
1678,
515,
869,
3670,
29918,
9564,
29889,
303,
28225,
29918,
29872,
4068,
653,
1053,
24656,
13,
13,
1678,
396,
960,
9927,
338,
3109,
1135,
29871,
29906,
29892,
27450,
13883,
13,
1678,
565,
270,
529,
29871,
29906,
29901,
13,
4706,
12020,
7865,
2392,
703,
16142,
2673,
3109,
1135,
29871,
29906,
29892,
13883,
28190,
29991,
1159,
13,
13,
1678,
565,
16717,
338,
451,
6213,
29901,
13,
4706,
7442,
29889,
8172,
29889,
26776,
29898,
26776,
29897,
13,
13,
1678,
396,
6204,
2847,
365,
26124,
4559,
13,
1678,
270,
29885,
353,
301,
9499,
29889,
3258,
29898,
29876,
29892,
270,
29892,
16717,
29922,
26776,
29897,
13,
13,
1678,
396,
20693,
326,
675,
278,
365,
26124,
4559,
13,
1678,
270,
29885,
29918,
3670,
353,
24656,
29898,
18933,
29892,
5446,
29918,
2220,
29892,
16897,
29918,
2344,
29892,
954,
29918,
735,
25990,
29892,
13,
462,
418,
4236,
29918,
3993,
29892,
4236,
29918,
5561,
29892,
4857,
1747,
29918,
7529,
29892,
3902,
8253,
29918,
7529,
29897,
13,
13,
1678,
736,
270,
29885,
29918,
3670,
29889,
18933,
29918,
13318,
13,
2
] |
python3/distortion_correct_aksk_demo.py | MeekoI/ais-sdk | 0 | 5556 | <filename>python3/distortion_correct_aksk_demo.py
# -*- coding:utf-8 -*-
from ais_sdk.utils import encode_to_base64
from ais_sdk.utils import decode_to_wave_file
from ais_sdk.distortion_correct import distortion_correct_aksk
from ais_sdk.utils import init_global_env
import json
if __name__ == '__main__':
#
# access moderation distortion correct.post data by ak,sk
#
app_key = '*************'
app_secret = '************'
init_global_env(region='cn-north-1')
demo_data_url = 'https://ais-sample-data.obs.cn-north-1.myhuaweicloud.com/vat-invoice.jpg'
#call interface use the url correction is true means do not correction
result = distortion_correct_aksk(app_key, app_secret, "", demo_data_url, True)
result_obj = json.loads(result)
if result_obj['result']['data'] != '':
decode_to_wave_file(result_obj['result']['data'], 'data/moderation-distortion-aksk-1.png')
else:
print(result)
# call interface use the file
result = distortion_correct_aksk(app_key, app_secret, encode_to_base64('data/moderation-distortion.jpg'), '', True)
result_obj = json.loads(result)
if result_obj['result']['data'] != '':
decode_to_wave_file(result_obj['result']['data'], 'data/moderation-distortion-aksk-2.png')
else:
print(result) | [
1,
529,
9507,
29958,
4691,
29941,
29914,
5721,
441,
291,
29918,
15728,
29918,
557,
808,
29918,
17482,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
9420,
29899,
29947,
448,
29930,
29899,
13,
3166,
263,
275,
29918,
15348,
29889,
13239,
1053,
19750,
29918,
517,
29918,
3188,
29953,
29946,
13,
3166,
263,
275,
29918,
15348,
29889,
13239,
1053,
21822,
29918,
517,
29918,
27766,
29918,
1445,
13,
3166,
263,
275,
29918,
15348,
29889,
5721,
441,
291,
29918,
15728,
1053,
1320,
441,
291,
29918,
15728,
29918,
557,
808,
13,
3166,
263,
275,
29918,
15348,
29889,
13239,
1053,
2069,
29918,
10945,
29918,
6272,
13,
5215,
4390,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
396,
13,
1678,
396,
2130,
17768,
362,
1320,
441,
291,
1959,
29889,
2490,
848,
491,
11208,
29892,
808,
13,
1678,
396,
13,
1678,
623,
29918,
1989,
353,
525,
4189,
2328,
29930,
29915,
13,
1678,
623,
29918,
19024,
353,
525,
4189,
2328,
29915,
13,
1678,
2069,
29918,
10945,
29918,
6272,
29898,
12803,
2433,
18038,
29899,
29876,
2072,
29899,
29896,
1495,
13,
13,
1678,
13455,
29918,
1272,
29918,
2271,
353,
525,
991,
597,
1759,
29899,
11249,
29899,
1272,
29889,
26290,
29889,
18038,
29899,
29876,
2072,
29899,
29896,
29889,
1357,
29882,
3357,
705,
293,
29880,
2736,
29889,
510,
29914,
9046,
29899,
262,
14917,
29889,
6173,
29915,
13,
13,
1678,
396,
4804,
5067,
671,
278,
3142,
26385,
338,
1565,
2794,
437,
451,
26385,
13,
1678,
1121,
353,
1320,
441,
291,
29918,
15728,
29918,
557,
808,
29898,
932,
29918,
1989,
29892,
623,
29918,
19024,
29892,
12633,
13455,
29918,
1272,
29918,
2271,
29892,
5852,
29897,
13,
1678,
1121,
29918,
5415,
353,
4390,
29889,
18132,
29898,
2914,
29897,
13,
1678,
565,
1121,
29918,
5415,
1839,
2914,
16215,
1272,
2033,
2804,
525,
2396,
13,
4706,
21822,
29918,
517,
29918,
27766,
29918,
1445,
29898,
2914,
29918,
5415,
1839,
2914,
16215,
1272,
7464,
525,
1272,
29914,
1545,
261,
362,
29899,
5721,
441,
291,
29899,
557,
808,
29899,
29896,
29889,
2732,
1495,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
2914,
29897,
13,
13,
1678,
396,
1246,
5067,
671,
278,
934,
13,
1678,
1121,
353,
1320,
441,
291,
29918,
15728,
29918,
557,
808,
29898,
932,
29918,
1989,
29892,
623,
29918,
19024,
29892,
19750,
29918,
517,
29918,
3188,
29953,
29946,
877,
1272,
29914,
1545,
261,
362,
29899,
5721,
441,
291,
29889,
6173,
5477,
15516,
5852,
29897,
13,
1678,
1121,
29918,
5415,
353,
4390,
29889,
18132,
29898,
2914,
29897,
13,
1678,
565,
1121,
29918,
5415,
1839,
2914,
16215,
1272,
2033,
2804,
525,
2396,
13,
4706,
21822,
29918,
517,
29918,
27766,
29918,
1445,
29898,
2914,
29918,
5415,
1839,
2914,
16215,
1272,
7464,
525,
1272,
29914,
1545,
261,
362,
29899,
5721,
441,
291,
29899,
557,
808,
29899,
29906,
29889,
2732,
1495,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
2914,
29897,
2
] |
main.py | wynshiter/WhatIsYourName | 3 | 58566 | <filename>main.py
# This is a sample Python script.
import load_data
import birthday_timeStamp
import itertools
class WhatIsYourName():
def __init__(self,surname:str,birth_day:str,Expectation:str):
self.surname= surname
self.birth_day = birth_day
self.Expectation = Expectation
self.DBSession = load_data.get_conn(load_data.STR_PATH_SQLITE, True)
self.name_list = []
def get_my_name(self):
bt = birthday_timeStamp.birthday_timeStamp(str_birthday_time=self.birth_day)
bt_index_array = bt.get_birthday_time_random_id()
#根据生日 随机生成的字序号 做笛卡尔积
name_bt_index_array = [x for x in itertools.product(bt_index_array, bt_index_array)]
surname_index = load_data.get_word_id(self.DBSession,self.surname)
name_result_bt_index_array = [[surname_index,x[0],x[1]] for x in name_bt_index_array]
return name_result_bt_index_array
def print_hi(self,prefix,name_index_array):
# 以三个字为例
print(f'Hi, {prefix}\n')
name = self.surname + \
load_data.get_word_info(self.DBSession,name_index_array[1],"Word")+ \
load_data.get_word_info(self.DBSession,name_index_array[2],"Word")
self.name_list.append([self.surname,name,name_index_array])
print(name+"\n")
if __name__ == '__main__':
baby_name = WhatIsYourName(surname = "王",birth_day="2022-02-28 23:40:10",Expectation="")
print(baby_name.get_my_name())
baby_name_array = baby_name.get_my_name()
for name in baby_name_array:
baby_name.print_hi('你的名字是:',name)
print(baby_name.name_list)
| [
1,
529,
9507,
29958,
3396,
29889,
2272,
13,
29937,
910,
338,
263,
4559,
5132,
2471,
29889,
13,
13,
5215,
2254,
29918,
1272,
13,
5215,
12060,
3250,
29918,
2230,
855,
1160,
13,
5215,
4256,
8504,
13,
13,
1990,
1724,
3624,
10858,
1170,
7295,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
29879,
16004,
29901,
710,
29892,
29890,
7515,
29918,
3250,
29901,
710,
29892,
1252,
1103,
362,
29901,
710,
1125,
13,
4706,
1583,
29889,
29879,
16004,
29922,
23403,
13,
4706,
1583,
29889,
29890,
7515,
29918,
3250,
353,
12060,
29918,
3250,
13,
4706,
1583,
29889,
1252,
1103,
362,
353,
1222,
1103,
362,
13,
13,
4706,
1583,
29889,
4051,
7317,
353,
2254,
29918,
1272,
29889,
657,
29918,
13082,
29898,
1359,
29918,
1272,
29889,
10810,
29918,
10145,
29918,
4176,
9094,
29892,
5852,
29897,
13,
4706,
1583,
29889,
978,
29918,
1761,
353,
5159,
13,
13,
1678,
822,
679,
29918,
1357,
29918,
978,
29898,
1311,
1125,
13,
13,
4706,
289,
29873,
353,
12060,
3250,
29918,
2230,
855,
1160,
29889,
29890,
7515,
3250,
29918,
2230,
855,
1160,
29898,
710,
29918,
29890,
7515,
3250,
29918,
2230,
29922,
1311,
29889,
29890,
7515,
29918,
3250,
29897,
13,
4706,
289,
29873,
29918,
2248,
29918,
2378,
353,
289,
29873,
29889,
657,
29918,
29890,
7515,
3250,
29918,
2230,
29918,
8172,
29918,
333,
580,
13,
4706,
396,
31393,
30763,
30486,
30325,
29871,
236,
157,
146,
31429,
30486,
30494,
30210,
30578,
31463,
30850,
29871,
232,
132,
157,
234,
175,
158,
232,
144,
164,
31814,
234,
170,
178,
13,
4706,
1024,
29918,
3116,
29918,
2248,
29918,
2378,
353,
518,
29916,
363,
921,
297,
4256,
8504,
29889,
4704,
29898,
3116,
29918,
2248,
29918,
2378,
29892,
289,
29873,
29918,
2248,
29918,
2378,
4638,
13,
4706,
23403,
29918,
2248,
353,
2254,
29918,
1272,
29889,
657,
29918,
1742,
29918,
333,
29898,
1311,
29889,
4051,
7317,
29892,
1311,
29889,
29879,
16004,
29897,
13,
4706,
1024,
29918,
2914,
29918,
3116,
29918,
2248,
29918,
2378,
353,
5519,
29879,
16004,
29918,
2248,
29892,
29916,
29961,
29900,
1402,
29916,
29961,
29896,
5262,
363,
921,
297,
1024,
29918,
3116,
29918,
2248,
29918,
2378,
29962,
13,
4706,
736,
1024,
29918,
2914,
29918,
3116,
29918,
2248,
29918,
2378,
13,
13,
13,
1678,
822,
1596,
29918,
2918,
29898,
1311,
29892,
13506,
29892,
978,
29918,
2248,
29918,
2378,
1125,
13,
4706,
396,
29871,
30651,
30457,
30502,
30578,
30573,
31507,
13,
13,
13,
4706,
1596,
29898,
29888,
29915,
18567,
29892,
426,
13506,
1012,
29876,
1495,
13,
13,
4706,
1024,
353,
1583,
29889,
29879,
16004,
718,
320,
13,
4706,
2254,
29918,
1272,
29889,
657,
29918,
1742,
29918,
3888,
29898,
1311,
29889,
4051,
7317,
29892,
978,
29918,
2248,
29918,
2378,
29961,
29896,
1402,
29908,
14463,
1159,
29974,
320,
13,
4706,
2254,
29918,
1272,
29889,
657,
29918,
1742,
29918,
3888,
29898,
1311,
29889,
4051,
7317,
29892,
978,
29918,
2248,
29918,
2378,
29961,
29906,
1402,
29908,
14463,
1159,
13,
13,
4706,
1583,
29889,
978,
29918,
1761,
29889,
4397,
4197,
1311,
29889,
29879,
16004,
29892,
978,
29892,
978,
29918,
2248,
29918,
2378,
2314,
13,
13,
4706,
1596,
29898,
978,
13578,
29905,
29876,
1159,
13,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
24354,
29918,
978,
353,
1724,
3624,
10858,
1170,
29898,
29879,
16004,
353,
376,
30462,
613,
29890,
7515,
29918,
3250,
543,
29906,
29900,
29906,
29906,
29899,
29900,
29906,
29899,
29906,
29947,
29871,
29906,
29941,
29901,
29946,
29900,
29901,
29896,
29900,
613,
1252,
1103,
362,
543,
1159,
13,
1678,
1596,
29898,
29890,
10798,
29918,
978,
29889,
657,
29918,
1357,
29918,
978,
3101,
13,
1678,
24354,
29918,
978,
29918,
2378,
353,
24354,
29918,
978,
29889,
657,
29918,
1357,
29918,
978,
580,
13,
13,
1678,
363,
1024,
297,
24354,
29918,
978,
29918,
2378,
29901,
13,
4706,
24354,
29918,
978,
29889,
2158,
29918,
2918,
877,
30919,
30210,
30548,
30578,
30392,
30383,
742,
978,
29897,
13,
13,
1678,
1596,
29898,
29890,
10798,
29918,
978,
29889,
978,
29918,
1761,
29897,
13,
13,
13,
2
] |
secretScript_sxsw.py | grapealope/secrets | 1 | 1602759 | import os, sys
import json
import csv
import collections
import random
from pprint import pprint
from playsound import playsound
import datetime
from six import string_types
from boto3 import Session
from botocore.exceptions import BotoCoreError, ClientError
from contextlib import closing
from pollySpeak import newSession, pollySpeech
from concatMp3 import concatMp3
from nltk import tokenize
from google.cloud import translate
import utils
from utils import createTimestampedDir
from pollySpeak import newSession, pollySpeech, speakSecrets
# Defaults (integrate this into main, and with keyword args)
from params import *
csvfile = '/Users/kalmar/Documents/code/secrets/secrets_data/secrets_sxsw_sn_curated.csv'
datapath = '/Users/kalmar/Documents/code/secrets/secrets_data/secrets_sxsw.json'
createSecretsJsonFromCSV(csvfile, datapath)
secrets = []
with open(datapath) as data_file:
secrets = json.load(data_file)
voiceIds = ['Joanna', 'Kendra', 'Amy', 'Joey', 'Brian', 'Matthew', 'Nicole', 'Russell']
whisperFreq = 0.2 # What percentage of the secrets should be whispered?
# attenuations_list = [0, 2.5, 5, 7.5, 10]
# attenuations_list = [0, 2, 4, 6, 8]
# attenuations_list = [0, 1, 2, 3, 4]
attenuations_list = [0]
random_min = 1000
random_max = 4000
secrets_per_file = 195
# Shuffle secrets
random.shuffle(secrets)
secrets[0:10]
mp3path = createTimestampedDir(mp3path_base)
speakSecrets(secrets, voiceIds, mp3path, whisperFreq=0.15, randVoice=True, mp3_padding='random',
createLog=True, attenuation_list=attenuations_list)
concatMp3(mp3path + '/', file_name='mergedSecrets-group-{}'.format(0), file_padding='random', random_min=1000, random_max=4000, verbose=True)
for fdx in range(0,5):
range_start = fdx * secrets_per_file
range_stop = range_start + secrets_per_file
print('{} range: {}-{}'.format(fdx, range_start, range_stop))
concatMp3(mp3path + '/', file_name='mergedSecrets-group-{}'.format(fdx), file_padding='random', random_min=1000, random_max=4000,
range_start=range_start, range_stop=range_stop, verbose=True)
# ------------------------------------------ #
# Test voices
mp3path = createTimestampedDir(mp3path_base)
attenuations_list = [0]
voiceIds = ['Joanna', 'Kendra', 'Amy', 'Joey', 'Brian']
voiceIds = ['Salli', 'Kimberly', 'Justin', 'Emma', 'Nicole', 'Russell', 'Matthew', 'Geraint', 'Celine',
'Mathieu', 'Chantal', 'Hans', 'Marlene', 'Vicki', 'Ricardo', 'Vitoria', 'Miguel', 'Penelope',
'Astrid', 'Maxim', 'Tatyana', 'Carla', 'Giorgio']
for voiceId in voiceIds:
speakSecrets([secrets[1]], [voiceId], mp3path, whisperFreq=0, randVoice=False, outputFileIdx=voiceId,
createLog=False, attenuation_list=attenuations_list)
# ------------------------------------------ #
# English
voiceIds = ['Joanna', 'Kendra', 'Amy', 'Joey', 'Brian']
speakSecrets(english_secrets[0:70], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[70:140], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[140:210], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[210:280], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[280:], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[137:138], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[138:139], voiceIds, createTimestampedDir(mp3path_base), randVoice=True)
speakSecrets(english_secrets[0:500], voiceIds, createTimestampedDir(mp3path_base), randVoice=True, verbose=True)
# ------------------------------------------ #
# Italian
voiceIds = ['Carla', 'Giorgio']
speakSecrets(italian_secrets[0:50], voiceIds, createTimestampedDir(mp3path_base),
randVoice=True,
language='it',
target_lang='it')
speakSecrets(italian_secrets[50:100], voiceIds, createTimestampedDir(mp3path_base),
randVoice=True,
language='it',
target_lang='it')
speakSecrets(italian_secrets[100:], voiceIds, createTimestampedDir(mp3path_base),
randVoice=True,
language='it',
target_lang='it')
# ------------------------------------------ #
# Fix timing
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-11-10-test'
concatMp3(mp3path + '/', file_padding=45000)
concatMp3(mp3path + '/', file_padding='random')
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-11-10-1'
concatMp3(mp3path + '/', file_padding='random')
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-11-10-2'
concatMp3(mp3path + '/', file_padding='random')
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-11-10-3'
concatMp3(mp3path + '/', file_padding='random')
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-11-10-4'
concatMp3(mp3path + '/', file_padding='random')
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-11-10-5'
concatMp3(mp3path + '/', file_padding='random')
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-05-20-03-25'
concatMp3(mp3path + '/', file_padding=mp3_padding)
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-05-20-03-43'
concatMp3(mp3path + '/', file_padding=mp3_padding)
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-05-20-03-48'
concatMp3(mp3path + '/', file_padding=mp3_padding)
mp3path = '/Users/kalmar/Documents/code/secrets/audio/2017-05-20-03-52'
concatMp3(mp3path + '/', file_padding=mp3_padding)
| [
1,
1053,
2897,
29892,
10876,
13,
5215,
4390,
13,
5215,
11799,
13,
5215,
16250,
13,
5215,
4036,
13,
3166,
282,
2158,
1053,
282,
2158,
13,
3166,
13582,
618,
1053,
13582,
618,
13,
5215,
12865,
13,
3166,
4832,
1053,
1347,
29918,
8768,
13,
3166,
289,
3747,
29941,
1053,
16441,
13,
3166,
9225,
542,
487,
29889,
11739,
29879,
1053,
350,
3747,
9203,
2392,
29892,
12477,
2392,
13,
3166,
3030,
1982,
1053,
14382,
13,
3166,
1248,
368,
10649,
557,
1053,
716,
7317,
29892,
1248,
368,
10649,
5309,
13,
3166,
3022,
271,
29924,
29886,
29941,
1053,
3022,
271,
29924,
29886,
29941,
13,
3166,
302,
1896,
29895,
1053,
5993,
675,
13,
3166,
5386,
29889,
9274,
1053,
14240,
13,
13,
5215,
3667,
29879,
13,
3166,
3667,
29879,
1053,
1653,
27939,
287,
9170,
13,
3166,
1248,
368,
10649,
557,
1053,
716,
7317,
29892,
1248,
368,
10649,
5309,
29892,
7726,
7898,
27487,
13,
13,
29937,
13109,
29879,
313,
14146,
403,
445,
964,
1667,
29892,
322,
411,
13553,
6389,
29897,
13,
3166,
8636,
1053,
334,
13,
13,
7638,
1445,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
344,
1037,
1372,
29918,
1272,
29914,
344,
1037,
1372,
29918,
29879,
29916,
2774,
29918,
16586,
29918,
2764,
630,
29889,
7638,
29915,
13,
4130,
481,
493,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
344,
1037,
1372,
29918,
1272,
29914,
344,
1037,
1372,
29918,
29879,
29916,
2774,
29889,
3126,
29915,
13,
13,
3258,
7898,
27487,
8148,
4591,
29907,
7597,
29898,
7638,
1445,
29892,
1418,
481,
493,
29897,
13,
13,
344,
1037,
1372,
353,
5159,
13,
2541,
1722,
29898,
4130,
481,
493,
29897,
408,
848,
29918,
1445,
29901,
268,
13,
12,
344,
1037,
1372,
353,
4390,
29889,
1359,
29898,
1272,
29918,
1445,
29897,
13,
13,
14917,
21943,
353,
6024,
10844,
9713,
742,
525,
29968,
25404,
742,
525,
29909,
1357,
742,
525,
10844,
1032,
742,
525,
29933,
6392,
742,
525,
29924,
1131,
13636,
742,
525,
29940,
23249,
742,
525,
23002,
514,
2033,
13,
1332,
275,
546,
29943,
7971,
353,
29871,
29900,
29889,
29906,
12,
12,
12,
29937,
1724,
19649,
310,
278,
22183,
1372,
881,
367,
21039,
287,
29973,
13,
29937,
472,
841,
29884,
800,
29918,
1761,
353,
518,
29900,
29892,
29871,
29906,
29889,
29945,
29892,
29871,
29945,
29892,
29871,
29955,
29889,
29945,
29892,
29871,
29896,
29900,
29962,
13,
29937,
472,
841,
29884,
800,
29918,
1761,
353,
518,
29900,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29953,
29892,
29871,
29947,
29962,
13,
29937,
472,
841,
29884,
800,
29918,
1761,
353,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29962,
13,
8606,
29884,
800,
29918,
1761,
353,
518,
29900,
29962,
13,
8172,
29918,
1195,
353,
29871,
29896,
29900,
29900,
29900,
13,
8172,
29918,
3317,
353,
29871,
29946,
29900,
29900,
29900,
13,
344,
1037,
1372,
29918,
546,
29918,
1445,
353,
29871,
29896,
29929,
29945,
13,
13,
13,
29937,
1383,
21897,
22183,
1372,
13,
8172,
29889,
845,
21897,
29898,
344,
1037,
1372,
29897,
13,
344,
1037,
1372,
29961,
29900,
29901,
29896,
29900,
29962,
13,
13,
1526,
29941,
2084,
353,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
29897,
13,
5965,
557,
7898,
27487,
29898,
344,
1037,
1372,
29892,
7314,
21943,
29892,
22326,
29941,
2084,
29892,
21039,
29943,
7971,
29922,
29900,
29889,
29896,
29945,
29892,
20088,
29963,
29877,
625,
29922,
5574,
29892,
22326,
29941,
29918,
12791,
2433,
8172,
742,
13,
12,
12,
12,
1653,
3403,
29922,
5574,
29892,
472,
841,
29884,
362,
29918,
1761,
29922,
8606,
29884,
800,
29918,
1761,
29897,
13,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
978,
2433,
1050,
3192,
7898,
27487,
29899,
2972,
29899,
8875,
4286,
4830,
29898,
29900,
511,
934,
29918,
12791,
2433,
8172,
742,
4036,
29918,
1195,
29922,
29896,
29900,
29900,
29900,
29892,
4036,
29918,
3317,
29922,
29946,
29900,
29900,
29900,
29892,
26952,
29922,
5574,
29897,
13,
13,
1454,
285,
8235,
297,
3464,
29898,
29900,
29892,
29945,
1125,
13,
12,
3881,
29918,
2962,
353,
285,
8235,
334,
22183,
1372,
29918,
546,
29918,
1445,
13,
12,
3881,
29918,
9847,
353,
3464,
29918,
2962,
718,
22183,
1372,
29918,
546,
29918,
1445,
13,
12,
2158,
877,
8875,
3464,
29901,
6571,
29899,
8875,
4286,
4830,
29898,
29888,
8235,
29892,
3464,
29918,
2962,
29892,
3464,
29918,
9847,
876,
13,
12,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
978,
2433,
1050,
3192,
7898,
27487,
29899,
2972,
29899,
8875,
4286,
4830,
29898,
29888,
8235,
511,
934,
29918,
12791,
2433,
8172,
742,
4036,
29918,
1195,
29922,
29896,
29900,
29900,
29900,
29892,
4036,
29918,
3317,
29922,
29946,
29900,
29900,
29900,
29892,
13,
12,
12,
3881,
29918,
2962,
29922,
3881,
29918,
2962,
29892,
3464,
29918,
9847,
29922,
3881,
29918,
9847,
29892,
26952,
29922,
5574,
29897,
12,
13,
13,
29937,
448,
2683,
2683,
1378,
29899,
396,
13,
29937,
4321,
28848,
13,
13,
1526,
29941,
2084,
353,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
29897,
13,
8606,
29884,
800,
29918,
1761,
353,
518,
29900,
29962,
13,
13,
14917,
21943,
353,
6024,
10844,
9713,
742,
525,
29968,
25404,
742,
525,
29909,
1357,
742,
525,
10844,
1032,
742,
525,
29933,
6392,
2033,
13,
14917,
21943,
353,
6024,
20392,
492,
742,
525,
29968,
326,
495,
368,
742,
525,
14084,
262,
742,
525,
6026,
655,
742,
525,
29940,
23249,
742,
525,
23002,
514,
742,
525,
29924,
1131,
13636,
742,
525,
29954,
261,
2365,
742,
525,
29907,
5570,
742,
29871,
13,
12,
12,
12,
29915,
11309,
9532,
742,
525,
1451,
17978,
742,
525,
29950,
550,
742,
525,
7083,
29880,
1600,
742,
525,
29963,
26894,
742,
525,
29934,
293,
6491,
742,
525,
29963,
2105,
423,
742,
525,
29924,
335,
2491,
742,
525,
29925,
264,
295,
2300,
742,
29871,
13,
12,
12,
12,
29915,
29909,
710,
333,
742,
525,
7976,
326,
742,
525,
29911,
11156,
1648,
742,
525,
8179,
433,
742,
525,
26074,
990,
601,
2033,
13,
13,
1454,
7314,
1204,
297,
7314,
21943,
29901,
13,
12,
5965,
557,
7898,
27487,
4197,
344,
1037,
1372,
29961,
29896,
20526,
518,
14917,
1204,
1402,
22326,
29941,
2084,
29892,
21039,
29943,
7971,
29922,
29900,
29892,
20088,
29963,
29877,
625,
29922,
8824,
29892,
1962,
2283,
1204,
29916,
29922,
14917,
1204,
29892,
13,
12,
12,
12,
12,
1653,
3403,
29922,
8824,
29892,
472,
841,
29884,
362,
29918,
1761,
29922,
8606,
29884,
800,
29918,
1761,
29897,
13,
13,
29937,
448,
2683,
2683,
1378,
29899,
396,
13,
29937,
4223,
29871,
13,
13,
14917,
21943,
353,
6024,
10844,
9713,
742,
525,
29968,
25404,
742,
525,
29909,
1357,
742,
525,
10844,
1032,
742,
525,
29933,
6392,
2033,
13,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29900,
29901,
29955,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29955,
29900,
29901,
29896,
29946,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29896,
29946,
29900,
29901,
29906,
29896,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29906,
29896,
29900,
29901,
29906,
29947,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29906,
29947,
29900,
29901,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29896,
29941,
29955,
29901,
29896,
29941,
29947,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29896,
29941,
29947,
29901,
29896,
29941,
29929,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29897,
13,
13,
13,
5965,
557,
7898,
27487,
29898,
996,
1674,
29918,
344,
1037,
1372,
29961,
29900,
29901,
29945,
29900,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
20088,
29963,
29877,
625,
29922,
5574,
29892,
26952,
29922,
5574,
29897,
13,
13,
13,
29937,
448,
2683,
2683,
1378,
29899,
396,
13,
29937,
10545,
29871,
13,
13,
14917,
21943,
353,
6024,
8179,
433,
742,
525,
26074,
990,
601,
2033,
13,
29871,
13,
5965,
557,
7898,
27487,
29898,
2410,
713,
29918,
344,
1037,
1372,
29961,
29900,
29901,
29945,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
13,
12,
12,
12,
12,
20088,
29963,
29877,
625,
29922,
5574,
29892,
13,
12,
12,
12,
12,
4086,
2433,
277,
742,
29871,
13,
12,
12,
12,
12,
3646,
29918,
3893,
2433,
277,
1495,
13,
13,
5965,
557,
7898,
27487,
29898,
2410,
713,
29918,
344,
1037,
1372,
29961,
29945,
29900,
29901,
29896,
29900,
29900,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
13,
12,
12,
12,
12,
20088,
29963,
29877,
625,
29922,
5574,
29892,
13,
12,
12,
12,
12,
4086,
2433,
277,
742,
29871,
13,
12,
12,
12,
12,
3646,
29918,
3893,
2433,
277,
1495,
13,
13,
5965,
557,
7898,
27487,
29898,
2410,
713,
29918,
344,
1037,
1372,
29961,
29896,
29900,
29900,
29901,
1402,
7314,
21943,
29892,
1653,
27939,
287,
9170,
29898,
1526,
29941,
2084,
29918,
3188,
511,
13,
12,
12,
12,
12,
20088,
29963,
29877,
625,
29922,
5574,
29892,
13,
12,
12,
12,
12,
4086,
2433,
277,
742,
29871,
13,
12,
12,
12,
12,
3646,
29918,
3893,
2433,
277,
1495,
13,
13,
29937,
448,
2683,
2683,
1378,
29899,
396,
13,
29937,
24778,
28750,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29896,
29896,
29899,
29896,
29900,
29899,
1688,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
29922,
29946,
29945,
29900,
29900,
29900,
29897,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
2433,
8172,
1495,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29896,
29896,
29899,
29896,
29900,
29899,
29896,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
2433,
8172,
1495,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29896,
29896,
29899,
29896,
29900,
29899,
29906,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
2433,
8172,
1495,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29896,
29896,
29899,
29896,
29900,
29899,
29941,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
2433,
8172,
1495,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29896,
29896,
29899,
29896,
29900,
29899,
29946,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
2433,
8172,
1495,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29896,
29896,
29899,
29896,
29900,
29899,
29945,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
2433,
8172,
1495,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29900,
29945,
29899,
29906,
29900,
29899,
29900,
29941,
29899,
29906,
29945,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
29922,
1526,
29941,
29918,
12791,
29897,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29900,
29945,
29899,
29906,
29900,
29899,
29900,
29941,
29899,
29946,
29941,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
29922,
1526,
29941,
29918,
12791,
29897,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29900,
29945,
29899,
29906,
29900,
29899,
29900,
29941,
29899,
29946,
29947,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
29922,
1526,
29941,
29918,
12791,
29897,
13,
13,
1526,
29941,
2084,
353,
8207,
5959,
29914,
11311,
3034,
29914,
20128,
29914,
401,
29914,
344,
1037,
1372,
29914,
18494,
29914,
29906,
29900,
29896,
29955,
29899,
29900,
29945,
29899,
29906,
29900,
29899,
29900,
29941,
29899,
29945,
29906,
29915,
13,
17685,
29924,
29886,
29941,
29898,
1526,
29941,
2084,
718,
8207,
742,
934,
29918,
12791,
29922,
1526,
29941,
29918,
12791,
29897,
13,
13,
13,
13,
13,
2
] |
main.py | liaoyongming/flaskapi | 0 | 81601 | #!/usr/bin/env python
from flask_script import Manager, Shell
from app import create_app,db
from flask_migrate import Migrate,MigrateCommand
app = create_app()
if __name__ == '__main__':
app.run(debug=True)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
3166,
29784,
29918,
2154,
1053,
15629,
29892,
1383,
514,
13,
3166,
623,
1053,
1653,
29918,
932,
29892,
2585,
13,
3166,
29784,
29918,
26983,
403,
1053,
341,
4481,
403,
29892,
29924,
4481,
403,
6255,
13,
13,
932,
353,
1653,
29918,
932,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29897,
13,
2
] |
djangoerp/core/templatetags/avatar.py | xarala221/django-erp | 345 | 86580 | #!/usr/bin/env python
"""This file is part of the django ERP project.
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.
"""
__author__ = '<NAME> <<EMAIL>>'
__copyright__ = 'Copyright (c) 2013-2015, django ERP Team'
__version__ = '0.0.5'
from hashlib import md5
from django import template
from django.utils.html import format_html, mark_safe, escape
register = template.Library()
@register.simple_tag
def avatar(email, size=32, default="mm", css_class="avatar image"):
"""Returns the gravatar image associated to the given email.
More info: http://www.gravatar.com
Example tag usage: {% avatar email_address 80 "http://.../my_default_image.jpg" [css_class] %}
"""
# Creates and returns the URL.
h = ""
if email:
h = md5(email.encode('utf-8')).hexdigest()
url = 'http://www.gravatar.com/avatar/%s?s=%s&r=g' % (h, escape(size))
# Adds a default image URL (if present).
if default:
url += "&d=%s" % escape(default)
url = mark_safe(url)
return format_html('<img class="{}" width="{}" height="{}" src="{}" />', css_class, size, size, url)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
15945,
29908,
4013,
934,
338,
760,
310,
278,
9557,
8982,
29925,
2060,
29889,
13,
13,
28350,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
29902,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
29943,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
20656,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
5265,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
13,
12015,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
13,
28350,
7791,
7818,
12982,
1525,
29889,
13,
15945,
29908,
13,
13,
1649,
8921,
1649,
353,
12801,
5813,
29958,
3532,
26862,
6227,
6778,
29915,
13,
1649,
8552,
1266,
1649,
353,
525,
11882,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29941,
29899,
29906,
29900,
29896,
29945,
29892,
9557,
8982,
29925,
8583,
29915,
13,
1649,
3259,
1649,
353,
525,
29900,
29889,
29900,
29889,
29945,
29915,
13,
13,
3166,
6608,
1982,
1053,
22821,
29945,
13,
3166,
9557,
1053,
4472,
13,
3166,
9557,
29889,
13239,
29889,
1420,
1053,
3402,
29918,
1420,
29892,
2791,
29918,
11177,
29892,
10169,
13,
13,
9573,
353,
4472,
29889,
12284,
580,
13,
13,
29992,
9573,
29889,
12857,
29918,
4039,
13,
1753,
1029,
14873,
29898,
5269,
29892,
2159,
29922,
29941,
29906,
29892,
2322,
543,
4317,
613,
5997,
29918,
1990,
543,
485,
14873,
1967,
29908,
1125,
13,
1678,
9995,
11609,
29879,
278,
8310,
14873,
1967,
6942,
304,
278,
2183,
4876,
29889,
13,
268,
13,
1678,
5853,
5235,
29901,
1732,
597,
1636,
29889,
3874,
9046,
279,
29889,
510,
13,
13,
1678,
8741,
4055,
8744,
29901,
18674,
1029,
14873,
4876,
29918,
7328,
29871,
29947,
29900,
376,
1124,
597,
856,
29914,
1357,
29918,
4381,
29918,
3027,
29889,
6173,
29908,
518,
4268,
29918,
1990,
29962,
15493,
13,
1678,
9995,
308,
13,
1678,
396,
6760,
1078,
322,
3639,
278,
3988,
29889,
13,
1678,
298,
353,
5124,
13,
1678,
565,
4876,
29901,
13,
4706,
298,
353,
22821,
29945,
29898,
5269,
29889,
12508,
877,
9420,
29899,
29947,
1495,
467,
20970,
7501,
342,
580,
13,
1678,
3142,
353,
525,
1124,
597,
1636,
29889,
3874,
9046,
279,
29889,
510,
29914,
485,
14873,
22584,
29879,
29973,
29879,
16328,
29879,
29987,
29878,
29922,
29887,
29915,
1273,
313,
29882,
29892,
10169,
29898,
2311,
876,
13,
268,
13,
1678,
396,
3462,
29879,
263,
2322,
1967,
3988,
313,
361,
2198,
467,
13,
1678,
565,
2322,
29901,
13,
4706,
3142,
4619,
376,
29987,
29881,
16328,
29879,
29908,
1273,
10169,
29898,
4381,
29897,
13,
268,
13,
1678,
3142,
353,
2791,
29918,
11177,
29898,
2271,
29897,
13,
308,
13,
1678,
736,
3402,
29918,
1420,
877,
29966,
2492,
770,
10724,
5038,
2920,
10724,
5038,
3171,
10724,
5038,
4765,
10724,
5038,
2900,
742,
5997,
29918,
1990,
29892,
2159,
29892,
2159,
29892,
3142,
29897,
13,
13,
2
] |
PyFlow/Packages/DepthAI_Device/Nodes/ModelZoo/PedestrianDetectionAdas2Node.py | AsherVo/depthai-gui | 46 | 198851 | from pathlib import Path
from PyFlow.Core.Common import *
from PyFlow.Core.NodeBase import NodePinsSuggestionsHelper
from common import DeviceNode
class PedestrianDetectionAdas2Node(DeviceNode):
def __init__(self, name):
super(PedestrianDetectionAdas2Node, self).__init__(name)
self.frame = self.createInputPin('frame', 'FramePin')
self.out_tensor = self.createOutputPin('out_tensor', 'NeuralTensorPin')
self.frame.enableOptions(PinOptions.AllowMultipleConnections)
self.out_tensor.enableOptions(PinOptions.AllowMultipleConnections)
@staticmethod
def pinTypeHints():
helper = NodePinsSuggestionsHelper()
helper.addInputDataType('FramePin')
helper.addOutputDataType('NeuralTensorPin')
helper.addInputStruct(StructureType.Multi)
helper.addOutputStruct(StructureType.Multi)
return helper
@staticmethod
def category():
return 'Model Zoo'
@staticmethod
def keywords():
return []
@staticmethod
def description():
return "Description in rst format."
def build_pipeline(self, pipeline):
detection_nn = pipeline.createNeuralNetwork()
detection_nn.setBlobPath(str(Path(str((Path(__file__).parent / Path('models/pedestrian-detection-adas-0002.blob')).resolve().absolute())).resolve().absolute()))
self.connection_map["out_tensor"] = detection_nn.out
self.connection_map["frame"] = detection_nn.input
| [
1,
515,
2224,
1982,
1053,
10802,
13,
13,
3166,
10772,
17907,
29889,
9203,
29889,
18877,
1053,
334,
13,
3166,
10772,
17907,
29889,
9203,
29889,
4247,
5160,
1053,
9071,
29925,
1144,
29903,
12981,
2297,
10739,
13,
3166,
3619,
1053,
21830,
4247,
13,
13,
13,
1990,
9293,
342,
6392,
29928,
2650,
428,
3253,
294,
29906,
4247,
29898,
11501,
4247,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
1125,
13,
4706,
2428,
29898,
29925,
287,
342,
6392,
29928,
2650,
428,
3253,
294,
29906,
4247,
29892,
1583,
467,
1649,
2344,
12035,
978,
29897,
13,
4706,
1583,
29889,
2557,
353,
1583,
29889,
3258,
4290,
29925,
262,
877,
2557,
742,
525,
4308,
29925,
262,
1495,
13,
4706,
1583,
29889,
449,
29918,
20158,
353,
1583,
29889,
3258,
6466,
29925,
262,
877,
449,
29918,
20158,
742,
525,
8139,
3631,
29911,
6073,
29925,
262,
1495,
13,
4706,
1583,
29889,
2557,
29889,
12007,
5856,
29898,
29925,
262,
5856,
29889,
15930,
15329,
552,
20971,
1953,
29897,
13,
4706,
1583,
29889,
449,
29918,
20158,
29889,
12007,
5856,
29898,
29925,
262,
5856,
29889,
15930,
15329,
552,
20971,
1953,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
12534,
1542,
29950,
9466,
7295,
13,
4706,
16876,
353,
9071,
29925,
1144,
29903,
12981,
2297,
10739,
580,
13,
4706,
16876,
29889,
1202,
4290,
1469,
1542,
877,
4308,
29925,
262,
1495,
13,
4706,
16876,
29889,
1202,
6466,
1469,
1542,
877,
8139,
3631,
29911,
6073,
29925,
262,
1495,
13,
4706,
16876,
29889,
1202,
4290,
19560,
29898,
5015,
12425,
1542,
29889,
15329,
29897,
13,
4706,
16876,
29889,
1202,
6466,
19560,
29898,
5015,
12425,
1542,
29889,
15329,
29897,
13,
4706,
736,
16876,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
7663,
7295,
13,
4706,
736,
525,
3195,
796,
3634,
29915,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
29361,
7295,
13,
4706,
736,
5159,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6139,
7295,
13,
4706,
736,
376,
9868,
297,
364,
303,
3402,
1213,
13,
13,
1678,
822,
2048,
29918,
13096,
5570,
29898,
1311,
29892,
16439,
1125,
13,
4706,
15326,
29918,
15755,
353,
16439,
29889,
3258,
8139,
3631,
13724,
580,
13,
4706,
15326,
29918,
15755,
29889,
842,
29933,
2127,
2605,
29898,
710,
29898,
2605,
29898,
710,
3552,
2605,
22168,
1445,
1649,
467,
3560,
847,
10802,
877,
9794,
29914,
9795,
342,
6392,
29899,
29881,
2650,
428,
29899,
3922,
29899,
29900,
29900,
29900,
29906,
29889,
10054,
1495,
467,
17863,
2141,
23552,
3101,
467,
17863,
2141,
23552,
22130,
13,
4706,
1583,
29889,
9965,
29918,
1958,
3366,
449,
29918,
20158,
3108,
353,
15326,
29918,
15755,
29889,
449,
13,
4706,
1583,
29889,
9965,
29918,
1958,
3366,
2557,
3108,
353,
15326,
29918,
15755,
29889,
2080,
13,
2
] |
queries/staff.py | CaladBlogBaal/Victorique | 0 | 187487 | <filename>queries/staff.py
def search_staff():
query = """
query ($id: Int, $search: String, $type: MediaType) {
Media(search: $search, id: $id, type: $type) {
id
idMal
type
title {
romaji
english
}
staff {
edges {
node {
primaryOccupations
siteUrl
image {
large
}
name {
full
}
}
}
}
}
}
"""
return query
| [
1,
529,
9507,
29958,
339,
6358,
29914,
303,
3470,
29889,
2272,
13,
1753,
2740,
29918,
303,
3470,
7295,
13,
1678,
2346,
353,
9995,
13,
4706,
2346,
3255,
333,
29901,
3159,
29892,
395,
4478,
29901,
1714,
29892,
395,
1853,
29901,
8213,
1542,
29897,
426,
13,
3986,
8213,
29898,
4478,
29901,
395,
4478,
29892,
1178,
29901,
395,
333,
29892,
1134,
29901,
395,
1853,
29897,
426,
13,
9651,
1178,
13,
9651,
1178,
22995,
13,
9651,
1134,
13,
9651,
3611,
426,
13,
795,
6017,
1175,
29875,
13,
795,
3033,
1674,
13,
9651,
500,
13,
9651,
13925,
426,
13,
795,
12770,
426,
13,
18884,
2943,
426,
13,
462,
29871,
7601,
22034,
786,
800,
13,
462,
29871,
3268,
5983,
13,
462,
29871,
1967,
426,
13,
462,
1678,
2919,
13,
462,
29871,
500,
13,
462,
29871,
1024,
426,
13,
462,
1678,
2989,
13,
462,
29871,
500,
13,
18884,
500,
13,
795,
500,
13,
9651,
500,
13,
3986,
500,
13,
4706,
500,
13,
1678,
9995,
13,
1678,
736,
2346,
13,
13,
2
] |
src/scenic/core/type_support.py | joel-mb/Scenic | 0 | 139219 | <reponame>joel-mb/Scenic
"""Support for checking Scenic types."""
import sys
import inspect
import numbers
import typing
from scenic.core.distributions import (Distribution, RejectionException, StarredDistribution,
distributionFunction)
from scenic.core.lazy_eval import (DelayedArgument, valueInContext, requiredProperties,
needsLazyEvaluation, toDelayedArgument)
from scenic.core.vectors import Vector
from scenic.core.errors import RuntimeParseError, saveErrorLocation
# Typing and coercion rules:
#
# coercible to a scalar:
# instances of numbers.Real (by calling float())
# coercible to a heading:
# anything coercible to a scalar
# anything with a toHeading() method
# coercible to a Vector:
# tuples/lists of length 2
# anything with a toVector() method
# coercible to an object of type T:
# instances of T
#
# Finally, Distributions are coercible to T iff their valueType is.
## Basic types
class Heading(float):
"""Dummy class used as a target for type coercions to headings."""
pass
def underlyingType(thing):
"""What type this value ultimately evaluates to, if we can tell."""
if isinstance(thing, Distribution):
return thing.valueType
elif isinstance(thing, TypeChecker) and len(thing.types) == 1:
return thing.types[0]
else:
return type(thing)
def isA(thing, ty):
"""Does this evaluate to a member of the given Scenic type?"""
return issubclass(underlyingType(thing), ty)
def unifyingType(opts): # TODO improve?
"""Most specific type unifying the given types."""
types = []
for opt in opts:
if isinstance(opt, StarredDistribution):
ty = underlyingType(opt)
typeargs = typing.get_args(ty)
if typeargs == ():
types.append(ty)
else:
for ty in typeargs:
if ty is not Ellipsis:
types.append(ty)
else:
types.append(underlyingType(opt))
if all(issubclass(ty, numbers.Real) for ty in types):
return float
mro = inspect.getmro(types[0])
for parent in mro:
if all(issubclass(ty, parent) for ty in types):
return parent
raise RuntimeError(f'broken MRO for types {types}')
## Type coercions (for internal use -- see the type checking API below)
def canCoerceType(typeA, typeB):
"""Can values of typeA be coerced into typeB?"""
import scenic.syntax.veneer as veneer # TODO improve
if typing.get_origin(typeA) is typing.Union:
# only raise an error now if none of the possible types will work;
# we'll do more careful checking at runtime
return any(canCoerceType(ty, typeB) for ty in typing.get_args(typeA))
if typeB is float:
return issubclass(typeA, numbers.Real)
elif typeB is Heading:
return canCoerceType(typeA, float) or hasattr(typeA, 'toHeading')
elif typeB is Vector:
return issubclass(typeA, (tuple, list)) or hasattr(typeA, 'toVector')
elif typeB is veneer.Behavior:
return issubclass(typeA, typeB) or typeA in (type, type(None))
else:
return issubclass(typeA, typeB)
def canCoerce(thing, ty):
"""Can this value be coerced into the given type?"""
tt = underlyingType(thing)
if canCoerceType(tt, ty):
return True
elif isinstance(thing, Distribution) and tt is object:
return True # fall back on type-checking at runtime
else:
return False
def coerce(thing, ty, error='wrong type'):
"""Coerce something into the given type."""
assert canCoerce(thing, ty), (thing, ty)
import scenic.syntax.veneer as veneer # TODO improve?
realType = ty
if ty is float:
coercer = coerceToFloat
elif ty is Heading:
coercer = coerceToHeading
ty = numbers.Real
realType = float
elif ty is Vector:
coercer = coerceToVector
elif ty is veneer.Behavior:
coercer = coerceToBehavior
else:
coercer = None
if isinstance(thing, Distribution):
vt = thing.valueType
if typing.get_origin(vt) is typing.Union:
possibleTypes = typing.get_args(vt)
else:
possibleTypes = (vt,)
if all(issubclass(possible, ty) for possible in possibleTypes):
return thing # no coercion necessary
else:
return TypecheckedDistribution(thing, realType, error, coercer=coercer)
elif coercer:
try:
return coercer(thing)
except CoercionFailure as e:
raise RuntimeParseError(f'{error} ({e.args[0]})') from None
else:
return thing
class CoercionFailure(Exception):
pass
def coerceToFloat(thing) -> float:
return float(thing)
def coerceToHeading(thing) -> float:
if hasattr(thing, 'toHeading'):
return thing.toHeading()
return float(thing)
def coerceToVector(thing) -> Vector:
if isinstance(thing, (tuple, list)):
l = len(thing)
if l != 2:
raise CoercionFailure('expected 2D vector, got '
f'{type(thing).__name__} of length {l}')
return Vector(*thing)
else:
return thing.toVector()
def coerceToBehavior(thing):
import scenic.syntax.veneer as veneer # TODO improve
if thing is None or isinstance(thing, veneer.Behavior):
return thing
else:
assert issubclass(thing, veneer.Behavior)
return thing()
class TypecheckedDistribution(Distribution):
def __init__(self, dist, ty, errorMessage, coercer=None):
super().__init__(dist, valueType=ty)
self.dist = dist
self.errorMessage = errorMessage
self.coercer = coercer
self.loc = saveErrorLocation()
def sampleGiven(self, value):
val = value[self.dist]
suffix = None
if self.coercer:
if canCoerceType(type(val), self.valueType):
try:
return self.coercer(val)
except CoercionFailure as e:
suffix = f' ({e.args[0]})'
elif isinstance(val, self.valueType):
return val
if suffix is None:
suffix = f' (expected {self.valueType.__name__}, got {type(val).__name__})'
raise RuntimeParseError(self.errorMessage + suffix, self.loc)
def conditionTo(self, value):
self.dist.conditionTo(value)
def __repr__(self):
return f'TypecheckedDistribution({self.dist}, {self.valueType})'
def coerceToAny(thing, types, error):
"""Coerce something into any of the given types, printing an error if impossible."""
for ty in types:
if canCoerce(thing, ty):
return coerce(thing, ty, error)
from scenic.syntax.veneer import verbosePrint
verbosePrint(f'Failed to coerce {thing} of type {underlyingType(thing)} to {types}',
file=sys.stderr)
raise RuntimeParseError(error)
## Top-level type checking/conversion API
def toTypes(thing, types, typeError='wrong type'):
"""Convert something to any of the given types, printing an error if impossible."""
if needsLazyEvaluation(thing):
# cannot check the type now; create proxy object to check type after evaluation
return TypeChecker(thing, types, typeError)
else:
return coerceToAny(thing, types, typeError)
def toType(thing, ty, typeError='wrong type'):
"""Convert something to a given type, printing an error if impossible."""
return toTypes(thing, (ty,), typeError)
def toScalar(thing, typeError='non-scalar in scalar context'):
"""Convert something to a scalar, printing an error if impossible."""
return toType(thing, float, typeError)
def toHeading(thing, typeError='non-heading in heading context'):
"""Convert something to a heading, printing an error if impossible."""
return toType(thing, Heading, typeError)
def toVector(thing, typeError='non-vector in vector context'):
"""Convert something to a vector, printing an error if impossible."""
return toType(thing, Vector, typeError)
def evaluateRequiringEqualTypes(func, thingA, thingB, typeError='type mismatch'):
"""Evaluate the func, assuming thingA and thingB have the same type.
If func produces a lazy value, it should not have any required properties beyond
those of thingA and thingB."""
if not needsLazyEvaluation(thingA) and not needsLazyEvaluation(thingB):
if underlyingType(thingA) is not underlyingType(thingB):
raise RuntimeParseError(typeError)
return func()
else:
# cannot check the types now; create proxy object to check types after evaluation
return TypeEqualityChecker(func, thingA, thingB, typeError)
## Proxy objects for lazy type checking
class TypeChecker(DelayedArgument):
"""Checks that a given lazy value has one of a given list of types."""
def __init__(self, arg, types, error):
def check(context):
val = arg.evaluateIn(context)
return coerceToAny(val, types, error)
super().__init__(requiredProperties(arg), check)
self.inner = arg
self.types = types
def __str__(self):
return f'TypeChecker({self.inner},{self.types})'
class TypeEqualityChecker(DelayedArgument):
"""Lazily evaluates a function, after checking that two lazy values have the same type."""
def __init__(self, func, checkA, checkB, error):
props = requiredProperties(checkA) | requiredProperties(checkB)
def check(context):
ca = valueInContext(checkA, context)
cb = valueInContext(checkB, context)
if underlyingType(ca) is not underlyingType(cb):
raise RuntimeParseError(error)
return valueInContext(func(), context)
super().__init__(props, check)
self.inner = func
self.checkA = checkA
self.checkB = checkB
def __str__(self):
return f'TypeEqualityChecker({self.inner},{self.checkA},{self.checkB})'
| [
1,
529,
276,
1112,
420,
29958,
2212,
295,
29899,
8337,
29914,
4421,
264,
293,
13,
15945,
29908,
14039,
363,
8454,
2522,
264,
293,
4072,
1213,
15945,
13,
13,
5215,
10876,
13,
5215,
16096,
13,
5215,
3694,
13,
5215,
19229,
13,
13,
3166,
5763,
293,
29889,
3221,
29889,
27691,
29879,
1053,
313,
13398,
3224,
29892,
830,
6929,
2451,
29892,
7828,
1127,
13398,
3224,
29892,
13,
462,
462,
539,
4978,
6678,
29897,
13,
3166,
5763,
293,
29889,
3221,
29889,
433,
1537,
29918,
14513,
1053,
313,
24996,
287,
15730,
29892,
995,
797,
2677,
29892,
3734,
11857,
29892,
13,
462,
462,
259,
4225,
29931,
24683,
29923,
4387,
362,
29892,
304,
24996,
287,
15730,
29897,
13,
3166,
5763,
293,
29889,
3221,
29889,
345,
14359,
1053,
16510,
13,
3166,
5763,
293,
29889,
3221,
29889,
12523,
1053,
24875,
12914,
2392,
29892,
4078,
2392,
6508,
13,
13,
29937,
14213,
292,
322,
1302,
6269,
291,
6865,
29901,
13,
29937,
13,
29937,
1302,
261,
15520,
304,
263,
17336,
29901,
13,
29937,
259,
8871,
310,
3694,
29889,
21713,
313,
1609,
5432,
5785,
3101,
13,
29937,
1302,
261,
15520,
304,
263,
28435,
29901,
13,
29937,
12,
1384,
1918,
1302,
261,
15520,
304,
263,
17336,
13,
29937,
12,
1384,
1918,
411,
263,
304,
5494,
292,
580,
1158,
13,
29937,
1302,
261,
15520,
304,
263,
16510,
29901,
13,
29937,
259,
5291,
2701,
29914,
21513,
310,
3309,
29871,
29906,
13,
29937,
259,
3099,
411,
263,
304,
12877,
580,
1158,
13,
29937,
1302,
261,
15520,
304,
385,
1203,
310,
1134,
323,
29901,
13,
29937,
259,
8871,
310,
323,
13,
29937,
13,
29937,
9788,
29892,
17740,
29879,
526,
1302,
261,
15520,
304,
323,
565,
29888,
1009,
995,
1542,
338,
29889,
13,
13,
2277,
19219,
4072,
13,
13,
1990,
940,
9382,
29898,
7411,
1125,
13,
12,
15945,
29908,
29928,
11770,
770,
1304,
408,
263,
3646,
363,
1134,
1302,
6269,
1080,
304,
2343,
886,
1213,
15945,
13,
12,
3364,
13,
13,
1753,
14407,
1542,
29898,
1918,
1125,
13,
12,
15945,
29908,
5618,
1134,
445,
995,
18973,
6161,
1078,
304,
29892,
565,
591,
508,
2649,
1213,
15945,
13,
12,
361,
338,
8758,
29898,
1918,
29892,
17740,
1125,
13,
12,
12,
2457,
2655,
29889,
1767,
1542,
13,
12,
23681,
338,
8758,
29898,
1918,
29892,
5167,
5596,
261,
29897,
322,
7431,
29898,
1918,
29889,
8768,
29897,
1275,
29871,
29896,
29901,
13,
12,
12,
2457,
2655,
29889,
8768,
29961,
29900,
29962,
13,
12,
2870,
29901,
13,
12,
12,
2457,
1134,
29898,
1918,
29897,
13,
13,
1753,
338,
29909,
29898,
1918,
29892,
7911,
1125,
13,
12,
15945,
29908,
25125,
445,
14707,
304,
263,
4509,
310,
278,
2183,
2522,
264,
293,
1134,
3026,
15945,
13,
12,
2457,
338,
1491,
1990,
29898,
5062,
5890,
1542,
29898,
1918,
511,
7911,
29897,
13,
13,
1753,
443,
9215,
1542,
29898,
25707,
1125,
12,
12,
29937,
14402,
11157,
29973,
13,
12,
15945,
29908,
29924,
520,
2702,
1134,
443,
9215,
278,
2183,
4072,
1213,
15945,
13,
12,
8768,
353,
5159,
13,
12,
1454,
3523,
297,
29111,
29901,
13,
12,
12,
361,
338,
8758,
29898,
3670,
29892,
7828,
1127,
13398,
3224,
1125,
13,
12,
12,
12,
1017,
353,
14407,
1542,
29898,
3670,
29897,
13,
12,
12,
12,
1853,
5085,
353,
19229,
29889,
657,
29918,
5085,
29898,
1017,
29897,
13,
12,
12,
12,
361,
1134,
5085,
1275,
313,
1125,
13,
12,
12,
12,
12,
8768,
29889,
4397,
29898,
1017,
29897,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1454,
7911,
297,
1134,
5085,
29901,
13,
12,
12,
12,
12,
12,
361,
7911,
338,
451,
26656,
567,
275,
29901,
13,
12,
12,
12,
12,
12,
12,
8768,
29889,
4397,
29898,
1017,
29897,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
8768,
29889,
4397,
29898,
5062,
5890,
1542,
29898,
3670,
876,
13,
12,
361,
599,
29898,
790,
431,
1990,
29898,
1017,
29892,
3694,
29889,
21713,
29897,
363,
7911,
297,
4072,
1125,
13,
12,
12,
2457,
5785,
13,
12,
29885,
307,
353,
16096,
29889,
657,
29885,
307,
29898,
8768,
29961,
29900,
2314,
13,
12,
1454,
3847,
297,
286,
307,
29901,
13,
12,
12,
361,
599,
29898,
790,
431,
1990,
29898,
1017,
29892,
3847,
29897,
363,
7911,
297,
4072,
1125,
13,
12,
12,
12,
2457,
3847,
13,
12,
22692,
24875,
2392,
29898,
29888,
29915,
6729,
1717,
341,
1672,
363,
4072,
426,
8768,
29913,
1495,
13,
13,
2277,
5167,
1302,
6269,
1080,
313,
1454,
7463,
671,
1192,
1074,
278,
1134,
8454,
3450,
2400,
29897,
13,
13,
1753,
508,
7967,
261,
346,
1542,
29898,
1853,
29909,
29892,
1134,
29933,
1125,
13,
12,
15945,
29908,
6028,
1819,
310,
1134,
29909,
367,
1302,
261,
1133,
964,
1134,
29933,
3026,
15945,
13,
12,
5215,
5763,
293,
29889,
29562,
29889,
854,
29872,
261,
408,
325,
1600,
261,
12,
29937,
14402,
11157,
13,
12,
361,
19229,
29889,
657,
29918,
12574,
29898,
1853,
29909,
29897,
338,
19229,
29889,
19986,
29901,
13,
12,
12,
29937,
871,
12020,
385,
1059,
1286,
565,
5642,
310,
278,
1950,
4072,
674,
664,
29936,
13,
12,
12,
29937,
591,
29915,
645,
437,
901,
16010,
8454,
472,
10073,
13,
12,
12,
2457,
738,
29898,
3068,
7967,
261,
346,
1542,
29898,
1017,
29892,
1134,
29933,
29897,
363,
7911,
297,
19229,
29889,
657,
29918,
5085,
29898,
1853,
29909,
876,
13,
12,
361,
1134,
29933,
338,
5785,
29901,
13,
12,
12,
2457,
338,
1491,
1990,
29898,
1853,
29909,
29892,
3694,
29889,
21713,
29897,
13,
12,
23681,
1134,
29933,
338,
940,
9382,
29901,
13,
12,
12,
2457,
508,
7967,
261,
346,
1542,
29898,
1853,
29909,
29892,
5785,
29897,
470,
756,
5552,
29898,
1853,
29909,
29892,
525,
517,
5494,
292,
1495,
13,
12,
23681,
1134,
29933,
338,
16510,
29901,
13,
12,
12,
2457,
338,
1491,
1990,
29898,
1853,
29909,
29892,
313,
23583,
29892,
1051,
876,
470,
756,
5552,
29898,
1853,
29909,
29892,
525,
517,
12877,
1495,
13,
12,
23681,
1134,
29933,
338,
325,
1600,
261,
29889,
28100,
29901,
13,
12,
12,
2457,
338,
1491,
1990,
29898,
1853,
29909,
29892,
1134,
29933,
29897,
470,
1134,
29909,
297,
313,
1853,
29892,
1134,
29898,
8516,
876,
13,
12,
2870,
29901,
13,
12,
12,
2457,
338,
1491,
1990,
29898,
1853,
29909,
29892,
1134,
29933,
29897,
13,
13,
1753,
508,
7967,
261,
346,
29898,
1918,
29892,
7911,
1125,
13,
12,
15945,
29908,
6028,
445,
995,
367,
1302,
261,
1133,
964,
278,
2183,
1134,
3026,
15945,
13,
12,
698,
353,
14407,
1542,
29898,
1918,
29897,
13,
12,
361,
508,
7967,
261,
346,
1542,
29898,
698,
29892,
7911,
1125,
13,
12,
12,
2457,
5852,
13,
12,
23681,
338,
8758,
29898,
1918,
29892,
17740,
29897,
322,
260,
29873,
338,
1203,
29901,
13,
12,
12,
2457,
5852,
12,
12,
29937,
6416,
1250,
373,
1134,
29899,
3198,
292,
472,
10073,
13,
12,
2870,
29901,
13,
12,
12,
2457,
7700,
13,
13,
1753,
1302,
261,
346,
29898,
1918,
29892,
7911,
29892,
1059,
2433,
15866,
549,
1134,
29374,
13,
12,
15945,
29908,
7967,
261,
346,
1554,
964,
278,
2183,
1134,
1213,
15945,
13,
12,
9294,
508,
7967,
261,
346,
29898,
1918,
29892,
7911,
511,
313,
1918,
29892,
7911,
29897,
13,
13,
12,
5215,
5763,
293,
29889,
29562,
29889,
854,
29872,
261,
408,
325,
1600,
261,
12,
29937,
14402,
11157,
29973,
13,
12,
6370,
1542,
353,
7911,
13,
12,
361,
7911,
338,
5785,
29901,
13,
12,
12,
1111,
261,
2265,
353,
1302,
261,
346,
1762,
11031,
13,
12,
23681,
7911,
338,
940,
9382,
29901,
13,
12,
12,
1111,
261,
2265,
353,
1302,
261,
346,
1762,
5494,
292,
13,
12,
12,
1017,
353,
3694,
29889,
21713,
13,
12,
12,
6370,
1542,
353,
5785,
13,
12,
23681,
7911,
338,
16510,
29901,
13,
12,
12,
1111,
261,
2265,
353,
1302,
261,
346,
1762,
12877,
13,
12,
23681,
7911,
338,
325,
1600,
261,
29889,
28100,
29901,
13,
12,
12,
1111,
261,
2265,
353,
1302,
261,
346,
1762,
28100,
13,
12,
2870,
29901,
13,
12,
12,
1111,
261,
2265,
353,
6213,
13,
13,
12,
361,
338,
8758,
29898,
1918,
29892,
17740,
1125,
13,
12,
12,
21908,
353,
2655,
29889,
1767,
1542,
13,
12,
12,
361,
19229,
29889,
657,
29918,
12574,
29898,
21908,
29897,
338,
19229,
29889,
19986,
29901,
13,
12,
12,
12,
27338,
10562,
353,
19229,
29889,
657,
29918,
5085,
29898,
21908,
29897,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
27338,
10562,
353,
313,
21908,
29892,
29897,
13,
12,
12,
361,
599,
29898,
790,
431,
1990,
29898,
27338,
29892,
7911,
29897,
363,
1950,
297,
1950,
10562,
1125,
13,
12,
12,
12,
2457,
2655,
29871,
12,
29937,
694,
1302,
6269,
291,
5181,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
2457,
5167,
11238,
13398,
3224,
29898,
1918,
29892,
1855,
1542,
29892,
1059,
29892,
1302,
261,
2265,
29922,
1111,
261,
2265,
29897,
13,
12,
23681,
1302,
261,
2265,
29901,
13,
12,
12,
2202,
29901,
13,
12,
12,
12,
2457,
1302,
261,
2265,
29898,
1918,
29897,
13,
12,
12,
19499,
3189,
6269,
291,
24155,
408,
321,
29901,
13,
12,
12,
12,
22692,
24875,
12914,
2392,
29898,
29888,
29915,
29912,
2704,
29913,
21313,
29872,
29889,
5085,
29961,
29900,
29962,
1800,
1495,
515,
6213,
13,
12,
2870,
29901,
13,
12,
12,
2457,
2655,
13,
13,
1990,
3189,
6269,
291,
24155,
29898,
2451,
1125,
13,
12,
3364,
13,
13,
1753,
1302,
261,
346,
1762,
11031,
29898,
1918,
29897,
1599,
5785,
29901,
13,
12,
2457,
5785,
29898,
1918,
29897,
13,
13,
1753,
1302,
261,
346,
1762,
5494,
292,
29898,
1918,
29897,
1599,
5785,
29901,
13,
12,
361,
756,
5552,
29898,
1918,
29892,
525,
517,
5494,
292,
29374,
13,
12,
12,
2457,
2655,
29889,
517,
5494,
292,
580,
13,
12,
2457,
5785,
29898,
1918,
29897,
13,
13,
1753,
1302,
261,
346,
1762,
12877,
29898,
1918,
29897,
1599,
16510,
29901,
13,
12,
361,
338,
8758,
29898,
1918,
29892,
313,
23583,
29892,
1051,
22164,
13,
12,
12,
29880,
353,
7431,
29898,
1918,
29897,
13,
12,
12,
361,
301,
2804,
29871,
29906,
29901,
13,
12,
12,
12,
22692,
3189,
6269,
291,
24155,
877,
9684,
29871,
29906,
29928,
4608,
29892,
2355,
525,
13,
12,
12,
12,
462,
418,
285,
29915,
29912,
1853,
29898,
1918,
467,
1649,
978,
1649,
29913,
310,
3309,
426,
29880,
29913,
1495,
13,
12,
12,
2457,
16510,
10456,
1918,
29897,
13,
12,
2870,
29901,
13,
12,
12,
2457,
2655,
29889,
517,
12877,
580,
13,
13,
1753,
1302,
261,
346,
1762,
28100,
29898,
1918,
1125,
13,
12,
5215,
5763,
293,
29889,
29562,
29889,
854,
29872,
261,
408,
325,
1600,
261,
12,
29937,
14402,
11157,
13,
12,
361,
2655,
338,
6213,
470,
338,
8758,
29898,
1918,
29892,
325,
1600,
261,
29889,
28100,
1125,
13,
12,
12,
2457,
2655,
13,
12,
2870,
29901,
13,
12,
12,
9294,
338,
1491,
1990,
29898,
1918,
29892,
325,
1600,
261,
29889,
28100,
29897,
13,
12,
12,
2457,
2655,
580,
13,
13,
1990,
5167,
11238,
13398,
3224,
29898,
13398,
3224,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
1320,
29892,
7911,
29892,
1059,
3728,
29892,
1302,
261,
2265,
29922,
8516,
1125,
13,
12,
12,
9136,
2141,
1649,
2344,
12035,
5721,
29892,
995,
1542,
29922,
1017,
29897,
13,
12,
12,
1311,
29889,
5721,
353,
1320,
13,
12,
12,
1311,
29889,
2704,
3728,
353,
1059,
3728,
13,
12,
12,
1311,
29889,
1111,
261,
2265,
353,
1302,
261,
2265,
13,
12,
12,
1311,
29889,
2029,
353,
4078,
2392,
6508,
580,
13,
13,
12,
1753,
4559,
29954,
5428,
29898,
1311,
29892,
995,
1125,
13,
12,
12,
791,
353,
995,
29961,
1311,
29889,
5721,
29962,
13,
12,
12,
2146,
600,
861,
353,
6213,
13,
12,
12,
361,
1583,
29889,
1111,
261,
2265,
29901,
13,
12,
12,
12,
361,
508,
7967,
261,
346,
1542,
29898,
1853,
29898,
791,
511,
1583,
29889,
1767,
1542,
1125,
13,
12,
12,
12,
12,
2202,
29901,
13,
12,
12,
12,
12,
12,
2457,
1583,
29889,
1111,
261,
2265,
29898,
791,
29897,
13,
12,
12,
12,
12,
19499,
3189,
6269,
291,
24155,
408,
321,
29901,
13,
12,
12,
12,
12,
12,
2146,
600,
861,
353,
285,
29915,
21313,
29872,
29889,
5085,
29961,
29900,
29962,
1800,
29915,
13,
12,
12,
23681,
338,
8758,
29898,
791,
29892,
1583,
29889,
1767,
1542,
1125,
13,
12,
12,
12,
2457,
659,
13,
12,
12,
361,
25557,
338,
6213,
29901,
13,
12,
12,
12,
2146,
600,
861,
353,
285,
29915,
313,
9684,
426,
1311,
29889,
1767,
1542,
17255,
978,
1649,
1118,
2355,
426,
1853,
29898,
791,
467,
1649,
978,
1649,
1800,
29915,
13,
12,
12,
22692,
24875,
12914,
2392,
29898,
1311,
29889,
2704,
3728,
718,
25557,
29892,
1583,
29889,
2029,
29897,
13,
13,
12,
1753,
4195,
1762,
29898,
1311,
29892,
995,
1125,
13,
12,
12,
1311,
29889,
5721,
29889,
16122,
1762,
29898,
1767,
29897,
13,
13,
12,
1753,
4770,
276,
558,
12035,
1311,
1125,
13,
12,
12,
2457,
285,
29915,
1542,
11238,
13398,
3224,
3319,
1311,
29889,
5721,
1118,
426,
1311,
29889,
1767,
1542,
1800,
29915,
13,
13,
1753,
1302,
261,
346,
1762,
10773,
29898,
1918,
29892,
4072,
29892,
1059,
1125,
13,
12,
15945,
29908,
7967,
261,
346,
1554,
964,
738,
310,
278,
2183,
4072,
29892,
14010,
385,
1059,
565,
9301,
1213,
15945,
13,
12,
1454,
7911,
297,
4072,
29901,
13,
12,
12,
361,
508,
7967,
261,
346,
29898,
1918,
29892,
7911,
1125,
13,
12,
12,
12,
2457,
1302,
261,
346,
29898,
1918,
29892,
7911,
29892,
1059,
29897,
13,
12,
3166,
5763,
293,
29889,
29562,
29889,
854,
29872,
261,
1053,
26952,
11816,
13,
12,
369,
15828,
11816,
29898,
29888,
29915,
17776,
304,
1302,
261,
346,
426,
1918,
29913,
310,
1134,
426,
5062,
5890,
1542,
29898,
1918,
2915,
304,
426,
8768,
29913,
742,
13,
12,
632,
934,
29922,
9675,
29889,
303,
20405,
29897,
13,
12,
22692,
24875,
12914,
2392,
29898,
2704,
29897,
13,
13,
2277,
7488,
29899,
5563,
1134,
8454,
29914,
535,
3259,
3450,
13,
13,
1753,
304,
10562,
29898,
1918,
29892,
4072,
29892,
1134,
2392,
2433,
15866,
549,
1134,
29374,
13,
12,
15945,
29908,
18455,
1554,
304,
738,
310,
278,
2183,
4072,
29892,
14010,
385,
1059,
565,
9301,
1213,
15945,
13,
12,
361,
4225,
29931,
24683,
29923,
4387,
362,
29898,
1918,
1125,
13,
12,
12,
29937,
2609,
1423,
278,
1134,
1286,
29936,
1653,
10166,
1203,
304,
1423,
1134,
1156,
17983,
13,
12,
12,
2457,
5167,
5596,
261,
29898,
1918,
29892,
4072,
29892,
1134,
2392,
29897,
13,
12,
2870,
29901,
13,
12,
12,
2457,
1302,
261,
346,
1762,
10773,
29898,
1918,
29892,
4072,
29892,
1134,
2392,
29897,
13,
13,
1753,
304,
1542,
29898,
1918,
29892,
7911,
29892,
1134,
2392,
2433,
15866,
549,
1134,
29374,
13,
12,
15945,
29908,
18455,
1554,
304,
263,
2183,
1134,
29892,
14010,
385,
1059,
565,
9301,
1213,
15945,
13,
12,
2457,
304,
10562,
29898,
1918,
29892,
313,
1017,
29892,
511,
1134,
2392,
29897,
13,
13,
1753,
304,
29636,
279,
29898,
1918,
29892,
1134,
2392,
2433,
5464,
29899,
19529,
279,
297,
17336,
3030,
29374,
13,
12,
15945,
29908,
18455,
1554,
304,
263,
17336,
29892,
14010,
385,
1059,
565,
9301,
1213,
15945,
13,
12,
2457,
304,
1542,
29898,
1918,
29892,
5785,
29892,
1134,
2392,
29897,
13,
13,
1753,
304,
5494,
292,
29898,
1918,
29892,
1134,
2392,
2433,
5464,
29899,
2813,
292,
297,
28435,
3030,
29374,
13,
12,
15945,
29908,
18455,
1554,
304,
263,
28435,
29892,
14010,
385,
1059,
565,
9301,
1213,
15945,
13,
12,
2457,
304,
1542,
29898,
1918,
29892,
940,
9382,
29892,
1134,
2392,
29897,
13,
13,
1753,
304,
12877,
29898,
1918,
29892,
1134,
2392,
2433,
5464,
29899,
8111,
297,
4608,
3030,
29374,
13,
12,
15945,
29908,
18455,
1554,
304,
263,
4608,
29892,
14010,
385,
1059,
565,
9301,
1213,
15945,
13,
12,
2457,
304,
1542,
29898,
1918,
29892,
16510,
29892,
1134,
2392,
29897,
13,
13,
1753,
14707,
1123,
339,
8491,
9843,
10562,
29898,
9891,
29892,
2655,
29909,
29892,
2655,
29933,
29892,
1134,
2392,
2433,
1853,
29635,
29374,
13,
12,
15945,
29908,
29923,
4387,
403,
278,
3653,
29892,
10241,
2655,
29909,
322,
2655,
29933,
505,
278,
1021,
1134,
29889,
13,
13,
12,
3644,
3653,
13880,
263,
17366,
995,
29892,
372,
881,
451,
505,
738,
3734,
4426,
8724,
13,
12,
386,
852,
310,
2655,
29909,
322,
2655,
29933,
1213,
15945,
13,
12,
361,
451,
4225,
29931,
24683,
29923,
4387,
362,
29898,
1918,
29909,
29897,
322,
451,
4225,
29931,
24683,
29923,
4387,
362,
29898,
1918,
29933,
1125,
13,
12,
12,
361,
14407,
1542,
29898,
1918,
29909,
29897,
338,
451,
14407,
1542,
29898,
1918,
29933,
1125,
13,
12,
12,
12,
22692,
24875,
12914,
2392,
29898,
1853,
2392,
29897,
13,
12,
12,
2457,
3653,
580,
13,
12,
2870,
29901,
13,
12,
12,
29937,
2609,
1423,
278,
4072,
1286,
29936,
1653,
10166,
1203,
304,
1423,
4072,
1156,
17983,
13,
12,
12,
2457,
5167,
6108,
2877,
5596,
261,
29898,
9891,
29892,
2655,
29909,
29892,
2655,
29933,
29892,
1134,
2392,
29897,
13,
13,
2277,
1019,
3594,
3618,
363,
17366,
1134,
8454,
13,
13,
1990,
5167,
5596,
261,
29898,
24996,
287,
15730,
1125,
13,
12,
15945,
29908,
5596,
29879,
393,
263,
2183,
17366,
995,
756,
697,
310,
263,
2183,
1051,
310,
4072,
1213,
15945,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
1852,
29892,
4072,
29892,
1059,
1125,
13,
12,
12,
1753,
1423,
29898,
4703,
1125,
13,
12,
12,
12,
791,
353,
1852,
29889,
24219,
403,
797,
29898,
4703,
29897,
13,
12,
12,
12,
2457,
1302,
261,
346,
1762,
10773,
29898,
791,
29892,
4072,
29892,
1059,
29897,
13,
12,
12,
9136,
2141,
1649,
2344,
12035,
12403,
11857,
29898,
1191,
511,
1423,
29897,
13,
12,
12,
1311,
29889,
3993,
353,
1852,
13,
12,
12,
1311,
29889,
8768,
353,
4072,
13,
13,
12,
1753,
4770,
710,
12035,
1311,
1125,
13,
12,
12,
2457,
285,
29915,
1542,
5596,
261,
3319,
1311,
29889,
3993,
29087,
1311,
29889,
8768,
1800,
29915,
13,
13,
1990,
5167,
6108,
2877,
5596,
261,
29898,
24996,
287,
15730,
1125,
13,
12,
15945,
29908,
29931,
834,
2354,
6161,
1078,
263,
740,
29892,
1156,
8454,
393,
1023,
17366,
1819,
505,
278,
1021,
1134,
1213,
15945,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
3653,
29892,
1423,
29909,
29892,
1423,
29933,
29892,
1059,
1125,
13,
12,
12,
11030,
353,
3734,
11857,
29898,
3198,
29909,
29897,
891,
3734,
11857,
29898,
3198,
29933,
29897,
13,
12,
12,
1753,
1423,
29898,
4703,
1125,
13,
12,
12,
12,
1113,
353,
995,
797,
2677,
29898,
3198,
29909,
29892,
3030,
29897,
13,
12,
12,
12,
10702,
353,
995,
797,
2677,
29898,
3198,
29933,
29892,
3030,
29897,
13,
12,
12,
12,
361,
14407,
1542,
29898,
1113,
29897,
338,
451,
14407,
1542,
29898,
10702,
1125,
13,
12,
12,
12,
12,
22692,
24875,
12914,
2392,
29898,
2704,
29897,
13,
12,
12,
12,
2457,
995,
797,
2677,
29898,
9891,
3285,
3030,
29897,
13,
12,
12,
9136,
2141,
1649,
2344,
12035,
11030,
29892,
1423,
29897,
13,
12,
12,
1311,
29889,
3993,
353,
3653,
13,
12,
12,
1311,
29889,
3198,
29909,
353,
1423,
29909,
13,
12,
12,
1311,
29889,
3198,
29933,
353,
1423,
29933,
13,
13,
12,
1753,
4770,
710,
12035,
1311,
1125,
13,
12,
12,
2457,
285,
29915,
1542,
6108,
2877,
5596,
261,
3319,
1311,
29889,
3993,
29087,
1311,
29889,
3198,
29909,
29087,
1311,
29889,
3198,
29933,
1800,
29915,
13,
2
] |
tests/pbraiders/database/processor/init/setup/config.py | pbraiders/pomponne-test-bdd | 1 | 170935 | <filename>tests/pbraiders/database/processor/init/setup/config.py<gh_stars>1-10
# coding=utf-8
"""Insert default users in database"""
from pbraiders.database.processor.abstract import AbstractProcessor
class Config(AbstractProcessor):
def execute(self, config: dict):
print('Inserting config')
self._pAdapter.execute(u"delete from `{d}`.`config`;")
self._pAdapter.executemany(
u"insert into `{d}`.`config` (`name`, `value`, `role`) VALUES (%(name)s, %(value)s, %(role)s);",
config)
| [
1,
529,
9507,
29958,
21150,
29914,
29886,
2634,
11376,
29914,
9803,
29914,
26482,
29914,
2344,
29914,
14669,
29914,
2917,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14137,
29922,
9420,
29899,
29947,
13,
15945,
29908,
17491,
2322,
4160,
297,
2566,
15945,
29908,
13,
13,
3166,
282,
2634,
11376,
29889,
9803,
29889,
26482,
29889,
16595,
1053,
25513,
18689,
13,
13,
13,
1990,
12782,
29898,
9118,
18689,
1125,
13,
13,
1678,
822,
6222,
29898,
1311,
29892,
2295,
29901,
9657,
1125,
13,
4706,
1596,
877,
797,
643,
1259,
2295,
1495,
13,
4706,
1583,
3032,
29886,
6168,
29889,
7978,
29898,
29884,
29908,
8143,
515,
23230,
29881,
29913,
27870,
2917,
21966,
1159,
13,
4706,
1583,
3032,
29886,
6168,
29889,
4258,
329,
331,
1384,
29898,
13,
9651,
318,
29908,
7851,
964,
23230,
29881,
29913,
27870,
2917,
29952,
6695,
978,
1673,
421,
1767,
1673,
421,
12154,
6348,
15673,
313,
29995,
29898,
978,
29897,
29879,
29892,
1273,
29898,
1767,
29897,
29879,
29892,
1273,
29898,
12154,
29897,
29879,
416,
613,
13,
9651,
2295,
29897,
13,
2
] |
mp/data/datasets/ds_mr_hippocampus_dryad.py | MECLabTUDA/ACS | 5 | 142075 | # ------------------------------------------------------------------------------
# Hippocampus segmentation published by Dryad
# (https://datadryad.org/stash/dataset/doi:10.5061/dryad.gc72v)
# ------------------------------------------------------------------------------
import os
import SimpleITK as sitk
import mp.data.datasets.dataset_utils as du
from mp.data.datasets.dataset_segmentation import SegmentationDataset, SegmentationInstance
from mp.paths import storage_data_path
from mp.utils.load_restore import join_path
import re
import nibabel as nib
import numpy as np
import re
class DryadHippocampus(SegmentationDataset):
r"""Class for the segmentation of the HarP dataset,
https://datadryad.org/stash/dataset/doi:10.5061/dryad.gc72v.
"""
def __init__(self, subset=None, hold_out_ixs=None, merge_labels=True):
# Modality is either: "T1w" or "T2w"
# Resolution is either: "Standard" or "Hires"
# If you want to use different resolutions or modalities, please create another object with a different subset
default = {"Modality": "T1w", "Resolution": "Standard"}
if subset is not None:
default.update(subset)
subset = default
else:
subset = default
# Hires T2w is not available
assert not (subset["Resolution"] == "Standard" and subset["Modality"] == "T2w"), \
"Hires T2w not available for the Dryad Hippocampus dataset"
if hold_out_ixs is None:
hold_out_ixs = []
global_name = 'DryadHippocampus'
name = du.get_dataset_name(global_name, subset)
dataset_path = os.path.join(storage_data_path,
global_name,
"Merged Labels" if merge_labels else "Original",
"".join([f"{key}[{subset[key]}]" for key in ["Modality", "Resolution"]])
)
original_data_path = du.get_original_data_path(global_name)
# Copy the images if not done already
if not os.path.isdir(dataset_path):
_extract_images(original_data_path, dataset_path, merge_labels, subset)
# Fetch all patient/study names
study_names = set(file_name.split('.nii')[0].split('_gt')[0] for file_name in os.listdir(dataset_path))
# Build instances
instances = []
for study_name in study_names:
instances.append(SegmentationInstance(
x_path=os.path.join(dataset_path, study_name + '.nii.gz'),
y_path=os.path.join(dataset_path, study_name + '_gt.nii.gz'),
name=study_name,
group_id=None
))
if merge_labels:
label_names = ['background', 'hippocampus']
else:
label_names = ['background', 'subiculum', 'CA1-3', 'CA4-DG']
super().__init__(instances, name=name, label_names=label_names,
modality=subset["Modality"] + ' MRI', nr_channels=1, hold_out_ixs=hold_out_ixs)
def _extract_images(source_path, target_path, merge_labels, subset):
r"""Extracts images, merges mask labels (if specified) and saves the
modified images.
"""
def bbox_3D(img):
r = np.any(img, axis=(1, 2))
c = np.any(img, axis=(0, 2))
z = np.any(img, axis=(0, 1))
rmin, rmax = np.where(r)[0][[0, -1]]
cmin, cmax = np.where(c)[0][[0, -1]]
zmin, zmax = np.where(z)[0][[0, -1]]
return rmin, rmax, cmin, cmax, zmin, zmax
# Create directories
os.makedirs(os.path.join(target_path))
# Patient folders s01, s02, ...
for patient_folder in filter(lambda s: re.match(r"^s[0-9]+.*", s), os.listdir(source_path)):
# Loading the image
image_path = os.path.join(source_path, patient_folder,
f"{patient_folder}_{subset['Modality'].lower()}_"
f"{subset['Resolution'].lower()}_defaced_MNI.nii.gz")
x = sitk.ReadImage(image_path)
x = sitk.GetArrayFromImage(x)
# For each MRI, there are 2 segmentation (left and right hippocampus)
for side in ["L", "R"]:
# Loading the label
label_path = os.path.join(source_path, patient_folder,
f"{patient_folder}_hippolabels_"
f"{'hres' if subset['Resolution'] == 'Hires' else 't1w_standard'}"
f"_{side}_MNI.nii.gz")
y = sitk.ReadImage(label_path)
y = sitk.GetArrayFromImage(y)
# We need to recover the study name of the image name to construct the name of the segmentation files
study_name = f"{patient_folder}_{side}"
# Average label shape (T1w, standard): (37.0, 36.3, 26.7)
# Average label shape (T1w, hires): (94.1, 92.1, 68.5)
# Average label shape (T2w, hires): (94.1, 92.1, 68.5)
assert x.shape == y.shape
# Disclaimer: next part is ugly and not many checks are made
# So we first compute the bounding box
rmin, rmax, cmin, cmax, zmin, zmax = bbox_3D(y)
# Compute the start idx for each dim
dr = (rmax - rmin) // 4
dc = (cmax - cmin) // 4
dz = (zmax - zmin) // 4
# Reshaping
y = y[rmin - dr: rmax + dr,
cmin - dc: cmax + dc,
zmin - dz: zmax + dz]
if merge_labels:
y[y > 1] = 1
x_cropped = x[rmin - dr: rmax + dr,
cmin - dc: cmax + dc,
zmin - dz: zmax + dz]
# Save new images so they can be loaded directly
sitk.WriteImage(sitk.GetImageFromArray(y),
join_path([target_path, study_name + "_gt.nii.gz"]))
sitk.WriteImage(sitk.GetImageFromArray(x_cropped),
join_path([target_path, study_name + ".nii.gz"]))
| [
1,
396,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
29937,
6324,
407,
542,
1160,
375,
10768,
362,
6369,
491,
360,
719,
328,
13,
29937,
313,
991,
597,
4130,
328,
719,
328,
29889,
990,
29914,
303,
1161,
29914,
24713,
29914,
1867,
29875,
29901,
29896,
29900,
29889,
29945,
29900,
29953,
29896,
29914,
29881,
719,
328,
29889,
27354,
29955,
29906,
29894,
29897,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
5215,
2897,
13,
13,
5215,
12545,
1806,
29968,
408,
7845,
29895,
13,
13,
5215,
22326,
29889,
1272,
29889,
14538,
1691,
29889,
24713,
29918,
13239,
408,
868,
13,
3166,
22326,
29889,
1272,
29889,
14538,
1691,
29889,
24713,
29918,
28192,
362,
1053,
6667,
358,
362,
16390,
24541,
29892,
6667,
358,
362,
4998,
13,
3166,
22326,
29889,
24772,
1053,
8635,
29918,
1272,
29918,
2084,
13,
3166,
22326,
29889,
13239,
29889,
1359,
29918,
5060,
487,
1053,
5988,
29918,
2084,
13,
5215,
337,
13,
5215,
302,
747,
1107,
408,
302,
747,
13,
5215,
12655,
408,
7442,
13,
5215,
337,
13,
13,
13,
1990,
360,
719,
328,
29950,
8377,
542,
1160,
375,
29898,
17669,
358,
362,
16390,
24541,
1125,
13,
1678,
364,
15945,
29908,
2385,
363,
278,
10768,
362,
310,
278,
3536,
29925,
8783,
29892,
13,
1678,
2045,
597,
4130,
328,
719,
328,
29889,
990,
29914,
303,
1161,
29914,
24713,
29914,
1867,
29875,
29901,
29896,
29900,
29889,
29945,
29900,
29953,
29896,
29914,
29881,
719,
328,
29889,
27354,
29955,
29906,
29894,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11306,
29922,
8516,
29892,
4808,
29918,
449,
29918,
861,
29879,
29922,
8516,
29892,
10366,
29918,
21134,
29922,
5574,
1125,
13,
4706,
396,
3382,
2877,
338,
2845,
29901,
376,
29911,
29896,
29893,
29908,
470,
376,
29911,
29906,
29893,
29908,
13,
4706,
396,
24062,
918,
338,
2845,
29901,
376,
15449,
29908,
470,
376,
29950,
2658,
29908,
13,
4706,
396,
960,
366,
864,
304,
671,
1422,
10104,
29879,
470,
13008,
1907,
29892,
3113,
1653,
1790,
1203,
411,
263,
1422,
11306,
13,
4706,
2322,
353,
8853,
2111,
2877,
1115,
376,
29911,
29896,
29893,
613,
376,
12375,
918,
1115,
376,
15449,
9092,
13,
4706,
565,
11306,
338,
451,
6213,
29901,
13,
9651,
2322,
29889,
5504,
29898,
6484,
29897,
13,
9651,
11306,
353,
2322,
13,
4706,
1683,
29901,
13,
9651,
11306,
353,
2322,
13,
13,
4706,
396,
379,
2658,
323,
29906,
29893,
338,
451,
3625,
13,
4706,
4974,
451,
313,
6484,
3366,
12375,
918,
3108,
1275,
376,
15449,
29908,
322,
11306,
3366,
2111,
2877,
3108,
1275,
376,
29911,
29906,
29893,
4968,
320,
13,
9651,
376,
29950,
2658,
323,
29906,
29893,
451,
3625,
363,
278,
360,
719,
328,
6324,
407,
542,
1160,
375,
8783,
29908,
13,
13,
4706,
565,
4808,
29918,
449,
29918,
861,
29879,
338,
6213,
29901,
13,
9651,
4808,
29918,
449,
29918,
861,
29879,
353,
5159,
13,
13,
4706,
5534,
29918,
978,
353,
525,
29928,
719,
328,
29950,
8377,
542,
1160,
375,
29915,
13,
4706,
1024,
353,
868,
29889,
657,
29918,
24713,
29918,
978,
29898,
10945,
29918,
978,
29892,
11306,
29897,
13,
4706,
8783,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12925,
29918,
1272,
29918,
2084,
29892,
13,
462,
462,
1678,
5534,
29918,
978,
29892,
13,
462,
462,
1678,
376,
15836,
3192,
15796,
29879,
29908,
565,
10366,
29918,
21134,
1683,
376,
26036,
613,
13,
462,
462,
1678,
376,
1642,
7122,
4197,
29888,
29908,
29912,
1989,
4400,
29912,
6484,
29961,
1989,
29962,
6525,
29908,
363,
1820,
297,
6796,
2111,
2877,
613,
376,
12375,
918,
3108,
2314,
13,
462,
462,
1678,
1723,
13,
4706,
2441,
29918,
1272,
29918,
2084,
353,
868,
29889,
657,
29918,
13492,
29918,
1272,
29918,
2084,
29898,
10945,
29918,
978,
29897,
13,
13,
4706,
396,
14187,
278,
4558,
565,
451,
2309,
2307,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
24713,
29918,
2084,
1125,
13,
9651,
903,
21111,
29918,
8346,
29898,
13492,
29918,
1272,
29918,
2084,
29892,
8783,
29918,
2084,
29892,
10366,
29918,
21134,
29892,
11306,
29897,
13,
13,
4706,
396,
383,
3486,
599,
16500,
29914,
18082,
29891,
2983,
13,
4706,
6559,
29918,
7039,
353,
731,
29898,
1445,
29918,
978,
29889,
5451,
12839,
1240,
29875,
29861,
29900,
1822,
5451,
877,
29918,
4141,
29861,
29900,
29962,
363,
934,
29918,
978,
297,
2897,
29889,
1761,
3972,
29898,
24713,
29918,
2084,
876,
13,
13,
4706,
396,
8878,
8871,
13,
4706,
8871,
353,
5159,
13,
4706,
363,
6559,
29918,
978,
297,
6559,
29918,
7039,
29901,
13,
9651,
8871,
29889,
4397,
29898,
17669,
358,
362,
4998,
29898,
13,
18884,
921,
29918,
2084,
29922,
359,
29889,
2084,
29889,
7122,
29898,
24713,
29918,
2084,
29892,
6559,
29918,
978,
718,
15300,
1240,
29875,
29889,
18828,
5477,
13,
18884,
343,
29918,
2084,
29922,
359,
29889,
2084,
29889,
7122,
29898,
24713,
29918,
2084,
29892,
6559,
29918,
978,
718,
22868,
4141,
29889,
1240,
29875,
29889,
18828,
5477,
13,
18884,
1024,
29922,
18082,
29891,
29918,
978,
29892,
13,
18884,
2318,
29918,
333,
29922,
8516,
13,
632,
876,
13,
13,
4706,
565,
10366,
29918,
21134,
29901,
13,
9651,
3858,
29918,
7039,
353,
6024,
7042,
742,
525,
2918,
407,
542,
1160,
375,
2033,
13,
4706,
1683,
29901,
13,
9651,
3858,
29918,
7039,
353,
6024,
7042,
742,
525,
1491,
12906,
398,
742,
525,
5454,
29896,
29899,
29941,
742,
525,
5454,
29946,
29899,
29928,
29954,
2033,
13,
13,
4706,
2428,
2141,
1649,
2344,
12035,
2611,
2925,
29892,
1024,
29922,
978,
29892,
3858,
29918,
7039,
29922,
1643,
29918,
7039,
29892,
13,
462,
308,
878,
2877,
29922,
6484,
3366,
2111,
2877,
3108,
718,
525,
341,
3960,
742,
17114,
29918,
305,
12629,
29922,
29896,
29892,
4808,
29918,
449,
29918,
861,
29879,
29922,
8948,
29918,
449,
29918,
861,
29879,
29897,
13,
13,
13,
1753,
903,
21111,
29918,
8346,
29898,
4993,
29918,
2084,
29892,
3646,
29918,
2084,
29892,
10366,
29918,
21134,
29892,
11306,
1125,
13,
1678,
364,
15945,
29908,
5647,
1461,
29879,
4558,
29892,
2778,
2710,
11105,
11073,
313,
361,
6790,
29897,
322,
27401,
278,
13,
1678,
9120,
4558,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
289,
1884,
29918,
29941,
29928,
29898,
2492,
1125,
13,
4706,
364,
353,
7442,
29889,
1384,
29898,
2492,
29892,
9685,
7607,
29896,
29892,
29871,
29906,
876,
13,
4706,
274,
353,
7442,
29889,
1384,
29898,
2492,
29892,
9685,
7607,
29900,
29892,
29871,
29906,
876,
13,
4706,
503,
353,
7442,
29889,
1384,
29898,
2492,
29892,
9685,
7607,
29900,
29892,
29871,
29896,
876,
13,
13,
4706,
364,
1195,
29892,
364,
3317,
353,
7442,
29889,
3062,
29898,
29878,
9601,
29900,
3816,
29961,
29900,
29892,
448,
29896,
5262,
13,
4706,
274,
1195,
29892,
274,
3317,
353,
7442,
29889,
3062,
29898,
29883,
9601,
29900,
3816,
29961,
29900,
29892,
448,
29896,
5262,
13,
4706,
503,
1195,
29892,
503,
3317,
353,
7442,
29889,
3062,
29898,
29920,
9601,
29900,
3816,
29961,
29900,
29892,
448,
29896,
5262,
13,
13,
4706,
736,
364,
1195,
29892,
364,
3317,
29892,
274,
1195,
29892,
274,
3317,
29892,
503,
1195,
29892,
503,
3317,
13,
13,
1678,
396,
6204,
17525,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
359,
29889,
2084,
29889,
7122,
29898,
5182,
29918,
2084,
876,
13,
13,
1678,
396,
4121,
993,
16495,
269,
29900,
29896,
29892,
269,
29900,
29906,
29892,
2023,
13,
1678,
363,
16500,
29918,
12083,
297,
4175,
29898,
2892,
269,
29901,
337,
29889,
4352,
29898,
29878,
29908,
29985,
29879,
29961,
29900,
29899,
29929,
10062,
5575,
613,
269,
511,
2897,
29889,
1761,
3972,
29898,
4993,
29918,
2084,
22164,
13,
13,
4706,
396,
4309,
9382,
278,
1967,
13,
4706,
1967,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4993,
29918,
2084,
29892,
16500,
29918,
12083,
29892,
13,
462,
462,
29871,
285,
29908,
29912,
5031,
993,
29918,
12083,
3227,
6484,
1839,
2111,
2877,
13359,
13609,
580,
2403,
29908,
13,
462,
462,
29871,
285,
29908,
29912,
6484,
1839,
12375,
918,
13359,
13609,
580,
2403,
1753,
562,
287,
29918,
29924,
12916,
29889,
1240,
29875,
29889,
18828,
1159,
13,
4706,
921,
353,
7845,
29895,
29889,
6359,
2940,
29898,
3027,
29918,
2084,
29897,
13,
4706,
921,
353,
7845,
29895,
29889,
2577,
2588,
4591,
2940,
29898,
29916,
29897,
13,
13,
4706,
396,
1152,
1269,
341,
3960,
29892,
727,
526,
29871,
29906,
10768,
362,
313,
1563,
322,
1492,
7251,
407,
542,
1160,
375,
29897,
13,
4706,
363,
2625,
297,
6796,
29931,
613,
376,
29934,
3108,
29901,
13,
9651,
396,
4309,
9382,
278,
3858,
13,
9651,
3858,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4993,
29918,
2084,
29892,
16500,
29918,
12083,
29892,
13,
462,
462,
418,
285,
29908,
29912,
5031,
993,
29918,
12083,
2403,
2918,
407,
324,
1107,
29879,
27508,
13,
462,
462,
418,
285,
29908,
10998,
29882,
690,
29915,
565,
11306,
1839,
12375,
918,
2033,
1275,
525,
29950,
2658,
29915,
1683,
525,
29873,
29896,
29893,
29918,
15770,
29915,
5038,
13,
462,
462,
418,
285,
29908,
648,
2975,
2403,
29924,
12916,
29889,
1240,
29875,
29889,
18828,
1159,
13,
13,
9651,
343,
353,
7845,
29895,
29889,
6359,
2940,
29898,
1643,
29918,
2084,
29897,
13,
9651,
343,
353,
7845,
29895,
29889,
2577,
2588,
4591,
2940,
29898,
29891,
29897,
13,
13,
9651,
396,
1334,
817,
304,
9792,
278,
6559,
1024,
310,
278,
1967,
1024,
304,
3386,
278,
1024,
310,
278,
10768,
362,
2066,
13,
9651,
6559,
29918,
978,
353,
285,
29908,
29912,
5031,
993,
29918,
12083,
3227,
2975,
5038,
13,
13,
9651,
396,
319,
19698,
3858,
8267,
313,
29911,
29896,
29893,
29892,
3918,
1125,
313,
29941,
29955,
29889,
29900,
29892,
29871,
29941,
29953,
29889,
29941,
29892,
29871,
29906,
29953,
29889,
29955,
29897,
13,
9651,
396,
319,
19698,
3858,
8267,
313,
29911,
29896,
29893,
29892,
298,
2658,
1125,
313,
29929,
29946,
29889,
29896,
29892,
29871,
29929,
29906,
29889,
29896,
29892,
29871,
29953,
29947,
29889,
29945,
29897,
13,
9651,
396,
319,
19698,
3858,
8267,
313,
29911,
29906,
29893,
29892,
298,
2658,
1125,
313,
29929,
29946,
29889,
29896,
29892,
29871,
29929,
29906,
29889,
29896,
29892,
29871,
29953,
29947,
29889,
29945,
29897,
13,
9651,
4974,
921,
29889,
12181,
1275,
343,
29889,
12181,
13,
13,
9651,
396,
8565,
433,
4193,
29901,
2446,
760,
338,
22769,
322,
451,
1784,
12747,
526,
1754,
13,
13,
9651,
396,
1105,
591,
937,
10272,
278,
3216,
292,
3800,
13,
9651,
364,
1195,
29892,
364,
3317,
29892,
274,
1195,
29892,
274,
3317,
29892,
503,
1195,
29892,
503,
3317,
353,
289,
1884,
29918,
29941,
29928,
29898,
29891,
29897,
13,
13,
9651,
396,
11796,
29872,
278,
1369,
22645,
363,
1269,
3964,
13,
9651,
4192,
353,
313,
29878,
3317,
448,
364,
1195,
29897,
849,
29871,
29946,
13,
9651,
270,
29883,
353,
313,
29883,
3317,
448,
274,
1195,
29897,
849,
29871,
29946,
13,
9651,
9275,
353,
313,
29920,
3317,
448,
503,
1195,
29897,
849,
29871,
29946,
13,
13,
9651,
396,
2538,
29882,
21430,
13,
9651,
343,
353,
343,
29961,
29878,
1195,
448,
4192,
29901,
364,
3317,
718,
4192,
29892,
13,
18884,
274,
1195,
448,
270,
29883,
29901,
274,
3317,
718,
270,
29883,
29892,
13,
18884,
503,
1195,
448,
9275,
29901,
503,
3317,
718,
9275,
29962,
13,
13,
9651,
565,
10366,
29918,
21134,
29901,
13,
18884,
343,
29961,
29891,
1405,
29871,
29896,
29962,
353,
29871,
29896,
13,
13,
9651,
921,
29918,
24077,
2986,
353,
921,
29961,
29878,
1195,
448,
4192,
29901,
364,
3317,
718,
4192,
29892,
13,
462,
4706,
274,
1195,
448,
270,
29883,
29901,
274,
3317,
718,
270,
29883,
29892,
13,
462,
4706,
503,
1195,
448,
9275,
29901,
503,
3317,
718,
9275,
29962,
13,
13,
9651,
396,
16913,
716,
4558,
577,
896,
508,
367,
7500,
4153,
13,
9651,
7845,
29895,
29889,
6113,
2940,
29898,
29879,
277,
29895,
29889,
2577,
2940,
4591,
2588,
29898,
29891,
511,
13,
462,
9651,
5988,
29918,
2084,
4197,
5182,
29918,
2084,
29892,
6559,
29918,
978,
718,
11119,
4141,
29889,
1240,
29875,
29889,
18828,
3108,
876,
13,
9651,
7845,
29895,
29889,
6113,
2940,
29898,
29879,
277,
29895,
29889,
2577,
2940,
4591,
2588,
29898,
29916,
29918,
24077,
2986,
511,
13,
462,
9651,
5988,
29918,
2084,
4197,
5182,
29918,
2084,
29892,
6559,
29918,
978,
718,
11393,
1240,
29875,
29889,
18828,
3108,
876,
13,
2
] |
example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/H/helion-proton mass ratio.py | kuanpern/jupyterlab-snippets-multimenus | 0 | 152959 | <reponame>kuanpern/jupyterlab-snippets-multimenus
constants.physical_constants["helion-proton mass ratio"] | [
1,
529,
276,
1112,
420,
29958,
2120,
273,
546,
29876,
29914,
29926,
786,
25547,
8205,
29899,
29879,
1240,
27421,
29899,
4713,
19933,
375,
13,
3075,
1934,
29889,
14017,
936,
29918,
3075,
1934,
3366,
3952,
291,
29899,
771,
880,
4158,
11959,
3108,
2
] |
pubsub/synth.py | dgorelik/google-cloud-python | 0 | 56403 | <filename>pubsub/synth.py
# Copyright 2018 Google LLC
#
# 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.
"""This script is used to synthesize generated parts of this library."""
import re
import textwrap
import synthtool as s
from synthtool import gcp
gapic = gcp.GAPICGenerator()
common = gcp.CommonTemplates()
version = "v1"
# ----------------------------------------------------------------------------
# Generate pubsub GAPIC layer
# ----------------------------------------------------------------------------
library = gapic.py_library(
"pubsub",
version,
config_path="/google/pubsub/artman_pubsub.yaml",
include_protos=True,
)
s.move(
library,
excludes=[
"docs/**/*",
"nox.py",
"README.rst",
"setup.py",
"google/cloud/pubsub_v1/__init__.py",
"google/cloud/pubsub_v1/types.py",
],
)
# Adjust tests to import the clients directly.
s.replace(
"tests/unit/gapic/v1/test_publisher_client_v1.py",
"from google.cloud import pubsub_v1",
"from google.cloud.pubsub_v1.gapic import publisher_client",
)
s.replace(
"tests/unit/gapic/v1/test_publisher_client_v1.py", " pubsub_v1", " publisher_client"
)
s.replace(
"tests/unit/gapic/v1/test_subscriber_client_v1.py",
"from google.cloud import pubsub_v1",
"from google.cloud.pubsub_v1.gapic import subscriber_client",
)
s.replace(
"tests/unit/gapic/v1/test_subscriber_client_v1.py",
" pubsub_v1",
" subscriber_client",
)
# DEFAULT SCOPES are being used. so let's force them in.
s.replace(
"google/cloud/pubsub_v1/gapic/*er_client.py",
"# The name of the interface for this client. This is the key used to",
"""# The scopes needed to make gRPC calls to all of the methods defined in
# this service
_DEFAULT_SCOPES = (
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/pubsub', )
\g<0>""",
)
s.replace(
"google/cloud/pubsub_v1/gapic/publisher_client.py",
"import google.api_core.gapic_v1.method\n",
"\g<0>import google.api_core.path_template\n",
)
# Doc strings are formatted poorly
s.replace(
"google/cloud/pubsub_v1/proto/pubsub_pb2.py",
'DESCRIPTOR = _MESSAGESTORAGEPOLICY,\n\s+__module__.*\n\s+,\n\s+__doc__ = """',
"\g<0>A message storage policy.\n\n\n ",
)
s.replace(
"google/cloud/pubsub_v1/gapic/subscriber_client.py",
"subscription \(str\): The subscription whose backlog .*\n(.*\n)+?"
"\s+Format is .*",
"""subscription (str): The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain: \\
(a) The existing backlog on the subscription. More precisely, this is \\
defined as the messages in the subscription's backlog that are \\
unacknowledged upon the successful completion of the \\
`CreateSnapshot` request; as well as: \\
(b) Any messages published to the subscription's topic following the \\
successful completion of the CreateSnapshot request. \\
Format is ``projects/{project}/subscriptions/{sub}``.""",
)
s.replace(
"google/cloud/pubsub_v1/gapic/publisher_client.py",
"import functools\n",
"import collections\n"
"from copy import deepcopy\n\g<0>"
)
s.replace(
"google/cloud/pubsub_v1/gapic/publisher_client.py",
"import pkg_resources\n",
"\g<0>import six\n"
)
s.replace(
"google/cloud/pubsub_v1/gapic/publisher_client.py",
"class PublisherClient",
"""# TODO: remove conditional import after Python 2 support is dropped
if six.PY3:
from collections.abc import Mapping
else:
from collections import Mapping
def _merge_dict(d1, d2):
# Modifies d1 in-place to take values from d2
# if the nested keys from d2 are present in d1.
# https://stackoverflow.com/a/10704003/4488789
for k, v2 in d2.items():
v1 = d1.get(k) # returns None if v1 has no such key
if v1 is None:
raise Exception("{} is not recognized by client_config".format(k))
if isinstance(v1, Mapping) and isinstance(v2, Mapping):
_merge_dict(v1, v2)
else:
d1[k] = v2
return d1
\n\n\g<0>"""
)
s.replace(
"google/cloud/pubsub_v1/gapic/publisher_client.py",
"client_config \(dict\): DEPRECATED.",
"client_config (dict):"
)
s.replace(
"google/cloud/pubsub_v1/gapic/publisher_client.py",
"# Raise deprecation warnings .*\n.*\n.*\n.*\n.*\n.*\n",
"""default_client_config = deepcopy(publisher_client_config.config)
if client_config is None:
client_config = default_client_config
else:
client_config = _merge_dict(default_client_config, client_config)
"""
)
# document FlowControl settings in Python 3.5+
s.replace(
"google/cloud/pubsub_v1/types.py",
"FlowControl.__new__.__defaults__ = \(.*?\)",
textwrap.dedent("""\
\g<0>
if sys.version_info >= (3, 5):
FlowControl.__doc__ = (
"The settings for controlling the rate at which messages are pulled "
"with an asynchronous subscription."
)
FlowControl.max_bytes.__doc__ = (
"The maximum total size of received - but not yet processed - messages "
"before pausing the message stream."
)
FlowControl.max_messages.__doc__ = (
"The maximum number of received - but not yet processed - messages before "
"pausing the message stream."
)
FlowControl.resume_threshold.__doc__ = (
"The relative threshold of the ``max_bytes`` and ``max_messages`` limits "
"below which to resume the message stream. Must be a positive number not "
"greater than ``1.0``."
)
FlowControl.max_requests.__doc__ = "Currently not in use."
FlowControl.max_request_batch_size.__doc__ = (
"The maximum number of requests scheduled by callbacks to process and "
"dispatch at a time."
)
FlowControl.max_request_batch_latency.__doc__ = (
"The maximum amount of time in seconds to wait for additional request "
"items before processing the next batch of requests."
)
FlowControl.max_lease_duration.__doc__ = (
"The maximum amount of time in seconds to hold a lease on a message "
"before dropping it from the lease management."
)
"""),
flags=re.DOTALL,
)
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = gcp.CommonTemplates().py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)
s.shell.run(["nox", "-s", "blacken"], hide_output=False)
| [
1,
529,
9507,
29958,
5467,
1491,
29914,
19274,
386,
29889,
2272,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
5087,
365,
12182,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
15945,
29908,
4013,
2471,
338,
1304,
304,
14710,
267,
675,
5759,
5633,
310,
445,
3489,
1213,
15945,
13,
13,
5215,
337,
13,
5215,
1426,
6312,
13,
13,
5215,
14710,
10154,
408,
269,
13,
3166,
14710,
10154,
1053,
330,
6814,
13,
13,
29887,
481,
293,
353,
330,
6814,
29889,
29954,
8787,
29907,
21575,
580,
13,
9435,
353,
330,
6814,
29889,
18877,
5776,
9884,
580,
13,
3259,
353,
376,
29894,
29896,
29908,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
5634,
13,
29937,
3251,
403,
2529,
1491,
402,
8787,
29907,
7546,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
5634,
13,
5258,
353,
17261,
293,
29889,
2272,
29918,
5258,
29898,
13,
1678,
376,
5467,
1491,
613,
13,
1678,
1873,
29892,
13,
1678,
2295,
29918,
2084,
13802,
3608,
29914,
5467,
1491,
29914,
442,
1171,
29918,
5467,
1491,
29889,
25162,
613,
13,
1678,
3160,
29918,
771,
29873,
359,
29922,
5574,
29892,
13,
29897,
13,
29879,
29889,
11631,
29898,
13,
1678,
3489,
29892,
13,
1678,
429,
27722,
11759,
13,
4706,
376,
2640,
7918,
5515,
613,
13,
4706,
376,
1217,
29916,
29889,
2272,
613,
13,
4706,
376,
16310,
2303,
29889,
29878,
303,
613,
13,
4706,
376,
14669,
29889,
2272,
613,
13,
4706,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
1649,
2344,
26914,
2272,
613,
13,
4706,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
8768,
29889,
2272,
613,
13,
1678,
21251,
13,
29897,
13,
13,
29937,
2087,
5143,
6987,
304,
1053,
278,
13154,
4153,
29889,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
21150,
29914,
5441,
29914,
29887,
481,
293,
29914,
29894,
29896,
29914,
1688,
29918,
23679,
261,
29918,
4645,
29918,
29894,
29896,
29889,
2272,
613,
13,
1678,
376,
3166,
5386,
29889,
9274,
1053,
2529,
1491,
29918,
29894,
29896,
613,
13,
1678,
376,
3166,
5386,
29889,
9274,
29889,
5467,
1491,
29918,
29894,
29896,
29889,
29887,
481,
293,
1053,
9805,
261,
29918,
4645,
613,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
21150,
29914,
5441,
29914,
29887,
481,
293,
29914,
29894,
29896,
29914,
1688,
29918,
23679,
261,
29918,
4645,
29918,
29894,
29896,
29889,
2272,
613,
376,
2529,
1491,
29918,
29894,
29896,
613,
376,
9805,
261,
29918,
4645,
29908,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
21150,
29914,
5441,
29914,
29887,
481,
293,
29914,
29894,
29896,
29914,
1688,
29918,
1491,
7588,
495,
29918,
4645,
29918,
29894,
29896,
29889,
2272,
613,
13,
1678,
376,
3166,
5386,
29889,
9274,
1053,
2529,
1491,
29918,
29894,
29896,
613,
13,
1678,
376,
3166,
5386,
29889,
9274,
29889,
5467,
1491,
29918,
29894,
29896,
29889,
29887,
481,
293,
1053,
21696,
495,
29918,
4645,
613,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
21150,
29914,
5441,
29914,
29887,
481,
293,
29914,
29894,
29896,
29914,
1688,
29918,
1491,
7588,
495,
29918,
4645,
29918,
29894,
29896,
29889,
2272,
613,
13,
1678,
376,
2529,
1491,
29918,
29894,
29896,
613,
13,
1678,
376,
21696,
495,
29918,
4645,
613,
13,
29897,
13,
13,
29937,
22236,
317,
3217,
29925,
2890,
526,
1641,
1304,
29889,
577,
1235,
29915,
29879,
4889,
963,
297,
29889,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
5515,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
12305,
450,
1024,
310,
278,
5067,
363,
445,
3132,
29889,
910,
338,
278,
1820,
1304,
304,
613,
13,
1678,
9995,
29937,
450,
16505,
267,
4312,
304,
1207,
330,
29934,
9026,
5717,
304,
599,
310,
278,
3519,
3342,
297,
13,
1678,
396,
445,
2669,
13,
1678,
903,
23397,
29918,
29903,
3217,
29925,
2890,
353,
313,
13,
4706,
525,
991,
597,
1636,
29889,
15947,
29889,
510,
29914,
5150,
29914,
9274,
29899,
12120,
742,
13,
4706,
525,
991,
597,
1636,
29889,
15947,
29889,
510,
29914,
5150,
29914,
5467,
1491,
742,
1723,
13,
13,
1678,
320,
29887,
29966,
29900,
11903,
29908,
613,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
23679,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
376,
5215,
5386,
29889,
2754,
29918,
3221,
29889,
29887,
481,
293,
29918,
29894,
29896,
29889,
5696,
29905,
29876,
613,
13,
1678,
6634,
29887,
29966,
29900,
29958,
5215,
5386,
29889,
2754,
29918,
3221,
29889,
2084,
29918,
6886,
29905,
29876,
613,
13,
29897,
13,
13,
29937,
28197,
6031,
526,
20917,
6460,
368,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
17529,
29914,
5467,
1491,
29918,
24381,
29906,
29889,
2272,
613,
13,
1678,
525,
2287,
7187,
24290,
1955,
353,
903,
2303,
1799,
10461,
1254,
1955,
10461,
29925,
5607,
2965,
29979,
2053,
29876,
29905,
29879,
29974,
1649,
5453,
1649,
5575,
29905,
29876,
29905,
29879,
29974,
2053,
29876,
29905,
29879,
29974,
1649,
1514,
1649,
353,
9995,
742,
13,
1678,
6634,
29887,
29966,
29900,
29958,
29909,
2643,
8635,
8898,
7790,
29876,
29905,
29876,
29905,
29876,
1678,
9162,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
1491,
7588,
495,
29918,
4645,
29889,
2272,
613,
13,
1678,
376,
1491,
22371,
4269,
710,
29905,
1125,
450,
25691,
5069,
1250,
1188,
869,
17710,
29876,
28104,
29905,
29876,
7240,
3026,
13,
1678,
6634,
29879,
29974,
5809,
338,
869,
29930,
613,
13,
1678,
9995,
1491,
22371,
313,
710,
1125,
450,
25691,
5069,
1250,
1188,
278,
22395,
11551,
29879,
29889,
13,
18884,
26321,
29892,
278,
2825,
22395,
338,
22688,
304,
11551,
29901,
2474,
13,
462,
313,
29874,
29897,
450,
5923,
1250,
1188,
373,
278,
25691,
29889,
5853,
17503,
29892,
445,
338,
2474,
13,
462,
268,
3342,
408,
278,
7191,
297,
278,
25691,
29915,
29879,
1250,
1188,
393,
526,
2474,
13,
462,
268,
443,
547,
3707,
839,
3192,
2501,
278,
9150,
13285,
310,
278,
2474,
13,
462,
268,
421,
4391,
21913,
29952,
2009,
29936,
408,
1532,
408,
29901,
2474,
13,
462,
313,
29890,
29897,
3139,
7191,
6369,
304,
278,
25691,
29915,
29879,
11261,
1494,
278,
2474,
13,
462,
268,
9150,
13285,
310,
278,
6204,
21913,
2009,
29889,
2474,
13,
13,
18884,
19191,
338,
4954,
16418,
19248,
4836,
6822,
1491,
7588,
1980,
19248,
1491,
10114,
29952,
1213,
29908,
613,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
23679,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
376,
5215,
2090,
312,
8789,
29905,
29876,
613,
13,
1678,
376,
5215,
16250,
29905,
29876,
29908,
13,
1678,
376,
3166,
3509,
1053,
6483,
8552,
29905,
29876,
29905,
29887,
29966,
29900,
11903,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
23679,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
376,
5215,
282,
9415,
29918,
13237,
29905,
29876,
613,
13,
1678,
6634,
29887,
29966,
29900,
29958,
5215,
4832,
29905,
29876,
29908,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
23679,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
376,
1990,
12904,
261,
4032,
613,
13,
1678,
9995,
29937,
14402,
29901,
3349,
15047,
1053,
1156,
5132,
29871,
29906,
2304,
338,
13700,
13,
361,
4832,
29889,
20055,
29941,
29901,
13,
1678,
515,
16250,
29889,
10736,
1053,
341,
20304,
13,
2870,
29901,
13,
1678,
515,
16250,
1053,
341,
20304,
13,
268,
13,
13,
1753,
903,
14634,
29918,
8977,
29898,
29881,
29896,
29892,
270,
29906,
1125,
13,
1678,
396,
3382,
11057,
270,
29896,
297,
29899,
6689,
304,
2125,
1819,
515,
270,
29906,
13,
1678,
396,
565,
278,
9322,
6611,
515,
270,
29906,
526,
2198,
297,
270,
29896,
29889,
13,
1678,
396,
2045,
597,
2417,
29889,
510,
29914,
29874,
29914,
29896,
29900,
29955,
29900,
29946,
29900,
29900,
29941,
29914,
29946,
29946,
29947,
29947,
29955,
29947,
29929,
13,
1678,
363,
413,
29892,
325,
29906,
297,
270,
29906,
29889,
7076,
7295,
13,
4706,
325,
29896,
353,
270,
29896,
29889,
657,
29898,
29895,
29897,
396,
3639,
6213,
565,
325,
29896,
756,
694,
1316,
1820,
13,
4706,
565,
325,
29896,
338,
6213,
29901,
13,
9651,
12020,
8960,
703,
8875,
338,
451,
14831,
491,
3132,
29918,
2917,
1642,
4830,
29898,
29895,
876,
13,
4706,
565,
338,
8758,
29898,
29894,
29896,
29892,
341,
20304,
29897,
322,
338,
8758,
29898,
29894,
29906,
29892,
341,
20304,
1125,
13,
9651,
903,
14634,
29918,
8977,
29898,
29894,
29896,
29892,
325,
29906,
29897,
13,
4706,
1683,
29901,
13,
9651,
270,
29896,
29961,
29895,
29962,
353,
325,
29906,
13,
1678,
736,
270,
29896,
13,
1678,
320,
29876,
29905,
29876,
29905,
29887,
29966,
29900,
11903,
15945,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
23679,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
376,
4645,
29918,
2917,
4269,
8977,
29905,
1125,
5012,
15094,
29907,
3040,
29928,
19602,
13,
1678,
376,
4645,
29918,
2917,
313,
8977,
1125,
29908,
13,
29897,
13,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
29887,
481,
293,
29914,
23679,
261,
29918,
4645,
29889,
2272,
613,
13,
1678,
12305,
6981,
895,
16460,
362,
18116,
869,
17710,
29876,
5575,
29905,
29876,
5575,
29905,
29876,
5575,
29905,
29876,
5575,
29905,
29876,
5575,
29905,
29876,
613,
13,
1678,
9995,
4381,
29918,
4645,
29918,
2917,
353,
6483,
8552,
29898,
23679,
261,
29918,
4645,
29918,
2917,
29889,
2917,
29897,
13,
13,
4706,
565,
3132,
29918,
2917,
338,
6213,
29901,
13,
9651,
3132,
29918,
2917,
353,
2322,
29918,
4645,
29918,
2917,
13,
4706,
1683,
29901,
13,
9651,
3132,
29918,
2917,
353,
903,
14634,
29918,
8977,
29898,
4381,
29918,
4645,
29918,
2917,
29892,
3132,
29918,
2917,
29897,
13,
1678,
9995,
13,
29897,
13,
13,
29937,
1842,
22787,
4809,
6055,
297,
5132,
29871,
29941,
29889,
29945,
29974,
13,
29879,
29889,
6506,
29898,
13,
1678,
376,
3608,
29914,
9274,
29914,
5467,
1491,
29918,
29894,
29896,
29914,
8768,
29889,
2272,
613,
13,
1678,
376,
17907,
4809,
17255,
1482,
1649,
17255,
4381,
29879,
1649,
353,
4269,
5575,
29973,
7244,
613,
13,
1678,
1426,
6312,
29889,
7176,
296,
703,
15945,
29905,
13,
1678,
320,
29887,
29966,
29900,
29958,
13,
13,
1678,
565,
10876,
29889,
3259,
29918,
3888,
6736,
313,
29941,
29892,
29871,
29945,
1125,
13,
4706,
22787,
4809,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
6055,
363,
640,
22155,
278,
6554,
472,
607,
7191,
526,
20043,
376,
13,
9651,
376,
2541,
385,
20489,
25691,
1213,
13,
4706,
1723,
13,
4706,
22787,
4809,
29889,
3317,
29918,
13193,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
7472,
3001,
2159,
310,
4520,
448,
541,
451,
3447,
19356,
448,
7191,
376,
13,
9651,
376,
11083,
282,
1485,
292,
278,
2643,
4840,
1213,
13,
4706,
1723,
13,
4706,
22787,
4809,
29889,
3317,
29918,
19158,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
7472,
1353,
310,
4520,
448,
541,
451,
3447,
19356,
448,
7191,
1434,
376,
13,
9651,
376,
29886,
1485,
292,
278,
2643,
4840,
1213,
13,
4706,
1723,
13,
4706,
22787,
4809,
29889,
690,
2017,
29918,
386,
12268,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
6198,
16897,
310,
278,
4954,
3317,
29918,
13193,
16159,
322,
4954,
3317,
29918,
19158,
16159,
13071,
376,
13,
9651,
376,
22503,
607,
304,
620,
2017,
278,
2643,
4840,
29889,
19928,
367,
263,
6374,
1353,
451,
376,
13,
9651,
376,
7979,
1008,
1135,
4954,
29896,
29889,
29900,
16159,
1213,
13,
4706,
1723,
13,
4706,
22787,
4809,
29889,
3317,
29918,
24830,
17255,
1514,
1649,
353,
376,
7583,
368,
451,
297,
671,
1213,
13,
4706,
22787,
4809,
29889,
3317,
29918,
3827,
29918,
16175,
29918,
2311,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
7472,
1353,
310,
7274,
21467,
491,
6939,
29879,
304,
1889,
322,
376,
13,
9651,
376,
13369,
472,
263,
931,
1213,
13,
4706,
1723,
13,
4706,
22787,
4809,
29889,
3317,
29918,
3827,
29918,
16175,
29918,
29880,
2579,
1270,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
7472,
5253,
310,
931,
297,
6923,
304,
4480,
363,
5684,
2009,
376,
13,
9651,
376,
7076,
1434,
9068,
278,
2446,
9853,
310,
7274,
1213,
13,
4706,
1723,
13,
4706,
22787,
4809,
29889,
3317,
29918,
1511,
29918,
19708,
17255,
1514,
1649,
353,
313,
13,
9651,
376,
1576,
7472,
5253,
310,
931,
297,
6923,
304,
4808,
263,
454,
559,
373,
263,
2643,
376,
13,
9651,
376,
11083,
4441,
3262,
372,
515,
278,
454,
559,
10643,
1213,
13,
4706,
1723,
13,
1678,
5124,
4968,
13,
1678,
13449,
29922,
276,
29889,
29928,
2891,
9818,
29892,
13,
29897,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
5634,
13,
29937,
3462,
1350,
572,
630,
2066,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1356,
572,
630,
29918,
5325,
353,
330,
6814,
29889,
18877,
5776,
9884,
2141,
2272,
29918,
5258,
29898,
5441,
29918,
24542,
29918,
5563,
29922,
29929,
29955,
29892,
18838,
29918,
5563,
29922,
29896,
29900,
29900,
29897,
13,
29879,
29889,
11631,
29898,
1356,
572,
630,
29918,
5325,
29897,
13,
13,
29879,
29889,
15903,
29889,
3389,
29898,
3366,
1217,
29916,
613,
11663,
29879,
613,
376,
8517,
264,
12436,
9563,
29918,
4905,
29922,
8824,
29897,
13,
2
] |
cyclegan/task_launcher_faceswap.py | dingyanna/DepthNets | 114 | 1607015 | import numpy as np
import torch
import glob
import os
import pickle
import argparse
from torch.utils.data import DataLoader
from torch.utils.data.dataset import (TensorDataset,
ConcatDataset)
from i2i.cyclegan import CycleGAN
from util import (convert_to_rgb,
H5Dataset,
DatasetFromFolder)
from torchvision import transforms
from skimage.io import imsave, imread
from skimage.transform import rescale, resize
from importlib import import_module
def get_face_swap_iterators(bs):
"""DepthNet + GT <-> frontal GT faces"""
filename_vgg = "data/vgg/vgg.h5"
filename_celeba = "data/celeba/celebA.h5"
filename_celeba_swap = "data/celeba_faceswap/celeba_faceswap.h5"
a_train = H5Dataset(filename_celeba_swap, 'imgs', train=True)
vgg_side_train = H5Dataset('%s' % filename_vgg, 'src_GT', train=True)
vgg_frontal_train = H5Dataset('%s' % filename_vgg, 'tg_GT', train=True)
celeba_side_train = H5Dataset('%s' % filename_celeba, 'src_GT', train=True)
celeba_frontal_train = H5Dataset('%s' % filename_celeba, 'tg_GT', train=True)
b_train = ConcatDataset((vgg_side_train,
vgg_frontal_train,
celeba_side_train,
celeba_frontal_train))
a_valid = H5Dataset(filename_celeba_swap, 'imgs', train=False)
vgg_side_valid = H5Dataset('%s' % filename_vgg, 'src_GT', train=False)
vgg_frontal_valid = H5Dataset('%s' % filename_vgg, 'tg_GT', train=False)
celeba_side_valid = H5Dataset('%s' % filename_celeba, 'src_GT', train=False)
celeba_frontal_valid = H5Dataset('%s' % filename_celeba, 'tg_GT', train=False)
b_valid = ConcatDataset((vgg_side_valid,
vgg_frontal_valid,
celeba_side_valid,
celeba_frontal_valid))
loader_train_a = DataLoader(a_train, batch_size=bs, shuffle=True)
loader_train_b = DataLoader(b_train, batch_size=bs, shuffle=True)
loader_valid_a = DataLoader(a_valid, batch_size=bs, shuffle=True)
loader_valid_b = DataLoader(b_valid, batch_size=bs, shuffle=True)
return loader_train_a, loader_train_b, loader_valid_a, loader_valid_b
def image_dump_handler(out_folder, scale_factor=1.):
def _fn(losses, inputs, outputs, kwargs):
if kwargs['iter'] != 1:
return
A_real = inputs[0].data.cpu().numpy()
B_real = inputs[1].data.cpu().numpy()
atob, atob_btoa, btoa, btoa_atob = \
[elem.data.cpu().numpy() for elem in outputs.values()]
outs_np = [A_real, atob, atob_btoa, B_real, btoa, btoa_atob]
# determine # of channels
n_channels = outs_np[0].shape[1]
w, h = outs_np[0].shape[-1], outs_np[0].shape[-2]
# possible that A_real.bs != B_real.bs
bs = np.min([outs_np[0].shape[0], outs_np[3].shape[0]])
grid = np.zeros((h*bs, w*6, 3))
for j in range(bs):
for i in range(6):
n_channels = outs_np[i][j].shape[0]
img_to_write = convert_to_rgb(outs_np[i][j], is_grayscale=False)
grid[j*h:(j+1)*h, i*w:(i+1)*w, :] = img_to_write
imsave(arr=rescale(grid, scale=scale_factor),
fname="%s/%i_%s.png" % (out_folder, kwargs['epoch'], kwargs['mode']))
return _fn
if __name__ == '__main__':
from torchvision.utils import save_image
def parse_args():
parser = argparse.ArgumentParser(description="")
parser.add_argument('--name', type=str,
default="my_experiment")
parser.add_argument('--batch_size', type=int, default=32)
parser.add_argument('--network', type=str, default=None)
parser.add_argument('--mode', choices=['train', 'test', 'vis'],
default='train')
parser.add_argument('--epochs', type=int, default=1000)
parser.add_argument('--loss', type=str, choices=['mse', 'bce'],
default='mse')
parser.add_argument('--lamb', type=float, default=10.0)
parser.add_argument('--beta', type=float, default=0.0)
parser.add_argument('--lr', type=float, default=2e-4)
parser.add_argument('--beta1', type=float, default=0.5)
parser.add_argument('--beta2', type=float, default=0.999)
parser.add_argument('--resume', type=str, default=None)
parser.add_argument('--save_path', type=str,
default='./results')
parser.add_argument('--model_save_path', type=str,
default='./models')
parser.add_argument('--cpu', action='store_true')
args = parser.parse_args()
return args
args = parse_args()
# Dynamically load in the selected generator
# module.
mod = import_module(args.network.replace("/", ".").\
replace(".py", ""))
gen_atob_fn, disc_a_fn, gen_btoa_fn, disc_b_fn = mod.get_network()
print("Loading iterators...")
it_train_a, it_train_b, it_valid_a, it_valid_b = \
get_face_swap_iterators(args.batch_size)
print("Loading CycleGAN...")
name = args.name
net = CycleGAN(
gen_atob_fn=gen_atob_fn,
disc_a_fn=disc_a_fn,
gen_btoa_fn=gen_btoa_fn,
disc_b_fn=disc_b_fn,
loss=args.loss,
lamb=args.lamb,
beta=args.beta,
opt_d_args={'lr': args.lr, 'betas': (args.beta1, args.beta2)},
opt_g_args={'lr': args.lr, 'betas': (args.beta1, args.beta2)},
handlers=[image_dump_handler("%s/%s" % (args.save_path, name))],
use_cuda=False if args.cpu else True
)
if args.resume is not None:
if args.resume == 'auto':
# autoresume
model_dir = "%s/%s" % (args.model_save_path, name)
# List all the pkl files.
files = glob.glob("%s/*.pkl" % model_dir)
# Make them absolute paths.
files = [ os.path.abspath(key) for key in files ]
if len(files) > 0:
# Get creation time and use that.
latest_model = max(files, key=os.path.getctime)
print("Auto-resume mode found latest model: %s" %
latest_model)
net.load(latest_model)
else:
print("Loading model: %s" % args.resume)
net.load(args.resume)
if args.mode == "train":
print("Training...")
net.train(
itr_a_train=it_train_a,
itr_b_train=it_train_b,
itr_a_valid=it_valid_a,
itr_b_valid=it_valid_b,
epochs=args.epochs,
model_dir="%s/%s" % (args.model_save_path, name),
result_dir="%s/%s" % (args.save_path, name)
)
elif args.mode == "vis":
print("Converting A -> B...")
net.g_atob.eval()
aa = iter(it_train_a).next()[0:1]
bb = net.g_atob(aa)
save_image(aa*0.5 + 0.5, "tmp/aa.png")
save_image(bb*0.5 + 0.5, "tmp/bb.png")
elif args.mode == 'test':
print("Dropping into pdb...")
import pdb
pdb.set_trace()
| [
1,
1053,
12655,
408,
7442,
13,
5215,
4842,
305,
13,
5215,
13149,
13,
5215,
2897,
13,
5215,
5839,
280,
13,
5215,
1852,
5510,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
1053,
3630,
10036,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
29889,
24713,
1053,
313,
29911,
6073,
16390,
24541,
29892,
13,
462,
462,
418,
1281,
4117,
16390,
24541,
29897,
13,
3166,
474,
29906,
29875,
29889,
8798,
1397,
273,
1053,
8045,
2841,
29954,
2190,
13,
3166,
3667,
1053,
313,
13441,
29918,
517,
29918,
23973,
29892,
13,
462,
29871,
379,
29945,
16390,
24541,
29892,
13,
462,
29871,
13373,
24541,
4591,
12924,
29897,
13,
3166,
4842,
305,
4924,
1053,
4327,
29879,
13,
3166,
2071,
3027,
29889,
601,
1053,
527,
7620,
29892,
527,
949,
13,
3166,
2071,
3027,
29889,
9067,
1053,
620,
29883,
744,
29892,
19490,
13,
3166,
1053,
1982,
1053,
1053,
29918,
5453,
13,
13,
1753,
679,
29918,
2161,
29918,
26276,
29918,
1524,
4097,
29898,
5824,
1125,
13,
1678,
9995,
8498,
386,
6779,
718,
21342,
529,
976,
4565,
284,
21342,
17240,
15945,
29908,
13,
1678,
10422,
29918,
29894,
1505,
353,
376,
1272,
29914,
29894,
1505,
29914,
29894,
1505,
29889,
29882,
29945,
29908,
13,
1678,
10422,
29918,
346,
280,
2291,
353,
376,
1272,
29914,
346,
280,
2291,
29914,
346,
19982,
29909,
29889,
29882,
29945,
29908,
13,
1678,
10422,
29918,
346,
280,
2291,
29918,
26276,
353,
376,
1272,
29914,
346,
280,
2291,
29918,
8726,
29893,
481,
29914,
346,
280,
2291,
29918,
8726,
29893,
481,
29889,
29882,
29945,
29908,
13,
1678,
263,
29918,
14968,
353,
379,
29945,
16390,
24541,
29898,
9507,
29918,
346,
280,
2291,
29918,
26276,
29892,
525,
2492,
29879,
742,
7945,
29922,
5574,
29897,
13,
1678,
325,
1505,
29918,
2975,
29918,
14968,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
29894,
1505,
29892,
525,
4351,
29918,
23799,
742,
7945,
29922,
5574,
29897,
13,
1678,
325,
1505,
29918,
8862,
284,
29918,
14968,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
29894,
1505,
29892,
525,
29873,
29887,
29918,
23799,
742,
7945,
29922,
5574,
29897,
13,
1678,
7793,
2291,
29918,
2975,
29918,
14968,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
346,
280,
2291,
29892,
525,
4351,
29918,
23799,
742,
7945,
29922,
5574,
29897,
13,
1678,
7793,
2291,
29918,
8862,
284,
29918,
14968,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
346,
280,
2291,
29892,
525,
29873,
29887,
29918,
23799,
742,
7945,
29922,
5574,
29897,
13,
1678,
289,
29918,
14968,
353,
1281,
4117,
16390,
24541,
3552,
29894,
1505,
29918,
2975,
29918,
14968,
29892,
13,
462,
632,
325,
1505,
29918,
8862,
284,
29918,
14968,
29892,
13,
462,
632,
7793,
2291,
29918,
2975,
29918,
14968,
29892,
13,
462,
632,
7793,
2291,
29918,
8862,
284,
29918,
14968,
876,
13,
1678,
263,
29918,
3084,
353,
379,
29945,
16390,
24541,
29898,
9507,
29918,
346,
280,
2291,
29918,
26276,
29892,
525,
2492,
29879,
742,
7945,
29922,
8824,
29897,
13,
1678,
325,
1505,
29918,
2975,
29918,
3084,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
29894,
1505,
29892,
525,
4351,
29918,
23799,
742,
7945,
29922,
8824,
29897,
13,
1678,
325,
1505,
29918,
8862,
284,
29918,
3084,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
29894,
1505,
29892,
525,
29873,
29887,
29918,
23799,
742,
7945,
29922,
8824,
29897,
13,
1678,
7793,
2291,
29918,
2975,
29918,
3084,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
346,
280,
2291,
29892,
525,
4351,
29918,
23799,
742,
7945,
29922,
8824,
29897,
13,
1678,
7793,
2291,
29918,
8862,
284,
29918,
3084,
353,
379,
29945,
16390,
24541,
877,
29995,
29879,
29915,
1273,
10422,
29918,
346,
280,
2291,
29892,
525,
29873,
29887,
29918,
23799,
742,
7945,
29922,
8824,
29897,
13,
1678,
289,
29918,
3084,
353,
1281,
4117,
16390,
24541,
3552,
29894,
1505,
29918,
2975,
29918,
3084,
29892,
13,
462,
632,
325,
1505,
29918,
8862,
284,
29918,
3084,
29892,
13,
462,
632,
7793,
2291,
29918,
2975,
29918,
3084,
29892,
13,
462,
632,
7793,
2291,
29918,
8862,
284,
29918,
3084,
876,
13,
1678,
23466,
29918,
14968,
29918,
29874,
353,
3630,
10036,
29898,
29874,
29918,
14968,
29892,
9853,
29918,
2311,
29922,
5824,
29892,
528,
21897,
29922,
5574,
29897,
13,
1678,
23466,
29918,
14968,
29918,
29890,
353,
3630,
10036,
29898,
29890,
29918,
14968,
29892,
9853,
29918,
2311,
29922,
5824,
29892,
528,
21897,
29922,
5574,
29897,
13,
1678,
23466,
29918,
3084,
29918,
29874,
353,
3630,
10036,
29898,
29874,
29918,
3084,
29892,
9853,
29918,
2311,
29922,
5824,
29892,
528,
21897,
29922,
5574,
29897,
13,
1678,
23466,
29918,
3084,
29918,
29890,
353,
3630,
10036,
29898,
29890,
29918,
3084,
29892,
9853,
29918,
2311,
29922,
5824,
29892,
528,
21897,
29922,
5574,
29897,
13,
1678,
736,
23466,
29918,
14968,
29918,
29874,
29892,
23466,
29918,
14968,
29918,
29890,
29892,
23466,
29918,
3084,
29918,
29874,
29892,
23466,
29918,
3084,
29918,
29890,
13,
13,
1753,
1967,
29918,
15070,
29918,
13789,
29898,
449,
29918,
12083,
29892,
6287,
29918,
19790,
29922,
29896,
9575,
13,
1678,
822,
903,
9144,
29898,
6758,
267,
29892,
10970,
29892,
14391,
29892,
9049,
5085,
1125,
13,
4706,
565,
9049,
5085,
1839,
1524,
2033,
2804,
29871,
29896,
29901,
13,
9651,
736,
13,
4706,
319,
29918,
6370,
353,
10970,
29961,
29900,
1822,
1272,
29889,
21970,
2141,
23749,
580,
13,
4706,
350,
29918,
6370,
353,
10970,
29961,
29896,
1822,
1272,
29889,
21970,
2141,
23749,
580,
13,
4706,
472,
711,
29892,
472,
711,
29918,
29890,
517,
29874,
29892,
289,
517,
29874,
29892,
289,
517,
29874,
29918,
271,
711,
353,
320,
13,
9651,
518,
20461,
29889,
1272,
29889,
21970,
2141,
23749,
580,
363,
21268,
297,
14391,
29889,
5975,
580,
29962,
13,
4706,
714,
29879,
29918,
9302,
353,
518,
29909,
29918,
6370,
29892,
472,
711,
29892,
472,
711,
29918,
29890,
517,
29874,
29892,
350,
29918,
6370,
29892,
289,
517,
29874,
29892,
289,
517,
29874,
29918,
271,
711,
29962,
13,
4706,
396,
8161,
396,
310,
18196,
13,
4706,
302,
29918,
305,
12629,
353,
714,
29879,
29918,
9302,
29961,
29900,
1822,
12181,
29961,
29896,
29962,
13,
4706,
281,
29892,
298,
353,
714,
29879,
29918,
9302,
29961,
29900,
1822,
12181,
14352,
29896,
1402,
714,
29879,
29918,
9302,
29961,
29900,
1822,
12181,
14352,
29906,
29962,
13,
4706,
396,
1950,
393,
319,
29918,
6370,
29889,
5824,
2804,
350,
29918,
6370,
29889,
5824,
13,
4706,
24512,
353,
7442,
29889,
1195,
4197,
17718,
29918,
9302,
29961,
29900,
1822,
12181,
29961,
29900,
1402,
714,
29879,
29918,
9302,
29961,
29941,
1822,
12181,
29961,
29900,
24960,
13,
4706,
6856,
353,
7442,
29889,
3298,
359,
3552,
29882,
29930,
5824,
29892,
281,
29930,
29953,
29892,
29871,
29941,
876,
13,
4706,
363,
432,
297,
3464,
29898,
5824,
1125,
13,
9651,
363,
474,
297,
3464,
29898,
29953,
1125,
13,
18884,
302,
29918,
305,
12629,
353,
714,
29879,
29918,
9302,
29961,
29875,
3816,
29926,
1822,
12181,
29961,
29900,
29962,
13,
18884,
10153,
29918,
517,
29918,
3539,
353,
3588,
29918,
517,
29918,
23973,
29898,
17718,
29918,
9302,
29961,
29875,
3816,
29926,
1402,
338,
29918,
21012,
7052,
29922,
8824,
29897,
13,
18884,
6856,
29961,
29926,
29930,
29882,
5919,
29926,
29974,
29896,
11877,
29882,
29892,
474,
29930,
29893,
5919,
29875,
29974,
29896,
11877,
29893,
29892,
584,
29962,
353,
10153,
29918,
517,
29918,
3539,
13,
4706,
527,
7620,
29898,
2749,
29922,
690,
29883,
744,
29898,
7720,
29892,
6287,
29922,
7052,
29918,
19790,
511,
13,
1669,
285,
978,
543,
29995,
29879,
22584,
29875,
29918,
29995,
29879,
29889,
2732,
29908,
1273,
313,
449,
29918,
12083,
29892,
9049,
5085,
1839,
1022,
2878,
7464,
9049,
5085,
1839,
8513,
25901,
13,
1678,
736,
903,
9144,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
13,
1678,
515,
4842,
305,
4924,
29889,
13239,
1053,
4078,
29918,
3027,
13,
13,
1678,
822,
6088,
29918,
5085,
7295,
13,
4706,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
543,
1159,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
978,
742,
1134,
29922,
710,
29892,
13,
462,
9651,
2322,
543,
1357,
29918,
735,
15362,
1159,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
16175,
29918,
2311,
742,
1134,
29922,
524,
29892,
2322,
29922,
29941,
29906,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
11618,
742,
1134,
29922,
710,
29892,
2322,
29922,
8516,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
8513,
742,
19995,
29922,
1839,
14968,
742,
525,
1688,
742,
525,
1730,
7464,
13,
462,
9651,
2322,
2433,
14968,
1495,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
1022,
2878,
29879,
742,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29900,
29900,
29900,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
6758,
742,
1134,
29922,
710,
29892,
19995,
29922,
1839,
29885,
344,
742,
525,
29890,
346,
7464,
13,
462,
9651,
2322,
2433,
29885,
344,
1495,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
29880,
1117,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29896,
29900,
29889,
29900,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
3571,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29900,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
29212,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29906,
29872,
29899,
29946,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
3571,
29896,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29945,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
3571,
29906,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29929,
29929,
29929,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
690,
2017,
742,
1134,
29922,
710,
29892,
2322,
29922,
8516,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
7620,
29918,
2084,
742,
1134,
29922,
710,
29892,
13,
462,
9651,
2322,
2433,
6904,
9902,
1495,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
4299,
29918,
7620,
29918,
2084,
742,
1134,
29922,
710,
29892,
13,
462,
9651,
2322,
2433,
6904,
9794,
1495,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
21970,
742,
3158,
2433,
8899,
29918,
3009,
1495,
13,
4706,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
4706,
736,
6389,
13,
13,
1678,
6389,
353,
6088,
29918,
5085,
580,
13,
13,
1678,
396,
22554,
1711,
2254,
297,
278,
4629,
15299,
13,
1678,
396,
3883,
29889,
13,
1678,
878,
353,
1053,
29918,
5453,
29898,
5085,
29889,
11618,
29889,
6506,
11974,
613,
376,
1213,
467,
29905,
13,
462,
4706,
5191,
17350,
2272,
613,
5124,
876,
13,
1678,
2531,
29918,
271,
711,
29918,
9144,
29892,
2313,
29918,
29874,
29918,
9144,
29892,
2531,
29918,
29890,
517,
29874,
29918,
9144,
29892,
2313,
29918,
29890,
29918,
9144,
353,
878,
29889,
657,
29918,
11618,
580,
13,
13,
1678,
1596,
703,
23456,
4256,
4097,
856,
1159,
13,
1678,
372,
29918,
14968,
29918,
29874,
29892,
372,
29918,
14968,
29918,
29890,
29892,
372,
29918,
3084,
29918,
29874,
29892,
372,
29918,
3084,
29918,
29890,
353,
320,
13,
4706,
679,
29918,
2161,
29918,
26276,
29918,
1524,
4097,
29898,
5085,
29889,
16175,
29918,
2311,
29897,
13,
13,
1678,
1596,
703,
23456,
8045,
2841,
29954,
2190,
856,
1159,
13,
1678,
1024,
353,
6389,
29889,
978,
13,
1678,
7787,
353,
8045,
2841,
29954,
2190,
29898,
13,
4706,
2531,
29918,
271,
711,
29918,
9144,
29922,
1885,
29918,
271,
711,
29918,
9144,
29892,
13,
4706,
2313,
29918,
29874,
29918,
9144,
29922,
2218,
29883,
29918,
29874,
29918,
9144,
29892,
13,
4706,
2531,
29918,
29890,
517,
29874,
29918,
9144,
29922,
1885,
29918,
29890,
517,
29874,
29918,
9144,
29892,
13,
4706,
2313,
29918,
29890,
29918,
9144,
29922,
2218,
29883,
29918,
29890,
29918,
9144,
29892,
13,
4706,
6410,
29922,
5085,
29889,
6758,
29892,
13,
4706,
301,
1117,
29922,
5085,
29889,
29880,
1117,
29892,
13,
4706,
21762,
29922,
5085,
29889,
3571,
29892,
13,
4706,
3523,
29918,
29881,
29918,
5085,
3790,
29915,
29212,
2396,
6389,
29889,
29212,
29892,
525,
6878,
294,
2396,
313,
5085,
29889,
3571,
29896,
29892,
6389,
29889,
3571,
29906,
19230,
13,
4706,
3523,
29918,
29887,
29918,
5085,
3790,
29915,
29212,
2396,
6389,
29889,
29212,
29892,
525,
6878,
294,
2396,
313,
5085,
29889,
3571,
29896,
29892,
6389,
29889,
3571,
29906,
19230,
13,
4706,
25795,
11759,
3027,
29918,
15070,
29918,
13789,
11702,
29879,
22584,
29879,
29908,
1273,
313,
5085,
29889,
7620,
29918,
2084,
29892,
1024,
876,
1402,
13,
4706,
671,
29918,
29883,
6191,
29922,
8824,
565,
6389,
29889,
21970,
1683,
5852,
13,
1678,
1723,
13,
1678,
565,
6389,
29889,
690,
2017,
338,
451,
6213,
29901,
13,
4706,
565,
6389,
29889,
690,
2017,
1275,
525,
6921,
2396,
13,
9651,
396,
1120,
2361,
2017,
13,
9651,
1904,
29918,
3972,
353,
11860,
29879,
22584,
29879,
29908,
1273,
313,
5085,
29889,
4299,
29918,
7620,
29918,
2084,
29892,
1024,
29897,
13,
9651,
396,
2391,
599,
278,
282,
6321,
2066,
29889,
13,
9651,
2066,
353,
13149,
29889,
23705,
11702,
29879,
5515,
29889,
29886,
6321,
29908,
1273,
1904,
29918,
3972,
29897,
13,
9651,
396,
8561,
963,
8380,
10898,
29889,
13,
9651,
2066,
353,
518,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
1989,
29897,
363,
1820,
297,
2066,
4514,
13,
9651,
565,
7431,
29898,
5325,
29897,
1405,
29871,
29900,
29901,
13,
18884,
396,
3617,
11265,
931,
322,
671,
393,
29889,
13,
18884,
9281,
29918,
4299,
353,
4236,
29898,
5325,
29892,
1820,
29922,
359,
29889,
2084,
29889,
657,
312,
603,
29897,
13,
18884,
1596,
703,
12300,
29899,
690,
2017,
4464,
1476,
9281,
1904,
29901,
1273,
29879,
29908,
1273,
13,
462,
418,
9281,
29918,
4299,
29897,
13,
18884,
7787,
29889,
1359,
29898,
12333,
29918,
4299,
29897,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
23456,
1904,
29901,
1273,
29879,
29908,
1273,
6389,
29889,
690,
2017,
29897,
13,
9651,
7787,
29889,
1359,
29898,
5085,
29889,
690,
2017,
29897,
13,
1678,
565,
6389,
29889,
8513,
1275,
376,
14968,
1115,
13,
4706,
1596,
703,
5323,
2827,
856,
1159,
13,
4706,
7787,
29889,
14968,
29898,
13,
9651,
372,
29878,
29918,
29874,
29918,
14968,
29922,
277,
29918,
14968,
29918,
29874,
29892,
13,
9651,
372,
29878,
29918,
29890,
29918,
14968,
29922,
277,
29918,
14968,
29918,
29890,
29892,
13,
9651,
372,
29878,
29918,
29874,
29918,
3084,
29922,
277,
29918,
3084,
29918,
29874,
29892,
13,
9651,
372,
29878,
29918,
29890,
29918,
3084,
29922,
277,
29918,
3084,
29918,
29890,
29892,
13,
9651,
21502,
12168,
29922,
5085,
29889,
1022,
2878,
29879,
29892,
13,
9651,
1904,
29918,
3972,
543,
29995,
29879,
22584,
29879,
29908,
1273,
313,
5085,
29889,
4299,
29918,
7620,
29918,
2084,
29892,
1024,
511,
13,
9651,
1121,
29918,
3972,
543,
29995,
29879,
22584,
29879,
29908,
1273,
313,
5085,
29889,
7620,
29918,
2084,
29892,
1024,
29897,
13,
4706,
1723,
13,
1678,
25342,
6389,
29889,
8513,
1275,
376,
1730,
1115,
13,
4706,
1596,
703,
1168,
369,
1259,
319,
1599,
350,
856,
1159,
13,
4706,
7787,
29889,
29887,
29918,
271,
711,
29889,
14513,
580,
13,
4706,
29099,
353,
4256,
29898,
277,
29918,
14968,
29918,
29874,
467,
4622,
580,
29961,
29900,
29901,
29896,
29962,
13,
4706,
289,
29890,
353,
7787,
29889,
29887,
29918,
271,
711,
29898,
7340,
29897,
13,
4706,
4078,
29918,
3027,
29898,
7340,
29930,
29900,
29889,
29945,
718,
29871,
29900,
29889,
29945,
29892,
376,
7050,
29914,
7340,
29889,
2732,
1159,
13,
4706,
4078,
29918,
3027,
29898,
1327,
29930,
29900,
29889,
29945,
718,
29871,
29900,
29889,
29945,
29892,
376,
7050,
29914,
1327,
29889,
2732,
1159,
13,
1678,
25342,
6389,
29889,
8513,
1275,
525,
1688,
2396,
13,
4706,
1596,
703,
29928,
307,
3262,
964,
282,
2585,
856,
1159,
13,
4706,
1053,
282,
2585,
13,
4706,
282,
2585,
29889,
842,
29918,
15003,
580,
13,
2
] |
collector_module/opmon_collector/tests/test_database_manager.py | nordic-institute/X-Road-Metrics | 2 | 195503 | #!/usr/bin/env python3
"""
Unit tests for database_manager.py
"""
# The MIT License
# Copyright (c) 2021- Nordic Institute for Interoperability Solutions (NIIS)
# Copyright (c) 2017-2020 Estonian Information System Authority (RIA)
#
# 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.
import pytest
import os
import pathlib
import time
import mongomock
import pymongo
from opmon_collector.database_manager import DatabaseManager
from opmon_collector.settings import OpmonSettingsManager
@pytest.fixture
def basic_settings():
os.chdir(pathlib.Path(__file__).parent.absolute())
return OpmonSettingsManager().settings
@pytest.fixture()
def mock_db_client(mocker):
client = {
'collector_state_DEFAULT': {'server_list': mocker.Mock()},
'query_db_DEFAULT': {'raw_messages': mocker.Mock()}
}
mocker.patch('opmon_collector.database_manager.pymongo.MongoClient', return_value=client)
return client
def test_db_manager_init(basic_settings):
mongo_settings = basic_settings['mongodb']
xroad_instance = basic_settings['xroad']['instance']
d = DatabaseManager(mongo_settings, xroad_instance, 'testlogmanager')
assert d.mongo_uri == \
f"mongodb://{mongo_settings['user']}:{mongo_settings['password']}@{mongo_settings['host']}/auth_db"
assert d.db_name == 'query_db_DEFAULT'
assert d.db_collector_state == 'collector_state_DEFAULT'
assert d.collector_id == 'collector_DEFAULT'
assert d.logger_m == 'testlogmanager'
@mongomock.patch(servers=(('defaultmongodb', 27017),))
def test_save_server_list_to_database(basic_settings, mocker):
mongo_settings = basic_settings['mongodb']
xroad_instance = basic_settings['xroad']['instance']
d = DatabaseManager(mongo_settings, xroad_instance, mocker.Mock())
d.save_server_list_to_database([1, 2, 3])
server_list, timestamp = d.get_server_list_from_database()
assert timestamp == pytest.approx(float(time.time()), abs=1)
assert server_list == [1, 2, 3]
@mongomock.patch(servers=(('defaultmongodb', 27017),))
def test_insert_data_to_raw_messages(basic_settings, mocker):
mongo_settings = basic_settings['mongodb']
xroad_instance = basic_settings['xroad']['instance']
d = DatabaseManager(mongo_settings, xroad_instance, mocker.Mock())
test_data = [{'test': 1}, {'data': 2}]
d.insert_data_to_raw_messages(test_data)
client = pymongo.MongoClient(d.mongo_uri)
items = list(client['query_db_DEFAULT']['raw_messages'].find())
for item in items:
assert item['insertTime'] == pytest.approx(float(time.time()), abs=1)
assert test_data == items
assert test_data is not items
@mongomock.patch(servers=(('defaultmongodb', 27017),))
def test_set_next_records_timestamp(basic_settings, mocker):
mongo_settings = basic_settings['mongodb']
xroad_instance = basic_settings['xroad']['instance']
d = DatabaseManager(mongo_settings, xroad_instance, mocker.Mock())
# Verify that no timestamp is found for server 'test-server' in mock db
collection = pymongo.MongoClient(d.mongo_uri)[d.db_collector_state]['collector_pointer']
document = collection.find_one({'server': 'test-server'})
assert document is None
# Verify that a new timestamp can be added
d.set_next_records_timestamp('test-server', 123)
t = d.get_next_records_timestamp('test-server', 0)
assert t == 123
# Verify that an existing timestamp can be changed
d.set_next_records_timestamp('test-server', 456)
t = d.get_next_records_timestamp('test-server', 0)
assert t == 456
@mongomock.patch(servers=(('defaultmongodb', 27017),))
def test_get_next_records_timestamp_non_existent_key(basic_settings, mocker):
mongo_settings = basic_settings['mongodb']
xroad_instance = basic_settings['xroad']['instance']
d = DatabaseManager(mongo_settings, xroad_instance, mocker.Mock())
t = d.get_next_records_timestamp('newkey', 0)
assert t == pytest.approx(float(time.time()), 1)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
15945,
29908,
13,
8325,
6987,
363,
2566,
29918,
12847,
29889,
2272,
13,
15945,
29908,
13,
29937,
29871,
450,
341,
1806,
19245,
13,
29937,
29871,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
29899,
5245,
293,
8907,
363,
4124,
3372,
3097,
4956,
17925,
313,
29940,
2687,
29903,
29897,
13,
29937,
29871,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29955,
29899,
29906,
29900,
29906,
29900,
2661,
25813,
10343,
2184,
13361,
537,
313,
3960,
29909,
29897,
13,
29937,
13,
29937,
29871,
20894,
2333,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
263,
3509,
13,
29937,
29871,
310,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
376,
6295,
14093,
4968,
304,
5376,
13,
29937,
29871,
297,
278,
18540,
1728,
24345,
29892,
3704,
1728,
29485,
278,
10462,
13,
29937,
29871,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
13,
29937,
29871,
14591,
310,
278,
18540,
29892,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
13,
29937,
29871,
15252,
3276,
304,
437,
577,
29892,
4967,
304,
278,
1494,
5855,
29901,
13,
29937,
13,
29937,
29871,
450,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
5134,
297,
13,
29937,
29871,
599,
14591,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
29937,
13,
29937,
29871,
6093,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
29937,
29871,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
29937,
29871,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
29937,
29871,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
29937,
29871,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
13,
29937,
29871,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
13,
29937,
29871,
6093,
7791,
7818,
12982,
1525,
29889,
13,
13,
5215,
11451,
1688,
13,
5215,
2897,
13,
5215,
2224,
1982,
13,
5215,
931,
13,
5215,
286,
549,
290,
1698,
13,
5215,
282,
962,
7443,
13,
13,
3166,
1015,
3712,
29918,
15914,
272,
29889,
9803,
29918,
12847,
1053,
5470,
3260,
13,
3166,
1015,
3712,
29918,
15914,
272,
29889,
11027,
1053,
438,
3358,
265,
9585,
3260,
13,
13,
13,
29992,
2272,
1688,
29889,
7241,
15546,
13,
1753,
6996,
29918,
11027,
7295,
13,
1678,
2897,
29889,
305,
3972,
29898,
2084,
1982,
29889,
2605,
22168,
1445,
1649,
467,
3560,
29889,
23552,
3101,
13,
1678,
736,
438,
3358,
265,
9585,
3260,
2141,
11027,
13,
13,
13,
29992,
2272,
1688,
29889,
7241,
15546,
580,
13,
1753,
11187,
29918,
2585,
29918,
4645,
29898,
29885,
8658,
1125,
13,
1678,
3132,
353,
426,
13,
4706,
525,
15914,
272,
29918,
3859,
29918,
23397,
2396,
11117,
2974,
29918,
1761,
2396,
286,
8658,
29889,
18680,
580,
1118,
13,
4706,
525,
1972,
29918,
2585,
29918,
23397,
2396,
11117,
1610,
29918,
19158,
2396,
286,
8658,
29889,
18680,
28296,
13,
1678,
500,
13,
13,
1678,
286,
8658,
29889,
5041,
877,
459,
3712,
29918,
15914,
272,
29889,
9803,
29918,
12847,
29889,
29886,
962,
7443,
29889,
29924,
7443,
4032,
742,
736,
29918,
1767,
29922,
4645,
29897,
13,
1678,
736,
3132,
13,
13,
13,
1753,
1243,
29918,
2585,
29918,
12847,
29918,
2344,
29898,
16121,
29918,
11027,
1125,
13,
1678,
19476,
29918,
11027,
353,
6996,
29918,
11027,
1839,
23264,
2033,
13,
1678,
921,
9972,
29918,
8758,
353,
6996,
29918,
11027,
1839,
29916,
9972,
16215,
8758,
2033,
13,
13,
1678,
270,
353,
5470,
3260,
29898,
29885,
7443,
29918,
11027,
29892,
921,
9972,
29918,
8758,
29892,
525,
1688,
1188,
12847,
1495,
13,
1678,
4974,
270,
29889,
29885,
7443,
29918,
5338,
1275,
320,
13,
965,
285,
29908,
23264,
597,
29912,
29885,
7443,
29918,
11027,
1839,
1792,
2033,
6177,
29912,
29885,
7443,
29918,
11027,
1839,
5630,
2033,
29913,
28312,
29885,
7443,
29918,
11027,
1839,
3069,
2033,
6822,
5150,
29918,
2585,
29908,
13,
13,
1678,
4974,
270,
29889,
2585,
29918,
978,
1275,
525,
1972,
29918,
2585,
29918,
23397,
29915,
13,
1678,
4974,
270,
29889,
2585,
29918,
15914,
272,
29918,
3859,
1275,
525,
15914,
272,
29918,
3859,
29918,
23397,
29915,
13,
1678,
4974,
270,
29889,
15914,
272,
29918,
333,
1275,
525,
15914,
272,
29918,
23397,
29915,
13,
1678,
4974,
270,
29889,
21707,
29918,
29885,
1275,
525,
1688,
1188,
12847,
29915,
13,
13,
13,
29992,
29885,
549,
290,
1698,
29889,
5041,
29898,
643,
874,
7607,
877,
4381,
23264,
742,
29871,
29906,
29955,
29900,
29896,
29955,
511,
876,
13,
1753,
1243,
29918,
7620,
29918,
2974,
29918,
1761,
29918,
517,
29918,
9803,
29898,
16121,
29918,
11027,
29892,
286,
8658,
1125,
13,
1678,
19476,
29918,
11027,
353,
6996,
29918,
11027,
1839,
23264,
2033,
13,
1678,
921,
9972,
29918,
8758,
353,
6996,
29918,
11027,
1839,
29916,
9972,
16215,
8758,
2033,
13,
13,
1678,
270,
353,
5470,
3260,
29898,
29885,
7443,
29918,
11027,
29892,
921,
9972,
29918,
8758,
29892,
286,
8658,
29889,
18680,
3101,
13,
1678,
270,
29889,
7620,
29918,
2974,
29918,
1761,
29918,
517,
29918,
9803,
4197,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
2314,
13,
13,
1678,
1923,
29918,
1761,
29892,
14334,
353,
270,
29889,
657,
29918,
2974,
29918,
1761,
29918,
3166,
29918,
9803,
580,
13,
1678,
4974,
14334,
1275,
11451,
1688,
29889,
14850,
29898,
7411,
29898,
2230,
29889,
2230,
25739,
6425,
29922,
29896,
29897,
13,
1678,
4974,
1923,
29918,
1761,
1275,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29962,
13,
13,
13,
29992,
29885,
549,
290,
1698,
29889,
5041,
29898,
643,
874,
7607,
877,
4381,
23264,
742,
29871,
29906,
29955,
29900,
29896,
29955,
511,
876,
13,
1753,
1243,
29918,
7851,
29918,
1272,
29918,
517,
29918,
1610,
29918,
19158,
29898,
16121,
29918,
11027,
29892,
286,
8658,
1125,
13,
1678,
19476,
29918,
11027,
353,
6996,
29918,
11027,
1839,
23264,
2033,
13,
1678,
921,
9972,
29918,
8758,
353,
6996,
29918,
11027,
1839,
29916,
9972,
16215,
8758,
2033,
13,
13,
1678,
270,
353,
5470,
3260,
29898,
29885,
7443,
29918,
11027,
29892,
921,
9972,
29918,
8758,
29892,
286,
8658,
29889,
18680,
3101,
13,
1678,
1243,
29918,
1272,
353,
518,
10998,
1688,
2396,
29871,
29896,
1118,
11117,
1272,
2396,
29871,
29906,
6525,
13,
1678,
270,
29889,
7851,
29918,
1272,
29918,
517,
29918,
1610,
29918,
19158,
29898,
1688,
29918,
1272,
29897,
13,
13,
1678,
3132,
353,
282,
962,
7443,
29889,
29924,
7443,
4032,
29898,
29881,
29889,
29885,
7443,
29918,
5338,
29897,
13,
1678,
4452,
353,
1051,
29898,
4645,
1839,
1972,
29918,
2585,
29918,
23397,
16215,
1610,
29918,
19158,
13359,
2886,
3101,
13,
1678,
363,
2944,
297,
4452,
29901,
13,
4706,
4974,
2944,
1839,
7851,
2481,
2033,
1275,
11451,
1688,
29889,
14850,
29898,
7411,
29898,
2230,
29889,
2230,
25739,
6425,
29922,
29896,
29897,
13,
13,
1678,
4974,
1243,
29918,
1272,
1275,
4452,
13,
1678,
4974,
1243,
29918,
1272,
338,
451,
4452,
13,
13,
13,
29992,
29885,
549,
290,
1698,
29889,
5041,
29898,
643,
874,
7607,
877,
4381,
23264,
742,
29871,
29906,
29955,
29900,
29896,
29955,
511,
876,
13,
1753,
1243,
29918,
842,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
29898,
16121,
29918,
11027,
29892,
286,
8658,
1125,
13,
1678,
19476,
29918,
11027,
353,
6996,
29918,
11027,
1839,
23264,
2033,
13,
1678,
921,
9972,
29918,
8758,
353,
6996,
29918,
11027,
1839,
29916,
9972,
16215,
8758,
2033,
13,
13,
1678,
270,
353,
5470,
3260,
29898,
29885,
7443,
29918,
11027,
29892,
921,
9972,
29918,
8758,
29892,
286,
8658,
29889,
18680,
3101,
13,
13,
1678,
396,
1798,
1598,
393,
694,
14334,
338,
1476,
363,
1923,
525,
1688,
29899,
2974,
29915,
297,
11187,
4833,
13,
1678,
4333,
353,
282,
962,
7443,
29889,
29924,
7443,
4032,
29898,
29881,
29889,
29885,
7443,
29918,
5338,
9601,
29881,
29889,
2585,
29918,
15914,
272,
29918,
3859,
22322,
15914,
272,
29918,
17226,
2033,
13,
1678,
1842,
353,
4333,
29889,
2886,
29918,
650,
3319,
29915,
2974,
2396,
525,
1688,
29899,
2974,
29915,
1800,
13,
1678,
4974,
1842,
338,
6213,
13,
13,
1678,
396,
1798,
1598,
393,
263,
716,
14334,
508,
367,
2715,
13,
1678,
270,
29889,
842,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
877,
1688,
29899,
2974,
742,
29871,
29896,
29906,
29941,
29897,
13,
1678,
260,
353,
270,
29889,
657,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
877,
1688,
29899,
2974,
742,
29871,
29900,
29897,
13,
1678,
4974,
260,
1275,
29871,
29896,
29906,
29941,
13,
13,
1678,
396,
1798,
1598,
393,
385,
5923,
14334,
508,
367,
3939,
13,
1678,
270,
29889,
842,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
877,
1688,
29899,
2974,
742,
29871,
29946,
29945,
29953,
29897,
13,
1678,
260,
353,
270,
29889,
657,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
877,
1688,
29899,
2974,
742,
29871,
29900,
29897,
13,
1678,
4974,
260,
1275,
29871,
29946,
29945,
29953,
13,
13,
13,
29992,
29885,
549,
290,
1698,
29889,
5041,
29898,
643,
874,
7607,
877,
4381,
23264,
742,
29871,
29906,
29955,
29900,
29896,
29955,
511,
876,
13,
1753,
1243,
29918,
657,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
29918,
5464,
29918,
735,
9696,
29918,
1989,
29898,
16121,
29918,
11027,
29892,
286,
8658,
1125,
13,
1678,
19476,
29918,
11027,
353,
6996,
29918,
11027,
1839,
23264,
2033,
13,
1678,
921,
9972,
29918,
8758,
353,
6996,
29918,
11027,
1839,
29916,
9972,
16215,
8758,
2033,
13,
13,
1678,
270,
353,
5470,
3260,
29898,
29885,
7443,
29918,
11027,
29892,
921,
9972,
29918,
8758,
29892,
286,
8658,
29889,
18680,
3101,
13,
13,
1678,
260,
353,
270,
29889,
657,
29918,
4622,
29918,
3757,
4339,
29918,
16394,
877,
1482,
1989,
742,
29871,
29900,
29897,
13,
1678,
4974,
260,
1275,
11451,
1688,
29889,
14850,
29898,
7411,
29898,
2230,
29889,
2230,
25739,
29871,
29896,
29897,
13,
2
] |
demo/Mesh1D_demo.py | bond-anton/BDMesh | 0 | 90300 | import numpy as np
from BDMesh.Mesh1D import Mesh1D
MyMesh = Mesh1D(0.0, 10.0, 0.0, 0.0)
print(MyMesh)
print(MyMesh.physical_boundary_1)
MyMesh.physical_boundary_1 = 2
print(MyMesh.physical_boundary_1)
MyMesh2 = Mesh1D(2.0, 10.0, 0.0, 0.0)
print(MyMesh)
print(MyMesh2)
print(MyMesh == MyMesh2)
print(MyMesh == 2)
print(MyMesh.local_nodes)
MyMesh.local_nodes = np.linspace(0.0, 1.0, num=11, endpoint=True, dtype=np.float64)
print(MyMesh.local_nodes)
print(MyMesh.num)
print(MyMesh.physical_nodes)
| [
1,
1053,
12655,
408,
7442,
13,
3166,
350,
23560,
12094,
29889,
29924,
12094,
29896,
29928,
1053,
341,
12094,
29896,
29928,
13,
13,
13,
3421,
29924,
12094,
353,
341,
12094,
29896,
29928,
29898,
29900,
29889,
29900,
29892,
29871,
29896,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29897,
13,
13,
2158,
29898,
3421,
29924,
12094,
29897,
13,
2158,
29898,
3421,
29924,
12094,
29889,
14017,
936,
29918,
9917,
653,
29918,
29896,
29897,
13,
13,
3421,
29924,
12094,
29889,
14017,
936,
29918,
9917,
653,
29918,
29896,
353,
29871,
29906,
13,
2158,
29898,
3421,
29924,
12094,
29889,
14017,
936,
29918,
9917,
653,
29918,
29896,
29897,
13,
13,
3421,
29924,
12094,
29906,
353,
341,
12094,
29896,
29928,
29898,
29906,
29889,
29900,
29892,
29871,
29896,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29897,
13,
13,
2158,
29898,
3421,
29924,
12094,
29897,
13,
2158,
29898,
3421,
29924,
12094,
29906,
29897,
13,
13,
2158,
29898,
3421,
29924,
12094,
1275,
1619,
29924,
12094,
29906,
29897,
13,
2158,
29898,
3421,
29924,
12094,
1275,
29871,
29906,
29897,
13,
13,
2158,
29898,
3421,
29924,
12094,
29889,
2997,
29918,
18010,
29897,
13,
3421,
29924,
12094,
29889,
2997,
29918,
18010,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29892,
954,
29922,
29896,
29896,
29892,
16248,
29922,
5574,
29892,
26688,
29922,
9302,
29889,
7411,
29953,
29946,
29897,
13,
2158,
29898,
3421,
29924,
12094,
29889,
2997,
29918,
18010,
29897,
13,
2158,
29898,
3421,
29924,
12094,
29889,
1949,
29897,
13,
2158,
29898,
3421,
29924,
12094,
29889,
14017,
936,
29918,
18010,
29897,
13,
2
] |
old_scripts/midi_lights.py | cohnt/midi-piano-lights | 0 | 164456 | import pygame.midi
import board
import neopixel
n_pixels = 177
n_keys = 88.0
pixels = neopixel.NeoPixel(board.D18, n_pixels, brightness=1.0, auto_write=False, pixel_order=neopixel.GRB)
min_key = 21
max_key = 108
def number_to_light(note_number):
led_num = int((note_number - min_key) * (float(n_pixels) / float(n_keys)))
led_num = (int(n_pixels)) - led_num
if led_num >= n_pixels:
return n_pixels
elif led_num < 0:
return 0
else:
return led_num
def number_to_note(number):
notes = ['c', 'c#', 'd', 'd#', 'e', 'f', 'f#', 'g', 'g#', 'a', 'a#', 'b']
return notes[number%12]
def readInput(input_device):
while True:
if input_device.poll():
event = input_device.read(1)[0]
data = event[0]
timestamp = event[1]
note_number = data[1]
velocity = data[2]
if data[0] != 248:
if velocity == 127:
continue
if velocity > 0:
print (note_number, number_to_note(note_number), velocity, "ON")
for i in range(number_to_light(note_number+1), number_to_light(note_number)):
pixels[i] = (255, 0, 0)
pixels.show()
else:
print (note_number, number_to_note(note_number), velocity, "OFF")
for i in range(number_to_light(note_number+1), number_to_light(note_number)):
pixels[i] = (0, 0, 0)
pixels.show()
if __name__ == '__main__':
pygame.midi.init()
my_input = pygame.midi.Input(3) #only in my case the id is 2
readInput(my_input)
| [
1,
1053,
22028,
29889,
6563,
29875,
13,
5215,
7613,
13,
5215,
452,
459,
15711,
13,
13,
29876,
29918,
29886,
861,
1379,
353,
29871,
29896,
29955,
29955,
13,
29876,
29918,
8149,
353,
29871,
29947,
29947,
29889,
29900,
13,
29886,
861,
1379,
353,
452,
459,
15711,
29889,
8139,
29877,
29637,
29898,
3377,
29889,
29928,
29896,
29947,
29892,
302,
29918,
29886,
861,
1379,
29892,
11785,
2264,
29922,
29896,
29889,
29900,
29892,
4469,
29918,
3539,
29922,
8824,
29892,
15526,
29918,
2098,
29922,
484,
459,
15711,
29889,
14345,
29933,
29897,
13,
1195,
29918,
1989,
353,
29871,
29906,
29896,
13,
3317,
29918,
1989,
353,
29871,
29896,
29900,
29947,
13,
13,
1753,
1353,
29918,
517,
29918,
4366,
29898,
6812,
29918,
4537,
1125,
13,
1678,
5331,
29918,
1949,
353,
938,
3552,
6812,
29918,
4537,
448,
1375,
29918,
1989,
29897,
334,
313,
7411,
29898,
29876,
29918,
29886,
861,
1379,
29897,
847,
5785,
29898,
29876,
29918,
8149,
4961,
13,
1678,
5331,
29918,
1949,
353,
313,
524,
29898,
29876,
29918,
29886,
861,
1379,
876,
448,
5331,
29918,
1949,
13,
1678,
565,
5331,
29918,
1949,
6736,
302,
29918,
29886,
861,
1379,
29901,
13,
4706,
736,
302,
29918,
29886,
861,
1379,
13,
1678,
25342,
5331,
29918,
1949,
529,
29871,
29900,
29901,
13,
4706,
736,
29871,
29900,
13,
1678,
1683,
29901,
13,
4706,
736,
5331,
29918,
1949,
13,
13,
1753,
1353,
29918,
517,
29918,
6812,
29898,
4537,
1125,
13,
1678,
11486,
353,
6024,
29883,
742,
525,
29883,
29937,
742,
525,
29881,
742,
525,
29881,
29937,
742,
525,
29872,
742,
525,
29888,
742,
525,
29888,
29937,
742,
525,
29887,
742,
525,
29887,
29937,
742,
525,
29874,
742,
525,
29874,
29937,
742,
525,
29890,
2033,
13,
1678,
736,
11486,
29961,
4537,
29995,
29896,
29906,
29962,
13,
13,
1753,
1303,
4290,
29898,
2080,
29918,
10141,
1125,
13,
1678,
1550,
5852,
29901,
13,
4706,
565,
1881,
29918,
10141,
29889,
29886,
3028,
7295,
13,
9651,
1741,
353,
1881,
29918,
10141,
29889,
949,
29898,
29896,
9601,
29900,
29962,
13,
9651,
848,
353,
1741,
29961,
29900,
29962,
13,
9651,
14334,
353,
1741,
29961,
29896,
29962,
13,
9651,
4443,
29918,
4537,
353,
848,
29961,
29896,
29962,
13,
9651,
12885,
353,
848,
29961,
29906,
29962,
13,
9651,
565,
848,
29961,
29900,
29962,
2804,
29871,
29906,
29946,
29947,
29901,
13,
18884,
565,
12885,
1275,
29871,
29896,
29906,
29955,
29901,
13,
462,
1678,
6773,
13,
18884,
565,
12885,
1405,
29871,
29900,
29901,
13,
462,
1678,
1596,
313,
6812,
29918,
4537,
29892,
1353,
29918,
517,
29918,
6812,
29898,
6812,
29918,
4537,
511,
12885,
29892,
376,
1164,
1159,
13,
462,
1678,
363,
474,
297,
3464,
29898,
4537,
29918,
517,
29918,
4366,
29898,
6812,
29918,
4537,
29974,
29896,
511,
1353,
29918,
517,
29918,
4366,
29898,
6812,
29918,
4537,
22164,
13,
462,
4706,
17036,
29961,
29875,
29962,
353,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
462,
1678,
17036,
29889,
4294,
580,
13,
18884,
1683,
29901,
13,
462,
1678,
1596,
313,
6812,
29918,
4537,
29892,
1353,
29918,
517,
29918,
6812,
29898,
6812,
29918,
4537,
511,
12885,
29892,
376,
27681,
1159,
13,
462,
1678,
363,
474,
297,
3464,
29898,
4537,
29918,
517,
29918,
4366,
29898,
6812,
29918,
4537,
29974,
29896,
511,
1353,
29918,
517,
29918,
4366,
29898,
6812,
29918,
4537,
22164,
13,
462,
4706,
17036,
29961,
29875,
29962,
353,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
462,
1678,
17036,
29889,
4294,
580,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
22028,
29889,
6563,
29875,
29889,
2344,
580,
13,
1678,
590,
29918,
2080,
353,
22028,
29889,
6563,
29875,
29889,
4290,
29898,
29941,
29897,
396,
6194,
297,
590,
1206,
278,
1178,
338,
29871,
29906,
13,
1678,
1303,
4290,
29898,
1357,
29918,
2080,
29897,
13,
2
] |
schevo/test/test_extent_name_override.py | Schevo/schevo | 1 | 92780 | <reponame>Schevo/schevo<filename>schevo/test/test_extent_name_override.py
"""Test for extent name overriding, which is useful for exporting
entity class definitions from a schema."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
from schevo.test import CreatesSchema
class BaseOverride(CreatesSchema):
body = '''
class Base(E.Entity):
name = f.string()
class Base2(E.Base):
_actual_name = "BaseTwo"
class BaseThree(E.BaseTwo):
pass
'''
def test_extents_in_db(self):
expected = ['Base', 'BaseThree', 'BaseTwo']
result = db.extent_names()
assert result == expected
# class TestOverride1(BaseOverride):
# include = True
# format = 1
class TestOverride2(BaseOverride):
include = True
format = 2
| [
1,
529,
276,
1112,
420,
29958,
29903,
1173,
1365,
29914,
5955,
1365,
29966,
9507,
29958,
5955,
1365,
29914,
1688,
29914,
1688,
29918,
1062,
296,
29918,
978,
29918,
15752,
29889,
2272,
13,
15945,
29908,
3057,
363,
15834,
1024,
20831,
292,
29892,
607,
338,
5407,
363,
5609,
292,
13,
10041,
770,
15848,
515,
263,
10938,
1213,
15945,
13,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29900,
29896,
29899,
29906,
29900,
29900,
29929,
8317,
854,
29907,
4154,
9266,
29889,
13,
29937,
2823,
365,
2965,
1430,
1660,
363,
4902,
29889,
13,
13,
3166,
21014,
1365,
29889,
1688,
1053,
6760,
1078,
12763,
13,
13,
13,
1990,
7399,
4640,
29898,
9832,
1078,
12763,
1125,
13,
13,
1678,
3573,
353,
14550,
13,
13,
1678,
770,
7399,
29898,
29923,
29889,
6691,
1125,
13,
4706,
1024,
353,
285,
29889,
1807,
580,
13,
13,
1678,
770,
7399,
29906,
29898,
29923,
29889,
5160,
1125,
13,
4706,
903,
19304,
29918,
978,
353,
376,
5160,
13985,
29908,
13,
13,
1678,
770,
7399,
28575,
29898,
29923,
29889,
5160,
13985,
1125,
13,
4706,
1209,
13,
1678,
14550,
13,
13,
1678,
822,
1243,
29918,
1062,
1237,
29918,
262,
29918,
2585,
29898,
1311,
1125,
13,
4706,
3806,
353,
6024,
5160,
742,
525,
5160,
28575,
742,
525,
5160,
13985,
2033,
13,
4706,
1121,
353,
4833,
29889,
1062,
296,
29918,
7039,
580,
13,
4706,
4974,
1121,
1275,
3806,
13,
13,
13,
29937,
770,
4321,
4640,
29896,
29898,
5160,
4640,
1125,
13,
13,
29937,
268,
3160,
353,
5852,
13,
13,
29937,
268,
3402,
353,
29871,
29896,
13,
13,
13,
1990,
4321,
4640,
29906,
29898,
5160,
4640,
1125,
13,
13,
1678,
3160,
353,
5852,
13,
13,
1678,
3402,
353,
29871,
29906,
13,
2
] |
scripts/calculate_rank.py | daniel-theis/multicore-test-harness | 15 | 3181 | <reponame>daniel-theis/multicore-test-harness
################################################################################
# Copyright (c) 2017 <NAME>, <NAME>, <NAME>
# 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.
################################################################################
import sys
import json
from pprint import pprint
class CalculateRank(object):
def __init__(self, input_file):
self._input_file = input_file
def get_rank(self):
# Read the configuration in the JSON file
with open(self._input_file) as data_file:
experiments_object = json.load(data_file)
# Sort all the configurations in a list
dict_list = list()
for experiment in experiments_object:
ranked_list = experiments_object[experiment]["it"]
od = list(sorted(ranked_list.values(), key=lambda x:x['q_value'], reverse=True))
dict_list.append(od)
# for it in dict_list:
# print()
# print()
# for i in range(len(it)):
# print(it[i]['mapping'])
# print(it[i]['q_value'])
# For each environment. get the rank in the other experiments and store in 'rank'
for it in dict_list[0]:
environment = it['mapping']
rank_list = list()
# Look it up for each victim(experiment)
for it2 in dict_list:
# Find its rank there
for i in range(len(it2)):
env = it2[i]['mapping']
if environment == env:
rank_here = i
break
rank_list.append(rank_here)
it['rank'] = rank_list
# Identify the ones that are not Pareto optimal
rank_list_bad = list()
for it1 in dict_list[0]:
for it2 in dict_list[0]:
if len([i for i, j in zip(it1['rank'], it2['rank']) if i > j]) == len(it1['rank']):
rank_list_bad.append(it1)
# Put the Pareto Optimal in a list
paretto_optimal = list()
for it in dict_list[0]:
if not (it in rank_list_bad):
paretto_optimal.append(it)
# If there are ties, try to break them at fewer comparisons
if len(paretto_optimal) > 1:
rank_list_bad = list()
for it1 in paretto_optimal:
for it2 in paretto_optimal:
if len([i for i, j in zip(it1['rank'], it2['rank']) if i > j]) == len(it1['rank']) - 1:
rank_list_bad.append(it1)
# Put the tie broken ones in a list
paretto_optimal_tie_break = list()
for it in paretto_optimal:
if not (it in rank_list_bad):
paretto_optimal_tie_break.append(it)
print("With no tie breaking")
for i in range(len(paretto_optimal)):
print(paretto_optimal[i]['mapping'])
print("With tie breaking")
for i in range(len(paretto_optimal_tie_break)):
print(paretto_optimal_tie_break[i]['mapping'])
else:
print(paretto_optimal[0]['mapping'])
print("There was no tie breaking")
if __name__ == "__main__":
if len(sys.argv) != 2:
print("usage: " + sys.argv[0] + " <ranked_environments>.json\n")
exit(1)
rank = CalculateRank(sys.argv[1])
rank.get_rank()
| [
1,
529,
276,
1112,
420,
29958,
18386,
709,
29899,
1552,
275,
29914,
4713,
293,
487,
29899,
1688,
29899,
8222,
2264,
13,
13383,
13383,
13383,
13383,
13383,
13,
396,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29955,
529,
5813,
10202,
529,
5813,
10202,
529,
5813,
29958,
13,
13,
396,
20894,
2333,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
263,
3509,
13,
396,
310,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
376,
6295,
14093,
4968,
304,
5376,
13,
396,
297,
278,
18540,
1728,
24345,
29892,
3704,
1728,
29485,
278,
10462,
13,
396,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
13,
396,
14591,
310,
278,
18540,
29892,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
13,
396,
15252,
3276,
304,
437,
577,
29892,
4967,
304,
278,
1494,
5855,
29901,
13,
13,
396,
450,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
5134,
297,
599,
13,
396,
9708,
583,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
13,
396,
6093,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
396,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
396,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
396,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
396,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
13,
396,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
6093,
13,
396,
7791,
7818,
12982,
1525,
29889,
13,
13383,
13383,
13383,
13383,
13383,
13,
13,
5215,
10876,
13,
5215,
4390,
13,
3166,
282,
2158,
1053,
282,
2158,
13,
13,
13,
1990,
20535,
403,
29934,
804,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1881,
29918,
1445,
1125,
13,
4706,
1583,
3032,
2080,
29918,
1445,
353,
1881,
29918,
1445,
13,
13,
1678,
822,
679,
29918,
10003,
29898,
1311,
1125,
13,
4706,
396,
7523,
278,
5285,
297,
278,
4663,
934,
13,
4706,
411,
1722,
29898,
1311,
3032,
2080,
29918,
1445,
29897,
408,
848,
29918,
1445,
29901,
13,
9651,
15729,
29918,
3318,
353,
4390,
29889,
1359,
29898,
1272,
29918,
1445,
29897,
13,
13,
4706,
396,
20025,
599,
278,
22920,
297,
263,
1051,
13,
4706,
9657,
29918,
1761,
353,
1051,
580,
13,
4706,
363,
7639,
297,
15729,
29918,
3318,
29901,
13,
9651,
26642,
29918,
1761,
353,
15729,
29918,
3318,
29961,
735,
15362,
29962,
3366,
277,
3108,
13,
9651,
2413,
353,
1051,
29898,
24582,
29898,
10003,
287,
29918,
1761,
29889,
5975,
3285,
1820,
29922,
2892,
921,
29901,
29916,
1839,
29939,
29918,
1767,
7464,
11837,
29922,
5574,
876,
13,
9651,
9657,
29918,
1761,
29889,
4397,
29898,
397,
29897,
13,
13,
4706,
396,
363,
372,
297,
9657,
29918,
1761,
29901,
13,
4706,
396,
268,
1596,
580,
13,
4706,
396,
268,
1596,
580,
13,
4706,
396,
268,
363,
474,
297,
3464,
29898,
2435,
29898,
277,
22164,
13,
4706,
396,
308,
1596,
29898,
277,
29961,
29875,
22322,
20698,
11287,
13,
4706,
396,
308,
1596,
29898,
277,
29961,
29875,
22322,
29939,
29918,
1767,
11287,
13,
13,
4706,
396,
1152,
1269,
5177,
29889,
679,
278,
7115,
297,
278,
916,
15729,
322,
3787,
297,
525,
10003,
29915,
13,
4706,
363,
372,
297,
9657,
29918,
1761,
29961,
29900,
5387,
13,
9651,
5177,
353,
372,
1839,
20698,
2033,
13,
9651,
7115,
29918,
1761,
353,
1051,
580,
13,
9651,
396,
7419,
372,
701,
363,
1269,
28985,
29898,
735,
15362,
29897,
13,
9651,
363,
372,
29906,
297,
9657,
29918,
1761,
29901,
13,
18884,
396,
10987,
967,
7115,
727,
13,
18884,
363,
474,
297,
3464,
29898,
2435,
29898,
277,
29906,
22164,
13,
462,
1678,
8829,
353,
372,
29906,
29961,
29875,
22322,
20698,
2033,
13,
462,
1678,
565,
5177,
1275,
8829,
29901,
13,
462,
4706,
7115,
29918,
4150,
353,
474,
13,
462,
4706,
2867,
13,
18884,
7115,
29918,
1761,
29889,
4397,
29898,
10003,
29918,
4150,
29897,
13,
9651,
372,
1839,
10003,
2033,
353,
7115,
29918,
1761,
13,
13,
4706,
396,
13355,
1598,
278,
6743,
393,
526,
451,
349,
598,
517,
14413,
13,
4706,
7115,
29918,
1761,
29918,
12313,
353,
1051,
580,
13,
4706,
363,
372,
29896,
297,
9657,
29918,
1761,
29961,
29900,
5387,
13,
9651,
363,
372,
29906,
297,
9657,
29918,
1761,
29961,
29900,
5387,
13,
18884,
565,
7431,
4197,
29875,
363,
474,
29892,
432,
297,
14319,
29898,
277,
29896,
1839,
10003,
7464,
372,
29906,
1839,
10003,
11287,
565,
474,
1405,
432,
2314,
1275,
7431,
29898,
277,
29896,
1839,
10003,
2033,
1125,
13,
462,
1678,
7115,
29918,
1761,
29918,
12313,
29889,
4397,
29898,
277,
29896,
29897,
13,
13,
4706,
396,
12065,
278,
349,
598,
517,
20693,
3039,
297,
263,
1051,
13,
4706,
9541,
16461,
29918,
3670,
3039,
353,
1051,
580,
13,
4706,
363,
372,
297,
9657,
29918,
1761,
29961,
29900,
5387,
13,
9651,
565,
451,
313,
277,
297,
7115,
29918,
1761,
29918,
12313,
1125,
13,
18884,
9541,
16461,
29918,
3670,
3039,
29889,
4397,
29898,
277,
29897,
13,
13,
4706,
396,
960,
727,
526,
260,
583,
29892,
1018,
304,
2867,
963,
472,
28145,
5734,
14125,
13,
4706,
565,
7431,
29898,
29886,
10474,
517,
29918,
3670,
3039,
29897,
1405,
29871,
29896,
29901,
13,
9651,
7115,
29918,
1761,
29918,
12313,
353,
1051,
580,
13,
9651,
363,
372,
29896,
297,
9541,
16461,
29918,
3670,
3039,
29901,
13,
18884,
363,
372,
29906,
297,
9541,
16461,
29918,
3670,
3039,
29901,
13,
462,
1678,
565,
7431,
4197,
29875,
363,
474,
29892,
432,
297,
14319,
29898,
277,
29896,
1839,
10003,
7464,
372,
29906,
1839,
10003,
11287,
565,
474,
1405,
432,
2314,
1275,
7431,
29898,
277,
29896,
1839,
10003,
11287,
448,
29871,
29896,
29901,
13,
462,
4706,
7115,
29918,
1761,
29918,
12313,
29889,
4397,
29898,
277,
29896,
29897,
13,
13,
9651,
396,
12065,
278,
22134,
9391,
6743,
297,
263,
1051,
13,
9651,
9541,
16461,
29918,
3670,
3039,
29918,
29873,
347,
29918,
8690,
353,
1051,
580,
13,
9651,
363,
372,
297,
9541,
16461,
29918,
3670,
3039,
29901,
13,
18884,
565,
451,
313,
277,
297,
7115,
29918,
1761,
29918,
12313,
1125,
13,
462,
1678,
9541,
16461,
29918,
3670,
3039,
29918,
29873,
347,
29918,
8690,
29889,
4397,
29898,
277,
29897,
13,
13,
9651,
1596,
703,
3047,
694,
22134,
16679,
1159,
13,
9651,
363,
474,
297,
3464,
29898,
2435,
29898,
29886,
10474,
517,
29918,
3670,
3039,
22164,
13,
18884,
1596,
29898,
29886,
10474,
517,
29918,
3670,
3039,
29961,
29875,
22322,
20698,
11287,
13,
9651,
1596,
703,
3047,
22134,
16679,
1159,
13,
9651,
363,
474,
297,
3464,
29898,
2435,
29898,
29886,
10474,
517,
29918,
3670,
3039,
29918,
29873,
347,
29918,
8690,
22164,
13,
18884,
1596,
29898,
29886,
10474,
517,
29918,
3670,
3039,
29918,
29873,
347,
29918,
8690,
29961,
29875,
22322,
20698,
11287,
13,
13,
4706,
1683,
29901,
13,
9651,
1596,
29898,
29886,
10474,
517,
29918,
3670,
3039,
29961,
29900,
22322,
20698,
11287,
13,
9651,
1596,
703,
8439,
471,
694,
22134,
16679,
1159,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
2804,
29871,
29906,
29901,
13,
4706,
1596,
703,
21125,
29901,
376,
718,
10876,
29889,
19218,
29961,
29900,
29962,
718,
376,
529,
10003,
287,
29918,
21813,
1860,
15513,
3126,
29905,
29876,
1159,
13,
4706,
6876,
29898,
29896,
29897,
13,
13,
1678,
7115,
353,
20535,
403,
29934,
804,
29898,
9675,
29889,
19218,
29961,
29896,
2314,
13,
13,
1678,
7115,
29889,
657,
29918,
10003,
580,
13,
2
] |
SEGM01.py | abphilip-codes/Codechef_Practice | 2 | 106841 | <reponame>abphilip-codes/Codechef_Practice
# https://www.codechef.com/problems/SEGM01
for T in range(int(input())): print("NO") if(len([s for s in input().split('0') if s])!=1) else print("YES") | [
1,
529,
276,
1112,
420,
29958,
370,
561,
309,
666,
29899,
18137,
29914,
3399,
1173,
29888,
29918,
29925,
1461,
625,
13,
29937,
2045,
597,
1636,
29889,
401,
1173,
29888,
29889,
510,
29914,
17199,
29879,
29914,
1660,
21576,
29900,
29896,
13,
13,
1454,
323,
297,
3464,
29898,
524,
29898,
2080,
22130,
29901,
1596,
703,
6632,
1159,
565,
29898,
2435,
4197,
29879,
363,
269,
297,
1881,
2141,
5451,
877,
29900,
1495,
565,
269,
2314,
19216,
29896,
29897,
1683,
1596,
703,
21143,
1159,
2
] |
instance/config.py | adriankiprono/pitches_project | 0 | 47485 |
SECRET_KEY='<KEY>' | [
1,
29871,
13,
1660,
22245,
29911,
29918,
10818,
2433,
29966,
10818,
16299,
2
] |
tests/test_refo.py | yimian/refo | 2 | 95349 | <reponame>yimian/refo
# Copyright (c) 2012, Machinalis S.R.L.
#
# Author: <NAME> <<EMAIL>>
#
# This file is part of REfO and is distributed under the Modified BSD License.
# You should have received a copy of license in the LICENSE.txt file.
import unittest
import refo
from refo.match import Match, match as refomatch
import re
import math
def isprime(x):
if x < 2:
return False
top = int(math.sqrt(x))
for i in xrange(2, top + 1):
if x % i == 0:
return False
return True
def _seq2str(seq):
xs = []
for x in seq:
if isprime(x):
xs.append("a")
else:
xs.append("b")
return "".join(xs)
def path_function(x):
def f(xs):
if x in xs:
return x * x
return None
return f
class TestRefoModule(unittest.TestCase):
seq = xrange(10000)
a = refo.Predicate(isprime)
b = refo.Predicate(lambda x: not isprime(x))
x = refo.Predicate(path_function(1))
y = refo.Predicate(path_function(2))
z = refo.Predicate(path_function(3))
string = _seq2str(seq)
def _eq_span_n_stuff(self, m, strm):
assert (m and strm) or (not m and not strm)
self.assertNotEqual(m, None)
self.assertNotEqual(strm, None)
self.assertEqual(m.span(), strm.span())
def _eq_list_n_stuff(self, xs, strxs):
xs = [x.span() for x in xs]
strxs = [x.span() for x in strxs]
self.assert_(xs == strxs)
def test_match1(self):
regexptn = self.b + self.b + self.a + self.a + self.b
strregex = re.compile("bbaab")
m = refomatch(regexptn, self.seq)
strm = strregex.match(self.string)
self._eq_span_n_stuff(m, strm)
def test_match2(self):
# This regular expression is known to kill the python re module
# because it exploits the fact that the implementation has exponential
# worst case complexity.
# Instead, this implementation has polinomial worst case complexity,
# and therefore this test should finish in a reasonable time.
N = 100
a = refo.Literal("a")
strg = "a" * N
regexptn = refo.Question(a) * N + a * N
m = refomatch(regexptn, strg)
self.assertNotEqual(m, None)
def test_search1(self):
regexptn = self.a + self.b + self.b + self.b + self.a
strregex = re.compile("abbba")
m = refo.search(regexptn, self.seq)
strm = strregex.search(self.string)
self._eq_span_n_stuff(m, strm)
def test_search2(self):
tab = self.a + self.b + self.a
regexptn = tab + self.b * 3 + tab
strregex = re.compile("ababbbaba")
m = refo.search(regexptn, self.seq)
strm = strregex.search(self.string)
self._eq_span_n_stuff(m, strm)
def test_search3(self):
tab = self.a + self.b
regexptn = tab + tab + refo.Plus(self.b)
strregex = re.compile("ababb+")
m = refo.search(regexptn, self.seq)
strm = strregex.search(self.string)
self._eq_span_n_stuff(m, strm)
def test_search4(self):
tab = self.a + self.b
regexptn = tab * 2 + refo.Plus(self.b, greedy=False)
strregex = re.compile("ababb+?")
m = refo.search(regexptn, self.seq)
strm = strregex.search(self.string)
self._eq_span_n_stuff(m, strm)
def test_search5(self):
tab = self.a + self.b
regexptn = tab * (2, 5)
strregex = re.compile("(?:ab){2,5}")
m = refo.search(regexptn, self.seq)
strm = strregex.search(self.string)
self._eq_span_n_stuff(m, strm)
def test_finditer1(self):
tab = self.a + self.b
regexptn = tab * (2, None)
strregex = re.compile("(?:ab){2,}")
xs = list(refo.finditer(regexptn, self.seq))
strxs = list(strregex.finditer(self.string))
self._eq_list_n_stuff(xs, strxs)
def test_finditer2(self):
tab = self.a + self.b
regexptn = tab * (2, None) + refo.Group(refo.Plus(self.b), "foobar")
strregex = re.compile("(?:ab){2,}(b+)")
xs = list(refo.finditer(regexptn, self.seq))
strxs = list(strregex.finditer(self.string))
xs = [x.group("foobar") for x in xs]
strxs = [x.span(1) for x in strxs]
self.assert_(xs == strxs)
def test_match_path(self):
seq = [[1, 2], # x and y
[1], # x
[1, 2, 3], # x, y and z
[1, 2], # x and y
[2, 3], # y and z
[0, 4, 5],
[]]
regexptn = refo.Star(self.y) + refo.Plus(self.x + self.z)
m = refomatch(regexptn, seq, keep_path=True)
self.assert_(isinstance(m, Match))
path = m.get_path()
self.assertEqual([4, 1, 9, 1, 9], path)
if __name__ == "__main__":
unittest.main()
| [
1,
529,
276,
1112,
420,
29958,
29891,
326,
713,
29914,
999,
29877,
13,
29937,
29871,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29906,
29892,
17197,
979,
275,
317,
29889,
29934,
29889,
29931,
29889,
13,
29937,
13,
29937,
29871,
13361,
29901,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
29937,
13,
29937,
29871,
910,
934,
338,
760,
310,
5195,
29888,
29949,
322,
338,
13235,
1090,
278,
3382,
2164,
350,
7230,
19245,
29889,
13,
29937,
29871,
887,
881,
505,
4520,
263,
3509,
310,
19405,
297,
278,
365,
2965,
1430,
1660,
29889,
3945,
934,
29889,
13,
13,
5215,
443,
27958,
13,
5215,
337,
1181,
13,
3166,
337,
1181,
29889,
4352,
1053,
14514,
29892,
1993,
408,
2143,
290,
905,
13,
5215,
337,
13,
5215,
5844,
13,
13,
13,
1753,
338,
10080,
29898,
29916,
1125,
13,
1678,
565,
921,
529,
29871,
29906,
29901,
13,
4706,
736,
7700,
13,
1678,
2246,
353,
938,
29898,
755,
29889,
3676,
29898,
29916,
876,
13,
1678,
363,
474,
297,
921,
3881,
29898,
29906,
29892,
2246,
718,
29871,
29896,
1125,
13,
4706,
565,
921,
1273,
474,
1275,
29871,
29900,
29901,
13,
9651,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
903,
11762,
29906,
710,
29898,
11762,
1125,
13,
1678,
14492,
353,
5159,
13,
1678,
363,
921,
297,
19359,
29901,
13,
4706,
565,
338,
10080,
29898,
29916,
1125,
13,
9651,
14492,
29889,
4397,
703,
29874,
1159,
13,
4706,
1683,
29901,
13,
9651,
14492,
29889,
4397,
703,
29890,
1159,
13,
1678,
736,
376,
1642,
7122,
29898,
10351,
29897,
13,
13,
13,
1753,
2224,
29918,
2220,
29898,
29916,
1125,
13,
1678,
822,
285,
29898,
10351,
1125,
13,
4706,
565,
921,
297,
14492,
29901,
13,
9651,
736,
921,
334,
921,
13,
4706,
736,
6213,
13,
1678,
736,
285,
13,
13,
13,
1990,
4321,
1123,
1181,
7355,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
19359,
353,
921,
3881,
29898,
29896,
29900,
29900,
29900,
29900,
29897,
13,
1678,
263,
353,
337,
1181,
29889,
23084,
9593,
29898,
275,
10080,
29897,
13,
1678,
289,
353,
337,
1181,
29889,
23084,
9593,
29898,
2892,
921,
29901,
451,
338,
10080,
29898,
29916,
876,
13,
1678,
921,
353,
337,
1181,
29889,
23084,
9593,
29898,
2084,
29918,
2220,
29898,
29896,
876,
13,
1678,
343,
353,
337,
1181,
29889,
23084,
9593,
29898,
2084,
29918,
2220,
29898,
29906,
876,
13,
1678,
503,
353,
337,
1181,
29889,
23084,
9593,
29898,
2084,
29918,
2220,
29898,
29941,
876,
13,
1678,
1347,
353,
903,
11762,
29906,
710,
29898,
11762,
29897,
13,
13,
1678,
822,
903,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
1311,
29892,
286,
29892,
851,
29885,
1125,
13,
4706,
4974,
313,
29885,
322,
851,
29885,
29897,
470,
313,
1333,
286,
322,
451,
851,
29885,
29897,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
29885,
29892,
6213,
29897,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
710,
29885,
29892,
6213,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
9653,
3285,
851,
29885,
29889,
9653,
3101,
13,
13,
1678,
822,
903,
1837,
29918,
1761,
29918,
29876,
29918,
303,
3096,
29898,
1311,
29892,
14492,
29892,
851,
10351,
1125,
13,
4706,
14492,
353,
518,
29916,
29889,
9653,
580,
363,
921,
297,
14492,
29962,
13,
4706,
851,
10351,
353,
518,
29916,
29889,
9653,
580,
363,
921,
297,
851,
10351,
29962,
13,
4706,
1583,
29889,
9294,
23538,
10351,
1275,
851,
10351,
29897,
13,
13,
1678,
822,
1243,
29918,
4352,
29896,
29898,
1311,
1125,
13,
4706,
6528,
415,
29876,
353,
1583,
29889,
29890,
718,
1583,
29889,
29890,
718,
1583,
29889,
29874,
718,
1583,
29889,
29874,
718,
1583,
29889,
29890,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
1327,
29874,
370,
1159,
13,
4706,
286,
353,
2143,
290,
905,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
29897,
13,
4706,
851,
29885,
353,
851,
13087,
29889,
4352,
29898,
1311,
29889,
1807,
29897,
13,
4706,
1583,
3032,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
29885,
29892,
851,
29885,
29897,
13,
13,
1678,
822,
1243,
29918,
4352,
29906,
29898,
1311,
1125,
13,
4706,
396,
910,
4943,
4603,
338,
2998,
304,
12088,
278,
3017,
337,
3883,
13,
4706,
396,
1363,
372,
16035,
1169,
278,
2114,
393,
278,
5314,
756,
25658,
13,
4706,
396,
17322,
1206,
13644,
29889,
13,
4706,
396,
8669,
29892,
445,
5314,
756,
1248,
262,
7615,
17322,
1206,
13644,
29892,
13,
4706,
396,
322,
5480,
445,
1243,
881,
8341,
297,
263,
15590,
931,
29889,
13,
4706,
405,
353,
29871,
29896,
29900,
29900,
13,
4706,
263,
353,
337,
1181,
29889,
24938,
284,
703,
29874,
1159,
13,
4706,
851,
29887,
353,
376,
29874,
29908,
334,
405,
13,
4706,
6528,
415,
29876,
353,
337,
1181,
29889,
16492,
29898,
29874,
29897,
334,
405,
718,
263,
334,
405,
13,
4706,
286,
353,
2143,
290,
905,
29898,
13087,
415,
29876,
29892,
851,
29887,
29897,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
29885,
29892,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
4478,
29896,
29898,
1311,
1125,
13,
4706,
6528,
415,
29876,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
718,
1583,
29889,
29890,
718,
1583,
29889,
29890,
718,
1583,
29889,
29874,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
370,
1327,
29874,
1159,
13,
4706,
286,
353,
337,
1181,
29889,
4478,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
29897,
13,
4706,
851,
29885,
353,
851,
13087,
29889,
4478,
29898,
1311,
29889,
1807,
29897,
13,
4706,
1583,
3032,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
29885,
29892,
851,
29885,
29897,
13,
13,
1678,
822,
1243,
29918,
4478,
29906,
29898,
1311,
1125,
13,
4706,
4434,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
718,
1583,
29889,
29874,
13,
4706,
6528,
415,
29876,
353,
4434,
718,
1583,
29889,
29890,
334,
29871,
29941,
718,
4434,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
370,
370,
1327,
5363,
1159,
13,
4706,
286,
353,
337,
1181,
29889,
4478,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
29897,
13,
4706,
851,
29885,
353,
851,
13087,
29889,
4478,
29898,
1311,
29889,
1807,
29897,
13,
4706,
1583,
3032,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
29885,
29892,
851,
29885,
29897,
13,
13,
1678,
822,
1243,
29918,
4478,
29941,
29898,
1311,
1125,
13,
4706,
4434,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
13,
4706,
6528,
415,
29876,
353,
4434,
718,
4434,
718,
337,
1181,
29889,
29575,
29898,
1311,
29889,
29890,
29897,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
370,
8846,
29974,
1159,
13,
4706,
286,
353,
337,
1181,
29889,
4478,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
29897,
13,
4706,
851,
29885,
353,
851,
13087,
29889,
4478,
29898,
1311,
29889,
1807,
29897,
13,
4706,
1583,
3032,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
29885,
29892,
851,
29885,
29897,
13,
13,
1678,
822,
1243,
29918,
4478,
29946,
29898,
1311,
1125,
13,
4706,
4434,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
13,
4706,
6528,
415,
29876,
353,
4434,
334,
29871,
29906,
718,
337,
1181,
29889,
29575,
29898,
1311,
29889,
29890,
29892,
1395,
7584,
29922,
8824,
29897,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
370,
8846,
29974,
29973,
1159,
13,
4706,
286,
353,
337,
1181,
29889,
4478,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
29897,
13,
4706,
851,
29885,
353,
851,
13087,
29889,
4478,
29898,
1311,
29889,
1807,
29897,
13,
4706,
1583,
3032,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
29885,
29892,
851,
29885,
29897,
13,
13,
1678,
822,
1243,
29918,
4478,
29945,
29898,
1311,
1125,
13,
4706,
4434,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
13,
4706,
6528,
415,
29876,
353,
4434,
334,
313,
29906,
29892,
29871,
29945,
29897,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
10780,
29901,
370,
2597,
29906,
29892,
29945,
27195,
13,
4706,
286,
353,
337,
1181,
29889,
4478,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
29897,
13,
4706,
851,
29885,
353,
851,
13087,
29889,
4478,
29898,
1311,
29889,
1807,
29897,
13,
4706,
1583,
3032,
1837,
29918,
9653,
29918,
29876,
29918,
303,
3096,
29898,
29885,
29892,
851,
29885,
29897,
13,
13,
1678,
822,
1243,
29918,
2886,
1524,
29896,
29898,
1311,
1125,
13,
4706,
4434,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
13,
4706,
6528,
415,
29876,
353,
4434,
334,
313,
29906,
29892,
6213,
29897,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
10780,
29901,
370,
2597,
29906,
29892,
27195,
13,
4706,
14492,
353,
1051,
29898,
999,
29877,
29889,
2886,
1524,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
876,
13,
4706,
851,
10351,
353,
1051,
29898,
710,
13087,
29889,
2886,
1524,
29898,
1311,
29889,
1807,
876,
13,
4706,
1583,
3032,
1837,
29918,
1761,
29918,
29876,
29918,
303,
3096,
29898,
10351,
29892,
851,
10351,
29897,
13,
13,
1678,
822,
1243,
29918,
2886,
1524,
29906,
29898,
1311,
1125,
13,
4706,
4434,
353,
1583,
29889,
29874,
718,
1583,
29889,
29890,
13,
4706,
6528,
415,
29876,
353,
4434,
334,
313,
29906,
29892,
6213,
29897,
718,
337,
1181,
29889,
4782,
29898,
999,
29877,
29889,
29575,
29898,
1311,
29889,
29890,
511,
376,
1181,
22872,
1159,
13,
4706,
851,
13087,
353,
337,
29889,
12198,
703,
10780,
29901,
370,
2597,
29906,
29892,
2119,
29890,
29974,
25760,
13,
4706,
14492,
353,
1051,
29898,
999,
29877,
29889,
2886,
1524,
29898,
13087,
415,
29876,
29892,
1583,
29889,
11762,
876,
13,
4706,
851,
10351,
353,
1051,
29898,
710,
13087,
29889,
2886,
1524,
29898,
1311,
29889,
1807,
876,
13,
4706,
14492,
353,
518,
29916,
29889,
2972,
703,
1181,
22872,
1159,
363,
921,
297,
14492,
29962,
13,
4706,
851,
10351,
353,
518,
29916,
29889,
9653,
29898,
29896,
29897,
363,
921,
297,
851,
10351,
29962,
13,
4706,
1583,
29889,
9294,
23538,
10351,
1275,
851,
10351,
29897,
13,
13,
1678,
822,
1243,
29918,
4352,
29918,
2084,
29898,
1311,
1125,
13,
4706,
19359,
353,
5519,
29896,
29892,
29871,
29906,
1402,
268,
396,
921,
322,
343,
13,
1669,
518,
29896,
1402,
4706,
396,
921,
13,
1669,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
1402,
29871,
396,
921,
29892,
343,
322,
503,
13,
1669,
518,
29896,
29892,
29871,
29906,
1402,
268,
396,
921,
322,
343,
13,
1669,
518,
29906,
29892,
29871,
29941,
1402,
268,
396,
343,
322,
503,
13,
1669,
518,
29900,
29892,
29871,
29946,
29892,
29871,
29945,
1402,
13,
1669,
5159,
29962,
13,
4706,
6528,
415,
29876,
353,
337,
1181,
29889,
16213,
29898,
1311,
29889,
29891,
29897,
718,
337,
1181,
29889,
29575,
29898,
1311,
29889,
29916,
718,
1583,
29889,
29920,
29897,
13,
4706,
286,
353,
2143,
290,
905,
29898,
13087,
415,
29876,
29892,
19359,
29892,
3013,
29918,
2084,
29922,
5574,
29897,
13,
4706,
1583,
29889,
9294,
23538,
275,
8758,
29898,
29885,
29892,
14514,
876,
13,
4706,
2224,
353,
286,
29889,
657,
29918,
2084,
580,
13,
4706,
1583,
29889,
9294,
9843,
4197,
29946,
29892,
29871,
29896,
29892,
29871,
29929,
29892,
29871,
29896,
29892,
29871,
29929,
1402,
2224,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
tbase/common/optimizers.py | iminders/TradeBaselines | 16 | 180162 | import torch
mapping = {}
def register(name):
def _thunk(func):
mapping[name] = func
return func
return _thunk
@register("rmsprop")
def rmsprop():
return torch.optim.RMSprop
@register("adam")
def adam():
return torch.optim.Adam
def get_optimizer_func(name):
"""
If you want to register your own optimizer function, you just need:
Usage Example:
-------------
from tbase.common.optimizers import register
@register("your_reward_function_name")
def your_optimizer_func(**kwargs):
...
return optimizer_func
"""
if callable(name):
return name
elif name in mapping:
return mapping[name]
else:
raise ValueError('Unknown optimizer_func: {}'.format(name))
| [
1,
1053,
4842,
305,
13,
13,
20698,
353,
6571,
13,
13,
13,
1753,
6036,
29898,
978,
1125,
13,
1678,
822,
903,
386,
2960,
29898,
9891,
1125,
13,
4706,
10417,
29961,
978,
29962,
353,
3653,
13,
4706,
736,
3653,
13,
1678,
736,
903,
386,
2960,
13,
13,
13,
29992,
9573,
703,
29878,
1516,
7728,
1159,
13,
1753,
364,
1516,
7728,
7295,
13,
1678,
736,
4842,
305,
29889,
20640,
29889,
29934,
4345,
7728,
13,
13,
13,
29992,
9573,
703,
328,
314,
1159,
13,
1753,
594,
314,
7295,
13,
1678,
736,
4842,
305,
29889,
20640,
29889,
3253,
314,
13,
13,
13,
1753,
679,
29918,
20640,
3950,
29918,
9891,
29898,
978,
1125,
13,
1678,
9995,
13,
1678,
960,
366,
864,
304,
6036,
596,
1914,
5994,
3950,
740,
29892,
366,
925,
817,
29901,
13,
1678,
10783,
482,
8741,
29901,
13,
1678,
448,
9072,
13,
1678,
515,
260,
3188,
29889,
9435,
29889,
20640,
19427,
1053,
6036,
13,
1678,
732,
9573,
703,
8066,
29918,
276,
1328,
29918,
2220,
29918,
978,
1159,
13,
1678,
822,
596,
29918,
20640,
3950,
29918,
9891,
29898,
1068,
19290,
1125,
13,
4706,
2023,
13,
4706,
736,
5994,
3950,
29918,
9891,
13,
1678,
9995,
13,
1678,
565,
1246,
519,
29898,
978,
1125,
13,
4706,
736,
1024,
13,
1678,
25342,
1024,
297,
10417,
29901,
13,
4706,
736,
10417,
29961,
978,
29962,
13,
1678,
1683,
29901,
13,
4706,
12020,
7865,
2392,
877,
14148,
5994,
3950,
29918,
9891,
29901,
6571,
4286,
4830,
29898,
978,
876,
13,
2
] |
Incident-Response/Tools/grr/grr/test/grr_response_test/end_to_end_tests/tests/timeline.py | sn0b4ll/Incident-Playbook | 1 | 25142 | #!/usr/bin/env python
# Lint as: python3
"""E2E tests for the timeline flow."""
import csv
import io
from typing import Sequence
from typing import Text
from absl.testing import absltest
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.util import temp
from grr_response_proto.api import timeline_pb2
from grr_response_test.end_to_end_tests import test_base
class TestTimelineLinux(test_base.EndToEndTest):
"""A class with Linux-specific timeline tests."""
platforms = [test_base.EndToEndTest.Platform.LINUX]
def testUsrBin(self):
args = self.grr_api.types.CreateFlowArgs("TimelineFlow")
args.root = "/bin/".encode("utf-8")
flow = self.RunFlowAndWait("TimelineFlow", args=args)
with temp.AutoTempFilePath(suffix=".body") as temp_filepath:
timeline_format = timeline_pb2.ApiGetCollectedTimelineArgs.Format.BODY
body = flow.GetCollectedTimeline(timeline_format)
body.WriteToFile(temp_filepath)
with io.open(temp_filepath, mode="r", encoding="utf-8") as temp_filedesc:
entries = list(csv.reader(temp_filedesc, delimiter="|"))
paths = [entry[1] for entry in entries]
self.assertIn("/bin/bash", paths)
self.assertIn("/bin/cat", paths)
self.assertIn("/bin/chmod", paths)
self.assertIn("/bin/cp", paths)
self.assertIn("/bin/rm", paths)
self.assertIn("/bin/sleep", paths)
for entry in entries:
assertBodyEntrySanity(self, entry)
class TestTimelineWindows(test_base.EndToEndTest):
"""A class with Windows-specific timeline tests."""
platforms = [test_base.EndToEndTest.Platform.WINDOWS]
def testWindows(self):
args = self.grr_api.types.CreateFlowArgs("TimelineFlow")
args.root = "C:\\Windows".encode("utf-8")
flow = self.RunFlowAndWait("TimelineFlow", args=args)
with temp.AutoTempFilePath(suffix=".body") as temp_filepath:
timeline_format = timeline_pb2.ApiGetCollectedTimelineArgs.Format.BODY
body = flow.GetCollectedTimeline(timeline_format)
body.WriteToFile(temp_filepath)
with io.open(temp_filepath, mode="r", encoding="utf-8") as temp_filedesc:
entries = list(csv.reader(temp_filedesc, delimiter="|"))
paths = [entry[1].lower() for entry in entries]
self.assertIn("C:\\Windows\\explorer.exe".lower(), paths)
self.assertIn("C:\\Windows\\notepad.exe".lower(), paths)
self.assertIn("C:\\Windows\\regedit.exe".lower(), paths)
self.assertIn("C:\\Windows\\System32\\dwm.exe".lower(), paths)
for entry in entries:
assertBodyEntrySanity(self, entry)
def testWindowsBackslashEscape(self):
args = self.grr_api.types.CreateFlowArgs("TimelineFlow")
args.root = "C:\\Windows".encode("utf-8")
flow = self.RunFlowAndWait("TimelineFlow", args=args)
with temp.AutoTempFilePath(suffix=".body") as temp_filepath:
body = flow.GetCollectedTimelineBody(backslash_escape=True)
body.WriteToFile(temp_filepath)
with io.open(temp_filepath, mode="r", encoding="utf-8") as temp_filedesc:
content = temp_filedesc.read().lower()
self.assertIn("|C:\\\\Windows\\\\explorer.exe|".lower(), content)
self.assertIn("|C:\\\\Windows\\\\notepad.exe|".lower(), content)
self.assertIn("|C:\\\\Windows\\\\regedit.exe|".lower(), content)
self.assertIn("|C:\\\\Windows\\\\System32\\\\dwm.exe|".lower(), content)
def assertBodyEntrySanity( # pylint: disable=invalid-name
test: absltest.TestCase,
entry: Sequence[Text],
) -> None:
"""Asserts that given row of a body file is sane."""
# Size should be non-negative (some files might be empty, though).
test.assertGreaterEqual(int(entry[6]), 0)
# All timestamps should be positive.
test.assertGreater(int(entry[7]), 0)
test.assertGreater(int(entry[8]), 0)
test.assertGreater(int(entry[9]), 0)
# All timestamps should be older than now.
now = rdfvalue.RDFDatetime.Now()
test.assertLessEqual(int(entry[7]), now.AsSecondsSinceEpoch())
test.assertLessEqual(int(entry[8]), now.AsSecondsSinceEpoch())
test.assertLessEqual(int(entry[9]), now.AsSecondsSinceEpoch())
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
365,
524,
408,
29901,
3017,
29941,
13,
15945,
29908,
29923,
29906,
29923,
6987,
363,
278,
5335,
5570,
4972,
1213,
15945,
13,
5215,
11799,
13,
5215,
12013,
13,
3166,
19229,
1053,
922,
3910,
13,
3166,
19229,
1053,
3992,
13,
13,
3166,
633,
2536,
29889,
13424,
1053,
633,
2536,
1688,
13,
13,
3166,
867,
29878,
29918,
5327,
29918,
3221,
29889,
1982,
1053,
364,
2176,
1767,
13,
3166,
867,
29878,
29918,
5327,
29918,
3221,
29889,
1982,
29889,
4422,
1053,
5694,
13,
3166,
867,
29878,
29918,
5327,
29918,
17529,
29889,
2754,
1053,
5335,
5570,
29918,
24381,
29906,
13,
3166,
867,
29878,
29918,
5327,
29918,
1688,
29889,
355,
29918,
517,
29918,
355,
29918,
21150,
1053,
1243,
29918,
3188,
13,
13,
13,
1990,
4321,
13711,
5570,
24085,
29898,
1688,
29918,
3188,
29889,
5044,
1762,
5044,
3057,
1125,
13,
29871,
9995,
29909,
770,
411,
8074,
29899,
14940,
5335,
5570,
6987,
1213,
15945,
13,
13,
29871,
21796,
353,
518,
1688,
29918,
3188,
29889,
5044,
1762,
5044,
3057,
29889,
21889,
29889,
23714,
29965,
29990,
29962,
13,
13,
29871,
822,
1243,
15922,
29878,
29933,
262,
29898,
1311,
1125,
13,
1678,
6389,
353,
1583,
29889,
629,
29878,
29918,
2754,
29889,
8768,
29889,
4391,
17907,
7883,
703,
13711,
5570,
17907,
1159,
13,
1678,
6389,
29889,
4632,
353,
5591,
2109,
29914,
1642,
12508,
703,
9420,
29899,
29947,
1159,
13,
13,
1678,
4972,
353,
1583,
29889,
6558,
17907,
2855,
15716,
703,
13711,
5570,
17907,
613,
6389,
29922,
5085,
29897,
13,
13,
1678,
411,
5694,
29889,
12300,
15637,
2283,
2605,
29898,
2146,
600,
861,
29569,
2587,
1159,
408,
5694,
29918,
1445,
2084,
29901,
13,
418,
5335,
5570,
29918,
4830,
353,
5335,
5570,
29918,
24381,
29906,
29889,
11713,
2577,
28916,
287,
13711,
5570,
7883,
29889,
5809,
29889,
8456,
29928,
29979,
13,
13,
418,
3573,
353,
4972,
29889,
2577,
28916,
287,
13711,
5570,
29898,
9346,
5570,
29918,
4830,
29897,
13,
418,
3573,
29889,
6113,
1762,
2283,
29898,
7382,
29918,
1445,
2084,
29897,
13,
13,
418,
411,
12013,
29889,
3150,
29898,
7382,
29918,
1445,
2084,
29892,
4464,
543,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
5694,
29918,
1445,
14273,
29901,
13,
4706,
9976,
353,
1051,
29898,
7638,
29889,
16950,
29898,
7382,
29918,
1445,
14273,
29892,
28552,
543,
29989,
5783,
13,
13,
1678,
10898,
353,
518,
8269,
29961,
29896,
29962,
363,
6251,
297,
9976,
29962,
13,
1678,
1583,
29889,
9294,
797,
11974,
2109,
29914,
13067,
613,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
11974,
2109,
29914,
4117,
613,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
11974,
2109,
29914,
305,
1545,
613,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
11974,
2109,
29914,
6814,
613,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
11974,
2109,
29914,
1758,
613,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
11974,
2109,
29914,
17059,
613,
10898,
29897,
13,
13,
1678,
363,
6251,
297,
9976,
29901,
13,
418,
4974,
8434,
9634,
22509,
537,
29898,
1311,
29892,
6251,
29897,
13,
13,
13,
1990,
4321,
13711,
5570,
7685,
29898,
1688,
29918,
3188,
29889,
5044,
1762,
5044,
3057,
1125,
13,
29871,
9995,
29909,
770,
411,
3852,
29899,
14940,
5335,
5570,
6987,
1213,
15945,
13,
13,
29871,
21796,
353,
518,
1688,
29918,
3188,
29889,
5044,
1762,
5044,
3057,
29889,
21889,
29889,
25152,
3970,
7811,
29962,
13,
13,
29871,
822,
1243,
7685,
29898,
1311,
1125,
13,
1678,
6389,
353,
1583,
29889,
629,
29878,
29918,
2754,
29889,
8768,
29889,
4391,
17907,
7883,
703,
13711,
5570,
17907,
1159,
13,
1678,
6389,
29889,
4632,
353,
376,
29907,
22298,
7685,
1642,
12508,
703,
9420,
29899,
29947,
1159,
13,
13,
1678,
4972,
353,
1583,
29889,
6558,
17907,
2855,
15716,
703,
13711,
5570,
17907,
613,
6389,
29922,
5085,
29897,
13,
13,
1678,
411,
5694,
29889,
12300,
15637,
2283,
2605,
29898,
2146,
600,
861,
29569,
2587,
1159,
408,
5694,
29918,
1445,
2084,
29901,
13,
418,
5335,
5570,
29918,
4830,
353,
5335,
5570,
29918,
24381,
29906,
29889,
11713,
2577,
28916,
287,
13711,
5570,
7883,
29889,
5809,
29889,
8456,
29928,
29979,
13,
13,
418,
3573,
353,
4972,
29889,
2577,
28916,
287,
13711,
5570,
29898,
9346,
5570,
29918,
4830,
29897,
13,
418,
3573,
29889,
6113,
1762,
2283,
29898,
7382,
29918,
1445,
2084,
29897,
13,
13,
418,
411,
12013,
29889,
3150,
29898,
7382,
29918,
1445,
2084,
29892,
4464,
543,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
5694,
29918,
1445,
14273,
29901,
13,
4706,
9976,
353,
1051,
29898,
7638,
29889,
16950,
29898,
7382,
29918,
1445,
14273,
29892,
28552,
543,
29989,
5783,
13,
13,
1678,
10898,
353,
518,
8269,
29961,
29896,
1822,
13609,
580,
363,
6251,
297,
9976,
29962,
13,
1678,
1583,
29889,
9294,
797,
703,
29907,
22298,
7685,
1966,
735,
14716,
29889,
8097,
1642,
13609,
3285,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
703,
29907,
22298,
7685,
1966,
6812,
8305,
29889,
8097,
1642,
13609,
3285,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
703,
29907,
22298,
7685,
1966,
1727,
5628,
29889,
8097,
1642,
13609,
3285,
10898,
29897,
13,
1678,
1583,
29889,
9294,
797,
703,
29907,
22298,
7685,
1966,
3924,
29941,
29906,
1966,
28012,
29885,
29889,
8097,
1642,
13609,
3285,
10898,
29897,
13,
13,
1678,
363,
6251,
297,
9976,
29901,
13,
418,
4974,
8434,
9634,
22509,
537,
29898,
1311,
29892,
6251,
29897,
13,
13,
29871,
822,
1243,
7685,
5841,
17057,
14190,
5738,
29898,
1311,
1125,
13,
1678,
6389,
353,
1583,
29889,
629,
29878,
29918,
2754,
29889,
8768,
29889,
4391,
17907,
7883,
703,
13711,
5570,
17907,
1159,
13,
1678,
6389,
29889,
4632,
353,
376,
29907,
22298,
7685,
1642,
12508,
703,
9420,
29899,
29947,
1159,
13,
13,
1678,
4972,
353,
1583,
29889,
6558,
17907,
2855,
15716,
703,
13711,
5570,
17907,
613,
6389,
29922,
5085,
29897,
13,
13,
1678,
411,
5694,
29889,
12300,
15637,
2283,
2605,
29898,
2146,
600,
861,
29569,
2587,
1159,
408,
5694,
29918,
1445,
2084,
29901,
13,
418,
3573,
353,
4972,
29889,
2577,
28916,
287,
13711,
5570,
8434,
29898,
1627,
17057,
29918,
21587,
29922,
5574,
29897,
13,
418,
3573,
29889,
6113,
1762,
2283,
29898,
7382,
29918,
1445,
2084,
29897,
13,
13,
418,
411,
12013,
29889,
3150,
29898,
7382,
29918,
1445,
2084,
29892,
4464,
543,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
5694,
29918,
1445,
14273,
29901,
13,
4706,
2793,
353,
5694,
29918,
1445,
14273,
29889,
949,
2141,
13609,
580,
13,
13,
1678,
1583,
29889,
9294,
797,
703,
29989,
29907,
22298,
1966,
7685,
1966,
1966,
735,
14716,
29889,
8097,
29989,
1642,
13609,
3285,
2793,
29897,
13,
1678,
1583,
29889,
9294,
797,
703,
29989,
29907,
22298,
1966,
7685,
1966,
1966,
6812,
8305,
29889,
8097,
29989,
1642,
13609,
3285,
2793,
29897,
13,
1678,
1583,
29889,
9294,
797,
703,
29989,
29907,
22298,
1966,
7685,
1966,
1966,
1727,
5628,
29889,
8097,
29989,
1642,
13609,
3285,
2793,
29897,
13,
1678,
1583,
29889,
9294,
797,
703,
29989,
29907,
22298,
1966,
7685,
1966,
1966,
3924,
29941,
29906,
1966,
1966,
28012,
29885,
29889,
8097,
29989,
1642,
13609,
3285,
2793,
29897,
13,
13,
13,
1753,
4974,
8434,
9634,
22509,
537,
29898,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
978,
13,
1678,
1243,
29901,
633,
2536,
1688,
29889,
3057,
8259,
29892,
13,
1678,
6251,
29901,
922,
3910,
29961,
1626,
1402,
13,
29897,
1599,
6213,
29901,
13,
29871,
9995,
2887,
643,
1372,
393,
2183,
1948,
310,
263,
3573,
934,
338,
269,
1662,
1213,
15945,
13,
29871,
396,
21179,
881,
367,
1661,
29899,
22198,
313,
5372,
2066,
1795,
367,
4069,
29892,
2466,
467,
13,
29871,
1243,
29889,
9294,
25120,
1008,
9843,
29898,
524,
29898,
8269,
29961,
29953,
11724,
29871,
29900,
29897,
13,
13,
29871,
396,
2178,
5335,
342,
15092,
881,
367,
6374,
29889,
13,
29871,
1243,
29889,
9294,
25120,
1008,
29898,
524,
29898,
8269,
29961,
29955,
11724,
29871,
29900,
29897,
13,
29871,
1243,
29889,
9294,
25120,
1008,
29898,
524,
29898,
8269,
29961,
29947,
11724,
29871,
29900,
29897,
13,
29871,
1243,
29889,
9294,
25120,
1008,
29898,
524,
29898,
8269,
29961,
29929,
11724,
29871,
29900,
29897,
13,
13,
29871,
396,
2178,
5335,
342,
15092,
881,
367,
9642,
1135,
1286,
29889,
13,
29871,
1286,
353,
364,
2176,
1767,
29889,
29934,
4037,
16390,
5410,
29889,
10454,
580,
13,
29871,
1243,
29889,
9294,
29931,
404,
9843,
29898,
524,
29898,
8269,
29961,
29955,
11724,
1286,
29889,
2887,
27535,
23036,
29923,
1129,
305,
3101,
13,
29871,
1243,
29889,
9294,
29931,
404,
9843,
29898,
524,
29898,
8269,
29961,
29947,
11724,
1286,
29889,
2887,
27535,
23036,
29923,
1129,
305,
3101,
13,
29871,
1243,
29889,
9294,
29931,
404,
9843,
29898,
524,
29898,
8269,
29961,
29929,
11724,
1286,
29889,
2887,
27535,
23036,
29923,
1129,
305,
3101,
13,
2
] |
sobchak/report.py | JorisHartog/sobchak | 0 | 92880 | import os
import logging
class Report(object):
"""Report
A Report object generates a report in the form of a HTML-page of a list of
hypervisors and information about how certain migrations improve the
resource distribution.
"""
def __init__(self, inventory, template='template.html'):
self._inventory = inventory
self._migration_report = ''
self._template = self._fetch_template(template)
self.title = 'Migration report'
def _fetch_template(self, filename):
"""_fetch_template
Reads a template and returns the contents.
"""
try:
with open(filename, 'r') as template:
return template.read()
except Exception as e:
logging.error('Could not load %s: %s', filename, e)
exit(1)
def add_migrations(self, migrations):
"""add_migrations
Adds the migrations to the report.
"""
def code_block(c):
return '<pre><code>' + c + '</code></pre>'
migration_list = '<br />'.join([str(m) for m in migrations])
self._migration_report = code_block(migration_list)
def save(self, filename='report.html'):
"""save
Save the report as a HTML-file.
"""
with open(filename, 'w+') as f:
f.write(self.page)
print('Report available: {}'.format(os.path.abspath(filename)))
@property
def body(self):
"""body
Returns the HTML body of the report.
"""
def img_tag(i): return \
'<img width="25%" src="data:image/png;base64,{}"/>'.format(i)
body = '<h1>{}</h1>'.format(self.title)
body += '<h2>Hypervisor info</h2>'
for hypervisor in self._inventory.hypervisors:
body += img_tag(hypervisor.plot)
body += '<h2>Migration list</h2>'
body += self._migration_report
return body
@property
def page(self):
"""page
Returns the report as HTML.
"""
variables = {
'title': self.title,
'body': self.body
}
content = self._template
for key, value in variables.items():
content = content.replace('{{'+key+'}}', value)
return content
| [
1,
1053,
2897,
13,
5215,
12183,
13,
13,
1990,
13969,
29898,
3318,
1125,
13,
1678,
9995,
13020,
13,
13,
1678,
319,
13969,
1203,
16785,
263,
3461,
297,
278,
883,
310,
263,
4544,
29899,
3488,
310,
263,
1051,
310,
13,
1678,
11266,
1730,
943,
322,
2472,
1048,
920,
3058,
9725,
800,
11157,
278,
13,
1678,
6503,
4978,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11817,
706,
29892,
4472,
2433,
6886,
29889,
1420,
29374,
13,
4706,
1583,
3032,
262,
23886,
353,
11817,
706,
13,
4706,
1583,
3032,
29885,
16783,
29918,
12276,
353,
6629,
13,
4706,
1583,
3032,
6886,
353,
1583,
3032,
9155,
29918,
6886,
29898,
6886,
29897,
13,
4706,
1583,
29889,
3257,
353,
525,
29924,
16783,
3461,
29915,
13,
13,
1678,
822,
903,
9155,
29918,
6886,
29898,
1311,
29892,
10422,
1125,
13,
4706,
9995,
29918,
9155,
29918,
6886,
13,
13,
4706,
7523,
29879,
263,
4472,
322,
3639,
278,
8118,
29889,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
411,
1722,
29898,
9507,
29892,
525,
29878,
1495,
408,
4472,
29901,
13,
18884,
736,
4472,
29889,
949,
580,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
12183,
29889,
2704,
877,
23323,
451,
2254,
1273,
29879,
29901,
1273,
29879,
742,
10422,
29892,
321,
29897,
13,
9651,
6876,
29898,
29896,
29897,
13,
13,
1678,
822,
788,
29918,
26983,
800,
29898,
1311,
29892,
9725,
800,
1125,
13,
4706,
9995,
1202,
29918,
26983,
800,
13,
13,
4706,
3462,
29879,
278,
9725,
800,
304,
278,
3461,
29889,
13,
4706,
9995,
13,
4706,
822,
775,
29918,
1271,
29898,
29883,
1125,
13,
9651,
736,
12801,
1457,
5299,
401,
16299,
718,
274,
718,
525,
829,
401,
2565,
1457,
16299,
13,
13,
4706,
20332,
29918,
1761,
353,
12801,
1182,
2900,
4286,
7122,
4197,
710,
29898,
29885,
29897,
363,
286,
297,
9725,
800,
2314,
13,
4706,
1583,
3032,
29885,
16783,
29918,
12276,
353,
775,
29918,
1271,
29898,
29885,
16783,
29918,
1761,
29897,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
10422,
2433,
12276,
29889,
1420,
29374,
13,
4706,
9995,
7620,
13,
13,
4706,
16913,
278,
3461,
408,
263,
4544,
29899,
1445,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
9507,
29892,
525,
29893,
29974,
1495,
408,
285,
29901,
13,
9651,
285,
29889,
3539,
29898,
1311,
29889,
3488,
29897,
13,
9651,
1596,
877,
13020,
3625,
29901,
6571,
4286,
4830,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
9507,
4961,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3573,
29898,
1311,
1125,
13,
4706,
9995,
2587,
13,
13,
4706,
16969,
278,
4544,
3573,
310,
278,
3461,
29889,
13,
4706,
9995,
13,
4706,
822,
10153,
29918,
4039,
29898,
29875,
1125,
736,
320,
13,
9651,
12801,
2492,
2920,
543,
29906,
29945,
23577,
4765,
543,
1272,
29901,
3027,
29914,
2732,
29936,
3188,
29953,
29946,
29892,
8875,
4681,
4286,
4830,
29898,
29875,
29897,
13,
13,
4706,
3573,
353,
12801,
29882,
29896,
29958,
8875,
829,
29882,
29896,
29958,
4286,
4830,
29898,
1311,
29889,
3257,
29897,
13,
13,
4706,
3573,
4619,
12801,
29882,
29906,
29958,
26322,
546,
19188,
5235,
829,
29882,
29906,
16299,
13,
4706,
363,
11266,
19188,
297,
1583,
3032,
262,
23886,
29889,
24947,
1730,
943,
29901,
13,
9651,
3573,
4619,
10153,
29918,
4039,
29898,
24947,
19188,
29889,
5317,
29897,
13,
13,
4706,
3573,
4619,
12801,
29882,
29906,
29958,
29924,
16783,
1051,
829,
29882,
29906,
16299,
13,
4706,
3573,
4619,
1583,
3032,
29885,
16783,
29918,
12276,
13,
13,
4706,
736,
3573,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29898,
1311,
1125,
13,
4706,
9995,
3488,
13,
13,
4706,
16969,
278,
3461,
408,
4544,
29889,
13,
4706,
9995,
13,
4706,
3651,
353,
426,
13,
9651,
525,
3257,
2396,
1583,
29889,
3257,
29892,
13,
9651,
525,
2587,
2396,
1583,
29889,
2587,
13,
4706,
500,
13,
4706,
2793,
353,
1583,
3032,
6886,
13,
13,
4706,
363,
1820,
29892,
995,
297,
3651,
29889,
7076,
7295,
13,
9651,
2793,
353,
2793,
29889,
6506,
877,
6224,
18717,
1989,
23097,
930,
742,
995,
29897,
13,
13,
4706,
736,
2793,
13,
2
] |
tools/eval_proposal_hit_rate.py | h-zcc/ref-nms | 19 | 49529 | import argparse
import pickle
from utils.hit_rate_utils import NewHitRateEvaluator
from utils.constants import EVAL_SPLITS_DICT
from lib.refer import REFER
def threshold_with_confidence(exp_to_proposals, conf):
results = {}
for exp_id, proposals in exp_to_proposals.items():
assert len(proposals) >= 1
sorted_proposals = sorted(proposals, key=lambda p: p['score'], reverse=True)
thresh_proposals = [sorted_proposals[0]]
for prop in sorted_proposals[1:]:
if prop['score'] > conf:
thresh_proposals.append(prop)
else:
break
results[exp_id] = thresh_proposals
return results
def main(args):
dataset_splitby = '{}_{}'.format(args.dataset, args.split_by)
eval_splits = EVAL_SPLITS_DICT[dataset_splitby]
# Load proposals
proposal_path = 'cache/proposals_{}_{}_{}.pkl'.format(args.m, args.dataset, args.tid)
print('loading {} proposals from {}...'.format(args.m, proposal_path))
with open(proposal_path, 'rb') as f:
proposal_dict = pickle.load(f)
# Load refer
refer = REFER('data/refer', dataset=args.dataset, splitBy=args.split_by)
# Evaluate hit rate
print('Hit rate on {}\n'.format(dataset_splitby))
evaluator = NewHitRateEvaluator(refer, top_N=None, threshold=args.thresh)
print('conf: {:.3f}'.format(args.conf))
for split in eval_splits:
exp_to_proposals = proposal_dict[split]
exp_to_proposals = threshold_with_confidence(exp_to_proposals, args.conf)
proposal_per_ref, hit_rate = evaluator.eval_hit_rate(split, exp_to_proposals)
print('[{:5s}] hit rate: {:.2f} @ {:.2f}'.format(split, hit_rate*100, proposal_per_ref))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--m', type=str, required=True)
parser.add_argument('--dataset', default='refcoco')
parser.add_argument('--split-by', default='unc')
parser.add_argument('--tid', type=str, required=True)
parser.add_argument('--thresh', type=float, default=0.5)
parser.add_argument('--conf', type=float, required=True)
main(parser.parse_args())
| [
1,
1053,
1852,
5510,
13,
5215,
5839,
280,
13,
13,
3166,
3667,
29879,
29889,
27342,
29918,
10492,
29918,
13239,
1053,
1570,
29950,
277,
19907,
29923,
4387,
1061,
13,
3166,
3667,
29879,
29889,
3075,
1934,
1053,
382,
8932,
29918,
5550,
29931,
1806,
29903,
29918,
4571,
1783,
13,
3166,
4303,
29889,
20275,
1053,
5195,
29943,
1001,
13,
13,
13,
1753,
16897,
29918,
2541,
29918,
5527,
5084,
29898,
4548,
29918,
517,
29918,
771,
1066,
1338,
29892,
1970,
1125,
13,
1678,
2582,
353,
6571,
13,
1678,
363,
1518,
29918,
333,
29892,
9551,
1338,
297,
1518,
29918,
517,
29918,
771,
1066,
1338,
29889,
7076,
7295,
13,
4706,
4974,
7431,
29898,
771,
1066,
1338,
29897,
6736,
29871,
29896,
13,
4706,
12705,
29918,
771,
1066,
1338,
353,
12705,
29898,
771,
1066,
1338,
29892,
1820,
29922,
2892,
282,
29901,
282,
1839,
13628,
7464,
11837,
29922,
5574,
29897,
13,
4706,
266,
3781,
29918,
771,
1066,
1338,
353,
518,
24582,
29918,
771,
1066,
1338,
29961,
29900,
5262,
13,
4706,
363,
3107,
297,
12705,
29918,
771,
1066,
1338,
29961,
29896,
29901,
5387,
13,
9651,
565,
3107,
1839,
13628,
2033,
1405,
1970,
29901,
13,
18884,
266,
3781,
29918,
771,
1066,
1338,
29889,
4397,
29898,
7728,
29897,
13,
9651,
1683,
29901,
13,
18884,
2867,
13,
4706,
2582,
29961,
4548,
29918,
333,
29962,
353,
266,
3781,
29918,
771,
1066,
1338,
13,
1678,
736,
2582,
13,
13,
13,
1753,
1667,
29898,
5085,
1125,
13,
1678,
8783,
29918,
5451,
1609,
353,
22372,
3227,
29913,
4286,
4830,
29898,
5085,
29889,
24713,
29892,
6389,
29889,
5451,
29918,
1609,
29897,
13,
1678,
19745,
29918,
23579,
1169,
353,
382,
8932,
29918,
5550,
29931,
1806,
29903,
29918,
4571,
1783,
29961,
24713,
29918,
5451,
1609,
29962,
13,
1678,
396,
16012,
9551,
1338,
13,
1678,
24963,
29918,
2084,
353,
525,
8173,
29914,
771,
1066,
1338,
648,
3227,
3227,
1836,
29886,
6321,
4286,
4830,
29898,
5085,
29889,
29885,
29892,
6389,
29889,
24713,
29892,
6389,
29889,
17681,
29897,
13,
1678,
1596,
877,
13234,
6571,
9551,
1338,
515,
6571,
856,
4286,
4830,
29898,
5085,
29889,
29885,
29892,
24963,
29918,
2084,
876,
13,
1678,
411,
1722,
29898,
771,
1066,
284,
29918,
2084,
29892,
525,
6050,
1495,
408,
285,
29901,
13,
4706,
24963,
29918,
8977,
353,
5839,
280,
29889,
1359,
29898,
29888,
29897,
13,
1678,
396,
16012,
2737,
13,
1678,
2737,
353,
5195,
29943,
1001,
877,
1272,
29914,
20275,
742,
8783,
29922,
5085,
29889,
24713,
29892,
6219,
2059,
29922,
5085,
29889,
5451,
29918,
1609,
29897,
13,
1678,
396,
382,
4387,
403,
7124,
6554,
13,
1678,
1596,
877,
29950,
277,
6554,
373,
426,
1012,
29876,
4286,
4830,
29898,
24713,
29918,
5451,
1609,
876,
13,
1678,
6161,
1061,
353,
1570,
29950,
277,
19907,
29923,
4387,
1061,
29898,
20275,
29892,
2246,
29918,
29940,
29922,
8516,
29892,
16897,
29922,
5085,
29889,
386,
3781,
29897,
13,
1678,
1596,
877,
5527,
29901,
12365,
29889,
29941,
29888,
29913,
4286,
4830,
29898,
5085,
29889,
5527,
876,
13,
1678,
363,
6219,
297,
19745,
29918,
23579,
1169,
29901,
13,
4706,
1518,
29918,
517,
29918,
771,
1066,
1338,
353,
24963,
29918,
8977,
29961,
5451,
29962,
13,
4706,
1518,
29918,
517,
29918,
771,
1066,
1338,
353,
16897,
29918,
2541,
29918,
5527,
5084,
29898,
4548,
29918,
517,
29918,
771,
1066,
1338,
29892,
6389,
29889,
5527,
29897,
13,
4706,
24963,
29918,
546,
29918,
999,
29892,
7124,
29918,
10492,
353,
6161,
1061,
29889,
14513,
29918,
27342,
29918,
10492,
29898,
5451,
29892,
1518,
29918,
517,
29918,
771,
1066,
1338,
29897,
13,
4706,
1596,
877,
19660,
29901,
29945,
29879,
6525,
7124,
6554,
29901,
12365,
29889,
29906,
29888,
29913,
732,
12365,
29889,
29906,
29888,
29913,
4286,
4830,
29898,
5451,
29892,
7124,
29918,
10492,
29930,
29896,
29900,
29900,
29892,
24963,
29918,
546,
29918,
999,
876,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
29885,
742,
1134,
29922,
710,
29892,
3734,
29922,
5574,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
24713,
742,
2322,
2433,
999,
29883,
6235,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
5451,
29899,
1609,
742,
2322,
2433,
4661,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
17681,
742,
1134,
29922,
710,
29892,
3734,
29922,
5574,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
386,
3781,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29945,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
5527,
742,
1134,
29922,
7411,
29892,
3734,
29922,
5574,
29897,
13,
1678,
1667,
29898,
16680,
29889,
5510,
29918,
5085,
3101,
13,
2
] |
setup.py | lrado1/delimag | 0 | 176562 | <reponame>lrado1/delimag
from setuptools import setup
setup(name = 'delimag',
version = '0.01',
description = 'Delimag is a tool to analyze Pandas DataFrame objects with multiselect records.',
packages = ['pandas', 'delimag'],
author = 'lrado1',
zip_safe=False)
| [
1,
529,
276,
1112,
420,
29958,
29880,
26881,
29896,
29914,
6144,
326,
351,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
14669,
29898,
978,
353,
525,
6144,
326,
351,
742,
13,
418,
1873,
353,
525,
29900,
29889,
29900,
29896,
742,
13,
418,
6139,
353,
525,
13157,
326,
351,
338,
263,
5780,
304,
27599,
349,
7086,
3630,
4308,
3618,
411,
1773,
895,
781,
6475,
29889,
742,
13,
418,
9741,
353,
6024,
15112,
742,
525,
6144,
326,
351,
7464,
13,
418,
4148,
353,
525,
29880,
26881,
29896,
742,
13,
418,
14319,
29918,
11177,
29922,
8824,
29897,
13,
2
] |
04-Working-With-Dataframes/4.Exercise_ Distinct Articles.py | RodriGonca/DP-203-Data-Engineer | 0 | 39568 | # Databricks notebook source
# MAGIC %md
# MAGIC # Introduction to DataFrames Lab
# MAGIC ## Distinct Articles
# COMMAND ----------
# MAGIC %md
# MAGIC ## Instructions
# MAGIC
# MAGIC In the cell provided below, write the code necessary to count the number of distinct articles in our data set.
# MAGIC 0. Copy and paste all you like from the previous notebook.
# MAGIC 0. Read in our parquet files.
# MAGIC 0. Apply the necessary transformations.
# MAGIC 0. Assign the count to the variable `totalArticles`
# MAGIC 0. Run the last cell to verify that the data was loaded correctly.
# MAGIC
# MAGIC **Bonus**
# MAGIC
# MAGIC If you recall from the beginning of the previous notebook, the act of reading in our parquet files will trigger a job.
# MAGIC 0. Define a schema that matches the data we are working with.
# MAGIC 0. Update the read operation to use the schema.
# COMMAND ----------
# MAGIC %md
# MAGIC ## Getting Started
# MAGIC
# MAGIC Run the following cell to configure our "classroom."
# COMMAND ----------
# MAGIC %run "./Includes/Classroom-Setup"
# COMMAND ----------
# MAGIC %md
# MAGIC ## Show Your Work
# COMMAND ----------
(source, sasEntity, sasToken) = getAzureDataSource()
spark.conf.set(sasEntity, sasToken)
path = source + "/wikipedia/pagecounts/staging_parquet_en_only_clean/"
# COMMAND ----------
# TODO
# Replace <<FILL_IN>> with your code.
df = (spark # Our SparkSession & Entry Point
.read # Our DataFrameReader
<<FILL_IN>> # Read in the parquet files
<<FILL_IN>> # Reduce the columns to just the one
<<FILL_IN>> # Produce a unique set of values
)
totalArticles = df.<<FILL_IN>> # Identify the total number of records remaining.
print("Distinct Articles: {0:,}".format(totalArticles))
# COMMAND ----------
# MAGIC %md
# MAGIC ## Verify Your Work
# MAGIC Run the following cell to verify that your `DataFrame` was created properly.
# COMMAND ----------
expected = 1783138
assert totalArticles == expected, "Expected the total to be " + str(expected) + " but found " + str(totalArticles)
| [
1,
396,
13373,
370,
29878,
7358,
451,
19273,
2752,
13,
29937,
341,
10051,
2965,
1273,
3487,
13,
29937,
341,
10051,
2965,
396,
27576,
304,
3630,
14438,
1280,
12016,
13,
29937,
341,
10051,
2965,
444,
6652,
5562,
12952,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29937,
341,
10051,
2965,
1273,
3487,
13,
29937,
341,
10051,
2965,
444,
21298,
29903,
6378,
4522,
29877,
323,
4901,
850,
991,
597,
5325,
29889,
26495,
29889,
29503,
29878,
7358,
29889,
510,
29914,
8346,
29914,
29896,
29900,
29945,
29914,
14569,
29918,
12597,
29918,
25649,
29889,
2732,
29897,
2799,
582,
1953,
13,
29937,
341,
10051,
2965,
29871,
13,
29937,
341,
10051,
2965,
512,
278,
3038,
4944,
2400,
29892,
2436,
278,
775,
5181,
304,
2302,
278,
1353,
310,
8359,
7456,
297,
1749,
848,
731,
29889,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
14187,
322,
11417,
599,
366,
763,
515,
278,
3517,
451,
19273,
29889,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
7523,
297,
1749,
610,
12621,
2066,
29889,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
2401,
368,
278,
5181,
29304,
29889,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
4007,
647,
278,
2302,
304,
278,
2286,
421,
7827,
9986,
4027,
29952,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
7525,
278,
1833,
3038,
304,
11539,
393,
278,
848,
471,
7500,
5149,
29889,
13,
29937,
341,
10051,
2965,
29871,
13,
29937,
341,
10051,
2965,
3579,
29933,
265,
375,
1068,
13,
29937,
341,
10051,
2965,
29871,
13,
29937,
341,
10051,
2965,
960,
366,
17386,
515,
278,
6763,
310,
278,
3517,
451,
19273,
29892,
278,
1044,
310,
5183,
297,
1749,
610,
12621,
2066,
674,
7135,
263,
4982,
29889,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
22402,
263,
10938,
393,
7087,
278,
848,
591,
526,
1985,
411,
29889,
13,
29937,
341,
10051,
2965,
29871,
29900,
29889,
10318,
278,
1303,
5858,
304,
671,
278,
10938,
29889,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29937,
341,
10051,
2965,
1273,
3487,
13,
29937,
341,
10051,
2965,
444,
21298,
29903,
6378,
4522,
29877,
323,
4901,
850,
991,
597,
5325,
29889,
26495,
29889,
29503,
29878,
7358,
29889,
510,
29914,
8346,
29914,
29896,
29900,
29945,
29914,
14569,
29918,
12597,
29918,
25649,
29889,
2732,
29897,
24162,
7370,
287,
13,
29937,
341,
10051,
2965,
29871,
13,
29937,
341,
10051,
2965,
7525,
278,
1494,
3038,
304,
10822,
1749,
376,
1990,
8345,
1213,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29937,
341,
10051,
2965,
1273,
3389,
376,
6904,
797,
27722,
29914,
2385,
8345,
29899,
26947,
29908,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29937,
341,
10051,
2965,
1273,
3487,
13,
29937,
341,
10051,
2965,
444,
21298,
29903,
6378,
4522,
29877,
323,
4901,
850,
991,
597,
5325,
29889,
26495,
29889,
29503,
29878,
7358,
29889,
510,
29914,
8346,
29914,
29896,
29900,
29945,
29914,
14569,
29918,
12597,
29918,
25649,
29889,
2732,
29897,
7704,
3575,
5244,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29898,
4993,
29892,
269,
294,
6691,
29892,
269,
294,
6066,
29897,
353,
679,
28413,
15559,
580,
13,
12597,
29889,
5527,
29889,
842,
29898,
29879,
294,
6691,
29892,
269,
294,
6066,
29897,
13,
13,
2084,
353,
2752,
718,
5591,
6011,
29914,
3488,
2798,
29879,
29914,
303,
6751,
29918,
862,
12621,
29918,
264,
29918,
6194,
29918,
14941,
12975,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29937,
14402,
13,
29937,
22108,
3532,
3738,
2208,
29918,
1177,
6778,
411,
596,
775,
29889,
29871,
13,
13,
2176,
353,
313,
12597,
462,
1678,
396,
8680,
20814,
7317,
669,
28236,
8984,
13,
29871,
869,
949,
462,
4706,
396,
8680,
3630,
4308,
6982,
13,
29871,
3532,
3738,
2208,
29918,
1177,
6778,
462,
29871,
396,
7523,
297,
278,
610,
12621,
2066,
13,
29871,
3532,
3738,
2208,
29918,
1177,
6778,
462,
29871,
396,
4367,
24551,
278,
4341,
304,
925,
278,
697,
13,
29871,
3532,
3738,
2208,
29918,
1177,
6778,
462,
29871,
396,
7138,
346,
263,
5412,
731,
310,
1819,
13,
29897,
13,
7827,
9986,
4027,
353,
4489,
29889,
9314,
3738,
2208,
29918,
1177,
6778,
396,
13355,
1598,
278,
3001,
1353,
310,
6475,
9886,
29889,
13,
13,
2158,
703,
13398,
5562,
12952,
29901,
426,
29900,
29901,
29892,
29913,
1642,
4830,
29898,
7827,
9986,
4027,
876,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
29937,
341,
10051,
2965,
1273,
3487,
13,
29937,
341,
10051,
2965,
444,
21298,
29903,
6378,
4522,
29877,
323,
4901,
850,
991,
597,
5325,
29889,
26495,
29889,
29503,
29878,
7358,
29889,
510,
29914,
8346,
29914,
29896,
29900,
29945,
29914,
14569,
29918,
12597,
29918,
25649,
29889,
2732,
29897,
1798,
1598,
3575,
5244,
13,
29937,
341,
10051,
2965,
7525,
278,
1494,
3038,
304,
11539,
393,
596,
421,
17271,
29952,
471,
2825,
6284,
29889,
13,
13,
29937,
23353,
1529,
2797,
448,
1378,
29899,
13,
13,
9684,
353,
29871,
29896,
29955,
29947,
29941,
29896,
29941,
29947,
13,
9294,
3001,
9986,
4027,
1275,
3806,
29892,
376,
1252,
6021,
278,
3001,
304,
367,
376,
718,
851,
29898,
9684,
29897,
718,
376,
541,
1476,
376,
718,
851,
29898,
7827,
9986,
4027,
29897,
13,
2
] |
core/tests/test_models.py | CezarPoeta/Fusion | 0 | 49351 | <filename>core/tests/test_models.py<gh_stars>0
import uuid
from django.test import TestCase
from model_mommy import mommy
from core.models import get_file_path
class GetFilePathTestCase(TestCase):
def setUp(self):
self.filename = f'{uuid.uuid4()}.png'
def test_get_file_path(self):
arquivo = get_file_path('Nome', 'teste.png')
self.assertTrue(len(arquivo),len(self.filename))
class ServicoTestCase(TestCase):
def setUp(self):
self.servico = mommy.make('Servico')
def test_str(self):
self.assertEquals(str(self.servico),self.servico.servico)
class CargoTestCase(TestCase):
def setUp(self):
self.cargo = mommy.make('Cargo')
def test_str(self):
self.assertEquals(str(self.cargo),self.cargo.cargo)
class FuncionarioTestCase(TestCase):
def setUp(self):
self.funcionario = mommy.make('Funcionario')
def test_str(self):
self.assertEquals(str(self.funcionario),self.funcionario.nome)
class CaracteristicaTestCase(TestCase):
def setUp(self):
self.caracteristica = mommy.make('Caracteristica')
def test_str(self):
self.assertEquals(str(self.caracteristica),self.caracteristica.nome)
| [
1,
529,
9507,
29958,
3221,
29914,
21150,
29914,
1688,
29918,
9794,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
318,
5416,
13,
3166,
9557,
29889,
1688,
1053,
4321,
8259,
13,
3166,
1904,
29918,
29885,
290,
1357,
1053,
16823,
1357,
13,
13,
3166,
7136,
29889,
9794,
1053,
679,
29918,
1445,
29918,
2084,
13,
13,
1990,
3617,
2283,
2605,
3057,
8259,
29898,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9507,
353,
285,
29915,
29912,
25118,
29889,
25118,
29946,
580,
1836,
2732,
29915,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
1445,
29918,
2084,
29898,
1311,
1125,
13,
4706,
19325,
4243,
353,
679,
29918,
1445,
29918,
2084,
877,
29940,
608,
742,
525,
1688,
29872,
29889,
2732,
1495,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
19862,
4243,
511,
2435,
29898,
1311,
29889,
9507,
876,
268,
13,
13,
1990,
9635,
1417,
3057,
8259,
29898,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2140,
1417,
353,
16823,
1357,
29889,
5675,
877,
6889,
1417,
1495,
13,
13,
1678,
822,
1243,
29918,
710,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
710,
29898,
1311,
29889,
2140,
1417,
511,
1311,
29889,
2140,
1417,
29889,
2140,
1417,
29897,
13,
13,
1990,
315,
7921,
3057,
8259,
29898,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29883,
7921,
353,
16823,
1357,
29889,
5675,
877,
29907,
7921,
1495,
13,
13,
1678,
822,
1243,
29918,
710,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
710,
29898,
1311,
29889,
29883,
7921,
511,
1311,
29889,
29883,
7921,
29889,
29883,
7921,
29897,
13,
13,
1990,
383,
4661,
25150,
3057,
8259,
29898,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9891,
25150,
353,
16823,
1357,
29889,
5675,
877,
14400,
25150,
1495,
13,
13,
1678,
822,
1243,
29918,
710,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
710,
29898,
1311,
29889,
9891,
25150,
511,
1311,
29889,
9891,
25150,
29889,
25155,
29897,
13,
13,
1990,
1704,
5761,
24504,
3057,
8259,
29898,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
4287,
5761,
24504,
353,
16823,
1357,
29889,
5675,
877,
8179,
5761,
24504,
1495,
13,
13,
1678,
822,
1243,
29918,
710,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
14776,
29898,
710,
29898,
1311,
29889,
4287,
5761,
24504,
511,
1311,
29889,
4287,
5761,
24504,
29889,
25155,
29897,
13,
13,
2
] |
part-2/deploy/main.py | limxl31/NTUOSS-API-Development-Workshop | 0 | 158382 | <filename>part-2/deploy/main.py
"""
Introduction to API Development (Part 2)
NTUOSS TGIFHacks #132
by <NAME> for NTU Open Source Society
"""
# Imports
from fastapi import FastAPI, Depends, status
from pydantic import BaseModel
from typing import List, Optional
from database import SessionLocal
from schema import DBMember
from sqlalchemy import desc, asc
from sqlalchemy.orm import Session
# Create a FastAPI Instance
app = FastAPI()
# Database Dependency
# Create a session for a request.
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
# A Pydantic Member
# Data validation and settings management using python type annotations.
class Member(BaseModel):
name: str
school: str
graduation_year: int
# Allow ORM fetch
class Config:
orm_mode = True
# Methods for interacting with the SQLite Database
# ------------------------------------------------
def get_member(db: Session, member_id: int):
return db.query(DBMember).where(DBMember.id == member_id).first()
def get_members(db: Session, sort_by: str):
if(sort_by == 'desc'):
return db.query(DBMember).order_by(desc(DBMember.name)).all()
elif(sort_by == 'asc'):
return db.query(DBMember).order_by(asc(DBMember.name)).all()
else:
return db.query(DBMember).all()
def create_member(db: Session, member: Member):
db_member = DBMember(**member.dict())
db.add(db_member)
db.commit()
db.refresh(db_member)
return db_member
# ------------------------------------------------
# API Routes
# ------------------------------------------------
@app.post('/members/', response_model=Member)
def create_members_view(member: Member, db: Session = Depends(get_db)):
db_member = create_member(db, member)
return db_member
@app.get('/members/', response_model=List[Member])
def get_members_view(db: Session = Depends(get_db), sort_by: Optional[str] = None):
return get_members(db, sort_by)
@app.get('/member/{member_id}')
def get_member_view(member_id: int, db: Session = Depends(get_db)):
return get_member(db, member_id)
# ------------------------------------------------
# Health Check
@app.get('/healthcheck', status_code=status.HTTP_200_OK)
def perform_healthcheck():
return {'healthcheck': 'Everything OK!'} | [
1,
529,
9507,
29958,
1595,
29899,
29906,
29914,
16519,
29914,
3396,
29889,
2272,
13,
15945,
29908,
13,
25898,
304,
3450,
14650,
313,
7439,
29871,
29906,
29897,
13,
20321,
29965,
29949,
1799,
323,
29954,
6545,
29950,
26514,
396,
29896,
29941,
29906,
13,
1609,
529,
5813,
29958,
363,
405,
29911,
29965,
4673,
7562,
7765,
13,
15945,
29908,
13,
13,
29937,
1954,
4011,
13,
3166,
5172,
2754,
1053,
23786,
8787,
29892,
10034,
1975,
29892,
4660,
13,
3166,
282,
2941,
7716,
1053,
7399,
3195,
13,
3166,
19229,
1053,
2391,
29892,
28379,
13,
3166,
2566,
1053,
16441,
7717,
13,
3166,
10938,
1053,
6535,
13404,
13,
3166,
4576,
284,
305,
6764,
1053,
5153,
29892,
12066,
13,
3166,
4576,
284,
305,
6764,
29889,
555,
1053,
16441,
13,
13,
29937,
6204,
263,
23786,
8787,
2799,
749,
13,
932,
353,
23786,
8787,
580,
13,
13,
29937,
5470,
10034,
5197,
13,
29937,
6204,
263,
4867,
363,
263,
2009,
29889,
29871,
13,
1753,
679,
29918,
2585,
7295,
13,
1678,
4833,
353,
16441,
7717,
580,
13,
1678,
1018,
29901,
13,
4706,
7709,
4833,
13,
1678,
7146,
29901,
13,
4706,
4833,
29889,
5358,
580,
13,
13,
29937,
319,
349,
2941,
7716,
19495,
13,
29937,
3630,
8845,
322,
6055,
10643,
773,
3017,
1134,
25495,
29889,
13,
1990,
19495,
29898,
5160,
3195,
1125,
13,
1678,
1024,
29901,
851,
13,
1678,
3762,
29901,
851,
13,
1678,
10591,
362,
29918,
6360,
29901,
938,
13,
268,
13,
1678,
396,
29408,
6323,
29924,
6699,
13,
1678,
770,
12782,
29901,
13,
4706,
470,
29885,
29918,
8513,
353,
5852,
13,
13,
29937,
8108,
29879,
363,
16254,
292,
411,
278,
23299,
5470,
13,
29937,
448,
2683,
2683,
9072,
5634,
13,
1753,
679,
29918,
14242,
29898,
2585,
29901,
16441,
29892,
4509,
29918,
333,
29901,
938,
1125,
13,
1678,
736,
4833,
29889,
1972,
29898,
4051,
13404,
467,
3062,
29898,
4051,
13404,
29889,
333,
1275,
4509,
29918,
333,
467,
4102,
580,
13,
13,
1753,
679,
29918,
28109,
29898,
2585,
29901,
16441,
29892,
2656,
29918,
1609,
29901,
851,
1125,
13,
1678,
565,
29898,
6605,
29918,
1609,
1275,
525,
14273,
29374,
13,
4706,
736,
4833,
29889,
1972,
29898,
4051,
13404,
467,
2098,
29918,
1609,
29898,
14273,
29898,
4051,
13404,
29889,
978,
8106,
497,
580,
13,
1678,
25342,
29898,
6605,
29918,
1609,
1275,
525,
6151,
29374,
13,
4706,
736,
4833,
29889,
1972,
29898,
4051,
13404,
467,
2098,
29918,
1609,
29898,
6151,
29898,
4051,
13404,
29889,
978,
8106,
497,
580,
13,
1678,
1683,
29901,
13,
4706,
736,
4833,
29889,
1972,
29898,
4051,
13404,
467,
497,
580,
13,
13,
1753,
1653,
29918,
14242,
29898,
2585,
29901,
16441,
29892,
4509,
29901,
19495,
1125,
13,
1678,
4833,
29918,
14242,
353,
6535,
13404,
29898,
1068,
14242,
29889,
8977,
3101,
13,
1678,
4833,
29889,
1202,
29898,
2585,
29918,
14242,
29897,
13,
1678,
4833,
29889,
15060,
580,
13,
1678,
4833,
29889,
22379,
29898,
2585,
29918,
14242,
29897,
13,
13,
1678,
736,
4833,
29918,
14242,
13,
29937,
448,
2683,
2683,
9072,
5634,
13,
13,
13,
29937,
3450,
20829,
267,
13,
29937,
448,
2683,
2683,
9072,
5634,
13,
29992,
932,
29889,
2490,
11219,
28109,
29914,
742,
2933,
29918,
4299,
29922,
13404,
29897,
13,
1753,
1653,
29918,
28109,
29918,
1493,
29898,
14242,
29901,
19495,
29892,
4833,
29901,
16441,
353,
10034,
1975,
29898,
657,
29918,
2585,
22164,
13,
1678,
4833,
29918,
14242,
353,
1653,
29918,
14242,
29898,
2585,
29892,
4509,
29897,
13,
1678,
736,
4833,
29918,
14242,
13,
13,
29992,
932,
29889,
657,
11219,
28109,
29914,
742,
2933,
29918,
4299,
29922,
1293,
29961,
13404,
2314,
13,
1753,
679,
29918,
28109,
29918,
1493,
29898,
2585,
29901,
16441,
353,
10034,
1975,
29898,
657,
29918,
2585,
511,
2656,
29918,
1609,
29901,
28379,
29961,
710,
29962,
353,
6213,
1125,
13,
1678,
736,
679,
29918,
28109,
29898,
2585,
29892,
2656,
29918,
1609,
29897,
13,
13,
29992,
932,
29889,
657,
11219,
14242,
19248,
14242,
29918,
333,
29913,
1495,
13,
1753,
679,
29918,
14242,
29918,
1493,
29898,
14242,
29918,
333,
29901,
938,
29892,
4833,
29901,
16441,
353,
10034,
1975,
29898,
657,
29918,
2585,
22164,
13,
1678,
736,
679,
29918,
14242,
29898,
2585,
29892,
4509,
29918,
333,
29897,
13,
29937,
448,
2683,
2683,
9072,
5634,
13,
13,
29937,
15202,
5399,
13,
29992,
932,
29889,
657,
11219,
354,
4298,
3198,
742,
4660,
29918,
401,
29922,
4882,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
29897,
13,
1753,
2189,
29918,
354,
4298,
3198,
7295,
13,
1678,
736,
11117,
354,
4298,
3198,
2396,
525,
26526,
1918,
9280,
29991,
10827,
2
] |
python/7kyu/list_filtering.py | Sigmanificient/codewars | 3 | 84251 | <gh_stars>1-10
"""Kate url: https://www.codewars.com/kata/53dbd5315a3c69eed20002dd."""
from typing import List, Any
def filter_list(collection: List[Any]) -> List[int]:
return [x for x in collection if isinstance(x, int)]
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
29968,
403,
3142,
29901,
2045,
597,
1636,
29889,
401,
29893,
1503,
29889,
510,
29914,
29895,
532,
29914,
29945,
29941,
2585,
29881,
29945,
29941,
29896,
29945,
29874,
29941,
29883,
29953,
29929,
12613,
29906,
29900,
29900,
29900,
29906,
1289,
1213,
15945,
13,
13,
3166,
19229,
1053,
2391,
29892,
3139,
13,
13,
13,
1753,
4175,
29918,
1761,
29898,
10855,
29901,
2391,
29961,
10773,
2314,
1599,
2391,
29961,
524,
5387,
13,
1678,
736,
518,
29916,
363,
921,
297,
4333,
565,
338,
8758,
29898,
29916,
29892,
938,
4638,
13,
2
] |
ssguan/ignitor/registry/model.py | samuelbaizg/ssguan | 1 | 146814 | <reponame>samuelbaizg/ssguan<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2015 www.suishouguan.com
#
# Licensed under the Private License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/samuelbaizg/ssguan/blob/master/LICENSE
#
# 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 ssguan.ignitor import IGNITOR_DOMAIN
from ssguan.ignitor.orm import properti
from ssguan.ignitor.orm.model import Model
from ssguan.ignitor.orm.validator import UniqueValidator
class Registry(Model):
ROOT_KEY = 'ROOT'
@classmethod
def meta_domain(cls):
return IGNITOR_DOMAIN
item_key = properti.StringProperty(required=True, validator=[UniqueValidator('item_key')])
parent_key = properti.StringProperty(required=True, default=ROOT_KEY)
item_value = properti.ObjectProperty(required=True, length=255)
item_desc = properti.StringProperty(required=False, length=255)
valid_flag = properti.BooleanProperty(required=True, default=False)
| [
1,
529,
276,
1112,
420,
29958,
13445,
2491,
2291,
466,
29887,
29914,
893,
2543,
273,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
30004,
13,
29937,
29871,
14187,
1266,
29871,
29906,
29900,
29896,
29945,
7821,
29889,
2146,
728,
692,
12323,
29889,
510,
30004,
13,
29937,
30004,
13,
29937,
29871,
10413,
21144,
1090,
278,
12230,
19245,
313,
1552,
376,
29931,
293,
1947,
18584,
13,
29937,
29871,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
22993,
13,
29937,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
30004,
13,
29937,
30004,
13,
29937,
418,
2045,
597,
3292,
29889,
510,
29914,
13445,
2491,
2291,
466,
29887,
29914,
893,
2543,
273,
29914,
10054,
29914,
6207,
29914,
27888,
1430,
1660,
30004,
13,
29937,
30004,
13,
29937,
29871,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
30004,
13,
29937,
29871,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
11167,
13,
29937,
29871,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
22993,
13,
29937,
29871,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
30004,
13,
29937,
29871,
27028,
1090,
278,
19245,
22993,
13,
30004,
13,
3166,
17971,
2543,
273,
29889,
647,
2105,
1053,
306,
20728,
1806,
1955,
29918,
3970,
29032,
30004,
13,
3166,
17971,
2543,
273,
29889,
647,
2105,
29889,
555,
1053,
1571,
2034,
30004,
13,
3166,
17971,
2543,
273,
29889,
647,
2105,
29889,
555,
29889,
4299,
1053,
8125,
30004,
13,
3166,
17971,
2543,
273,
29889,
647,
2105,
29889,
555,
29889,
3084,
1061,
1053,
853,
1387,
24204,
30004,
13,
30004,
13,
30004,
13,
1990,
2169,
6020,
29898,
3195,
1125,
30004,
13,
1678,
6756,
13,
1678,
16641,
2891,
29918,
10818,
353,
525,
21289,
29915,
30004,
13,
1678,
6756,
13,
1678,
732,
1990,
5696,
30004,
13,
1678,
822,
12700,
29918,
7247,
29898,
25932,
1125,
30004,
13,
4706,
736,
306,
20728,
1806,
1955,
29918,
3970,
29032,
30004,
13,
1678,
6756,
13,
1678,
2944,
29918,
1989,
353,
1571,
2034,
29889,
1231,
4854,
29898,
12403,
29922,
5574,
29892,
2854,
1061,
11759,
8110,
802,
24204,
877,
667,
29918,
1989,
1495,
2314,
1678,
6756,
13,
1678,
3847,
29918,
1989,
353,
1571,
2034,
29889,
1231,
4854,
29898,
12403,
29922,
5574,
29892,
2322,
29922,
21289,
29918,
10818,
8443,
13,
1678,
2944,
29918,
1767,
353,
1571,
2034,
29889,
2061,
4854,
29898,
12403,
29922,
5574,
29892,
3309,
29922,
29906,
29945,
29945,
8443,
13,
1678,
2944,
29918,
14273,
353,
1571,
2034,
29889,
1231,
4854,
29898,
12403,
29922,
8824,
29892,
3309,
29922,
29906,
29945,
29945,
8443,
13,
1678,
2854,
29918,
15581,
353,
1571,
2034,
29889,
18146,
4854,
29898,
12403,
29922,
5574,
29892,
2322,
29922,
8824,
8443,
13,
1678,
6756,
13,
2
] |
sdk/eventhub/azure-eventhubs/azure/eventhub/common.py | pjquirk/azure-sdk-for-python | 1 | 193453 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from __future__ import unicode_literals
import datetime
import calendar
import json
import six
from uamqp import Message, BatchMessage
from uamqp import types, constants, errors
from uamqp.message import MessageHeader, MessageProperties
_NO_RETRY_ERRORS = (
b"com.microsoft:argument-out-of-range",
b"com.microsoft:entity-disabled",
b"com.microsoft:auth-failed",
b"com.microsoft:precondition-failed",
b"com.microsoft:argument-error"
)
def _error_handler(error):
"""
Called internally when an event has failed to send so we
can parse the error to determine whether we should attempt
to retry sending the event again.
Returns the action to take according to error type.
:param error: The error received in the send attempt.
:type error: Exception
:rtype: ~uamqp.errors.ErrorAction
"""
if error.condition == b'com.microsoft:server-busy':
return errors.ErrorAction(retry=True, backoff=4)
if error.condition == b'com.microsoft:timeout':
return errors.ErrorAction(retry=True, backoff=2)
if error.condition == b'com.microsoft:operation-cancelled':
return errors.ErrorAction(retry=True)
if error.condition == b"com.microsoft:container-close":
return errors.ErrorAction(retry=True, backoff=4)
if error.condition in _NO_RETRY_ERRORS:
return errors.ErrorAction(retry=False)
return errors.ErrorAction(retry=True)
def parse_sas_token(sas_token):
"""Parse a SAS token into its components.
:param sas_token: The SAS token.
:type sas_token: str
:rtype: dict[str, str]
"""
sas_data = {}
token = sas_token.partition(' ')[2]
fields = token.split('&')
for field in fields:
key, value = field.split('=', 1)
sas_data[key.lower()] = value
return sas_data
class EventData(object):
"""
The EventData class is a holder of event content.
Acts as a wrapper to an uamqp.message.Message object.
Example:
.. literalinclude:: ../examples/test_examples_eventhub.py
:start-after: [START create_event_data]
:end-before: [END create_event_data]
:language: python
:dedent: 4
:caption: Create instances of EventData
"""
PROP_SEQ_NUMBER = b"x-opt-sequence-number"
PROP_OFFSET = b"x-opt-offset"
PROP_PARTITION_KEY = b"x-opt-partition-key"
PROP_TIMESTAMP = b"x-opt-enqueued-time"
PROP_DEVICE_ID = b"iothub-connection-device-id"
def __init__(self, body=None, batch=None, to_device=None, message=None):
"""
Initialize EventData.
:param body: The data to send in a single message.
:type body: str, bytes or list
:param batch: A data generator to send batched messages.
:type batch: Generator
:param to_device: An IoT device to route to.
:type to_device: str
:param message: The received message.
:type message: ~uamqp.message.Message
"""
self._partition_key = types.AMQPSymbol(EventData.PROP_PARTITION_KEY)
self._annotations = {}
self._app_properties = {}
self.msg_properties = MessageProperties()
if to_device:
self.msg_properties.to = '/devices/{}/messages/devicebound'.format(to_device)
if batch:
self.message = BatchMessage(data=batch, multi_messages=True, properties=self.msg_properties)
elif message:
self.message = message
self.msg_properties = message.properties
self._annotations = message.annotations
self._app_properties = message.application_properties
else:
if isinstance(body, list) and body:
self.message = Message(body[0], properties=self.msg_properties)
for more in body[1:]:
self.message._body.append(more) # pylint: disable=protected-access
elif body is None:
raise ValueError("EventData cannot be None.")
else:
self.message = Message(body, properties=self.msg_properties)
@property
def sequence_number(self):
"""
The sequence number of the event data object.
:rtype: int or long
"""
return self._annotations.get(EventData.PROP_SEQ_NUMBER, None)
@property
def offset(self):
"""
The offset of the event data object.
:rtype: ~azure.eventhub.common.Offset
"""
try:
return Offset(self._annotations[EventData.PROP_OFFSET].decode('UTF-8'))
except (KeyError, AttributeError):
return None
@property
def enqueued_time(self):
"""
The enqueued timestamp of the event data object.
:rtype: datetime.datetime
"""
timestamp = self._annotations.get(EventData.PROP_TIMESTAMP, None)
if timestamp:
return datetime.datetime.utcfromtimestamp(float(timestamp)/1000)
return None
@property
def device_id(self):
"""
The device ID of the event data object. This is only used for
IoT Hub implementations.
:rtype: bytes
"""
return self._annotations.get(EventData.PROP_DEVICE_ID, None)
@property
def partition_key(self):
"""
The partition key of the event data object.
:rtype: bytes
"""
try:
return self._annotations[self._partition_key]
except KeyError:
return self._annotations.get(EventData.PROP_PARTITION_KEY, None)
@partition_key.setter
def partition_key(self, value):
"""
Set the partition key of the event data object.
:param value: The partition key to set.
:type value: str or bytes
"""
annotations = dict(self._annotations)
annotations[self._partition_key] = value
header = MessageHeader()
header.durable = True
self.message.annotations = annotations
self.message.header = header
self._annotations = annotations
@property
def application_properties(self):
"""
Application defined properties on the message.
:rtype: dict
"""
return self._app_properties
@application_properties.setter
def application_properties(self, value):
"""
Application defined properties on the message.
:param value: The application properties for the EventData.
:type value: dict
"""
self._app_properties = value
properties = dict(self._app_properties)
self.message.application_properties = properties
@property
def body(self):
"""
The body of the event data object.
:rtype: bytes or Generator[bytes]
"""
try:
return self.message.get_data()
except TypeError:
raise ValueError("Message data empty.")
def body_as_str(self, encoding='UTF-8'):
"""
The body of the event data as a string if the data is of a
compatible type.
:param encoding: The encoding to use for decoding message data.
Default is 'UTF-8'
:rtype: str or unicode
"""
data = self.body
try:
return "".join(b.decode(encoding) for b in data)
except TypeError:
return six.text_type(data)
except: # pylint: disable=bare-except
pass
try:
return data.decode(encoding)
except Exception as e:
raise TypeError("Message data is not compatible with string type: {}".format(e))
def body_as_json(self, encoding='UTF-8'):
"""
The body of the event loaded as a JSON object is the data is compatible.
:param encoding: The encoding to use for decoding message data.
Default is 'UTF-8'
:rtype: dict
"""
data_str = self.body_as_str(encoding=encoding)
try:
return json.loads(data_str)
except Exception as e:
raise TypeError("Event data is not compatible with JSON type: {}".format(e))
class Offset(object):
"""
The offset (position or timestamp) where a receiver starts. Examples:
Beginning of the event stream:
>>> offset = Offset("-1")
End of the event stream:
>>> offset = Offset("@latest")
Events after the specified offset:
>>> offset = Offset("12345")
Events from the specified offset:
>>> offset = Offset("12345", True)
Events after a datetime:
>>> offset = Offset(datetime.datetime.utcnow())
Events after a specific sequence number:
>>> offset = Offset(1506968696002)
"""
def __init__(self, value, inclusive=False):
"""
Initialize Offset.
:param value: The offset value.
:type value: ~datetime.datetime or int or str
:param inclusive: Whether to include the supplied value as the start point.
:type inclusive: bool
"""
self.value = value
self.inclusive = inclusive
def selector(self):
"""
Creates a selector expression of the offset.
:rtype: bytes
"""
operator = ">=" if self.inclusive else ">"
if isinstance(self.value, datetime.datetime):
timestamp = (calendar.timegm(self.value.utctimetuple()) * 1000) + (self.value.microsecond/1000)
return ("amqp.annotation.x-opt-enqueued-time {} '{}'".format(operator, int(timestamp))).encode('utf-8')
if isinstance(self.value, six.integer_types):
return ("amqp.annotation.x-opt-sequence-number {} '{}'".format(operator, self.value)).encode('utf-8')
return ("amqp.annotation.x-opt-offset {} '{}'".format(operator, self.value)).encode('utf-8')
class EventHubError(Exception):
"""
Represents an error happened in the client.
:ivar message: The error message.
:vartype message: str
:ivar error: The error condition, if available.
:vartype error: str
:ivar details: The error details, if included in the
service response.
:vartype details: dict[str, str]
"""
def __init__(self, message, details=None):
self.error = None
self.message = message
self.details = details
if isinstance(message, constants.MessageSendResult):
self.message = "Message send failed with result: {}".format(message)
if details and isinstance(details, Exception):
try:
condition = details.condition.value.decode('UTF-8')
except AttributeError:
condition = details.condition.decode('UTF-8')
_, _, self.error = condition.partition(':')
self.message += "\nError: {}".format(self.error)
try:
self._parse_error(details.description)
for detail in self.details:
self.message += "\n{}".format(detail)
except: # pylint: disable=bare-except
self.message += "\n{}".format(details)
super(EventHubError, self).__init__(self.message)
def _parse_error(self, error_list):
details = []
self.message = error_list if isinstance(error_list, six.text_type) else error_list.decode('UTF-8')
details_index = self.message.find(" Reference:")
if details_index >= 0:
details_msg = self.message[details_index + 1:]
self.message = self.message[0:details_index]
tracking_index = details_msg.index(", TrackingId:")
system_index = details_msg.index(", SystemTracker:")
timestamp_index = details_msg.index(", Timestamp:")
details.append(details_msg[:tracking_index])
details.append(details_msg[tracking_index + 2: system_index])
details.append(details_msg[system_index + 2: timestamp_index])
details.append(details_msg[timestamp_index + 2:])
self.details = details
| [
1,
396,
448,
2683,
2683,
2683,
2683,
2683,
1378,
5634,
13,
29937,
14187,
1266,
313,
29883,
29897,
7783,
15025,
29889,
2178,
10462,
21676,
29889,
13,
29937,
10413,
21144,
1090,
278,
341,
1806,
19245,
29889,
2823,
19245,
29889,
3945,
297,
278,
2060,
3876,
363,
19405,
2472,
29889,
13,
29937,
448,
2683,
2683,
2683,
2683,
2683,
1378,
5634,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
5215,
12865,
13,
5215,
17684,
13,
5215,
4390,
13,
13,
5215,
4832,
13,
13,
3166,
318,
314,
29939,
29886,
1053,
7777,
29892,
350,
905,
3728,
13,
3166,
318,
314,
29939,
29886,
1053,
4072,
29892,
17727,
29892,
4436,
13,
3166,
318,
314,
29939,
29886,
29889,
4906,
1053,
7777,
7850,
29892,
7777,
11857,
13,
13,
29918,
6632,
29918,
1525,
5659,
29979,
29918,
11432,
29903,
353,
313,
13,
1678,
289,
29908,
510,
29889,
4994,
29901,
23516,
29899,
449,
29899,
974,
29899,
3881,
613,
13,
1678,
289,
29908,
510,
29889,
4994,
29901,
10041,
29899,
18279,
613,
13,
1678,
289,
29908,
510,
29889,
4994,
29901,
5150,
29899,
26061,
613,
13,
1678,
289,
29908,
510,
29889,
4994,
29901,
1457,
16122,
29899,
26061,
613,
13,
1678,
289,
29908,
510,
29889,
4994,
29901,
23516,
29899,
2704,
29908,
13,
29897,
13,
13,
1753,
903,
2704,
29918,
13789,
29898,
2704,
1125,
13,
1678,
9995,
13,
1678,
3037,
839,
25106,
746,
385,
1741,
756,
5229,
304,
3638,
577,
591,
13,
1678,
508,
6088,
278,
1059,
304,
8161,
3692,
591,
881,
4218,
13,
1678,
304,
337,
2202,
9348,
278,
1741,
1449,
29889,
13,
1678,
16969,
278,
3158,
304,
2125,
5034,
304,
1059,
1134,
29889,
13,
13,
1678,
584,
3207,
1059,
29901,
450,
1059,
4520,
297,
278,
3638,
4218,
29889,
13,
1678,
584,
1853,
1059,
29901,
8960,
13,
1678,
584,
29878,
1853,
29901,
3695,
29884,
314,
29939,
29886,
29889,
12523,
29889,
2392,
4276,
13,
1678,
9995,
13,
1678,
565,
1059,
29889,
16122,
1275,
289,
29915,
510,
29889,
4994,
29901,
2974,
29899,
8262,
29891,
2396,
13,
4706,
736,
4436,
29889,
2392,
4276,
29898,
276,
2202,
29922,
5574,
29892,
1250,
2696,
29922,
29946,
29897,
13,
1678,
565,
1059,
29889,
16122,
1275,
289,
29915,
510,
29889,
4994,
29901,
15619,
2396,
13,
4706,
736,
4436,
29889,
2392,
4276,
29898,
276,
2202,
29922,
5574,
29892,
1250,
2696,
29922,
29906,
29897,
13,
1678,
565,
1059,
29889,
16122,
1275,
289,
29915,
510,
29889,
4994,
29901,
16453,
29899,
20713,
839,
2396,
13,
4706,
736,
4436,
29889,
2392,
4276,
29898,
276,
2202,
29922,
5574,
29897,
13,
1678,
565,
1059,
29889,
16122,
1275,
289,
29908,
510,
29889,
4994,
29901,
7611,
29899,
5358,
1115,
13,
4706,
736,
4436,
29889,
2392,
4276,
29898,
276,
2202,
29922,
5574,
29892,
1250,
2696,
29922,
29946,
29897,
13,
1678,
565,
1059,
29889,
16122,
297,
903,
6632,
29918,
1525,
5659,
29979,
29918,
11432,
29903,
29901,
13,
4706,
736,
4436,
29889,
2392,
4276,
29898,
276,
2202,
29922,
8824,
29897,
13,
1678,
736,
4436,
29889,
2392,
4276,
29898,
276,
2202,
29922,
5574,
29897,
13,
13,
13,
1753,
6088,
29918,
29879,
294,
29918,
6979,
29898,
29879,
294,
29918,
6979,
1125,
13,
1678,
9995,
12914,
263,
317,
3289,
5993,
964,
967,
7117,
29889,
13,
13,
1678,
584,
3207,
269,
294,
29918,
6979,
29901,
450,
317,
3289,
5993,
29889,
13,
1678,
584,
1853,
269,
294,
29918,
6979,
29901,
851,
13,
1678,
584,
29878,
1853,
29901,
9657,
29961,
710,
29892,
851,
29962,
13,
1678,
9995,
13,
1678,
269,
294,
29918,
1272,
353,
6571,
13,
1678,
5993,
353,
269,
294,
29918,
6979,
29889,
16707,
877,
525,
9601,
29906,
29962,
13,
1678,
4235,
353,
5993,
29889,
5451,
877,
29987,
1495,
13,
1678,
363,
1746,
297,
4235,
29901,
13,
4706,
1820,
29892,
995,
353,
1746,
29889,
5451,
877,
29922,
742,
29871,
29896,
29897,
13,
4706,
269,
294,
29918,
1272,
29961,
1989,
29889,
13609,
580,
29962,
353,
995,
13,
1678,
736,
269,
294,
29918,
1272,
13,
13,
13,
1990,
6864,
1469,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
450,
6864,
1469,
770,
338,
263,
19464,
310,
1741,
2793,
29889,
13,
1678,
3185,
29879,
408,
263,
14476,
304,
385,
318,
314,
29939,
29886,
29889,
4906,
29889,
3728,
1203,
29889,
13,
13,
1678,
8741,
29901,
13,
4706,
6317,
16333,
2856,
1057,
29772,
19057,
29914,
1688,
29918,
19057,
29918,
3696,
29882,
431,
29889,
2272,
13,
9651,
584,
2962,
29899,
7045,
29901,
518,
25826,
1653,
29918,
3696,
29918,
1272,
29962,
13,
9651,
584,
355,
29899,
11083,
29901,
518,
11794,
1653,
29918,
3696,
29918,
1272,
29962,
13,
9651,
584,
11675,
29901,
3017,
13,
9651,
584,
7176,
296,
29901,
29871,
29946,
13,
9651,
584,
6671,
29901,
6204,
8871,
310,
6864,
1469,
13,
13,
1678,
9995,
13,
13,
1678,
13756,
29925,
29918,
1660,
29984,
29918,
23207,
353,
289,
29908,
29916,
29899,
3670,
29899,
16506,
29899,
4537,
29908,
13,
1678,
13756,
29925,
29918,
27681,
10490,
353,
289,
29908,
29916,
29899,
3670,
29899,
10289,
29908,
13,
1678,
13756,
29925,
29918,
26092,
22122,
29918,
10818,
353,
289,
29908,
29916,
29899,
3670,
29899,
16707,
29899,
1989,
29908,
13,
1678,
13756,
29925,
29918,
15307,
1254,
19297,
353,
289,
29908,
29916,
29899,
3670,
29899,
264,
802,
6742,
29899,
2230,
29908,
13,
1678,
13756,
29925,
29918,
2287,
19059,
29918,
1367,
353,
289,
29908,
29875,
720,
431,
29899,
9965,
29899,
10141,
29899,
333,
29908,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3573,
29922,
8516,
29892,
9853,
29922,
8516,
29892,
304,
29918,
10141,
29922,
8516,
29892,
2643,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
25455,
6864,
1469,
29889,
13,
13,
4706,
584,
3207,
3573,
29901,
450,
848,
304,
3638,
297,
263,
2323,
2643,
29889,
13,
4706,
584,
1853,
3573,
29901,
851,
29892,
6262,
470,
1051,
13,
4706,
584,
3207,
9853,
29901,
319,
848,
15299,
304,
3638,
9853,
287,
7191,
29889,
13,
4706,
584,
1853,
9853,
29901,
3251,
1061,
13,
4706,
584,
3207,
304,
29918,
10141,
29901,
530,
22244,
29911,
4742,
304,
5782,
304,
29889,
13,
4706,
584,
1853,
304,
29918,
10141,
29901,
851,
13,
4706,
584,
3207,
2643,
29901,
450,
4520,
2643,
29889,
13,
4706,
584,
1853,
2643,
29901,
3695,
29884,
314,
29939,
29886,
29889,
4906,
29889,
3728,
13,
4706,
9995,
13,
4706,
1583,
3032,
16707,
29918,
1989,
353,
4072,
29889,
5194,
29984,
7024,
2789,
29898,
2624,
1469,
29889,
8618,
29925,
29918,
26092,
22122,
29918,
10818,
29897,
13,
4706,
1583,
3032,
6735,
800,
353,
6571,
13,
4706,
1583,
3032,
932,
29918,
11330,
353,
6571,
13,
4706,
1583,
29889,
7645,
29918,
11330,
353,
7777,
11857,
580,
13,
4706,
565,
304,
29918,
10141,
29901,
13,
9651,
1583,
29889,
7645,
29918,
11330,
29889,
517,
353,
8207,
3359,
1575,
19248,
6822,
19158,
29914,
10141,
9917,
4286,
4830,
29898,
517,
29918,
10141,
29897,
13,
4706,
565,
9853,
29901,
13,
9651,
1583,
29889,
4906,
353,
350,
905,
3728,
29898,
1272,
29922,
16175,
29892,
2473,
29918,
19158,
29922,
5574,
29892,
4426,
29922,
1311,
29889,
7645,
29918,
11330,
29897,
13,
4706,
25342,
2643,
29901,
13,
9651,
1583,
29889,
4906,
353,
2643,
13,
9651,
1583,
29889,
7645,
29918,
11330,
353,
2643,
29889,
11330,
13,
9651,
1583,
3032,
6735,
800,
353,
2643,
29889,
6735,
800,
13,
9651,
1583,
3032,
932,
29918,
11330,
353,
2643,
29889,
6214,
29918,
11330,
13,
4706,
1683,
29901,
13,
9651,
565,
338,
8758,
29898,
2587,
29892,
1051,
29897,
322,
3573,
29901,
13,
18884,
1583,
29889,
4906,
353,
7777,
29898,
2587,
29961,
29900,
1402,
4426,
29922,
1311,
29889,
7645,
29918,
11330,
29897,
13,
18884,
363,
901,
297,
3573,
29961,
29896,
29901,
5387,
13,
462,
1678,
1583,
29889,
4906,
3032,
2587,
29889,
4397,
29898,
5514,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
24681,
29899,
5943,
13,
9651,
25342,
3573,
338,
6213,
29901,
13,
18884,
12020,
7865,
2392,
703,
2624,
1469,
2609,
367,
6213,
23157,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
4906,
353,
7777,
29898,
2587,
29892,
4426,
29922,
1311,
29889,
7645,
29918,
11330,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
5665,
29918,
4537,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
450,
5665,
1353,
310,
278,
1741,
848,
1203,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
938,
470,
1472,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
6735,
800,
29889,
657,
29898,
2624,
1469,
29889,
8618,
29925,
29918,
1660,
29984,
29918,
23207,
29892,
6213,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
9210,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
450,
9210,
310,
278,
1741,
848,
1203,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
3695,
17688,
29889,
3696,
29882,
431,
29889,
9435,
29889,
10302,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
736,
5947,
842,
29898,
1311,
3032,
6735,
800,
29961,
2624,
1469,
29889,
8618,
29925,
29918,
27681,
10490,
1822,
13808,
877,
10496,
29899,
29947,
8785,
13,
4706,
5174,
313,
2558,
2392,
29892,
23833,
2392,
1125,
13,
9651,
736,
6213,
13,
13,
1678,
732,
6799,
13,
1678,
822,
427,
802,
6742,
29918,
2230,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
450,
427,
802,
6742,
14334,
310,
278,
1741,
848,
1203,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
12865,
29889,
12673,
13,
4706,
9995,
13,
4706,
14334,
353,
1583,
3032,
6735,
800,
29889,
657,
29898,
2624,
1469,
29889,
8618,
29925,
29918,
15307,
1254,
19297,
29892,
6213,
29897,
13,
4706,
565,
14334,
29901,
13,
9651,
736,
12865,
29889,
12673,
29889,
329,
29883,
3166,
16394,
29898,
7411,
29898,
16394,
6802,
29896,
29900,
29900,
29900,
29897,
13,
4706,
736,
6213,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4742,
29918,
333,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
450,
4742,
3553,
310,
278,
1741,
848,
1203,
29889,
910,
338,
871,
1304,
363,
13,
4706,
22244,
29911,
14533,
20240,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
6262,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
6735,
800,
29889,
657,
29898,
2624,
1469,
29889,
8618,
29925,
29918,
2287,
19059,
29918,
1367,
29892,
6213,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
8877,
29918,
1989,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
450,
8877,
1820,
310,
278,
1741,
848,
1203,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
6262,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
6735,
800,
29961,
1311,
3032,
16707,
29918,
1989,
29962,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
736,
1583,
3032,
6735,
800,
29889,
657,
29898,
2624,
1469,
29889,
8618,
29925,
29918,
26092,
22122,
29918,
10818,
29892,
6213,
29897,
13,
13,
1678,
732,
16707,
29918,
1989,
29889,
842,
357,
13,
1678,
822,
8877,
29918,
1989,
29898,
1311,
29892,
995,
1125,
13,
4706,
9995,
13,
4706,
3789,
278,
8877,
1820,
310,
278,
1741,
848,
1203,
29889,
13,
13,
4706,
584,
3207,
995,
29901,
450,
8877,
1820,
304,
731,
29889,
13,
4706,
584,
1853,
995,
29901,
851,
470,
6262,
13,
4706,
9995,
13,
4706,
25495,
353,
9657,
29898,
1311,
3032,
6735,
800,
29897,
13,
4706,
25495,
29961,
1311,
3032,
16707,
29918,
1989,
29962,
353,
995,
13,
4706,
4839,
353,
7777,
7850,
580,
13,
4706,
4839,
29889,
29881,
21115,
353,
5852,
13,
4706,
1583,
29889,
4906,
29889,
6735,
800,
353,
25495,
13,
4706,
1583,
29889,
4906,
29889,
6672,
353,
4839,
13,
4706,
1583,
3032,
6735,
800,
353,
25495,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2280,
29918,
11330,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
8427,
3342,
4426,
373,
278,
2643,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
9657,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
932,
29918,
11330,
13,
13,
1678,
732,
6214,
29918,
11330,
29889,
842,
357,
13,
1678,
822,
2280,
29918,
11330,
29898,
1311,
29892,
995,
1125,
13,
4706,
9995,
13,
4706,
8427,
3342,
4426,
373,
278,
2643,
29889,
13,
13,
4706,
584,
3207,
995,
29901,
450,
2280,
4426,
363,
278,
6864,
1469,
29889,
13,
4706,
584,
1853,
995,
29901,
9657,
13,
4706,
9995,
13,
4706,
1583,
3032,
932,
29918,
11330,
353,
995,
13,
4706,
4426,
353,
9657,
29898,
1311,
3032,
932,
29918,
11330,
29897,
13,
4706,
1583,
29889,
4906,
29889,
6214,
29918,
11330,
353,
4426,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3573,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
450,
3573,
310,
278,
1741,
848,
1203,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
6262,
470,
3251,
1061,
29961,
13193,
29962,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
29889,
4906,
29889,
657,
29918,
1272,
580,
13,
4706,
5174,
20948,
29901,
13,
9651,
12020,
7865,
2392,
703,
3728,
848,
4069,
23157,
13,
13,
1678,
822,
3573,
29918,
294,
29918,
710,
29898,
1311,
29892,
8025,
2433,
10496,
29899,
29947,
29374,
13,
4706,
9995,
13,
4706,
450,
3573,
310,
278,
1741,
848,
408,
263,
1347,
565,
278,
848,
338,
310,
263,
13,
4706,
15878,
1134,
29889,
13,
13,
4706,
584,
3207,
8025,
29901,
450,
8025,
304,
671,
363,
1602,
3689,
2643,
848,
29889,
13,
308,
13109,
338,
525,
10496,
29899,
29947,
29915,
13,
4706,
584,
29878,
1853,
29901,
851,
470,
29104,
13,
4706,
9995,
13,
4706,
848,
353,
1583,
29889,
2587,
13,
4706,
1018,
29901,
13,
9651,
736,
376,
1642,
7122,
29898,
29890,
29889,
13808,
29898,
22331,
29897,
363,
289,
297,
848,
29897,
13,
4706,
5174,
20948,
29901,
13,
9651,
736,
4832,
29889,
726,
29918,
1853,
29898,
1272,
29897,
13,
4706,
5174,
29901,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
18354,
29899,
19499,
13,
9651,
1209,
13,
4706,
1018,
29901,
13,
9651,
736,
848,
29889,
13808,
29898,
22331,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
12020,
20948,
703,
3728,
848,
338,
451,
15878,
411,
1347,
1134,
29901,
6571,
1642,
4830,
29898,
29872,
876,
13,
13,
1678,
822,
3573,
29918,
294,
29918,
3126,
29898,
1311,
29892,
8025,
2433,
10496,
29899,
29947,
29374,
13,
4706,
9995,
13,
4706,
450,
3573,
310,
278,
1741,
7500,
408,
263,
4663,
1203,
338,
278,
848,
338,
15878,
29889,
13,
13,
4706,
584,
3207,
8025,
29901,
450,
8025,
304,
671,
363,
1602,
3689,
2643,
848,
29889,
13,
308,
13109,
338,
525,
10496,
29899,
29947,
29915,
13,
4706,
584,
29878,
1853,
29901,
9657,
13,
4706,
9995,
13,
4706,
848,
29918,
710,
353,
1583,
29889,
2587,
29918,
294,
29918,
710,
29898,
22331,
29922,
22331,
29897,
13,
4706,
1018,
29901,
13,
9651,
736,
4390,
29889,
18132,
29898,
1272,
29918,
710,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
12020,
20948,
703,
2624,
848,
338,
451,
15878,
411,
4663,
1134,
29901,
6571,
1642,
4830,
29898,
29872,
876,
13,
13,
13,
1990,
5947,
842,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
450,
9210,
313,
3283,
470,
14334,
29897,
988,
263,
19870,
8665,
29889,
1222,
9422,
29901,
13,
13,
1678,
14893,
1076,
310,
278,
1741,
4840,
29901,
13,
418,
8653,
9210,
353,
5947,
842,
703,
29899,
29896,
1159,
13,
1678,
2796,
310,
278,
1741,
4840,
29901,
13,
418,
8653,
9210,
353,
5947,
842,
29475,
12333,
1159,
13,
1678,
28488,
1156,
278,
6790,
9210,
29901,
13,
418,
8653,
9210,
353,
5947,
842,
703,
29896,
29906,
29941,
29946,
29945,
1159,
13,
1678,
28488,
515,
278,
6790,
9210,
29901,
13,
418,
8653,
9210,
353,
5947,
842,
703,
29896,
29906,
29941,
29946,
29945,
613,
5852,
29897,
13,
1678,
28488,
1156,
263,
12865,
29901,
13,
418,
8653,
9210,
353,
5947,
842,
29898,
12673,
29889,
12673,
29889,
329,
29883,
3707,
3101,
13,
1678,
28488,
1156,
263,
2702,
5665,
1353,
29901,
13,
418,
8653,
9210,
353,
5947,
842,
29898,
29896,
29945,
29900,
29953,
29929,
29953,
29947,
29953,
29929,
29953,
29900,
29900,
29906,
29897,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
995,
29892,
20978,
573,
29922,
8824,
1125,
13,
4706,
9995,
13,
4706,
25455,
5947,
842,
29889,
13,
13,
4706,
584,
3207,
995,
29901,
450,
9210,
995,
29889,
13,
4706,
584,
1853,
995,
29901,
3695,
12673,
29889,
12673,
470,
938,
470,
851,
13,
4706,
584,
3207,
20978,
573,
29901,
26460,
304,
3160,
278,
19056,
995,
408,
278,
1369,
1298,
29889,
13,
4706,
584,
1853,
20978,
573,
29901,
6120,
13,
4706,
9995,
13,
4706,
1583,
29889,
1767,
353,
995,
13,
4706,
1583,
29889,
262,
7009,
573,
353,
20978,
573,
13,
13,
1678,
822,
11764,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
6760,
1078,
263,
11764,
4603,
310,
278,
9210,
29889,
13,
13,
4706,
584,
29878,
1853,
29901,
6262,
13,
4706,
9995,
13,
4706,
5455,
353,
376,
29958,
543,
565,
1583,
29889,
262,
7009,
573,
1683,
376,
11903,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
1767,
29892,
12865,
29889,
12673,
1125,
13,
9651,
14334,
353,
313,
23392,
29889,
9346,
387,
29885,
29898,
1311,
29889,
1767,
29889,
329,
312,
17528,
29884,
552,
3101,
334,
29871,
29896,
29900,
29900,
29900,
29897,
718,
313,
1311,
29889,
1767,
29889,
29885,
2357,
7496,
29914,
29896,
29900,
29900,
29900,
29897,
13,
9651,
736,
4852,
314,
29939,
29886,
29889,
18317,
29889,
29916,
29899,
3670,
29899,
264,
802,
6742,
29899,
2230,
6571,
525,
8875,
29915,
1642,
4830,
29898,
6891,
29892,
938,
29898,
16394,
876,
467,
12508,
877,
9420,
29899,
29947,
1495,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
1767,
29892,
4832,
29889,
16031,
29918,
8768,
1125,
13,
9651,
736,
4852,
314,
29939,
29886,
29889,
18317,
29889,
29916,
29899,
3670,
29899,
16506,
29899,
4537,
6571,
525,
8875,
29915,
1642,
4830,
29898,
6891,
29892,
1583,
29889,
1767,
8106,
12508,
877,
9420,
29899,
29947,
1495,
13,
4706,
736,
4852,
314,
29939,
29886,
29889,
18317,
29889,
29916,
29899,
3670,
29899,
10289,
6571,
525,
8875,
29915,
1642,
4830,
29898,
6891,
29892,
1583,
29889,
1767,
8106,
12508,
877,
9420,
29899,
29947,
1495,
13,
13,
13,
1990,
6864,
16046,
2392,
29898,
2451,
1125,
13,
1678,
9995,
13,
1678,
830,
4569,
1237,
385,
1059,
9559,
297,
278,
3132,
29889,
13,
13,
1678,
584,
440,
279,
2643,
29901,
450,
1059,
2643,
29889,
13,
1678,
584,
29894,
442,
668,
2643,
29901,
851,
13,
1678,
584,
440,
279,
1059,
29901,
450,
1059,
4195,
29892,
565,
3625,
29889,
13,
1678,
584,
29894,
442,
668,
1059,
29901,
851,
13,
1678,
584,
440,
279,
4902,
29901,
450,
1059,
4902,
29892,
565,
5134,
297,
278,
13,
268,
2669,
2933,
29889,
13,
1678,
584,
29894,
442,
668,
4902,
29901,
9657,
29961,
710,
29892,
851,
29962,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2643,
29892,
4902,
29922,
8516,
1125,
13,
4706,
1583,
29889,
2704,
353,
6213,
13,
4706,
1583,
29889,
4906,
353,
2643,
13,
4706,
1583,
29889,
14144,
353,
4902,
13,
4706,
565,
338,
8758,
29898,
4906,
29892,
17727,
29889,
3728,
12600,
3591,
1125,
13,
9651,
1583,
29889,
4906,
353,
376,
3728,
3638,
5229,
411,
1121,
29901,
6571,
1642,
4830,
29898,
4906,
29897,
13,
4706,
565,
4902,
322,
338,
8758,
29898,
14144,
29892,
8960,
1125,
13,
9651,
1018,
29901,
13,
18884,
4195,
353,
4902,
29889,
16122,
29889,
1767,
29889,
13808,
877,
10496,
29899,
29947,
1495,
13,
9651,
5174,
23833,
2392,
29901,
13,
18884,
4195,
353,
4902,
29889,
16122,
29889,
13808,
877,
10496,
29899,
29947,
1495,
13,
9651,
17117,
17117,
1583,
29889,
2704,
353,
4195,
29889,
16707,
877,
29901,
1495,
13,
9651,
1583,
29889,
4906,
4619,
6634,
29876,
2392,
29901,
6571,
1642,
4830,
29898,
1311,
29889,
2704,
29897,
13,
9651,
1018,
29901,
13,
18884,
1583,
3032,
5510,
29918,
2704,
29898,
14144,
29889,
8216,
29897,
13,
18884,
363,
9493,
297,
1583,
29889,
14144,
29901,
13,
462,
1678,
1583,
29889,
4906,
4619,
6634,
29876,
8875,
1642,
4830,
29898,
16432,
29897,
13,
9651,
5174,
29901,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
18354,
29899,
19499,
13,
18884,
1583,
29889,
4906,
4619,
6634,
29876,
8875,
1642,
4830,
29898,
14144,
29897,
13,
4706,
2428,
29898,
2624,
16046,
2392,
29892,
1583,
467,
1649,
2344,
12035,
1311,
29889,
4906,
29897,
13,
13,
1678,
822,
903,
5510,
29918,
2704,
29898,
1311,
29892,
1059,
29918,
1761,
1125,
13,
4706,
4902,
353,
5159,
13,
4706,
1583,
29889,
4906,
353,
1059,
29918,
1761,
565,
338,
8758,
29898,
2704,
29918,
1761,
29892,
4832,
29889,
726,
29918,
1853,
29897,
1683,
1059,
29918,
1761,
29889,
13808,
877,
10496,
29899,
29947,
1495,
13,
4706,
4902,
29918,
2248,
353,
1583,
29889,
4906,
29889,
2886,
703,
12105,
29901,
1159,
13,
4706,
565,
4902,
29918,
2248,
6736,
29871,
29900,
29901,
13,
9651,
4902,
29918,
7645,
353,
1583,
29889,
4906,
29961,
14144,
29918,
2248,
718,
29871,
29896,
17531,
13,
9651,
1583,
29889,
4906,
353,
1583,
29889,
4906,
29961,
29900,
29901,
14144,
29918,
2248,
29962,
13,
13,
9651,
23110,
29918,
2248,
353,
4902,
29918,
7645,
29889,
2248,
28165,
17026,
292,
1204,
29901,
1159,
13,
9651,
1788,
29918,
2248,
353,
4902,
29918,
7645,
29889,
2248,
28165,
2184,
5323,
4937,
29901,
1159,
13,
9651,
14334,
29918,
2248,
353,
4902,
29918,
7645,
29889,
2248,
28165,
7870,
7416,
29901,
1159,
13,
9651,
4902,
29889,
4397,
29898,
14144,
29918,
7645,
7503,
11294,
292,
29918,
2248,
2314,
13,
9651,
4902,
29889,
4397,
29898,
14144,
29918,
7645,
29961,
11294,
292,
29918,
2248,
718,
29871,
29906,
29901,
1788,
29918,
2248,
2314,
13,
9651,
4902,
29889,
4397,
29898,
14144,
29918,
7645,
29961,
5205,
29918,
2248,
718,
29871,
29906,
29901,
14334,
29918,
2248,
2314,
13,
9651,
4902,
29889,
4397,
29898,
14144,
29918,
7645,
29961,
16394,
29918,
2248,
718,
29871,
29906,
29901,
2314,
13,
9651,
1583,
29889,
14144,
353,
4902,
13,
2
] |
src/kernel-graphql/riotapi/objects.py | pseudonym117/kernel-graphql | 1 | 82003 | from graphene import Boolean, Field, Int, List, ObjectType, String, Schema
from riotwatcher import RiotWatcher, ApiError
from .riot_graphene.Champion import ChampionInfo
from .riot_graphene.League import ApexLeagueType, LeagueList, RankedQueue
from .riot_graphene.LolStatus import ShardStatus
from .riot_graphene.Match import Match
from .riot_graphene.Spectator import FeaturedGames
from .riot_graphene.Summoner import Summoner
class Query(ObjectType):
championRotation = Field(ChampionInfo, region=String())
featuredGames = Field(FeaturedGames, region=String())
league = Field(
LeagueList,
region=String(),
tier=ApexLeagueType(required=False),
queue=RankedQueue(required=False),
leagueId=String(required=False),
)
match = Field(Match, region=String(), matchId=String())
status = Field(ShardStatus, region=String())
summoner = Field(
Summoner,
region=String(),
name=String(required=False),
accountId=String(required=False),
puuid=String(required=False),
summonerId=String(required=False),
)
def resolve_championRotation(self, info, region: str):
watcher: RiotWatcher = info.context
champs = watcher.champion.rotations(region)
return ChampionInfo(region, champs)
def resolve_featuredGames(self, info, region: str):
watcher: RiotWatcher = info.context
games = watcher.spectator.featured_games(region)
return FeaturedGames(region, games)
def resolve_league(
self,
info,
region: str,
tier: int = None,
queue: int = None,
leagueId: str = None,
):
watcher: RiotWatcher = info.context
if leagueId:
leagues = watcher.league.by_id(region, leagueId)
else:
if not queue or not tier:
raise ValueError("both queue and tier must be provided")
queue = RankedQueue.str_from_val(queue)
if tier == ApexLeagueType.CHALLENGER:
leagues = watcher.league.challenger_by_queue(region, queue)
elif tier == ApexLeagueType.GRANDMASTER:
leagues = watcher.league.grandmaster_by_queue(region, queue)
elif tier == ApexLeagueType.MASTER:
leagues = watcher.league.masters_by_queue(region, queue)
else:
raise ValueError("invalid tier provided")
return LeagueList(region, leagues)
def resolve_match(self, info, region: str, matchId: str):
watcher: RiotWatcher = info.context
try:
match = watcher.match.by_id(region, matchId)
return Match(region, match)
except ApiError as e:
if e.response.status_code == 404:
return None
raise
def resolve_status(self, info, region: str):
watcher: RiotWatcher = info.context
shard = watcher.lol_status.shard_data(region=region)
return ShardStatus(region, shard)
def resolve_summoner(
self,
info,
region: str,
name: str = None,
accountId: str = None,
puuid: str = None,
summonerId: str = None,
):
watcher: RiotWatcher = info.context
if puuid:
summoner = watcher.summoner.by_puuid(region, puuid)
elif accountId:
summoner = watcher.summoner.by_account(region, accountId)
elif summonerId:
summoner = watcher.summoner.by_id(region, summonerId)
elif name:
summoner = watcher.summoner.by_name(region, name)
else:
raise ValueError("some identified must be defined")
return Summoner(region, summoner)
schema = Schema(query=Query)
| [
1,
515,
3983,
1600,
1053,
11185,
29892,
8989,
29892,
3159,
29892,
2391,
29892,
4669,
1542,
29892,
1714,
29892,
1102,
2603,
13,
13,
3166,
10107,
327,
12344,
261,
1053,
21710,
327,
24709,
261,
29892,
29749,
2392,
13,
13,
3166,
869,
374,
327,
29918,
4262,
1600,
29889,
1451,
3103,
1053,
5257,
3401,
13,
3166,
869,
374,
327,
29918,
4262,
1600,
29889,
3226,
3437,
1053,
319,
412,
29916,
3226,
3437,
1542,
29892,
5165,
1293,
29892,
22125,
287,
10620,
13,
3166,
869,
374,
327,
29918,
4262,
1600,
29889,
29931,
324,
5709,
1053,
1383,
538,
5709,
13,
3166,
869,
374,
327,
29918,
4262,
1600,
29889,
9652,
1053,
14514,
13,
3166,
869,
374,
327,
29918,
4262,
1600,
29889,
29903,
1103,
1061,
1053,
5169,
1535,
29881,
29954,
1280,
13,
3166,
869,
374,
327,
29918,
4262,
1600,
29889,
11139,
3712,
261,
1053,
6991,
3712,
261,
13,
13,
13,
1990,
13641,
29898,
2061,
1542,
1125,
13,
1678,
8064,
21281,
362,
353,
8989,
29898,
1451,
3103,
3401,
29892,
5120,
29922,
1231,
3101,
13,
1678,
15000,
29954,
1280,
353,
8989,
29898,
19132,
29881,
29954,
1280,
29892,
5120,
29922,
1231,
3101,
13,
1678,
13225,
353,
8989,
29898,
13,
4706,
5165,
1293,
29892,
13,
4706,
5120,
29922,
1231,
3285,
13,
4706,
26485,
29922,
29909,
412,
29916,
3226,
3437,
1542,
29898,
12403,
29922,
8824,
511,
13,
4706,
9521,
29922,
29934,
804,
287,
10620,
29898,
12403,
29922,
8824,
511,
13,
4706,
13225,
1204,
29922,
1231,
29898,
12403,
29922,
8824,
511,
13,
1678,
1723,
13,
1678,
1993,
353,
8989,
29898,
9652,
29892,
5120,
29922,
1231,
3285,
1993,
1204,
29922,
1231,
3101,
13,
1678,
4660,
353,
8989,
29898,
2713,
538,
5709,
29892,
5120,
29922,
1231,
3101,
13,
1678,
2533,
3712,
261,
353,
8989,
29898,
13,
4706,
6991,
3712,
261,
29892,
13,
4706,
5120,
29922,
1231,
3285,
13,
4706,
1024,
29922,
1231,
29898,
12403,
29922,
8824,
511,
13,
4706,
3633,
1204,
29922,
1231,
29898,
12403,
29922,
8824,
511,
13,
4706,
2653,
5416,
29922,
1231,
29898,
12403,
29922,
8824,
511,
13,
4706,
2533,
3712,
261,
1204,
29922,
1231,
29898,
12403,
29922,
8824,
511,
13,
1678,
1723,
13,
13,
1678,
822,
8814,
29918,
305,
3103,
21281,
362,
29898,
1311,
29892,
5235,
29892,
5120,
29901,
851,
1125,
13,
4706,
6505,
261,
29901,
21710,
327,
24709,
261,
353,
5235,
29889,
4703,
13,
13,
4706,
11179,
567,
353,
6505,
261,
29889,
305,
3103,
29889,
5450,
800,
29898,
12803,
29897,
13,
13,
4706,
736,
5257,
3401,
29898,
12803,
29892,
11179,
567,
29897,
13,
13,
1678,
822,
8814,
29918,
14394,
29881,
29954,
1280,
29898,
1311,
29892,
5235,
29892,
5120,
29901,
851,
1125,
13,
4706,
6505,
261,
29901,
21710,
327,
24709,
261,
353,
5235,
29889,
4703,
13,
13,
4706,
8090,
353,
6505,
261,
29889,
21494,
1061,
29889,
14394,
29881,
29918,
29887,
1280,
29898,
12803,
29897,
13,
13,
4706,
736,
5169,
1535,
29881,
29954,
1280,
29898,
12803,
29892,
8090,
29897,
13,
13,
1678,
822,
8814,
29918,
280,
3437,
29898,
13,
4706,
1583,
29892,
13,
4706,
5235,
29892,
13,
4706,
5120,
29901,
851,
29892,
13,
4706,
26485,
29901,
938,
353,
6213,
29892,
13,
4706,
9521,
29901,
938,
353,
6213,
29892,
13,
4706,
13225,
1204,
29901,
851,
353,
6213,
29892,
13,
268,
1125,
13,
4706,
6505,
261,
29901,
21710,
327,
24709,
261,
353,
5235,
29889,
4703,
13,
13,
4706,
565,
13225,
1204,
29901,
13,
9651,
454,
21628,
353,
6505,
261,
29889,
280,
3437,
29889,
1609,
29918,
333,
29898,
12803,
29892,
13225,
1204,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
451,
9521,
470,
451,
26485,
29901,
13,
18884,
12020,
7865,
2392,
703,
20313,
9521,
322,
26485,
1818,
367,
4944,
1159,
13,
13,
9651,
9521,
353,
22125,
287,
10620,
29889,
710,
29918,
3166,
29918,
791,
29898,
9990,
29897,
13,
13,
9651,
565,
26485,
1275,
319,
412,
29916,
3226,
3437,
1542,
29889,
3210,
1964,
19271,
1001,
29901,
13,
18884,
454,
21628,
353,
6505,
261,
29889,
280,
3437,
29889,
305,
5442,
914,
29918,
1609,
29918,
9990,
29898,
12803,
29892,
9521,
29897,
13,
9651,
25342,
26485,
1275,
319,
412,
29916,
3226,
3437,
1542,
29889,
14345,
9468,
1529,
1254,
1001,
29901,
13,
18884,
454,
21628,
353,
6505,
261,
29889,
280,
3437,
29889,
27857,
6207,
29918,
1609,
29918,
9990,
29898,
12803,
29892,
9521,
29897,
13,
9651,
25342,
26485,
1275,
319,
412,
29916,
3226,
3437,
1542,
29889,
1529,
1254,
1001,
29901,
13,
18884,
454,
21628,
353,
6505,
261,
29889,
280,
3437,
29889,
6207,
29879,
29918,
1609,
29918,
9990,
29898,
12803,
29892,
9521,
29897,
13,
9651,
1683,
29901,
13,
18884,
12020,
7865,
2392,
703,
20965,
26485,
4944,
1159,
13,
13,
4706,
736,
5165,
1293,
29898,
12803,
29892,
454,
21628,
29897,
13,
13,
1678,
822,
8814,
29918,
4352,
29898,
1311,
29892,
5235,
29892,
5120,
29901,
851,
29892,
1993,
1204,
29901,
851,
1125,
13,
4706,
6505,
261,
29901,
21710,
327,
24709,
261,
353,
5235,
29889,
4703,
13,
13,
4706,
1018,
29901,
13,
9651,
1993,
353,
6505,
261,
29889,
4352,
29889,
1609,
29918,
333,
29898,
12803,
29892,
1993,
1204,
29897,
13,
13,
9651,
736,
14514,
29898,
12803,
29892,
1993,
29897,
13,
4706,
5174,
29749,
2392,
408,
321,
29901,
13,
9651,
565,
321,
29889,
5327,
29889,
4882,
29918,
401,
1275,
29871,
29946,
29900,
29946,
29901,
13,
18884,
736,
6213,
13,
9651,
12020,
13,
13,
1678,
822,
8814,
29918,
4882,
29898,
1311,
29892,
5235,
29892,
5120,
29901,
851,
1125,
13,
4706,
6505,
261,
29901,
21710,
327,
24709,
261,
353,
5235,
29889,
4703,
13,
13,
4706,
528,
538,
353,
6505,
261,
29889,
29880,
324,
29918,
4882,
29889,
845,
538,
29918,
1272,
29898,
12803,
29922,
12803,
29897,
13,
13,
4706,
736,
1383,
538,
5709,
29898,
12803,
29892,
528,
538,
29897,
13,
13,
1678,
822,
8814,
29918,
2083,
3712,
261,
29898,
13,
4706,
1583,
29892,
13,
4706,
5235,
29892,
13,
4706,
5120,
29901,
851,
29892,
13,
4706,
1024,
29901,
851,
353,
6213,
29892,
13,
4706,
3633,
1204,
29901,
851,
353,
6213,
29892,
13,
4706,
2653,
5416,
29901,
851,
353,
6213,
29892,
13,
4706,
2533,
3712,
261,
1204,
29901,
851,
353,
6213,
29892,
13,
268,
1125,
13,
4706,
6505,
261,
29901,
21710,
327,
24709,
261,
353,
5235,
29889,
4703,
13,
13,
4706,
565,
2653,
5416,
29901,
13,
9651,
2533,
3712,
261,
353,
6505,
261,
29889,
2083,
3712,
261,
29889,
1609,
29918,
3746,
5416,
29898,
12803,
29892,
2653,
5416,
29897,
13,
4706,
25342,
3633,
1204,
29901,
13,
9651,
2533,
3712,
261,
353,
6505,
261,
29889,
2083,
3712,
261,
29889,
1609,
29918,
10149,
29898,
12803,
29892,
3633,
1204,
29897,
13,
4706,
25342,
2533,
3712,
261,
1204,
29901,
13,
9651,
2533,
3712,
261,
353,
6505,
261,
29889,
2083,
3712,
261,
29889,
1609,
29918,
333,
29898,
12803,
29892,
2533,
3712,
261,
1204,
29897,
13,
4706,
25342,
1024,
29901,
13,
9651,
2533,
3712,
261,
353,
6505,
261,
29889,
2083,
3712,
261,
29889,
1609,
29918,
978,
29898,
12803,
29892,
1024,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
703,
5372,
15659,
1818,
367,
3342,
1159,
13,
13,
4706,
736,
6991,
3712,
261,
29898,
12803,
29892,
2533,
3712,
261,
29897,
13,
13,
13,
11010,
353,
1102,
2603,
29898,
1972,
29922,
3010,
29897,
13,
2
] |
setup.py | jparsai/fabric8-analytics-auth | 0 | 1601359 | """Project setup file."""
from setuptools import setup
def get_requirements():
"""Parse all packages mentioned in the 'requirements.txt' file."""
with open('requirements.txt') as fd:
return fd.read().splitlines()
setup(
name='fabric8a_auth',
version='0.0.1',
description='a pip-installable package example',
license='Apache License 2.0',
packages=['fabric8a_auth'],
author='<NAME>',
author_email='<EMAIL>',
keywords=['fabric8-analytics'],
url='https://github.com/fabric8-analytics/fabric8-analytics-auth',
install_requires=get_requirements(),
)
| [
1,
9995,
7653,
6230,
934,
1213,
15945,
13,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
13,
1753,
679,
29918,
12277,
1860,
7295,
13,
1678,
9995,
12914,
599,
9741,
5276,
297,
278,
525,
12277,
1860,
29889,
3945,
29915,
934,
1213,
15945,
13,
1678,
411,
1722,
877,
12277,
1860,
29889,
3945,
1495,
408,
285,
29881,
29901,
13,
4706,
736,
285,
29881,
29889,
949,
2141,
5451,
9012,
580,
13,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
16582,
2200,
29947,
29874,
29918,
5150,
742,
13,
1678,
1873,
2433,
29900,
29889,
29900,
29889,
29896,
742,
13,
1678,
6139,
2433,
29874,
8450,
29899,
6252,
519,
3577,
1342,
742,
13,
1678,
19405,
2433,
17396,
1829,
19245,
29871,
29906,
29889,
29900,
742,
13,
1678,
9741,
29922,
1839,
16582,
2200,
29947,
29874,
29918,
5150,
7464,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
1678,
29361,
29922,
1839,
16582,
2200,
29947,
29899,
7054,
22026,
7464,
13,
1678,
3142,
2433,
991,
597,
3292,
29889,
510,
29914,
16582,
2200,
29947,
29899,
7054,
22026,
29914,
16582,
2200,
29947,
29899,
7054,
22026,
29899,
5150,
742,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
657,
29918,
12277,
1860,
3285,
13,
29897,
13,
2
] |
tic_tac_toe/admin.py | ricardopereiraesilva/Tic_Tac_Toe_OO_Python_Django | 1 | 154496 | <filename>tic_tac_toe/admin.py
from django.contrib import admin
from .models import JVDjangoDBModel
admin.site.register(JVDjangoDBModel)
| [
1,
529,
9507,
29958,
29873,
293,
29918,
21229,
29918,
517,
29872,
29914,
6406,
29889,
2272,
13,
3166,
9557,
29889,
21570,
1053,
4113,
13,
13,
3166,
869,
9794,
1053,
435,
10699,
5364,
4051,
3195,
13,
13,
6406,
29889,
2746,
29889,
9573,
29898,
29967,
10699,
5364,
4051,
3195,
29897,
13,
2
] |
Parse_SOM.py | timletz/materials_datascience_uw_somlab | 1 | 146077 | import re
import pandas as pd
import numpy as np
COLUMN_NAMES = [
'Material family',
'Youngs modulus',
'Specific stiffness',
'Yield strength',
'Tensile strength',
'Specific strength',
'Elongation',
'Compressive strength',
'Flexural modulus',
'Flexural strength',
'Shear modulus',
'Bulk modulus',
'Poisson ratio',
'Shape factor',
'Hardness vickers',
'Elastic stored energy',
'Fatigue strength',
'Fracture toughness',
'Toughness',
'Ductility index',
'Melting point',
'Max service temp',
'Min service temp',
'Thermal conductivity',
'Specific heat capacity',
'Thermal expansion coefficient',
'Thermal shock resistance',
'Thermal distortion resistance',
'Latent heat of fusion',
'Electrical resistivity',
'Electrical conductivity',
'Galvanic potential',
'Mechanical loss coefficient',
]
BAD_PROPERTIES = [
'Elongation', # This is because there's over 600 bad properties in the dataset
'Hardness vickers',
# not worth saving
'Specific stiffness',
'Specific strength',
'Shape factor',
'Elastic stored energy',
'Toughness',
'Ductility index',
'Thermal shock resistance',
'Thermal distortion resistance',
# These properties are not actually real properties of the material
'Max service temp',
'Min service temp',
'Electrical resistivity',
# This really messes with our data selection
'Galvanic potential',
]
# These are materials with invalid values for one or more properties
# This entry is here because there's materials with higher, but valid values
# And I don't want to lose them
BAD_MATERIALS = [
"PEEK/IM carbon fiber, UD prepreg, UD lay-up"
]
def parsing_material_data(material_text, new_file):
with open(material_text, "r") as stuff_to_write:
with open(new_file, "w") as stuff_written:
in_thermal_properties = False
in_electrical_properties = False
in_mechanical_properties = False
in_impact_properties = False
for line in stuff_to_write:
if line.startswith("done"):
stuff_written.write(line)
elif "Mechanical properties" in line:
in_mechanical_properties = True
elif "Impact & fracture properties" in line:
in_mechanical_properties = False
in_impact_properties = True
elif "Thermal properties" in line:
in_thermal_properties = True
in_impact_properties = False
elif "Electrical properties" in line:
in_thermal_properties = False
in_electrical_properties = True
elif "Magnetic properties" in line:
in_electrical_properties = False
in_mechanical_properties = False
in_thermal_properties = False
in_impact_properties = False
elif "Mechanical loss coefficient" in line:
stuff_written.write(line)
elif line.startswith("Material family"):
stuff_written.write(line)
elif in_thermal_properties is True or in_electrical_properties is True or in_mechanical_properties is True or in_impact_properties is True:
stuff_written.write(line)
def parsing_refined_data(new_file):
material_name = []
material_family = []
young_modulus_values = []
specific_stiffness_values = []
yield_strength_values = []
tensile_strength_values = []
specific_strength_values = []
elongation_values = []
compressive_strength_values = []
flexural_modulus_values = []
flexural_strength_values = []
shear_modulus_values = []
bulk_modulus_values = []
poisson_ratio_values = []
shape_factor_values = []
hardness_vickers_values = []
elastic_stored_energy_values = []
fatigue_strength_values = []
fracture_toughness_values = []
toughness_values = []
ductility_index_values = []
melting_values = []
max_service_temp_values = []
min_service_temp_values = []
therm_cond_values = []
spec_heat_cap_values = []
therm_expan_coeff_values = []
therm_shock_resist_values = []
therm_dist_resist_values = []
latent_heat_fusion_values = []
elec_resist_values = []
elec_cond_values = []
galvanic_potential_values = []
mech_loss_coeff_values = []
with open(new_file, "r") as sample_info:
for line in sample_info:
if line.startswith("done"):
for line_item in range(2, len(line.split(' '))):
material_name.append((line.split(' ')[line_item].strip('" ,\t\n')))
elif line.startswith("Material family"):
for line_item in range(1, len(line.split(' ')) - 1):
material_family.append(line.split(' ')[line_item].strip(' ",\t\n'))
elif line.startswith("Young's modulus (10^6 psi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
young_modulus_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
young_modulus_values.append("Null")
else:
young_modulus_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Specific stiffness (lbf.ft/lb)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
specific_stiffness_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
specific_stiffness_values.append("Null")
else:
specific_stiffness_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Yield strength (elastic limit) (ksi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
yield_strength_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
yield_strength_values.append("Null")
else:
yield_strength_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Tensile strength (ksi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
tensile_strength_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
tensile_strength_values.append("Null")
else:
tensile_strength_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Specific strength (lbf.ft/lb)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
specific_strength_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
specific_strength_values.append("Null")
else:
specific_strength_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Elongation (% strain)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
elongation_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
elongation_values.append("Null")
else:
elongation_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Compressive strength (ksi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
compressive_strength_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
compressive_strength_values.append("Null")
else:
compressive_strength_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Flexural modulus (10^6 psi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
flexural_modulus_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
flexural_modulus_values.append("Null")
else:
flexural_modulus_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Flexural strength (modulus of rupture) (ksi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
flexural_strength_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
flexural_strength_values.append("Null")
else:
flexural_strength_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Shear modulus (10^6 psi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
shear_modulus_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
shear_modulus_values.append("Null")
else:
shear_modulus_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Bulk modulus (10^6 psi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
bulk_modulus_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
bulk_modulus_values.append("Null")
else:
bulk_modulus_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Poisson's ratio"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
poisson_ratio_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
poisson_ratio_values.append("Null")
else:
poisson_ratio_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Shape factor"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
shape_factor_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
shape_factor_values.append("Null")
else:
shape_factor_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Hardness - Vickers (HV)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
hardness_vickers_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
hardness_vickers_values.append("Null")
else:
hardness_vickers_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Elastic stored energy (springs) (ft.lbf/in^3)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
elastic_stored_energy_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
elastic_stored_energy_values.append("Null")
else:
elastic_stored_energy_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Fatigue strength at 10^7 cycles (ksi)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
fatigue_strength_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
fatigue_strength_values.append("Null")
else:
fatigue_strength_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Fracture toughness (ksi.in^0.5)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
fracture_toughness_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
fracture_toughness_values.append("Null")
else:
fracture_toughness_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Toughness (G) (ft.lbf/in^2)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
toughness_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
toughness_values.append("Null")
else:
toughness_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Ductility index (mil)"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
ductility_index_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
ductility_index_values.append("Null")
else:
ductility_index_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Melting"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
melting_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
melting_values.append("Null")
else:
melting_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Maximum service temperature"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
max_service_temp_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
max_service_temp_values.append("Null")
else:
max_service_temp_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Minimum service temperature"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
min_service_temp_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
min_service_temp_values.append("Null")
else:
min_service_temp_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Thermal conductivity"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
therm_cond_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
therm_cond_values.append("Null")
else:
therm_cond_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Specific heat capacity"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
spec_heat_cap_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
spec_heat_cap_values.append("Null")
else:
spec_heat_cap_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Thermal expansion coefficient"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
therm_expan_coeff_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
therm_expan_coeff_values.append("Null")
else:
therm_expan_coeff_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Thermal shock resistance"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
therm_shock_resist_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
therm_shock_resist_values.append("Null")
else:
therm_shock_resist_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Thermal distortion resistance"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
therm_dist_resist_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
therm_dist_resist_values.append("Null")
else:
therm_dist_resist_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Latent heat of fusion"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
latent_heat_fusion_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
latent_heat_fusion_values.append("Null")
else:
latent_heat_fusion_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Electrical resistivity"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
elec_resist_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
elec_resist_values.append("Null")
else:
elec_resist_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Electrical conductivity"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
elec_cond_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
elec_cond_values.append("Null")
else:
elec_cond_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Galvanic potential"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
galvanic_potential_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
galvanic_potential_values.append("Null")
else:
galvanic_potential_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
elif line.startswith("Mechanical loss coefficient"):
for line_item in range(1, (len(line.split(",")) - 1)):
if " - " in line.split(",")[line_item].strip(" "):
left_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[0]
right_of_dash = line.split(",")[line_item].strip(" ").split(" - ")[1]
average_of_dash = (float(left_of_dash) + float(right_of_dash)) / 2
mech_loss_coeff_values.append(round(average_of_dash, 6))
elif line.split(",")[line_item] is '':
mech_loss_coeff_values.append("Null")
else:
mech_loss_coeff_values.append(round(float(line.split(",")[line_item].strip(" ")), 6))
#Brinell Hardness, Dielectric Constant, Dielectric Strength, Dissipation Factor, excluded because lacking way too much data (>10 rows of materials non-existent)
null_extender = ["Null"] * 18
material_name.extend(null_extender)
material_family.extend(null_extender)
return(material_name, material_family, young_modulus_values, specific_stiffness_values, yield_strength_values,
tensile_strength_values, specific_strength_values, elongation_values, compressive_strength_values,
flexural_modulus_values, flexural_strength_values, shear_modulus_values, bulk_modulus_values,
poisson_ratio_values, shape_factor_values, hardness_vickers_values,
elastic_stored_energy_values, fatigue_strength_values, fracture_toughness_values, toughness_values,
ductility_index_values, melting_values, max_service_temp_values, min_service_temp_values,
therm_cond_values, spec_heat_cap_values, therm_expan_coeff_values, therm_shock_resist_values, therm_dist_resist_values,
latent_heat_fusion_values, elec_resist_values, elec_cond_values, galvanic_potential_values, mech_loss_coeff_values)
def null_invalid_properties(frame: pd.DataFrame):
# This drops elements in our dataset which have invalid values for any of the following properties
# found to contain a salvagable amount of invalid data
COLUMNS_TO_SCRUB = [
"Tensile strength",
"Compressive strength",
"Flexural modulus",
"Flexural strength",
"Bulk modulus",
"Elastic stored energy",
"Fatigue strength",
"Fracture toughness",
"Toughness",
"Thermal expansion coefficient",
]
for c in COLUMNS_TO_SCRUB:
# They're all some kind of number between 40k and 50k
# with bias towards repeating values
frame[c].mask(frame[c].gt(40000), inplace=True)
# Be gingerly with this column because there's larger entries with valid values
frame["Thermal shock resistance"].mask(frame["Thermal shock resistance"].eq(47650), inplace=True)
frame["Fracture toughness"].mask(frame["Fracture toughness"].gt(12000), inplace=True)
def properties_dataframe_from_file(path: str):
property_lists = parsing_refined_data(path)
frame = pd.DataFrame(index=property_lists[0], data={
k: v for (k, v) in zip(COLUMN_NAMES, property_lists[1:])
})
frame.replace("Null", np.nan, inplace=True)
null_invalid_properties(frame)
return frame
if __name__ == "__main__":
parsing_material_data("C:/Users/Everet/Documents/AMP_Project/Pres_3/Updated_PCM.csv", "C:/Users/Everet/Documents/AMP_Project/Pres_3/new_TEM.csv")
material_name, material_family, young_modulus_values, specific_stiffness_values, yield_strength_values, tensile_strength_values, specific_strength_values, elongation_values, compressive_strength_values, flexural_modulus_values, flexural_strength_values, shear_modulus_values, bulk_modulus_values, poisson_ratio_values, shape_factor_values, hardness_vickers_values, elastic_stored_energy_values, fatigue_strength_values, fracture_toughness_values, toughness_values, ductility_index_values, melting_values, max_service_temp_values, min_service_temp_values, therm_cond_values, spec_heat_cap_values, therm_expan_coeff_values, therm_shock_resist_values, therm_dist_resist_values, latent_heat_fusion_values, elec_resist_values, elec_cond_values, galvanic_potential_values, mech_loss_coeff_values = parsing_refined_data("C:/Users/Everet/Documents/AMP_Project/Pres_3/new_TEM.csv")
print(len(material_name), len(material_family), len(young_modulus_values), len(specific_stiffness_values), len(yield_strength_values), len(tensile_strength_values))
print(material_name[0])
print(material_family[0])
print(material_family[-4])
print(set(material_family))
#print(len(specific_strength_values), len(elongation_values), len(compressive_strength_values), len(flexural_modulus_values), len(flexural_strength_values))
#print(len(shear_modulus_values), len(bulk_modulus_values), len(poisson_ratio_values), len(shape_factor_values), len(hardness_vickers_values))
#print(len(elastic_stored_energy_values), len(fatigue_strength_values), len(fracture_toughness_values), len(toughness_values), len(ductility_index_values))
#print(len(melting_values), len(max_service_temp_values), len(min_service_temp_values), len(therm_cond_values), len(spec_heat_cap_values))
#print(len(therm_expan_coeff_values), len(therm_shock_resist_values), len(therm_dist_resist_values), len(latent_heat_fusion_values), len(elec_resist_values))
#print(len(elec_cond_values), len(galvanic_potential_values), len(mech_loss_coeff_values))
#33 properties total
| [
1,
1053,
337,
13,
5215,
11701,
408,
10518,
13,
5215,
12655,
408,
7442,
13,
13,
15032,
29127,
29918,
5813,
29903,
353,
518,
13,
1678,
525,
24095,
3942,
742,
13,
1678,
525,
3492,
865,
29879,
878,
14999,
742,
13,
1678,
525,
10299,
928,
380,
2593,
2264,
742,
13,
1678,
525,
29979,
969,
9324,
742,
13,
1678,
525,
29911,
575,
488,
9324,
742,
13,
1678,
525,
10299,
928,
9324,
742,
13,
1678,
525,
29923,
5426,
362,
742,
13,
1678,
525,
1523,
2139,
573,
9324,
742,
13,
1678,
525,
29943,
2506,
3631,
878,
14999,
742,
13,
1678,
525,
29943,
2506,
3631,
9324,
742,
13,
1678,
525,
13468,
279,
878,
14999,
742,
13,
1678,
525,
29933,
24456,
878,
14999,
742,
13,
1678,
525,
9837,
17387,
11959,
742,
13,
1678,
525,
24111,
7329,
742,
13,
1678,
525,
29950,
538,
2264,
325,
860,
414,
742,
13,
1678,
525,
29923,
4230,
293,
6087,
5864,
742,
13,
1678,
525,
29943,
271,
12137,
9324,
742,
13,
1678,
525,
29943,
1461,
545,
260,
820,
2264,
742,
13,
1678,
525,
29911,
820,
2264,
742,
13,
1678,
525,
29928,
5313,
1793,
2380,
742,
13,
1678,
525,
29924,
295,
1259,
1298,
742,
13,
1678,
525,
7976,
2669,
5694,
742,
13,
1678,
525,
8140,
2669,
5694,
742,
13,
1678,
525,
1349,
837,
284,
7512,
2068,
742,
13,
1678,
525,
10299,
928,
12871,
13284,
742,
13,
1678,
525,
1349,
837,
284,
13184,
10825,
742,
13,
1678,
525,
1349,
837,
284,
19253,
17711,
742,
13,
1678,
525,
1349,
837,
284,
1320,
441,
291,
17711,
742,
13,
1678,
525,
13992,
296,
12871,
310,
21736,
742,
13,
1678,
525,
29923,
781,
16888,
9241,
2068,
742,
13,
1678,
525,
29923,
781,
16888,
7512,
2068,
742,
13,
1678,
525,
29954,
284,
3703,
293,
7037,
742,
13,
1678,
525,
6816,
5083,
936,
6410,
10825,
742,
13,
29962,
13,
13,
29933,
3035,
29918,
8618,
13171,
24301,
2890,
353,
518,
13,
1678,
525,
29923,
5426,
362,
742,
396,
910,
338,
1363,
727,
29915,
29879,
975,
29871,
29953,
29900,
29900,
4319,
4426,
297,
278,
8783,
13,
1678,
525,
29950,
538,
2264,
325,
860,
414,
742,
13,
1678,
396,
451,
7088,
14238,
13,
1678,
525,
10299,
928,
380,
2593,
2264,
742,
13,
1678,
525,
10299,
928,
9324,
742,
13,
1678,
525,
24111,
7329,
742,
13,
1678,
525,
29923,
4230,
293,
6087,
5864,
742,
13,
1678,
525,
29911,
820,
2264,
742,
13,
1678,
525,
29928,
5313,
1793,
2380,
742,
13,
1678,
525,
1349,
837,
284,
19253,
17711,
742,
13,
1678,
525,
1349,
837,
284,
1320,
441,
291,
17711,
742,
13,
1678,
396,
4525,
4426,
526,
451,
2869,
1855,
4426,
310,
278,
5518,
13,
1678,
525,
7976,
2669,
5694,
742,
13,
1678,
525,
8140,
2669,
5694,
742,
13,
1678,
525,
29923,
781,
16888,
9241,
2068,
742,
13,
1678,
396,
910,
2289,
4473,
267,
411,
1749,
848,
9262,
13,
1678,
525,
29954,
284,
3703,
293,
7037,
742,
13,
29962,
13,
13,
29937,
4525,
526,
17279,
411,
8340,
1819,
363,
697,
470,
901,
4426,
13,
29937,
910,
6251,
338,
1244,
1363,
727,
29915,
29879,
17279,
411,
6133,
29892,
541,
2854,
1819,
13,
29937,
1126,
306,
1016,
29915,
29873,
864,
304,
14074,
963,
13,
29933,
3035,
29918,
29924,
1299,
1001,
25758,
29903,
353,
518,
13,
1678,
376,
4162,
29923,
29968,
29914,
7833,
22004,
5713,
495,
29892,
501,
29928,
758,
1457,
29887,
29892,
501,
29928,
6568,
29899,
786,
29908,
13,
29962,
13,
13,
1753,
13755,
29918,
15388,
29918,
1272,
29898,
15388,
29918,
726,
29892,
716,
29918,
1445,
1125,
13,
1678,
411,
1722,
29898,
15388,
29918,
726,
29892,
376,
29878,
1159,
408,
6433,
29918,
517,
29918,
3539,
29901,
13,
4706,
411,
1722,
29898,
1482,
29918,
1445,
29892,
376,
29893,
1159,
408,
6433,
29918,
17625,
29901,
13,
9651,
297,
29918,
721,
5156,
29918,
11330,
353,
7700,
13,
9651,
297,
29918,
15436,
16888,
29918,
11330,
353,
7700,
13,
9651,
297,
29918,
1004,
5083,
936,
29918,
11330,
353,
7700,
13,
9651,
297,
29918,
6574,
627,
29918,
11330,
353,
7700,
13,
9651,
363,
1196,
297,
6433,
29918,
517,
29918,
3539,
29901,
13,
18884,
565,
1196,
29889,
27382,
2541,
703,
15091,
29908,
1125,
13,
462,
1678,
6433,
29918,
17625,
29889,
3539,
29898,
1220,
29897,
13,
18884,
25342,
376,
6816,
5083,
936,
4426,
29908,
297,
1196,
29901,
13,
462,
1678,
297,
29918,
1004,
5083,
936,
29918,
11330,
353,
5852,
13,
18884,
25342,
376,
24192,
627,
669,
285,
1461,
545,
4426,
29908,
297,
1196,
29901,
13,
462,
1678,
297,
29918,
1004,
5083,
936,
29918,
11330,
353,
7700,
13,
462,
1678,
297,
29918,
6574,
627,
29918,
11330,
353,
5852,
13,
18884,
25342,
376,
1349,
837,
284,
4426,
29908,
297,
1196,
29901,
13,
462,
1678,
297,
29918,
721,
5156,
29918,
11330,
353,
5852,
13,
462,
1678,
297,
29918,
6574,
627,
29918,
11330,
353,
7700,
13,
18884,
25342,
376,
29923,
781,
16888,
4426,
29908,
297,
1196,
29901,
13,
462,
1678,
297,
29918,
721,
5156,
29918,
11330,
353,
7700,
13,
462,
1678,
297,
29918,
15436,
16888,
29918,
11330,
353,
5852,
13,
18884,
25342,
376,
19095,
1212,
293,
4426,
29908,
297,
1196,
29901,
13,
462,
1678,
297,
29918,
15436,
16888,
29918,
11330,
353,
7700,
13,
462,
1678,
297,
29918,
1004,
5083,
936,
29918,
11330,
353,
7700,
13,
462,
1678,
297,
29918,
721,
5156,
29918,
11330,
353,
7700,
13,
462,
1678,
297,
29918,
6574,
627,
29918,
11330,
353,
7700,
13,
18884,
25342,
376,
6816,
5083,
936,
6410,
10825,
29908,
297,
1196,
29901,
13,
462,
1678,
6433,
29918,
17625,
29889,
3539,
29898,
1220,
29897,
13,
18884,
25342,
1196,
29889,
27382,
2541,
703,
24095,
3942,
29908,
1125,
13,
462,
1678,
6433,
29918,
17625,
29889,
3539,
29898,
1220,
29897,
13,
18884,
25342,
297,
29918,
721,
5156,
29918,
11330,
338,
5852,
470,
297,
29918,
15436,
16888,
29918,
11330,
338,
5852,
470,
297,
29918,
1004,
5083,
936,
29918,
11330,
338,
5852,
470,
297,
29918,
6574,
627,
29918,
11330,
338,
5852,
29901,
13,
462,
1678,
6433,
29918,
17625,
29889,
3539,
29898,
1220,
29897,
13,
13,
1753,
13755,
29918,
999,
1312,
29918,
1272,
29898,
1482,
29918,
1445,
1125,
13,
1678,
5518,
29918,
978,
353,
5159,
13,
1678,
5518,
29918,
11922,
353,
5159,
13,
1678,
4123,
29918,
1545,
14999,
29918,
5975,
353,
5159,
13,
1678,
2702,
29918,
303,
2593,
2264,
29918,
5975,
353,
5159,
13,
1678,
7709,
29918,
710,
1477,
29918,
5975,
353,
5159,
13,
1678,
25187,
488,
29918,
710,
1477,
29918,
5975,
353,
5159,
13,
1678,
2702,
29918,
710,
1477,
29918,
5975,
353,
5159,
13,
1678,
560,
549,
362,
29918,
5975,
353,
5159,
13,
1678,
27122,
573,
29918,
710,
1477,
29918,
5975,
353,
5159,
13,
1678,
8525,
3631,
29918,
1545,
14999,
29918,
5975,
353,
5159,
13,
1678,
8525,
3631,
29918,
710,
1477,
29918,
5975,
353,
5159,
13,
1678,
1183,
279,
29918,
1545,
14999,
29918,
5975,
353,
5159,
13,
1678,
21610,
29918,
1545,
14999,
29918,
5975,
353,
5159,
13,
1678,
772,
17387,
29918,
3605,
601,
29918,
5975,
353,
5159,
13,
1678,
8267,
29918,
19790,
29918,
5975,
353,
5159,
13,
1678,
2898,
2264,
29918,
29894,
860,
414,
29918,
5975,
353,
5159,
13,
1678,
560,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
353,
5159,
13,
1678,
9950,
12137,
29918,
710,
1477,
29918,
5975,
353,
5159,
13,
1678,
285,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
353,
5159,
13,
1678,
260,
820,
2264,
29918,
5975,
353,
5159,
13,
1678,
868,
312,
1793,
29918,
2248,
29918,
5975,
353,
5159,
13,
1678,
9232,
1259,
29918,
5975,
353,
5159,
13,
1678,
4236,
29918,
5509,
29918,
7382,
29918,
5975,
353,
5159,
13,
1678,
1375,
29918,
5509,
29918,
7382,
29918,
5975,
353,
5159,
13,
1678,
14563,
29918,
1116,
29918,
5975,
353,
5159,
13,
1678,
1580,
29918,
354,
271,
29918,
5030,
29918,
5975,
353,
5159,
13,
1678,
14563,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
353,
5159,
13,
1678,
14563,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
353,
5159,
13,
1678,
14563,
29918,
5721,
29918,
690,
391,
29918,
5975,
353,
5159,
13,
1678,
3405,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
353,
5159,
13,
1678,
4552,
29883,
29918,
690,
391,
29918,
5975,
353,
5159,
13,
1678,
4552,
29883,
29918,
1116,
29918,
5975,
353,
5159,
13,
1678,
6898,
3703,
293,
29918,
17765,
2556,
29918,
5975,
353,
5159,
13,
1678,
592,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
353,
5159,
13,
1678,
411,
1722,
29898,
1482,
29918,
1445,
29892,
376,
29878,
1159,
408,
4559,
29918,
3888,
29901,
13,
4706,
363,
1196,
297,
4559,
29918,
3888,
29901,
13,
9651,
565,
1196,
29889,
27382,
2541,
703,
15091,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29906,
29892,
7431,
29898,
1220,
29889,
5451,
877,
29871,
525,
876,
1125,
13,
462,
1678,
5518,
29918,
978,
29889,
4397,
3552,
1220,
29889,
5451,
877,
29871,
525,
9601,
1220,
29918,
667,
1822,
17010,
877,
29908,
1919,
29905,
29873,
29905,
29876,
29915,
4961,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
24095,
3942,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
7431,
29898,
1220,
29889,
5451,
877,
29871,
525,
876,
448,
29871,
29896,
1125,
13,
462,
1678,
5518,
29918,
11922,
29889,
4397,
29898,
1220,
29889,
5451,
877,
29871,
525,
9601,
1220,
29918,
667,
1822,
17010,
877,
376,
2053,
29873,
29905,
29876,
8785,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
3492,
865,
29915,
29879,
878,
14999,
313,
29896,
29900,
29985,
29953,
282,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
4123,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
4123,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
4123,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
10299,
928,
380,
2593,
2264,
313,
29880,
1635,
29889,
615,
29914,
27728,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
2702,
29918,
303,
2593,
2264,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
2702,
29918,
303,
2593,
2264,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
2702,
29918,
303,
2593,
2264,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29979,
969,
9324,
313,
295,
6288,
4046,
29897,
313,
29895,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
7709,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
7709,
29918,
710,
1477,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
7709,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29911,
575,
488,
9324,
313,
29895,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
25187,
488,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
25187,
488,
29918,
710,
1477,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
25187,
488,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
10299,
928,
9324,
313,
29880,
1635,
29889,
615,
29914,
27728,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
2702,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
2702,
29918,
710,
1477,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
2702,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29923,
5426,
362,
313,
29995,
5312,
262,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
560,
549,
362,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
560,
549,
362,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
560,
549,
362,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
1523,
2139,
573,
9324,
313,
29895,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
27122,
573,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
27122,
573,
29918,
710,
1477,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
27122,
573,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29943,
2506,
3631,
878,
14999,
313,
29896,
29900,
29985,
29953,
282,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
8525,
3631,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
8525,
3631,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
8525,
3631,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29943,
2506,
3631,
9324,
313,
1545,
14999,
310,
5796,
415,
545,
29897,
313,
29895,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
8525,
3631,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
8525,
3631,
29918,
710,
1477,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
8525,
3631,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
13468,
279,
878,
14999,
313,
29896,
29900,
29985,
29953,
282,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
1183,
279,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
1183,
279,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
1183,
279,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29933,
24456,
878,
14999,
313,
29896,
29900,
29985,
29953,
282,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
21610,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
21610,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
21610,
29918,
1545,
14999,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
9837,
17387,
29915,
29879,
11959,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
772,
17387,
29918,
3605,
601,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
772,
17387,
29918,
3605,
601,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
772,
17387,
29918,
3605,
601,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
24111,
7329,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
8267,
29918,
19790,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
8267,
29918,
19790,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
8267,
29918,
19790,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29950,
538,
2264,
448,
478,
860,
414,
313,
29950,
29963,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
2898,
2264,
29918,
29894,
860,
414,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
2898,
2264,
29918,
29894,
860,
414,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
2898,
2264,
29918,
29894,
860,
414,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29923,
4230,
293,
6087,
5864,
313,
15099,
886,
29897,
313,
615,
29889,
29880,
1635,
29914,
262,
29985,
29941,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
560,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
560,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
560,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29943,
271,
12137,
9324,
472,
29871,
29896,
29900,
29985,
29955,
25785,
313,
29895,
1039,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
9950,
12137,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
9950,
12137,
29918,
710,
1477,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
9950,
12137,
29918,
710,
1477,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29943,
1461,
545,
260,
820,
2264,
313,
29895,
1039,
29889,
262,
29985,
29900,
29889,
29945,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
285,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
285,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
285,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29911,
820,
2264,
313,
29954,
29897,
313,
615,
29889,
29880,
1635,
29914,
262,
29985,
29906,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
260,
820,
2264,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
260,
820,
2264,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
260,
820,
2264,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29928,
5313,
1793,
2380,
313,
23853,
5513,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
868,
312,
1793,
29918,
2248,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
868,
312,
1793,
29918,
2248,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
868,
312,
1793,
29918,
2248,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29924,
295,
1259,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
9232,
1259,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
9232,
1259,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
9232,
1259,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
7976,
12539,
2669,
10430,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
4236,
29918,
5509,
29918,
7382,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
4236,
29918,
5509,
29918,
7382,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
4236,
29918,
5509,
29918,
7382,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
8140,
12539,
2669,
10430,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
1375,
29918,
5509,
29918,
7382,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
1375,
29918,
5509,
29918,
7382,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
1375,
29918,
5509,
29918,
7382,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
1349,
837,
284,
7512,
2068,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
14563,
29918,
1116,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
14563,
29918,
1116,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
14563,
29918,
1116,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
10299,
928,
12871,
13284,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
1580,
29918,
354,
271,
29918,
5030,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
1580,
29918,
354,
271,
29918,
5030,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
1580,
29918,
354,
271,
29918,
5030,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
1349,
837,
284,
13184,
10825,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
14563,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
14563,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
14563,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
1349,
837,
284,
19253,
17711,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
14563,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
14563,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
14563,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
1349,
837,
284,
1320,
441,
291,
17711,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
14563,
29918,
5721,
29918,
690,
391,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
14563,
29918,
5721,
29918,
690,
391,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
14563,
29918,
5721,
29918,
690,
391,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
13992,
296,
12871,
310,
21736,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
3405,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
3405,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
3405,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29923,
781,
16888,
9241,
2068,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
4552,
29883,
29918,
690,
391,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
4552,
29883,
29918,
690,
391,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
4552,
29883,
29918,
690,
391,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29923,
781,
16888,
7512,
2068,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
4552,
29883,
29918,
1116,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
4552,
29883,
29918,
1116,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
4552,
29883,
29918,
1116,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
29954,
284,
3703,
293,
7037,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
6898,
3703,
293,
29918,
17765,
2556,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
6898,
3703,
293,
29918,
17765,
2556,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
6898,
3703,
293,
29918,
17765,
2556,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
25342,
1196,
29889,
27382,
2541,
703,
6816,
5083,
936,
6410,
10825,
29908,
1125,
13,
18884,
363,
1196,
29918,
667,
297,
3464,
29898,
29896,
29892,
313,
2435,
29898,
1220,
29889,
5451,
29898,
3284,
876,
448,
29871,
29896,
22164,
13,
462,
1678,
565,
376,
448,
376,
297,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
1125,
13,
462,
4706,
2175,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29900,
29962,
13,
462,
4706,
1492,
29918,
974,
29918,
14592,
353,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
467,
5451,
703,
448,
376,
9601,
29896,
29962,
13,
462,
4706,
6588,
29918,
974,
29918,
14592,
353,
313,
7411,
29898,
1563,
29918,
974,
29918,
14592,
29897,
718,
5785,
29898,
1266,
29918,
974,
29918,
14592,
876,
847,
29871,
29906,
13,
462,
4706,
592,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
12483,
482,
29918,
974,
29918,
14592,
29892,
29871,
29953,
876,
13,
462,
1678,
25342,
1196,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
29962,
338,
525,
2396,
13,
462,
4706,
592,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
29889,
4397,
703,
7327,
1159,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
592,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
29889,
4397,
29898,
14486,
29898,
7411,
29898,
1220,
29889,
5451,
28165,
1159,
29961,
1220,
29918,
667,
1822,
17010,
703,
376,
8243,
29871,
29953,
876,
13,
9651,
396,
12432,
262,
514,
10999,
2264,
29892,
1640,
781,
2200,
28601,
29892,
1640,
781,
2200,
3767,
1477,
29892,
360,
790,
666,
362,
383,
7168,
29892,
429,
13347,
1363,
10225,
292,
982,
2086,
1568,
848,
313,
29958,
29896,
29900,
4206,
310,
17279,
1661,
29899,
735,
9696,
29897,
13,
1678,
1870,
29918,
1062,
1581,
353,
6796,
7327,
3108,
334,
29871,
29896,
29947,
13,
1678,
5518,
29918,
978,
29889,
21843,
29898,
4304,
29918,
1062,
1581,
29897,
13,
1678,
5518,
29918,
11922,
29889,
21843,
29898,
4304,
29918,
1062,
1581,
29897,
13,
13,
1678,
736,
29898,
15388,
29918,
978,
29892,
5518,
29918,
11922,
29892,
4123,
29918,
1545,
14999,
29918,
5975,
29892,
2702,
29918,
303,
2593,
2264,
29918,
5975,
29892,
7709,
29918,
710,
1477,
29918,
5975,
29892,
13,
965,
25187,
488,
29918,
710,
1477,
29918,
5975,
29892,
2702,
29918,
710,
1477,
29918,
5975,
29892,
560,
549,
362,
29918,
5975,
29892,
27122,
573,
29918,
710,
1477,
29918,
5975,
29892,
13,
965,
8525,
3631,
29918,
1545,
14999,
29918,
5975,
29892,
8525,
3631,
29918,
710,
1477,
29918,
5975,
29892,
1183,
279,
29918,
1545,
14999,
29918,
5975,
29892,
21610,
29918,
1545,
14999,
29918,
5975,
29892,
13,
965,
772,
17387,
29918,
3605,
601,
29918,
5975,
29892,
8267,
29918,
19790,
29918,
5975,
29892,
2898,
2264,
29918,
29894,
860,
414,
29918,
5975,
29892,
13,
965,
560,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
29892,
9950,
12137,
29918,
710,
1477,
29918,
5975,
29892,
285,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
29892,
260,
820,
2264,
29918,
5975,
29892,
13,
965,
868,
312,
1793,
29918,
2248,
29918,
5975,
29892,
9232,
1259,
29918,
5975,
29892,
4236,
29918,
5509,
29918,
7382,
29918,
5975,
29892,
1375,
29918,
5509,
29918,
7382,
29918,
5975,
29892,
13,
965,
14563,
29918,
1116,
29918,
5975,
29892,
1580,
29918,
354,
271,
29918,
5030,
29918,
5975,
29892,
14563,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
29892,
14563,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
29892,
14563,
29918,
5721,
29918,
690,
391,
29918,
5975,
29892,
13,
965,
3405,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
29892,
4552,
29883,
29918,
690,
391,
29918,
5975,
29892,
4552,
29883,
29918,
1116,
29918,
5975,
29892,
6898,
3703,
293,
29918,
17765,
2556,
29918,
5975,
29892,
592,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
29897,
13,
13,
1753,
1870,
29918,
20965,
29918,
11330,
29898,
2557,
29901,
10518,
29889,
17271,
1125,
13,
1678,
396,
910,
4441,
567,
3161,
297,
1749,
8783,
607,
505,
8340,
1819,
363,
738,
310,
278,
1494,
4426,
13,
1678,
396,
1476,
304,
1712,
263,
24754,
351,
519,
5253,
310,
8340,
848,
13,
1678,
23958,
5005,
3059,
29918,
4986,
29918,
7187,
29934,
7466,
353,
518,
13,
4706,
376,
29911,
575,
488,
9324,
613,
13,
4706,
376,
1523,
2139,
573,
9324,
613,
13,
4706,
376,
29943,
2506,
3631,
878,
14999,
613,
13,
4706,
376,
29943,
2506,
3631,
9324,
613,
13,
4706,
376,
29933,
24456,
878,
14999,
613,
13,
4706,
376,
29923,
4230,
293,
6087,
5864,
613,
13,
4706,
376,
29943,
271,
12137,
9324,
613,
13,
4706,
376,
29943,
1461,
545,
260,
820,
2264,
613,
13,
4706,
376,
29911,
820,
2264,
613,
13,
4706,
376,
1349,
837,
284,
13184,
10825,
613,
13,
4706,
4514,
13,
1678,
363,
274,
297,
23958,
5005,
3059,
29918,
4986,
29918,
7187,
29934,
7466,
29901,
13,
4706,
396,
2688,
29915,
276,
599,
777,
2924,
310,
1353,
1546,
29871,
29946,
29900,
29895,
322,
29871,
29945,
29900,
29895,
13,
4706,
396,
411,
24003,
7113,
28769,
1819,
13,
4706,
3515,
29961,
29883,
1822,
13168,
29898,
2557,
29961,
29883,
1822,
4141,
29898,
29946,
29900,
29900,
29900,
29900,
511,
297,
6689,
29922,
5574,
29897,
13,
268,
13,
1678,
396,
1522,
330,
5621,
368,
411,
445,
1897,
1363,
727,
29915,
29879,
7200,
9976,
411,
2854,
1819,
13,
1678,
3515,
3366,
1349,
837,
284,
19253,
17711,
16862,
13168,
29898,
2557,
3366,
1349,
837,
284,
19253,
17711,
16862,
1837,
29898,
29946,
29955,
29953,
29945,
29900,
511,
297,
6689,
29922,
5574,
29897,
13,
1678,
3515,
3366,
29943,
1461,
545,
260,
820,
2264,
16862,
13168,
29898,
2557,
3366,
29943,
1461,
545,
260,
820,
2264,
16862,
4141,
29898,
29896,
29906,
29900,
29900,
29900,
511,
297,
6689,
29922,
5574,
29897,
13,
13,
1753,
4426,
29918,
1272,
2557,
29918,
3166,
29918,
1445,
29898,
2084,
29901,
851,
1125,
13,
1678,
2875,
29918,
21513,
353,
13755,
29918,
999,
1312,
29918,
1272,
29898,
2084,
29897,
13,
1678,
3515,
353,
10518,
29889,
17271,
29898,
2248,
29922,
6799,
29918,
21513,
29961,
29900,
1402,
848,
3790,
13,
4706,
413,
29901,
325,
363,
313,
29895,
29892,
325,
29897,
297,
14319,
29898,
15032,
29127,
29918,
5813,
29903,
29892,
2875,
29918,
21513,
29961,
29896,
29901,
2314,
13,
1678,
5615,
13,
13,
1678,
3515,
29889,
6506,
703,
7327,
613,
7442,
29889,
13707,
29892,
297,
6689,
29922,
5574,
29897,
13,
1678,
1870,
29918,
20965,
29918,
11330,
29898,
2557,
29897,
13,
1678,
736,
3515,
13,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
13755,
29918,
15388,
29918,
1272,
703,
29907,
8419,
5959,
29914,
29923,
369,
300,
29914,
20128,
29914,
19297,
29918,
7653,
29914,
13504,
29918,
29941,
29914,
29248,
29918,
9026,
29924,
29889,
7638,
613,
376,
29907,
8419,
5959,
29914,
29923,
369,
300,
29914,
20128,
29914,
19297,
29918,
7653,
29914,
13504,
29918,
29941,
29914,
1482,
29918,
4330,
29924,
29889,
7638,
1159,
13,
1678,
5518,
29918,
978,
29892,
5518,
29918,
11922,
29892,
4123,
29918,
1545,
14999,
29918,
5975,
29892,
2702,
29918,
303,
2593,
2264,
29918,
5975,
29892,
7709,
29918,
710,
1477,
29918,
5975,
29892,
25187,
488,
29918,
710,
1477,
29918,
5975,
29892,
2702,
29918,
710,
1477,
29918,
5975,
29892,
560,
549,
362,
29918,
5975,
29892,
27122,
573,
29918,
710,
1477,
29918,
5975,
29892,
8525,
3631,
29918,
1545,
14999,
29918,
5975,
29892,
8525,
3631,
29918,
710,
1477,
29918,
5975,
29892,
1183,
279,
29918,
1545,
14999,
29918,
5975,
29892,
21610,
29918,
1545,
14999,
29918,
5975,
29892,
772,
17387,
29918,
3605,
601,
29918,
5975,
29892,
8267,
29918,
19790,
29918,
5975,
29892,
2898,
2264,
29918,
29894,
860,
414,
29918,
5975,
29892,
560,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
29892,
9950,
12137,
29918,
710,
1477,
29918,
5975,
29892,
285,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
29892,
260,
820,
2264,
29918,
5975,
29892,
868,
312,
1793,
29918,
2248,
29918,
5975,
29892,
9232,
1259,
29918,
5975,
29892,
4236,
29918,
5509,
29918,
7382,
29918,
5975,
29892,
1375,
29918,
5509,
29918,
7382,
29918,
5975,
29892,
14563,
29918,
1116,
29918,
5975,
29892,
1580,
29918,
354,
271,
29918,
5030,
29918,
5975,
29892,
14563,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
29892,
14563,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
29892,
14563,
29918,
5721,
29918,
690,
391,
29918,
5975,
29892,
3405,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
29892,
4552,
29883,
29918,
690,
391,
29918,
5975,
29892,
4552,
29883,
29918,
1116,
29918,
5975,
29892,
6898,
3703,
293,
29918,
17765,
2556,
29918,
5975,
29892,
592,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
353,
13755,
29918,
999,
1312,
29918,
1272,
703,
29907,
8419,
5959,
29914,
29923,
369,
300,
29914,
20128,
29914,
19297,
29918,
7653,
29914,
13504,
29918,
29941,
29914,
1482,
29918,
4330,
29924,
29889,
7638,
1159,
13,
1678,
1596,
29898,
2435,
29898,
15388,
29918,
978,
511,
7431,
29898,
15388,
29918,
11922,
511,
7431,
29898,
6293,
865,
29918,
1545,
14999,
29918,
5975,
511,
7431,
29898,
14940,
29918,
303,
2593,
2264,
29918,
5975,
511,
7431,
29898,
29891,
969,
29918,
710,
1477,
29918,
5975,
511,
7431,
29898,
29873,
575,
488,
29918,
710,
1477,
29918,
5975,
876,
13,
1678,
1596,
29898,
15388,
29918,
978,
29961,
29900,
2314,
13,
1678,
1596,
29898,
15388,
29918,
11922,
29961,
29900,
2314,
13,
1678,
1596,
29898,
15388,
29918,
11922,
14352,
29946,
2314,
13,
1678,
1596,
29898,
842,
29898,
15388,
29918,
11922,
876,
13,
1678,
396,
2158,
29898,
2435,
29898,
14940,
29918,
710,
1477,
29918,
5975,
511,
7431,
29898,
295,
549,
362,
29918,
5975,
511,
7431,
29898,
510,
2139,
573,
29918,
710,
1477,
29918,
5975,
511,
7431,
29898,
16041,
3631,
29918,
1545,
14999,
29918,
5975,
511,
7431,
29898,
16041,
3631,
29918,
710,
1477,
29918,
5975,
876,
13,
1678,
396,
2158,
29898,
2435,
29898,
11360,
279,
29918,
1545,
14999,
29918,
5975,
511,
7431,
29898,
8645,
29895,
29918,
1545,
14999,
29918,
5975,
511,
7431,
29898,
1129,
17387,
29918,
3605,
601,
29918,
5975,
511,
7431,
29898,
12181,
29918,
19790,
29918,
5975,
511,
7431,
29898,
6800,
2264,
29918,
29894,
860,
414,
29918,
5975,
876,
13,
1678,
396,
2158,
29898,
2435,
29898,
295,
6288,
29918,
303,
4395,
29918,
27548,
29918,
5975,
511,
7431,
29898,
29888,
271,
12137,
29918,
710,
1477,
29918,
5975,
511,
7431,
29898,
29888,
1461,
545,
29918,
29873,
820,
2264,
29918,
5975,
511,
7431,
29898,
29873,
820,
2264,
29918,
5975,
511,
7431,
29898,
2199,
1793,
29918,
2248,
29918,
5975,
876,
13,
1678,
396,
2158,
29898,
2435,
29898,
12873,
1259,
29918,
5975,
511,
7431,
29898,
3317,
29918,
5509,
29918,
7382,
29918,
5975,
511,
7431,
29898,
1195,
29918,
5509,
29918,
7382,
29918,
5975,
511,
7431,
29898,
721,
29885,
29918,
1116,
29918,
5975,
511,
7431,
29898,
6550,
29918,
354,
271,
29918,
5030,
29918,
5975,
876,
13,
1678,
396,
2158,
29898,
2435,
29898,
721,
29885,
29918,
4548,
273,
29918,
1111,
12352,
29918,
5975,
511,
7431,
29898,
721,
29885,
29918,
845,
1698,
29918,
690,
391,
29918,
5975,
511,
7431,
29898,
721,
29885,
29918,
5721,
29918,
690,
391,
29918,
5975,
511,
7431,
29898,
5066,
296,
29918,
354,
271,
29918,
29888,
3958,
29918,
5975,
511,
7431,
29898,
6146,
29883,
29918,
690,
391,
29918,
5975,
876,
13,
1678,
396,
2158,
29898,
2435,
29898,
6146,
29883,
29918,
1116,
29918,
5975,
511,
7431,
29898,
23014,
3703,
293,
29918,
17765,
2556,
29918,
5975,
511,
7431,
29898,
1004,
305,
29918,
6758,
29918,
1111,
12352,
29918,
5975,
876,
13,
13,
1678,
396,
29941,
29941,
4426,
3001,
13,
2
] |
demo/python/horizon.py | ebraminio/astronomy-fork | 138 | 33562 | #!/usr/bin/env python3
#
# horizon.py - by <NAME> - 2019-12-18
#
# Example Python program for Astronomy Engine:
# https://github.com/cosinekitty/astronomy
#
# This is a more advanced example. It shows how to use coordinate
# transforms and a binary search to find the two azimuths where the
# ecliptic intersects with an observer's horizon at a given date and time.
#
# To execute, run the command:
#
# python3 horizon.py latitude longitude [yyyy-mm-ddThh:mm:ssZ]
#
import sys
import astronomy
from astro_demo_common import ParseArgs
NUM_SAMPLES = 4
def ECLIPLON(i):
return (360.0 * i) / NUM_SAMPLES
def HorizontalCoords(ecliptic_longitude, time, rot_ecl_hor):
eclip = astronomy.Spherical(
0.0, # being "on the ecliptic plane" means ecliptic latitude is zero.
ecliptic_longitude,
1.0 # any positive distance value will work fine.
)
# Convert ecliptic angular coordinates to ecliptic vector.
ecl_vec = astronomy.VectorFromSphere(eclip, time)
# Use the rotation matrix to convert ecliptic vector to horizontal vector.
hor_vec = astronomy.RotateVector(rot_ecl_hor, ecl_vec)
# Find horizontal angular coordinates, correcting for atmospheric refraction.
return astronomy.HorizonFromVector(hor_vec, astronomy.Refraction.Normal)
def Search(time, rot_ecl_hor, e1, e2):
tolerance = 1.0e-6 # one-millionth of a degree is close enough!
# Binary search: find the ecliptic longitude such that the horizontal altitude
# ascends through a zero value. The caller must pass e1, e2 such that the altitudes
# bound zero in ascending order.
while True:
e3 = (e1 + e2) / 2.0
h3 = HorizontalCoords(e3, time, rot_ecl_hor)
if abs(e2-e1) < tolerance:
return (e3, h3)
if h3.lat < 0.0:
e1 = e3
else:
e2 = e3
def FindEclipticCrossings(observer, time):
# The ecliptic is a celestial circle that describes the mean plane of
# the Earth's orbit around the Sun. We use J2000 ecliptic coordinates,
# meaning the x-axis is defined to where the plane of the Earth's
# equator on January 1, 2000 at noon UTC intersects the ecliptic plane.
# The positive x-axis points toward the March equinox.
# Calculate a rotation matrix that converts J2000 ecliptic vectors
# to horizontal vectors for this observer and time.
rot = astronomy.Rotation_ECL_HOR(time, observer)
# Sample several points around the ecliptic.
# Remember the horizontal coordinates for each sample.
hor = [HorizontalCoords(ECLIPLON(i), time, rot) for i in range(NUM_SAMPLES)]
for i in range(NUM_SAMPLES):
a1 = hor[i].lat
a2 = hor[(i+1) % NUM_SAMPLES].lat
e1 = ECLIPLON(i)
e2 = ECLIPLON(i+1)
if a1 * a2 <= 0.0:
if a2 > a1:
(ex, h) = Search(time, rot, e1, e2)
else:
(ex, h) = Search(time, rot, e2, e1)
if h.lon > 0.0 and h.lon < 180.0:
direction = 'ascends'
else:
direction = 'descends'
print('Ecliptic longitude {:0.4f} {} through horizon az {:0.4f}, alt {:0.5g}'.format(ex, direction, h.lon, h.lat))
return 0
if __name__ == '__main__':
observer, time = ParseArgs(sys.argv)
sys.exit(FindEclipticCrossings(observer, time))
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
13,
29937,
1678,
28205,
29889,
2272,
29871,
448,
29871,
491,
529,
5813,
29958,
448,
29871,
29906,
29900,
29896,
29929,
29899,
29896,
29906,
29899,
29896,
29947,
13,
29937,
13,
29937,
1678,
8741,
5132,
1824,
363,
27348,
29891,
10863,
29901,
13,
29937,
1678,
2045,
597,
3292,
29889,
510,
29914,
3944,
27868,
986,
29891,
29914,
7614,
21926,
13,
29937,
13,
29937,
1678,
910,
338,
263,
901,
12862,
1342,
29889,
739,
3697,
920,
304,
671,
14821,
13,
29937,
1678,
4327,
29879,
322,
263,
7581,
2740,
304,
1284,
278,
1023,
2698,
326,
2806,
29879,
988,
278,
13,
29937,
1678,
321,
11303,
23000,
25869,
29879,
411,
385,
22944,
29915,
29879,
28205,
472,
263,
2183,
2635,
322,
931,
29889,
13,
29937,
13,
29937,
1678,
1763,
6222,
29892,
1065,
278,
1899,
29901,
13,
29937,
13,
29937,
1678,
3017,
29941,
28205,
29889,
2272,
26271,
28745,
518,
18855,
29899,
4317,
29899,
1289,
1349,
29882,
29901,
4317,
29901,
893,
29999,
29962,
13,
29937,
13,
5215,
10876,
13,
5215,
20932,
29891,
13,
3166,
8717,
307,
29918,
17482,
29918,
9435,
1053,
20969,
7883,
13,
13,
13967,
29918,
8132,
3580,
17101,
353,
29871,
29946,
13,
13,
1753,
17522,
5265,
7390,
1164,
29898,
29875,
1125,
13,
1678,
736,
313,
29941,
29953,
29900,
29889,
29900,
334,
474,
29897,
847,
28019,
29918,
8132,
3580,
17101,
13,
13,
13,
1753,
6912,
7731,
7967,
4339,
29898,
687,
492,
23000,
29918,
5426,
4279,
29892,
931,
29892,
5731,
29918,
687,
29880,
29918,
2015,
1125,
13,
1678,
21226,
3466,
353,
20932,
29891,
29889,
29903,
8096,
936,
29898,
13,
308,
29900,
29889,
29900,
29892,
462,
1678,
396,
1641,
376,
265,
278,
321,
11303,
23000,
10694,
29908,
2794,
321,
11303,
23000,
26271,
338,
5225,
29889,
13,
4706,
321,
11303,
23000,
29918,
5426,
4279,
29892,
13,
308,
29896,
29889,
29900,
462,
268,
396,
738,
6374,
5418,
995,
674,
664,
2691,
29889,
13,
1678,
1723,
13,
13,
1678,
396,
14806,
321,
11303,
23000,
6401,
10350,
304,
321,
11303,
23000,
4608,
29889,
13,
1678,
321,
695,
29918,
2003,
353,
20932,
29891,
29889,
12877,
4591,
29903,
9085,
29898,
687,
3466,
29892,
931,
29897,
13,
13,
1678,
396,
4803,
278,
13733,
4636,
304,
3588,
321,
11303,
23000,
4608,
304,
14698,
4608,
29889,
13,
1678,
4029,
29918,
2003,
353,
20932,
29891,
29889,
21281,
403,
12877,
29898,
5450,
29918,
687,
29880,
29918,
2015,
29892,
321,
695,
29918,
2003,
29897,
13,
13,
1678,
396,
10987,
14698,
6401,
10350,
29892,
1959,
292,
363,
15489,
8096,
293,
2143,
13857,
29889,
13,
1678,
736,
20932,
29891,
29889,
17241,
18162,
4591,
12877,
29898,
2015,
29918,
2003,
29892,
20932,
29891,
29889,
5620,
13857,
29889,
19077,
29897,
13,
13,
13,
1753,
11856,
29898,
2230,
29892,
5731,
29918,
687,
29880,
29918,
2015,
29892,
321,
29896,
29892,
321,
29906,
1125,
13,
1678,
20341,
749,
353,
29871,
29896,
29889,
29900,
29872,
29899,
29953,
418,
396,
697,
29899,
19958,
291,
386,
310,
263,
7426,
338,
3802,
3307,
29991,
13,
1678,
396,
29479,
2740,
29901,
1284,
278,
321,
11303,
23000,
28745,
1316,
393,
278,
14698,
5272,
4279,
13,
1678,
396,
12066,
1975,
1549,
263,
5225,
995,
29889,
450,
24959,
1818,
1209,
321,
29896,
29892,
321,
29906,
1316,
393,
278,
5272,
20816,
13,
1678,
396,
3216,
5225,
297,
12066,
2548,
1797,
29889,
13,
1678,
1550,
5852,
29901,
13,
4706,
321,
29941,
353,
313,
29872,
29896,
718,
321,
29906,
29897,
847,
29871,
29906,
29889,
29900,
13,
4706,
298,
29941,
353,
6912,
7731,
7967,
4339,
29898,
29872,
29941,
29892,
931,
29892,
5731,
29918,
687,
29880,
29918,
2015,
29897,
13,
4706,
565,
6425,
29898,
29872,
29906,
29899,
29872,
29896,
29897,
529,
20341,
749,
29901,
13,
9651,
736,
313,
29872,
29941,
29892,
298,
29941,
29897,
13,
4706,
565,
298,
29941,
29889,
5066,
529,
29871,
29900,
29889,
29900,
29901,
13,
9651,
321,
29896,
353,
321,
29941,
13,
4706,
1683,
29901,
13,
9651,
321,
29906,
353,
321,
29941,
13,
13,
13,
1753,
10987,
29923,
11303,
23000,
29907,
2124,
886,
29898,
711,
2974,
29892,
931,
1125,
13,
1678,
396,
450,
321,
11303,
23000,
338,
263,
6432,
342,
616,
8607,
393,
16612,
278,
2099,
10694,
310,
13,
1678,
396,
278,
11563,
29915,
29879,
16980,
2820,
278,
8991,
29889,
1334,
671,
435,
29906,
29900,
29900,
29900,
321,
11303,
23000,
10350,
29892,
13,
1678,
396,
6593,
278,
921,
29899,
8990,
338,
3342,
304,
988,
278,
10694,
310,
278,
11563,
29915,
29879,
13,
1678,
396,
1592,
1061,
373,
5490,
29871,
29896,
29892,
29871,
29906,
29900,
29900,
29900,
472,
694,
265,
17998,
25869,
29879,
278,
321,
11303,
23000,
10694,
29889,
13,
1678,
396,
450,
6374,
921,
29899,
8990,
3291,
11183,
278,
4779,
1592,
1789,
29916,
29889,
13,
1678,
396,
20535,
403,
263,
13733,
4636,
393,
29436,
435,
29906,
29900,
29900,
29900,
321,
11303,
23000,
12047,
13,
1678,
396,
304,
14698,
12047,
363,
445,
22944,
322,
931,
29889,
13,
1678,
5731,
353,
20932,
29891,
29889,
21281,
362,
29918,
29923,
6154,
29918,
29950,
1955,
29898,
2230,
29892,
22944,
29897,
13,
13,
1678,
396,
21029,
3196,
3291,
2820,
278,
321,
11303,
23000,
29889,
13,
1678,
396,
22738,
278,
14698,
10350,
363,
1269,
4559,
29889,
13,
1678,
4029,
353,
518,
24932,
7967,
4339,
29898,
11206,
5265,
7390,
1164,
29898,
29875,
511,
931,
29892,
5731,
29897,
363,
474,
297,
3464,
29898,
13967,
29918,
8132,
3580,
17101,
4638,
13,
13,
1678,
363,
474,
297,
3464,
29898,
13967,
29918,
8132,
3580,
17101,
1125,
13,
4706,
263,
29896,
353,
4029,
29961,
29875,
1822,
5066,
13,
4706,
263,
29906,
353,
4029,
15625,
29875,
29974,
29896,
29897,
1273,
28019,
29918,
8132,
3580,
17101,
1822,
5066,
13,
4706,
321,
29896,
353,
17522,
5265,
7390,
1164,
29898,
29875,
29897,
13,
4706,
321,
29906,
353,
17522,
5265,
7390,
1164,
29898,
29875,
29974,
29896,
29897,
13,
4706,
565,
263,
29896,
334,
263,
29906,
5277,
29871,
29900,
29889,
29900,
29901,
13,
9651,
565,
263,
29906,
1405,
263,
29896,
29901,
13,
18884,
313,
735,
29892,
298,
29897,
353,
11856,
29898,
2230,
29892,
5731,
29892,
321,
29896,
29892,
321,
29906,
29897,
13,
9651,
1683,
29901,
13,
18884,
313,
735,
29892,
298,
29897,
353,
11856,
29898,
2230,
29892,
5731,
29892,
321,
29906,
29892,
321,
29896,
29897,
13,
13,
9651,
565,
298,
29889,
12957,
1405,
29871,
29900,
29889,
29900,
322,
298,
29889,
12957,
529,
29871,
29896,
29947,
29900,
29889,
29900,
29901,
13,
18884,
5305,
353,
525,
6151,
1975,
29915,
13,
9651,
1683,
29901,
13,
18884,
5305,
353,
525,
14273,
1975,
29915,
13,
9651,
1596,
877,
29923,
11303,
23000,
28745,
12365,
29900,
29889,
29946,
29888,
29913,
6571,
1549,
28205,
2698,
12365,
29900,
29889,
29946,
29888,
1118,
5272,
12365,
29900,
29889,
29945,
29887,
29913,
4286,
4830,
29898,
735,
29892,
5305,
29892,
298,
29889,
12957,
29892,
298,
29889,
5066,
876,
13,
13,
1678,
736,
29871,
29900,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
22944,
29892,
931,
353,
20969,
7883,
29898,
9675,
29889,
19218,
29897,
13,
1678,
10876,
29889,
13322,
29898,
12542,
29923,
11303,
23000,
29907,
2124,
886,
29898,
711,
2974,
29892,
931,
876,
13,
2
] |
src/jira_dashboard.py | riptano/argus | 2 | 185210 | # Copyright 2018 DataStax, 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 configparser import RawConfigParser
from subprocess import Popen
from typing import Dict, Optional, TYPE_CHECKING
from src.jira_view import JiraView
from src.utils import (browser, get_input, is_yes, pause, pick_value,
print_separator)
from .display_filter import DisplayFilter
if TYPE_CHECKING:
from src.display_filter import Column
from src.jira_manager import JiraManager
class JiraDashboard:
"""
Contains multiple JiraViews linked together into a single display
"""
def __init__(self, name: str, jira_views: Dict[str, JiraView]) -> None:
self.name = name
self._jira_views = jira_views
@classmethod
def build(cls, jira_views: Dict[str, JiraView]) -> Optional['JiraDashboard']:
"""
Links 2 or more JiraViews together, combining their results for display
"""
if len(jira_views) <= 1:
print('Need at least 2 JiraViews to create a dashboard. Please create more JiraViews first.')
return None
view_name_options = list(jira_views.keys())
dash_name = get_input('Name this dashboard:', lowered=False)
view_name = pick_value('Include which view?', view_name_options, True, 'Cancel')
if view_name is None:
return None
dash_views = {view_name: jira_views[view_name]}
view_name_options.remove(view_name)
view_name = pick_value('Second view?', view_name_options, False)
# make mypy happy - doesn't realize False means we can't have None
if view_name is None:
return None
dash_views[view_name] = jira_views[view_name]
view_name_options.remove(view_name)
while len(view_name_options) > 0:
if is_yes('Add another?'):
view_name = pick_value('What view?', view_name_options, True, '[q] Cancel')
if view_name == 'q' or view_name is None:
break
dash_views[view_name] = jira_views[view_name]
view_name_options.remove(view_name)
else:
break
return JiraDashboard(dash_name, dash_views)
def display_dashboard(self, jira_manager: 'JiraManager', jira_views: Dict[str, JiraView]) -> None:
df = DisplayFilter.default()
matching_issues = []
for jira_view in list(self._jira_views.values()):
matching_issues.extend(list(jira_view.get_issues().values()))
filters = {} # type: Dict[Column, str]
while True:
filtered_issues = df.display_and_return_sorted_issues(jira_manager, matching_issues, 1, filters)
print_separator(60)
prompt = 'Input [#] integer value to open ticket in browser, [f] to filter column by string, [c] to clear filters, [q] to quit'
custom = get_input(prompt)
if custom == 'q':
return
elif custom == 'f':
column_name = pick_value('Filter against which column?', [column.name for column in df.included_columns], True)
if column_name is None:
continue
to_match = get_input('Filter for what string?', False)
column_list = [col for col in df.included_columns if col.name == column_name]
assert len(column_list) == 1, 'Expected only 1 match with column name {}, got {}'.format(column_name, len(column_list))
filters[column_list[0]] = to_match
elif custom == 'c':
filters = {}
elif custom.isdigit():
intval = int(custom) - 1
issue = filtered_issues[intval]
# As we cache JiraProject data on a JiraConnection basis, we need to reach into the JiraView, to their
# contained JiraConnections, and check for presence of the owning JiraProject for this issuekey
# in order to determine our base url to open a browser to this issue. I'm not in love with this.
base_url = 'unknown'
for jira_view in list(jira_views.values()):
jira_connection = jira_view.jira_connection
for jira_project in jira_connection.cached_projects:
if jira_project.owns_issue(issue):
base_url = jira_connection.url
if base_url == 'unknown':
print('Failed to find JiraConnection for issuekey: {}. Something went wrong.'.format(issue.issue_key))
else:
issue_url = '{}browse/{}'.format(base_url, issue)
try:
Popen([browser(), issue_url])
print('Opened {}. Press enter to continue.'.format(issue_url))
pause()
except OSError as oe:
print('Failed to open browser [{}]. Probably need to configure your environment or update from main menu. Exception: {}'.format(browser(), oe))
else:
print('Oops... Unrecognized input. Please try again.')
pause()
def edit_dashboard(self, all_views: Dict[str, JiraView]) -> None:
# Remove currently held from list of all for iteration
for view_name in list(self._jira_views.keys()):
all_views.pop(view_name)
cmd = ''
while cmd != 'q':
cmd = get_input('[A]dd a view, [R]emove a view, [Q]uit:')
if cmd == 'r':
to_remove = pick_value('Remove which view?', list(self._jira_views.keys()), True, 'Cancel')
if to_remove is None:
continue
all_views.update({to_remove: self._jira_views[to_remove]})
self._jira_views.pop(to_remove)
elif cmd == 'a':
to_add = pick_value('Add which view?', list(all_views.keys()), True, 'Cancel')
if to_add is None:
continue
self._jira_views[to_add] = all_views[to_add]
all_views.pop(to_add)
def add_jira_view(self, jira_view: JiraView) -> None:
self._jira_views[jira_view.name] = jira_view
def remove_jira_view(self, jira_view_name: str) -> None:
if jira_view_name in self._jira_views:
del self._jira_views[jira_view_name]
def contains_jira_view(self, jira_view_name: str) -> bool:
return jira_view_name in self._jira_views
def save_config(self, config_parser: RawConfigParser) -> None:
config_parser.set('Dashboards', self.name, ','.join(list(self._jira_views.keys())))
def __str__(self) -> str:
result = 'Name: {}'.format(self.name)
for view in self._jira_views:
result += ', View: {}'.format(view)
return result
| [
1,
396,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
3630,
855,
1165,
29892,
9266,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
3166,
2295,
16680,
1053,
22038,
3991,
11726,
13,
3166,
1014,
5014,
1053,
349,
3150,
13,
3166,
19229,
1053,
360,
919,
29892,
28379,
29892,
323,
6959,
29918,
3210,
16658,
4214,
13,
13,
13,
3166,
4765,
29889,
2397,
336,
29918,
1493,
1053,
435,
3055,
1043,
13,
3166,
4765,
29889,
13239,
1053,
313,
15965,
29892,
679,
29918,
2080,
29892,
338,
29918,
3582,
29892,
19957,
29892,
5839,
29918,
1767,
29892,
13,
462,
539,
1596,
29918,
344,
17954,
29897,
13,
13,
3166,
869,
4990,
29918,
4572,
1053,
17440,
5072,
13,
13,
361,
323,
6959,
29918,
3210,
16658,
4214,
29901,
13,
1678,
515,
4765,
29889,
4990,
29918,
4572,
1053,
12481,
13,
1678,
515,
4765,
29889,
2397,
336,
29918,
12847,
1053,
435,
3055,
3260,
13,
13,
13,
1990,
435,
3055,
29928,
1161,
3377,
29901,
13,
13,
1678,
9995,
13,
1678,
2866,
2708,
2999,
435,
3055,
23825,
9024,
4208,
964,
263,
2323,
2479,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29901,
851,
29892,
432,
3055,
29918,
7406,
29901,
360,
919,
29961,
710,
29892,
435,
3055,
1043,
2314,
1599,
6213,
29901,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
3032,
2397,
336,
29918,
7406,
353,
432,
3055,
29918,
7406,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
2048,
29898,
25932,
29892,
432,
3055,
29918,
7406,
29901,
360,
919,
29961,
710,
29892,
435,
3055,
1043,
2314,
1599,
28379,
1839,
29967,
3055,
29928,
1161,
3377,
2033,
29901,
13,
4706,
9995,
13,
4706,
6645,
29879,
29871,
29906,
470,
901,
435,
3055,
23825,
4208,
29892,
29299,
1009,
2582,
363,
2479,
13,
4706,
9995,
13,
4706,
565,
7431,
29898,
2397,
336,
29918,
7406,
29897,
5277,
29871,
29896,
29901,
13,
9651,
1596,
877,
8139,
287,
472,
3203,
29871,
29906,
435,
3055,
23825,
304,
1653,
263,
12569,
3377,
29889,
3529,
1653,
901,
435,
3055,
23825,
937,
29889,
1495,
13,
9651,
736,
6213,
13,
13,
4706,
1776,
29918,
978,
29918,
6768,
353,
1051,
29898,
2397,
336,
29918,
7406,
29889,
8149,
3101,
13,
4706,
12569,
29918,
978,
353,
679,
29918,
2080,
877,
1170,
445,
12569,
3377,
29901,
742,
5224,
287,
29922,
8824,
29897,
13,
4706,
1776,
29918,
978,
353,
5839,
29918,
1767,
877,
29419,
607,
1776,
29973,
742,
1776,
29918,
978,
29918,
6768,
29892,
5852,
29892,
525,
19420,
1495,
13,
4706,
565,
1776,
29918,
978,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
13,
4706,
12569,
29918,
7406,
353,
426,
1493,
29918,
978,
29901,
432,
3055,
29918,
7406,
29961,
1493,
29918,
978,
12258,
13,
4706,
1776,
29918,
978,
29918,
6768,
29889,
5992,
29898,
1493,
29918,
978,
29897,
13,
13,
4706,
1776,
29918,
978,
353,
5839,
29918,
1767,
877,
11863,
1776,
29973,
742,
1776,
29918,
978,
29918,
6768,
29892,
7700,
29897,
13,
4706,
396,
1207,
590,
2272,
9796,
448,
1838,
29915,
29873,
16289,
7700,
2794,
591,
508,
29915,
29873,
505,
6213,
13,
4706,
565,
1776,
29918,
978,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
4706,
12569,
29918,
7406,
29961,
1493,
29918,
978,
29962,
353,
432,
3055,
29918,
7406,
29961,
1493,
29918,
978,
29962,
13,
4706,
1776,
29918,
978,
29918,
6768,
29889,
5992,
29898,
1493,
29918,
978,
29897,
13,
13,
4706,
1550,
7431,
29898,
1493,
29918,
978,
29918,
6768,
29897,
1405,
29871,
29900,
29901,
13,
9651,
565,
338,
29918,
3582,
877,
2528,
1790,
17901,
1125,
13,
18884,
1776,
29918,
978,
353,
5839,
29918,
1767,
877,
5618,
1776,
29973,
742,
1776,
29918,
978,
29918,
6768,
29892,
5852,
29892,
525,
29961,
29939,
29962,
1815,
2242,
1495,
13,
18884,
565,
1776,
29918,
978,
1275,
525,
29939,
29915,
470,
1776,
29918,
978,
338,
6213,
29901,
13,
462,
1678,
2867,
13,
18884,
12569,
29918,
7406,
29961,
1493,
29918,
978,
29962,
353,
432,
3055,
29918,
7406,
29961,
1493,
29918,
978,
29962,
13,
18884,
1776,
29918,
978,
29918,
6768,
29889,
5992,
29898,
1493,
29918,
978,
29897,
13,
9651,
1683,
29901,
13,
18884,
2867,
13,
13,
4706,
736,
435,
3055,
29928,
1161,
3377,
29898,
14592,
29918,
978,
29892,
12569,
29918,
7406,
29897,
13,
13,
1678,
822,
2479,
29918,
14592,
3377,
29898,
1311,
29892,
432,
3055,
29918,
12847,
29901,
525,
29967,
3055,
3260,
742,
432,
3055,
29918,
7406,
29901,
360,
919,
29961,
710,
29892,
435,
3055,
1043,
2314,
1599,
6213,
29901,
13,
4706,
4489,
353,
17440,
5072,
29889,
4381,
580,
13,
13,
4706,
9686,
29918,
12175,
353,
5159,
13,
4706,
363,
432,
3055,
29918,
1493,
297,
1051,
29898,
1311,
3032,
2397,
336,
29918,
7406,
29889,
5975,
580,
1125,
13,
9651,
9686,
29918,
12175,
29889,
21843,
29898,
1761,
29898,
2397,
336,
29918,
1493,
29889,
657,
29918,
12175,
2141,
5975,
22130,
13,
13,
4706,
18094,
353,
6571,
29871,
396,
1134,
29901,
360,
919,
29961,
4409,
29892,
851,
29962,
13,
4706,
1550,
5852,
29901,
13,
9651,
22289,
29918,
12175,
353,
4489,
29889,
4990,
29918,
392,
29918,
2457,
29918,
24582,
29918,
12175,
29898,
2397,
336,
29918,
12847,
29892,
9686,
29918,
12175,
29892,
29871,
29896,
29892,
18094,
29897,
13,
9651,
1596,
29918,
344,
17954,
29898,
29953,
29900,
29897,
13,
9651,
9508,
353,
525,
4290,
518,
29937,
29962,
6043,
995,
304,
1722,
23381,
297,
4714,
29892,
518,
29888,
29962,
304,
4175,
1897,
491,
1347,
29892,
518,
29883,
29962,
304,
2821,
18094,
29892,
518,
29939,
29962,
304,
23283,
29915,
13,
9651,
2888,
353,
679,
29918,
2080,
29898,
14032,
415,
29897,
13,
9651,
565,
2888,
1275,
525,
29939,
2396,
13,
18884,
736,
13,
9651,
25342,
2888,
1275,
525,
29888,
2396,
13,
18884,
1897,
29918,
978,
353,
5839,
29918,
1767,
877,
5072,
2750,
607,
1897,
29973,
742,
518,
4914,
29889,
978,
363,
1897,
297,
4489,
29889,
11707,
287,
29918,
13099,
1402,
5852,
29897,
13,
18884,
565,
1897,
29918,
978,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
304,
29918,
4352,
353,
679,
29918,
2080,
877,
5072,
363,
825,
1347,
29973,
742,
7700,
29897,
13,
13,
18884,
1897,
29918,
1761,
353,
518,
1054,
363,
784,
297,
4489,
29889,
11707,
287,
29918,
13099,
565,
784,
29889,
978,
1275,
1897,
29918,
978,
29962,
13,
18884,
4974,
7431,
29898,
4914,
29918,
1761,
29897,
1275,
29871,
29896,
29892,
525,
1252,
6021,
871,
29871,
29896,
1993,
411,
1897,
1024,
24335,
2355,
6571,
4286,
4830,
29898,
4914,
29918,
978,
29892,
7431,
29898,
4914,
29918,
1761,
876,
13,
18884,
18094,
29961,
4914,
29918,
1761,
29961,
29900,
5262,
353,
304,
29918,
4352,
13,
9651,
25342,
2888,
1275,
525,
29883,
2396,
13,
18884,
18094,
353,
6571,
13,
9651,
25342,
2888,
29889,
275,
26204,
7295,
13,
18884,
938,
791,
353,
938,
29898,
6341,
29897,
448,
29871,
29896,
13,
18884,
2228,
353,
22289,
29918,
12175,
29961,
524,
791,
29962,
13,
13,
18884,
396,
1094,
591,
7090,
435,
3055,
7653,
848,
373,
263,
435,
3055,
5350,
8405,
29892,
591,
817,
304,
6159,
964,
278,
435,
3055,
1043,
29892,
304,
1009,
13,
18884,
396,
11122,
435,
3055,
20971,
1953,
29892,
322,
1423,
363,
10122,
310,
278,
8152,
1076,
435,
3055,
7653,
363,
445,
2228,
1989,
13,
18884,
396,
297,
1797,
304,
8161,
1749,
2967,
3142,
304,
1722,
263,
4714,
304,
445,
2228,
29889,
306,
29915,
29885,
451,
297,
5360,
411,
445,
29889,
13,
18884,
2967,
29918,
2271,
353,
525,
26690,
29915,
13,
18884,
363,
432,
3055,
29918,
1493,
297,
1051,
29898,
2397,
336,
29918,
7406,
29889,
5975,
580,
1125,
13,
462,
1678,
432,
3055,
29918,
9965,
353,
432,
3055,
29918,
1493,
29889,
2397,
336,
29918,
9965,
13,
462,
1678,
363,
432,
3055,
29918,
4836,
297,
432,
3055,
29918,
9965,
29889,
29883,
3791,
29918,
16418,
29901,
13,
462,
4706,
565,
432,
3055,
29918,
4836,
29889,
776,
29879,
29918,
15118,
29898,
15118,
1125,
13,
462,
9651,
2967,
29918,
2271,
353,
432,
3055,
29918,
9965,
29889,
2271,
13,
18884,
565,
2967,
29918,
2271,
1275,
525,
26690,
2396,
13,
462,
1678,
1596,
877,
17776,
304,
1284,
435,
3055,
5350,
363,
2228,
1989,
29901,
426,
1836,
12538,
3512,
2743,
29889,
4286,
4830,
29898,
15118,
29889,
15118,
29918,
1989,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
2228,
29918,
2271,
353,
525,
8875,
23721,
344,
29914,
8875,
4286,
4830,
29898,
3188,
29918,
2271,
29892,
2228,
29897,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
349,
3150,
4197,
15965,
3285,
2228,
29918,
2271,
2314,
13,
462,
4706,
1596,
877,
6585,
287,
426,
1836,
5254,
3896,
304,
6773,
29889,
4286,
4830,
29898,
15118,
29918,
2271,
876,
13,
462,
4706,
19957,
580,
13,
462,
1678,
5174,
438,
29173,
408,
288,
29872,
29901,
13,
462,
4706,
1596,
877,
17776,
304,
1722,
4714,
518,
8875,
1822,
21606,
817,
304,
10822,
596,
5177,
470,
2767,
515,
1667,
6143,
29889,
8960,
29901,
6571,
4286,
4830,
29898,
15965,
3285,
288,
29872,
876,
13,
9651,
1683,
29901,
13,
18884,
1596,
877,
29949,
3554,
856,
853,
29423,
1891,
1881,
29889,
3529,
1018,
1449,
29889,
1495,
13,
18884,
19957,
580,
13,
13,
1678,
822,
3863,
29918,
14592,
3377,
29898,
1311,
29892,
599,
29918,
7406,
29901,
360,
919,
29961,
710,
29892,
435,
3055,
1043,
2314,
1599,
6213,
29901,
13,
4706,
396,
15154,
5279,
4934,
515,
1051,
310,
599,
363,
12541,
13,
4706,
363,
1776,
29918,
978,
297,
1051,
29898,
1311,
3032,
2397,
336,
29918,
7406,
29889,
8149,
580,
1125,
13,
9651,
599,
29918,
7406,
29889,
7323,
29898,
1493,
29918,
978,
29897,
13,
13,
4706,
9920,
353,
6629,
13,
4706,
1550,
9920,
2804,
525,
29939,
2396,
13,
9651,
9920,
353,
679,
29918,
2080,
877,
29961,
29909,
29962,
1289,
263,
1776,
29892,
518,
29934,
29962,
331,
994,
263,
1776,
29892,
518,
29984,
29962,
3121,
29901,
1495,
13,
9651,
565,
9920,
1275,
525,
29878,
2396,
13,
18884,
304,
29918,
5992,
353,
5839,
29918,
1767,
877,
15941,
607,
1776,
29973,
742,
1051,
29898,
1311,
3032,
2397,
336,
29918,
7406,
29889,
8149,
25739,
5852,
29892,
525,
19420,
1495,
13,
18884,
565,
304,
29918,
5992,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
599,
29918,
7406,
29889,
5504,
3319,
517,
29918,
5992,
29901,
1583,
3032,
2397,
336,
29918,
7406,
29961,
517,
29918,
5992,
29962,
1800,
13,
18884,
1583,
3032,
2397,
336,
29918,
7406,
29889,
7323,
29898,
517,
29918,
5992,
29897,
13,
9651,
25342,
9920,
1275,
525,
29874,
2396,
13,
18884,
304,
29918,
1202,
353,
5839,
29918,
1767,
877,
2528,
607,
1776,
29973,
742,
1051,
29898,
497,
29918,
7406,
29889,
8149,
25739,
5852,
29892,
525,
19420,
1495,
13,
18884,
565,
304,
29918,
1202,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
1583,
3032,
2397,
336,
29918,
7406,
29961,
517,
29918,
1202,
29962,
353,
599,
29918,
7406,
29961,
517,
29918,
1202,
29962,
13,
18884,
599,
29918,
7406,
29889,
7323,
29898,
517,
29918,
1202,
29897,
13,
13,
1678,
822,
788,
29918,
2397,
336,
29918,
1493,
29898,
1311,
29892,
432,
3055,
29918,
1493,
29901,
435,
3055,
1043,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
2397,
336,
29918,
7406,
29961,
2397,
336,
29918,
1493,
29889,
978,
29962,
353,
432,
3055,
29918,
1493,
13,
13,
1678,
822,
3349,
29918,
2397,
336,
29918,
1493,
29898,
1311,
29892,
432,
3055,
29918,
1493,
29918,
978,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
565,
432,
3055,
29918,
1493,
29918,
978,
297,
1583,
3032,
2397,
336,
29918,
7406,
29901,
13,
9651,
628,
1583,
3032,
2397,
336,
29918,
7406,
29961,
2397,
336,
29918,
1493,
29918,
978,
29962,
13,
13,
1678,
822,
3743,
29918,
2397,
336,
29918,
1493,
29898,
1311,
29892,
432,
3055,
29918,
1493,
29918,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
432,
3055,
29918,
1493,
29918,
978,
297,
1583,
3032,
2397,
336,
29918,
7406,
13,
13,
1678,
822,
4078,
29918,
2917,
29898,
1311,
29892,
2295,
29918,
16680,
29901,
22038,
3991,
11726,
29897,
1599,
6213,
29901,
13,
4706,
2295,
29918,
16680,
29889,
842,
877,
29928,
1161,
24691,
742,
1583,
29889,
978,
29892,
13420,
4286,
7122,
29898,
1761,
29898,
1311,
3032,
2397,
336,
29918,
7406,
29889,
8149,
580,
4961,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
1121,
353,
525,
1170,
29901,
6571,
4286,
4830,
29898,
1311,
29889,
978,
29897,
13,
4706,
363,
1776,
297,
1583,
3032,
2397,
336,
29918,
7406,
29901,
13,
9651,
1121,
4619,
13420,
4533,
29901,
6571,
4286,
4830,
29898,
1493,
29897,
13,
4706,
736,
1121,
13,
2
] |
encrypt.py | mtlynch/simple-encrypt | 0 | 48136 | <filename>encrypt.py
#!/usr/bin/python3
import argparse
import base64
from cryptography import fernet
from cryptography.hazmat import backends
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf import pbkdf2
import getpass
import secrets
import sys
def _derive_key(password: bytes) -> bytes:
kdf = pbkdf2.PBKDF2HMAC(
algorithm=hashes.SHA256(), length=32, salt=b'',
iterations=pow(10, 7), backend=backends.default_backend())
return base64.urlsafe_b64encode(kdf.derive(password))
def password_encrypt(message: bytes, password: str) -> bytes:
key = _derive_key(password.encode())
return fernet.Fernet(key).encrypt(message)
if __name__ == '__main__':
message = sys.stdin.read()
password = <PASSWORD>()
ciphertext = password_encrypt(message.encode(), password)
print(ciphertext.decode())
| [
1,
529,
9507,
29958,
3977,
4641,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
29941,
13,
13,
5215,
1852,
5510,
13,
5215,
2967,
29953,
29946,
13,
3166,
24941,
5275,
1053,
285,
824,
300,
13,
3166,
24941,
5275,
29889,
29882,
834,
2922,
1053,
1250,
1975,
13,
3166,
24941,
5275,
29889,
29882,
834,
2922,
29889,
9469,
277,
3145,
1053,
6608,
267,
13,
3166,
24941,
5275,
29889,
29882,
834,
2922,
29889,
9469,
277,
3145,
29889,
29895,
2176,
1053,
282,
29890,
29895,
2176,
29906,
13,
5215,
679,
3364,
13,
5215,
22183,
1372,
13,
5215,
10876,
13,
13,
13,
1753,
903,
672,
573,
29918,
1989,
29898,
5630,
29901,
6262,
29897,
1599,
6262,
29901,
13,
1678,
413,
2176,
353,
282,
29890,
29895,
2176,
29906,
29889,
29925,
29933,
29968,
4037,
29906,
29950,
1529,
29907,
29898,
13,
4706,
5687,
29922,
8568,
267,
29889,
23498,
29906,
29945,
29953,
3285,
3309,
29922,
29941,
29906,
29892,
15795,
29922,
29890,
29915,
742,
13,
4706,
24372,
29922,
12248,
29898,
29896,
29900,
29892,
29871,
29955,
511,
14998,
29922,
1627,
1975,
29889,
4381,
29918,
27852,
3101,
13,
1678,
736,
2967,
29953,
29946,
29889,
2271,
11177,
29918,
29890,
29953,
29946,
12508,
29898,
29895,
2176,
29889,
672,
573,
29898,
5630,
876,
13,
13,
13,
1753,
4800,
29918,
3977,
4641,
29898,
4906,
29901,
6262,
29892,
4800,
29901,
851,
29897,
1599,
6262,
29901,
13,
1678,
1820,
353,
903,
672,
573,
29918,
1989,
29898,
5630,
29889,
12508,
3101,
13,
1678,
736,
285,
824,
300,
29889,
20899,
300,
29898,
1989,
467,
3977,
4641,
29898,
4906,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
2643,
353,
10876,
29889,
4172,
262,
29889,
949,
580,
13,
1678,
4800,
353,
529,
25711,
17013,
16917,
13,
1678,
4583,
8096,
726,
353,
4800,
29918,
3977,
4641,
29898,
4906,
29889,
12508,
3285,
4800,
29897,
13,
1678,
1596,
29898,
455,
8096,
726,
29889,
13808,
3101,
13,
2
] |
test.py | schanezon/webapp | 0 | 78729 | from flask import Flask, redirect, abort, url_for
app = Flask(__name__)
app.debug = True
@app.route('/')
def index():
return redirect(url_for('login'))
@app.route('/login')
def login():
abort(401)
this_is_never_executed()
if __name__ == '__main__':
app.run()
| [
1,
515,
29784,
1053,
2379,
1278,
29892,
6684,
29892,
27450,
29892,
3142,
29918,
1454,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
932,
29889,
8382,
353,
5852,
13,
13,
29992,
932,
29889,
13134,
11219,
1495,
13,
1753,
2380,
7295,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
13,
29992,
932,
29889,
13134,
11219,
7507,
1495,
13,
1753,
6464,
7295,
13,
1678,
27450,
29898,
29946,
29900,
29896,
29897,
13,
1678,
445,
29918,
275,
29918,
484,
369,
29918,
4258,
3860,
580,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
623,
29889,
3389,
580,
13,
2
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.