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
|
---|---|---|---|---|---|
InvenTree/build/views.py | mpdgraev/InvenTree | 0 | 152474 | """
Django views for interacting with Build objects
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from django.views.generic import DetailView, ListView, UpdateView
from django.forms import HiddenInput
from django.urls import reverse
from part.models import Part
from .models import Build, BuildItem
from . import forms
from stock.models import StockLocation, StockItem
from InvenTree.views import AjaxUpdateView, AjaxCreateView, AjaxDeleteView
from InvenTree.views import InvenTreeRoleMixin
from InvenTree.helpers import str2bool, ExtractSerialNumbers
from InvenTree.status_codes import BuildStatus
class BuildIndex(InvenTreeRoleMixin, ListView):
""" View for displaying list of Builds
"""
model = Build
template_name = 'build/index.html'
context_object_name = 'builds'
role_required = 'build.view'
def get_queryset(self):
""" Return all Build objects (order by date, newest first) """
return Build.objects.order_by('status', '-completion_date')
def get_context_data(self, **kwargs):
context = super(BuildIndex, self).get_context_data(**kwargs).copy()
context['BuildStatus'] = BuildStatus
context['active'] = self.get_queryset().filter(status__in=BuildStatus.ACTIVE_CODES)
context['completed'] = self.get_queryset().filter(status=BuildStatus.COMPLETE)
context['cancelled'] = self.get_queryset().filter(status=BuildStatus.CANCELLED)
return context
class BuildCancel(AjaxUpdateView):
""" View to cancel a Build.
Provides a cancellation information dialog
"""
model = Build
ajax_template_name = 'build/cancel.html'
ajax_form_title = _('Cancel Build')
context_object_name = 'build'
form_class = forms.CancelBuildForm
role_required = 'build.change'
def post(self, request, *args, **kwargs):
""" Handle POST request. Mark the build status as CANCELLED """
build = self.get_object()
form = self.get_form()
valid = form.is_valid()
confirm = str2bool(request.POST.get('confirm_cancel', False))
if confirm:
build.cancelBuild(request.user)
else:
form.errors['confirm_cancel'] = [_('Confirm build cancellation')]
valid = False
data = {
'form_valid': valid,
'danger': _('Build was cancelled')
}
return self.renderJsonResponse(request, form, data=data)
class BuildAutoAllocate(AjaxUpdateView):
""" View to auto-allocate parts for a build.
Follows a simple set of rules to automatically allocate StockItem objects.
Ref: build.models.Build.getAutoAllocations()
"""
model = Build
form_class = forms.ConfirmBuildForm
context_object_name = 'build'
ajax_form_title = _('Allocate Stock')
ajax_template_name = 'build/auto_allocate.html'
role_required = 'build.change'
def get_context_data(self, *args, **kwargs):
""" Get the context data for form rendering. """
context = {}
try:
build = Build.objects.get(id=self.kwargs['pk'])
context['build'] = build
context['allocations'] = build.getAutoAllocations()
except Build.DoesNotExist:
context['error'] = _('No matching build found')
return context
def post(self, request, *args, **kwargs):
""" Handle POST request. Perform auto allocations.
- If the form validation passes, perform allocations
- Otherwise, the form is passed back to the client
"""
build = self.get_object()
form = self.get_form()
confirm = request.POST.get('confirm', False)
valid = False
if confirm is False:
form.errors['confirm'] = [_('Confirm stock allocation')]
form.non_field_errors = [_('Check the confirmation box at the bottom of the list')]
else:
build.autoAllocate()
valid = True
data = {
'form_valid': valid,
}
return self.renderJsonResponse(request, form, data, context=self.get_context_data())
class BuildUnallocate(AjaxUpdateView):
""" View to un-allocate all parts from a build.
Provides a simple confirmation dialog with a BooleanField checkbox.
"""
model = Build
form_class = forms.ConfirmBuildForm
ajax_form_title = _("Unallocate Stock")
ajax_template_name = "build/unallocate.html"
form_required = 'build.change'
def post(self, request, *args, **kwargs):
build = self.get_object()
form = self.get_form()
confirm = request.POST.get('confirm', False)
valid = False
if confirm is False:
form.errors['confirm'] = [_('Confirm unallocation of build stock')]
form.non_field_errors = [_('Check the confirmation box')]
else:
build.unallocateStock()
valid = True
data = {
'form_valid': valid,
}
return self.renderJsonResponse(request, form, data)
class BuildComplete(AjaxUpdateView):
""" View to mark a build as Complete.
- Notifies the user of which parts will be removed from stock.
- Removes allocated items from stock
- Deletes pending BuildItem objects
"""
model = Build
form_class = forms.CompleteBuildForm
context_object_name = "build"
ajax_form_title = _("Complete Build")
ajax_template_name = "build/complete.html"
role_required = 'build.change'
def get_form(self):
""" Get the form object.
If the part is trackable, include a field for serial numbers.
"""
build = self.get_object()
form = super().get_form()
if not build.part.trackable:
form.fields.pop('serial_numbers')
else:
form.field_placeholder['serial_numbers'] = build.part.getSerialNumberString(build.quantity)
form.rebuild_layout()
return form
def get_initial(self):
""" Get initial form data for the CompleteBuild form
- If the part being built has a default location, pre-select that location
"""
initials = super(BuildComplete, self).get_initial().copy()
build = self.get_object()
if build.part.default_location is not None:
try:
location = StockLocation.objects.get(pk=build.part.default_location.id)
initials['location'] = location
except StockLocation.DoesNotExist:
pass
return initials
def get_context_data(self, **kwargs):
""" Get context data for passing to the rendered form
- Build information is required
"""
build = Build.objects.get(id=self.kwargs['pk'])
context = {}
# Build object
context['build'] = build
# Items to be removed from stock
taking = BuildItem.objects.filter(build=build.id)
context['taking'] = taking
return context
def post(self, request, *args, **kwargs):
""" Handle POST request. Mark the build as COMPLETE
- If the form validation passes, the Build objects completeBuild() method is called
- Otherwise, the form is passed back to the client
"""
build = self.get_object()
form = self.get_form()
confirm = str2bool(request.POST.get('confirm', False))
loc_id = request.POST.get('location', None)
valid = False
if confirm is False:
form.errors['confirm'] = [
_('Confirm completion of build'),
]
else:
try:
location = StockLocation.objects.get(id=loc_id)
valid = True
except (ValueError, StockLocation.DoesNotExist):
form.errors['location'] = [_('Invalid location selected')]
serials = []
if build.part.trackable:
# A build for a trackable part may optionally specify serial numbers.
sn = request.POST.get('serial_numbers', '')
sn = str(sn).strip()
# If the user has specified serial numbers, check they are valid
if len(sn) > 0:
try:
# Exctract a list of provided serial numbers
serials = ExtractSerialNumbers(sn, build.quantity)
existing = []
for serial in serials:
if build.part.checkIfSerialNumberExists(serial):
existing.append(serial)
if len(existing) > 0:
exists = ",".join([str(x) for x in existing])
form.errors['serial_numbers'] = [_('The following serial numbers already exist: ({sn})'.format(sn=exists))]
valid = False
except ValidationError as e:
form.errors['serial_numbers'] = e.messages
valid = False
if valid:
if not build.completeBuild(location, serials, request.user):
form.non_field_errors = [('Build could not be completed')]
valid = False
data = {
'form_valid': valid,
}
return self.renderJsonResponse(request, form, data, context=self.get_context_data())
def get_data(self):
""" Provide feedback data back to the form """
return {
'info': _('Build marked as COMPLETE')
}
class BuildNotes(UpdateView):
""" View for editing the 'notes' field of a Build object.
"""
context_object_name = 'build'
template_name = 'build/notes.html'
model = Build
role_required = 'build.view'
fields = ['notes']
def get_success_url(self):
return reverse('build-notes', kwargs={'pk': self.get_object().id})
def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx['editing'] = str2bool(self.request.GET.get('edit', ''))
return ctx
class BuildDetail(DetailView):
""" Detail view of a single Build object. """
model = Build
template_name = 'build/detail.html'
context_object_name = 'build'
role_required = 'build.view'
def get_context_data(self, **kwargs):
ctx = super(DetailView, self).get_context_data(**kwargs)
build = self.get_object()
ctx['bom_price'] = build.part.get_price_info(build.quantity, buy=False)
ctx['BuildStatus'] = BuildStatus
return ctx
class BuildAllocate(DetailView):
""" View for allocating parts to a Build """
model = Build
context_object_name = 'build'
template_name = 'build/allocate.html'
role_required = ['build.change']
def get_context_data(self, **kwargs):
""" Provide extra context information for the Build allocation page """
context = super(DetailView, self).get_context_data(**kwargs)
build = self.get_object()
part = build.part
bom_items = part.bom_items
context['part'] = part
context['bom_items'] = bom_items
context['BuildStatus'] = BuildStatus
context['bom_price'] = build.part.get_price_info(build.quantity, buy=False)
if str2bool(self.request.GET.get('edit', None)):
context['editing'] = True
return context
class BuildCreate(AjaxCreateView):
""" View to create a new Build object """
model = Build
context_object_name = 'build'
form_class = forms.EditBuildForm
ajax_form_title = _('Start new Build')
ajax_template_name = 'modal_form.html'
role_required = 'build.add'
def get_initial(self):
""" Get initial parameters for Build creation.
If 'part' is specified in the GET query, initialize the Build with the specified Part
"""
initials = super(BuildCreate, self).get_initial().copy()
# User has provided a Part ID
initials['part'] = self.request.GET.get('part', None)
initials['parent'] = self.request.GET.get('parent', None)
# User has provided a SalesOrder ID
initials['sales_order'] = self.request.GET.get('sales_order', None)
initials['quantity'] = self.request.GET.get('quantity', 1)
return initials
def get_data(self):
return {
'success': _('Created new build'),
}
class BuildUpdate(AjaxUpdateView):
""" View for editing a Build object """
model = Build
form_class = forms.EditBuildForm
context_object_name = 'build'
ajax_form_title = _('Edit Build Details')
ajax_template_name = 'modal_form.html'
role_required = 'build.change'
def get_data(self):
return {
'info': _('Edited build'),
}
class BuildDelete(AjaxDeleteView):
""" View to delete a build """
model = Build
ajax_template_name = 'build/delete_build.html'
ajax_form_title = _('Delete Build')
role_required = 'build.delete'
class BuildItemDelete(AjaxDeleteView):
""" View to 'unallocate' a BuildItem.
Really we are deleting the BuildItem object from the database.
"""
model = BuildItem
ajax_template_name = 'build/delete_build_item.html'
ajax_form_title = _('Unallocate Stock')
context_object_name = 'item'
role_required = 'build.delete'
def get_data(self):
return {
'danger': _('Removed parts from build allocation')
}
class BuildItemCreate(AjaxCreateView):
""" View for allocating a new part to a build """
model = BuildItem
form_class = forms.EditBuildItemForm
ajax_template_name = 'build/create_build_item.html'
ajax_form_title = _('Allocate new Part')
role_required = 'build.add'
part = None
available_stock = None
def get_context_data(self):
ctx = super(AjaxCreateView, self).get_context_data()
if self.part:
ctx['part'] = self.part
if self.available_stock:
ctx['stock'] = self.available_stock
else:
ctx['no_stock'] = True
return ctx
def get_form(self):
""" Create Form for making / editing new Part object """
form = super(AjaxCreateView, self).get_form()
# If the Build object is specified, hide the input field.
# We do not want the users to be able to move a BuildItem to a different build
build_id = form['build'].value()
if build_id is not None:
form.fields['build'].widget = HiddenInput()
# If the sub_part is supplied, limit to matching stock items
part_id = self.get_param('part')
if part_id:
try:
self.part = Part.objects.get(pk=part_id)
query = form.fields['stock_item'].queryset
# Only allow StockItem objects which match the current part
query = query.filter(part=part_id)
if build_id is not None:
try:
build = Build.objects.get(id=build_id)
if build.take_from is not None:
# Limit query to stock items that are downstream of the 'take_from' location
query = query.filter(location__in=[loc for loc in build.take_from.getUniqueChildren()])
except Build.DoesNotExist:
pass
# Exclude StockItem objects which are already allocated to this build and part
query = query.exclude(id__in=[item.stock_item.id for item in BuildItem.objects.filter(build=build_id, stock_item__part=part_id)])
form.fields['stock_item'].queryset = query
stocks = query.all()
self.available_stock = stocks
# If there is only one item selected, select it
if len(stocks) == 1:
form.fields['stock_item'].initial = stocks[0].id
# There is no stock available
elif len(stocks) == 0:
# TODO - Add a message to the form describing the problem
pass
except Part.DoesNotExist:
self.part = None
pass
return form
def get_initial(self):
""" Provide initial data for BomItem. Look for the folllowing in the GET data:
- build: pk of the Build object
"""
initials = super(AjaxCreateView, self).get_initial().copy()
build_id = self.get_param('build')
part_id = self.get_param('part')
# Reference to a Part object
part = None
# Reference to a StockItem object
item = None
# Reference to a Build object
build = None
if part_id:
try:
part = Part.objects.get(pk=part_id)
initials['part'] = part
except Part.DoesNotExist:
pass
if build_id:
try:
build = Build.objects.get(pk=build_id)
initials['build'] = build
except Build.DoesNotExist:
pass
quantity = self.request.GET.get('quantity', None)
if quantity is not None:
quantity = float(quantity)
if quantity is None:
# Work out how many parts remain to be alloacted for the build
if part:
quantity = build.getUnallocatedQuantity(part)
item_id = self.get_param('item')
# If the request specifies a particular StockItem
if item_id:
try:
item = StockItem.objects.get(pk=item_id)
except:
pass
# If a StockItem is not selected, try to auto-select one
if item is None and part is not None:
items = StockItem.objects.filter(part=part)
if items.count() == 1:
item = items.first()
# Finally, if a StockItem is selected, ensure the quantity is not too much
if item is not None:
if quantity is None:
quantity = item.unallocated_quantity()
else:
quantity = min(quantity, item.unallocated_quantity())
if quantity is not None:
initials['quantity'] = quantity
return initials
class BuildItemEdit(AjaxUpdateView):
""" View to edit a BuildItem object """
model = BuildItem
ajax_template_name = 'modal_form.html'
form_class = forms.EditBuildItemForm
ajax_form_title = _('Edit Stock Allocation')
role_required = 'build.change'
def get_data(self):
return {
'info': _('Updated Build Item'),
}
def get_form(self):
""" Create form for editing a BuildItem.
- Limit the StockItem options to items that match the part
"""
build_item = self.get_object()
form = super(BuildItemEdit, self).get_form()
query = StockItem.objects.all()
if build_item.stock_item:
part_id = build_item.stock_item.part.id
query = query.filter(part=part_id)
form.fields['stock_item'].queryset = query
form.fields['build'].widget = HiddenInput()
return form
| [
1,
9995,
13,
29928,
5364,
8386,
363,
16254,
292,
411,
8878,
3618,
13,
15945,
29908,
13,
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,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
408,
903,
13,
3166,
9557,
29889,
3221,
29889,
11739,
29879,
1053,
15758,
362,
2392,
13,
3166,
9557,
29889,
7406,
29889,
19206,
1053,
5953,
737,
1043,
29892,
22184,
29892,
10318,
1043,
13,
3166,
9557,
29889,
9514,
1053,
379,
4215,
4290,
13,
3166,
9557,
29889,
26045,
1053,
11837,
13,
13,
3166,
760,
29889,
9794,
1053,
3455,
13,
3166,
869,
9794,
1053,
8878,
29892,
8878,
2001,
13,
3166,
869,
1053,
7190,
13,
3166,
10961,
29889,
9794,
1053,
10224,
6508,
29892,
10224,
2001,
13,
13,
3166,
512,
854,
9643,
29889,
7406,
1053,
21586,
6422,
1043,
29892,
21586,
4391,
1043,
29892,
21586,
12498,
1043,
13,
3166,
512,
854,
9643,
29889,
7406,
1053,
512,
854,
9643,
16727,
29924,
861,
262,
13,
3166,
512,
854,
9643,
29889,
3952,
6774,
1053,
851,
29906,
11227,
29892,
7338,
1461,
9125,
29478,
13,
3166,
512,
854,
9643,
29889,
4882,
29918,
18137,
1053,
8878,
5709,
13,
13,
13,
1990,
8878,
3220,
29898,
797,
854,
9643,
16727,
29924,
861,
262,
29892,
22184,
1125,
13,
1678,
9995,
4533,
363,
16384,
1051,
310,
8878,
29879,
13,
1678,
9995,
13,
1678,
1904,
353,
8878,
13,
1678,
4472,
29918,
978,
353,
525,
4282,
29914,
2248,
29889,
1420,
29915,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29879,
29915,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
1493,
29915,
13,
13,
1678,
822,
679,
29918,
1972,
842,
29898,
1311,
1125,
13,
4706,
9995,
7106,
599,
8878,
3618,
313,
2098,
491,
2635,
29892,
716,
342,
937,
29897,
9995,
13,
4706,
736,
8878,
29889,
12650,
29889,
2098,
29918,
1609,
877,
4882,
742,
17411,
5729,
12757,
29918,
1256,
1495,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
29892,
3579,
19290,
1125,
13,
13,
4706,
3030,
353,
2428,
29898,
8893,
3220,
29892,
1583,
467,
657,
29918,
4703,
29918,
1272,
29898,
1068,
19290,
467,
8552,
580,
13,
13,
4706,
3030,
1839,
8893,
5709,
2033,
353,
8878,
5709,
13,
13,
4706,
3030,
1839,
4925,
2033,
353,
1583,
29889,
657,
29918,
1972,
842,
2141,
4572,
29898,
4882,
1649,
262,
29922,
8893,
5709,
29889,
17923,
18474,
29918,
16524,
29903,
29897,
13,
13,
4706,
3030,
1839,
5729,
9446,
2033,
353,
1583,
29889,
657,
29918,
1972,
842,
2141,
4572,
29898,
4882,
29922,
8893,
5709,
29889,
21514,
18476,
29897,
13,
4706,
3030,
1839,
20713,
839,
2033,
353,
1583,
29889,
657,
29918,
1972,
842,
2141,
4572,
29898,
4882,
29922,
8893,
5709,
29889,
29907,
23219,
29931,
20566,
29897,
13,
13,
4706,
736,
3030,
13,
13,
13,
1990,
8878,
19420,
29898,
29909,
6487,
6422,
1043,
1125,
13,
1678,
9995,
4533,
304,
12611,
263,
8878,
29889,
13,
1678,
9133,
2247,
263,
508,
22603,
2472,
7928,
13,
1678,
9995,
13,
13,
1678,
1904,
353,
8878,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
4282,
29914,
20713,
29889,
1420,
29915,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
19420,
8878,
1495,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
19420,
8893,
2500,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
3167,
29915,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
29273,
11971,
2009,
29889,
4485,
278,
2048,
4660,
408,
315,
23219,
29931,
20566,
9995,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
883,
353,
1583,
29889,
657,
29918,
689,
580,
13,
13,
4706,
2854,
353,
883,
29889,
275,
29918,
3084,
580,
13,
13,
4706,
9659,
353,
851,
29906,
11227,
29898,
3827,
29889,
5438,
29889,
657,
877,
26897,
29918,
20713,
742,
7700,
876,
13,
13,
4706,
565,
9659,
29901,
13,
9651,
2048,
29889,
20713,
8893,
29898,
3827,
29889,
1792,
29897,
13,
4706,
1683,
29901,
13,
9651,
883,
29889,
12523,
1839,
26897,
29918,
20713,
2033,
353,
23160,
877,
16376,
3568,
2048,
508,
22603,
1495,
29962,
13,
9651,
2854,
353,
7700,
13,
13,
4706,
848,
353,
426,
13,
9651,
525,
689,
29918,
3084,
2396,
2854,
29892,
13,
9651,
525,
29881,
4600,
2396,
903,
877,
8893,
471,
12611,
839,
1495,
13,
4706,
500,
13,
13,
4706,
736,
1583,
29889,
9482,
8148,
5103,
29898,
3827,
29892,
883,
29892,
848,
29922,
1272,
29897,
13,
13,
13,
1990,
8878,
12300,
2499,
2029,
403,
29898,
29909,
6487,
6422,
1043,
1125,
13,
1678,
9995,
4533,
304,
4469,
29899,
15956,
403,
5633,
363,
263,
2048,
29889,
13,
1678,
10306,
29879,
263,
2560,
731,
310,
6865,
304,
6336,
23632,
10224,
2001,
3618,
29889,
13,
13,
1678,
9897,
29901,
2048,
29889,
9794,
29889,
8893,
29889,
657,
12300,
2499,
2029,
800,
580,
13,
1678,
9995,
13,
13,
1678,
1904,
353,
8878,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
16376,
3568,
8893,
2500,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
2499,
2029,
403,
10224,
1495,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
4282,
29914,
6921,
29918,
15956,
403,
29889,
1420,
29915,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
3167,
29915,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
3617,
278,
3030,
848,
363,
883,
15061,
29889,
9995,
13,
13,
4706,
3030,
353,
6571,
13,
13,
4706,
1018,
29901,
13,
9651,
2048,
353,
8878,
29889,
12650,
29889,
657,
29898,
333,
29922,
1311,
29889,
19290,
1839,
20571,
11287,
13,
9651,
3030,
1839,
4282,
2033,
353,
2048,
13,
9651,
3030,
1839,
15956,
800,
2033,
353,
2048,
29889,
657,
12300,
2499,
2029,
800,
580,
13,
4706,
5174,
8878,
29889,
25125,
3664,
1252,
391,
29901,
13,
9651,
3030,
1839,
2704,
2033,
353,
903,
877,
3782,
9686,
2048,
1476,
1495,
13,
13,
4706,
736,
3030,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
29273,
11971,
2009,
29889,
27313,
4469,
6643,
800,
29889,
13,
13,
4706,
448,
960,
278,
883,
8845,
14517,
29892,
2189,
6643,
800,
13,
4706,
448,
13466,
29892,
278,
883,
338,
4502,
1250,
304,
278,
3132,
13,
4706,
9995,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
4706,
883,
353,
1583,
29889,
657,
29918,
689,
580,
13,
13,
4706,
9659,
353,
2009,
29889,
5438,
29889,
657,
877,
26897,
742,
7700,
29897,
13,
13,
4706,
2854,
353,
7700,
13,
13,
4706,
565,
9659,
338,
7700,
29901,
13,
9651,
883,
29889,
12523,
1839,
26897,
2033,
353,
23160,
877,
16376,
3568,
10961,
24082,
1495,
29962,
13,
9651,
883,
29889,
5464,
29918,
2671,
29918,
12523,
353,
23160,
877,
5596,
278,
9659,
362,
3800,
472,
278,
5970,
310,
278,
1051,
1495,
29962,
13,
4706,
1683,
29901,
13,
9651,
2048,
29889,
6921,
2499,
2029,
403,
580,
13,
9651,
2854,
353,
5852,
13,
13,
4706,
848,
353,
426,
13,
9651,
525,
689,
29918,
3084,
2396,
2854,
29892,
13,
4706,
500,
13,
13,
4706,
736,
1583,
29889,
9482,
8148,
5103,
29898,
3827,
29892,
883,
29892,
848,
29892,
3030,
29922,
1311,
29889,
657,
29918,
4703,
29918,
1272,
3101,
13,
13,
13,
1990,
8878,
2525,
15956,
403,
29898,
29909,
6487,
6422,
1043,
1125,
13,
1678,
9995,
4533,
304,
443,
29899,
15956,
403,
599,
5633,
515,
263,
2048,
29889,
13,
13,
1678,
9133,
2247,
263,
2560,
9659,
362,
7928,
411,
263,
11185,
3073,
12527,
29889,
13,
1678,
9995,
13,
13,
1678,
1904,
353,
8878,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
16376,
3568,
8893,
2500,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
703,
2525,
15956,
403,
10224,
1159,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
376,
4282,
29914,
348,
15956,
403,
29889,
1420,
29908,
13,
1678,
883,
29918,
12403,
353,
525,
4282,
29889,
3167,
29915,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
4706,
883,
353,
1583,
29889,
657,
29918,
689,
580,
13,
308,
13,
4706,
9659,
353,
2009,
29889,
5438,
29889,
657,
877,
26897,
742,
7700,
29897,
13,
13,
4706,
2854,
353,
7700,
13,
13,
4706,
565,
9659,
338,
7700,
29901,
13,
9651,
883,
29889,
12523,
1839,
26897,
2033,
353,
23160,
877,
16376,
3568,
443,
284,
5479,
310,
2048,
10961,
1495,
29962,
13,
9651,
883,
29889,
5464,
29918,
2671,
29918,
12523,
353,
23160,
877,
5596,
278,
9659,
362,
3800,
1495,
29962,
13,
4706,
1683,
29901,
13,
9651,
2048,
29889,
348,
15956,
403,
20754,
384,
580,
13,
9651,
2854,
353,
5852,
13,
13,
4706,
848,
353,
426,
13,
9651,
525,
689,
29918,
3084,
2396,
2854,
29892,
13,
4706,
500,
13,
13,
4706,
736,
1583,
29889,
9482,
8148,
5103,
29898,
3827,
29892,
883,
29892,
848,
29897,
13,
13,
13,
1990,
8878,
17813,
29898,
29909,
6487,
6422,
1043,
1125,
13,
1678,
9995,
4533,
304,
2791,
263,
2048,
408,
25034,
29889,
13,
13,
1678,
448,
2216,
11057,
278,
1404,
310,
607,
5633,
674,
367,
6206,
515,
10961,
29889,
13,
1678,
448,
5240,
586,
267,
19591,
4452,
515,
10961,
13,
1678,
448,
897,
1026,
267,
28235,
8878,
2001,
3618,
13,
1678,
9995,
13,
13,
1678,
1904,
353,
8878,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
17813,
8893,
2500,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
376,
4282,
29908,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
703,
17813,
8878,
1159,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
376,
4282,
29914,
8835,
29889,
1420,
29908,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
3167,
29915,
13,
13,
1678,
822,
679,
29918,
689,
29898,
1311,
1125,
13,
4706,
9995,
3617,
278,
883,
1203,
29889,
13,
13,
4706,
960,
278,
760,
338,
5702,
519,
29892,
3160,
263,
1746,
363,
7797,
3694,
29889,
13,
4706,
9995,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
883,
353,
2428,
2141,
657,
29918,
689,
580,
13,
13,
4706,
565,
451,
2048,
29889,
1595,
29889,
11294,
519,
29901,
13,
9651,
883,
29889,
9621,
29889,
7323,
877,
15550,
29918,
20326,
1495,
13,
4706,
1683,
29901,
13,
13,
9651,
883,
29889,
2671,
29918,
27074,
1839,
15550,
29918,
20326,
2033,
353,
2048,
29889,
1595,
29889,
657,
9125,
4557,
1231,
29898,
4282,
29889,
22640,
29897,
13,
13,
9651,
883,
29889,
276,
4282,
29918,
2680,
580,
13,
13,
4706,
736,
883,
13,
13,
1678,
822,
679,
29918,
11228,
29898,
1311,
1125,
13,
4706,
9995,
3617,
2847,
883,
848,
363,
278,
25034,
8893,
883,
13,
13,
4706,
448,
960,
278,
760,
1641,
4240,
756,
263,
2322,
4423,
29892,
758,
29899,
2622,
393,
4423,
13,
4706,
9995,
13,
308,
13,
4706,
2847,
29879,
353,
2428,
29898,
8893,
17813,
29892,
1583,
467,
657,
29918,
11228,
2141,
8552,
580,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
565,
2048,
29889,
1595,
29889,
4381,
29918,
5479,
338,
451,
6213,
29901,
13,
9651,
1018,
29901,
13,
18884,
4423,
353,
10224,
6508,
29889,
12650,
29889,
657,
29898,
20571,
29922,
4282,
29889,
1595,
29889,
4381,
29918,
5479,
29889,
333,
29897,
13,
18884,
2847,
29879,
1839,
5479,
2033,
353,
4423,
13,
9651,
5174,
10224,
6508,
29889,
25125,
3664,
1252,
391,
29901,
13,
18884,
1209,
13,
13,
4706,
736,
2847,
29879,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
9995,
3617,
3030,
848,
363,
6819,
304,
278,
13751,
883,
13,
13,
4706,
448,
8878,
2472,
338,
3734,
13,
4706,
9995,
13,
13,
4706,
2048,
353,
8878,
29889,
12650,
29889,
657,
29898,
333,
29922,
1311,
29889,
19290,
1839,
20571,
11287,
13,
13,
4706,
3030,
353,
6571,
13,
13,
4706,
396,
8878,
1203,
13,
4706,
3030,
1839,
4282,
2033,
353,
2048,
13,
13,
4706,
396,
25085,
304,
367,
6206,
515,
10961,
13,
4706,
5622,
353,
8878,
2001,
29889,
12650,
29889,
4572,
29898,
4282,
29922,
4282,
29889,
333,
29897,
13,
4706,
3030,
1839,
29873,
5086,
2033,
353,
5622,
13,
13,
4706,
736,
3030,
13,
268,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
29273,
11971,
2009,
29889,
4485,
278,
2048,
408,
4810,
3580,
18476,
13,
308,
13,
4706,
448,
960,
278,
883,
8845,
14517,
29892,
278,
8878,
3618,
4866,
8893,
580,
1158,
338,
2000,
13,
4706,
448,
13466,
29892,
278,
883,
338,
4502,
1250,
304,
278,
3132,
13,
4706,
9995,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
883,
353,
1583,
29889,
657,
29918,
689,
580,
13,
13,
4706,
9659,
353,
851,
29906,
11227,
29898,
3827,
29889,
5438,
29889,
657,
877,
26897,
742,
7700,
876,
13,
13,
4706,
1180,
29918,
333,
353,
2009,
29889,
5438,
29889,
657,
877,
5479,
742,
6213,
29897,
13,
13,
4706,
2854,
353,
7700,
13,
13,
4706,
565,
9659,
338,
7700,
29901,
13,
9651,
883,
29889,
12523,
1839,
26897,
2033,
353,
518,
13,
18884,
903,
877,
16376,
3568,
13285,
310,
2048,
5477,
13,
9651,
4514,
13,
4706,
1683,
29901,
13,
9651,
1018,
29901,
13,
18884,
4423,
353,
10224,
6508,
29889,
12650,
29889,
657,
29898,
333,
29922,
2029,
29918,
333,
29897,
13,
18884,
2854,
353,
5852,
13,
9651,
5174,
313,
1917,
2392,
29892,
10224,
6508,
29889,
25125,
3664,
1252,
391,
1125,
13,
18884,
883,
29889,
12523,
1839,
5479,
2033,
353,
23160,
877,
13919,
4423,
4629,
1495,
29962,
13,
13,
9651,
7797,
29879,
353,
5159,
13,
13,
9651,
565,
2048,
29889,
1595,
29889,
11294,
519,
29901,
13,
18884,
396,
319,
2048,
363,
263,
5702,
519,
760,
1122,
2984,
635,
6084,
7797,
3694,
29889,
13,
13,
18884,
5807,
353,
2009,
29889,
5438,
29889,
657,
877,
15550,
29918,
20326,
742,
27255,
13,
13,
18884,
5807,
353,
851,
29898,
16586,
467,
17010,
580,
13,
13,
18884,
396,
960,
278,
1404,
756,
6790,
7797,
3694,
29892,
1423,
896,
526,
2854,
13,
18884,
565,
7431,
29898,
16586,
29897,
1405,
29871,
29900,
29901,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
396,
1222,
312,
1461,
263,
1051,
310,
4944,
7797,
3694,
13,
462,
4706,
7797,
29879,
353,
7338,
1461,
9125,
29478,
29898,
16586,
29892,
2048,
29889,
22640,
29897,
13,
13,
462,
4706,
5923,
353,
5159,
13,
13,
462,
4706,
363,
7797,
297,
7797,
29879,
29901,
13,
462,
9651,
565,
2048,
29889,
1595,
29889,
3198,
3644,
9125,
4557,
24217,
29898,
15550,
1125,
13,
462,
18884,
5923,
29889,
4397,
29898,
15550,
29897,
13,
13,
462,
4706,
565,
7431,
29898,
735,
15423,
29897,
1405,
29871,
29900,
29901,
13,
462,
9651,
4864,
353,
9162,
1642,
7122,
4197,
710,
29898,
29916,
29897,
363,
921,
297,
5923,
2314,
13,
462,
9651,
883,
29889,
12523,
1839,
15550,
29918,
20326,
2033,
353,
23160,
877,
1576,
1494,
7797,
3694,
2307,
1863,
29901,
21313,
16586,
1800,
4286,
4830,
29898,
16586,
29922,
9933,
28166,
13,
462,
9651,
2854,
353,
7700,
13,
13,
462,
1678,
5174,
15758,
362,
2392,
408,
321,
29901,
13,
462,
4706,
883,
29889,
12523,
1839,
15550,
29918,
20326,
2033,
353,
321,
29889,
19158,
13,
462,
4706,
2854,
353,
7700,
13,
13,
9651,
565,
2854,
29901,
13,
18884,
565,
451,
2048,
29889,
8835,
8893,
29898,
5479,
29892,
7797,
29879,
29892,
2009,
29889,
1792,
1125,
13,
462,
1678,
883,
29889,
5464,
29918,
2671,
29918,
12523,
353,
518,
877,
8893,
1033,
451,
367,
8676,
1495,
29962,
13,
462,
1678,
2854,
353,
7700,
13,
13,
4706,
848,
353,
426,
13,
9651,
525,
689,
29918,
3084,
2396,
2854,
29892,
13,
4706,
500,
13,
13,
4706,
736,
1583,
29889,
9482,
8148,
5103,
29898,
3827,
29892,
883,
29892,
848,
29892,
3030,
29922,
1311,
29889,
657,
29918,
4703,
29918,
1272,
3101,
13,
13,
1678,
822,
679,
29918,
1272,
29898,
1311,
1125,
13,
4706,
9995,
9133,
680,
16705,
848,
1250,
304,
278,
883,
9995,
13,
4706,
736,
426,
13,
9651,
525,
3888,
2396,
903,
877,
8893,
10902,
408,
4810,
3580,
18476,
1495,
13,
4706,
500,
13,
13,
13,
1990,
8878,
3664,
267,
29898,
6422,
1043,
1125,
13,
1678,
9995,
4533,
363,
16278,
278,
525,
16953,
29915,
1746,
310,
263,
8878,
1203,
29889,
13,
1678,
9995,
13,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
4472,
29918,
978,
353,
525,
4282,
29914,
16953,
29889,
1420,
29915,
13,
1678,
1904,
353,
8878,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
1493,
29915,
13,
13,
1678,
4235,
353,
6024,
16953,
2033,
13,
13,
1678,
822,
679,
29918,
8698,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
877,
4282,
29899,
16953,
742,
9049,
5085,
3790,
29915,
20571,
2396,
1583,
29889,
657,
29918,
3318,
2141,
333,
1800,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
29892,
3579,
19290,
1125,
13,
13,
4706,
12893,
353,
2428,
2141,
657,
29918,
4703,
29918,
1272,
29898,
1068,
19290,
29897,
13,
308,
13,
4706,
12893,
1839,
5628,
292,
2033,
353,
851,
29906,
11227,
29898,
1311,
29889,
3827,
29889,
7194,
29889,
657,
877,
5628,
742,
6629,
876,
13,
13,
4706,
736,
12893,
13,
13,
13,
1990,
8878,
16570,
29898,
16570,
1043,
1125,
13,
1678,
9995,
5953,
737,
1776,
310,
263,
2323,
8878,
1203,
29889,
9995,
13,
13,
1678,
1904,
353,
8878,
13,
1678,
4472,
29918,
978,
353,
525,
4282,
29914,
16432,
29889,
1420,
29915,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
1493,
29915,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
29892,
3579,
19290,
1125,
13,
13,
4706,
12893,
353,
2428,
29898,
16570,
1043,
29892,
1583,
467,
657,
29918,
4703,
29918,
1272,
29898,
1068,
19290,
29897,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
12893,
1839,
29890,
290,
29918,
9175,
2033,
353,
2048,
29889,
1595,
29889,
657,
29918,
9175,
29918,
3888,
29898,
4282,
29889,
22640,
29892,
15649,
29922,
8824,
29897,
13,
4706,
12893,
1839,
8893,
5709,
2033,
353,
8878,
5709,
13,
13,
4706,
736,
12893,
13,
13,
13,
1990,
8878,
2499,
2029,
403,
29898,
16570,
1043,
1125,
13,
1678,
9995,
4533,
363,
6643,
1218,
5633,
304,
263,
8878,
9995,
13,
1678,
1904,
353,
8878,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
4472,
29918,
978,
353,
525,
4282,
29914,
15956,
403,
29889,
1420,
29915,
13,
1678,
6297,
29918,
12403,
353,
6024,
4282,
29889,
3167,
2033,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
9995,
9133,
680,
4805,
3030,
2472,
363,
278,
8878,
24082,
1813,
9995,
13,
13,
4706,
3030,
353,
2428,
29898,
16570,
1043,
29892,
1583,
467,
657,
29918,
4703,
29918,
1272,
29898,
1068,
19290,
29897,
13,
13,
4706,
2048,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
4706,
760,
353,
2048,
29889,
1595,
13,
4706,
18523,
29918,
7076,
353,
760,
29889,
29890,
290,
29918,
7076,
13,
13,
4706,
3030,
1839,
1595,
2033,
353,
760,
13,
4706,
3030,
1839,
29890,
290,
29918,
7076,
2033,
353,
18523,
29918,
7076,
13,
4706,
3030,
1839,
8893,
5709,
2033,
353,
8878,
5709,
13,
13,
4706,
3030,
1839,
29890,
290,
29918,
9175,
2033,
353,
2048,
29889,
1595,
29889,
657,
29918,
9175,
29918,
3888,
29898,
4282,
29889,
22640,
29892,
15649,
29922,
8824,
29897,
13,
13,
4706,
565,
851,
29906,
11227,
29898,
1311,
29889,
3827,
29889,
7194,
29889,
657,
877,
5628,
742,
6213,
22164,
13,
9651,
3030,
1839,
5628,
292,
2033,
353,
5852,
13,
13,
4706,
736,
3030,
13,
13,
13,
1990,
8878,
4391,
29898,
29909,
6487,
4391,
1043,
1125,
13,
1678,
9995,
4533,
304,
1653,
263,
716,
8878,
1203,
9995,
13,
1678,
1904,
353,
8878,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
6103,
8893,
2500,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
4763,
716,
8878,
1495,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
15601,
29918,
689,
29889,
1420,
29915,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
1202,
29915,
13,
13,
1678,
822,
679,
29918,
11228,
29898,
1311,
1125,
13,
4706,
9995,
3617,
2847,
4128,
363,
8878,
11265,
29889,
13,
13,
4706,
960,
525,
1595,
29915,
338,
6790,
297,
278,
12354,
2346,
29892,
11905,
278,
8878,
411,
278,
6790,
3455,
13,
4706,
9995,
13,
13,
4706,
2847,
29879,
353,
2428,
29898,
8893,
4391,
29892,
1583,
467,
657,
29918,
11228,
2141,
8552,
580,
13,
13,
4706,
396,
4911,
756,
4944,
263,
3455,
3553,
13,
4706,
2847,
29879,
1839,
1595,
2033,
353,
1583,
29889,
3827,
29889,
7194,
29889,
657,
877,
1595,
742,
6213,
29897,
13,
13,
4706,
2847,
29879,
1839,
3560,
2033,
353,
1583,
29889,
3827,
29889,
7194,
29889,
657,
877,
3560,
742,
6213,
29897,
13,
13,
4706,
396,
4911,
756,
4944,
263,
28389,
7514,
3553,
13,
4706,
2847,
29879,
1839,
29879,
2122,
29918,
2098,
2033,
353,
1583,
29889,
3827,
29889,
7194,
29889,
657,
877,
29879,
2122,
29918,
2098,
742,
6213,
29897,
13,
13,
4706,
2847,
29879,
1839,
22640,
2033,
353,
1583,
29889,
3827,
29889,
7194,
29889,
657,
877,
22640,
742,
29871,
29896,
29897,
13,
13,
4706,
736,
2847,
29879,
13,
13,
1678,
822,
679,
29918,
1272,
29898,
1311,
1125,
13,
4706,
736,
426,
13,
9651,
525,
8698,
2396,
903,
877,
20399,
716,
2048,
5477,
13,
4706,
500,
13,
13,
13,
1990,
8878,
6422,
29898,
29909,
6487,
6422,
1043,
1125,
13,
1678,
9995,
4533,
363,
16278,
263,
8878,
1203,
9995,
13,
268,
13,
1678,
1904,
353,
8878,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
6103,
8893,
2500,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
4282,
29915,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
6103,
8878,
25577,
1495,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
15601,
29918,
689,
29889,
1420,
29915,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
3167,
29915,
13,
13,
1678,
822,
679,
29918,
1272,
29898,
1311,
1125,
13,
4706,
736,
426,
13,
9651,
525,
3888,
2396,
903,
877,
3853,
1573,
2048,
5477,
13,
4706,
500,
13,
13,
13,
1990,
8878,
12498,
29898,
29909,
6487,
12498,
1043,
1125,
13,
1678,
9995,
4533,
304,
5217,
263,
2048,
9995,
13,
13,
1678,
1904,
353,
8878,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
4282,
29914,
8143,
29918,
4282,
29889,
1420,
29915,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
12498,
8878,
1495,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
8143,
29915,
13,
13,
13,
1990,
8878,
2001,
12498,
29898,
29909,
6487,
12498,
1043,
1125,
13,
1678,
9995,
4533,
304,
525,
348,
15956,
403,
29915,
263,
8878,
2001,
29889,
13,
1678,
830,
635,
591,
526,
21228,
278,
8878,
2001,
1203,
515,
278,
2566,
29889,
13,
1678,
9995,
13,
13,
1678,
1904,
353,
8878,
2001,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
4282,
29914,
8143,
29918,
4282,
29918,
667,
29889,
1420,
29915,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
2525,
15956,
403,
10224,
1495,
13,
1678,
3030,
29918,
3318,
29918,
978,
353,
525,
667,
29915,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
8143,
29915,
13,
13,
1678,
822,
679,
29918,
1272,
29898,
1311,
1125,
13,
4706,
736,
426,
13,
9651,
525,
29881,
4600,
2396,
903,
877,
7301,
8238,
5633,
515,
2048,
24082,
1495,
13,
4706,
500,
13,
13,
13,
1990,
8878,
2001,
4391,
29898,
29909,
6487,
4391,
1043,
1125,
13,
1678,
9995,
4533,
363,
6643,
1218,
263,
716,
760,
304,
263,
2048,
9995,
13,
13,
1678,
1904,
353,
8878,
2001,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
6103,
8893,
2001,
2500,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
4282,
29914,
3258,
29918,
4282,
29918,
667,
29889,
1420,
29915,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
2499,
2029,
403,
716,
3455,
1495,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
1202,
29915,
13,
13,
1678,
760,
353,
6213,
13,
1678,
3625,
29918,
17712,
353,
6213,
13,
13,
1678,
822,
679,
29918,
4703,
29918,
1272,
29898,
1311,
1125,
13,
4706,
12893,
353,
2428,
29898,
29909,
6487,
4391,
1043,
29892,
1583,
467,
657,
29918,
4703,
29918,
1272,
580,
13,
13,
4706,
565,
1583,
29889,
1595,
29901,
13,
9651,
12893,
1839,
1595,
2033,
353,
1583,
29889,
1595,
13,
13,
4706,
565,
1583,
29889,
16515,
29918,
17712,
29901,
13,
9651,
12893,
1839,
17712,
2033,
353,
1583,
29889,
16515,
29918,
17712,
13,
4706,
1683,
29901,
13,
9651,
12893,
1839,
1217,
29918,
17712,
2033,
353,
5852,
13,
13,
4706,
736,
12893,
13,
13,
1678,
822,
679,
29918,
689,
29898,
1311,
1125,
13,
4706,
9995,
6204,
3812,
363,
3907,
847,
16278,
716,
3455,
1203,
9995,
13,
13,
4706,
883,
353,
2428,
29898,
29909,
6487,
4391,
1043,
29892,
1583,
467,
657,
29918,
689,
580,
13,
13,
4706,
396,
960,
278,
8878,
1203,
338,
6790,
29892,
9563,
278,
1881,
1746,
29889,
13,
4706,
396,
1334,
437,
451,
864,
278,
4160,
304,
367,
2221,
304,
4337,
263,
8878,
2001,
304,
263,
1422,
2048,
13,
4706,
2048,
29918,
333,
353,
883,
1839,
4282,
13359,
1767,
580,
13,
13,
4706,
565,
2048,
29918,
333,
338,
451,
6213,
29901,
13,
9651,
883,
29889,
9621,
1839,
4282,
13359,
8030,
353,
379,
4215,
4290,
580,
13,
13,
4706,
396,
960,
278,
1014,
29918,
1595,
338,
19056,
29892,
4046,
304,
9686,
10961,
4452,
13,
4706,
760,
29918,
333,
353,
1583,
29889,
657,
29918,
3207,
877,
1595,
1495,
13,
13,
4706,
565,
760,
29918,
333,
29901,
13,
9651,
1018,
29901,
13,
18884,
1583,
29889,
1595,
353,
3455,
29889,
12650,
29889,
657,
29898,
20571,
29922,
1595,
29918,
333,
29897,
13,
13,
18884,
2346,
353,
883,
29889,
9621,
1839,
17712,
29918,
667,
13359,
1972,
842,
13,
462,
13,
18884,
396,
9333,
2758,
10224,
2001,
3618,
607,
1993,
278,
1857,
760,
13,
18884,
2346,
353,
2346,
29889,
4572,
29898,
1595,
29922,
1595,
29918,
333,
29897,
13,
13,
18884,
565,
2048,
29918,
333,
338,
451,
6213,
29901,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
2048,
353,
8878,
29889,
12650,
29889,
657,
29898,
333,
29922,
4282,
29918,
333,
29897,
13,
462,
308,
13,
462,
4706,
565,
2048,
29889,
19730,
29918,
3166,
338,
451,
6213,
29901,
13,
462,
9651,
396,
9628,
277,
2346,
304,
10961,
4452,
393,
526,
1623,
5461,
310,
278,
525,
19730,
29918,
3166,
29915,
4423,
13,
462,
9651,
2346,
353,
2346,
29889,
4572,
29898,
5479,
1649,
262,
11759,
2029,
363,
1180,
297,
2048,
29889,
19730,
29918,
3166,
29889,
657,
8110,
802,
19334,
580,
2314,
13,
462,
632,
13,
462,
1678,
5174,
8878,
29889,
25125,
3664,
1252,
391,
29901,
13,
462,
4706,
1209,
13,
13,
462,
1678,
396,
1222,
2325,
10224,
2001,
3618,
607,
526,
2307,
19591,
304,
445,
2048,
322,
760,
13,
462,
1678,
2346,
353,
2346,
29889,
735,
2325,
29898,
333,
1649,
262,
11759,
667,
29889,
17712,
29918,
667,
29889,
333,
363,
2944,
297,
8878,
2001,
29889,
12650,
29889,
4572,
29898,
4282,
29922,
4282,
29918,
333,
29892,
10961,
29918,
667,
1649,
1595,
29922,
1595,
29918,
333,
29897,
2314,
13,
13,
18884,
883,
29889,
9621,
1839,
17712,
29918,
667,
13359,
1972,
842,
353,
2346,
13,
13,
18884,
10961,
29879,
353,
2346,
29889,
497,
580,
13,
18884,
1583,
29889,
16515,
29918,
17712,
353,
10961,
29879,
13,
13,
18884,
396,
960,
727,
338,
871,
697,
2944,
4629,
29892,
1831,
372,
13,
18884,
565,
7431,
29898,
17712,
29879,
29897,
1275,
29871,
29896,
29901,
13,
462,
1678,
883,
29889,
9621,
1839,
17712,
29918,
667,
13359,
11228,
353,
10961,
29879,
29961,
29900,
1822,
333,
13,
18884,
396,
1670,
338,
694,
10961,
3625,
13,
18884,
25342,
7431,
29898,
17712,
29879,
29897,
1275,
29871,
29900,
29901,
13,
462,
1678,
396,
14402,
448,
3462,
263,
2643,
304,
278,
883,
20766,
278,
1108,
13,
462,
1678,
1209,
13,
13,
9651,
5174,
3455,
29889,
25125,
3664,
1252,
391,
29901,
13,
18884,
1583,
29889,
1595,
353,
6213,
13,
18884,
1209,
13,
13,
4706,
736,
883,
13,
13,
1678,
822,
679,
29918,
11228,
29898,
1311,
1125,
13,
4706,
9995,
9133,
680,
2847,
848,
363,
27707,
2001,
29889,
7419,
363,
278,
900,
645,
340,
292,
297,
278,
12354,
848,
29901,
13,
13,
4706,
448,
2048,
29901,
282,
29895,
310,
278,
8878,
1203,
13,
4706,
9995,
13,
13,
4706,
2847,
29879,
353,
2428,
29898,
29909,
6487,
4391,
1043,
29892,
1583,
467,
657,
29918,
11228,
2141,
8552,
580,
13,
13,
4706,
2048,
29918,
333,
353,
1583,
29889,
657,
29918,
3207,
877,
4282,
1495,
13,
4706,
760,
29918,
333,
353,
1583,
29889,
657,
29918,
3207,
877,
1595,
1495,
13,
13,
4706,
396,
12105,
304,
263,
3455,
1203,
13,
4706,
760,
353,
6213,
13,
13,
4706,
396,
12105,
304,
263,
10224,
2001,
1203,
13,
4706,
2944,
353,
6213,
13,
308,
13,
4706,
396,
12105,
304,
263,
8878,
1203,
13,
4706,
2048,
353,
6213,
13,
13,
4706,
565,
760,
29918,
333,
29901,
13,
9651,
1018,
29901,
13,
18884,
760,
353,
3455,
29889,
12650,
29889,
657,
29898,
20571,
29922,
1595,
29918,
333,
29897,
13,
18884,
2847,
29879,
1839,
1595,
2033,
353,
760,
13,
9651,
5174,
3455,
29889,
25125,
3664,
1252,
391,
29901,
13,
18884,
1209,
13,
13,
4706,
565,
2048,
29918,
333,
29901,
13,
9651,
1018,
29901,
13,
18884,
2048,
353,
8878,
29889,
12650,
29889,
657,
29898,
20571,
29922,
4282,
29918,
333,
29897,
13,
18884,
2847,
29879,
1839,
4282,
2033,
353,
2048,
13,
9651,
5174,
8878,
29889,
25125,
3664,
1252,
391,
29901,
13,
18884,
1209,
13,
13,
4706,
14728,
353,
1583,
29889,
3827,
29889,
7194,
29889,
657,
877,
22640,
742,
6213,
29897,
13,
13,
4706,
565,
14728,
338,
451,
6213,
29901,
13,
9651,
14728,
353,
5785,
29898,
22640,
29897,
13,
13,
4706,
565,
14728,
338,
6213,
29901,
13,
9651,
396,
5244,
714,
920,
1784,
5633,
3933,
304,
367,
25169,
627,
287,
363,
278,
2048,
13,
9651,
565,
760,
29901,
13,
18884,
14728,
353,
2048,
29889,
657,
2525,
15956,
630,
22930,
537,
29898,
1595,
29897,
13,
462,
13,
4706,
2944,
29918,
333,
353,
1583,
29889,
657,
29918,
3207,
877,
667,
1495,
13,
13,
4706,
396,
960,
278,
2009,
1580,
11057,
263,
3153,
10224,
2001,
13,
4706,
565,
2944,
29918,
333,
29901,
13,
9651,
1018,
29901,
13,
18884,
2944,
353,
10224,
2001,
29889,
12650,
29889,
657,
29898,
20571,
29922,
667,
29918,
333,
29897,
13,
9651,
5174,
29901,
13,
18884,
1209,
13,
13,
4706,
396,
960,
263,
10224,
2001,
338,
451,
4629,
29892,
1018,
304,
4469,
29899,
2622,
697,
13,
4706,
565,
2944,
338,
6213,
322,
760,
338,
451,
6213,
29901,
13,
9651,
4452,
353,
10224,
2001,
29889,
12650,
29889,
4572,
29898,
1595,
29922,
1595,
29897,
13,
9651,
565,
4452,
29889,
2798,
580,
1275,
29871,
29896,
29901,
13,
18884,
2944,
353,
4452,
29889,
4102,
580,
13,
13,
4706,
396,
9788,
29892,
565,
263,
10224,
2001,
338,
4629,
29892,
9801,
278,
14728,
338,
451,
2086,
1568,
13,
4706,
565,
2944,
338,
451,
6213,
29901,
13,
9651,
565,
14728,
338,
6213,
29901,
13,
18884,
14728,
353,
2944,
29889,
348,
15956,
630,
29918,
22640,
580,
13,
9651,
1683,
29901,
13,
18884,
14728,
353,
1375,
29898,
22640,
29892,
2944,
29889,
348,
15956,
630,
29918,
22640,
3101,
13,
13,
4706,
565,
14728,
338,
451,
6213,
29901,
13,
9651,
2847,
29879,
1839,
22640,
2033,
353,
14728,
13,
13,
4706,
736,
2847,
29879,
13,
13,
13,
1990,
8878,
2001,
6103,
29898,
29909,
6487,
6422,
1043,
1125,
13,
1678,
9995,
4533,
304,
3863,
263,
8878,
2001,
1203,
9995,
13,
13,
1678,
1904,
353,
8878,
2001,
13,
1678,
9349,
29918,
6886,
29918,
978,
353,
525,
15601,
29918,
689,
29889,
1420,
29915,
13,
1678,
883,
29918,
1990,
353,
7190,
29889,
6103,
8893,
2001,
2500,
13,
1678,
9349,
29918,
689,
29918,
3257,
353,
903,
877,
6103,
10224,
838,
5479,
1495,
13,
1678,
6297,
29918,
12403,
353,
525,
4282,
29889,
3167,
29915,
13,
13,
1678,
822,
679,
29918,
1272,
29898,
1311,
1125,
13,
4706,
736,
426,
13,
9651,
525,
3888,
2396,
903,
877,
29248,
8878,
10976,
5477,
13,
4706,
500,
13,
13,
1678,
822,
679,
29918,
689,
29898,
1311,
1125,
13,
4706,
9995,
6204,
883,
363,
16278,
263,
8878,
2001,
29889,
13,
13,
4706,
448,
9628,
277,
278,
10224,
2001,
3987,
304,
4452,
393,
1993,
278,
760,
13,
4706,
9995,
13,
13,
4706,
2048,
29918,
667,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
883,
353,
2428,
29898,
8893,
2001,
6103,
29892,
1583,
467,
657,
29918,
689,
580,
13,
13,
4706,
2346,
353,
10224,
2001,
29889,
12650,
29889,
497,
580,
13,
308,
13,
4706,
565,
2048,
29918,
667,
29889,
17712,
29918,
667,
29901,
13,
9651,
760,
29918,
333,
353,
2048,
29918,
667,
29889,
17712,
29918,
667,
29889,
1595,
29889,
333,
13,
9651,
2346,
353,
2346,
29889,
4572,
29898,
1595,
29922,
1595,
29918,
333,
29897,
13,
13,
4706,
883,
29889,
9621,
1839,
17712,
29918,
667,
13359,
1972,
842,
353,
2346,
13,
13,
4706,
883,
29889,
9621,
1839,
4282,
13359,
8030,
353,
379,
4215,
4290,
580,
13,
13,
4706,
736,
883,
13,
2
] |
tests/test_config.py | dstarner/pacyam | 3 | 139474 | <gh_stars>1-10
import os
import unittest
from pacyam.pacyam import Configuration, BuildException
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class ConfigurationTestCase(unittest.TestCase):
test_configs_root = os.path.join(REPO_ROOT, 'tests', 'test-configs')
project_root = os.path.join(REPO_ROOT, 'tests', 'project')
def test_invalid_root_dir(self):
root = 'totes-invalid-dir'
config_path = 'config.json'
with self.assertRaises(BuildException):
Configuration.load(
root_directory=root,
config_file_name=config_path,
)
def test_missing_config_path(self):
root = self.test_configs_root
config_path = 'not-available-config.json'
with self.assertRaises(BuildException):
Configuration.load(
root_directory=root,
config_file_name=config_path
)
def test_invalid_json_file(self):
root = self.test_configs_root
config_path = 'bad_json.json'
with self.assertRaises(BuildException):
Configuration.load(
root_directory=root,
config_file_name=config_path
)
def test_unique_config_path(self):
root = self.test_configs_root
config_path = 'some-unique-name.json'
config = Configuration.load(
root_directory=root,
config_file_name=config_path
)
self.assertTrue(
os.path.basename(config.config_file_path),
config_path
)
self.assertEqual(config.root_directory, root)
def test_invalid_config(self):
root = self.test_configs_root
config_path = 'config.json'
with self.assertRaises(BuildException):
Configuration.load(
root_directory=root,
config_file_name=config_path
)
def test_template_paths(self):
root = self.project_root
config_path = 'config.json'
config = Configuration.load(
root_directory=root,
config_file_name=config_path
)
expected = [
"builders/virtualbox.yaml",
"builders/virtualbox.yaml",
"post-processors/vagrant.yaml",
"provisioners/core.yaml"
]
self.assertEqual(config.template_paths, expected)
def test_variable_paths(self):
root = self.project_root
config_path = 'config.json'
config = Configuration.load(
root_directory=root,
config_file_name=config_path
)
expected = [
"variables/default.yaml"
]
self.assertEqual(config.variable_paths, expected)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
2897,
13,
5215,
443,
27958,
13,
13,
3166,
282,
4135,
314,
29889,
29886,
4135,
314,
1053,
20999,
29892,
8878,
2451,
13,
13,
1525,
13152,
29918,
21289,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
22168,
1445,
1649,
4961,
13,
13,
1990,
20999,
3057,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
1243,
29918,
2917,
29879,
29918,
4632,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1525,
13152,
29918,
21289,
29892,
525,
21150,
742,
525,
1688,
29899,
2917,
29879,
1495,
13,
1678,
2060,
29918,
4632,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1525,
13152,
29918,
21289,
29892,
525,
21150,
742,
525,
4836,
1495,
13,
13,
1678,
822,
1243,
29918,
20965,
29918,
4632,
29918,
3972,
29898,
1311,
1125,
13,
4706,
3876,
353,
525,
4260,
267,
29899,
20965,
29899,
3972,
29915,
13,
4706,
2295,
29918,
2084,
353,
525,
2917,
29889,
3126,
29915,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8893,
2451,
1125,
13,
9651,
20999,
29889,
1359,
29898,
13,
18884,
3876,
29918,
12322,
29922,
4632,
29892,
13,
18884,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
29892,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
27259,
29918,
2917,
29918,
2084,
29898,
1311,
1125,
13,
4706,
3876,
353,
1583,
29889,
1688,
29918,
2917,
29879,
29918,
4632,
13,
4706,
2295,
29918,
2084,
353,
525,
1333,
29899,
16515,
29899,
2917,
29889,
3126,
29915,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8893,
2451,
1125,
13,
9651,
20999,
29889,
1359,
29898,
13,
18884,
3876,
29918,
12322,
29922,
4632,
29892,
13,
18884,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
20965,
29918,
3126,
29918,
1445,
29898,
1311,
1125,
13,
4706,
3876,
353,
1583,
29889,
1688,
29918,
2917,
29879,
29918,
4632,
13,
4706,
2295,
29918,
2084,
353,
525,
12313,
29918,
3126,
29889,
3126,
29915,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8893,
2451,
1125,
13,
9651,
20999,
29889,
1359,
29898,
13,
18884,
3876,
29918,
12322,
29922,
4632,
29892,
13,
18884,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
13092,
29918,
2917,
29918,
2084,
29898,
1311,
1125,
13,
4706,
3876,
353,
1583,
29889,
1688,
29918,
2917,
29879,
29918,
4632,
13,
4706,
2295,
29918,
2084,
353,
525,
5372,
29899,
13092,
29899,
978,
29889,
3126,
29915,
13,
4706,
2295,
353,
20999,
29889,
1359,
29898,
13,
9651,
3876,
29918,
12322,
29922,
4632,
29892,
13,
9651,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
13,
4706,
1723,
13,
4706,
1583,
29889,
9294,
5574,
29898,
13,
9651,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
2917,
29889,
2917,
29918,
1445,
29918,
2084,
511,
13,
9651,
2295,
29918,
2084,
13,
4706,
1723,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2917,
29889,
4632,
29918,
12322,
29892,
3876,
29897,
13,
13,
1678,
822,
1243,
29918,
20965,
29918,
2917,
29898,
1311,
1125,
13,
4706,
3876,
353,
1583,
29889,
1688,
29918,
2917,
29879,
29918,
4632,
13,
4706,
2295,
29918,
2084,
353,
525,
2917,
29889,
3126,
29915,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8893,
2451,
1125,
13,
9651,
20999,
29889,
1359,
29898,
13,
18884,
3876,
29918,
12322,
29922,
4632,
29892,
13,
18884,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
6886,
29918,
24772,
29898,
1311,
1125,
13,
4706,
3876,
353,
1583,
29889,
4836,
29918,
4632,
13,
4706,
2295,
29918,
2084,
353,
525,
2917,
29889,
3126,
29915,
13,
4706,
2295,
353,
20999,
29889,
1359,
29898,
13,
9651,
3876,
29918,
12322,
29922,
4632,
29892,
13,
9651,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
13,
4706,
1723,
13,
4706,
3806,
353,
518,
13,
9651,
376,
4282,
414,
29914,
18714,
1884,
29889,
25162,
613,
13,
9651,
376,
4282,
414,
29914,
18714,
1884,
29889,
25162,
613,
13,
9651,
376,
2490,
29899,
5014,
943,
29914,
29894,
29592,
29889,
25162,
613,
13,
9651,
376,
771,
4924,
414,
29914,
3221,
29889,
25162,
29908,
13,
4706,
4514,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2917,
29889,
6886,
29918,
24772,
29892,
3806,
29897,
13,
13,
1678,
822,
1243,
29918,
11918,
29918,
24772,
29898,
1311,
1125,
13,
4706,
3876,
353,
1583,
29889,
4836,
29918,
4632,
13,
4706,
2295,
29918,
2084,
353,
525,
2917,
29889,
3126,
29915,
13,
4706,
2295,
353,
20999,
29889,
1359,
29898,
13,
9651,
3876,
29918,
12322,
29922,
4632,
29892,
13,
9651,
2295,
29918,
1445,
29918,
978,
29922,
2917,
29918,
2084,
13,
4706,
1723,
13,
4706,
3806,
353,
518,
13,
9651,
376,
20897,
29914,
4381,
29889,
25162,
29908,
13,
4706,
4514,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2917,
29889,
11918,
29918,
24772,
29892,
3806,
29897,
13,
2
] |
plugins/simsimi.py | messense/wechat-bot | 115 | 1617087 | #coding=utf-8
"""
Copyright (c) 2012 wong2 <<EMAIL>>
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
sys.path.append('..')
import requests
import cookielib
from tornado.options import options
__name__ = 'simsimi'
SIMSIMI_KEY = options.simsimi_key or ''
class SimSimi(object):
def __init__(self):
self.headers = {
'Referer': 'http://www.simsimi.com/talk.htm'
}
self.chat_url = 'http://www.simsimi.com/func/req?lc=ch&msg=%s'
self.api_url = 'http://api.simsimi.com/request.p?key=%s&lc=ch&ft=1.0&text=%s'
if not SIMSIMI_KEY:
self.initSimSimiCookie()
def initSimSimiCookie(self):
r = requests.get('http://www.simsimi.com/talk.htm')
self.chat_cookies = r.cookies
def getSimSimiResult(self, message, method='normal'):
if method == 'normal':
r = requests.get(self.chat_url % message,
cookies=self.chat_cookies, headers=self.headers)
self.chat_cookies = r.cookies
else:
url = self.api_url % (SIMSIMI_KEY, message)
r = requests.get(url)
return r
def chat(self, message=''):
if message:
r = self.getSimSimiResult(
message, 'normal' if not SIMSIMI_KEY else 'api')
try:
answer = r.json()['response']
return answer.encode('utf-8')
except:
return u'呵呵'
else:
return u'叫我干嘛'
simsimi = SimSimi()
def test(data, msg=None, bot=None):
return True
def respond(data, msg=None, bot=None):
response = simsimi.chat(data)
if "Unauthorized access" in response:
# try again
response = simsimi.chat(data)
response = response.replace('xiaohuangji', options.username)
response = response.replace('小黄鸡', '我')
if "Unauthorized access" in response:
# still can't , give up
response = u'矮油,这个问题我暂时回答不了喵~'
if u'微信' in response and u'搜' in response:
# remove some ads
response = u'呵呵'
return response
| [
1,
396,
29883,
3689,
29922,
9420,
29899,
29947,
13,
13,
15945,
29908,
13,
11882,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29906,
281,
549,
29906,
3532,
26862,
6227,
6778,
13,
13,
27293,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
13,
29874,
3509,
310,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
13,
29915,
6295,
14093,
5477,
304,
5376,
297,
278,
18540,
1728,
24345,
29892,
3704,
13,
14037,
29485,
278,
10462,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
13,
5721,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
14591,
310,
278,
18540,
29892,
322,
304,
13,
546,
2415,
12407,
304,
6029,
278,
18540,
338,
15252,
3276,
304,
437,
577,
29892,
4967,
304,
13,
1552,
1494,
5855,
29901,
13,
13,
1576,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
13,
11707,
287,
297,
599,
14591,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
13,
28350,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
525,
3289,
8519,
742,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
13,
5746,
15094,
1799,
6323,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
13,
29924,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
13,
1177,
11698,
382,
29963,
3919,
24972,
9818,
6093,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
13,
13875,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
13,
29911,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
13,
6156,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
6093,
7791,
7818,
12982,
1525,
29889,
13,
15945,
29908,
13,
13,
5215,
10876,
13,
9675,
29889,
2084,
29889,
4397,
877,
636,
1495,
13,
13,
5215,
7274,
13,
5215,
7984,
709,
747,
13,
13,
3166,
10146,
912,
29889,
6768,
1053,
3987,
13,
13,
1649,
978,
1649,
353,
525,
3601,
3601,
29875,
29915,
13,
13,
5425,
4345,
7833,
29902,
29918,
10818,
353,
3987,
29889,
3601,
3601,
29875,
29918,
1989,
470,
6629,
13,
13,
13,
1990,
3439,
8942,
29875,
29898,
3318,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
13,
4706,
1583,
29889,
13662,
353,
426,
13,
9651,
525,
1123,
571,
261,
2396,
525,
1124,
597,
1636,
29889,
3601,
3601,
29875,
29889,
510,
29914,
29873,
2235,
29889,
13357,
29915,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
13496,
29918,
2271,
353,
525,
1124,
597,
1636,
29889,
3601,
3601,
29875,
29889,
510,
29914,
9891,
29914,
7971,
29973,
29880,
29883,
29922,
305,
29987,
7645,
16328,
29879,
29915,
13,
4706,
1583,
29889,
2754,
29918,
2271,
353,
525,
1124,
597,
2754,
29889,
3601,
3601,
29875,
29889,
510,
29914,
3827,
29889,
29886,
29973,
1989,
16328,
29879,
29987,
29880,
29883,
29922,
305,
29987,
615,
29922,
29896,
29889,
29900,
29987,
726,
16328,
29879,
29915,
13,
13,
4706,
565,
451,
22717,
4345,
7833,
29902,
29918,
10818,
29901,
13,
9651,
1583,
29889,
2344,
8942,
8942,
29875,
24914,
580,
13,
13,
1678,
822,
2069,
8942,
8942,
29875,
24914,
29898,
1311,
1125,
13,
4706,
364,
353,
7274,
29889,
657,
877,
1124,
597,
1636,
29889,
3601,
3601,
29875,
29889,
510,
29914,
29873,
2235,
29889,
13357,
1495,
13,
4706,
1583,
29889,
13496,
29918,
15108,
583,
353,
364,
29889,
15108,
583,
13,
13,
1678,
822,
679,
8942,
8942,
29875,
3591,
29898,
1311,
29892,
2643,
29892,
1158,
2433,
8945,
29374,
13,
4706,
565,
1158,
1275,
525,
8945,
2396,
13,
9651,
364,
353,
7274,
29889,
657,
29898,
1311,
29889,
13496,
29918,
2271,
1273,
2643,
29892,
13,
462,
632,
21046,
29922,
1311,
29889,
13496,
29918,
15108,
583,
29892,
9066,
29922,
1311,
29889,
13662,
29897,
13,
9651,
1583,
29889,
13496,
29918,
15108,
583,
353,
364,
29889,
15108,
583,
13,
4706,
1683,
29901,
13,
9651,
3142,
353,
1583,
29889,
2754,
29918,
2271,
1273,
313,
5425,
4345,
7833,
29902,
29918,
10818,
29892,
2643,
29897,
13,
9651,
364,
353,
7274,
29889,
657,
29898,
2271,
29897,
13,
4706,
736,
364,
13,
13,
1678,
822,
13563,
29898,
1311,
29892,
2643,
2433,
29374,
13,
4706,
565,
2643,
29901,
13,
9651,
364,
353,
1583,
29889,
657,
8942,
8942,
29875,
3591,
29898,
13,
18884,
2643,
29892,
525,
8945,
29915,
565,
451,
22717,
4345,
7833,
29902,
29918,
10818,
1683,
525,
2754,
1495,
13,
9651,
1018,
29901,
13,
18884,
1234,
353,
364,
29889,
3126,
580,
1839,
5327,
2033,
13,
18884,
736,
1234,
29889,
12508,
877,
9420,
29899,
29947,
1495,
13,
9651,
5174,
29901,
13,
18884,
736,
318,
29915,
232,
148,
184,
232,
148,
184,
29915,
13,
4706,
1683,
29901,
13,
9651,
736,
318,
29915,
232,
146,
174,
30672,
232,
188,
181,
232,
155,
158,
29915,
13,
13,
3601,
3601,
29875,
353,
3439,
8942,
29875,
580,
13,
13,
13,
1753,
1243,
29898,
1272,
29892,
10191,
29922,
8516,
29892,
9225,
29922,
8516,
1125,
13,
1678,
736,
5852,
13,
13,
13,
1753,
10049,
29898,
1272,
29892,
10191,
29922,
8516,
29892,
9225,
29922,
8516,
1125,
13,
1678,
2933,
353,
1027,
3601,
29875,
29889,
13496,
29898,
1272,
29897,
13,
1678,
565,
376,
29965,
1056,
329,
2015,
1891,
2130,
29908,
297,
2933,
29901,
13,
4706,
396,
1018,
1449,
13,
4706,
2933,
353,
1027,
3601,
29875,
29889,
13496,
29898,
1272,
29897,
13,
1678,
2933,
353,
2933,
29889,
6506,
877,
29916,
423,
1148,
29884,
574,
2397,
742,
3987,
29889,
6786,
29897,
13,
1678,
2933,
353,
2933,
29889,
6506,
877,
30446,
31491,
236,
187,
164,
742,
525,
30672,
1495,
13,
1678,
565,
376,
29965,
1056,
329,
2015,
1891,
2130,
29908,
297,
2933,
29901,
13,
4706,
396,
1603,
508,
29915,
29873,
1919,
2367,
701,
13,
4706,
2933,
353,
318,
29915,
234,
162,
177,
233,
181,
188,
30214,
30810,
30502,
31658,
31596,
30672,
233,
157,
133,
30594,
30742,
234,
176,
151,
30413,
30743,
232,
153,
184,
30022,
29915,
13,
1678,
565,
318,
29915,
31935,
30689,
29915,
297,
2933,
322,
318,
29915,
233,
147,
159,
29915,
297,
2933,
29901,
13,
4706,
396,
3349,
777,
594,
29879,
13,
4706,
2933,
353,
318,
29915,
232,
148,
184,
232,
148,
184,
29915,
13,
1678,
736,
2933,
13,
2
] |
train.py | JanFschr/gangealing | 2 | 132801 | <filename>train.py
"""
GANgealing training script.
"""
import torch
from torch import nn, optim
import numpy as np
from tqdm import tqdm
import json
import os
from models import Generator, get_stn, DirectionInterpolator, PCA, get_perceptual_loss, kmeans_plusplus, BilinearDownsample, accumulate, requires_grad
from models import gangealing_loss, gangealing_cluster_loss, total_variation_loss, flow_identity_loss
from datasets import img_dataloader, sample_infinite_data
from utils.vis_tools.training_vis import GANgealingWriter, create_training_visuals, create_training_cluster_visuals
from utils.distributed import all_gather, get_rank, setup_distributed, reduce_loss_dict, get_world_size, primary
from utils.base_argparse import base_training_argparse
from utils.annealing import DecayingCosineAnnealingWarmRestarts, lr_cycle_iters, get_psi_annealing_fn
from utils.download import find_model
def save_state_dict(ckpt_name, generator, t_module, t_ema, t_optim, t_sched, ll_module, ll_optim, ll_sched, args):
ckpt_dict = {"g_ema": generator.state_dict(), "t": t_module.state_dict(),
"t_ema": t_ema.state_dict(), "t_optim": t_optim.state_dict(),
"t_sched": t_sched.state_dict(), "ll": ll_module.state_dict(),
"ll_optim": ll_optim.state_dict(), "ll_sched": ll_sched.state_dict(),
"args": args}
torch.save(ckpt_dict, f'{results_path}/checkpoints/{ckpt_name}.pt')
def train(args, loader, generator, stn, t_ema, ll, t_optim, ll_optim, t_sched, ll_sched, loss_fn,
anneal_fn, device, writer):
# If using real data, select some fixed samples used to visualize training:
vis_reals = loader is not None
if vis_reals:
if args.random_reals:
real_indices = torch.randint(0, len(loader.dataset), (args.n_sample,)).numpy()
else:
real_indices = range(args.n_sample)
sample_reals = torch.stack([loader.dataset[ix] for ix in real_indices]).to(device)
loader = sample_infinite_data(loader, args.seed)
else:
sample_reals = None
# Progress bar for monitoring training:
pbar = range(args.iter)
if primary():
pbar = tqdm(pbar, initial=args.start_iter, dynamic_ncols=True, smoothing=0.2)
# Record modules to make saving checkpoints easier:
if args.distributed:
t_module = stn.module
ll_module = ll.module
else:
t_module = stn
ll_module = ll
sample_z = torch.randn(args.n_sample // args.num_heads, args.dim_latent, device=device) # Used for generating a fixed set of GAN samples
if args.clustering: # A much larger fixed set of GAN samples used for generating clustering-specific visuals:
big_sample_z = torch.randn(args.n_mean // get_world_size(), args.dim_latent, device=device)
resize_fake2stn = BilinearDownsample(args.gen_size // args.flow_size, 3).to(device) if args.gen_size > args.flow_size else nn.Sequential()
generator.eval()
requires_grad(generator, False) # G is frozen throughout this entire process
requires_grad(stn, True)
requires_grad(ll, True)
# A model checkpoint will be saved whenever the learning rate is zero:
zero_lr_iters = lr_cycle_iters(args.anneal_psi, args.period, args.iter, args.tm)
early_ckpt_iters = set(zero_lr_iters)
early_vis_iters = {100}
early_vis_iters.update(early_ckpt_iters)
# Initialize various training variables and constants:
zero = torch.tensor(0.0, device='cuda')
accum = 0.5 ** (32 / (10 * 1000))
psi = 1.0 # initially there is no truncation
# Create initial training visualizations:
if args.clustering:
create_training_cluster_visuals(generator, t_ema, ll, loss_fn, loader, resize_fake2stn, sample_z, big_sample_z,
psi, device, args.n_mean, args.n_sample, args.num_heads, args.flips,
args.vis_batch_size, args.flow_size, 0, writer, padding_mode=args.padding_mode)
else:
create_training_visuals(generator, t_ema, ll, loader, sample_reals, resize_fake2stn, sample_z, psi, device,
args.n_mean, args.n_sample, 0, writer, padding_mode=args.padding_mode)
for idx in pbar: # main training loop
i = idx + args.start_iter + 1
if i <= args.anneal_psi:
psi = anneal_fn(i, 1.0, 0.0, args.anneal_psi).item()
psi_is_fixed = False
else:
psi = 0.0
psi_is_fixed = True
if i > args.iter:
print("Done!")
break
####################################
######### TRAIN STN and LL #########
####################################
if args.clustering or args.flips: # Clustering-specific perceptual loss:
perceptual_loss, delta_flow = gangealing_cluster_loss(generator, stn, ll, loss_fn, resize_fake2stn, psi,
args.batch, args.dim_latent, args.freeze_ll,
args.num_heads, args.flips, device,
sample_from_full_res=args.sample_from_full_res,
padding_mode=args.padding_mode)
else: # Standard GANgealing perceptual loss (unimodal):
perceptual_loss, delta_flow = gangealing_loss(generator, stn, ll, loss_fn, resize_fake2stn, psi,
args.batch, args.dim_latent, args.freeze_ll, device,
sample_from_full_res=args.sample_from_full_res,
padding_mode=args.padding_mode)
tv_loss = total_variation_loss(delta_flow) if args.tv_weight > 0 else zero
flow_idty_loss = flow_identity_loss(delta_flow) if args.flow_identity_weight > 0 else zero
loss_dict = {}
loss_dict["p"] = perceptual_loss
loss_dict["tv"] = tv_loss
loss_dict["f"] = flow_idty_loss
stn.zero_grad()
ll.zero_grad()
full_stn_loss = perceptual_loss + args.tv_weight * tv_loss + args.flow_identity_weight * flow_idty_loss
full_stn_loss.backward()
t_optim.step()
if not args.freeze_ll:
ll_optim.step()
if psi_is_fixed: # Step learning rate schedulers once psi has been fully-annealed to zero:
epoch = max(0, (i - args.anneal_psi) / args.period)
t_sched.step(epoch)
ll_sched.step(epoch)
accumulate(t_ema, t_module, accum)
loss_reduced = reduce_loss_dict(loss_dict) # Aggregate loss information across GPUs
if primary():
# Display losses on the progress bar:
perceptual_loss_val = loss_reduced["p"].mean().item()
tv_loss_val = loss_reduced["tv"].mean().item()
flow_idty_loss_val = loss_reduced["f"].mean().item()
f_str = f"identity loss: {flow_idty_loss_val:.4f}; " if args.flow_identity_weight > 0 else ""
tv_str = f"tv loss: {tv_loss_val:.6f}; " if args.tv_weight > 0 else ""
pbar.set_description(f"perceptual loss: {perceptual_loss_val:.4f}; {tv_str}{f_str}psi: {psi:.4f}")
# Log losses and others metrics to TensorBoard:
if i % args.log_every == 0 or i in early_ckpt_iters:
writer.add_scalar('Loss/Reconstruction', perceptual_loss_val, i)
writer.add_scalar('Loss/TotalVariation', tv_loss_val, i)
writer.add_scalar('Loss/FlowIdentity', flow_idty_loss_val, i)
writer.add_scalar('Progress/psi', psi, i)
writer.add_scalar('Progress/LL_LearningRate', ll_sched.get_last_lr()[0], i)
writer.add_scalar('Progress/STN_LearningRate', t_sched.get_last_lr()[0], i)
if i % args.ckpt_every == 0 or i in early_ckpt_iters: # Save model checkpoint
save_state_dict(str(i).zfill(7), generator, t_module, t_ema, t_optim, t_sched, ll_module,
ll_optim, ll_sched, args)
if i % args.vis_every == 0 or i in early_vis_iters: # Save visualizations to TensorBoard
if primary() and i in early_ckpt_iters:
pbar.write(f'{i:07}: Learning Rate = {t_sched.get_last_lr()[0]}')
if args.clustering:
create_training_cluster_visuals(generator, t_ema, ll, loss_fn, loader, resize_fake2stn, sample_z, big_sample_z,
psi, device, args.n_mean, args.n_sample, args.num_heads, args.flips,
args.vis_batch_size, args.flow_size, i, writer,
padding_mode=args.padding_mode)
else:
create_training_visuals(generator, t_ema, ll, loader, sample_reals, resize_fake2stn, sample_z, psi,
device, args.n_mean, args.n_sample, i, writer, padding_mode=args.padding_mode)
if __name__ == "__main__":
device = "cuda"
parser = base_training_argparse()
args = parser.parse_args()
if args.transform == 'similarity':
assert args.tv_weight == 0, 'Total Variation loss is not currently supported for similarity-only STNs'
args.n_mean = 200 if args.debug else args.n_mean
args.vis_batch_size //= args.num_heads # Keep visualization batch size reasonable for clustering models
# Setup distributed PyTorch and create results directory:
args.distributed = setup_distributed(args.local_rank)
args.clustering = args.num_heads > 1
results_path = os.path.join(args.results, args.exp_name)
if primary():
writer = GANgealingWriter(results_path)
with open(f'{results_path}/opt.txt', 'w') as f:
json.dump(args.__dict__, f, indent=2)
else:
writer = None
# Seed RNG:
torch.manual_seed(args.seed * get_world_size() + get_rank())
np.random.seed(args.seed * get_world_size() + get_rank())
# Initialize models:
generator = Generator(args.gen_size, args.dim_latent, args.n_mlp, channel_multiplier=args.gen_channel_multiplier, num_fp16_res=args.num_fp16_res).to(device)
stn = get_stn(args.transform, flow_size=args.flow_size, supersize=args.real_size, channel_multiplier=args.stn_channel_multiplier, num_heads=args.num_heads).to(device)
t_ema = get_stn(args.transform, flow_size=args.flow_size, supersize=args.real_size, channel_multiplier=args.stn_channel_multiplier, num_heads=args.num_heads).to(device)
ll = DirectionInterpolator(pca_path=None, n_comps=args.ndirs, inject_index=args.inject, n_latent=generator.n_latent, num_heads=args.num_heads).to(device)
accumulate(t_ema, stn, 0)
# Setup optimizers and learning rate schedulers:
t_optim = optim.Adam(stn.parameters(), lr=args.stn_lr, betas=(0.9, 0.999), eps=1e-8)
ll_optim = optim.Adam(ll.parameters(), lr=args.ll_lr, betas=(0.9, 0.999), eps=1e-8)
t_sched = DecayingCosineAnnealingWarmRestarts(t_optim, T_0=1, T_mult=args.tm, decay=args.decay)
ll_sched = DecayingCosineAnnealingWarmRestarts(ll_optim, T_0=1, T_mult=args.tm, decay=args.decay)
# Setup the perceptual loss function:
loss_fn = get_perceptual_loss(args.loss_fn, device)
# Get the function used to anneal psi:
anneal_fn = get_psi_annealing_fn(args.anneal_fn)
# Load pre-trained generator (and optionally resume from a GANgealing checkpoint):
print(f"Loading model from {args.ckpt}")
ckpt, _ = find_model(args.ckpt)
generator.load_state_dict(ckpt["g_ema"]) # NOTE: We load g_ema as generator since G is frozen!
try: # Restore from full checkpoint, including the optimizer
if args.load_G_only: # Don't attempt to load GANgealing checkpoint; jump straight to the except block
raise KeyError # This doesn't actually raise an error
stn.load_state_dict(ckpt["t"])
t_ema.load_state_dict(ckpt["t_ema"])
t_optim.load_state_dict(ckpt["t_optim"])
t_sched.load_state_dict(ckpt["t_sched"])
ll.load_state_dict(ckpt["ll"])
ll_optim.load_state_dict(ckpt["ll_optim"])
ll_sched.load_state_dict(ckpt["ll_sched"])
except KeyError: # Initialize the target mode c (ll)
print('Only G_EMA has been loaded from checkpoint. Other nets are random!')
n_pca = 1000 if args.debug else 1000000
with torch.no_grad():
batch_w = generator.batch_latent(n_pca // get_world_size())
batch_w = all_gather(batch_w)
pca = PCA(args.ndirs, batch_w)
ll.assign_buffers(pca)
if args.clustering: # For clustering models, initialize using K-Means++ on W-Space
print('Running K-Means++ Initialization')
if args.debug:
centroids = generator.batch_latent(args.num_heads).detach().requires_grad_(False)
else:
centroids = kmeans_plusplus(args.num_heads, 50000, generator, loss_fn, args.inject)
decomposed = pca.encode(centroids)
ll.assign_coefficients(decomposed)
# See if the start iteration can be recovered when resuming training:
args.start_iter = 0
try:
ckpt_name = os.path.basename(args.ckpt)
if ckpt_name.startswith('best_'):
ckpt_name = ckpt_name[5:] # Remove prefix
args.start_iter = int(os.path.splitext(ckpt_name)[0])
except ValueError:
pass
# Move models to DDP if distributed training is enabled:
if args.distributed:
stn = nn.parallel.DistributedDataParallel(stn, device_ids=[args.local_rank], output_device=args.local_rank, broadcast_buffers=False)
ll = nn.parallel.DistributedDataParallel(ll, device_ids=[args.local_rank], output_device=args.local_rank, broadcast_buffers=False)
# Setup real data for visualizations (optional):
loader = img_dataloader(args.real_data_path, shuffle=False, batch_size=args.vis_batch_size, resolution=args.real_size, infinite=False) if args.real_data_path is not None else None
# Begin training:
train(args, loader, generator, stn, t_ema, ll, t_optim, ll_optim, t_sched, ll_sched, loss_fn, anneal_fn,
device, writer)
| [
1,
529,
9507,
29958,
14968,
29889,
2272,
13,
15945,
29908,
13,
29954,
2190,
479,
12818,
6694,
2471,
29889,
13,
15945,
29908,
13,
13,
5215,
4842,
305,
13,
3166,
4842,
305,
1053,
302,
29876,
29892,
5994,
13,
5215,
12655,
408,
7442,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
5215,
4390,
13,
5215,
2897,
13,
13,
3166,
4733,
1053,
3251,
1061,
29892,
679,
29918,
303,
29876,
29892,
360,
8684,
4074,
3733,
1061,
29892,
349,
5454,
29892,
679,
29918,
546,
1547,
950,
29918,
6758,
29892,
413,
1004,
550,
29918,
11242,
11242,
29892,
20347,
457,
279,
6767,
11249,
29892,
18414,
5987,
29892,
6858,
29918,
5105,
13,
3166,
4733,
1053,
330,
927,
12818,
29918,
6758,
29892,
330,
927,
12818,
29918,
19594,
29918,
6758,
29892,
3001,
29918,
5927,
362,
29918,
6758,
29892,
4972,
29918,
22350,
29918,
6758,
13,
3166,
20035,
1053,
10153,
29918,
29881,
2075,
29877,
1664,
29892,
4559,
29918,
262,
18925,
29918,
1272,
13,
3166,
3667,
29879,
29889,
1730,
29918,
8504,
29889,
26495,
29918,
1730,
1053,
402,
2190,
479,
12818,
10507,
29892,
1653,
29918,
26495,
29918,
20119,
29879,
29892,
1653,
29918,
26495,
29918,
19594,
29918,
20119,
29879,
13,
3166,
3667,
29879,
29889,
5721,
7541,
1053,
599,
29918,
29887,
1624,
29892,
679,
29918,
10003,
29892,
6230,
29918,
5721,
7541,
29892,
10032,
29918,
6758,
29918,
8977,
29892,
679,
29918,
11526,
29918,
2311,
29892,
7601,
13,
3166,
3667,
29879,
29889,
3188,
29918,
1191,
5510,
1053,
2967,
29918,
26495,
29918,
1191,
5510,
13,
3166,
3667,
29879,
29889,
11276,
12818,
1053,
3826,
388,
292,
29907,
359,
457,
2744,
484,
12818,
29956,
2817,
15078,
5708,
29892,
301,
29878,
29918,
23090,
29918,
277,
414,
29892,
679,
29918,
6134,
29918,
11276,
12818,
29918,
9144,
13,
3166,
3667,
29879,
29889,
10382,
1053,
1284,
29918,
4299,
13,
13,
13,
1753,
4078,
29918,
3859,
29918,
8977,
29898,
384,
415,
29918,
978,
29892,
15299,
29892,
260,
29918,
5453,
29892,
260,
29918,
2603,
29892,
260,
29918,
20640,
29892,
260,
29918,
816,
287,
29892,
11148,
29918,
5453,
29892,
11148,
29918,
20640,
29892,
11148,
29918,
816,
287,
29892,
6389,
1125,
13,
1678,
274,
29895,
415,
29918,
8977,
353,
8853,
29887,
29918,
2603,
1115,
15299,
29889,
3859,
29918,
8977,
3285,
376,
29873,
1115,
260,
29918,
5453,
29889,
3859,
29918,
8977,
3285,
13,
462,
376,
29873,
29918,
2603,
1115,
260,
29918,
2603,
29889,
3859,
29918,
8977,
3285,
376,
29873,
29918,
20640,
1115,
260,
29918,
20640,
29889,
3859,
29918,
8977,
3285,
13,
462,
376,
29873,
29918,
816,
287,
1115,
260,
29918,
816,
287,
29889,
3859,
29918,
8977,
3285,
376,
645,
1115,
11148,
29918,
5453,
29889,
3859,
29918,
8977,
3285,
13,
462,
376,
645,
29918,
20640,
1115,
11148,
29918,
20640,
29889,
3859,
29918,
8977,
3285,
376,
645,
29918,
816,
287,
1115,
11148,
29918,
816,
287,
29889,
3859,
29918,
8977,
3285,
13,
462,
376,
5085,
1115,
6389,
29913,
13,
1678,
4842,
305,
29889,
7620,
29898,
384,
415,
29918,
8977,
29892,
285,
29915,
29912,
9902,
29918,
2084,
6822,
3198,
9748,
19248,
384,
415,
29918,
978,
1836,
415,
1495,
13,
13,
13,
1753,
7945,
29898,
5085,
29892,
23466,
29892,
15299,
29892,
380,
29876,
29892,
260,
29918,
2603,
29892,
11148,
29892,
260,
29918,
20640,
29892,
11148,
29918,
20640,
29892,
260,
29918,
816,
287,
29892,
11148,
29918,
816,
287,
29892,
6410,
29918,
9144,
29892,
13,
3986,
385,
484,
284,
29918,
9144,
29892,
4742,
29892,
9227,
1125,
13,
13,
1678,
396,
960,
773,
1855,
848,
29892,
1831,
777,
4343,
11916,
1304,
304,
7604,
675,
6694,
29901,
13,
1678,
1998,
29918,
276,
1338,
353,
23466,
338,
451,
6213,
13,
1678,
565,
1998,
29918,
276,
1338,
29901,
13,
4706,
565,
6389,
29889,
8172,
29918,
276,
1338,
29901,
13,
9651,
1855,
29918,
513,
1575,
353,
4842,
305,
29889,
9502,
524,
29898,
29900,
29892,
7431,
29898,
12657,
29889,
24713,
511,
313,
5085,
29889,
29876,
29918,
11249,
29892,
8106,
23749,
580,
13,
4706,
1683,
29901,
13,
9651,
1855,
29918,
513,
1575,
353,
3464,
29898,
5085,
29889,
29876,
29918,
11249,
29897,
13,
4706,
4559,
29918,
276,
1338,
353,
4842,
305,
29889,
1429,
4197,
12657,
29889,
24713,
29961,
861,
29962,
363,
474,
29916,
297,
1855,
29918,
513,
1575,
14664,
517,
29898,
10141,
29897,
13,
4706,
23466,
353,
4559,
29918,
262,
18925,
29918,
1272,
29898,
12657,
29892,
6389,
29889,
26776,
29897,
13,
1678,
1683,
29901,
13,
4706,
4559,
29918,
276,
1338,
353,
6213,
13,
13,
1678,
396,
20018,
2594,
363,
29652,
6694,
29901,
13,
1678,
282,
1646,
353,
3464,
29898,
5085,
29889,
1524,
29897,
13,
1678,
565,
7601,
7295,
13,
4706,
282,
1646,
353,
260,
29939,
18933,
29898,
29886,
1646,
29892,
2847,
29922,
5085,
29889,
2962,
29918,
1524,
29892,
7343,
29918,
29876,
22724,
29922,
5574,
29892,
1560,
29877,
6046,
29922,
29900,
29889,
29906,
29897,
13,
13,
1678,
396,
14164,
10585,
304,
1207,
14238,
1423,
9748,
6775,
29901,
13,
1678,
565,
6389,
29889,
5721,
7541,
29901,
13,
4706,
260,
29918,
5453,
353,
380,
29876,
29889,
5453,
13,
4706,
11148,
29918,
5453,
353,
11148,
29889,
5453,
13,
1678,
1683,
29901,
13,
4706,
260,
29918,
5453,
353,
380,
29876,
13,
4706,
11148,
29918,
5453,
353,
11148,
13,
13,
1678,
4559,
29918,
29920,
353,
4842,
305,
29889,
9502,
29876,
29898,
5085,
29889,
29876,
29918,
11249,
849,
6389,
29889,
1949,
29918,
2813,
29879,
29892,
6389,
29889,
6229,
29918,
5066,
296,
29892,
4742,
29922,
10141,
29897,
29871,
396,
501,
8485,
363,
14655,
263,
4343,
731,
310,
402,
2190,
11916,
13,
1678,
565,
6389,
29889,
695,
504,
3241,
29901,
29871,
396,
319,
1568,
7200,
4343,
731,
310,
402,
2190,
11916,
1304,
363,
14655,
16993,
3241,
29899,
14940,
7604,
29879,
29901,
13,
4706,
4802,
29918,
11249,
29918,
29920,
353,
4842,
305,
29889,
9502,
29876,
29898,
5085,
29889,
29876,
29918,
12676,
849,
679,
29918,
11526,
29918,
2311,
3285,
6389,
29889,
6229,
29918,
5066,
296,
29892,
4742,
29922,
10141,
29897,
13,
1678,
19490,
29918,
29888,
1296,
29906,
303,
29876,
353,
20347,
457,
279,
6767,
11249,
29898,
5085,
29889,
1885,
29918,
2311,
849,
6389,
29889,
1731,
29918,
2311,
29892,
29871,
29941,
467,
517,
29898,
10141,
29897,
565,
6389,
29889,
1885,
29918,
2311,
1405,
6389,
29889,
1731,
29918,
2311,
1683,
302,
29876,
29889,
16941,
2556,
580,
13,
13,
1678,
15299,
29889,
14513,
580,
13,
1678,
6858,
29918,
5105,
29898,
27959,
29892,
7700,
29897,
29871,
396,
402,
338,
14671,
2256,
10106,
445,
4152,
1889,
13,
1678,
6858,
29918,
5105,
29898,
303,
29876,
29892,
5852,
29897,
13,
1678,
6858,
29918,
5105,
29898,
645,
29892,
5852,
29897,
13,
13,
1678,
396,
319,
1904,
1423,
3149,
674,
367,
7160,
10940,
278,
6509,
6554,
338,
5225,
29901,
13,
1678,
5225,
29918,
29212,
29918,
277,
414,
353,
301,
29878,
29918,
23090,
29918,
277,
414,
29898,
5085,
29889,
11276,
284,
29918,
6134,
29892,
6389,
29889,
19145,
29892,
6389,
29889,
1524,
29892,
6389,
29889,
18276,
29897,
13,
1678,
4688,
29918,
384,
415,
29918,
277,
414,
353,
731,
29898,
9171,
29918,
29212,
29918,
277,
414,
29897,
13,
1678,
4688,
29918,
1730,
29918,
277,
414,
353,
426,
29896,
29900,
29900,
29913,
13,
1678,
4688,
29918,
1730,
29918,
277,
414,
29889,
5504,
29898,
799,
368,
29918,
384,
415,
29918,
277,
414,
29897,
13,
13,
1678,
396,
25455,
5164,
6694,
3651,
322,
17727,
29901,
13,
1678,
5225,
353,
4842,
305,
29889,
20158,
29898,
29900,
29889,
29900,
29892,
4742,
2433,
29883,
6191,
1495,
13,
1678,
18414,
353,
29871,
29900,
29889,
29945,
3579,
313,
29941,
29906,
847,
313,
29896,
29900,
334,
29871,
29896,
29900,
29900,
29900,
876,
13,
1678,
282,
1039,
353,
29871,
29896,
29889,
29900,
29871,
396,
12919,
727,
338,
694,
21022,
362,
13,
13,
1678,
396,
6204,
2847,
6694,
7604,
17063,
29901,
13,
1678,
565,
6389,
29889,
695,
504,
3241,
29901,
13,
4706,
1653,
29918,
26495,
29918,
19594,
29918,
20119,
29879,
29898,
27959,
29892,
260,
29918,
2603,
29892,
11148,
29892,
6410,
29918,
9144,
29892,
23466,
29892,
19490,
29918,
29888,
1296,
29906,
303,
29876,
29892,
4559,
29918,
29920,
29892,
4802,
29918,
11249,
29918,
29920,
29892,
13,
462,
462,
4706,
282,
1039,
29892,
4742,
29892,
29871,
6389,
29889,
29876,
29918,
12676,
29892,
6389,
29889,
29876,
29918,
11249,
29892,
6389,
29889,
1949,
29918,
2813,
29879,
29892,
6389,
29889,
20157,
567,
29892,
13,
462,
462,
4706,
6389,
29889,
1730,
29918,
16175,
29918,
2311,
29892,
6389,
29889,
1731,
29918,
2311,
29892,
29871,
29900,
29892,
9227,
29892,
7164,
29918,
8513,
29922,
5085,
29889,
12791,
29918,
8513,
29897,
13,
1678,
1683,
29901,
13,
4706,
1653,
29918,
26495,
29918,
20119,
29879,
29898,
27959,
29892,
260,
29918,
2603,
29892,
11148,
29892,
23466,
29892,
4559,
29918,
276,
1338,
29892,
19490,
29918,
29888,
1296,
29906,
303,
29876,
29892,
4559,
29918,
29920,
29892,
282,
1039,
29892,
4742,
29892,
13,
462,
18884,
6389,
29889,
29876,
29918,
12676,
29892,
6389,
29889,
29876,
29918,
11249,
29892,
29871,
29900,
29892,
9227,
29892,
7164,
29918,
8513,
29922,
5085,
29889,
12791,
29918,
8513,
29897,
13,
13,
1678,
363,
22645,
297,
282,
1646,
29901,
29871,
396,
1667,
6694,
2425,
13,
4706,
474,
353,
22645,
718,
6389,
29889,
2962,
29918,
1524,
718,
29871,
29896,
13,
4706,
565,
474,
5277,
6389,
29889,
11276,
284,
29918,
6134,
29901,
13,
9651,
282,
1039,
353,
385,
484,
284,
29918,
9144,
29898,
29875,
29892,
29871,
29896,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
6389,
29889,
11276,
284,
29918,
6134,
467,
667,
580,
13,
9651,
282,
1039,
29918,
275,
29918,
20227,
353,
7700,
13,
4706,
1683,
29901,
13,
9651,
282,
1039,
353,
29871,
29900,
29889,
29900,
13,
9651,
282,
1039,
29918,
275,
29918,
20227,
353,
5852,
13,
13,
4706,
565,
474,
1405,
6389,
29889,
1524,
29901,
13,
9651,
1596,
703,
25632,
29991,
1159,
13,
9651,
2867,
13,
13,
4706,
835,
13383,
13383,
29937,
13,
4706,
835,
4136,
2277,
323,
4717,
1177,
6850,
29940,
322,
27624,
835,
4136,
2277,
13,
4706,
835,
13383,
13383,
29937,
13,
13,
4706,
565,
6389,
29889,
695,
504,
3241,
470,
6389,
29889,
20157,
567,
29901,
29871,
396,
2233,
504,
3241,
29899,
14940,
639,
1547,
950,
6410,
29901,
13,
9651,
639,
1547,
950,
29918,
6758,
29892,
19471,
29918,
1731,
353,
330,
927,
12818,
29918,
19594,
29918,
6758,
29898,
27959,
29892,
380,
29876,
29892,
11148,
29892,
6410,
29918,
9144,
29892,
19490,
29918,
29888,
1296,
29906,
303,
29876,
29892,
282,
1039,
29892,
13,
462,
462,
462,
462,
29871,
6389,
29889,
16175,
29892,
6389,
29889,
6229,
29918,
5066,
296,
29892,
6389,
29889,
9021,
911,
29918,
645,
29892,
13,
462,
462,
462,
462,
29871,
6389,
29889,
1949,
29918,
2813,
29879,
29892,
6389,
29889,
20157,
567,
29892,
4742,
29892,
13,
462,
462,
462,
462,
29871,
4559,
29918,
3166,
29918,
8159,
29918,
690,
29922,
5085,
29889,
11249,
29918,
3166,
29918,
8159,
29918,
690,
29892,
13,
462,
462,
462,
462,
29871,
7164,
29918,
8513,
29922,
5085,
29889,
12791,
29918,
8513,
29897,
13,
4706,
1683,
29901,
29871,
396,
10117,
402,
2190,
479,
12818,
639,
1547,
950,
6410,
313,
348,
326,
397,
284,
1125,
13,
9651,
639,
1547,
950,
29918,
6758,
29892,
19471,
29918,
1731,
353,
330,
927,
12818,
29918,
6758,
29898,
27959,
29892,
380,
29876,
29892,
11148,
29892,
6410,
29918,
9144,
29892,
19490,
29918,
29888,
1296,
29906,
303,
29876,
29892,
282,
1039,
29892,
13,
462,
462,
462,
3986,
6389,
29889,
16175,
29892,
6389,
29889,
6229,
29918,
5066,
296,
29892,
6389,
29889,
9021,
911,
29918,
645,
29892,
4742,
29892,
13,
462,
462,
462,
3986,
4559,
29918,
3166,
29918,
8159,
29918,
690,
29922,
5085,
29889,
11249,
29918,
3166,
29918,
8159,
29918,
690,
29892,
13,
462,
462,
462,
3986,
7164,
29918,
8513,
29922,
5085,
29889,
12791,
29918,
8513,
29897,
13,
4706,
9631,
29918,
6758,
353,
3001,
29918,
5927,
362,
29918,
6758,
29898,
4181,
29918,
1731,
29897,
565,
6389,
29889,
12427,
29918,
7915,
1405,
29871,
29900,
1683,
5225,
13,
4706,
4972,
29918,
333,
1017,
29918,
6758,
353,
4972,
29918,
22350,
29918,
6758,
29898,
4181,
29918,
1731,
29897,
565,
6389,
29889,
1731,
29918,
22350,
29918,
7915,
1405,
29871,
29900,
1683,
5225,
13,
13,
4706,
6410,
29918,
8977,
353,
6571,
13,
4706,
6410,
29918,
8977,
3366,
29886,
3108,
353,
639,
1547,
950,
29918,
6758,
13,
4706,
6410,
29918,
8977,
3366,
12427,
3108,
353,
9631,
29918,
6758,
13,
4706,
6410,
29918,
8977,
3366,
29888,
3108,
353,
4972,
29918,
333,
1017,
29918,
6758,
13,
13,
4706,
380,
29876,
29889,
9171,
29918,
5105,
580,
13,
4706,
11148,
29889,
9171,
29918,
5105,
580,
13,
4706,
2989,
29918,
303,
29876,
29918,
6758,
353,
639,
1547,
950,
29918,
6758,
718,
6389,
29889,
12427,
29918,
7915,
334,
9631,
29918,
6758,
718,
6389,
29889,
1731,
29918,
22350,
29918,
7915,
334,
4972,
29918,
333,
1017,
29918,
6758,
13,
4706,
2989,
29918,
303,
29876,
29918,
6758,
29889,
1627,
1328,
580,
13,
4706,
260,
29918,
20640,
29889,
10568,
580,
13,
4706,
565,
451,
6389,
29889,
9021,
911,
29918,
645,
29901,
13,
9651,
11148,
29918,
20640,
29889,
10568,
580,
13,
4706,
565,
282,
1039,
29918,
275,
29918,
20227,
29901,
29871,
396,
16696,
6509,
6554,
28598,
352,
414,
2748,
282,
1039,
756,
1063,
8072,
29899,
11276,
7943,
304,
5225,
29901,
13,
9651,
21502,
305,
353,
4236,
29898,
29900,
29892,
313,
29875,
448,
6389,
29889,
11276,
284,
29918,
6134,
29897,
847,
6389,
29889,
19145,
29897,
13,
9651,
260,
29918,
816,
287,
29889,
10568,
29898,
1022,
2878,
29897,
13,
9651,
11148,
29918,
816,
287,
29889,
10568,
29898,
1022,
2878,
29897,
13,
13,
4706,
18414,
5987,
29898,
29873,
29918,
2603,
29892,
260,
29918,
5453,
29892,
18414,
29897,
13,
13,
4706,
6410,
29918,
9313,
1133,
353,
10032,
29918,
6758,
29918,
8977,
29898,
6758,
29918,
8977,
29897,
29871,
396,
319,
26127,
403,
6410,
2472,
4822,
22796,
29879,
13,
13,
4706,
565,
7601,
7295,
13,
9651,
396,
17440,
28495,
373,
278,
6728,
2594,
29901,
13,
9651,
639,
1547,
950,
29918,
6758,
29918,
791,
353,
6410,
29918,
9313,
1133,
3366,
29886,
16862,
12676,
2141,
667,
580,
13,
9651,
9631,
29918,
6758,
29918,
791,
353,
6410,
29918,
9313,
1133,
3366,
12427,
16862,
12676,
2141,
667,
580,
13,
9651,
4972,
29918,
333,
1017,
29918,
6758,
29918,
791,
353,
6410,
29918,
9313,
1133,
3366,
29888,
16862,
12676,
2141,
667,
580,
13,
9651,
285,
29918,
710,
353,
285,
29908,
22350,
6410,
29901,
426,
1731,
29918,
333,
1017,
29918,
6758,
29918,
791,
29901,
29889,
29946,
29888,
3400,
376,
565,
6389,
29889,
1731,
29918,
22350,
29918,
7915,
1405,
29871,
29900,
1683,
5124,
13,
9651,
9631,
29918,
710,
353,
285,
29908,
12427,
6410,
29901,
426,
12427,
29918,
6758,
29918,
791,
29901,
29889,
29953,
29888,
3400,
376,
565,
6389,
29889,
12427,
29918,
7915,
1405,
29871,
29900,
1683,
5124,
13,
9651,
282,
1646,
29889,
842,
29918,
8216,
29898,
29888,
29908,
546,
1547,
950,
6410,
29901,
426,
546,
1547,
950,
29918,
6758,
29918,
791,
29901,
29889,
29946,
29888,
3400,
426,
12427,
29918,
710,
1157,
29888,
29918,
710,
29913,
6134,
29901,
426,
6134,
29901,
29889,
29946,
29888,
27195,
13,
13,
9651,
396,
4522,
28495,
322,
4045,
21556,
304,
323,
6073,
28397,
29901,
13,
9651,
565,
474,
1273,
6389,
29889,
1188,
29918,
17991,
1275,
29871,
29900,
470,
474,
297,
4688,
29918,
384,
415,
29918,
277,
414,
29901,
13,
18884,
9227,
29889,
1202,
29918,
19529,
279,
877,
29931,
2209,
29914,
1123,
3075,
4080,
742,
639,
1547,
950,
29918,
6758,
29918,
791,
29892,
474,
29897,
13,
18884,
9227,
29889,
1202,
29918,
19529,
279,
877,
29931,
2209,
29914,
11536,
10444,
362,
742,
9631,
29918,
6758,
29918,
791,
29892,
474,
29897,
13,
18884,
9227,
29889,
1202,
29918,
19529,
279,
877,
29931,
2209,
29914,
17907,
18415,
742,
4972,
29918,
333,
1017,
29918,
6758,
29918,
791,
29892,
474,
29897,
13,
18884,
9227,
29889,
1202,
29918,
19529,
279,
877,
14470,
29914,
6134,
742,
282,
1039,
29892,
474,
29897,
13,
18884,
9227,
29889,
1202,
29918,
19529,
279,
877,
14470,
29914,
2208,
29918,
29931,
799,
1076,
19907,
742,
11148,
29918,
816,
287,
29889,
657,
29918,
4230,
29918,
29212,
580,
29961,
29900,
1402,
474,
29897,
13,
18884,
9227,
29889,
1202,
29918,
19529,
279,
877,
14470,
29914,
1254,
29940,
29918,
29931,
799,
1076,
19907,
742,
260,
29918,
816,
287,
29889,
657,
29918,
4230,
29918,
29212,
580,
29961,
29900,
1402,
474,
29897,
13,
13,
9651,
565,
474,
1273,
6389,
29889,
384,
415,
29918,
17991,
1275,
29871,
29900,
470,
474,
297,
4688,
29918,
384,
415,
29918,
277,
414,
29901,
29871,
396,
16913,
1904,
1423,
3149,
13,
18884,
4078,
29918,
3859,
29918,
8977,
29898,
710,
29898,
29875,
467,
29920,
5589,
29898,
29955,
511,
15299,
29892,
260,
29918,
5453,
29892,
260,
29918,
2603,
29892,
260,
29918,
20640,
29892,
260,
29918,
816,
287,
29892,
11148,
29918,
5453,
29892,
13,
462,
18884,
11148,
29918,
20640,
29892,
11148,
29918,
816,
287,
29892,
6389,
29897,
13,
13,
4706,
565,
474,
1273,
6389,
29889,
1730,
29918,
17991,
1275,
29871,
29900,
470,
474,
297,
4688,
29918,
1730,
29918,
277,
414,
29901,
29871,
396,
16913,
7604,
17063,
304,
323,
6073,
28397,
13,
9651,
565,
7601,
580,
322,
474,
297,
4688,
29918,
384,
415,
29918,
277,
414,
29901,
13,
18884,
282,
1646,
29889,
3539,
29898,
29888,
29915,
29912,
29875,
29901,
29900,
29955,
6177,
29257,
390,
403,
353,
426,
29873,
29918,
816,
287,
29889,
657,
29918,
4230,
29918,
29212,
580,
29961,
29900,
12258,
1495,
13,
9651,
565,
6389,
29889,
695,
504,
3241,
29901,
13,
18884,
1653,
29918,
26495,
29918,
19594,
29918,
20119,
29879,
29898,
27959,
29892,
260,
29918,
2603,
29892,
11148,
29892,
6410,
29918,
9144,
29892,
23466,
29892,
19490,
29918,
29888,
1296,
29906,
303,
29876,
29892,
4559,
29918,
29920,
29892,
4802,
29918,
11249,
29918,
29920,
29892,
13,
462,
462,
18884,
282,
1039,
29892,
4742,
29892,
6389,
29889,
29876,
29918,
12676,
29892,
6389,
29889,
29876,
29918,
11249,
29892,
6389,
29889,
1949,
29918,
2813,
29879,
29892,
6389,
29889,
20157,
567,
29892,
13,
462,
462,
18884,
6389,
29889,
1730,
29918,
16175,
29918,
2311,
29892,
6389,
29889,
1731,
29918,
2311,
29892,
474,
29892,
9227,
29892,
13,
462,
462,
18884,
7164,
29918,
8513,
29922,
5085,
29889,
12791,
29918,
8513,
29897,
13,
9651,
1683,
29901,
13,
18884,
1653,
29918,
26495,
29918,
20119,
29879,
29898,
27959,
29892,
260,
29918,
2603,
29892,
11148,
29892,
23466,
29892,
4559,
29918,
276,
1338,
29892,
19490,
29918,
29888,
1296,
29906,
303,
29876,
29892,
4559,
29918,
29920,
29892,
282,
1039,
29892,
13,
462,
462,
4706,
4742,
29892,
6389,
29889,
29876,
29918,
12676,
29892,
6389,
29889,
29876,
29918,
11249,
29892,
474,
29892,
9227,
29892,
7164,
29918,
8513,
29922,
5085,
29889,
12791,
29918,
8513,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
4742,
353,
376,
29883,
6191,
29908,
13,
1678,
13812,
353,
2967,
29918,
26495,
29918,
1191,
5510,
580,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
565,
6389,
29889,
9067,
1275,
525,
29764,
537,
2396,
13,
4706,
4974,
6389,
29889,
12427,
29918,
7915,
1275,
29871,
29900,
29892,
525,
11536,
9586,
362,
6410,
338,
451,
5279,
6969,
363,
29501,
29899,
6194,
6850,
29940,
29879,
29915,
13,
1678,
6389,
29889,
29876,
29918,
12676,
353,
29871,
29906,
29900,
29900,
565,
6389,
29889,
8382,
1683,
6389,
29889,
29876,
29918,
12676,
13,
1678,
6389,
29889,
1730,
29918,
16175,
29918,
2311,
849,
29922,
6389,
29889,
1949,
29918,
2813,
29879,
29871,
396,
19152,
7604,
2133,
9853,
2159,
15590,
363,
16993,
3241,
4733,
13,
1678,
396,
3789,
786,
13235,
10772,
29911,
25350,
322,
1653,
2582,
3884,
29901,
13,
1678,
6389,
29889,
5721,
7541,
353,
6230,
29918,
5721,
7541,
29898,
5085,
29889,
2997,
29918,
10003,
29897,
13,
1678,
6389,
29889,
695,
504,
3241,
353,
6389,
29889,
1949,
29918,
2813,
29879,
1405,
29871,
29896,
13,
1678,
2582,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
9902,
29892,
6389,
29889,
4548,
29918,
978,
29897,
13,
1678,
565,
7601,
7295,
13,
4706,
9227,
353,
402,
2190,
479,
12818,
10507,
29898,
9902,
29918,
2084,
29897,
13,
4706,
411,
1722,
29898,
29888,
29915,
29912,
9902,
29918,
2084,
6822,
3670,
29889,
3945,
742,
525,
29893,
1495,
408,
285,
29901,
13,
9651,
4390,
29889,
15070,
29898,
5085,
17255,
8977,
1649,
29892,
285,
29892,
29536,
29922,
29906,
29897,
13,
1678,
1683,
29901,
13,
4706,
9227,
353,
6213,
13,
13,
1678,
396,
922,
287,
390,
9312,
29901,
13,
1678,
4842,
305,
29889,
11288,
29918,
26776,
29898,
5085,
29889,
26776,
334,
679,
29918,
11526,
29918,
2311,
580,
718,
679,
29918,
10003,
3101,
13,
1678,
7442,
29889,
8172,
29889,
26776,
29898,
5085,
29889,
26776,
334,
679,
29918,
11526,
29918,
2311,
580,
718,
679,
29918,
10003,
3101,
13,
13,
1678,
396,
25455,
4733,
29901,
13,
1678,
15299,
353,
3251,
1061,
29898,
5085,
29889,
1885,
29918,
2311,
29892,
6389,
29889,
6229,
29918,
5066,
296,
29892,
6389,
29889,
29876,
29918,
828,
29886,
29892,
8242,
29918,
18056,
4926,
29922,
5085,
29889,
1885,
29918,
12719,
29918,
18056,
4926,
29892,
954,
29918,
18091,
29896,
29953,
29918,
690,
29922,
5085,
29889,
1949,
29918,
18091,
29896,
29953,
29918,
690,
467,
517,
29898,
10141,
29897,
13,
1678,
380,
29876,
353,
679,
29918,
303,
29876,
29898,
5085,
29889,
9067,
29892,
4972,
29918,
2311,
29922,
5085,
29889,
1731,
29918,
2311,
29892,
480,
6774,
675,
29922,
5085,
29889,
6370,
29918,
2311,
29892,
8242,
29918,
18056,
4926,
29922,
5085,
29889,
303,
29876,
29918,
12719,
29918,
18056,
4926,
29892,
954,
29918,
2813,
29879,
29922,
5085,
29889,
1949,
29918,
2813,
29879,
467,
517,
29898,
10141,
29897,
13,
1678,
260,
29918,
2603,
353,
679,
29918,
303,
29876,
29898,
5085,
29889,
9067,
29892,
4972,
29918,
2311,
29922,
5085,
29889,
1731,
29918,
2311,
29892,
480,
6774,
675,
29922,
5085,
29889,
6370,
29918,
2311,
29892,
8242,
29918,
18056,
4926,
29922,
5085,
29889,
303,
29876,
29918,
12719,
29918,
18056,
4926,
29892,
954,
29918,
2813,
29879,
29922,
5085,
29889,
1949,
29918,
2813,
29879,
467,
517,
29898,
10141,
29897,
13,
1678,
11148,
353,
360,
8684,
4074,
3733,
1061,
29898,
29886,
1113,
29918,
2084,
29922,
8516,
29892,
302,
29918,
510,
567,
29922,
5085,
29889,
299,
12935,
29892,
11658,
29918,
2248,
29922,
5085,
29889,
21920,
29892,
302,
29918,
5066,
296,
29922,
27959,
29889,
29876,
29918,
5066,
296,
29892,
954,
29918,
2813,
29879,
29922,
5085,
29889,
1949,
29918,
2813,
29879,
467,
517,
29898,
10141,
29897,
13,
1678,
18414,
5987,
29898,
29873,
29918,
2603,
29892,
380,
29876,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
3789,
786,
5994,
19427,
322,
6509,
6554,
28598,
352,
414,
29901,
13,
1678,
260,
29918,
20640,
353,
5994,
29889,
3253,
314,
29898,
303,
29876,
29889,
16744,
3285,
301,
29878,
29922,
5085,
29889,
303,
29876,
29918,
29212,
29892,
1010,
294,
7607,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
511,
321,
567,
29922,
29896,
29872,
29899,
29947,
29897,
13,
1678,
11148,
29918,
20640,
353,
5994,
29889,
3253,
314,
29898,
645,
29889,
16744,
3285,
301,
29878,
29922,
5085,
29889,
645,
29918,
29212,
29892,
1010,
294,
7607,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
511,
321,
567,
29922,
29896,
29872,
29899,
29947,
29897,
13,
1678,
260,
29918,
816,
287,
353,
3826,
388,
292,
29907,
359,
457,
2744,
484,
12818,
29956,
2817,
15078,
5708,
29898,
29873,
29918,
20640,
29892,
323,
29918,
29900,
29922,
29896,
29892,
323,
29918,
4713,
29922,
5085,
29889,
18276,
29892,
20228,
29922,
5085,
29889,
7099,
388,
29897,
13,
1678,
11148,
29918,
816,
287,
353,
3826,
388,
292,
29907,
359,
457,
2744,
484,
12818,
29956,
2817,
15078,
5708,
29898,
645,
29918,
20640,
29892,
323,
29918,
29900,
29922,
29896,
29892,
323,
29918,
4713,
29922,
5085,
29889,
18276,
29892,
20228,
29922,
5085,
29889,
7099,
388,
29897,
13,
13,
1678,
396,
3789,
786,
278,
639,
1547,
950,
6410,
740,
29901,
13,
1678,
6410,
29918,
9144,
353,
679,
29918,
546,
1547,
950,
29918,
6758,
29898,
5085,
29889,
6758,
29918,
9144,
29892,
4742,
29897,
13,
1678,
396,
3617,
278,
740,
1304,
304,
385,
484,
284,
282,
1039,
29901,
13,
1678,
385,
484,
284,
29918,
9144,
353,
679,
29918,
6134,
29918,
11276,
12818,
29918,
9144,
29898,
5085,
29889,
11276,
284,
29918,
9144,
29897,
13,
13,
1678,
396,
16012,
758,
29899,
3018,
1312,
15299,
313,
392,
2984,
635,
620,
2017,
515,
263,
402,
2190,
479,
12818,
1423,
3149,
1125,
13,
1678,
1596,
29898,
29888,
29908,
23456,
1904,
515,
426,
5085,
29889,
384,
415,
27195,
13,
1678,
274,
29895,
415,
29892,
903,
353,
1284,
29918,
4299,
29898,
5085,
29889,
384,
415,
29897,
13,
1678,
15299,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
29887,
29918,
2603,
20068,
29871,
396,
6058,
29923,
29901,
1334,
2254,
330,
29918,
2603,
408,
15299,
1951,
402,
338,
14671,
2256,
29991,
13,
1678,
1018,
29901,
29871,
396,
11654,
487,
515,
2989,
1423,
3149,
29892,
3704,
278,
5994,
3950,
13,
4706,
565,
6389,
29889,
1359,
29918,
29954,
29918,
6194,
29901,
29871,
396,
3872,
29915,
29873,
4218,
304,
2254,
402,
2190,
479,
12818,
1423,
3149,
29936,
12500,
7812,
304,
278,
5174,
2908,
13,
9651,
12020,
7670,
2392,
29871,
396,
910,
1838,
29915,
29873,
2869,
12020,
385,
1059,
13,
4706,
380,
29876,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
29873,
20068,
13,
4706,
260,
29918,
2603,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
29873,
29918,
2603,
20068,
13,
4706,
260,
29918,
20640,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
29873,
29918,
20640,
20068,
13,
4706,
260,
29918,
816,
287,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
29873,
29918,
816,
287,
20068,
13,
4706,
11148,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
645,
20068,
13,
4706,
11148,
29918,
20640,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
645,
29918,
20640,
20068,
13,
4706,
11148,
29918,
816,
287,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
384,
415,
3366,
645,
29918,
816,
287,
20068,
13,
1678,
5174,
7670,
2392,
29901,
29871,
396,
25455,
278,
3646,
4464,
274,
313,
645,
29897,
13,
4706,
1596,
877,
11730,
402,
29918,
26862,
756,
1063,
7500,
515,
1423,
3149,
29889,
5901,
302,
1691,
526,
4036,
29991,
1495,
13,
4706,
302,
29918,
29886,
1113,
353,
29871,
29896,
29900,
29900,
29900,
565,
6389,
29889,
8382,
1683,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
13,
4706,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
9651,
9853,
29918,
29893,
353,
15299,
29889,
16175,
29918,
5066,
296,
29898,
29876,
29918,
29886,
1113,
849,
679,
29918,
11526,
29918,
2311,
3101,
13,
4706,
9853,
29918,
29893,
353,
599,
29918,
29887,
1624,
29898,
16175,
29918,
29893,
29897,
13,
4706,
282,
1113,
353,
349,
5454,
29898,
5085,
29889,
299,
12935,
29892,
9853,
29918,
29893,
29897,
13,
4706,
11148,
29889,
16645,
29918,
28040,
414,
29898,
29886,
1113,
29897,
13,
4706,
565,
6389,
29889,
695,
504,
3241,
29901,
29871,
396,
1152,
16993,
3241,
4733,
29892,
11905,
773,
476,
29899,
6816,
550,
1817,
373,
399,
29899,
14936,
13,
9651,
1596,
877,
27795,
476,
29899,
6816,
550,
1817,
17250,
2133,
1495,
13,
9651,
565,
6389,
29889,
8382,
29901,
13,
18884,
1644,
1007,
29879,
353,
15299,
29889,
16175,
29918,
5066,
296,
29898,
5085,
29889,
1949,
29918,
2813,
29879,
467,
4801,
496,
2141,
276,
339,
2658,
29918,
5105,
23538,
8824,
29897,
13,
9651,
1683,
29901,
13,
18884,
1644,
1007,
29879,
353,
413,
1004,
550,
29918,
11242,
11242,
29898,
5085,
29889,
1949,
29918,
2813,
29879,
29892,
29871,
29945,
29900,
29900,
29900,
29900,
29892,
15299,
29892,
6410,
29918,
9144,
29892,
6389,
29889,
21920,
29897,
13,
9651,
17753,
4752,
353,
282,
1113,
29889,
12508,
29898,
1760,
1007,
29879,
29897,
13,
9651,
11148,
29889,
16645,
29918,
1111,
8462,
29879,
29898,
311,
510,
4752,
29897,
13,
13,
1678,
396,
2823,
565,
278,
1369,
12541,
508,
367,
24776,
746,
620,
9929,
6694,
29901,
13,
1678,
6389,
29889,
2962,
29918,
1524,
353,
29871,
29900,
13,
1678,
1018,
29901,
13,
4706,
274,
29895,
415,
29918,
978,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
5085,
29889,
384,
415,
29897,
13,
4706,
565,
274,
29895,
415,
29918,
978,
29889,
27382,
2541,
877,
13318,
29918,
29374,
13,
9651,
274,
29895,
415,
29918,
978,
353,
274,
29895,
415,
29918,
978,
29961,
29945,
17531,
29871,
396,
15154,
10944,
13,
4706,
6389,
29889,
2962,
29918,
1524,
353,
938,
29898,
359,
29889,
2084,
29889,
23579,
568,
486,
29898,
384,
415,
29918,
978,
9601,
29900,
2314,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
1209,
13,
13,
1678,
396,
25249,
4733,
304,
360,
11191,
565,
13235,
6694,
338,
9615,
29901,
13,
1678,
565,
6389,
29889,
5721,
7541,
29901,
13,
4706,
380,
29876,
353,
302,
29876,
29889,
23482,
29889,
13398,
7541,
1469,
2177,
6553,
29898,
303,
29876,
29892,
4742,
29918,
4841,
11759,
5085,
29889,
2997,
29918,
10003,
1402,
1962,
29918,
10141,
29922,
5085,
29889,
2997,
29918,
10003,
29892,
12672,
29918,
28040,
414,
29922,
8824,
29897,
13,
4706,
11148,
353,
302,
29876,
29889,
23482,
29889,
13398,
7541,
1469,
2177,
6553,
29898,
645,
29892,
4742,
29918,
4841,
11759,
5085,
29889,
2997,
29918,
10003,
1402,
1962,
29918,
10141,
29922,
5085,
29889,
2997,
29918,
10003,
29892,
12672,
29918,
28040,
414,
29922,
8824,
29897,
13,
13,
1678,
396,
3789,
786,
1855,
848,
363,
7604,
17063,
313,
25253,
1125,
13,
1678,
23466,
353,
10153,
29918,
29881,
2075,
29877,
1664,
29898,
5085,
29889,
6370,
29918,
1272,
29918,
2084,
29892,
528,
21897,
29922,
8824,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
1730,
29918,
16175,
29918,
2311,
29892,
10104,
29922,
5085,
29889,
6370,
29918,
2311,
29892,
10362,
29922,
8824,
29897,
565,
6389,
29889,
6370,
29918,
1272,
29918,
2084,
338,
451,
6213,
1683,
6213,
13,
13,
1678,
396,
14893,
6694,
29901,
13,
1678,
7945,
29898,
5085,
29892,
23466,
29892,
15299,
29892,
380,
29876,
29892,
260,
29918,
2603,
29892,
11148,
29892,
260,
29918,
20640,
29892,
11148,
29918,
20640,
29892,
260,
29918,
816,
287,
29892,
11148,
29918,
816,
287,
29892,
6410,
29918,
9144,
29892,
385,
484,
284,
29918,
9144,
29892,
13,
3986,
4742,
29892,
9227,
29897,
13,
2
] |
pygame/PygameSuperMario/source/setup.py | Tom-Li1/py_modules | 0 | 66309 | <filename>pygame/PygameSuperMario/source/setup.py<gh_stars>0
import pygame
from . import constants as C
from . import tools
pygame.init()
SCREEN = pygame.display.set_mode(C.SCREEN_SIZE)
GRAPHICS = tools.load_graphics(r'resources/graphics')
| [
1,
529,
9507,
29958,
2272,
11802,
29914,
29925,
4790,
420,
19111,
29924,
2628,
29914,
4993,
29914,
14669,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
22028,
13,
3166,
869,
1053,
17727,
408,
315,
13,
3166,
869,
1053,
8492,
13,
13,
2272,
11802,
29889,
2344,
580,
13,
7187,
1525,
1430,
353,
22028,
29889,
4990,
29889,
842,
29918,
8513,
29898,
29907,
29889,
7187,
1525,
1430,
29918,
14226,
29897,
13,
14345,
3301,
29950,
2965,
29903,
353,
8492,
29889,
1359,
29918,
6420,
29898,
29878,
29915,
13237,
29914,
6420,
1495,
13,
2
] |
unifier/apps/core/migrations/0010_auto_20210225_0227.py | sosolidkk/manga-unifier | 6 | 151580 | <reponame>sosolidkk/manga-unifier<gh_stars>1-10
# Generated by Django 3.1.7 on 2021-02-25 02:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0009_auto_20210223_0124'),
]
operations = [
migrations.AddField(
model_name='mangachapter',
name='images',
field=models.JSONField(default=list, verbose_name='Images'),
),
migrations.DeleteModel(
name='Image',
),
]
| [
1,
529,
276,
1112,
420,
29958,
29879,
359,
17211,
6859,
29914,
29885,
12686,
29899,
348,
3709,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29896,
29889,
29955,
373,
29871,
29906,
29900,
29906,
29896,
29899,
29900,
29906,
29899,
29906,
29945,
29871,
29900,
29906,
29901,
29906,
29955,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
3221,
742,
525,
29900,
29900,
29900,
29929,
29918,
6921,
29918,
29906,
29900,
29906,
29896,
29900,
29906,
29906,
29941,
29918,
29900,
29896,
29906,
29946,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
29885,
574,
496,
3314,
742,
13,
9651,
1024,
2433,
8346,
742,
13,
9651,
1746,
29922,
9794,
29889,
7249,
3073,
29898,
4381,
29922,
1761,
29892,
26952,
29918,
978,
2433,
20163,
5477,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
12498,
3195,
29898,
13,
9651,
1024,
2433,
2940,
742,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
demisto_sdk/commands/lint/linter.py | nericksen/demisto-sdk | 0 | 77399 | # STD python packages
import copy
import hashlib
import logging
import os
import platform
import traceback
from typing import Any, Dict, List, Optional, Tuple
import docker
import docker.errors
import docker.models.containers
import git
import requests.exceptions
import urllib3.exceptions
from packaging.version import parse
from wcmatch.pathlib import NEGATE, Path
from demisto_sdk.commands.common.constants import (INTEGRATIONS_DIR,
PACKS_PACK_META_FILE_NAME,
TYPE_PWSH, TYPE_PYTHON)
from demisto_sdk.commands.common.handlers import JSON_Handler, YAML_Handler
from demisto_sdk.commands.common.timers import timer
from demisto_sdk.commands.common.tools import (get_all_docker_images,
run_command_os)
from demisto_sdk.commands.lint.commands_builder import (
build_bandit_command, build_flake8_command, build_mypy_command,
build_pwsh_analyze_command, build_pwsh_test_command, build_pylint_command,
build_pytest_command, build_vulture_command, build_xsoar_linter_command)
from demisto_sdk.commands.lint.docker_helper import Docker
from demisto_sdk.commands.lint.helpers import (EXIT_CODES, FAIL, RERUN, RL,
SUCCESS, WARNING,
add_tmp_lint_files,
add_typing_module,
coverage_report_editor,
get_file_from_container,
get_python_version_from_image,
pylint_plugin,
split_warnings_errors,
stream_docker_container_output)
json = JSON_Handler()
# 3-rd party packages
# Local packages
logger = logging.getLogger('demisto-sdk')
class Linter:
""" Linter used to activate lint command on single package
Attributes:
pack_dir(Path): Pack to run lint on.
content_repo(Path): Git repo object of content repo.
req_2(list): requirements for docker using python2.
req_3(list): requirements for docker using python3.
docker_engine(bool): Whether docker engine detected by docker-sdk.
"""
def __init__(self, pack_dir: Path, content_repo: Path, req_3: list, req_2: list, docker_engine: bool,
docker_timeout: int):
self._req_3 = req_3
self._req_2 = req_2
self._content_repo = content_repo
self._pack_abs_dir = pack_dir
self._pack_name = None
self.docker_timeout = docker_timeout
# Docker client init
if docker_engine:
self._docker_client: docker.DockerClient = docker.from_env(timeout=docker_timeout)
self._docker_hub_login = self._docker_login()
# Facts gathered regarding pack lint and test
self._facts: Dict[str, Any] = {
"images": [],
"python_version": 0,
"env_vars": {},
"test": False,
"lint_files": [],
"support_level": None,
"is_long_running": False,
"lint_unittest_files": [],
"additional_requirements": [],
"docker_engine": docker_engine,
"is_script": False,
"commands": None,
}
# Pack lint status object - visualize it
self._pkg_lint_status: Dict = {
"pkg": None,
"pack_type": None,
"path": str(self._content_repo),
"errors": [],
"images": [],
"flake8_errors": None,
"XSOAR_linter_errors": None,
"bandit_errors": None,
"mypy_errors": None,
"vulture_errors": None,
"flake8_warnings": None,
"XSOAR_linter_warnings": None,
"bandit_warnings": None,
"mypy_warnings": None,
"vulture_warnings": None,
"exit_code": SUCCESS,
"warning_code": SUCCESS,
}
@timer(group_name='lint')
def run_dev_packages(self, no_flake8: bool, no_bandit: bool, no_mypy: bool, no_pylint: bool, no_vulture: bool,
no_xsoar_linter: bool, no_pwsh_analyze: bool, no_pwsh_test: bool, no_test: bool, modules: dict,
keep_container: bool, test_xml: str, no_coverage: bool) -> dict:
""" Run lint and tests on single package
Performing the follow:
1. Run the lint on OS - flake8, bandit, mypy.
2. Run in package docker - pylint, pytest.
Args:
no_flake8(bool): Whether to skip flake8
no_bandit(bool): Whether to skip bandit
no_mypy(bool): Whether to skip mypy
no_vulture(bool): Whether to skip vulture
no_pylint(bool): Whether to skip pylint
no_test(bool): Whether to skip pytest
no_pwsh_analyze(bool): Whether to skip powershell code analyzing
no_pwsh_test(bool): whether to skip powershell tests
modules(dict): Mandatory modules to locate in pack path (CommonServerPython.py etc)
keep_container(bool): Whether to keep the test container
test_xml(str): Path for saving pytest xml results
no_coverage(bool): Run pytest without coverage report
Returns:
dict: lint and test all status, pkg status)
"""
# Gather information for lint check information
skip = self._gather_facts(modules)
# If not python pack - skip pack
if skip:
return self._pkg_lint_status
try:
# Locate mandatory files in pack path - for more info checkout the context manager LintFiles
with add_tmp_lint_files(content_repo=self._content_repo, # type: ignore
pack_path=self._pack_abs_dir,
lint_files=self._facts["lint_files"],
modules=modules,
pack_type=self._pkg_lint_status["pack_type"]):
# Run lint check on host - flake8, bandit, mypy
if self._pkg_lint_status["pack_type"] == TYPE_PYTHON:
self._run_lint_in_host(no_flake8=no_flake8,
no_bandit=no_bandit,
no_mypy=no_mypy,
no_vulture=no_vulture,
no_xsoar_linter=no_xsoar_linter)
# Run lint and test check on pack docker image
if self._facts["docker_engine"]:
self._run_lint_on_docker_image(no_pylint=no_pylint,
no_test=no_test,
no_pwsh_analyze=no_pwsh_analyze,
no_pwsh_test=no_pwsh_test,
keep_container=keep_container,
test_xml=test_xml,
no_coverage=no_coverage)
except Exception as ex:
err = f'{self._pack_abs_dir}: Unexpected fatal exception: {str(ex)}'
logger.error(f"{err}. Traceback: {traceback.format_exc()}")
self._pkg_lint_status["errors"].append(err)
self._pkg_lint_status['exit_code'] += FAIL
return self._pkg_lint_status
@timer(group_name='lint')
def _gather_facts(self, modules: dict) -> bool:
""" Gathering facts about the package - python version, docker images, valid docker image, yml parsing
Args:
modules(dict): Test mandatory modules to be ignore in lint check
Returns:
bool: Indicating if to continue further or not, if False exit Thread, Else continue.
"""
# Looking for pkg yaml
yml_file: Optional[Path] = self._pack_abs_dir.glob([r'*.yaml', r'*.yml', r'!*unified*.yml'], flags=NEGATE)
if not yml_file:
logger.info(f"{self._pack_abs_dir} - Skipping no yaml file found {yml_file}")
self._pkg_lint_status["errors"].append('Unable to find yml file in package')
return True
else:
try:
yml_file = next(yml_file)
except StopIteration:
return True
# Get pack name
self._pack_name = yml_file.stem
log_prompt = f"{self._pack_name} - Facts"
self._pkg_lint_status["pkg"] = yml_file.stem
logger.info(f"{log_prompt} - Using yaml file {yml_file}")
# Parsing pack yaml - in order to verify if check needed
try:
script_obj: Dict = {}
yml_obj: Dict = YAML_Handler().load(yml_file)
if isinstance(yml_obj, dict):
script_obj = yml_obj.get('script', {}) if isinstance(yml_obj.get('script'), dict) else yml_obj
self._facts['is_script'] = True if 'Scripts' in yml_file.parts else False
self._facts['is_long_running'] = script_obj.get('longRunning')
self._facts['commands'] = self._get_commands_list(script_obj)
self._pkg_lint_status["pack_type"] = script_obj.get('type')
except (FileNotFoundError, IOError, KeyError):
self._pkg_lint_status["errors"].append('Unable to parse package yml')
return True
# return no check needed if not python pack
if self._pkg_lint_status["pack_type"] not in (TYPE_PYTHON, TYPE_PWSH):
logger.info(f"{log_prompt} - Skipping due to not Python, Powershell package - Pack is"
f" {self._pkg_lint_status['pack_type']}")
return True
# Docker images
if self._facts["docker_engine"]:
logger.info(f"{log_prompt} - Pulling docker images, can take up to 1-2 minutes if not exists locally ")
self._facts["images"] = [[image, -1] for image in get_all_docker_images(script_obj=script_obj)]
# Gather environment variables for docker execution
self._facts["env_vars"] = {
"CI": os.getenv("CI", False),
"DEMISTO_LINT_UPDATE_CERTS": os.getenv('DEMISTO_LINT_UPDATE_CERTS', "yes")
}
lint_files = set()
# Facts for python pack
if self._pkg_lint_status["pack_type"] == TYPE_PYTHON:
self._update_support_level()
if self._facts["docker_engine"]:
# Getting python version from docker image - verifying if not valid docker image configured
for image in self._facts["images"]:
py_num: str = get_python_version_from_image(image=image[0], timeout=self.docker_timeout)
image[1] = py_num
logger.info(f"{self._pack_name} - Facts - {image[0]} - Python {py_num}")
if not self._facts["python_version"]:
self._facts["python_version"] = py_num
# Checking whatever *test* exists in package
self._facts["test"] = True if next(self._pack_abs_dir.glob([r'test_*.py', r'*_test.py']),
None) else False
if self._facts["test"]:
logger.info(f"{log_prompt} - Tests found")
else:
logger.info(f"{log_prompt} - Tests not found")
# Gather package requirements embedded test-requirements.py file
test_requirements = self._pack_abs_dir / 'test-requirements.txt'
if test_requirements.exists():
try:
additional_req = test_requirements.read_text(encoding='utf-8').strip().split('\n')
self._facts["additional_requirements"].extend(additional_req)
logger.info(f"{log_prompt} - Additional package Pypi packages found - {additional_req}")
except (FileNotFoundError, IOError):
self._pkg_lint_status["errors"].append('Unable to parse test-requirements.txt in package')
elif not self._facts["python_version"]:
# get python version from yml
pynum = '3.7' if (script_obj.get('subtype', 'python3') == 'python3') else '2.7'
self._facts["python_version"] = pynum
logger.info(f"{log_prompt} - Using python version from yml: {pynum}")
# Get lint files
lint_files = set(self._pack_abs_dir.glob(["*.py", "!__init__.py", "!*.tmp"],
flags=NEGATE))
# Facts for Powershell pack
elif self._pkg_lint_status["pack_type"] == TYPE_PWSH:
# Get lint files
lint_files = set(
self._pack_abs_dir.glob(["*.ps1", "!*Tests.ps1", "CommonServerPowerShell.ps1", "demistomock.ps1'"],
flags=NEGATE))
# Add CommonServer to the lint checks
if 'commonserver' in self._pack_abs_dir.name.lower():
# Powershell
if self._pkg_lint_status["pack_type"] == TYPE_PWSH:
self._facts["lint_files"] = [Path(self._pack_abs_dir / 'CommonServerPowerShell.ps1')]
# Python
elif self._pkg_lint_status["pack_type"] == TYPE_PYTHON:
self._facts["lint_files"] = [Path(self._pack_abs_dir / 'CommonServerPython.py')]
else:
test_modules = {self._pack_abs_dir / module.name for module in modules.keys()}
lint_files = lint_files.difference(test_modules)
self._facts["lint_files"] = list(lint_files)
if self._facts["lint_files"]:
self._remove_gitignore_files(log_prompt)
for lint_file in self._facts["lint_files"]:
logger.info(f"{log_prompt} - Lint file {lint_file}")
else:
logger.info(f"{log_prompt} - Lint files not found")
# Remove files that are in gitignore
self._split_lint_files()
return False
def _remove_gitignore_files(self, log_prompt: str) -> None:
"""
Skipping files that matches gitignore patterns.
Args:
log_prompt(str): log prompt string
Returns:
"""
try:
repo = git.Repo(self._content_repo)
files_to_ignore = repo.ignored(self._facts['lint_files'])
for file in files_to_ignore:
logger.info(f"{log_prompt} - Skipping gitignore file {file}")
self._facts["lint_files"] = [path for path in self._facts['lint_files'] if path not in files_to_ignore]
except (git.InvalidGitRepositoryError, git.NoSuchPathError):
logger.debug("No gitignore files is available")
def _split_lint_files(self):
""" Remove unit test files from _facts['lint_files'] and put into their own list _facts['lint_unittest_files']
This is because not all lints should be done on unittest files.
"""
lint_files_list = copy.deepcopy(self._facts["lint_files"])
for lint_file in lint_files_list:
if lint_file.name.startswith('test_') or lint_file.name.endswith('_test.py'):
self._facts['lint_unittest_files'].append(lint_file)
self._facts["lint_files"].remove(lint_file)
@timer(group_name='lint')
def _run_lint_in_host(self, no_flake8: bool, no_bandit: bool, no_mypy: bool, no_vulture: bool,
no_xsoar_linter: bool):
""" Run lint check on host
Args:
no_flake8(bool): Whether to skip flake8.
no_bandit(bool): Whether to skip bandit.
no_mypy(bool): Whether to skip mypy.
no_vulture(bool): Whether to skip Vulture.
"""
warning = []
error = []
other = []
exit_code: int = 0
for lint_check in ["flake8", "XSOAR_linter", "bandit", "mypy", "vulture"]:
exit_code = SUCCESS
output = ""
if self._facts["lint_files"] or self._facts["lint_unittest_files"]:
if lint_check == "flake8" and not no_flake8:
flake8_lint_files = copy.deepcopy(self._facts["lint_files"])
# if there are unittest.py then we would run flake8 on them too.
if self._facts['lint_unittest_files']:
flake8_lint_files.extend(self._facts['lint_unittest_files'])
exit_code, output = self._run_flake8(py_num=self._facts["python_version"],
lint_files=flake8_lint_files)
if self._facts["lint_files"]:
if lint_check == "XSOAR_linter" and not no_xsoar_linter:
exit_code, output = self._run_xsoar_linter(py_num=self._facts["python_version"],
lint_files=self._facts["lint_files"])
elif lint_check == "bandit" and not no_bandit:
exit_code, output = self._run_bandit(lint_files=self._facts["lint_files"])
elif lint_check == "mypy" and not no_mypy:
exit_code, output = self._run_mypy(py_num=self._facts["python_version"],
lint_files=self._facts["lint_files"])
elif lint_check == "vulture" and not no_vulture:
exit_code, output = self._run_vulture(py_num=self._facts["python_version"],
lint_files=self._facts["lint_files"])
# check for any exit code other than 0
if exit_code:
error, warning, other = split_warnings_errors(output)
if exit_code and warning:
self._pkg_lint_status["warning_code"] |= EXIT_CODES[lint_check]
self._pkg_lint_status[f"{lint_check}_warnings"] = "\n".join(warning)
if exit_code & FAIL:
self._pkg_lint_status["exit_code"] |= EXIT_CODES[lint_check]
# if the error were extracted correctly as they start with E
if error:
self._pkg_lint_status[f"{lint_check}_errors"] = "\n".join(error)
# if there were errors but they do not start with E
else:
self._pkg_lint_status[f"{lint_check}_errors"] = "\n".join(other)
@timer(group_name='lint')
def _run_flake8(self, py_num: str, lint_files: List[Path]) -> Tuple[int, str]:
""" Runs flake8 in pack dir
Args:
py_num(str): The python version in use
lint_files(List[Path]): file to perform lint
Returns:
int: 0 on successful else 1, errors
str: Bandit errors
"""
log_prompt = f"{self._pack_name} - Flake8"
logger.info(f"{log_prompt} - Start")
stdout, stderr, exit_code = run_command_os(command=build_flake8_command(lint_files, py_num),
cwd=self._content_repo)
logger.debug(f"{log_prompt} - Finished, exit-code: {exit_code}")
logger.debug(f"{log_prompt} - Finished, stdout: {RL if stdout else ''}{stdout}")
logger.debug(f"{log_prompt} - Finished, stderr: {RL if stderr else ''}{stderr}")
if stderr or exit_code:
logger.error(f"{log_prompt}- Finished, errors found")
if stderr:
return FAIL, stderr
else:
return FAIL, stdout
logger.info(f"{log_prompt} - Successfully finished")
return SUCCESS, ""
@timer(group_name='lint')
def _run_xsoar_linter(self, py_num: str, lint_files: List[Path]) -> Tuple[int, str]:
""" Runs Xsaor linter in pack dir
Args:
lint_files(List[Path]): file to perform lint
Returns:
int: 0 on successful else 1, errors
str: Xsoar linter errors
"""
status = SUCCESS
FAIL_PYLINT = 0b10
with pylint_plugin(self._pack_abs_dir):
log_prompt = f"{self._pack_name} - XSOAR Linter"
logger.info(f"{log_prompt} - Start")
myenv = os.environ.copy()
if myenv.get('PYTHONPATH'):
myenv['PYTHONPATH'] += ':' + str(self._pack_abs_dir)
else:
myenv['PYTHONPATH'] = str(self._pack_abs_dir)
if self._facts['is_long_running']:
myenv['LONGRUNNING'] = 'True'
py_ver = parse(py_num).major
if py_ver < 3:
myenv['PY2'] = 'True'
myenv['is_script'] = str(self._facts['is_script'])
# as Xsoar checker is a pylint plugin and runs as part of pylint code, we can not pass args to it.
# as a result we can use the env vars as a getway.
myenv['commands'] = ','.join([str(elem) for elem in self._facts['commands']]) \
if self._facts['commands'] else ''
stdout, stderr, exit_code = run_command_os(
command=build_xsoar_linter_command(lint_files, py_num, self._facts.get('support_level', 'base')),
cwd=self._pack_abs_dir, env=myenv)
if exit_code & FAIL_PYLINT:
logger.error(f"{log_prompt}- Finished, errors found")
status = FAIL
if exit_code & WARNING:
logger.warning(f"{log_prompt} - Finished, warnings found")
if not status:
status = WARNING
# if pylint did not run and failure exit code has been returned from run commnad
elif exit_code & FAIL:
status = FAIL
logger.debug(f"{log_prompt} - Actual XSOAR linter error -")
logger.debug(f"{log_prompt} - Full format stdout: {RL if stdout else ''}{stdout}")
# for contrib prs which are not merged from master and do not have pylint in dev-requirements-py2.
if os.environ.get('CI'):
stdout = "Xsoar linter could not run, Please merge from master"
else:
stdout = "Xsoar linter could not run, please make sure you have" \
" the necessary Pylint version for both py2 and py3"
logger.error(f"{log_prompt}- Finished, errors found")
logger.debug(f"{log_prompt} - Finished, exit-code: {exit_code}")
logger.debug(f"{log_prompt} - Finished, stdout: {RL if stdout else ''}{stdout}")
logger.debug(f"{log_prompt} - Finished, stderr: {RL if stderr else ''}{stderr}")
if not exit_code:
logger.info(f"{log_prompt} - Successfully finished")
return status, stdout
@timer(group_name='lint')
def _run_bandit(self, lint_files: List[Path]) -> Tuple[int, str]:
""" Run bandit in pack dir
Args:
lint_files(List[Path]): file to perform lint
Returns:
int: 0 on successful else 1, errors
str: Bandit errors
"""
log_prompt = f"{self._pack_name} - Bandit"
logger.info(f"{log_prompt} - Start")
stdout, stderr, exit_code = run_command_os(command=build_bandit_command(lint_files),
cwd=self._pack_abs_dir)
logger.debug(f"{log_prompt} - Finished, exit-code: {exit_code}")
logger.debug(f"{log_prompt} - Finished, stdout: {RL if stdout else ''}{stdout}")
logger.debug(f"{log_prompt} - Finished, stderr: {RL if stderr else ''}{stderr}")
if stderr or exit_code:
logger.error(f"{log_prompt}- Finished, errors found")
if stderr:
return FAIL, stderr
else:
return FAIL, stdout
logger.info(f"{log_prompt} - Successfully finished")
return SUCCESS, ""
@timer(group_name='lint')
def _run_mypy(self, py_num: str, lint_files: List[Path]) -> Tuple[int, str]:
""" Run mypy in pack dir
Args:
py_num(str): The python version in use
lint_files(List[Path]): file to perform lint
Returns:
int: 0 on successful else 1, errors
str: Bandit errors
"""
log_prompt = f"{self._pack_name} - Mypy"
logger.info(f"{log_prompt} - Start")
with add_typing_module(lint_files=lint_files, python_version=py_num):
mypy_command = build_mypy_command(files=lint_files, version=py_num, content_repo=self._content_repo)
stdout, stderr, exit_code = run_command_os(command=mypy_command, cwd=self._pack_abs_dir)
logger.debug(f"{log_prompt} - Finished, exit-code: {exit_code}")
logger.debug(f"{log_prompt} - Finished, stdout: {RL if stdout else ''}{stdout}")
logger.debug(f"{log_prompt} - Finished, stderr: {RL if stderr else ''}{stderr}")
if stderr or exit_code:
logger.error(f"{log_prompt}- Finished, errors found")
if stderr:
return FAIL, stderr
else:
return FAIL, stdout
logger.info(f"{log_prompt} - Successfully finished")
return SUCCESS, ""
@timer(group_name='lint')
def _run_vulture(self, py_num: str, lint_files: List[Path]) -> Tuple[int, str]:
""" Run mypy in pack dir
Args:
py_num(str): The python version in use
lint_files(List[Path]): file to perform lint
Returns:
int: 0 on successful else 1, errors
str: Vulture errors
"""
log_prompt = f"{self._pack_name} - Vulture"
logger.info(f"{log_prompt} - Start")
stdout, stderr, exit_code = run_command_os(command=build_vulture_command(files=lint_files,
pack_path=self._pack_abs_dir,
py_num=py_num),
cwd=self._pack_abs_dir)
logger.debug(f"{log_prompt} - Finished, exit-code: {exit_code}")
logger.debug(f"{log_prompt} - Finished, stdout: {RL if stdout else ''}{stdout}")
logger.debug(f"{log_prompt} - Finished, stderr: {RL if stderr else ''}{stderr}")
if stderr or exit_code:
logger.error(f"{log_prompt}- Finished, errors found")
if stderr:
return FAIL, stderr
else:
return FAIL, stdout
logger.info(f"{log_prompt} - Successfully finished")
return SUCCESS, ""
@timer(group_name='lint')
def _run_lint_on_docker_image(self, no_pylint: bool, no_test: bool, no_pwsh_analyze: bool, no_pwsh_test: bool,
keep_container: bool, test_xml: str, no_coverage: bool):
""" Run lint check on docker image
Args:
no_pylint(bool): Whether to skip pylint
no_test(bool): Whether to skip pytest
no_pwsh_analyze(bool): Whether to skip powershell code analyzing
no_pwsh_test(bool): whether to skip powershell tests
keep_container(bool): Whether to keep the test container
test_xml(str): Path for saving pytest xml results
no_coverage(bool): Run pytest without coverage report
"""
for image in self._facts["images"]:
# Docker image status - visualize
status = {
"image": image[0],
"image_errors": "",
"pylint_errors": "",
"pytest_errors": "",
"pytest_json": {},
"pwsh_analyze_errors": "",
"pwsh_test_errors": ""
}
# Creating image if pylint specified or found tests and tests specified
image_id = ""
errors = ""
for trial in range(2):
image_id, errors = self._docker_image_create(docker_base_image=image)
if not errors:
break
if image_id and not errors:
# Set image creation status
for check in ["pylint", "pytest", "pwsh_analyze", "pwsh_test"]:
exit_code = SUCCESS
output = ""
for trial in range(2):
if self._pkg_lint_status["pack_type"] == TYPE_PYTHON:
# Perform pylint
if not no_pylint and check == "pylint" and self._facts["lint_files"]:
exit_code, output = self._docker_run_pylint(test_image=image_id,
keep_container=keep_container)
# Perform pytest
elif not no_test and self._facts["test"] and check == "pytest":
exit_code, output, test_json = self._docker_run_pytest(test_image=image_id,
keep_container=keep_container,
test_xml=test_xml,
no_coverage=no_coverage)
status["pytest_json"] = test_json
elif self._pkg_lint_status["pack_type"] == TYPE_PWSH:
# Perform powershell analyze
if not no_pwsh_analyze and check == "pwsh_analyze" and self._facts["lint_files"]:
exit_code, output = self._docker_run_pwsh_analyze(test_image=image_id,
keep_container=keep_container)
# Perform powershell test
elif not no_pwsh_test and check == "pwsh_test":
exit_code, output = self._docker_run_pwsh_test(test_image=image_id,
keep_container=keep_container)
# If lint check perfrom and failed on reason related to enviorment will run twice,
# But it failing in second time it will count as test failure.
if (exit_code == RERUN and trial == 1) or exit_code == FAIL or exit_code == SUCCESS:
if exit_code in [RERUN, FAIL]:
self._pkg_lint_status["exit_code"] |= EXIT_CODES[check]
status[f"{check}_errors"] = output
break
else:
status["image_errors"] = str(errors)
self._pkg_lint_status["exit_code"] += EXIT_CODES["image"]
# Add image status to images
self._pkg_lint_status["images"].append(status)
def _docker_login(self) -> bool:
""" Login to docker-hub using environment variables:
1. DOCKERHUB_USER - User for docker hub.
2. DOCKERHUB_PASSWORD - Password for docker-hub.
Used in Circle-CI for pushing into repo devtestdemisto
Returns:
bool: True if logged in successfully.
"""
docker_user = os.getenv('DOCKERHUB_USER')
docker_pass = os.getenv('DOCKERHUB_PASSWORD')
try:
self._docker_client.login(username=docker_user,
password=<PASSWORD>,
registry="https://index.docker.io/v1")
return self._docker_client.ping()
except docker.errors.APIError:
return False
@timer(group_name='lint')
def _docker_image_create(self, docker_base_image: List[Any]) -> Tuple[str, str]:
""" Create docker image:
1. Installing 'build base' if required in alpine images version - https://wiki.alpinelinux.org/wiki/GCC
2. Installing pypi packs - if only pylint required - only pylint installed otherwise all pytest and pylint
installed, packages which being install can be found in path demisto_sdk/commands/lint/dev_envs
3. The docker image build done by Dockerfile template located in
demisto_sdk/commands/lint/templates/dockerfile.jinja2
Args:
docker_base_image(list): docker image to use as base for installing dev deps and python version.
Returns:
str, str. image name to use and errors string.
"""
log_prompt = f"{self._pack_name} - Image create"
# Get requirements file for image
requirements = []
if docker_base_image[1] != -1:
py_ver = parse(docker_base_image[1]).major
if py_ver == 2:
requirements = self._req_2
elif py_ver == 3:
requirements = self._req_3
# Using DockerFile template
pip_requirements = requirements + self._facts["additional_requirements"]
# Trying to pull image based on dockerfile hash, will check if something changed
errors = ""
identifier = hashlib.md5("\n".join(sorted(pip_requirements)).encode("utf-8")).hexdigest()
test_image_name = f'devtest{docker_base_image[0]}-{identifier}'
test_image = None
try:
logger.info(f"{log_prompt} - Trying to pull existing image {test_image_name}")
test_image = Docker.pull_image(test_image_name)
except (docker.errors.APIError, docker.errors.ImageNotFound):
logger.info(f"{log_prompt} - Unable to find image {test_image_name}")
# Creatng new image if existing image isn't found
if not test_image:
logger.info(
f"{log_prompt} - Creating image based on {docker_base_image[0]} - Could take 2-3 minutes at first "
f"time")
try:
Docker.create_image(docker_base_image[0], test_image_name, container_type=self._pkg_lint_status["pack_type"],
install_packages=pip_requirements)
if self._docker_hub_login:
for _ in range(2):
try:
self._docker_client.images.push(test_image_name)
logger.info(f"{log_prompt} - Image {test_image_name} pushed to repository")
break
except (requests.exceptions.ConnectionError, urllib3.exceptions.ReadTimeoutError,
requests.exceptions.ReadTimeout):
logger.info(f"{log_prompt} - Unable to push image {test_image_name} to repository")
except (docker.errors.BuildError, docker.errors.APIError, Exception) as e:
logger.critical(f"{log_prompt} - Build errors occurred {e}")
errors = str(e)
return test_image_name, errors
def _docker_remove_container(self, container_name: str):
try:
container = self._docker_client.containers.get(container_name)
container.remove(force=True)
except docker.errors.NotFound:
pass
except requests.exceptions.ChunkedEncodingError as err:
# see: https://github.com/docker/docker-py/issues/2696#issuecomment-721322548
if platform.system() != 'Darwin' or 'Connection broken' not in str(err):
raise
@timer(group_name='lint')
def _docker_run_pylint(self, test_image: str, keep_container: bool) -> Tuple[int, str]:
""" Run Pylint in created test image
Args:
test_image(str): test image id/name
keep_container(bool): True if to keep container after execution finished
Returns:
int: 0 on successful, errors 1, need to retry 2
str: Container log
"""
log_prompt = f'{self._pack_name} - Pylint - Image {test_image}'
logger.info(f"{log_prompt} - Start")
container_name = f"{self._pack_name}-pylint"
# Check if previous run left container a live if it do, we remove it
self._docker_remove_container(container_name)
# Run container
exit_code = SUCCESS
output = ""
try:
container: docker.models.containers.Container = Docker.create_container(
name=container_name,
image=test_image,
command=[
build_pylint_command(
self._facts["lint_files"], docker_version=self._facts.get('python_version'))
],
user=f"{os.getuid()}:4000",
files_to_push=[('/devwork', self._pack_abs_dir)],
environment=self._facts["env_vars"],
)
container.start()
stream_docker_container_output(container.logs(stream=True))
# wait for container to finish
container_status = container.wait(condition="exited")
# Get container exit code
container_exit_code = container_status.get("StatusCode")
# Getting container logs
container_log = container.logs().decode("utf-8")
logger.info(f"{log_prompt} - exit-code: {container_exit_code}")
if container_exit_code in [1, 2]:
# 1-fatal message issued
# 2-Error message issued
exit_code = FAIL
output = container_log
logger.error(f"{log_prompt} - Finished, errors found")
elif container_exit_code in [4, 8, 16]:
# 4-Warning message issued
# 8-refactor message issued
# 16-convention message issued
logger.info(f"{log_prompt} - Successfully finished - warnings found")
exit_code = SUCCESS
elif container_exit_code == 32:
# 32-usage error
logger.critical(f"{log_prompt} - Finished - Usage error")
exit_code = RERUN
else:
logger.info(f"{log_prompt} - Successfully finished")
# Keeping container if needed or remove it
if keep_container:
print(f"{log_prompt} - container name {container_name}")
container.commit(repository=container_name.lower(), tag="pylint")
else:
try:
container.remove(force=True)
except docker.errors.NotFound as e:
logger.critical(f"{log_prompt} - Unable to delete container - {e}")
except Exception as e:
logger.exception(f"{log_prompt} - Unable to run pylint")
exit_code = RERUN
output = str(e)
return exit_code, output
@timer(group_name='lint')
def _docker_run_pytest(self, test_image: str, keep_container: bool, test_xml: str, no_coverage: bool = False) -> Tuple[int, str, dict]:
""" Run Pytest in created test image
Args:
test_image(str): Test image id/name
keep_container(bool): True if to keep container after execution finished
test_xml(str): Xml saving path
no_coverage(bool): Run pytest without coverage report
Returns:
int: 0 on successful, errors 1, need to retry 2
str: Unit test json report
"""
log_prompt = f'{self._pack_name} - Pytest - Image {test_image}'
logger.info(f"{log_prompt} - Start")
container_name = f"{self._pack_name}-pytest"
# Check if previous run left container a live if it does, Remove it
self._docker_remove_container(container_name)
# Collect tests
exit_code = SUCCESS
output = ''
test_json = {}
try:
# Running pytest container
cov = '' if no_coverage else self._pack_abs_dir.stem
uid = os.getuid() or 4000
logger.debug(f'{log_prompt} - user uid for running lint/test: {uid}') # lgtm[py/clear-text-logging-sensitive-data]
container = Docker.create_container(
name=container_name, image=test_image, user=f"{uid}:4000",
command=[build_pytest_command(test_xml=test_xml, json=True, cov=cov)],
environment=self._facts["env_vars"], files_to_push=[('/devwork', self._pack_abs_dir)]
)
container.start()
stream_docker_container_output(container.logs(stream=True))
# Waiting for container to be finished
container_status: dict = container.wait(condition="exited")
# Getting container exit code
container_exit_code = container_status.get("StatusCode")
# Getting container logs
logger.info(f"{log_prompt} - exit-code: {container_exit_code}")
if container_exit_code in [0, 1, 2, 5]:
# 0-All tests passed
# 1-Tests were collected and run but some of the tests failed
# 2-Test execution was interrupted by the user
# 5-No tests were collected
if test_xml:
test_data_xml = get_file_from_container(container_obj=container,
container_path="/devwork/report_pytest.xml")
xml_apth = Path(test_xml) / f'{self._pack_name}_pytest.xml'
with open(file=xml_apth, mode='bw') as f:
f.write(test_data_xml) # type: ignore
if not no_coverage:
cov_file_path = os.path.join(self._pack_abs_dir, '.coverage')
cov_data = get_file_from_container(container_obj=container,
container_path="/devwork/.coverage")
cov_data = cov_data if isinstance(cov_data, bytes) else cov_data.encode()
with open(cov_file_path, 'wb') as coverage_file:
coverage_file.write(cov_data)
coverage_report_editor(cov_file_path, os.path.join(self._pack_abs_dir, f'{self._pack_abs_dir.stem}.py'))
test_json = json.loads(get_file_from_container(container_obj=container,
container_path="/devwork/report_pytest.json",
encoding="utf-8"))
for test in test_json.get('report', {}).get("tests"):
if test.get("call", {}).get("longrepr"):
test["call"]["longrepr"] = test["call"]["longrepr"].split('\n')
if container_exit_code in [0, 5]:
logger.info(f"{log_prompt} - Successfully finished")
exit_code = SUCCESS
elif container_exit_code in [2]:
output = container.logs().decode('utf-8')
exit_code = FAIL
else:
logger.error(f"{log_prompt} - Finished, errors found")
exit_code = FAIL
elif container_exit_code in [3, 4]:
# 3-Internal error happened while executing tests
# 4-pytest command line usage error
logger.critical(f"{log_prompt} - Usage error")
exit_code = RERUN
output = container.logs().decode('utf-8')
else:
# Any other container exit code
logger.error(f"{log_prompt} - Finished, docker container error found ({container_exit_code})")
exit_code = FAIL
# Remove container if not needed
if keep_container:
print(f"{log_prompt} - Container name {container_name}")
container.commit(repository=container_name.lower(), tag="pytest")
else:
try:
container.remove(force=True)
except docker.errors.NotFound as e:
logger.critical(f"{log_prompt} - Unable to remove container {e}")
except (docker.errors.ImageNotFound, docker.errors.APIError) as e:
logger.critical(f"{log_prompt} - Unable to run pytest container {e}")
exit_code = RERUN
return exit_code, output, test_json
def _docker_run_pwsh_analyze(self, test_image: str, keep_container: bool) -> Tuple[int, str]:
""" Run Powershell code analyze in created test image
Args:
test_image(str): test image id/name
keep_container(bool): True if to keep container after excution finished
Returns:
int: 0 on successful, errors 1, need to retry 2
str: Container log
"""
log_prompt = f'{self._pack_name} - Powershell analyze - Image {test_image}'
logger.info(f"{log_prompt} - Start")
container_name = f"{self._pack_name}-pwsh-analyze"
# Check if previous run left container a live if it do, we remove it
container: docker.models.containers.Container
try:
container = self._docker_client.containers.get(container_name)
container.remove(force=True)
except docker.errors.NotFound:
pass
# Run container
exit_code = SUCCESS
output = ""
try:
uid = os.getuid() or 4000
logger.debug(f'{log_prompt} - user uid for running lint/test: {uid}') # lgtm[py/clear-text-logging-sensitive-data]
container = Docker.create_container(name=container_name, image=test_image,
user=f"{uid}:4000", environment=self._facts["env_vars"],
files_to_push=[('/devwork', self._pack_abs_dir)],
command=build_pwsh_analyze_command(
self._facts["lint_files"][0])
)
container.start()
stream_docker_container_output(container.logs(stream=True))
# wait for container to finish
container_status = container.wait(condition="exited")
# Get container exit code
container_exit_code = container_status.get("StatusCode")
# Getting container logs
container_log = container.logs().decode("utf-8")
logger.info(f"{log_prompt} - exit-code: {container_exit_code}")
if container_exit_code:
# 1-fatal message issued
# 2-Error message issued
logger.error(f"{log_prompt} - Finished, errors found")
output = container_log
exit_code = FAIL
else:
logger.info(f"{log_prompt} - Successfully finished")
# Keeping container if needed or remove it
if keep_container:
print(f"{log_prompt} - container name {container_name}")
container.commit(repository=container_name.lower(), tag="pwsh_analyze")
else:
try:
container.remove(force=True)
except docker.errors.NotFound as e:
logger.critical(f"{log_prompt} - Unable to delete container - {e}")
except (docker.errors.ImageNotFound, docker.errors.APIError, requests.exceptions.ReadTimeout) as e:
logger.critical(f"{log_prompt} - Unable to run powershell test - {e}")
exit_code = RERUN
return exit_code, output
def _update_support_level(self):
pack_dir = self._pack_abs_dir.parent if self._pack_abs_dir.parts[-1] == INTEGRATIONS_DIR else \
self._pack_abs_dir.parent.parent
pack_meta_content: Dict = json.load((pack_dir / PACKS_PACK_META_FILE_NAME).open())
self._facts['support_level'] = pack_meta_content.get('support')
if self._facts['support_level'] == 'partner' and pack_meta_content.get('Certification'):
self._facts['support_level'] = 'certified partner'
def _docker_run_pwsh_test(self, test_image: str, keep_container: bool) -> Tuple[int, str]:
""" Run Powershell tests in created test image
Args:
test_image(str): test image id/name
keep_container(bool): True if to keep container after excution finished
Returns:
int: 0 on successful, errors 1, neet to retry 2
str: Container log
"""
log_prompt = f'{self._pack_name} - Powershell test - Image {test_image}'
logger.info(f"{log_prompt} - Start")
container_name = f"{self._pack_name}-pwsh-test"
# Check if previous run left container a live if it do, we remove it
self._docker_remove_container(container_name)
# Run container
exit_code = SUCCESS
output = ""
try:
uid = os.getuid() or 4000
logger.debug(f'{log_prompt} - user uid for running lint/test: {uid}') # lgtm[py/clear-text-logging-sensitive-data]
container: docker.models.containers.Container = Docker.create_container(
files_to_push=[('/devwork', self._pack_abs_dir)],
name=container_name, image=test_image, command=build_pwsh_test_command(),
user=f"{uid}:4000", environment=self._facts["env_vars"])
container.start()
stream_docker_container_output(container.logs(stream=True))
# wait for container to finish
container_status = container.wait(condition="exited")
# Get container exit code
container_exit_code = container_status.get("StatusCode")
# Getting container logs
container_log = container.logs().decode("utf-8")
logger.info(f"{log_prompt} - exit-code: {container_exit_code}")
if container_exit_code:
# 1-fatal message issued
# 2-Error message issued
logger.error(f"{log_prompt} - Finished, errors found")
output = container_log
exit_code = FAIL
else:
logger.info(f"{log_prompt} - Successfully finished")
# Keeping container if needed or remove it
if keep_container:
print(f"{log_prompt} - container name {container_name}")
container.commit(repository=container_name.lower(), tag='pwsh_test')
else:
try:
container.remove(force=True)
except docker.errors.NotFound as e:
logger.critical(f"{log_prompt} - Unable to delete container - {e}")
except (docker.errors.ImageNotFound, docker.errors.APIError, requests.exceptions.ReadTimeout) as e:
logger.critical(f"{log_prompt} - Unable to run powershell test - {e}")
exit_code = RERUN
return exit_code, output
def _get_commands_list(self, script_obj: dict):
""" Get all commands from yml file of the pack
Args:
script_obj(dict): the script section of the yml file.
Returns:
list: list of all commands
"""
commands_list = []
try:
commands_obj = script_obj.get('commands', {})
for command in commands_obj:
commands_list.append(command.get('name', ''))
except Exception:
logger.debug("Failed getting the commands from the yml file")
return commands_list
| [
1,
396,
6850,
29928,
3017,
9741,
13,
5215,
3509,
13,
5215,
6608,
1982,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
7481,
13,
5215,
9637,
1627,
13,
3166,
19229,
1053,
3139,
29892,
360,
919,
29892,
2391,
29892,
28379,
29892,
12603,
552,
13,
13,
5215,
10346,
13,
5215,
10346,
29889,
12523,
13,
5215,
10346,
29889,
9794,
29889,
1285,
475,
414,
13,
5215,
6315,
13,
5215,
7274,
29889,
11739,
29879,
13,
5215,
3142,
1982,
29941,
29889,
11739,
29879,
13,
3166,
4870,
6751,
29889,
3259,
1053,
6088,
13,
3166,
28678,
4352,
29889,
2084,
1982,
1053,
405,
11787,
3040,
29892,
10802,
13,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
9435,
29889,
3075,
1934,
1053,
313,
1177,
4330,
14345,
8098,
29903,
29918,
9464,
29892,
13,
462,
462,
462,
259,
349,
11375,
29903,
29918,
29925,
11375,
29918,
2303,
6040,
29918,
7724,
29918,
5813,
29892,
13,
462,
462,
462,
259,
323,
6959,
29918,
29925,
29956,
7068,
29892,
323,
6959,
29918,
20055,
4690,
1164,
29897,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
9435,
29889,
3179,
9306,
1053,
4663,
29918,
4598,
29892,
612,
23956,
29918,
4598,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
9435,
29889,
9346,
414,
1053,
12237,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
9435,
29889,
8504,
1053,
313,
657,
29918,
497,
29918,
14695,
29918,
8346,
29892,
13,
462,
462,
1669,
1065,
29918,
6519,
29918,
359,
29897,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
27854,
29889,
26381,
29918,
16409,
1053,
313,
13,
1678,
2048,
29918,
4980,
277,
29918,
6519,
29892,
2048,
29918,
29888,
433,
446,
29947,
29918,
6519,
29892,
2048,
29918,
1357,
2272,
29918,
6519,
29892,
13,
1678,
2048,
29918,
29886,
29893,
845,
29918,
24209,
911,
29918,
6519,
29892,
2048,
29918,
29886,
29893,
845,
29918,
1688,
29918,
6519,
29892,
2048,
29918,
2272,
27854,
29918,
6519,
29892,
13,
1678,
2048,
29918,
2272,
1688,
29918,
6519,
29892,
2048,
29918,
29894,
12896,
29918,
6519,
29892,
2048,
29918,
29916,
578,
279,
29918,
29880,
1639,
29918,
6519,
29897,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
27854,
29889,
14695,
29918,
20907,
1053,
20868,
13,
3166,
1261,
5137,
29918,
15348,
29889,
26381,
29889,
27854,
29889,
3952,
6774,
1053,
313,
5746,
1806,
29918,
16524,
29903,
29892,
13515,
6227,
29892,
390,
1001,
3904,
29892,
390,
29931,
29892,
13,
462,
462,
1669,
20134,
26925,
29892,
399,
25614,
29892,
13,
462,
462,
1669,
788,
29918,
7050,
29918,
27854,
29918,
5325,
29892,
13,
462,
462,
1669,
788,
29918,
1017,
15702,
29918,
5453,
29892,
13,
462,
462,
1669,
23746,
29918,
12276,
29918,
15204,
29892,
13,
462,
462,
1669,
679,
29918,
1445,
29918,
3166,
29918,
7611,
29892,
13,
462,
462,
1669,
679,
29918,
4691,
29918,
3259,
29918,
3166,
29918,
3027,
29892,
13,
462,
462,
1669,
282,
2904,
524,
29918,
8582,
29892,
13,
462,
462,
1669,
6219,
29918,
25442,
886,
29918,
12523,
29892,
13,
462,
462,
1669,
4840,
29918,
14695,
29918,
7611,
29918,
4905,
29897,
13,
13,
3126,
353,
4663,
29918,
4598,
580,
13,
13,
13,
29937,
29871,
29941,
29899,
5499,
6263,
9741,
13,
13,
29937,
9959,
9741,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
877,
2310,
5137,
29899,
15348,
1495,
13,
13,
13,
1990,
365,
1639,
29901,
13,
1678,
9995,
365,
1639,
1304,
304,
5039,
403,
301,
524,
1899,
373,
2323,
3577,
13,
13,
4706,
6212,
5026,
29901,
13,
9651,
4870,
29918,
3972,
29898,
2605,
1125,
18744,
304,
1065,
301,
524,
373,
29889,
13,
9651,
2793,
29918,
20095,
29898,
2605,
1125,
11786,
13761,
1203,
310,
2793,
13761,
29889,
13,
9651,
12428,
29918,
29906,
29898,
1761,
1125,
11780,
363,
10346,
773,
3017,
29906,
29889,
13,
9651,
12428,
29918,
29941,
29898,
1761,
1125,
11780,
363,
10346,
773,
3017,
29941,
29889,
13,
9651,
10346,
29918,
10599,
29898,
11227,
1125,
29871,
26460,
10346,
6012,
17809,
491,
10346,
29899,
15348,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4870,
29918,
3972,
29901,
10802,
29892,
2793,
29918,
20095,
29901,
10802,
29892,
12428,
29918,
29941,
29901,
1051,
29892,
12428,
29918,
29906,
29901,
1051,
29892,
10346,
29918,
10599,
29901,
6120,
29892,
13,
462,
10346,
29918,
15619,
29901,
938,
1125,
13,
4706,
1583,
3032,
7971,
29918,
29941,
353,
12428,
29918,
29941,
13,
4706,
1583,
3032,
7971,
29918,
29906,
353,
12428,
29918,
29906,
13,
4706,
1583,
3032,
3051,
29918,
20095,
353,
2793,
29918,
20095,
13,
4706,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
353,
4870,
29918,
3972,
13,
4706,
1583,
3032,
4058,
29918,
978,
353,
6213,
13,
4706,
1583,
29889,
14695,
29918,
15619,
353,
10346,
29918,
15619,
13,
4706,
396,
20868,
3132,
2069,
13,
4706,
565,
10346,
29918,
10599,
29901,
13,
9651,
1583,
3032,
14695,
29918,
4645,
29901,
10346,
29889,
29928,
8658,
4032,
353,
10346,
29889,
3166,
29918,
6272,
29898,
15619,
29922,
14695,
29918,
15619,
29897,
13,
9651,
1583,
3032,
14695,
29918,
29882,
431,
29918,
7507,
353,
1583,
3032,
14695,
29918,
7507,
580,
13,
4706,
396,
26748,
29879,
22229,
11211,
4870,
301,
524,
322,
1243,
13,
4706,
1583,
3032,
17028,
29879,
29901,
360,
919,
29961,
710,
29892,
3139,
29962,
353,
426,
13,
9651,
376,
8346,
1115,
19997,
13,
9651,
376,
4691,
29918,
3259,
1115,
29871,
29900,
29892,
13,
9651,
376,
6272,
29918,
16908,
1115,
24335,
13,
9651,
376,
1688,
1115,
7700,
29892,
13,
9651,
376,
27854,
29918,
5325,
1115,
19997,
13,
9651,
376,
5924,
29918,
5563,
1115,
6213,
29892,
13,
9651,
376,
275,
29918,
5426,
29918,
21094,
1115,
7700,
29892,
13,
9651,
376,
27854,
29918,
348,
27958,
29918,
5325,
1115,
19997,
13,
9651,
376,
1202,
3245,
29918,
12277,
1860,
1115,
19997,
13,
9651,
376,
14695,
29918,
10599,
1115,
10346,
29918,
10599,
29892,
13,
9651,
376,
275,
29918,
2154,
1115,
7700,
29892,
13,
9651,
376,
26381,
1115,
6213,
29892,
13,
4706,
500,
13,
4706,
396,
18744,
301,
524,
4660,
1203,
448,
7604,
675,
372,
13,
4706,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
29901,
360,
919,
353,
426,
13,
9651,
376,
15865,
1115,
6213,
29892,
13,
9651,
376,
4058,
29918,
1853,
1115,
6213,
29892,
13,
9651,
376,
2084,
1115,
851,
29898,
1311,
3032,
3051,
29918,
20095,
511,
13,
9651,
376,
12523,
1115,
19997,
13,
9651,
376,
8346,
1115,
19997,
13,
9651,
376,
29888,
433,
446,
29947,
29918,
12523,
1115,
6213,
29892,
13,
9651,
376,
29990,
6156,
1718,
29918,
29880,
1639,
29918,
12523,
1115,
6213,
29892,
13,
9651,
376,
4980,
277,
29918,
12523,
1115,
6213,
29892,
13,
9651,
376,
1357,
2272,
29918,
12523,
1115,
6213,
29892,
13,
9651,
376,
29894,
12896,
29918,
12523,
1115,
6213,
29892,
13,
9651,
376,
29888,
433,
446,
29947,
29918,
25442,
886,
1115,
6213,
29892,
13,
9651,
376,
29990,
6156,
1718,
29918,
29880,
1639,
29918,
25442,
886,
1115,
6213,
29892,
13,
9651,
376,
4980,
277,
29918,
25442,
886,
1115,
6213,
29892,
13,
9651,
376,
1357,
2272,
29918,
25442,
886,
1115,
6213,
29892,
13,
9651,
376,
29894,
12896,
29918,
25442,
886,
1115,
6213,
29892,
13,
9651,
376,
13322,
29918,
401,
1115,
20134,
26925,
29892,
13,
9651,
376,
27392,
29918,
401,
1115,
20134,
26925,
29892,
13,
4706,
500,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
1065,
29918,
3359,
29918,
8318,
29898,
1311,
29892,
694,
29918,
29888,
433,
446,
29947,
29901,
6120,
29892,
694,
29918,
4980,
277,
29901,
6120,
29892,
694,
29918,
1357,
2272,
29901,
6120,
29892,
694,
29918,
2272,
27854,
29901,
6120,
29892,
694,
29918,
29894,
12896,
29901,
6120,
29892,
13,
462,
308,
694,
29918,
29916,
578,
279,
29918,
29880,
1639,
29901,
6120,
29892,
694,
29918,
29886,
29893,
845,
29918,
24209,
911,
29901,
6120,
29892,
694,
29918,
29886,
29893,
845,
29918,
1688,
29901,
6120,
29892,
694,
29918,
1688,
29901,
6120,
29892,
10585,
29901,
9657,
29892,
13,
462,
308,
3013,
29918,
7611,
29901,
6120,
29892,
1243,
29918,
3134,
29901,
851,
29892,
694,
29918,
11911,
482,
29901,
6120,
29897,
1599,
9657,
29901,
13,
4706,
9995,
7525,
301,
524,
322,
6987,
373,
2323,
3577,
13,
4706,
27313,
292,
278,
1101,
29901,
13,
632,
29896,
29889,
7525,
278,
301,
524,
373,
6570,
448,
17422,
446,
29947,
29892,
3719,
277,
29892,
590,
2272,
29889,
13,
632,
29906,
29889,
7525,
297,
3577,
10346,
448,
282,
2904,
524,
29892,
11451,
1688,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
694,
29918,
29888,
433,
446,
29947,
29898,
11227,
1125,
26460,
304,
14383,
17422,
446,
29947,
13,
9651,
694,
29918,
4980,
277,
29898,
11227,
1125,
26460,
304,
14383,
3719,
277,
13,
9651,
694,
29918,
1357,
2272,
29898,
11227,
1125,
26460,
304,
14383,
590,
2272,
13,
9651,
694,
29918,
29894,
12896,
29898,
11227,
1125,
26460,
304,
14383,
325,
12896,
13,
9651,
694,
29918,
2272,
27854,
29898,
11227,
1125,
26460,
304,
14383,
282,
2904,
524,
13,
9651,
694,
29918,
1688,
29898,
11227,
1125,
26460,
304,
14383,
11451,
1688,
13,
9651,
694,
29918,
29886,
29893,
845,
29918,
24209,
911,
29898,
11227,
1125,
26460,
304,
14383,
25532,
775,
29537,
292,
13,
9651,
694,
29918,
29886,
29893,
845,
29918,
1688,
29898,
11227,
1125,
3692,
304,
14383,
25532,
6987,
13,
9651,
10585,
29898,
8977,
1125,
15419,
7606,
10585,
304,
26694,
297,
4870,
2224,
313,
18877,
6004,
11980,
29889,
2272,
2992,
29897,
13,
9651,
3013,
29918,
7611,
29898,
11227,
1125,
26460,
304,
3013,
278,
1243,
5639,
13,
9651,
1243,
29918,
3134,
29898,
710,
1125,
10802,
363,
14238,
11451,
1688,
4903,
2582,
13,
9651,
694,
29918,
11911,
482,
29898,
11227,
1125,
7525,
11451,
1688,
1728,
23746,
3461,
13,
13,
4706,
16969,
29901,
13,
9651,
9657,
29901,
301,
524,
322,
1243,
599,
4660,
29892,
282,
9415,
4660,
29897,
13,
4706,
9995,
13,
4706,
396,
402,
1624,
2472,
363,
301,
524,
1423,
2472,
13,
4706,
14383,
353,
1583,
3032,
29887,
1624,
29918,
17028,
29879,
29898,
7576,
29897,
13,
4706,
396,
960,
451,
3017,
4870,
448,
14383,
4870,
13,
4706,
565,
14383,
29901,
13,
9651,
736,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
13,
4706,
1018,
29901,
13,
9651,
396,
5976,
403,
9619,
7606,
2066,
297,
4870,
2224,
448,
363,
901,
5235,
24808,
278,
3030,
8455,
365,
524,
10547,
13,
9651,
411,
788,
29918,
7050,
29918,
27854,
29918,
5325,
29898,
3051,
29918,
20095,
29922,
1311,
3032,
3051,
29918,
20095,
29892,
29871,
396,
1134,
29901,
11455,
13,
462,
462,
1678,
4870,
29918,
2084,
29922,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29892,
13,
462,
462,
1678,
301,
524,
29918,
5325,
29922,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
12436,
13,
462,
462,
1678,
10585,
29922,
7576,
29892,
13,
462,
462,
1678,
4870,
29918,
1853,
29922,
1311,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1125,
13,
18884,
396,
7525,
301,
524,
1423,
373,
3495,
448,
17422,
446,
29947,
29892,
3719,
277,
29892,
590,
2272,
13,
18884,
565,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
20055,
4690,
1164,
29901,
13,
462,
1678,
1583,
3032,
3389,
29918,
27854,
29918,
262,
29918,
3069,
29898,
1217,
29918,
29888,
433,
446,
29947,
29922,
1217,
29918,
29888,
433,
446,
29947,
29892,
13,
462,
462,
965,
694,
29918,
4980,
277,
29922,
1217,
29918,
4980,
277,
29892,
13,
462,
462,
965,
694,
29918,
1357,
2272,
29922,
1217,
29918,
1357,
2272,
29892,
13,
462,
462,
965,
694,
29918,
29894,
12896,
29922,
1217,
29918,
29894,
12896,
29892,
13,
462,
462,
965,
694,
29918,
29916,
578,
279,
29918,
29880,
1639,
29922,
1217,
29918,
29916,
578,
279,
29918,
29880,
1639,
29897,
13,
13,
18884,
396,
7525,
301,
524,
322,
1243,
1423,
373,
4870,
10346,
1967,
13,
18884,
565,
1583,
3032,
17028,
29879,
3366,
14695,
29918,
10599,
3108,
29901,
13,
462,
1678,
1583,
3032,
3389,
29918,
27854,
29918,
265,
29918,
14695,
29918,
3027,
29898,
1217,
29918,
2272,
27854,
29922,
1217,
29918,
2272,
27854,
29892,
13,
462,
462,
462,
259,
694,
29918,
1688,
29922,
1217,
29918,
1688,
29892,
13,
462,
462,
462,
259,
694,
29918,
29886,
29893,
845,
29918,
24209,
911,
29922,
1217,
29918,
29886,
29893,
845,
29918,
24209,
911,
29892,
13,
462,
462,
462,
259,
694,
29918,
29886,
29893,
845,
29918,
1688,
29922,
1217,
29918,
29886,
29893,
845,
29918,
1688,
29892,
13,
462,
462,
462,
259,
3013,
29918,
7611,
29922,
17462,
29918,
7611,
29892,
13,
462,
462,
462,
259,
1243,
29918,
3134,
29922,
1688,
29918,
3134,
29892,
13,
462,
462,
462,
259,
694,
29918,
11911,
482,
29922,
1217,
29918,
11911,
482,
29897,
13,
4706,
5174,
8960,
408,
429,
29901,
13,
9651,
4589,
353,
285,
29915,
29912,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
6177,
10016,
29916,
6021,
18409,
3682,
29901,
426,
710,
29898,
735,
2915,
29915,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
3127,
1836,
29243,
29901,
426,
15003,
1627,
29889,
4830,
29918,
735,
29883,
580,
27195,
13,
9651,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
12523,
16862,
4397,
29898,
3127,
29897,
13,
9651,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
1839,
13322,
29918,
401,
2033,
4619,
13515,
6227,
13,
4706,
736,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
29887,
1624,
29918,
17028,
29879,
29898,
1311,
29892,
10585,
29901,
9657,
29897,
1599,
6120,
29901,
13,
4706,
9995,
402,
1624,
292,
17099,
1048,
278,
3577,
448,
3017,
1873,
29892,
10346,
4558,
29892,
2854,
10346,
1967,
29892,
343,
828,
13755,
13,
4706,
826,
3174,
29901,
13,
9651,
10585,
29898,
8977,
1125,
4321,
9619,
7606,
10585,
304,
367,
11455,
297,
301,
524,
1423,
13,
13,
4706,
16969,
29901,
13,
9651,
6120,
29901,
1894,
293,
1218,
565,
304,
6773,
4340,
470,
451,
29892,
565,
7700,
6876,
10480,
29892,
15785,
6773,
29889,
13,
4706,
9995,
13,
4706,
396,
21223,
363,
282,
9415,
343,
8807,
13,
4706,
343,
828,
29918,
1445,
29901,
28379,
29961,
2605,
29962,
353,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
23705,
4197,
29878,
29915,
10521,
25162,
742,
364,
29915,
10521,
21053,
742,
364,
29915,
29991,
29930,
348,
2164,
10521,
21053,
7464,
13449,
29922,
8186,
29954,
3040,
29897,
13,
4706,
565,
451,
343,
828,
29918,
1445,
29901,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29913,
448,
28551,
3262,
694,
343,
8807,
934,
1476,
426,
21053,
29918,
1445,
27195,
13,
9651,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
12523,
16862,
4397,
877,
2525,
519,
304,
1284,
343,
828,
934,
297,
3577,
1495,
13,
9651,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
1018,
29901,
13,
18884,
343,
828,
29918,
1445,
353,
2446,
29898,
21053,
29918,
1445,
29897,
13,
9651,
5174,
22303,
13463,
362,
29901,
13,
18884,
736,
5852,
13,
4706,
396,
3617,
4870,
1024,
13,
4706,
1583,
3032,
4058,
29918,
978,
353,
343,
828,
29918,
1445,
29889,
303,
331,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
26748,
29879,
29908,
13,
4706,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
15865,
3108,
353,
343,
828,
29918,
1445,
29889,
303,
331,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
5293,
343,
8807,
934,
426,
21053,
29918,
1445,
27195,
13,
4706,
396,
1459,
2976,
4870,
343,
8807,
448,
297,
1797,
304,
11539,
565,
1423,
4312,
13,
4706,
1018,
29901,
13,
13,
9651,
2471,
29918,
5415,
29901,
360,
919,
353,
6571,
13,
9651,
343,
828,
29918,
5415,
29901,
360,
919,
353,
612,
23956,
29918,
4598,
2141,
1359,
29898,
21053,
29918,
1445,
29897,
13,
9651,
565,
338,
8758,
29898,
21053,
29918,
5415,
29892,
9657,
1125,
13,
18884,
2471,
29918,
5415,
353,
343,
828,
29918,
5415,
29889,
657,
877,
2154,
742,
426,
1800,
565,
338,
8758,
29898,
21053,
29918,
5415,
29889,
657,
877,
2154,
5477,
9657,
29897,
1683,
343,
828,
29918,
5415,
13,
9651,
1583,
3032,
17028,
29879,
1839,
275,
29918,
2154,
2033,
353,
5852,
565,
525,
4081,
29879,
29915,
297,
343,
828,
29918,
1445,
29889,
20895,
1683,
7700,
13,
9651,
1583,
3032,
17028,
29879,
1839,
275,
29918,
5426,
29918,
21094,
2033,
353,
2471,
29918,
5415,
29889,
657,
877,
5426,
27795,
1495,
13,
9651,
1583,
3032,
17028,
29879,
1839,
26381,
2033,
353,
1583,
3032,
657,
29918,
26381,
29918,
1761,
29898,
2154,
29918,
5415,
29897,
13,
9651,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
353,
2471,
29918,
5415,
29889,
657,
877,
1853,
1495,
13,
4706,
5174,
313,
2283,
17413,
2392,
29892,
10663,
2392,
29892,
7670,
2392,
1125,
13,
9651,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
12523,
16862,
4397,
877,
2525,
519,
304,
6088,
3577,
343,
828,
1495,
13,
9651,
736,
5852,
13,
4706,
396,
736,
694,
1423,
4312,
565,
451,
3017,
4870,
13,
4706,
565,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
451,
297,
313,
11116,
29918,
20055,
4690,
1164,
29892,
323,
6959,
29918,
29925,
29956,
7068,
1125,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
28551,
3262,
2861,
304,
451,
5132,
29892,
12265,
27456,
3577,
448,
18744,
338,
29908,
13,
462,
4706,
285,
29908,
426,
1311,
3032,
15865,
29918,
27854,
29918,
4882,
1839,
4058,
29918,
1853,
2033,
27195,
13,
9651,
736,
5852,
13,
4706,
396,
20868,
4558,
13,
4706,
565,
1583,
3032,
17028,
29879,
3366,
14695,
29918,
10599,
3108,
29901,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
349,
913,
292,
10346,
4558,
29892,
508,
2125,
701,
304,
29871,
29896,
29899,
29906,
6233,
565,
451,
4864,
12430,
16521,
13,
9651,
1583,
3032,
17028,
29879,
3366,
8346,
3108,
353,
5519,
3027,
29892,
448,
29896,
29962,
363,
1967,
297,
679,
29918,
497,
29918,
14695,
29918,
8346,
29898,
2154,
29918,
5415,
29922,
2154,
29918,
5415,
4638,
13,
9651,
396,
402,
1624,
5177,
3651,
363,
10346,
8225,
13,
9651,
1583,
3032,
17028,
29879,
3366,
6272,
29918,
16908,
3108,
353,
426,
13,
18884,
376,
8426,
1115,
2897,
29889,
657,
6272,
703,
8426,
613,
7700,
511,
13,
18884,
376,
2287,
29924,
9047,
29949,
29918,
29931,
10192,
29918,
14474,
29918,
29907,
1001,
9375,
1115,
2897,
29889,
657,
6272,
877,
2287,
29924,
9047,
29949,
29918,
29931,
10192,
29918,
14474,
29918,
29907,
1001,
9375,
742,
376,
3582,
1159,
13,
9651,
500,
13,
4706,
301,
524,
29918,
5325,
353,
731,
580,
13,
4706,
396,
26748,
29879,
363,
3017,
4870,
13,
4706,
565,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
20055,
4690,
1164,
29901,
13,
9651,
1583,
3032,
5504,
29918,
5924,
29918,
5563,
580,
13,
9651,
565,
1583,
3032,
17028,
29879,
3366,
14695,
29918,
10599,
3108,
29901,
13,
18884,
396,
24162,
3017,
1873,
515,
10346,
1967,
448,
1147,
9215,
565,
451,
2854,
10346,
1967,
13252,
13,
18884,
363,
1967,
297,
1583,
3032,
17028,
29879,
3366,
8346,
3108,
29901,
13,
462,
1678,
11451,
29918,
1949,
29901,
851,
353,
679,
29918,
4691,
29918,
3259,
29918,
3166,
29918,
3027,
29898,
3027,
29922,
3027,
29961,
29900,
1402,
11815,
29922,
1311,
29889,
14695,
29918,
15619,
29897,
13,
462,
1678,
1967,
29961,
29896,
29962,
353,
11451,
29918,
1949,
13,
462,
1678,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
26748,
29879,
448,
426,
3027,
29961,
29900,
12258,
448,
5132,
426,
2272,
29918,
1949,
27195,
13,
462,
1678,
565,
451,
1583,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
3108,
29901,
13,
462,
4706,
1583,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
3108,
353,
11451,
29918,
1949,
13,
18884,
396,
5399,
292,
6514,
334,
1688,
29930,
4864,
297,
3577,
13,
18884,
1583,
3032,
17028,
29879,
3366,
1688,
3108,
353,
5852,
565,
2446,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
23705,
4197,
29878,
29915,
1688,
29918,
10521,
2272,
742,
364,
29915,
29930,
29918,
1688,
29889,
2272,
2033,
511,
13,
462,
462,
462,
259,
6213,
29897,
1683,
7700,
13,
18884,
565,
1583,
3032,
17028,
29879,
3366,
1688,
3108,
29901,
13,
462,
1678,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4321,
29879,
1476,
1159,
13,
18884,
1683,
29901,
13,
462,
1678,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4321,
29879,
451,
1476,
1159,
13,
18884,
396,
402,
1624,
3577,
11780,
15685,
1243,
29899,
12277,
1860,
29889,
2272,
934,
13,
18884,
1243,
29918,
12277,
1860,
353,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
847,
525,
1688,
29899,
12277,
1860,
29889,
3945,
29915,
13,
18884,
565,
1243,
29918,
12277,
1860,
29889,
9933,
7295,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
5684,
29918,
7971,
353,
1243,
29918,
12277,
1860,
29889,
949,
29918,
726,
29898,
22331,
2433,
9420,
29899,
29947,
2824,
17010,
2141,
5451,
28909,
29876,
1495,
13,
462,
4706,
1583,
3032,
17028,
29879,
3366,
1202,
3245,
29918,
12277,
1860,
16862,
21843,
29898,
1202,
3245,
29918,
7971,
29897,
13,
462,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
3462,
3245,
3577,
349,
1478,
29875,
9741,
1476,
448,
426,
1202,
3245,
29918,
7971,
27195,
13,
462,
1678,
5174,
313,
2283,
17413,
2392,
29892,
10663,
2392,
1125,
13,
462,
4706,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
12523,
16862,
4397,
877,
2525,
519,
304,
6088,
1243,
29899,
12277,
1860,
29889,
3945,
297,
3577,
1495,
13,
9651,
25342,
451,
1583,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
3108,
29901,
13,
18884,
396,
679,
3017,
1873,
515,
343,
828,
13,
18884,
282,
948,
398,
353,
525,
29941,
29889,
29955,
29915,
565,
313,
2154,
29918,
5415,
29889,
657,
877,
1491,
1853,
742,
525,
4691,
29941,
1495,
1275,
525,
4691,
29941,
1495,
1683,
525,
29906,
29889,
29955,
29915,
13,
18884,
1583,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
3108,
353,
282,
948,
398,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
5293,
3017,
1873,
515,
343,
828,
29901,
426,
29886,
948,
398,
27195,
13,
9651,
396,
3617,
301,
524,
2066,
13,
9651,
301,
524,
29918,
5325,
353,
731,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
23705,
29898,
3366,
10521,
2272,
613,
376,
29991,
1649,
2344,
26914,
2272,
613,
376,
29991,
10521,
7050,
12436,
13,
462,
462,
462,
268,
13449,
29922,
8186,
29954,
3040,
876,
13,
4706,
396,
26748,
29879,
363,
12265,
27456,
4870,
13,
4706,
25342,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
29925,
29956,
7068,
29901,
13,
9651,
396,
3617,
301,
524,
2066,
13,
9651,
301,
524,
29918,
5325,
353,
731,
29898,
13,
18884,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
23705,
29898,
3366,
10521,
567,
29896,
613,
376,
29991,
29930,
24376,
29889,
567,
29896,
613,
376,
18877,
6004,
21472,
16037,
29889,
567,
29896,
613,
376,
2310,
391,
290,
1698,
29889,
567,
29896,
11838,
1402,
13,
462,
462,
4706,
13449,
29922,
8186,
29954,
3040,
876,
13,
13,
4706,
396,
3462,
13103,
6004,
304,
278,
301,
524,
12747,
13,
4706,
565,
525,
9435,
2974,
29915,
297,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
978,
29889,
13609,
7295,
13,
9651,
396,
12265,
27456,
13,
9651,
565,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
29925,
29956,
7068,
29901,
13,
18884,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
353,
518,
2605,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
847,
525,
18877,
6004,
21472,
16037,
29889,
567,
29896,
1495,
29962,
13,
9651,
396,
5132,
13,
9651,
25342,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
20055,
4690,
1164,
29901,
13,
18884,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
353,
518,
2605,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
847,
525,
18877,
6004,
11980,
29889,
2272,
1495,
29962,
13,
4706,
1683,
29901,
13,
9651,
1243,
29918,
7576,
353,
426,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
847,
3883,
29889,
978,
363,
3883,
297,
10585,
29889,
8149,
28296,
13,
9651,
301,
524,
29918,
5325,
353,
301,
524,
29918,
5325,
29889,
29881,
17678,
29898,
1688,
29918,
7576,
29897,
13,
9651,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
353,
1051,
29898,
27854,
29918,
5325,
29897,
13,
13,
4706,
565,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
29901,
13,
9651,
1583,
3032,
5992,
29918,
5559,
17281,
29918,
5325,
29898,
1188,
29918,
14032,
415,
29897,
13,
9651,
363,
301,
524,
29918,
1445,
297,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
29901,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
365,
524,
934,
426,
27854,
29918,
1445,
27195,
13,
4706,
1683,
29901,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
365,
524,
2066,
451,
1476,
1159,
13,
13,
4706,
396,
15154,
2066,
393,
526,
297,
6315,
17281,
13,
13,
4706,
1583,
3032,
5451,
29918,
27854,
29918,
5325,
580,
13,
4706,
736,
7700,
13,
13,
1678,
822,
903,
5992,
29918,
5559,
17281,
29918,
5325,
29898,
1311,
29892,
1480,
29918,
14032,
415,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
28551,
3262,
2066,
393,
7087,
6315,
17281,
15038,
29889,
13,
4706,
826,
3174,
29901,
13,
9651,
1480,
29918,
14032,
415,
29898,
710,
1125,
1480,
9508,
1347,
13,
13,
4706,
16969,
29901,
13,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
13761,
353,
6315,
29889,
5612,
29877,
29898,
1311,
3032,
3051,
29918,
20095,
29897,
13,
9651,
2066,
29918,
517,
29918,
17281,
353,
13761,
29889,
647,
4395,
29898,
1311,
3032,
17028,
29879,
1839,
27854,
29918,
5325,
11287,
13,
9651,
363,
934,
297,
2066,
29918,
517,
29918,
17281,
29901,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
28551,
3262,
6315,
17281,
934,
426,
1445,
27195,
13,
9651,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
353,
518,
2084,
363,
2224,
297,
1583,
3032,
17028,
29879,
1839,
27854,
29918,
5325,
2033,
565,
2224,
451,
297,
2066,
29918,
517,
29918,
17281,
29962,
13,
13,
4706,
5174,
313,
5559,
29889,
13919,
28712,
11481,
2392,
29892,
6315,
29889,
3782,
29903,
987,
2605,
2392,
1125,
13,
9651,
17927,
29889,
8382,
703,
3782,
6315,
17281,
2066,
338,
3625,
1159,
13,
13,
1678,
822,
903,
5451,
29918,
27854,
29918,
5325,
29898,
1311,
1125,
13,
4706,
9995,
15154,
5190,
1243,
2066,
515,
903,
17028,
29879,
1839,
27854,
29918,
5325,
2033,
322,
1925,
964,
1009,
1914,
1051,
903,
17028,
29879,
1839,
27854,
29918,
348,
27958,
29918,
5325,
2033,
13,
4706,
910,
338,
1363,
451,
599,
301,
9466,
881,
367,
2309,
373,
443,
27958,
2066,
29889,
13,
4706,
9995,
13,
4706,
301,
524,
29918,
5325,
29918,
1761,
353,
3509,
29889,
24535,
8552,
29898,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
20068,
13,
4706,
363,
301,
524,
29918,
1445,
297,
301,
524,
29918,
5325,
29918,
1761,
29901,
13,
9651,
565,
301,
524,
29918,
1445,
29889,
978,
29889,
27382,
2541,
877,
1688,
29918,
1495,
470,
301,
524,
29918,
1445,
29889,
978,
29889,
1975,
2541,
877,
29918,
1688,
29889,
2272,
29374,
13,
18884,
1583,
3032,
17028,
29879,
1839,
27854,
29918,
348,
27958,
29918,
5325,
13359,
4397,
29898,
27854,
29918,
1445,
29897,
13,
18884,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
16862,
5992,
29898,
27854,
29918,
1445,
29897,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
27854,
29918,
262,
29918,
3069,
29898,
1311,
29892,
694,
29918,
29888,
433,
446,
29947,
29901,
6120,
29892,
694,
29918,
4980,
277,
29901,
6120,
29892,
694,
29918,
1357,
2272,
29901,
6120,
29892,
694,
29918,
29894,
12896,
29901,
6120,
29892,
13,
462,
3986,
694,
29918,
29916,
578,
279,
29918,
29880,
1639,
29901,
6120,
1125,
13,
4706,
9995,
7525,
301,
524,
1423,
373,
3495,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
694,
29918,
29888,
433,
446,
29947,
29898,
11227,
1125,
26460,
304,
14383,
17422,
446,
29947,
29889,
13,
9651,
694,
29918,
4980,
277,
29898,
11227,
1125,
26460,
304,
14383,
3719,
277,
29889,
13,
9651,
694,
29918,
1357,
2272,
29898,
11227,
1125,
26460,
304,
14383,
590,
2272,
29889,
13,
9651,
694,
29918,
29894,
12896,
29898,
11227,
1125,
26460,
304,
14383,
478,
12896,
29889,
13,
4706,
9995,
13,
4706,
9177,
353,
5159,
13,
4706,
1059,
353,
5159,
13,
4706,
916,
353,
5159,
13,
4706,
6876,
29918,
401,
29901,
938,
353,
29871,
29900,
13,
4706,
363,
301,
524,
29918,
3198,
297,
6796,
29888,
433,
446,
29947,
613,
376,
29990,
6156,
1718,
29918,
29880,
1639,
613,
376,
4980,
277,
613,
376,
1357,
2272,
613,
376,
29894,
12896,
3108,
29901,
13,
9651,
6876,
29918,
401,
353,
20134,
26925,
13,
9651,
1962,
353,
5124,
13,
9651,
565,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
470,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
348,
27958,
29918,
5325,
3108,
29901,
13,
18884,
565,
301,
524,
29918,
3198,
1275,
376,
29888,
433,
446,
29947,
29908,
322,
451,
694,
29918,
29888,
433,
446,
29947,
29901,
13,
462,
1678,
17422,
446,
29947,
29918,
27854,
29918,
5325,
353,
3509,
29889,
24535,
8552,
29898,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
20068,
13,
462,
1678,
396,
565,
727,
526,
443,
27958,
29889,
2272,
769,
591,
723,
1065,
17422,
446,
29947,
373,
963,
2086,
29889,
13,
462,
1678,
565,
1583,
3032,
17028,
29879,
1839,
27854,
29918,
348,
27958,
29918,
5325,
2033,
29901,
13,
462,
4706,
17422,
446,
29947,
29918,
27854,
29918,
5325,
29889,
21843,
29898,
1311,
3032,
17028,
29879,
1839,
27854,
29918,
348,
27958,
29918,
5325,
11287,
13,
462,
1678,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
3389,
29918,
29888,
433,
446,
29947,
29898,
2272,
29918,
1949,
29922,
1311,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
12436,
13,
462,
462,
462,
308,
301,
524,
29918,
5325,
29922,
29888,
433,
446,
29947,
29918,
27854,
29918,
5325,
29897,
13,
13,
9651,
565,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
29901,
13,
18884,
565,
301,
524,
29918,
3198,
1275,
376,
29990,
6156,
1718,
29918,
29880,
1639,
29908,
322,
451,
694,
29918,
29916,
578,
279,
29918,
29880,
1639,
29901,
13,
462,
1678,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
3389,
29918,
29916,
578,
279,
29918,
29880,
1639,
29898,
2272,
29918,
1949,
29922,
1311,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
12436,
13,
462,
462,
462,
1669,
301,
524,
29918,
5325,
29922,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
20068,
13,
18884,
25342,
301,
524,
29918,
3198,
1275,
376,
4980,
277,
29908,
322,
451,
694,
29918,
4980,
277,
29901,
13,
462,
1678,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
3389,
29918,
4980,
277,
29898,
27854,
29918,
5325,
29922,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
20068,
13,
13,
18884,
25342,
301,
524,
29918,
3198,
1275,
376,
1357,
2272,
29908,
322,
451,
694,
29918,
1357,
2272,
29901,
13,
462,
1678,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
3389,
29918,
1357,
2272,
29898,
2272,
29918,
1949,
29922,
1311,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
12436,
13,
462,
462,
462,
539,
301,
524,
29918,
5325,
29922,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
20068,
13,
18884,
25342,
301,
524,
29918,
3198,
1275,
376,
29894,
12896,
29908,
322,
451,
694,
29918,
29894,
12896,
29901,
13,
462,
1678,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
3389,
29918,
29894,
12896,
29898,
2272,
29918,
1949,
29922,
1311,
3032,
17028,
29879,
3366,
4691,
29918,
3259,
12436,
13,
462,
462,
462,
3986,
301,
524,
29918,
5325,
29922,
1311,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
20068,
13,
13,
9651,
396,
1423,
363,
738,
6876,
775,
916,
1135,
29871,
29900,
13,
9651,
565,
6876,
29918,
401,
29901,
13,
18884,
1059,
29892,
9177,
29892,
916,
353,
6219,
29918,
25442,
886,
29918,
12523,
29898,
4905,
29897,
13,
9651,
565,
6876,
29918,
401,
322,
9177,
29901,
13,
18884,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
27392,
29918,
401,
3108,
891,
29922,
8528,
1806,
29918,
16524,
29903,
29961,
27854,
29918,
3198,
29962,
13,
18884,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
29961,
29888,
29908,
29912,
27854,
29918,
3198,
2403,
25442,
886,
3108,
353,
6634,
29876,
1642,
7122,
29898,
27392,
29897,
13,
9651,
565,
6876,
29918,
401,
669,
13515,
6227,
29901,
13,
18884,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
13322,
29918,
401,
3108,
891,
29922,
8528,
1806,
29918,
16524,
29903,
29961,
27854,
29918,
3198,
29962,
13,
18884,
396,
565,
278,
1059,
892,
23892,
5149,
408,
896,
1369,
411,
382,
13,
18884,
565,
1059,
29901,
13,
462,
1678,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
29961,
29888,
29908,
29912,
27854,
29918,
3198,
2403,
12523,
3108,
353,
6634,
29876,
1642,
7122,
29898,
2704,
29897,
13,
18884,
396,
565,
727,
892,
4436,
541,
896,
437,
451,
1369,
411,
382,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
29961,
29888,
29908,
29912,
27854,
29918,
3198,
2403,
12523,
3108,
353,
6634,
29876,
1642,
7122,
29898,
1228,
29897,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
29888,
433,
446,
29947,
29898,
1311,
29892,
11451,
29918,
1949,
29901,
851,
29892,
301,
524,
29918,
5325,
29901,
2391,
29961,
2605,
2314,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
390,
6948,
17422,
446,
29947,
297,
4870,
4516,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
11451,
29918,
1949,
29898,
710,
1125,
450,
3017,
1873,
297,
671,
13,
9651,
301,
524,
29918,
5325,
29898,
1293,
29961,
2605,
29962,
1125,
934,
304,
2189,
301,
524,
13,
13,
4706,
16969,
29901,
13,
965,
938,
29901,
259,
29900,
373,
9150,
1683,
29871,
29896,
29892,
4436,
13,
965,
851,
29901,
5158,
277,
4436,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
383,
433,
446,
29947,
29908,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
27591,
29892,
380,
20405,
29892,
6876,
29918,
401,
353,
1065,
29918,
6519,
29918,
359,
29898,
6519,
29922,
4282,
29918,
29888,
433,
446,
29947,
29918,
6519,
29898,
27854,
29918,
5325,
29892,
11451,
29918,
1949,
511,
13,
462,
462,
462,
259,
274,
9970,
29922,
1311,
3032,
3051,
29918,
20095,
29897,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
6876,
29899,
401,
29901,
426,
13322,
29918,
401,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
27591,
29901,
426,
2241,
565,
27591,
1683,
6629,
1157,
25393,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
380,
20405,
29901,
426,
2241,
565,
380,
20405,
1683,
6629,
1157,
303,
20405,
27195,
13,
4706,
565,
380,
20405,
470,
6876,
29918,
401,
29901,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
7402,
4231,
3276,
29892,
4436,
1476,
1159,
13,
9651,
565,
380,
20405,
29901,
13,
18884,
736,
13515,
6227,
29892,
380,
20405,
13,
9651,
1683,
29901,
13,
18884,
736,
13515,
6227,
29892,
27591,
13,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
13,
4706,
736,
20134,
26925,
29892,
5124,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
29916,
578,
279,
29918,
29880,
1639,
29898,
1311,
29892,
11451,
29918,
1949,
29901,
851,
29892,
301,
524,
29918,
5325,
29901,
2391,
29961,
2605,
2314,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
390,
6948,
1060,
4977,
272,
301,
1639,
297,
4870,
4516,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
301,
524,
29918,
5325,
29898,
1293,
29961,
2605,
29962,
1125,
934,
304,
2189,
301,
524,
13,
13,
4706,
16969,
29901,
13,
965,
938,
29901,
259,
29900,
373,
9150,
1683,
29871,
29896,
29892,
4436,
13,
965,
851,
29901,
1060,
578,
279,
301,
1639,
4436,
13,
4706,
9995,
13,
4706,
4660,
353,
20134,
26925,
13,
4706,
13515,
6227,
29918,
20055,
29931,
10192,
353,
29871,
29900,
29890,
29896,
29900,
13,
4706,
411,
282,
2904,
524,
29918,
8582,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
1125,
13,
9651,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
1060,
6156,
1718,
365,
1639,
29908,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
9651,
590,
6272,
353,
2897,
29889,
21813,
29889,
8552,
580,
13,
9651,
565,
590,
6272,
29889,
657,
877,
20055,
4690,
1164,
10145,
29374,
13,
18884,
590,
6272,
1839,
20055,
4690,
1164,
10145,
2033,
4619,
525,
11283,
718,
851,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
13,
9651,
1683,
29901,
13,
18884,
590,
6272,
1839,
20055,
4690,
1164,
10145,
2033,
353,
851,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
13,
9651,
565,
1583,
3032,
17028,
29879,
1839,
275,
29918,
5426,
29918,
21094,
2033,
29901,
13,
18884,
590,
6272,
1839,
29931,
1164,
14345,
3904,
29940,
4214,
2033,
353,
525,
5574,
29915,
13,
13,
9651,
11451,
29918,
369,
353,
6088,
29898,
2272,
29918,
1949,
467,
21355,
13,
9651,
565,
11451,
29918,
369,
529,
29871,
29941,
29901,
13,
18884,
590,
6272,
1839,
20055,
29906,
2033,
353,
525,
5574,
29915,
13,
9651,
590,
6272,
1839,
275,
29918,
2154,
2033,
353,
851,
29898,
1311,
3032,
17028,
29879,
1839,
275,
29918,
2154,
11287,
13,
9651,
396,
408,
1060,
578,
279,
1423,
261,
338,
263,
282,
2904,
524,
7079,
322,
6057,
408,
760,
310,
282,
2904,
524,
775,
29892,
591,
508,
451,
1209,
6389,
304,
372,
29889,
13,
9651,
396,
408,
263,
1121,
591,
508,
671,
278,
8829,
24987,
408,
263,
679,
1582,
29889,
13,
9651,
590,
6272,
1839,
26381,
2033,
353,
13420,
4286,
7122,
4197,
710,
29898,
20461,
29897,
363,
21268,
297,
1583,
3032,
17028,
29879,
1839,
26381,
2033,
2314,
320,
13,
18884,
565,
1583,
3032,
17028,
29879,
1839,
26381,
2033,
1683,
6629,
13,
9651,
27591,
29892,
380,
20405,
29892,
6876,
29918,
401,
353,
1065,
29918,
6519,
29918,
359,
29898,
13,
18884,
1899,
29922,
4282,
29918,
29916,
578,
279,
29918,
29880,
1639,
29918,
6519,
29898,
27854,
29918,
5325,
29892,
11451,
29918,
1949,
29892,
1583,
3032,
17028,
29879,
29889,
657,
877,
5924,
29918,
5563,
742,
525,
3188,
1495,
511,
13,
18884,
274,
9970,
29922,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29892,
8829,
29922,
1357,
6272,
29897,
13,
4706,
565,
6876,
29918,
401,
669,
13515,
6227,
29918,
20055,
29931,
10192,
29901,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
7402,
4231,
3276,
29892,
4436,
1476,
1159,
13,
9651,
4660,
353,
13515,
6227,
13,
4706,
565,
6876,
29918,
401,
669,
399,
25614,
29901,
13,
9651,
17927,
29889,
27392,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
18116,
1476,
1159,
13,
9651,
565,
451,
4660,
29901,
13,
18884,
4660,
353,
399,
25614,
13,
4706,
396,
565,
282,
2904,
524,
1258,
451,
1065,
322,
10672,
6876,
775,
756,
1063,
4133,
515,
1065,
844,
28486,
13,
4706,
25342,
6876,
29918,
401,
669,
13515,
6227,
29901,
13,
9651,
4660,
353,
13515,
6227,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
3185,
950,
1060,
6156,
1718,
301,
1639,
1059,
448,
1159,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
14846,
3402,
27591,
29901,
426,
2241,
565,
27591,
1683,
6629,
1157,
25393,
27195,
13,
9651,
396,
363,
17737,
544,
29879,
607,
526,
451,
19412,
515,
5835,
322,
437,
451,
505,
282,
2904,
524,
297,
2906,
29899,
12277,
1860,
29899,
2272,
29906,
29889,
13,
9651,
565,
2897,
29889,
21813,
29889,
657,
877,
8426,
29374,
13,
18884,
27591,
353,
376,
29990,
578,
279,
301,
1639,
1033,
451,
1065,
29892,
3529,
10366,
515,
5835,
29908,
13,
9651,
1683,
29901,
13,
18884,
27591,
353,
376,
29990,
578,
279,
301,
1639,
1033,
451,
1065,
29892,
3113,
1207,
1854,
366,
505,
29908,
320,
13,
462,
308,
376,
278,
5181,
349,
2904,
524,
1873,
363,
1716,
11451,
29906,
322,
11451,
29941,
29908,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
7402,
4231,
3276,
29892,
4436,
1476,
1159,
13,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
6876,
29899,
401,
29901,
426,
13322,
29918,
401,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
27591,
29901,
426,
2241,
565,
27591,
1683,
6629,
1157,
25393,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
380,
20405,
29901,
426,
2241,
565,
380,
20405,
1683,
6629,
1157,
303,
20405,
27195,
13,
13,
4706,
565,
451,
6876,
29918,
401,
29901,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
13,
4706,
736,
4660,
29892,
27591,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
4980,
277,
29898,
1311,
29892,
301,
524,
29918,
5325,
29901,
2391,
29961,
2605,
2314,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
7525,
3719,
277,
297,
4870,
4516,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
301,
524,
29918,
5325,
29898,
1293,
29961,
2605,
29962,
1125,
934,
304,
2189,
301,
524,
13,
13,
4706,
16969,
29901,
13,
965,
938,
29901,
259,
29900,
373,
9150,
1683,
29871,
29896,
29892,
4436,
13,
965,
851,
29901,
5158,
277,
4436,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
5158,
277,
29908,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
27591,
29892,
380,
20405,
29892,
6876,
29918,
401,
353,
1065,
29918,
6519,
29918,
359,
29898,
6519,
29922,
4282,
29918,
4980,
277,
29918,
6519,
29898,
27854,
29918,
5325,
511,
13,
462,
462,
462,
259,
274,
9970,
29922,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
6876,
29899,
401,
29901,
426,
13322,
29918,
401,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
27591,
29901,
426,
2241,
565,
27591,
1683,
6629,
1157,
25393,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
380,
20405,
29901,
426,
2241,
565,
380,
20405,
1683,
6629,
1157,
303,
20405,
27195,
13,
4706,
565,
380,
20405,
470,
6876,
29918,
401,
29901,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
7402,
4231,
3276,
29892,
4436,
1476,
1159,
13,
9651,
565,
380,
20405,
29901,
13,
18884,
736,
13515,
6227,
29892,
380,
20405,
13,
9651,
1683,
29901,
13,
18884,
736,
13515,
6227,
29892,
27591,
13,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
13,
4706,
736,
20134,
26925,
29892,
5124,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
1357,
2272,
29898,
1311,
29892,
11451,
29918,
1949,
29901,
851,
29892,
301,
524,
29918,
5325,
29901,
2391,
29961,
2605,
2314,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
7525,
590,
2272,
297,
4870,
4516,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
11451,
29918,
1949,
29898,
710,
1125,
450,
3017,
1873,
297,
671,
13,
9651,
301,
524,
29918,
5325,
29898,
1293,
29961,
2605,
29962,
1125,
934,
304,
2189,
301,
524,
13,
13,
4706,
16969,
29901,
13,
965,
938,
29901,
259,
29900,
373,
9150,
1683,
29871,
29896,
29892,
4436,
13,
965,
851,
29901,
5158,
277,
4436,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
341,
1478,
29891,
29908,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
411,
788,
29918,
1017,
15702,
29918,
5453,
29898,
27854,
29918,
5325,
29922,
27854,
29918,
5325,
29892,
3017,
29918,
3259,
29922,
2272,
29918,
1949,
1125,
13,
9651,
590,
2272,
29918,
6519,
353,
2048,
29918,
1357,
2272,
29918,
6519,
29898,
5325,
29922,
27854,
29918,
5325,
29892,
1873,
29922,
2272,
29918,
1949,
29892,
2793,
29918,
20095,
29922,
1311,
3032,
3051,
29918,
20095,
29897,
13,
9651,
27591,
29892,
380,
20405,
29892,
6876,
29918,
401,
353,
1065,
29918,
6519,
29918,
359,
29898,
6519,
29922,
1357,
2272,
29918,
6519,
29892,
274,
9970,
29922,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
6876,
29899,
401,
29901,
426,
13322,
29918,
401,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
27591,
29901,
426,
2241,
565,
27591,
1683,
6629,
1157,
25393,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
380,
20405,
29901,
426,
2241,
565,
380,
20405,
1683,
6629,
1157,
303,
20405,
27195,
13,
4706,
565,
380,
20405,
470,
6876,
29918,
401,
29901,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
7402,
4231,
3276,
29892,
4436,
1476,
1159,
13,
9651,
565,
380,
20405,
29901,
13,
18884,
736,
13515,
6227,
29892,
380,
20405,
13,
9651,
1683,
29901,
13,
18884,
736,
13515,
6227,
29892,
27591,
13,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
13,
4706,
736,
20134,
26925,
29892,
5124,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
29894,
12896,
29898,
1311,
29892,
11451,
29918,
1949,
29901,
851,
29892,
301,
524,
29918,
5325,
29901,
2391,
29961,
2605,
2314,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
7525,
590,
2272,
297,
4870,
4516,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
11451,
29918,
1949,
29898,
710,
1125,
450,
3017,
1873,
297,
671,
13,
9651,
301,
524,
29918,
5325,
29898,
1293,
29961,
2605,
29962,
1125,
934,
304,
2189,
301,
524,
13,
13,
4706,
16969,
29901,
13,
965,
938,
29901,
29871,
29900,
373,
9150,
1683,
29871,
29896,
29892,
4436,
13,
965,
851,
29901,
478,
12896,
4436,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
478,
12896,
29908,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
27591,
29892,
380,
20405,
29892,
6876,
29918,
401,
353,
1065,
29918,
6519,
29918,
359,
29898,
6519,
29922,
4282,
29918,
29894,
12896,
29918,
6519,
29898,
5325,
29922,
27854,
29918,
5325,
29892,
13,
462,
462,
462,
462,
462,
4870,
29918,
2084,
29922,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29892,
13,
462,
462,
462,
462,
462,
11451,
29918,
1949,
29922,
2272,
29918,
1949,
511,
13,
462,
462,
462,
259,
274,
9970,
29922,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
6876,
29899,
401,
29901,
426,
13322,
29918,
401,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
27591,
29901,
426,
2241,
565,
27591,
1683,
6629,
1157,
25393,
27195,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
380,
20405,
29901,
426,
2241,
565,
380,
20405,
1683,
6629,
1157,
303,
20405,
27195,
13,
4706,
565,
380,
20405,
470,
6876,
29918,
401,
29901,
13,
9651,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
7402,
4231,
3276,
29892,
4436,
1476,
1159,
13,
9651,
565,
380,
20405,
29901,
13,
18884,
736,
13515,
6227,
29892,
380,
20405,
13,
9651,
1683,
29901,
13,
18884,
736,
13515,
6227,
29892,
27591,
13,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
13,
4706,
736,
20134,
26925,
29892,
5124,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
3389,
29918,
27854,
29918,
265,
29918,
14695,
29918,
3027,
29898,
1311,
29892,
694,
29918,
2272,
27854,
29901,
6120,
29892,
694,
29918,
1688,
29901,
6120,
29892,
694,
29918,
29886,
29893,
845,
29918,
24209,
911,
29901,
6120,
29892,
694,
29918,
29886,
29893,
845,
29918,
1688,
29901,
6120,
29892,
13,
462,
462,
29871,
3013,
29918,
7611,
29901,
6120,
29892,
1243,
29918,
3134,
29901,
851,
29892,
694,
29918,
11911,
482,
29901,
6120,
1125,
13,
4706,
9995,
7525,
301,
524,
1423,
373,
10346,
1967,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
694,
29918,
2272,
27854,
29898,
11227,
1125,
26460,
304,
14383,
282,
2904,
524,
13,
9651,
694,
29918,
1688,
29898,
11227,
1125,
26460,
304,
14383,
11451,
1688,
13,
9651,
694,
29918,
29886,
29893,
845,
29918,
24209,
911,
29898,
11227,
1125,
26460,
304,
14383,
25532,
775,
29537,
292,
13,
9651,
694,
29918,
29886,
29893,
845,
29918,
1688,
29898,
11227,
1125,
3692,
304,
14383,
25532,
6987,
13,
9651,
3013,
29918,
7611,
29898,
11227,
1125,
26460,
304,
3013,
278,
1243,
5639,
13,
9651,
1243,
29918,
3134,
29898,
710,
1125,
10802,
363,
14238,
11451,
1688,
4903,
2582,
13,
9651,
694,
29918,
11911,
482,
29898,
11227,
1125,
7525,
11451,
1688,
1728,
23746,
3461,
13,
13,
4706,
9995,
13,
4706,
363,
1967,
297,
1583,
3032,
17028,
29879,
3366,
8346,
3108,
29901,
13,
9651,
396,
20868,
1967,
4660,
448,
7604,
675,
13,
9651,
4660,
353,
426,
13,
18884,
376,
3027,
1115,
1967,
29961,
29900,
1402,
13,
18884,
376,
3027,
29918,
12523,
1115,
12633,
13,
18884,
376,
2272,
27854,
29918,
12523,
1115,
12633,
13,
18884,
376,
2272,
1688,
29918,
12523,
1115,
12633,
13,
18884,
376,
2272,
1688,
29918,
3126,
1115,
24335,
13,
18884,
376,
29886,
29893,
845,
29918,
24209,
911,
29918,
12523,
1115,
12633,
13,
18884,
376,
29886,
29893,
845,
29918,
1688,
29918,
12523,
1115,
5124,
13,
9651,
500,
13,
9651,
396,
26221,
1967,
565,
282,
2904,
524,
6790,
470,
1476,
6987,
322,
6987,
6790,
13,
9651,
1967,
29918,
333,
353,
5124,
13,
9651,
4436,
353,
5124,
13,
9651,
363,
14260,
297,
3464,
29898,
29906,
1125,
13,
18884,
1967,
29918,
333,
29892,
4436,
353,
1583,
3032,
14695,
29918,
3027,
29918,
3258,
29898,
14695,
29918,
3188,
29918,
3027,
29922,
3027,
29897,
13,
18884,
565,
451,
4436,
29901,
13,
462,
1678,
2867,
13,
13,
9651,
565,
1967,
29918,
333,
322,
451,
4436,
29901,
13,
18884,
396,
3789,
1967,
11265,
4660,
13,
18884,
363,
1423,
297,
6796,
2272,
27854,
613,
376,
2272,
1688,
613,
376,
29886,
29893,
845,
29918,
24209,
911,
613,
376,
29886,
29893,
845,
29918,
1688,
3108,
29901,
13,
462,
1678,
6876,
29918,
401,
353,
20134,
26925,
13,
462,
1678,
1962,
353,
5124,
13,
462,
1678,
363,
14260,
297,
3464,
29898,
29906,
1125,
13,
462,
4706,
565,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
20055,
4690,
1164,
29901,
13,
462,
9651,
396,
27313,
282,
2904,
524,
13,
462,
9651,
565,
451,
694,
29918,
2272,
27854,
322,
1423,
1275,
376,
2272,
27854,
29908,
322,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
29901,
13,
462,
18884,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
14695,
29918,
3389,
29918,
2272,
27854,
29898,
1688,
29918,
3027,
29922,
3027,
29918,
333,
29892,
13,
462,
462,
462,
462,
9651,
3013,
29918,
7611,
29922,
17462,
29918,
7611,
29897,
13,
462,
9651,
396,
27313,
11451,
1688,
13,
462,
9651,
25342,
451,
694,
29918,
1688,
322,
1583,
3032,
17028,
29879,
3366,
1688,
3108,
322,
1423,
1275,
376,
2272,
1688,
1115,
13,
462,
18884,
6876,
29918,
401,
29892,
1962,
29892,
1243,
29918,
3126,
353,
1583,
3032,
14695,
29918,
3389,
29918,
2272,
1688,
29898,
1688,
29918,
3027,
29922,
3027,
29918,
333,
29892,
13,
462,
462,
462,
462,
462,
539,
3013,
29918,
7611,
29922,
17462,
29918,
7611,
29892,
13,
462,
462,
462,
462,
462,
539,
1243,
29918,
3134,
29922,
1688,
29918,
3134,
29892,
13,
462,
462,
462,
462,
462,
539,
694,
29918,
11911,
482,
29922,
1217,
29918,
11911,
482,
29897,
13,
462,
18884,
4660,
3366,
2272,
1688,
29918,
3126,
3108,
353,
1243,
29918,
3126,
13,
462,
4706,
25342,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
3108,
1275,
323,
6959,
29918,
29925,
29956,
7068,
29901,
13,
462,
9651,
396,
27313,
25532,
27599,
13,
462,
9651,
565,
451,
694,
29918,
29886,
29893,
845,
29918,
24209,
911,
322,
1423,
1275,
376,
29886,
29893,
845,
29918,
24209,
911,
29908,
322,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
29901,
13,
462,
18884,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
14695,
29918,
3389,
29918,
29886,
29893,
845,
29918,
24209,
911,
29898,
1688,
29918,
3027,
29922,
3027,
29918,
333,
29892,
13,
462,
462,
462,
462,
462,
29871,
3013,
29918,
7611,
29922,
17462,
29918,
7611,
29897,
13,
462,
9651,
396,
27313,
25532,
1243,
13,
462,
9651,
25342,
451,
694,
29918,
29886,
29893,
845,
29918,
1688,
322,
1423,
1275,
376,
29886,
29893,
845,
29918,
1688,
1115,
13,
462,
18884,
6876,
29918,
401,
29892,
1962,
353,
1583,
3032,
14695,
29918,
3389,
29918,
29886,
29893,
845,
29918,
1688,
29898,
1688,
29918,
3027,
29922,
3027,
29918,
333,
29892,
13,
462,
462,
462,
462,
1669,
3013,
29918,
7611,
29922,
17462,
29918,
7611,
29897,
13,
462,
4706,
396,
960,
301,
524,
1423,
639,
3166,
322,
5229,
373,
2769,
4475,
304,
21061,
272,
358,
674,
1065,
8951,
29892,
13,
462,
4706,
396,
1205,
372,
17581,
297,
1473,
931,
372,
674,
2302,
408,
1243,
10672,
29889,
13,
462,
4706,
565,
313,
13322,
29918,
401,
1275,
390,
1001,
3904,
322,
14260,
1275,
29871,
29896,
29897,
470,
6876,
29918,
401,
1275,
13515,
6227,
470,
6876,
29918,
401,
1275,
20134,
26925,
29901,
13,
462,
9651,
565,
6876,
29918,
401,
297,
518,
29934,
1001,
3904,
29892,
13515,
6227,
5387,
13,
462,
18884,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
13322,
29918,
401,
3108,
891,
29922,
8528,
1806,
29918,
16524,
29903,
29961,
3198,
29962,
13,
462,
18884,
4660,
29961,
29888,
29908,
29912,
3198,
2403,
12523,
3108,
353,
1962,
13,
462,
9651,
2867,
13,
9651,
1683,
29901,
13,
18884,
4660,
3366,
3027,
29918,
12523,
3108,
353,
851,
29898,
12523,
29897,
13,
18884,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
13322,
29918,
401,
3108,
4619,
8528,
1806,
29918,
16524,
29903,
3366,
3027,
3108,
13,
13,
9651,
396,
3462,
1967,
4660,
304,
4558,
13,
9651,
1583,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
8346,
16862,
4397,
29898,
4882,
29897,
13,
13,
1678,
822,
903,
14695,
29918,
7507,
29898,
1311,
29897,
1599,
6120,
29901,
13,
4706,
9995,
19130,
304,
10346,
29899,
29882,
431,
773,
5177,
3651,
29901,
13,
462,
29896,
29889,
11662,
7077,
1001,
29950,
7466,
29918,
11889,
448,
4911,
363,
10346,
19766,
29889,
13,
462,
29906,
29889,
11662,
7077,
1001,
29950,
7466,
29918,
25711,
17013,
448,
25280,
363,
10346,
29899,
29882,
431,
29889,
13,
9651,
501,
8485,
297,
27927,
29899,
8426,
363,
27556,
964,
13761,
2906,
1688,
2310,
5137,
13,
13,
4706,
16969,
29901,
13,
9651,
6120,
29901,
5852,
565,
13817,
297,
8472,
29889,
13,
4706,
9995,
13,
4706,
10346,
29918,
1792,
353,
2897,
29889,
657,
6272,
877,
3970,
7077,
1001,
29950,
7466,
29918,
11889,
1495,
13,
4706,
10346,
29918,
3364,
353,
2897,
29889,
657,
6272,
877,
3970,
7077,
1001,
29950,
7466,
29918,
25711,
17013,
1495,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
14695,
29918,
4645,
29889,
7507,
29898,
6786,
29922,
14695,
29918,
1792,
29892,
13,
462,
462,
418,
4800,
29922,
29966,
25711,
17013,
10202,
13,
462,
462,
418,
21235,
543,
991,
597,
2248,
29889,
14695,
29889,
601,
29914,
29894,
29896,
1159,
13,
9651,
736,
1583,
3032,
14695,
29918,
4645,
29889,
15702,
580,
13,
4706,
5174,
10346,
29889,
12523,
29889,
8787,
2392,
29901,
13,
9651,
736,
7700,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
14695,
29918,
3027,
29918,
3258,
29898,
1311,
29892,
10346,
29918,
3188,
29918,
3027,
29901,
2391,
29961,
10773,
2314,
1599,
12603,
552,
29961,
710,
29892,
851,
5387,
13,
4706,
9995,
6204,
10346,
1967,
29901,
13,
632,
29896,
29889,
16052,
292,
525,
4282,
2967,
29915,
565,
3734,
297,
394,
26215,
4558,
1873,
448,
2045,
597,
4594,
29889,
284,
12687,
24446,
1314,
29889,
990,
29914,
4594,
29914,
29954,
4174,
13,
632,
29906,
29889,
16052,
292,
282,
1478,
29875,
4870,
29879,
448,
565,
871,
282,
2904,
524,
3734,
448,
871,
282,
2904,
524,
5130,
6467,
599,
11451,
1688,
322,
282,
2904,
524,
13,
1669,
5130,
29892,
9741,
607,
1641,
2601,
508,
367,
1476,
297,
2224,
1261,
5137,
29918,
15348,
29914,
26381,
29914,
27854,
29914,
3359,
29918,
264,
4270,
13,
632,
29941,
29889,
450,
10346,
1967,
2048,
2309,
491,
20868,
1445,
4472,
5982,
297,
13,
18884,
1261,
5137,
29918,
15348,
29914,
26381,
29914,
27854,
29914,
20943,
29914,
14695,
1445,
29889,
28789,
1764,
29906,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
10346,
29918,
3188,
29918,
3027,
29898,
1761,
1125,
10346,
1967,
304,
671,
408,
2967,
363,
15476,
2906,
316,
567,
322,
3017,
1873,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
851,
29892,
851,
29889,
1967,
1024,
304,
671,
322,
4436,
1347,
29889,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
7084,
1653,
29908,
13,
4706,
396,
3617,
11780,
934,
363,
1967,
13,
4706,
11780,
353,
5159,
13,
13,
4706,
565,
10346,
29918,
3188,
29918,
3027,
29961,
29896,
29962,
2804,
448,
29896,
29901,
13,
9651,
11451,
29918,
369,
353,
6088,
29898,
14695,
29918,
3188,
29918,
3027,
29961,
29896,
14664,
21355,
13,
9651,
565,
11451,
29918,
369,
1275,
29871,
29906,
29901,
13,
18884,
11780,
353,
1583,
3032,
7971,
29918,
29906,
13,
9651,
25342,
11451,
29918,
369,
1275,
29871,
29941,
29901,
13,
18884,
11780,
353,
1583,
3032,
7971,
29918,
29941,
13,
4706,
396,
5293,
20868,
2283,
4472,
13,
4706,
8450,
29918,
12277,
1860,
353,
11780,
718,
1583,
3032,
17028,
29879,
3366,
1202,
3245,
29918,
12277,
1860,
3108,
13,
4706,
396,
24428,
304,
8206,
1967,
2729,
373,
10346,
1445,
6608,
29892,
674,
1423,
565,
1554,
3939,
13,
4706,
4436,
353,
5124,
13,
4706,
15882,
353,
6608,
1982,
29889,
3487,
29945,
14182,
29876,
1642,
7122,
29898,
24582,
29898,
13096,
29918,
12277,
1860,
8106,
12508,
703,
9420,
29899,
29947,
1159,
467,
20970,
7501,
342,
580,
13,
4706,
1243,
29918,
3027,
29918,
978,
353,
285,
29915,
3359,
1688,
29912,
14695,
29918,
3188,
29918,
3027,
29961,
29900,
29962,
7402,
29912,
25378,
10162,
13,
4706,
1243,
29918,
3027,
353,
6213,
13,
4706,
1018,
29901,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
24428,
304,
8206,
5923,
1967,
426,
1688,
29918,
3027,
29918,
978,
27195,
13,
9651,
1243,
29918,
3027,
353,
20868,
29889,
26746,
29918,
3027,
29898,
1688,
29918,
3027,
29918,
978,
29897,
13,
4706,
5174,
313,
14695,
29889,
12523,
29889,
8787,
2392,
29892,
10346,
29889,
12523,
29889,
2940,
17413,
1125,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
1284,
1967,
426,
1688,
29918,
3027,
29918,
978,
27195,
13,
4706,
396,
6760,
271,
865,
716,
1967,
565,
5923,
1967,
3508,
29915,
29873,
1476,
13,
4706,
565,
451,
1243,
29918,
3027,
29901,
13,
9651,
17927,
29889,
3888,
29898,
13,
18884,
285,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
26221,
1967,
2729,
373,
426,
14695,
29918,
3188,
29918,
3027,
29961,
29900,
12258,
448,
6527,
2125,
29871,
29906,
29899,
29941,
6233,
472,
937,
376,
13,
18884,
285,
29908,
2230,
1159,
13,
9651,
1018,
29901,
13,
18884,
20868,
29889,
3258,
29918,
3027,
29898,
14695,
29918,
3188,
29918,
3027,
29961,
29900,
1402,
1243,
29918,
3027,
29918,
978,
29892,
5639,
29918,
1853,
29922,
1311,
3032,
15865,
29918,
27854,
29918,
4882,
3366,
4058,
29918,
1853,
12436,
13,
462,
462,
1678,
2601,
29918,
8318,
29922,
13096,
29918,
12277,
1860,
29897,
13,
13,
18884,
565,
1583,
3032,
14695,
29918,
29882,
431,
29918,
7507,
29901,
13,
462,
1678,
363,
903,
297,
3464,
29898,
29906,
1125,
13,
462,
4706,
1018,
29901,
13,
462,
9651,
1583,
3032,
14695,
29918,
4645,
29889,
8346,
29889,
5910,
29898,
1688,
29918,
3027,
29918,
978,
29897,
13,
462,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7084,
426,
1688,
29918,
3027,
29918,
978,
29913,
18760,
304,
9810,
1159,
13,
462,
9651,
2867,
13,
462,
4706,
5174,
313,
24830,
29889,
11739,
29879,
29889,
5350,
2392,
29892,
3142,
1982,
29941,
29889,
11739,
29879,
29889,
6359,
10851,
2392,
29892,
13,
462,
18884,
7274,
29889,
11739,
29879,
29889,
6359,
10851,
1125,
13,
462,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
5503,
1967,
426,
1688,
29918,
3027,
29918,
978,
29913,
304,
9810,
1159,
13,
13,
9651,
5174,
313,
14695,
29889,
12523,
29889,
8893,
2392,
29892,
10346,
29889,
12523,
29889,
8787,
2392,
29892,
8960,
29897,
408,
321,
29901,
13,
18884,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
8878,
4436,
10761,
426,
29872,
27195,
13,
18884,
4436,
353,
851,
29898,
29872,
29897,
13,
4706,
736,
1243,
29918,
3027,
29918,
978,
29892,
4436,
13,
13,
1678,
822,
903,
14695,
29918,
5992,
29918,
7611,
29898,
1311,
29892,
5639,
29918,
978,
29901,
851,
1125,
13,
4706,
1018,
29901,
13,
9651,
5639,
353,
1583,
3032,
14695,
29918,
4645,
29889,
1285,
475,
414,
29889,
657,
29898,
7611,
29918,
978,
29897,
13,
9651,
5639,
29889,
5992,
29898,
10118,
29922,
5574,
29897,
13,
4706,
5174,
10346,
29889,
12523,
29889,
17413,
29901,
13,
9651,
1209,
13,
4706,
5174,
7274,
29889,
11739,
29879,
29889,
1451,
2960,
287,
14934,
2392,
408,
4589,
29901,
13,
9651,
396,
1074,
29901,
2045,
597,
3292,
29889,
510,
29914,
14695,
29914,
14695,
29899,
2272,
29914,
12175,
29914,
29906,
29953,
29929,
29953,
29937,
15118,
9342,
29899,
29955,
29906,
29896,
29941,
29906,
29906,
29945,
29946,
29947,
13,
9651,
565,
7481,
29889,
5205,
580,
2804,
525,
29928,
279,
5080,
29915,
470,
525,
5350,
9391,
29915,
451,
297,
851,
29898,
3127,
1125,
13,
18884,
12020,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
14695,
29918,
3389,
29918,
2272,
27854,
29898,
1311,
29892,
1243,
29918,
3027,
29901,
851,
29892,
3013,
29918,
7611,
29901,
6120,
29897,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
7525,
349,
2904,
524,
297,
2825,
1243,
1967,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1243,
29918,
3027,
29898,
710,
1125,
1243,
1967,
1178,
29914,
978,
13,
9651,
3013,
29918,
7611,
29898,
11227,
1125,
5852,
565,
304,
3013,
5639,
1156,
8225,
7743,
13,
13,
4706,
16969,
29901,
13,
9651,
938,
29901,
29871,
29900,
373,
9150,
29892,
4436,
29871,
29896,
29892,
817,
304,
337,
2202,
29871,
29906,
13,
9651,
851,
29901,
21679,
1480,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29915,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
349,
2904,
524,
448,
7084,
426,
1688,
29918,
3027,
10162,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
5639,
29918,
978,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
7402,
2272,
27854,
29908,
13,
4706,
396,
5399,
565,
3517,
1065,
2175,
5639,
263,
5735,
565,
372,
437,
29892,
591,
3349,
372,
13,
4706,
1583,
3032,
14695,
29918,
5992,
29918,
7611,
29898,
7611,
29918,
978,
29897,
13,
13,
4706,
396,
7525,
5639,
13,
4706,
6876,
29918,
401,
353,
20134,
26925,
13,
4706,
1962,
353,
5124,
13,
4706,
1018,
29901,
13,
9651,
5639,
29901,
10346,
29889,
9794,
29889,
1285,
475,
414,
29889,
7895,
353,
20868,
29889,
3258,
29918,
7611,
29898,
13,
18884,
1024,
29922,
7611,
29918,
978,
29892,
13,
18884,
1967,
29922,
1688,
29918,
3027,
29892,
13,
18884,
1899,
11759,
13,
462,
1678,
2048,
29918,
2272,
27854,
29918,
6519,
29898,
13,
462,
4706,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
12436,
10346,
29918,
3259,
29922,
1311,
3032,
17028,
29879,
29889,
657,
877,
4691,
29918,
3259,
8785,
13,
18884,
21251,
13,
18884,
1404,
29922,
29888,
29908,
29912,
359,
29889,
657,
5416,
580,
6177,
29946,
29900,
29900,
29900,
613,
13,
18884,
2066,
29918,
517,
29918,
5910,
11759,
11219,
3359,
1287,
742,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
1402,
13,
18884,
5177,
29922,
1311,
3032,
17028,
29879,
3366,
6272,
29918,
16908,
12436,
13,
9651,
1723,
13,
9651,
5639,
29889,
2962,
580,
13,
9651,
4840,
29918,
14695,
29918,
7611,
29918,
4905,
29898,
7611,
29889,
20756,
29898,
5461,
29922,
5574,
876,
13,
9651,
396,
4480,
363,
5639,
304,
8341,
13,
9651,
5639,
29918,
4882,
353,
5639,
29889,
10685,
29898,
16122,
543,
735,
1573,
1159,
13,
9651,
396,
3617,
5639,
6876,
775,
13,
9651,
5639,
29918,
13322,
29918,
401,
353,
5639,
29918,
4882,
29889,
657,
703,
5709,
3399,
1159,
13,
9651,
396,
24162,
5639,
10748,
13,
9651,
5639,
29918,
1188,
353,
5639,
29889,
20756,
2141,
13808,
703,
9420,
29899,
29947,
1159,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
6876,
29899,
401,
29901,
426,
7611,
29918,
13322,
29918,
401,
27195,
13,
9651,
565,
5639,
29918,
13322,
29918,
401,
297,
518,
29896,
29892,
29871,
29906,
5387,
13,
18884,
396,
29871,
29896,
29899,
29888,
2075,
2643,
16610,
13,
18884,
396,
29871,
29906,
29899,
2392,
2643,
16610,
13,
18884,
6876,
29918,
401,
353,
13515,
6227,
13,
18884,
1962,
353,
5639,
29918,
1188,
13,
18884,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
4436,
1476,
1159,
13,
9651,
25342,
5639,
29918,
13322,
29918,
401,
297,
518,
29946,
29892,
29871,
29947,
29892,
29871,
29896,
29953,
5387,
13,
18884,
396,
29871,
29946,
29899,
22709,
2643,
16610,
13,
18884,
396,
29871,
29947,
29899,
999,
7168,
2643,
16610,
13,
18884,
396,
29871,
29896,
29953,
29899,
535,
7316,
2643,
16610,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
448,
18116,
1476,
1159,
13,
18884,
6876,
29918,
401,
353,
20134,
26925,
13,
9651,
25342,
5639,
29918,
13322,
29918,
401,
1275,
29871,
29941,
29906,
29901,
13,
18884,
396,
29871,
29941,
29906,
29899,
21125,
1059,
13,
18884,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
448,
10783,
482,
1059,
1159,
13,
18884,
6876,
29918,
401,
353,
390,
1001,
3904,
13,
9651,
1683,
29901,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
9651,
396,
19152,
292,
5639,
565,
4312,
470,
3349,
372,
13,
9651,
565,
3013,
29918,
7611,
29901,
13,
18884,
1596,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
5639,
1024,
426,
7611,
29918,
978,
27195,
13,
18884,
5639,
29889,
15060,
29898,
19033,
29922,
7611,
29918,
978,
29889,
13609,
3285,
4055,
543,
2272,
27854,
1159,
13,
9651,
1683,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
5639,
29889,
5992,
29898,
10118,
29922,
5574,
29897,
13,
18884,
5174,
10346,
29889,
12523,
29889,
17413,
408,
321,
29901,
13,
462,
1678,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
5217,
5639,
448,
426,
29872,
27195,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
17927,
29889,
11739,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
1065,
282,
2904,
524,
1159,
13,
9651,
6876,
29918,
401,
353,
390,
1001,
3904,
13,
9651,
1962,
353,
851,
29898,
29872,
29897,
13,
4706,
736,
6876,
29918,
401,
29892,
1962,
13,
13,
1678,
732,
20404,
29898,
2972,
29918,
978,
2433,
27854,
1495,
13,
1678,
822,
903,
14695,
29918,
3389,
29918,
2272,
1688,
29898,
1311,
29892,
1243,
29918,
3027,
29901,
851,
29892,
3013,
29918,
7611,
29901,
6120,
29892,
1243,
29918,
3134,
29901,
851,
29892,
694,
29918,
11911,
482,
29901,
6120,
353,
7700,
29897,
1599,
12603,
552,
29961,
524,
29892,
851,
29892,
9657,
5387,
13,
4706,
9995,
7525,
10772,
1688,
297,
2825,
1243,
1967,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1243,
29918,
3027,
29898,
710,
1125,
4321,
1967,
1178,
29914,
978,
13,
9651,
3013,
29918,
7611,
29898,
11227,
1125,
5852,
565,
304,
3013,
5639,
1156,
8225,
7743,
13,
9651,
1243,
29918,
3134,
29898,
710,
1125,
24409,
14238,
2224,
13,
9651,
694,
29918,
11911,
482,
29898,
11227,
1125,
7525,
11451,
1688,
1728,
23746,
3461,
13,
4706,
16969,
29901,
13,
9651,
938,
29901,
29871,
29900,
373,
9150,
29892,
4436,
29871,
29896,
29892,
817,
304,
337,
2202,
29871,
29906,
13,
9651,
851,
29901,
13223,
1243,
4390,
3461,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29915,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
10772,
1688,
448,
7084,
426,
1688,
29918,
3027,
10162,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
5639,
29918,
978,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
7402,
2272,
1688,
29908,
13,
4706,
396,
5399,
565,
3517,
1065,
2175,
5639,
263,
5735,
565,
372,
947,
29892,
15154,
372,
13,
4706,
1583,
3032,
14695,
29918,
5992,
29918,
7611,
29898,
7611,
29918,
978,
29897,
13,
4706,
396,
24930,
6987,
13,
4706,
6876,
29918,
401,
353,
20134,
26925,
13,
4706,
1962,
353,
6629,
13,
4706,
1243,
29918,
3126,
353,
6571,
13,
4706,
1018,
29901,
13,
9651,
396,
19509,
11451,
1688,
5639,
13,
9651,
18838,
353,
6629,
565,
694,
29918,
11911,
482,
1683,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
303,
331,
13,
9651,
318,
333,
353,
2897,
29889,
657,
5416,
580,
470,
29871,
29946,
29900,
29900,
29900,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29915,
29912,
1188,
29918,
14032,
415,
29913,
448,
1404,
318,
333,
363,
2734,
301,
524,
29914,
1688,
29901,
426,
5416,
29913,
1495,
29871,
396,
301,
4141,
29885,
29961,
2272,
29914,
8551,
29899,
726,
29899,
21027,
29899,
23149,
3321,
29899,
1272,
29962,
13,
9651,
5639,
353,
20868,
29889,
3258,
29918,
7611,
29898,
13,
18884,
1024,
29922,
7611,
29918,
978,
29892,
1967,
29922,
1688,
29918,
3027,
29892,
1404,
29922,
29888,
29908,
29912,
5416,
6177,
29946,
29900,
29900,
29900,
613,
13,
18884,
1899,
11759,
4282,
29918,
2272,
1688,
29918,
6519,
29898,
1688,
29918,
3134,
29922,
1688,
29918,
3134,
29892,
4390,
29922,
5574,
29892,
18838,
29922,
24542,
29897,
1402,
13,
18884,
5177,
29922,
1311,
3032,
17028,
29879,
3366,
6272,
29918,
16908,
12436,
2066,
29918,
517,
29918,
5910,
11759,
11219,
3359,
1287,
742,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
4638,
13,
9651,
1723,
13,
9651,
5639,
29889,
2962,
580,
13,
9651,
4840,
29918,
14695,
29918,
7611,
29918,
4905,
29898,
7611,
29889,
20756,
29898,
5461,
29922,
5574,
876,
13,
9651,
396,
20340,
292,
363,
5639,
304,
367,
7743,
13,
9651,
5639,
29918,
4882,
29901,
9657,
353,
5639,
29889,
10685,
29898,
16122,
543,
735,
1573,
1159,
13,
9651,
396,
24162,
5639,
6876,
775,
13,
9651,
5639,
29918,
13322,
29918,
401,
353,
5639,
29918,
4882,
29889,
657,
703,
5709,
3399,
1159,
13,
9651,
396,
24162,
5639,
10748,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
6876,
29899,
401,
29901,
426,
7611,
29918,
13322,
29918,
401,
27195,
13,
9651,
565,
5639,
29918,
13322,
29918,
401,
297,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29945,
5387,
13,
18884,
396,
29871,
29900,
29899,
3596,
6987,
4502,
13,
18884,
396,
29871,
29896,
29899,
24376,
892,
16531,
322,
1065,
541,
777,
310,
278,
6987,
5229,
13,
18884,
396,
29871,
29906,
29899,
3057,
8225,
471,
27803,
491,
278,
1404,
13,
18884,
396,
29871,
29945,
29899,
3782,
6987,
892,
16531,
13,
18884,
565,
1243,
29918,
3134,
29901,
13,
462,
1678,
1243,
29918,
1272,
29918,
3134,
353,
679,
29918,
1445,
29918,
3166,
29918,
7611,
29898,
7611,
29918,
5415,
29922,
7611,
29892,
13,
462,
462,
462,
9651,
5639,
29918,
2084,
13802,
3359,
1287,
29914,
12276,
29918,
2272,
1688,
29889,
3134,
1159,
13,
462,
1678,
4903,
29918,
481,
386,
353,
10802,
29898,
1688,
29918,
3134,
29897,
847,
285,
29915,
29912,
1311,
3032,
4058,
29918,
978,
2403,
2272,
1688,
29889,
3134,
29915,
13,
462,
1678,
411,
1722,
29898,
1445,
29922,
3134,
29918,
481,
386,
29892,
4464,
2433,
29890,
29893,
1495,
408,
285,
29901,
13,
462,
4706,
285,
29889,
3539,
29898,
1688,
29918,
1272,
29918,
3134,
29897,
29871,
396,
1134,
29901,
11455,
13,
13,
18884,
565,
451,
694,
29918,
11911,
482,
29901,
13,
462,
1678,
18838,
29918,
1445,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29892,
15300,
11911,
482,
1495,
13,
462,
1678,
18838,
29918,
1272,
353,
679,
29918,
1445,
29918,
3166,
29918,
7611,
29898,
7611,
29918,
5415,
29922,
7611,
29892,
13,
462,
462,
462,
539,
5639,
29918,
2084,
13802,
3359,
1287,
6294,
11911,
482,
1159,
13,
462,
1678,
18838,
29918,
1272,
353,
18838,
29918,
1272,
565,
338,
8758,
29898,
24542,
29918,
1272,
29892,
6262,
29897,
1683,
18838,
29918,
1272,
29889,
12508,
580,
13,
462,
1678,
411,
1722,
29898,
24542,
29918,
1445,
29918,
2084,
29892,
525,
29893,
29890,
1495,
408,
23746,
29918,
1445,
29901,
13,
462,
4706,
23746,
29918,
1445,
29889,
3539,
29898,
24542,
29918,
1272,
29897,
13,
462,
1678,
23746,
29918,
12276,
29918,
15204,
29898,
24542,
29918,
1445,
29918,
2084,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29892,
285,
29915,
29912,
1311,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
303,
331,
1836,
2272,
8785,
13,
13,
18884,
1243,
29918,
3126,
353,
4390,
29889,
18132,
29898,
657,
29918,
1445,
29918,
3166,
29918,
7611,
29898,
7611,
29918,
5415,
29922,
7611,
29892,
13,
462,
462,
462,
1669,
5639,
29918,
2084,
13802,
3359,
1287,
29914,
12276,
29918,
2272,
1688,
29889,
3126,
613,
13,
462,
462,
462,
1669,
8025,
543,
9420,
29899,
29947,
5783,
13,
18884,
363,
1243,
297,
1243,
29918,
3126,
29889,
657,
877,
12276,
742,
6571,
467,
657,
703,
21150,
29908,
1125,
13,
462,
1678,
565,
1243,
29889,
657,
703,
4804,
613,
6571,
467,
657,
703,
5426,
276,
558,
29908,
1125,
13,
462,
4706,
1243,
3366,
4804,
3108,
3366,
5426,
276,
558,
3108,
353,
1243,
3366,
4804,
3108,
3366,
5426,
276,
558,
16862,
5451,
28909,
29876,
1495,
13,
18884,
565,
5639,
29918,
13322,
29918,
401,
297,
518,
29900,
29892,
29871,
29945,
5387,
13,
462,
1678,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
462,
1678,
6876,
29918,
401,
353,
20134,
26925,
13,
18884,
25342,
5639,
29918,
13322,
29918,
401,
297,
518,
29906,
5387,
13,
462,
1678,
1962,
353,
5639,
29889,
20756,
2141,
13808,
877,
9420,
29899,
29947,
1495,
13,
462,
1678,
6876,
29918,
401,
353,
13515,
6227,
13,
18884,
1683,
29901,
13,
462,
1678,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
4436,
1476,
1159,
13,
462,
1678,
6876,
29918,
401,
353,
13515,
6227,
13,
9651,
25342,
5639,
29918,
13322,
29918,
401,
297,
518,
29941,
29892,
29871,
29946,
5387,
13,
18884,
396,
29871,
29941,
29899,
16491,
1059,
9559,
1550,
14012,
6987,
13,
18884,
396,
29871,
29946,
29899,
2272,
1688,
1899,
1196,
8744,
1059,
13,
18884,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
10783,
482,
1059,
1159,
13,
18884,
6876,
29918,
401,
353,
390,
1001,
3904,
13,
18884,
1962,
353,
5639,
29889,
20756,
2141,
13808,
877,
9420,
29899,
29947,
1495,
13,
9651,
1683,
29901,
13,
18884,
396,
3139,
916,
5639,
6876,
775,
13,
18884,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
10346,
5639,
1059,
1476,
21313,
7611,
29918,
13322,
29918,
401,
1800,
1159,
13,
18884,
6876,
29918,
401,
353,
13515,
6227,
13,
9651,
396,
15154,
5639,
565,
451,
4312,
13,
9651,
565,
3013,
29918,
7611,
29901,
13,
18884,
1596,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21679,
1024,
426,
7611,
29918,
978,
27195,
13,
18884,
5639,
29889,
15060,
29898,
19033,
29922,
7611,
29918,
978,
29889,
13609,
3285,
4055,
543,
2272,
1688,
1159,
13,
9651,
1683,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
5639,
29889,
5992,
29898,
10118,
29922,
5574,
29897,
13,
18884,
5174,
10346,
29889,
12523,
29889,
17413,
408,
321,
29901,
13,
462,
1678,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
3349,
5639,
426,
29872,
27195,
13,
4706,
5174,
313,
14695,
29889,
12523,
29889,
2940,
17413,
29892,
10346,
29889,
12523,
29889,
8787,
2392,
29897,
408,
321,
29901,
13,
9651,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
1065,
11451,
1688,
5639,
426,
29872,
27195,
13,
9651,
6876,
29918,
401,
353,
390,
1001,
3904,
13,
13,
4706,
736,
6876,
29918,
401,
29892,
1962,
29892,
1243,
29918,
3126,
13,
13,
1678,
822,
903,
14695,
29918,
3389,
29918,
29886,
29893,
845,
29918,
24209,
911,
29898,
1311,
29892,
1243,
29918,
3027,
29901,
851,
29892,
3013,
29918,
7611,
29901,
6120,
29897,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
7525,
12265,
27456,
775,
27599,
297,
2825,
1243,
1967,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1243,
29918,
3027,
29898,
710,
1125,
1243,
1967,
1178,
29914,
978,
13,
9651,
3013,
29918,
7611,
29898,
11227,
1125,
5852,
565,
304,
3013,
5639,
1156,
5566,
918,
7743,
13,
13,
4706,
16969,
29901,
13,
9651,
938,
29901,
29871,
29900,
373,
9150,
29892,
4436,
29871,
29896,
29892,
817,
304,
337,
2202,
29871,
29906,
13,
9651,
851,
29901,
21679,
1480,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29915,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
12265,
27456,
27599,
448,
7084,
426,
1688,
29918,
3027,
10162,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
5639,
29918,
978,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
7402,
29886,
29893,
845,
29899,
24209,
911,
29908,
13,
4706,
396,
5399,
565,
3517,
1065,
2175,
5639,
263,
5735,
565,
372,
437,
29892,
591,
3349,
372,
13,
4706,
5639,
29901,
10346,
29889,
9794,
29889,
1285,
475,
414,
29889,
7895,
13,
4706,
1018,
29901,
13,
9651,
5639,
353,
1583,
3032,
14695,
29918,
4645,
29889,
1285,
475,
414,
29889,
657,
29898,
7611,
29918,
978,
29897,
13,
9651,
5639,
29889,
5992,
29898,
10118,
29922,
5574,
29897,
13,
4706,
5174,
10346,
29889,
12523,
29889,
17413,
29901,
13,
9651,
1209,
13,
13,
4706,
396,
7525,
5639,
13,
4706,
6876,
29918,
401,
353,
20134,
26925,
13,
4706,
1962,
353,
5124,
13,
4706,
1018,
29901,
13,
9651,
318,
333,
353,
2897,
29889,
657,
5416,
580,
470,
29871,
29946,
29900,
29900,
29900,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29915,
29912,
1188,
29918,
14032,
415,
29913,
448,
1404,
318,
333,
363,
2734,
301,
524,
29914,
1688,
29901,
426,
5416,
29913,
1495,
29871,
396,
301,
4141,
29885,
29961,
2272,
29914,
8551,
29899,
726,
29899,
21027,
29899,
23149,
3321,
29899,
1272,
29962,
13,
9651,
5639,
353,
20868,
29889,
3258,
29918,
7611,
29898,
978,
29922,
7611,
29918,
978,
29892,
1967,
29922,
1688,
29918,
3027,
29892,
13,
462,
462,
18884,
1404,
29922,
29888,
29908,
29912,
5416,
6177,
29946,
29900,
29900,
29900,
613,
5177,
29922,
1311,
3032,
17028,
29879,
3366,
6272,
29918,
16908,
12436,
13,
462,
462,
18884,
2066,
29918,
517,
29918,
5910,
11759,
11219,
3359,
1287,
742,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
1402,
13,
462,
462,
18884,
1899,
29922,
4282,
29918,
29886,
29893,
845,
29918,
24209,
911,
29918,
6519,
29898,
13,
462,
462,
462,
1678,
1583,
3032,
17028,
29879,
3366,
27854,
29918,
5325,
3108,
29961,
29900,
2314,
13,
462,
462,
18884,
1723,
13,
9651,
5639,
29889,
2962,
580,
13,
9651,
4840,
29918,
14695,
29918,
7611,
29918,
4905,
29898,
7611,
29889,
20756,
29898,
5461,
29922,
5574,
876,
13,
9651,
396,
4480,
363,
5639,
304,
8341,
13,
9651,
5639,
29918,
4882,
353,
5639,
29889,
10685,
29898,
16122,
543,
735,
1573,
1159,
13,
9651,
396,
3617,
5639,
6876,
775,
13,
9651,
5639,
29918,
13322,
29918,
401,
353,
5639,
29918,
4882,
29889,
657,
703,
5709,
3399,
1159,
13,
9651,
396,
24162,
5639,
10748,
13,
9651,
5639,
29918,
1188,
353,
5639,
29889,
20756,
2141,
13808,
703,
9420,
29899,
29947,
1159,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
6876,
29899,
401,
29901,
426,
7611,
29918,
13322,
29918,
401,
27195,
13,
9651,
565,
5639,
29918,
13322,
29918,
401,
29901,
13,
18884,
396,
29871,
29896,
29899,
29888,
2075,
2643,
16610,
13,
18884,
396,
29871,
29906,
29899,
2392,
2643,
16610,
13,
18884,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
4436,
1476,
1159,
13,
18884,
1962,
353,
5639,
29918,
1188,
13,
18884,
6876,
29918,
401,
353,
13515,
6227,
13,
9651,
1683,
29901,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
9651,
396,
19152,
292,
5639,
565,
4312,
470,
3349,
372,
13,
9651,
565,
3013,
29918,
7611,
29901,
13,
18884,
1596,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
5639,
1024,
426,
7611,
29918,
978,
27195,
13,
18884,
5639,
29889,
15060,
29898,
19033,
29922,
7611,
29918,
978,
29889,
13609,
3285,
4055,
543,
29886,
29893,
845,
29918,
24209,
911,
1159,
13,
9651,
1683,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
5639,
29889,
5992,
29898,
10118,
29922,
5574,
29897,
13,
18884,
5174,
10346,
29889,
12523,
29889,
17413,
408,
321,
29901,
13,
462,
1678,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
5217,
5639,
448,
426,
29872,
27195,
13,
4706,
5174,
313,
14695,
29889,
12523,
29889,
2940,
17413,
29892,
10346,
29889,
12523,
29889,
8787,
2392,
29892,
7274,
29889,
11739,
29879,
29889,
6359,
10851,
29897,
408,
321,
29901,
13,
9651,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
1065,
25532,
1243,
448,
426,
29872,
27195,
13,
9651,
6876,
29918,
401,
353,
390,
1001,
3904,
13,
13,
4706,
736,
6876,
29918,
401,
29892,
1962,
13,
13,
1678,
822,
903,
5504,
29918,
5924,
29918,
5563,
29898,
1311,
1125,
13,
4706,
4870,
29918,
3972,
353,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
3560,
565,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
20895,
14352,
29896,
29962,
1275,
2672,
4330,
14345,
8098,
29903,
29918,
9464,
1683,
320,
13,
9651,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29889,
3560,
29889,
3560,
13,
4706,
4870,
29918,
7299,
29918,
3051,
29901,
360,
919,
353,
4390,
29889,
1359,
3552,
4058,
29918,
3972,
847,
349,
11375,
29903,
29918,
29925,
11375,
29918,
2303,
6040,
29918,
7724,
29918,
5813,
467,
3150,
3101,
13,
4706,
1583,
3032,
17028,
29879,
1839,
5924,
29918,
5563,
2033,
353,
4870,
29918,
7299,
29918,
3051,
29889,
657,
877,
5924,
1495,
13,
4706,
565,
1583,
3032,
17028,
29879,
1839,
5924,
29918,
5563,
2033,
1275,
525,
1595,
1089,
29915,
322,
4870,
29918,
7299,
29918,
3051,
29889,
657,
877,
20455,
2450,
29374,
13,
9651,
1583,
3032,
17028,
29879,
1839,
5924,
29918,
5563,
2033,
353,
525,
6327,
2164,
18096,
29915,
13,
13,
1678,
822,
903,
14695,
29918,
3389,
29918,
29886,
29893,
845,
29918,
1688,
29898,
1311,
29892,
1243,
29918,
3027,
29901,
851,
29892,
3013,
29918,
7611,
29901,
6120,
29897,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
4706,
9995,
7525,
12265,
27456,
6987,
297,
2825,
1243,
1967,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1243,
29918,
3027,
29898,
710,
1125,
1243,
1967,
1178,
29914,
978,
13,
9651,
3013,
29918,
7611,
29898,
11227,
1125,
5852,
565,
304,
3013,
5639,
1156,
5566,
918,
7743,
13,
13,
4706,
16969,
29901,
13,
9651,
938,
29901,
29871,
29900,
373,
9150,
29892,
4436,
29871,
29896,
29892,
452,
300,
304,
337,
2202,
29871,
29906,
13,
9651,
851,
29901,
21679,
1480,
13,
4706,
9995,
13,
4706,
1480,
29918,
14032,
415,
353,
285,
29915,
29912,
1311,
3032,
4058,
29918,
978,
29913,
448,
12265,
27456,
1243,
448,
7084,
426,
1688,
29918,
3027,
10162,
13,
4706,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
7370,
1159,
13,
4706,
5639,
29918,
978,
353,
285,
29908,
29912,
1311,
3032,
4058,
29918,
978,
7402,
29886,
29893,
845,
29899,
1688,
29908,
13,
4706,
396,
5399,
565,
3517,
1065,
2175,
5639,
263,
5735,
565,
372,
437,
29892,
591,
3349,
372,
13,
4706,
1583,
3032,
14695,
29918,
5992,
29918,
7611,
29898,
7611,
29918,
978,
29897,
13,
13,
4706,
396,
7525,
5639,
13,
4706,
6876,
29918,
401,
353,
20134,
26925,
13,
4706,
1962,
353,
5124,
13,
4706,
1018,
29901,
13,
9651,
318,
333,
353,
2897,
29889,
657,
5416,
580,
470,
29871,
29946,
29900,
29900,
29900,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29915,
29912,
1188,
29918,
14032,
415,
29913,
448,
1404,
318,
333,
363,
2734,
301,
524,
29914,
1688,
29901,
426,
5416,
29913,
1495,
29871,
396,
301,
4141,
29885,
29961,
2272,
29914,
8551,
29899,
726,
29899,
21027,
29899,
23149,
3321,
29899,
1272,
29962,
13,
9651,
5639,
29901,
10346,
29889,
9794,
29889,
1285,
475,
414,
29889,
7895,
353,
20868,
29889,
3258,
29918,
7611,
29898,
13,
18884,
2066,
29918,
517,
29918,
5910,
11759,
11219,
3359,
1287,
742,
1583,
3032,
4058,
29918,
6897,
29918,
3972,
29897,
1402,
13,
18884,
1024,
29922,
7611,
29918,
978,
29892,
1967,
29922,
1688,
29918,
3027,
29892,
1899,
29922,
4282,
29918,
29886,
29893,
845,
29918,
1688,
29918,
6519,
3285,
13,
18884,
1404,
29922,
29888,
29908,
29912,
5416,
6177,
29946,
29900,
29900,
29900,
613,
5177,
29922,
1311,
3032,
17028,
29879,
3366,
6272,
29918,
16908,
20068,
13,
9651,
5639,
29889,
2962,
580,
13,
9651,
4840,
29918,
14695,
29918,
7611,
29918,
4905,
29898,
7611,
29889,
20756,
29898,
5461,
29922,
5574,
876,
13,
9651,
396,
4480,
363,
5639,
304,
8341,
13,
9651,
5639,
29918,
4882,
353,
5639,
29889,
10685,
29898,
16122,
543,
735,
1573,
1159,
13,
9651,
396,
3617,
5639,
6876,
775,
13,
9651,
5639,
29918,
13322,
29918,
401,
353,
5639,
29918,
4882,
29889,
657,
703,
5709,
3399,
1159,
13,
9651,
396,
24162,
5639,
10748,
13,
9651,
5639,
29918,
1188,
353,
5639,
29889,
20756,
2141,
13808,
703,
9420,
29899,
29947,
1159,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
6876,
29899,
401,
29901,
426,
7611,
29918,
13322,
29918,
401,
27195,
13,
9651,
565,
5639,
29918,
13322,
29918,
401,
29901,
13,
18884,
396,
29871,
29896,
29899,
29888,
2075,
2643,
16610,
13,
18884,
396,
29871,
29906,
29899,
2392,
2643,
16610,
13,
18884,
17927,
29889,
2704,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
4231,
3276,
29892,
4436,
1476,
1159,
13,
18884,
1962,
353,
5639,
29918,
1188,
13,
18884,
6876,
29918,
401,
353,
13515,
6227,
13,
9651,
1683,
29901,
13,
18884,
17927,
29889,
3888,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
21397,
3730,
7743,
1159,
13,
9651,
396,
19152,
292,
5639,
565,
4312,
470,
3349,
372,
13,
9651,
565,
3013,
29918,
7611,
29901,
13,
18884,
1596,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
5639,
1024,
426,
7611,
29918,
978,
27195,
13,
18884,
5639,
29889,
15060,
29898,
19033,
29922,
7611,
29918,
978,
29889,
13609,
3285,
4055,
2433,
29886,
29893,
845,
29918,
1688,
1495,
13,
9651,
1683,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
5639,
29889,
5992,
29898,
10118,
29922,
5574,
29897,
13,
18884,
5174,
10346,
29889,
12523,
29889,
17413,
408,
321,
29901,
13,
462,
1678,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
5217,
5639,
448,
426,
29872,
27195,
13,
4706,
5174,
313,
14695,
29889,
12523,
29889,
2940,
17413,
29892,
10346,
29889,
12523,
29889,
8787,
2392,
29892,
7274,
29889,
11739,
29879,
29889,
6359,
10851,
29897,
408,
321,
29901,
13,
9651,
17927,
29889,
9695,
936,
29898,
29888,
29908,
29912,
1188,
29918,
14032,
415,
29913,
448,
20065,
304,
1065,
25532,
1243,
448,
426,
29872,
27195,
13,
9651,
6876,
29918,
401,
353,
390,
1001,
3904,
13,
13,
4706,
736,
6876,
29918,
401,
29892,
1962,
13,
13,
1678,
822,
903,
657,
29918,
26381,
29918,
1761,
29898,
1311,
29892,
2471,
29918,
5415,
29901,
9657,
1125,
13,
4706,
9995,
3617,
599,
8260,
515,
343,
828,
934,
310,
278,
4870,
13,
965,
826,
3174,
29901,
13,
1669,
2471,
29918,
5415,
29898,
8977,
1125,
278,
2471,
4004,
310,
278,
343,
828,
934,
29889,
13,
965,
16969,
29901,
13,
1669,
1051,
29901,
1051,
310,
599,
8260,
13,
4706,
9995,
13,
4706,
8260,
29918,
1761,
353,
5159,
13,
4706,
1018,
29901,
13,
9651,
8260,
29918,
5415,
353,
2471,
29918,
5415,
29889,
657,
877,
26381,
742,
426,
1800,
13,
9651,
363,
1899,
297,
8260,
29918,
5415,
29901,
13,
18884,
8260,
29918,
1761,
29889,
4397,
29898,
6519,
29889,
657,
877,
978,
742,
6629,
876,
13,
4706,
5174,
8960,
29901,
13,
9651,
17927,
29889,
8382,
703,
17776,
2805,
278,
8260,
515,
278,
343,
828,
934,
1159,
13,
4706,
736,
8260,
29918,
1761,
13,
2
] |
giggleliu/tba/lattice/latticelib.py | Lynn-015/Test_01 | 2 | 63116 | #!/usr/bin/python
#-*-coding:utf-8-*-
#By <NAME>
from numpy import *
from lattice import Lattice
from bzone import BZone
from group import C6vGroup,C4vGroup,C3vGroup
__all__=['Honeycomb_Lattice','Square_Lattice','Triangular_Lattice','Chain','construct_lattice','resize_lattice']
class Honeycomb_Lattice(Lattice):
'''
HoneyComb Lattice class.
Construct
----------------
Honeycomb_Lattice(N,form=1.)
form:
The form of lattice.
`1` -> traditional one with 0 point at a vertex, using C3v group.
`2` -> the C6v form with 0 point at the center of hexagon, using C6v group.
'''
def __init__(self,N,form=1):
if form==1:
catoms=[(0.,0.),(0.5,sqrt(3.)/6)]
pg=C3vGroup()
elif form==2:
catoms=array[(0.,1./sqrt(3.)),(0.5,sqrt(3.)/6)]
pg=C6vGroup()
else:
raise ValueError('Form %s not defined.'%form)
super(Honeycomb_Lattice,self).__init__(name='honeycomb',a=array([(1.,0),(0.5,sqrt(3.)/2)]),N=N,catoms=catoms)
self.usegroup(pg)
@property
def kspace(self):
'''
Get the <KSpace> instance.
'''
ks=super(Honeycomb_Lattice,self).kspace
M0=ks.b[1]/2.0
K0=(ks.b[0]+2*ks.b[1])/3.0
c6vg=C6vGroup()
M=[]
K=[]
for i in xrange(6):
M.append(c6vg.actonK(M0,i))
K.append(c6vg.actonK(K0,i))
ks.special_points['M']=M
ks.special_points['K']=K
ks.usegroup(c6vg)
return ks
class Square_Lattice(Lattice):
'''
Square Lattice, using C4v Group.
Construct
----------------
Square_Lattice(N,catoms=[(0.,0.)])
'''
def __init__(self,N,catoms=[(0.,0.)]):
a=array([(1.,0),(0.,1.)])
super(Square_Lattice,self).__init__(N=N,a=a,catoms=catoms,name='square')
c4vg=C4vGroup()
self.usegroup(c4vg)
@property
def kspace(self):
'''
Get the <KSpace> instance.
'''
ks=super(Square_Lattice,self).kspace
M0=ks.b[1]/2.0
K0=(ks.b[0]+ks.b[1])/2.0
c4vg=C4vGroup()
M=[]
K=[]
for i in xrange(4):
M.append(c4vg.actonK(M0,i))
K.append(c4vg.actonK(K0,i))
ks.special_points['M']=M
ks.special_points['K']=K
ks.usegroup(c4vg)
return ks
class Triangular_Lattice(Lattice):
'''
Triangular Lattice, using C6v Group.
Construct
----------------
Triangular_Lattice(N,catoms=[(0.,0.)])
'''
def __init__(self,N,catoms=[(0.,0.)]):
'''Basic information of Triangular Lattice'''
a=array([(1.,0),(0.5,sqrt(3.)/2)])
super(Triangular_Lattice,self).__init__(a=a,catoms=catoms,name='triangular',N=N)
c6vg=C6vGroup()
self.usegroup(c6vg)
@property
def kspace(self):
'''
Get the <KSpace> instance.
'''
ks=super(Triangular_Lattice,self).kspace
M0=ks.b[1]/2.0
K0=(ks.b[0]+2*ks.b[1])/3.0
c6vg=C6vGroup()
M=[]
K=[]
for i in xrange(6):
M.append(c6vg.actonK(M0,i))
K.append(c6vg.actonK(K0,i))
ks.special_points['M']=M
ks.special_points['K']=K
ks.usegroup(c6vg)
return ks
class Chain(Lattice):
'''
Lattice of Chain.
Construct
----------------
Chain(N,a=(1.),catoms=[(0.,0.)])
'''
def __init__(self,N,a=(1.),catoms=[(0.)]):
'''
N:
Number of cells, integer.
a:
Lattice vector, 1D array.
catoms:
Atom positions in a unit cell.
'''
super(Chain,self).__init__(a=[a],N=[N],name='chain',catoms=catoms)
@property
def kspace(self):
'''The <KSpace> instance correspond to a chain.'''
a=self.a[0]
b=2*pi*a/a.dot(a)
ks=KSpace(N=self.N,b=b)
ks.special_points['K']=array([-b/2.,b/2.])
return ks
def construct_lattice(N,lattice_shape='',a=None,catoms=None,args={}):
'''
Uniform construct method for lattice.
N:
The size of lattice.
lattice_shape:
The shape of lattice.
* '' -> the anonymous lattice.
* 'square' -> square lattice.
* 'honeycomb' -> honeycomb lattice.
* 'triangular' -> triangular lattice.
* 'chain' -> a chain.
a:
The unit vector.
catoms:
The atoms in a unit cell.
args:
Other arguments,
* `form` -> the form used in constructing honeycomb lattice.
'''
if lattice_shape=='':
assert(a is not None)
if catoms is None: catoms=zeros(shape(a)[-1])
return Lattice(name='anonymous',N=N,a=a,catoms=catoms)
elif lattice_shape=='honeycomb':
return Honeycomb_Lattice(N=N,form=args.get('form',1))
elif lattice_shape=='square':
if catoms is None: catoms=zeros([1,2])
return Square_Lattice(N=N,catoms=catoms)
elif lattice_shape=='triangular':
if catoms is None: catoms=zeros([1,2])
return Triangular_Lattice(N=N,catoms=catoms)
elif lattice_shape=='chain':
if a is None: a=[1.]
if catoms is None: catoms=zeros([1,1])
if ndim(N)==1:
N=N[0]
return Chain(N=N,catoms=catoms)
def resize_lattice(lattice,N):
'''
Resize the lattice to specific size.
lattice:
The target lattice.
N:
1D - array, the size of new lattice.
'''
return construct_lattice(a=lattice.a,N=N,catoms=lattice.catoms,args={'form':getattr(lattice,'form',None)})
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
30004,
13,
29937,
29899,
29930,
29899,
29883,
3689,
29901,
9420,
29899,
29947,
29899,
29930,
29899,
30004,
13,
29937,
2059,
529,
5813,
3238,
13,
30004,
13,
3166,
12655,
1053,
334,
30004,
13,
3166,
24094,
1053,
365,
19704,
30004,
13,
3166,
289,
8028,
1053,
350,
18482,
30004,
13,
3166,
2318,
1053,
315,
29953,
29894,
4782,
29892,
29907,
29946,
29894,
4782,
29892,
29907,
29941,
29894,
4782,
30004,
13,
30004,
13,
1649,
497,
1649,
29922,
1839,
29950,
4992,
17743,
29918,
29931,
19704,
3788,
29903,
4718,
29918,
29931,
19704,
3788,
29565,
6825,
29918,
29931,
19704,
3788,
14688,
3788,
11433,
29918,
29880,
19704,
3788,
21476,
29918,
29880,
19704,
2033,
30004,
13,
30004,
13,
1990,
379,
4992,
17743,
29918,
29931,
19704,
29898,
29931,
19704,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
379,
4992,
1523,
29890,
365,
19704,
770,
22993,
13,
30004,
13,
1678,
1281,
4984,
30004,
13,
1678,
448,
9072,
5634,
30004,
13,
1678,
379,
4992,
17743,
29918,
29931,
19704,
29898,
29940,
29892,
689,
29922,
29896,
1846,
30004,
13,
30004,
13,
1678,
883,
29901,
30004,
13,
4706,
450,
883,
310,
24094,
22993,
13,
4706,
421,
29896,
29952,
1599,
13807,
697,
411,
29871,
29900,
1298,
472,
263,
12688,
29892,
773,
315,
29941,
29894,
2318,
22993,
13,
4706,
421,
29906,
29952,
1599,
278,
315,
29953,
29894,
883,
411,
29871,
29900,
1298,
472,
278,
4818,
310,
15090,
12841,
29892,
773,
315,
29953,
29894,
2318,
22993,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
29940,
29892,
689,
29922,
29896,
1125,
30004,
13,
4706,
565,
883,
1360,
29896,
29901,
30004,
13,
9651,
6635,
4835,
11759,
29898,
29900,
1696,
29900,
9774,
29898,
29900,
29889,
29945,
29892,
3676,
29898,
29941,
1846,
29914,
29953,
4638,
30004,
13,
9651,
23822,
29922,
29907,
29941,
29894,
4782,
26471,
13,
4706,
25342,
883,
1360,
29906,
29901,
30004,
13,
9651,
6635,
4835,
29922,
2378,
15625,
29900,
1696,
29896,
6904,
3676,
29898,
29941,
1846,
21336,
29900,
29889,
29945,
29892,
3676,
29898,
29941,
1846,
29914,
29953,
4638,
30004,
13,
9651,
23822,
29922,
29907,
29953,
29894,
4782,
26471,
13,
4706,
1683,
29901,
30004,
13,
9651,
12020,
7865,
2392,
877,
2500,
1273,
29879,
451,
3342,
6169,
29995,
689,
8443,
13,
4706,
2428,
29898,
29950,
4992,
17743,
29918,
29931,
19704,
29892,
1311,
467,
1649,
2344,
12035,
978,
2433,
29882,
4992,
17743,
742,
29874,
29922,
2378,
4197,
29898,
29896,
1696,
29900,
21336,
29900,
29889,
29945,
29892,
3676,
29898,
29941,
1846,
29914,
29906,
4638,
511,
29940,
29922,
29940,
29892,
4117,
4835,
29922,
4117,
4835,
8443,
13,
4706,
1583,
29889,
1509,
2972,
29898,
4061,
8443,
13,
30004,
13,
1678,
732,
6799,
30004,
13,
1678,
822,
413,
3493,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
3617,
278,
529,
29968,
14936,
29958,
2777,
22993,
13,
4706,
14550,
30004,
13,
4706,
413,
29879,
29922,
9136,
29898,
29950,
4992,
17743,
29918,
29931,
19704,
29892,
1311,
467,
29895,
3493,
30004,
13,
30004,
13,
4706,
341,
29900,
29922,
2039,
29889,
29890,
29961,
29896,
16261,
29906,
29889,
29900,
30004,
13,
4706,
476,
29900,
7607,
2039,
29889,
29890,
29961,
29900,
10062,
29906,
29930,
2039,
29889,
29890,
29961,
29896,
2314,
29914,
29941,
29889,
29900,
30004,
13,
4706,
274,
29953,
29894,
29887,
29922,
29907,
29953,
29894,
4782,
26471,
13,
30004,
13,
4706,
341,
29922,
2636,
30004,
13,
4706,
476,
29922,
2636,
30004,
13,
4706,
363,
474,
297,
921,
3881,
29898,
29953,
1125,
30004,
13,
9651,
341,
29889,
4397,
29898,
29883,
29953,
29894,
29887,
29889,
627,
265,
29968,
29898,
29924,
29900,
29892,
29875,
876,
30004,
13,
9651,
476,
29889,
4397,
29898,
29883,
29953,
29894,
29887,
29889,
627,
265,
29968,
29898,
29968,
29900,
29892,
29875,
876,
30004,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29924,
2033,
29922,
29924,
30004,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29968,
2033,
29922,
29968,
30004,
13,
4706,
413,
29879,
29889,
1509,
2972,
29898,
29883,
29953,
29894,
29887,
8443,
13,
4706,
736,
413,
29879,
30004,
13,
30004,
13,
1990,
19256,
29918,
29931,
19704,
29898,
29931,
19704,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
19256,
365,
19704,
29892,
773,
315,
29946,
29894,
6431,
22993,
13,
30004,
13,
1678,
1281,
4984,
30004,
13,
1678,
448,
9072,
5634,
30004,
13,
1678,
19256,
29918,
29931,
19704,
29898,
29940,
29892,
4117,
4835,
11759,
29898,
29900,
1696,
29900,
1846,
2314,
30004,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
29940,
29892,
4117,
4835,
11759,
29898,
29900,
1696,
29900,
1846,
29962,
1125,
30004,
13,
4706,
263,
29922,
2378,
4197,
29898,
29896,
1696,
29900,
21336,
29900,
1696,
29896,
1846,
2314,
30004,
13,
4706,
2428,
29898,
29903,
4718,
29918,
29931,
19704,
29892,
1311,
467,
1649,
2344,
12035,
29940,
29922,
29940,
29892,
29874,
29922,
29874,
29892,
4117,
4835,
29922,
4117,
4835,
29892,
978,
2433,
17619,
1495,
30004,
13,
4706,
274,
29946,
29894,
29887,
29922,
29907,
29946,
29894,
4782,
26471,
13,
4706,
1583,
29889,
1509,
2972,
29898,
29883,
29946,
29894,
29887,
8443,
13,
30004,
13,
1678,
732,
6799,
30004,
13,
1678,
822,
413,
3493,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
3617,
278,
529,
29968,
14936,
29958,
2777,
22993,
13,
4706,
14550,
30004,
13,
4706,
413,
29879,
29922,
9136,
29898,
29903,
4718,
29918,
29931,
19704,
29892,
1311,
467,
29895,
3493,
30004,
13,
4706,
341,
29900,
29922,
2039,
29889,
29890,
29961,
29896,
16261,
29906,
29889,
29900,
30004,
13,
4706,
476,
29900,
7607,
2039,
29889,
29890,
29961,
29900,
10062,
2039,
29889,
29890,
29961,
29896,
2314,
29914,
29906,
29889,
29900,
30004,
13,
4706,
274,
29946,
29894,
29887,
29922,
29907,
29946,
29894,
4782,
26471,
13,
30004,
13,
4706,
341,
29922,
2636,
30004,
13,
4706,
476,
29922,
2636,
30004,
13,
4706,
363,
474,
297,
921,
3881,
29898,
29946,
1125,
30004,
13,
9651,
341,
29889,
4397,
29898,
29883,
29946,
29894,
29887,
29889,
627,
265,
29968,
29898,
29924,
29900,
29892,
29875,
876,
30004,
13,
9651,
476,
29889,
4397,
29898,
29883,
29946,
29894,
29887,
29889,
627,
265,
29968,
29898,
29968,
29900,
29892,
29875,
876,
30004,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29924,
2033,
29922,
29924,
30004,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29968,
2033,
29922,
29968,
30004,
13,
4706,
413,
29879,
29889,
1509,
2972,
29898,
29883,
29946,
29894,
29887,
8443,
13,
4706,
736,
413,
29879,
30004,
13,
30004,
13,
1990,
8602,
6825,
29918,
29931,
19704,
29898,
29931,
19704,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
8602,
6825,
365,
19704,
29892,
773,
315,
29953,
29894,
6431,
22993,
13,
30004,
13,
1678,
1281,
4984,
30004,
13,
1678,
448,
9072,
5634,
30004,
13,
1678,
8602,
6825,
29918,
29931,
19704,
29898,
29940,
29892,
4117,
4835,
11759,
29898,
29900,
1696,
29900,
1846,
2314,
30004,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
29940,
29892,
4117,
4835,
11759,
29898,
29900,
1696,
29900,
1846,
29962,
1125,
30004,
13,
4706,
14550,
16616,
2472,
310,
8602,
6825,
365,
19704,
12008,
30004,
13,
4706,
263,
29922,
2378,
4197,
29898,
29896,
1696,
29900,
21336,
29900,
29889,
29945,
29892,
3676,
29898,
29941,
1846,
29914,
29906,
29897,
2314,
30004,
13,
4706,
2428,
29898,
29565,
6825,
29918,
29931,
19704,
29892,
1311,
467,
1649,
2344,
12035,
29874,
29922,
29874,
29892,
4117,
4835,
29922,
4117,
4835,
29892,
978,
2433,
3626,
6825,
742,
29940,
29922,
29940,
8443,
13,
4706,
274,
29953,
29894,
29887,
29922,
29907,
29953,
29894,
4782,
26471,
13,
4706,
1583,
29889,
1509,
2972,
29898,
29883,
29953,
29894,
29887,
8443,
13,
30004,
13,
1678,
732,
6799,
30004,
13,
1678,
822,
413,
3493,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
3617,
278,
529,
29968,
14936,
29958,
2777,
22993,
13,
4706,
14550,
30004,
13,
4706,
413,
29879,
29922,
9136,
29898,
29565,
6825,
29918,
29931,
19704,
29892,
1311,
467,
29895,
3493,
30004,
13,
4706,
341,
29900,
29922,
2039,
29889,
29890,
29961,
29896,
16261,
29906,
29889,
29900,
30004,
13,
4706,
476,
29900,
7607,
2039,
29889,
29890,
29961,
29900,
10062,
29906,
29930,
2039,
29889,
29890,
29961,
29896,
2314,
29914,
29941,
29889,
29900,
30004,
13,
4706,
274,
29953,
29894,
29887,
29922,
29907,
29953,
29894,
4782,
26471,
13,
30004,
13,
4706,
341,
29922,
2636,
30004,
13,
4706,
476,
29922,
2636,
30004,
13,
4706,
363,
474,
297,
921,
3881,
29898,
29953,
1125,
30004,
13,
9651,
341,
29889,
4397,
29898,
29883,
29953,
29894,
29887,
29889,
627,
265,
29968,
29898,
29924,
29900,
29892,
29875,
876,
30004,
13,
9651,
476,
29889,
4397,
29898,
29883,
29953,
29894,
29887,
29889,
627,
265,
29968,
29898,
29968,
29900,
29892,
29875,
876,
30004,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29924,
2033,
29922,
29924,
30004,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29968,
2033,
29922,
29968,
30004,
13,
4706,
413,
29879,
29889,
1509,
2972,
29898,
29883,
29953,
29894,
29887,
8443,
13,
4706,
736,
413,
29879,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
1990,
678,
475,
29898,
29931,
19704,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
365,
19704,
310,
678,
475,
22993,
13,
30004,
13,
1678,
1281,
4984,
30004,
13,
1678,
448,
9072,
5634,
30004,
13,
1678,
678,
475,
29898,
29940,
29892,
29874,
7607,
29896,
9774,
4117,
4835,
11759,
29898,
29900,
1696,
29900,
1846,
2314,
30004,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
29940,
29892,
29874,
7607,
29896,
9774,
4117,
4835,
11759,
29898,
29900,
1846,
29962,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
405,
29901,
30004,
13,
9651,
9681,
310,
9101,
29892,
6043,
22993,
13,
4706,
263,
29901,
30004,
13,
9651,
365,
19704,
4608,
29892,
29871,
29896,
29928,
1409,
22993,
13,
4706,
6635,
4835,
29901,
30004,
13,
9651,
2180,
290,
11909,
297,
263,
5190,
3038,
22993,
13,
4706,
14550,
30004,
13,
4706,
2428,
29898,
14688,
29892,
1311,
467,
1649,
2344,
12035,
29874,
11759,
29874,
1402,
29940,
11759,
29940,
1402,
978,
2433,
14153,
742,
4117,
4835,
29922,
4117,
4835,
8443,
13,
30004,
13,
1678,
732,
6799,
30004,
13,
1678,
822,
413,
3493,
29898,
1311,
1125,
30004,
13,
4706,
14550,
1576,
529,
29968,
14936,
29958,
2777,
3928,
304,
263,
9704,
29889,
12008,
30004,
13,
4706,
263,
29922,
1311,
29889,
29874,
29961,
29900,
29962,
30004,
13,
4706,
289,
29922,
29906,
29930,
1631,
29930,
29874,
29914,
29874,
29889,
6333,
29898,
29874,
8443,
13,
4706,
413,
29879,
29922,
29968,
14936,
29898,
29940,
29922,
1311,
29889,
29940,
29892,
29890,
29922,
29890,
8443,
13,
4706,
413,
29879,
29889,
18732,
29918,
9748,
1839,
29968,
2033,
29922,
2378,
4197,
29899,
29890,
29914,
29906,
1696,
29890,
29914,
29906,
29889,
2314,
30004,
13,
4706,
736,
413,
29879,
30004,
13,
30004,
13,
30004,
13,
1753,
3386,
29918,
29880,
19704,
29898,
29940,
29892,
29880,
19704,
29918,
12181,
2433,
742,
29874,
29922,
8516,
29892,
4117,
4835,
29922,
8516,
29892,
5085,
3790,
29913,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
853,
5560,
3386,
1158,
363,
24094,
22993,
13,
30004,
13,
1678,
405,
29901,
30004,
13,
4706,
450,
2159,
310,
24094,
22993,
13,
1678,
24094,
29918,
12181,
29901,
30004,
13,
4706,
450,
8267,
310,
24094,
22993,
13,
30004,
13,
4706,
334,
6629,
9651,
1599,
278,
21560,
24094,
22993,
13,
4706,
334,
525,
17619,
29915,
418,
1599,
6862,
24094,
22993,
13,
4706,
334,
525,
29882,
4992,
17743,
29915,
259,
1599,
298,
4992,
17743,
24094,
22993,
13,
4706,
334,
525,
3626,
6825,
29915,
29871,
1599,
3367,
6825,
24094,
22993,
13,
4706,
334,
525,
14153,
29915,
539,
1599,
263,
9704,
22993,
13,
1678,
263,
29901,
30004,
13,
4706,
450,
5190,
4608,
22993,
13,
1678,
6635,
4835,
29901,
30004,
13,
4706,
450,
28422,
297,
263,
5190,
3038,
22993,
13,
1678,
6389,
29901,
30004,
13,
4706,
5901,
6273,
11167,
13,
30004,
13,
4706,
334,
421,
689,
29952,
1599,
278,
883,
1304,
297,
3386,
292,
298,
4992,
17743,
24094,
22993,
13,
1678,
14550,
30004,
13,
1678,
565,
24094,
29918,
12181,
1360,
29915,
2396,
30004,
13,
4706,
4974,
29898,
29874,
338,
451,
6213,
8443,
13,
4706,
565,
6635,
4835,
338,
6213,
29901,
6635,
4835,
29922,
3298,
359,
29898,
12181,
29898,
29874,
9601,
29899,
29896,
2314,
30004,
13,
4706,
736,
365,
19704,
29898,
978,
2433,
25772,
742,
29940,
29922,
29940,
29892,
29874,
29922,
29874,
29892,
4117,
4835,
29922,
4117,
4835,
8443,
13,
1678,
25342,
24094,
29918,
12181,
1360,
29915,
29882,
4992,
17743,
2396,
30004,
13,
4706,
736,
379,
4992,
17743,
29918,
29931,
19704,
29898,
29940,
29922,
29940,
29892,
689,
29922,
5085,
29889,
657,
877,
689,
742,
29896,
876,
30004,
13,
1678,
25342,
24094,
29918,
12181,
1360,
29915,
17619,
2396,
30004,
13,
4706,
565,
6635,
4835,
338,
6213,
29901,
6635,
4835,
29922,
3298,
359,
4197,
29896,
29892,
29906,
2314,
30004,
13,
4706,
736,
19256,
29918,
29931,
19704,
29898,
29940,
29922,
29940,
29892,
4117,
4835,
29922,
4117,
4835,
8443,
13,
1678,
25342,
24094,
29918,
12181,
1360,
29915,
3626,
6825,
2396,
30004,
13,
4706,
565,
6635,
4835,
338,
6213,
29901,
6635,
4835,
29922,
3298,
359,
4197,
29896,
29892,
29906,
2314,
30004,
13,
4706,
736,
8602,
6825,
29918,
29931,
19704,
29898,
29940,
29922,
29940,
29892,
4117,
4835,
29922,
4117,
4835,
8443,
13,
1678,
25342,
24094,
29918,
12181,
1360,
29915,
14153,
2396,
30004,
13,
4706,
565,
263,
338,
6213,
29901,
263,
11759,
29896,
5586,
30004,
13,
4706,
565,
6635,
4835,
338,
6213,
29901,
6635,
4835,
29922,
3298,
359,
4197,
29896,
29892,
29896,
2314,
30004,
13,
4706,
565,
29871,
299,
326,
29898,
29940,
29897,
1360,
29896,
29901,
30004,
13,
9651,
405,
29922,
29940,
29961,
29900,
29962,
30004,
13,
4706,
736,
678,
475,
29898,
29940,
29922,
29940,
29892,
4117,
4835,
29922,
4117,
4835,
8443,
13,
30004,
13,
30004,
13,
1753,
19490,
29918,
29880,
19704,
29898,
29880,
19704,
29892,
29940,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
2538,
675,
278,
24094,
304,
2702,
2159,
22993,
13,
30004,
13,
1678,
24094,
29901,
30004,
13,
4706,
450,
3646,
24094,
22993,
13,
1678,
405,
29901,
30004,
13,
308,
29896,
29928,
448,
1409,
29892,
278,
2159,
310,
716,
24094,
22993,
13,
1678,
14550,
30004,
13,
1678,
736,
3386,
29918,
29880,
19704,
29898,
29874,
29922,
29880,
19704,
29889,
29874,
29892,
29940,
29922,
29940,
29892,
4117,
4835,
29922,
29880,
19704,
29889,
4117,
4835,
29892,
5085,
3790,
29915,
689,
2396,
657,
5552,
29898,
29880,
19704,
5501,
689,
742,
8516,
26972,
30004,
13,
2
] |
teste.py | EduardoFockinkSilva/python-exercises | 0 | 164734 | <gh_stars>0
#test
print('==================================')
print(' this is just a test ')
print('==================================')
num = int(input('insert a number: '))
print((num * 5) % 3)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
1688,
13,
13,
2158,
877,
9166,
9166,
1360,
1495,
13,
2158,
877,
4706,
445,
338,
925,
263,
1243,
539,
25710,
13,
2158,
877,
9166,
9166,
1360,
1495,
13,
13,
1949,
353,
938,
29898,
2080,
877,
7851,
263,
1353,
29901,
525,
876,
13,
13,
2158,
3552,
1949,
334,
29871,
29945,
29897,
1273,
29871,
29941,
29897,
13,
13,
2
] |
src/bbapp/migrations/0004_auto_20190303_1557.py | levinsamuel/baseballdb | 0 | 84901 | <reponame>levinsamuel/baseballdb
# Generated by Django 2.1.7 on 2019-03-03 23:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bbapp', '0003_fielding'),
]
operations = [
migrations.AlterField(
model_name='batting',
name='teamID',
field=models.CharField(max_length=5),
),
]
| [
1,
529,
276,
1112,
420,
29958,
2608,
1144,
314,
2491,
29914,
3188,
5521,
430,
29890,
13,
29937,
3251,
630,
491,
15337,
29871,
29906,
29889,
29896,
29889,
29955,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29941,
29899,
29900,
29941,
29871,
29906,
29941,
29901,
29945,
29955,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
1327,
932,
742,
525,
29900,
29900,
29900,
29941,
29918,
2671,
292,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
29890,
23980,
742,
13,
9651,
1024,
2433,
14318,
1367,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
tests/test_wps_dummy.py | f-PLT/emu | 3 | 14210 | from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for, get_output
from emu.processes.wps_dummy import Dummy
def test_wps_dummy():
client = client_for(Service(processes=[Dummy()]))
datainputs = "input1=10;input2=2"
resp = client.get(
service='WPS', request='Execute', version='1.0.0',
identifier='dummyprocess',
datainputs=datainputs)
assert_response_success(resp)
assert get_output(resp.xml) == {'output1': '11', 'output2': '1'}
| [
1,
515,
282,
5693,
567,
1053,
6692,
13,
3166,
282,
5693,
567,
29889,
21150,
1053,
4974,
29918,
5327,
29918,
8698,
13,
13,
3166,
869,
9435,
1053,
3132,
29918,
1454,
29892,
679,
29918,
4905,
13,
3166,
953,
29884,
29889,
5014,
267,
29889,
29893,
567,
29918,
29881,
11770,
1053,
360,
11770,
13,
13,
13,
1753,
1243,
29918,
29893,
567,
29918,
29881,
11770,
7295,
13,
1678,
3132,
353,
3132,
29918,
1454,
29898,
3170,
29898,
5014,
267,
11759,
29928,
11770,
580,
12622,
13,
1678,
1418,
475,
649,
29879,
353,
376,
2080,
29896,
29922,
29896,
29900,
29936,
2080,
29906,
29922,
29906,
29908,
13,
1678,
4613,
353,
3132,
29889,
657,
29898,
13,
4706,
2669,
2433,
29956,
7024,
742,
2009,
2433,
12296,
742,
1873,
2433,
29896,
29889,
29900,
29889,
29900,
742,
13,
4706,
15882,
2433,
29881,
11770,
5014,
742,
13,
4706,
1418,
475,
649,
29879,
29922,
4130,
475,
649,
29879,
29897,
13,
1678,
4974,
29918,
5327,
29918,
8698,
29898,
13713,
29897,
13,
1678,
4974,
679,
29918,
4905,
29898,
13713,
29889,
3134,
29897,
1275,
11117,
4905,
29896,
2396,
525,
29896,
29896,
742,
525,
4905,
29906,
2396,
525,
29896,
10827,
13,
2
] |
data/split_data_num.py | xiangyue9607/QVE | 4 | 148648 | import json
import random
from argparse import ArgumentParser
from numpy.random import default_rng
parser = ArgumentParser()
parser.add_argument("--in_file", type=str, default="data/NewsQA.train.json",)
parser.add_argument("--out_file_dev", type=str, default="dataNewsQA.sample.dev.json")
parser.add_argument("--out_file_train", type=str, default="data/NewsQA.sample.train.json")
parser.add_argument("--num", type=int, default=1000, required=False)
parser.add_argument("--seed", type=int, default=42, required=False)
args = parser.parse_args()
def subsample_dataset_random(data_json, sample_num=1000, seed=55):
total = 0
context_num=0
id_lists=[]
for paras in data_json['data']:
for para in paras['paragraphs']:
context_num+=1
qa_num = len(para['qas'])
id_lists+=[qa['id'] for qa in para['qas']]
total += qa_num
print('Total QA Num: %d, Total Context: %d' % (total,context_num))
random.seed(seed)
rng = default_rng()
sampled_list = list(rng.choice(id_lists, size=sample_num,replace=False))
new_passages_dev = []
new_passages_train=[]
for passages in data_json['data']:
new_paras_dev = []
new_paras_train = []
for para in passages['paragraphs']:
context = para['context']
new_qas_dev = []
new_qas_train = []
for qa in para['qas']:
if qa['id'] in sampled_list:
new_qas_dev.append(qa)
else:
new_qas_train.append(qa)
if len(new_qas_dev) > 0:
new_paras_dev.append({'context': context, 'qas': new_qas_dev})
if len(new_qas_train) > 0:
new_paras_train.append({'context': context, 'qas': new_qas_train})
if len(new_paras_dev) > 0:
new_passages_dev.append({'title': passages['title'], 'paragraphs': new_paras_dev})
if len(new_paras_train) > 0:
new_passages_train.append({'title': passages['title'], 'paragraphs': new_paras_train})
dev_data_json = {'data': new_passages_dev, 'version': data_json['version']}
train_data_json = {'data': new_passages_train, 'version': data_json['version']}
total = 0
context_num=0
for paras in dev_data_json['data']:
for para in paras['paragraphs']:
context_num+=1
qa_num = len(para['qas'])
id_lists+=[qa['id'] for qa in para['qas']]
total += qa_num
print('Sample Dev QA Num: %d, Total Context: %d' % (total,context_num))
total = 0
context_num = 0
for paras in train_data_json['data']:
for para in paras['paragraphs']:
context_num += 1
qa_num = len(para['qas'])
id_lists += [qa['id'] for qa in para['qas']]
total += qa_num
print('Sample Train QA Num: %d, Total Context: %d' % (total, context_num))
return train_data_json,dev_data_json
def main(args):
dataset = json.load(open(args.in_file, 'r'))
train_data_json,dev_data_json=subsample_dataset_random(dataset, args.num, args.seed)
json.dump(train_data_json, open(args.out_file_train, 'w'))
json.dump(dev_data_json, open(args.out_file_dev, 'w'))
if __name__ == '__main__':
args = parser.parse_args()
random.seed(args.seed)
main(args)
| [
1,
1053,
4390,
30004,
13,
5215,
4036,
30004,
13,
3166,
1852,
5510,
1053,
23125,
11726,
30004,
13,
3166,
12655,
29889,
8172,
1053,
2322,
29918,
29878,
865,
30004,
13,
30004,
13,
16680,
353,
23125,
11726,
26471,
13,
16680,
29889,
1202,
29918,
23516,
703,
489,
262,
29918,
1445,
613,
1134,
29922,
710,
29892,
2322,
543,
1272,
29914,
29328,
29984,
29909,
29889,
14968,
29889,
3126,
613,
8443,
13,
16680,
29889,
1202,
29918,
23516,
703,
489,
449,
29918,
1445,
29918,
3359,
613,
1134,
29922,
710,
29892,
29871,
2322,
543,
1272,
29328,
29984,
29909,
29889,
11249,
29889,
3359,
29889,
3126,
1159,
30004,
13,
16680,
29889,
1202,
29918,
23516,
703,
489,
449,
29918,
1445,
29918,
14968,
613,
1134,
29922,
710,
29892,
2322,
543,
1272,
29914,
29328,
29984,
29909,
29889,
11249,
29889,
14968,
29889,
3126,
1159,
30004,
13,
16680,
29889,
1202,
29918,
23516,
703,
489,
1949,
613,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29900,
29900,
29900,
29892,
3734,
29922,
8824,
8443,
13,
16680,
29889,
1202,
29918,
23516,
703,
489,
26776,
613,
1134,
29922,
524,
29892,
2322,
29922,
29946,
29906,
29892,
3734,
29922,
8824,
8443,
13,
30004,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
26471,
13,
30004,
13,
30004,
13,
1753,
1014,
11249,
29918,
24713,
29918,
8172,
29898,
1272,
29918,
3126,
29892,
4559,
29918,
1949,
29922,
29896,
29900,
29900,
29900,
29892,
16717,
29922,
29945,
29945,
1125,
30004,
13,
30004,
13,
1678,
3001,
353,
29871,
29900,
30004,
13,
1678,
3030,
29918,
1949,
29922,
29900,
30004,
13,
1678,
1178,
29918,
21513,
29922,
2636,
30004,
13,
1678,
363,
610,
294,
297,
848,
29918,
3126,
1839,
1272,
2033,
29901,
30004,
13,
4706,
363,
1702,
297,
610,
294,
1839,
26956,
29879,
2033,
29901,
30004,
13,
9651,
3030,
29918,
1949,
23661,
29896,
30004,
13,
9651,
3855,
29874,
29918,
1949,
353,
7431,
29898,
22752,
1839,
29939,
294,
2033,
8443,
13,
9651,
1178,
29918,
21513,
29974,
11759,
25621,
1839,
333,
2033,
363,
3855,
29874,
297,
1702,
1839,
29939,
294,
2033,
29962,
30004,
13,
9651,
3001,
4619,
3855,
29874,
29918,
1949,
30004,
13,
1678,
1596,
877,
11536,
660,
29909,
11848,
29901,
1273,
29881,
29892,
14990,
15228,
29901,
1273,
29881,
29915,
1273,
313,
7827,
29892,
4703,
29918,
1949,
876,
30004,
13,
30004,
13,
1678,
4036,
29889,
26776,
29898,
26776,
8443,
13,
1678,
364,
865,
353,
2322,
29918,
29878,
865,
26471,
13,
1678,
4559,
29881,
29918,
1761,
353,
1051,
29898,
29878,
865,
29889,
16957,
29898,
333,
29918,
21513,
29892,
2159,
29922,
11249,
29918,
1949,
29892,
6506,
29922,
8824,
876,
30004,
13,
1678,
716,
29918,
3364,
1179,
29918,
3359,
353,
5159,
30004,
13,
1678,
716,
29918,
3364,
1179,
29918,
14968,
29922,
2636,
30004,
13,
30004,
13,
1678,
363,
1209,
1179,
297,
848,
29918,
3126,
1839,
1272,
2033,
29901,
30004,
13,
4706,
716,
29918,
862,
294,
29918,
3359,
353,
5159,
30004,
13,
4706,
716,
29918,
862,
294,
29918,
14968,
353,
5159,
30004,
13,
30004,
13,
4706,
363,
1702,
297,
1209,
1179,
1839,
26956,
29879,
2033,
29901,
30004,
13,
9651,
3030,
353,
1702,
1839,
4703,
2033,
30004,
13,
9651,
716,
29918,
29939,
294,
29918,
3359,
353,
5159,
30004,
13,
9651,
716,
29918,
29939,
294,
29918,
14968,
353,
5159,
30004,
13,
30004,
13,
9651,
363,
3855,
29874,
297,
1702,
1839,
29939,
294,
2033,
29901,
30004,
13,
18884,
565,
3855,
29874,
1839,
333,
2033,
297,
4559,
29881,
29918,
1761,
29901,
30004,
13,
462,
1678,
716,
29918,
29939,
294,
29918,
3359,
29889,
4397,
29898,
25621,
8443,
13,
18884,
1683,
29901,
30004,
13,
462,
1678,
716,
29918,
29939,
294,
29918,
14968,
29889,
4397,
29898,
25621,
8443,
13,
30004,
13,
9651,
565,
7431,
29898,
1482,
29918,
29939,
294,
29918,
3359,
29897,
1405,
29871,
29900,
29901,
30004,
13,
18884,
716,
29918,
862,
294,
29918,
3359,
29889,
4397,
3319,
29915,
4703,
2396,
3030,
29892,
525,
29939,
294,
2396,
716,
29918,
29939,
294,
29918,
3359,
1800,
30004,
13,
9651,
565,
7431,
29898,
1482,
29918,
29939,
294,
29918,
14968,
29897,
1405,
29871,
29900,
29901,
30004,
13,
18884,
716,
29918,
862,
294,
29918,
14968,
29889,
4397,
3319,
29915,
4703,
2396,
3030,
29892,
525,
29939,
294,
2396,
716,
29918,
29939,
294,
29918,
14968,
1800,
30004,
13,
30004,
13,
4706,
565,
7431,
29898,
1482,
29918,
862,
294,
29918,
3359,
29897,
1405,
29871,
29900,
29901,
30004,
13,
9651,
716,
29918,
3364,
1179,
29918,
3359,
29889,
4397,
3319,
29915,
3257,
2396,
1209,
1179,
1839,
3257,
7464,
525,
26956,
29879,
2396,
716,
29918,
862,
294,
29918,
3359,
1800,
30004,
13,
30004,
13,
4706,
565,
7431,
29898,
1482,
29918,
862,
294,
29918,
14968,
29897,
1405,
29871,
29900,
29901,
30004,
13,
9651,
716,
29918,
3364,
1179,
29918,
14968,
29889,
4397,
3319,
29915,
3257,
2396,
1209,
1179,
1839,
3257,
7464,
525,
26956,
29879,
2396,
716,
29918,
862,
294,
29918,
14968,
1800,
30004,
13,
30004,
13,
1678,
2906,
29918,
1272,
29918,
3126,
353,
11117,
1272,
2396,
716,
29918,
3364,
1179,
29918,
3359,
29892,
525,
3259,
2396,
848,
29918,
3126,
1839,
3259,
2033,
8117,
13,
1678,
7945,
29918,
1272,
29918,
3126,
353,
11117,
1272,
2396,
716,
29918,
3364,
1179,
29918,
14968,
29892,
525,
3259,
2396,
848,
29918,
3126,
1839,
3259,
2033,
8117,
13,
30004,
13,
1678,
3001,
353,
29871,
29900,
30004,
13,
1678,
3030,
29918,
1949,
29922,
29900,
30004,
13,
1678,
363,
610,
294,
297,
2906,
29918,
1272,
29918,
3126,
1839,
1272,
2033,
29901,
30004,
13,
4706,
363,
1702,
297,
610,
294,
1839,
26956,
29879,
2033,
29901,
30004,
13,
9651,
3030,
29918,
1949,
23661,
29896,
30004,
13,
9651,
3855,
29874,
29918,
1949,
353,
7431,
29898,
22752,
1839,
29939,
294,
2033,
8443,
13,
9651,
1178,
29918,
21513,
29974,
11759,
25621,
1839,
333,
2033,
363,
3855,
29874,
297,
1702,
1839,
29939,
294,
2033,
29962,
30004,
13,
9651,
3001,
4619,
3855,
29874,
29918,
1949,
30004,
13,
1678,
1596,
877,
17708,
9481,
660,
29909,
11848,
29901,
1273,
29881,
29892,
14990,
15228,
29901,
1273,
29881,
29915,
1273,
313,
7827,
29892,
4703,
29918,
1949,
876,
30004,
13,
30004,
13,
1678,
3001,
353,
29871,
29900,
30004,
13,
1678,
3030,
29918,
1949,
353,
29871,
29900,
30004,
13,
1678,
363,
610,
294,
297,
7945,
29918,
1272,
29918,
3126,
1839,
1272,
2033,
29901,
30004,
13,
4706,
363,
1702,
297,
610,
294,
1839,
26956,
29879,
2033,
29901,
30004,
13,
9651,
3030,
29918,
1949,
4619,
29871,
29896,
30004,
13,
9651,
3855,
29874,
29918,
1949,
353,
7431,
29898,
22752,
1839,
29939,
294,
2033,
8443,
13,
9651,
1178,
29918,
21513,
4619,
518,
25621,
1839,
333,
2033,
363,
3855,
29874,
297,
1702,
1839,
29939,
294,
2033,
29962,
30004,
13,
9651,
3001,
4619,
3855,
29874,
29918,
1949,
30004,
13,
1678,
1596,
877,
17708,
28186,
660,
29909,
11848,
29901,
1273,
29881,
29892,
14990,
15228,
29901,
1273,
29881,
29915,
1273,
313,
7827,
29892,
3030,
29918,
1949,
876,
30004,
13,
30004,
13,
1678,
736,
7945,
29918,
1272,
29918,
3126,
29892,
3359,
29918,
1272,
29918,
3126,
30004,
13,
30004,
13,
1753,
1667,
29898,
5085,
1125,
30004,
13,
30004,
13,
1678,
8783,
353,
4390,
29889,
1359,
29898,
3150,
29898,
5085,
29889,
262,
29918,
1445,
29892,
525,
29878,
8785,
30004,
13,
30004,
13,
1678,
7945,
29918,
1272,
29918,
3126,
29892,
3359,
29918,
1272,
29918,
3126,
29922,
1491,
11249,
29918,
24713,
29918,
8172,
29898,
24713,
29892,
6389,
29889,
1949,
29892,
6389,
29889,
26776,
8443,
13,
30004,
13,
1678,
4390,
29889,
15070,
29898,
14968,
29918,
1272,
29918,
3126,
29892,
1722,
29898,
5085,
29889,
449,
29918,
1445,
29918,
14968,
29892,
525,
29893,
8785,
30004,
13,
1678,
4390,
29889,
15070,
29898,
3359,
29918,
1272,
29918,
3126,
29892,
1722,
29898,
5085,
29889,
449,
29918,
1445,
29918,
3359,
29892,
525,
29893,
8785,
30004,
13,
30004,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
30004,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
26471,
13,
1678,
4036,
29889,
26776,
29898,
5085,
29889,
26776,
8443,
13,
1678,
1667,
29898,
5085,
8443,
13,
2
] |
code/ch14/chord.py | raionik/Py4Bio | 66 | 65754 | <filename>code/ch14/chord.py
from bokeh.charts import output_file, Chord
from bokeh.io import show
import pandas as pd
data = pd.read_csv('../../samples/test3.csv')
chord_from_df = Chord(data, source='name_x', target='name_y',
value='value')
output_file('chord.html')
show(chord_from_df)
| [
1,
529,
9507,
29958,
401,
29914,
305,
29896,
29946,
29914,
305,
536,
29889,
2272,
13,
3166,
1045,
446,
29882,
29889,
18366,
1053,
1962,
29918,
1445,
29892,
678,
536,
13,
3166,
1045,
446,
29882,
29889,
601,
1053,
1510,
13,
5215,
11701,
408,
10518,
13,
1272,
353,
10518,
29889,
949,
29918,
7638,
877,
21546,
27736,
29914,
1688,
29941,
29889,
7638,
1495,
13,
305,
536,
29918,
3166,
29918,
2176,
353,
678,
536,
29898,
1272,
29892,
2752,
2433,
978,
29918,
29916,
742,
3646,
2433,
978,
29918,
29891,
742,
13,
462,
418,
995,
2433,
1767,
1495,
13,
4905,
29918,
1445,
877,
305,
536,
29889,
1420,
1495,
13,
4294,
29898,
305,
536,
29918,
3166,
29918,
2176,
29897,
13,
2
] |
var/spack/repos/builtin/packages/perl-ipc-run/package.py | adrianjhpc/spack | 2 | 8105 | <reponame>adrianjhpc/spack
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlIpcRun(PerlPackage):
"""IPC::Run allows you to run and interact with child processes using
files, pipes, and pseudo-ttys. Both system()-style and scripted usages are
supported and may be mixed. Likewise, functional and OO API styles are both
supported and may be mixed."""
homepage = "https://metacpan.org/pod/IPC::Run"
url = "https://cpan.metacpan.org/authors/id/T/TO/TODDR/IPC-Run-20180523.0.tar.gz"
version('20180523.0', sha256='3850d7edf8a4671391c6e99bb770698e1c45da55b323b31c76310913349b6c2f')
depends_on('perl-io-tty', type=('build', 'run'))
depends_on('perl-readonly', type='build')
| [
1,
529,
276,
1112,
420,
29958,
328,
6392,
29926,
29882,
6739,
29914,
1028,
547,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29941,
29899,
29906,
29900,
29896,
29929,
19520,
22469,
5514,
3086,
14223,
29892,
365,
12182,
322,
916,
13,
29937,
1706,
547,
8010,
10682,
414,
29889,
2823,
278,
2246,
29899,
5563,
315,
4590,
29979,
22789,
3912,
934,
363,
4902,
29889,
13,
29937,
13,
29937,
10937,
29928,
29990,
29899,
29931,
293,
1947,
29899,
12889,
29901,
313,
17396,
1829,
29899,
29906,
29889,
29900,
6323,
341,
1806,
29897,
13,
13,
3166,
805,
547,
1053,
334,
13,
13,
13,
1990,
23907,
29902,
6739,
6558,
29898,
5894,
29880,
14459,
1125,
13,
1678,
9995,
5690,
29907,
1057,
6558,
6511,
366,
304,
1065,
322,
16254,
411,
2278,
10174,
773,
13,
1678,
2066,
29892,
8450,
267,
29892,
322,
17381,
29899,
698,
952,
29889,
9134,
1788,
580,
29899,
3293,
322,
2471,
287,
502,
1179,
526,
13,
1678,
6969,
322,
1122,
367,
12849,
29889,
8502,
3538,
29892,
13303,
322,
438,
29949,
3450,
11949,
526,
1716,
13,
1678,
6969,
322,
1122,
367,
12849,
1213,
15945,
13,
13,
1678,
3271,
3488,
353,
376,
991,
597,
2527,
562,
8357,
29889,
990,
29914,
15334,
29914,
5690,
29907,
1057,
6558,
29908,
13,
1678,
3142,
418,
353,
376,
991,
597,
6814,
273,
29889,
2527,
562,
8357,
29889,
990,
29914,
5150,
943,
29914,
333,
29914,
29911,
29914,
4986,
29914,
4986,
7858,
29934,
29914,
5690,
29907,
29899,
6558,
29899,
29906,
29900,
29896,
29947,
29900,
29945,
29906,
29941,
29889,
29900,
29889,
12637,
29889,
18828,
29908,
13,
13,
1678,
1873,
877,
29906,
29900,
29896,
29947,
29900,
29945,
29906,
29941,
29889,
29900,
742,
528,
29874,
29906,
29945,
29953,
2433,
29941,
29947,
29945,
29900,
29881,
29955,
287,
29888,
29947,
29874,
29946,
29953,
29955,
29896,
29941,
29929,
29896,
29883,
29953,
29872,
29929,
29929,
1327,
29955,
29955,
29900,
29953,
29929,
29947,
29872,
29896,
29883,
29946,
29945,
1388,
29945,
29945,
29890,
29941,
29906,
29941,
29890,
29941,
29896,
29883,
29955,
29953,
29941,
29896,
29900,
29929,
29896,
29941,
29941,
29946,
29929,
29890,
29953,
29883,
29906,
29888,
1495,
13,
13,
1678,
7111,
29918,
265,
877,
22032,
29899,
601,
29899,
4349,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
22032,
29899,
949,
6194,
742,
1134,
2433,
4282,
1495,
13,
2
] |
testing/logging/test_formatter.py | christian-steinmeyer/pytest | 4 | 24001 | import logging
from typing import Any
from _pytest._io import TerminalWriter
from _pytest.logging import ColoredLevelFormatter
def test_coloredlogformatter() -> None:
logfmt = "%(filename)-25s %(lineno)4d %(levelname)-8s %(message)s"
record = logging.LogRecord(
name="dummy",
level=logging.INFO,
pathname="dummypath",
lineno=10,
msg="Test Message",
args=(),
exc_info=None,
)
class ColorConfig:
class option:
pass
tw = TerminalWriter()
tw.hasmarkup = True
formatter = ColoredLevelFormatter(tw, logfmt)
output = formatter.format(record)
assert output == (
"dummypath 10 \x1b[32mINFO \x1b[0m Test Message"
)
tw.hasmarkup = False
formatter = ColoredLevelFormatter(tw, logfmt)
output = formatter.format(record)
assert output == ("dummypath 10 INFO Test Message")
def test_multiline_message() -> None:
from _pytest.logging import PercentStyleMultiline
logfmt = "%(filename)-25s %(lineno)4d %(levelname)-8s %(message)s"
record: Any = logging.LogRecord(
name="dummy",
level=logging.INFO,
pathname="dummypath",
lineno=10,
msg="Test Message line1\nline2",
args=(),
exc_info=None,
)
# this is called by logging.Formatter.format
record.message = record.getMessage()
ai_on_style = PercentStyleMultiline(logfmt, True)
output = ai_on_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\n"
" line2"
)
ai_off_style = PercentStyleMultiline(logfmt, False)
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\nline2"
)
ai_none_style = PercentStyleMultiline(logfmt, None)
output = ai_none_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\nline2"
)
record.auto_indent = False
output = ai_on_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\nline2"
)
record.auto_indent = True
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\n"
" line2"
)
record.auto_indent = "False"
output = ai_on_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\nline2"
)
record.auto_indent = "True"
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\n"
" line2"
)
# bad string values default to False
record.auto_indent = "junk"
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\nline2"
)
# anything other than string or int will default to False
record.auto_indent = dict()
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\nline2"
)
record.auto_indent = "5"
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\n line2"
)
record.auto_indent = 5
output = ai_off_style.format(record)
assert output == (
"dummypath 10 INFO Test Message line1\n line2"
)
def test_colored_short_level() -> None:
logfmt = "%(levelname).1s %(message)s"
record = logging.LogRecord(
name="dummy",
level=logging.INFO,
pathname="dummypath",
lineno=10,
msg="Test Message",
args=(),
exc_info=None,
)
class ColorConfig:
class option:
pass
tw = TerminalWriter()
tw.hasmarkup = True
formatter = ColoredLevelFormatter(tw, logfmt)
output = formatter.format(record)
# the I (of INFO) is colored
assert output == ("\x1b[32mI\x1b[0m Test Message")
| [
1,
1053,
12183,
13,
3166,
19229,
1053,
3139,
13,
13,
3166,
903,
2272,
1688,
3032,
601,
1053,
29175,
10507,
13,
3166,
903,
2272,
1688,
29889,
21027,
1053,
1530,
4395,
10108,
18522,
13,
13,
13,
1753,
1243,
29918,
2780,
287,
1188,
689,
2620,
580,
1599,
6213,
29901,
13,
1678,
1480,
23479,
353,
11860,
29898,
9507,
6817,
29906,
29945,
29879,
1273,
29898,
1915,
8154,
29897,
29946,
29881,
1273,
29898,
5563,
978,
6817,
29947,
29879,
1273,
29898,
4906,
29897,
29879,
29908,
13,
13,
1678,
2407,
353,
12183,
29889,
3403,
9182,
29898,
13,
4706,
1024,
543,
29881,
11770,
613,
13,
4706,
3233,
29922,
21027,
29889,
11690,
29892,
13,
4706,
2224,
978,
543,
29881,
11770,
2084,
613,
13,
4706,
6276,
8154,
29922,
29896,
29900,
29892,
13,
4706,
10191,
543,
3057,
7777,
613,
13,
4706,
6389,
29922,
3285,
13,
4706,
5566,
29918,
3888,
29922,
8516,
29892,
13,
1678,
1723,
13,
13,
1678,
770,
9159,
3991,
29901,
13,
4706,
770,
2984,
29901,
13,
9651,
1209,
13,
13,
1678,
3252,
353,
29175,
10507,
580,
13,
1678,
3252,
29889,
5349,
3502,
786,
353,
5852,
13,
1678,
883,
2620,
353,
1530,
4395,
10108,
18522,
29898,
7516,
29892,
1480,
23479,
29897,
13,
1678,
1962,
353,
883,
2620,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
320,
29916,
29896,
29890,
29961,
29941,
29906,
29885,
11690,
1678,
320,
29916,
29896,
29890,
29961,
29900,
29885,
4321,
7777,
29908,
13,
1678,
1723,
13,
13,
1678,
3252,
29889,
5349,
3502,
786,
353,
7700,
13,
1678,
883,
2620,
353,
1530,
4395,
10108,
18522,
29898,
7516,
29892,
1480,
23479,
29897,
13,
1678,
1962,
353,
883,
2620,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
4852,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1159,
13,
13,
13,
1753,
1243,
29918,
4713,
309,
457,
29918,
4906,
580,
1599,
6213,
29901,
13,
1678,
515,
903,
2272,
1688,
29889,
21027,
1053,
2431,
1760,
5568,
6857,
309,
457,
13,
13,
1678,
1480,
23479,
353,
11860,
29898,
9507,
6817,
29906,
29945,
29879,
1273,
29898,
1915,
8154,
29897,
29946,
29881,
1273,
29898,
5563,
978,
6817,
29947,
29879,
1273,
29898,
4906,
29897,
29879,
29908,
13,
13,
1678,
2407,
29901,
3139,
353,
12183,
29889,
3403,
9182,
29898,
13,
4706,
1024,
543,
29881,
11770,
613,
13,
4706,
3233,
29922,
21027,
29889,
11690,
29892,
13,
4706,
2224,
978,
543,
29881,
11770,
2084,
613,
13,
4706,
6276,
8154,
29922,
29896,
29900,
29892,
13,
4706,
10191,
543,
3057,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
613,
13,
4706,
6389,
29922,
3285,
13,
4706,
5566,
29918,
3888,
29922,
8516,
29892,
13,
1678,
1723,
13,
1678,
396,
445,
338,
2000,
491,
12183,
29889,
18522,
29889,
4830,
13,
1678,
2407,
29889,
4906,
353,
2407,
29889,
28983,
580,
13,
13,
1678,
7468,
29918,
265,
29918,
3293,
353,
2431,
1760,
5568,
6857,
309,
457,
29898,
1188,
23479,
29892,
5852,
29897,
13,
1678,
1962,
353,
7468,
29918,
265,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
29908,
13,
4706,
376,
462,
462,
4706,
1196,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
7468,
29918,
2696,
29918,
3293,
353,
2431,
1760,
5568,
6857,
309,
457,
29898,
1188,
23479,
29892,
7700,
29897,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
7468,
29918,
9290,
29918,
3293,
353,
2431,
1760,
5568,
6857,
309,
457,
29898,
1188,
23479,
29892,
6213,
29897,
13,
1678,
1962,
353,
7468,
29918,
9290,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
7700,
13,
1678,
1962,
353,
7468,
29918,
265,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
5852,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
29908,
13,
4706,
376,
462,
462,
4706,
1196,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
376,
8824,
29908,
13,
1678,
1962,
353,
7468,
29918,
265,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
376,
5574,
29908,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
29908,
13,
4706,
376,
462,
462,
4706,
1196,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
396,
4319,
1347,
1819,
2322,
304,
7700,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
376,
29926,
2960,
29908,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
396,
3099,
916,
1135,
1347,
470,
938,
674,
2322,
304,
7700,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
9657,
580,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
1220,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
376,
29945,
29908,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
268,
1196,
29906,
29908,
13,
1678,
1723,
13,
13,
1678,
2407,
29889,
6921,
29918,
12860,
353,
29871,
29945,
13,
1678,
1962,
353,
7468,
29918,
2696,
29918,
3293,
29889,
4830,
29898,
11651,
29897,
13,
1678,
4974,
1962,
1275,
313,
13,
4706,
376,
29881,
11770,
2084,
462,
1678,
29896,
29900,
15233,
268,
4321,
7777,
1196,
29896,
29905,
29876,
268,
1196,
29906,
29908,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
2780,
287,
29918,
12759,
29918,
5563,
580,
1599,
6213,
29901,
13,
1678,
1480,
23479,
353,
11860,
29898,
5563,
978,
467,
29896,
29879,
1273,
29898,
4906,
29897,
29879,
29908,
13,
13,
1678,
2407,
353,
12183,
29889,
3403,
9182,
29898,
13,
4706,
1024,
543,
29881,
11770,
613,
13,
4706,
3233,
29922,
21027,
29889,
11690,
29892,
13,
4706,
2224,
978,
543,
29881,
11770,
2084,
613,
13,
4706,
6276,
8154,
29922,
29896,
29900,
29892,
13,
4706,
10191,
543,
3057,
7777,
613,
13,
4706,
6389,
29922,
3285,
13,
4706,
5566,
29918,
3888,
29922,
8516,
29892,
13,
1678,
1723,
13,
13,
1678,
770,
9159,
3991,
29901,
13,
4706,
770,
2984,
29901,
13,
9651,
1209,
13,
13,
1678,
3252,
353,
29175,
10507,
580,
13,
1678,
3252,
29889,
5349,
3502,
786,
353,
5852,
13,
1678,
883,
2620,
353,
1530,
4395,
10108,
18522,
29898,
7516,
29892,
1480,
23479,
29897,
13,
1678,
1962,
353,
883,
2620,
29889,
4830,
29898,
11651,
29897,
13,
1678,
396,
278,
306,
313,
974,
15233,
29897,
338,
28684,
13,
1678,
4974,
1962,
1275,
4852,
29905,
29916,
29896,
29890,
29961,
29941,
29906,
29885,
29902,
29905,
29916,
29896,
29890,
29961,
29900,
29885,
4321,
7777,
1159,
13,
2
] |
waffle/defaults.py | PrimarySite/django-waffle | 0 | 199550 | from __future__ import unicode_literals
COOKIE = 'dwf_%s'
TEST_COOKIE = 'dwft_%s'
SECURE = True
MAX_AGE = 2592000 # 1 month in seconds
CACHE_PREFIX = 'waffle:'
CACHE_NAME = 'default'
FLAG_CACHE_KEY = 'flag:%s'
FLAG_USERS_CACHE_KEY = 'flag:%s:users'
FLAG_GROUPS_CACHE_KEY = 'flag:%s:groups'
ALL_FLAGS_CACHE_KEY = 'flags:all'
SAMPLE_CACHE_KEY = 'sample:%s'
ALL_SAMPLES_CACHE_KEY = 'samples:all'
SWITCH_CACHE_KEY = 'switch:%s'
ALL_SWITCHES_CACHE_KEY = 'switches:all'
FLAG_DEFAULT = False
SAMPLE_DEFAULT = False
SWITCH_DEFAULT = False
READ_FROM_WRITE_DB = False
CREATE_MISSING_FLAGS = False
CREATE_MISSING_SAMPLES = False
CREATE_MISSING_SWITCHES = False
LOG_MISSING_FLAGS = None
LOG_MISSING_SAMPLES = None
LOG_MISSING_SWITCHES = None
OVERRIDE = False
UNIQUE_FLAG_NAME = True
| [
1,
515,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
13,
3217,
8949,
8673,
353,
525,
28012,
29888,
29918,
29995,
29879,
29915,
13,
18267,
29918,
3217,
8949,
8673,
353,
525,
28012,
615,
29918,
29995,
29879,
29915,
13,
1660,
29907,
11499,
353,
5852,
13,
12648,
29918,
10461,
353,
29871,
29906,
29945,
29929,
29906,
29900,
29900,
29900,
29871,
396,
29871,
29896,
4098,
297,
6923,
13,
13,
29907,
2477,
9606,
29918,
15094,
25634,
353,
525,
2766,
600,
280,
11283,
13,
29907,
2477,
9606,
29918,
5813,
353,
525,
4381,
29915,
13,
26516,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
15581,
16664,
29879,
29915,
13,
26516,
29918,
11889,
29903,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
15581,
16664,
29879,
29901,
7193,
29915,
13,
26516,
29918,
26284,
29903,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
15581,
16664,
29879,
29901,
13155,
29915,
13,
9818,
29918,
18823,
10749,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
15764,
29901,
497,
29915,
13,
8132,
3580,
1307,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
11249,
16664,
29879,
29915,
13,
9818,
29918,
8132,
3580,
17101,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
27736,
29901,
497,
29915,
13,
23066,
1806,
3210,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
15123,
16664,
29879,
29915,
13,
9818,
29918,
23066,
1806,
3210,
2890,
29918,
29907,
2477,
9606,
29918,
10818,
353,
525,
15123,
267,
29901,
497,
29915,
13,
13,
26516,
29918,
23397,
353,
7700,
13,
8132,
3580,
1307,
29918,
23397,
353,
7700,
13,
23066,
1806,
3210,
29918,
23397,
353,
7700,
13,
13,
16310,
29918,
21482,
29918,
16365,
29918,
4051,
353,
7700,
13,
13,
27045,
29918,
10403,
1799,
4214,
29918,
18823,
10749,
353,
7700,
13,
27045,
29918,
10403,
1799,
4214,
29918,
8132,
3580,
17101,
353,
7700,
13,
27045,
29918,
10403,
1799,
4214,
29918,
23066,
1806,
3210,
2890,
353,
7700,
13,
13,
14480,
29918,
10403,
1799,
4214,
29918,
18823,
10749,
353,
6213,
13,
14480,
29918,
10403,
1799,
4214,
29918,
8132,
3580,
17101,
353,
6213,
13,
14480,
29918,
10403,
1799,
4214,
29918,
23066,
1806,
3210,
2890,
353,
6213,
13,
13,
29949,
5348,
29934,
22027,
353,
7700,
13,
13,
3904,
29902,
11144,
29918,
26516,
29918,
5813,
353,
5852,
13,
2
] |
magda/pipeline/parallel/group/group.py | p-mielniczuk/magda | 0 | 1606451 | <filename>magda/pipeline/parallel/group/group.py
from __future__ import annotations
from typing import List
from magda.module.module import Module
from magda.pipeline.parallel.group.runtime import GroupRuntime
class Group:
Runtime = GroupRuntime
def __init__(
self, name: str,
*,
replicas: int = 1,
state_type=None,
**options,
):
self.name = name
self.replicas = replicas
self.options = options
self._state_type = state_type
def set_replicas(self, replicas: int) -> Group:
self.replicas = replicas
return self
def set_options(self, **options) -> Group:
self.options = options
return self
@property
def state_type(self):
return self._state_type
@state_type.setter
def state_type(self, state_type):
self._state_type = state_type
def build(
self,
modules: List[Module],
dependent_modules: List[Module],
dependent_modules_nonregular: List[Module],
) -> Group.Runtime:
return self.Runtime(
name=self.name,
modules=modules,
dependent_modules=dependent_modules,
dependent_modules_nonregular=dependent_modules_nonregular,
replicas=self.replicas,
state_type=self.state_type,
options=self.options,
)
| [
1,
529,
9507,
29958,
11082,
1388,
29914,
13096,
5570,
29914,
23482,
29914,
2972,
29914,
2972,
29889,
2272,
13,
3166,
4770,
29888,
9130,
1649,
1053,
25495,
13,
13,
3166,
19229,
1053,
2391,
13,
13,
3166,
2320,
1388,
29889,
5453,
29889,
5453,
1053,
15591,
13,
3166,
2320,
1388,
29889,
13096,
5570,
29889,
23482,
29889,
2972,
29889,
15634,
1053,
6431,
7944,
13,
13,
13,
1990,
6431,
29901,
13,
1678,
24875,
353,
6431,
7944,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
1024,
29901,
851,
29892,
13,
4706,
334,
29892,
13,
4706,
1634,
506,
294,
29901,
938,
353,
29871,
29896,
29892,
13,
4706,
2106,
29918,
1853,
29922,
8516,
29892,
13,
4706,
3579,
6768,
29892,
13,
268,
1125,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
29889,
3445,
506,
294,
353,
1634,
506,
294,
13,
4706,
1583,
29889,
6768,
353,
3987,
13,
4706,
1583,
3032,
3859,
29918,
1853,
353,
2106,
29918,
1853,
13,
13,
1678,
822,
731,
29918,
3445,
506,
294,
29898,
1311,
29892,
1634,
506,
294,
29901,
938,
29897,
1599,
6431,
29901,
13,
4706,
1583,
29889,
3445,
506,
294,
353,
1634,
506,
294,
13,
4706,
736,
1583,
13,
13,
1678,
822,
731,
29918,
6768,
29898,
1311,
29892,
3579,
6768,
29897,
1599,
6431,
29901,
13,
4706,
1583,
29889,
6768,
353,
3987,
13,
4706,
736,
1583,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2106,
29918,
1853,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
3859,
29918,
1853,
13,
13,
1678,
732,
3859,
29918,
1853,
29889,
842,
357,
13,
1678,
822,
2106,
29918,
1853,
29898,
1311,
29892,
2106,
29918,
1853,
1125,
13,
4706,
1583,
3032,
3859,
29918,
1853,
353,
2106,
29918,
1853,
13,
13,
1678,
822,
2048,
29898,
13,
4706,
1583,
29892,
13,
4706,
10585,
29901,
2391,
29961,
7355,
1402,
13,
4706,
14278,
29918,
7576,
29901,
2391,
29961,
7355,
1402,
13,
4706,
14278,
29918,
7576,
29918,
5464,
15227,
29901,
2391,
29961,
7355,
1402,
13,
1678,
1723,
1599,
6431,
29889,
7944,
29901,
13,
4706,
736,
1583,
29889,
7944,
29898,
13,
9651,
1024,
29922,
1311,
29889,
978,
29892,
13,
9651,
10585,
29922,
7576,
29892,
13,
9651,
14278,
29918,
7576,
29922,
18980,
29918,
7576,
29892,
13,
9651,
14278,
29918,
7576,
29918,
5464,
15227,
29922,
18980,
29918,
7576,
29918,
5464,
15227,
29892,
13,
9651,
1634,
506,
294,
29922,
1311,
29889,
3445,
506,
294,
29892,
13,
9651,
2106,
29918,
1853,
29922,
1311,
29889,
3859,
29918,
1853,
29892,
13,
9651,
3987,
29922,
1311,
29889,
6768,
29892,
13,
4706,
1723,
13,
2
] |
Code/GMM Test Scripts/yellowTest.py | Praveen1098/Gaussian_Mixture_Modelling | 0 | 24954 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import numpy as np
from matplotlib import pyplot as plt
import os
import math
def gaussian(x, mu, sig):
return ((1/(sig*math.sqrt(2*math.pi)))*np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.))))
x=list(range(0, 256))
g1=gaussian(x,np.array([239.82]), np.array([2.53]))
g2=gaussian(x,np.array([221.93]), np.array([23.83]))
r2=gaussian(x, np.array([217.47]),np.array([29.43]))
r1=gaussian(x, np.array([230.01]),np.array([3.675]))
b1=gaussian(x, np.array([103.60]),np.array([18.64]))
b2=gaussian(x, np.array([164.96]),np.array([27.56]))
path=os.getcwd()+"/"+"detectbuoy.avi"
c=cv2.VideoCapture(path)
fourcc = cv2.VideoWriter_fourcc(*'MP4V')
out = cv2.VideoWriter('yellowDetection.mp4', fourcc, 15, (640, 480))
while (True):
ret,image=c.read()
if ret==False:
break
b,g,r=cv2.split(image)
if ret == True:
img_out3=np.zeros(g.shape, dtype = np.uint8)
for index, v in np.ndenumerate(g):
av=int((int(v)+int(r[index]))/2)
if ( g1[v]>0.08) and (r1[r[index]] >0.04) and (b1[b[index]]>0.01 ):
img_out3[index]=255
else:
img_out3[index]=0
ret, threshold3 = cv2.threshold(img_out3, 240, 255, cv2.THRESH_BINARY)
kernel3 = np.ones((2,2),np.uint8)
dilation3 = cv2.dilate(threshold3,kernel3,iterations =8)
contours3, _= cv2.findContours(dilation3, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
for contour in contours3:
if cv2.contourArea(contour) > 50:
(x,y),radius = cv2.minEnclosingCircle(contour)
center = (int(x),int(y))
radius = int(radius)
# print(radius)
if radius > 12:
cv2.circle(image,center,radius,(0,255,255),2)
cv2.imshow("Threshold",dilation3)
cv2.imshow('Yellow Ball Segmentation', image)
cv2.imwrite('yellow.jpg', image)
out.write(image)
k = cv2.waitKey(1) & 0xff
if k == 27:
break # wait for ESC key to exit
else:
break
c.release()
out.release()
cv2.destroyAllWindows()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
5215,
13850,
29906,
13,
5215,
12655,
408,
7442,
13,
3166,
22889,
1053,
11451,
5317,
408,
14770,
13,
5215,
2897,
13,
5215,
5844,
13,
13,
1753,
330,
17019,
29898,
29916,
29892,
3887,
29892,
4365,
1125,
13,
1678,
736,
5135,
29896,
14571,
18816,
29930,
755,
29889,
3676,
29898,
29906,
29930,
755,
29889,
1631,
4961,
29930,
9302,
29889,
4548,
6278,
9302,
29889,
13519,
29898,
29916,
448,
3887,
29892,
29871,
29906,
1846,
847,
313,
29906,
334,
7442,
29889,
13519,
29898,
18816,
29892,
29871,
29906,
29889,
13697,
13,
13,
29916,
29922,
1761,
29898,
3881,
29898,
29900,
29892,
29871,
29906,
29945,
29953,
876,
13,
13,
29887,
29896,
29922,
29887,
17019,
29898,
29916,
29892,
9302,
29889,
2378,
4197,
29906,
29941,
29929,
29889,
29947,
29906,
11724,
7442,
29889,
2378,
4197,
29906,
29889,
29945,
29941,
12622,
13,
29887,
29906,
29922,
29887,
17019,
29898,
29916,
29892,
9302,
29889,
2378,
4197,
29906,
29906,
29896,
29889,
29929,
29941,
11724,
7442,
29889,
2378,
4197,
29906,
29941,
29889,
29947,
29941,
12622,
13,
29878,
29906,
29922,
29887,
17019,
29898,
29916,
29892,
7442,
29889,
2378,
4197,
29906,
29896,
29955,
29889,
29946,
29955,
11724,
9302,
29889,
2378,
4197,
29906,
29929,
29889,
29946,
29941,
12622,
13,
29878,
29896,
29922,
29887,
17019,
29898,
29916,
29892,
7442,
29889,
2378,
4197,
29906,
29941,
29900,
29889,
29900,
29896,
11724,
9302,
29889,
2378,
4197,
29941,
29889,
29953,
29955,
29945,
12622,
13,
29890,
29896,
29922,
29887,
17019,
29898,
29916,
29892,
7442,
29889,
2378,
4197,
29896,
29900,
29941,
29889,
29953,
29900,
11724,
9302,
29889,
2378,
4197,
29896,
29947,
29889,
29953,
29946,
12622,
13,
29890,
29906,
29922,
29887,
17019,
29898,
29916,
29892,
7442,
29889,
2378,
4197,
29896,
29953,
29946,
29889,
29929,
29953,
11724,
9302,
29889,
2378,
4197,
29906,
29955,
29889,
29945,
29953,
12622,
13,
13,
2084,
29922,
359,
29889,
657,
29883,
9970,
580,
13578,
12975,
13578,
4801,
522,
2423,
12602,
29889,
17345,
29908,
13,
29883,
29922,
11023,
29906,
29889,
15167,
21133,
545,
29898,
2084,
29897,
13,
17823,
617,
353,
13850,
29906,
29889,
15167,
10507,
29918,
17823,
617,
10456,
29915,
3580,
29946,
29963,
1495,
13,
449,
353,
13850,
29906,
29889,
15167,
10507,
877,
29136,
29928,
2650,
428,
29889,
1526,
29946,
742,
3023,
617,
29892,
29871,
29896,
29945,
29892,
313,
29953,
29946,
29900,
29892,
29871,
29946,
29947,
29900,
876,
13,
13,
8000,
313,
5574,
1125,
13,
1678,
3240,
29892,
3027,
29922,
29883,
29889,
949,
580,
13,
1678,
565,
3240,
1360,
8824,
29901,
13,
4706,
2867,
13,
1678,
289,
29892,
29887,
29892,
29878,
29922,
11023,
29906,
29889,
5451,
29898,
3027,
29897,
13,
1678,
565,
3240,
1275,
5852,
29901,
13,
4706,
10153,
29918,
449,
29941,
29922,
9302,
29889,
3298,
359,
29898,
29887,
29889,
12181,
29892,
26688,
353,
7442,
29889,
13470,
29947,
29897,
539,
13,
4706,
363,
2380,
29892,
325,
297,
7442,
29889,
299,
15172,
29898,
29887,
1125,
13,
462,
1029,
29922,
524,
3552,
524,
29898,
29894,
7240,
524,
29898,
29878,
29961,
2248,
12622,
29914,
29906,
29897,
13,
462,
565,
313,
330,
29896,
29961,
29894,
29962,
29958,
29900,
29889,
29900,
29947,
29897,
322,
313,
29878,
29896,
29961,
29878,
29961,
2248,
5262,
1405,
29900,
29889,
29900,
29946,
29897,
29871,
322,
313,
29890,
29896,
29961,
29890,
29961,
2248,
5262,
29958,
29900,
29889,
29900,
29896,
29871,
1125,
13,
462,
9651,
10153,
29918,
449,
29941,
29961,
2248,
13192,
29906,
29945,
29945,
13,
462,
1683,
29901,
13,
462,
9651,
10153,
29918,
449,
29941,
29961,
2248,
13192,
29900,
259,
13,
4706,
3240,
29892,
16897,
29941,
353,
13850,
29906,
29889,
386,
12268,
29898,
2492,
29918,
449,
29941,
29892,
29871,
29906,
29946,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
13850,
29906,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
29897,
13,
4706,
8466,
29941,
353,
7442,
29889,
2873,
3552,
29906,
29892,
29906,
511,
9302,
29889,
13470,
29947,
29897,
13,
4706,
270,
8634,
29941,
353,
13850,
29906,
29889,
29881,
309,
403,
29898,
386,
12268,
29941,
29892,
17460,
29941,
29892,
1524,
800,
353,
29947,
29897,
13,
4706,
640,
2470,
29941,
29892,
903,
29922,
13850,
29906,
29889,
2886,
1323,
2470,
29898,
29881,
8634,
29941,
29892,
13850,
29906,
29889,
1525,
5659,
29918,
24360,
29892,
13850,
29906,
29889,
3210,
29909,
1177,
29918,
3301,
8618,
29990,
29918,
5425,
3580,
1307,
29897,
13,
268,
13,
4706,
363,
640,
473,
297,
640,
2470,
29941,
29901,
13,
9651,
565,
13850,
29906,
29889,
1285,
473,
13799,
29898,
1285,
473,
29897,
1405,
29871,
29945,
29900,
29901,
13,
18884,
313,
29916,
29892,
29891,
511,
13471,
353,
13850,
29906,
29889,
1195,
2369,
11291,
292,
23495,
280,
29898,
1285,
473,
29897,
13,
18884,
4818,
353,
313,
524,
29898,
29916,
511,
524,
29898,
29891,
876,
13,
18884,
11855,
353,
938,
29898,
13471,
29897,
13,
18884,
396,
1596,
29898,
13471,
29897,
13,
18884,
565,
11855,
1405,
29871,
29896,
29906,
29901,
13,
462,
1678,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
5064,
29892,
13471,
22657,
29900,
29892,
29906,
29945,
29945,
29892,
29906,
29945,
29945,
511,
29906,
29897,
13,
462,
268,
13,
4706,
13850,
29906,
29889,
326,
4294,
703,
1349,
12268,
613,
29881,
8634,
29941,
29897,
13,
4706,
13850,
29906,
29889,
326,
4294,
877,
29979,
4743,
13402,
6667,
358,
362,
742,
1967,
29897,
13,
4706,
13850,
29906,
29889,
326,
3539,
877,
29136,
29889,
6173,
742,
1967,
29897,
13,
4706,
714,
29889,
3539,
29898,
3027,
29897,
13,
4706,
413,
353,
13850,
29906,
29889,
10685,
2558,
29898,
29896,
29897,
669,
29871,
29900,
29916,
600,
13,
4706,
565,
413,
1275,
29871,
29906,
29955,
29901,
13,
9651,
2867,
418,
396,
4480,
363,
382,
7187,
1820,
304,
6876,
13,
1678,
1683,
29901,
13,
4706,
2867,
13,
308,
13,
29883,
29889,
14096,
580,
13,
449,
29889,
14096,
580,
13,
11023,
29906,
29889,
20524,
3596,
7685,
580,
1678,
13,
13,
13,
13,
13,
13,
2
] |
configs/benchmarks/classification/imagenet/imagenet_per_1/r50_sz224_4xb64_head1_lr0_01_step_ep20.py | Westlake-AI/openmixup | 10 | 108070 | <gh_stars>1-10
_base_ = [
'r50_sz224_4xb64_head1_lr0_1_step_ep20.py',
]
# optimizer
optimizer = dict(lr=0.01)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29918,
3188,
29918,
353,
518,
13,
1678,
525,
29878,
29945,
29900,
29918,
3616,
29906,
29906,
29946,
29918,
29946,
29916,
29890,
29953,
29946,
29918,
2813,
29896,
29918,
29212,
29900,
29918,
29896,
29918,
10568,
29918,
1022,
29906,
29900,
29889,
2272,
742,
13,
29962,
13,
13,
29937,
5994,
3950,
13,
20640,
3950,
353,
9657,
29898,
29212,
29922,
29900,
29889,
29900,
29896,
29897,
13,
2
] |
test/utilities/test_contains_none_values.py | elifesciences/profiles | 2 | 1607954 | import pytest
from profiles.utilities import contains_none_values
EMPTY_DICT = {}
DICT_WITH_NONE_VALUE = {'test': None}
DICT_WITH_NESTED_DICTS_WITHOUT_NONE_VALUE = {'test': {'test': {'test': 1}}}
DICT_WITH_NESTED_DICTS_WITH_NONE_VALUE = {'test': {'test': {'test': 1},
'this': {'test': None}}
}
DICT_WITH_NESTED_DICTS_WITH_NONE_VALUE_AND_FOLLOWING_VALUES = {
'test': {'test': {'test': 1},
'this': {'test': {'test': 'this'}},
'and': {'test': {'test': None}},
'that': {'test': 2}}
}
DICT_WITH_NESTED_DICT_AND_LIST_WITH_NONE_VALUE = {
'test': {'test': [1, None, 3]}}
LIST_WITH_NONE_VALUE = [1, '2', None, 4]
LIST_WITHOUT_NONE_VALUE = [1, '2', '3', 4]
LIST_WITH_NESTED_LISTS_WITH_NONE_VALUE_AND_FOLLOWING_VALUES = [
1,
[1, 2, 3],
[1, 2, [1,
2,
None]
],
[1, 2, 3],
4]
@pytest.mark.parametrize('test_data, expected_result', [
(EMPTY_DICT, False),
(DICT_WITH_NONE_VALUE, True),
(DICT_WITH_NESTED_DICTS_WITHOUT_NONE_VALUE, False),
(DICT_WITH_NESTED_DICTS_WITH_NONE_VALUE, True),
(DICT_WITH_NESTED_DICTS_WITH_NONE_VALUE_AND_FOLLOWING_VALUES, True),
(DICT_WITH_NESTED_DICT_AND_LIST_WITH_NONE_VALUE, True),
(LIST_WITH_NONE_VALUE, True),
(LIST_WITHOUT_NONE_VALUE, False),
(LIST_WITH_NESTED_LISTS_WITH_NONE_VALUE_AND_FOLLOWING_VALUES, True)
])
def test_contains_none_values(test_data, expected_result) -> None:
assert contains_none_values(test_data) is expected_result
| [
1,
1053,
11451,
1688,
13,
13,
3166,
28723,
29889,
4422,
1907,
1053,
3743,
29918,
9290,
29918,
5975,
13,
13,
29923,
3580,
15631,
29918,
4571,
1783,
353,
6571,
13,
4571,
1783,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
353,
11117,
1688,
2396,
6213,
29913,
13,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29903,
29918,
29956,
1806,
8187,
2692,
29918,
29940,
12413,
29918,
19143,
353,
11117,
1688,
2396,
11117,
1688,
2396,
11117,
1688,
2396,
29871,
29896,
12499,
13,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29903,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
353,
11117,
1688,
2396,
11117,
1688,
2396,
11117,
1688,
2396,
29871,
29896,
1118,
13,
462,
462,
462,
259,
525,
1366,
2396,
11117,
1688,
2396,
6213,
930,
13,
462,
462,
3986,
500,
13,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29903,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29918,
9468,
29918,
5800,
2208,
9806,
4214,
29918,
8932,
12996,
353,
426,
13,
1678,
525,
1688,
2396,
11117,
1688,
2396,
11117,
1688,
2396,
29871,
29896,
1118,
13,
632,
525,
1366,
2396,
11117,
1688,
2396,
11117,
1688,
2396,
525,
1366,
29915,
11656,
13,
632,
525,
392,
2396,
11117,
1688,
2396,
11117,
1688,
2396,
6213,
11656,
13,
632,
525,
5747,
2396,
11117,
1688,
2396,
29871,
29906,
930,
13,
29913,
13,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29918,
9468,
29918,
24360,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
353,
426,
13,
1678,
525,
1688,
2396,
11117,
1688,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29941,
29962,
930,
13,
13,
24360,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
353,
518,
29896,
29892,
525,
29906,
742,
6213,
29892,
29871,
29946,
29962,
13,
24360,
29918,
29956,
1806,
8187,
2692,
29918,
29940,
12413,
29918,
19143,
353,
518,
29896,
29892,
525,
29906,
742,
525,
29941,
742,
29871,
29946,
29962,
13,
24360,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
24360,
29903,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29918,
9468,
29918,
5800,
2208,
9806,
4214,
29918,
8932,
12996,
353,
518,
13,
268,
29896,
29892,
13,
1678,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
1402,
13,
1678,
518,
29896,
29892,
29871,
29906,
29892,
518,
29896,
29892,
13,
632,
29906,
29892,
13,
9651,
6213,
29962,
13,
268,
21251,
13,
1678,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
1402,
13,
268,
29946,
29962,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
1688,
29918,
1272,
29892,
3806,
29918,
2914,
742,
518,
13,
1678,
313,
29923,
3580,
15631,
29918,
4571,
1783,
29892,
7700,
511,
13,
1678,
313,
4571,
1783,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29892,
5852,
511,
13,
1678,
313,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29903,
29918,
29956,
1806,
8187,
2692,
29918,
29940,
12413,
29918,
19143,
29892,
7700,
511,
13,
1678,
313,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29903,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29892,
5852,
511,
13,
1678,
313,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29903,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29918,
9468,
29918,
5800,
2208,
9806,
4214,
29918,
8932,
12996,
29892,
5852,
511,
13,
1678,
313,
4571,
1783,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
4571,
1783,
29918,
9468,
29918,
24360,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29892,
5852,
511,
13,
1678,
313,
24360,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29892,
5852,
511,
13,
1678,
313,
24360,
29918,
29956,
1806,
8187,
2692,
29918,
29940,
12413,
29918,
19143,
29892,
7700,
511,
13,
1678,
313,
24360,
29918,
29956,
13054,
29918,
8186,
1254,
3352,
29918,
24360,
29903,
29918,
29956,
13054,
29918,
29940,
12413,
29918,
19143,
29918,
9468,
29918,
5800,
2208,
9806,
4214,
29918,
8932,
12996,
29892,
5852,
29897,
13,
2314,
13,
1753,
1243,
29918,
11516,
29918,
9290,
29918,
5975,
29898,
1688,
29918,
1272,
29892,
3806,
29918,
2914,
29897,
1599,
6213,
29901,
13,
1678,
4974,
3743,
29918,
9290,
29918,
5975,
29898,
1688,
29918,
1272,
29897,
338,
3806,
29918,
2914,
13,
2
] |
mailmerge/smtp_dummy.py | Denzeldeveloper/Python-Auto-MailMerge- | 0 | 29996 | """Dummy SMTP API."""
class SMTP_dummy(object): # pylint: disable=useless-object-inheritance
# pylint: disable=invalid-name, no-self-use
"""Dummy SMTP API."""
# Class variables track member function calls for later checking.
msg_from = None
msg_to = None
msg = None
def login(self, login, password):
"""Do nothing."""
def sendmail(self, msg_from, msg_to, msg):
"""Remember the recipients."""
SMTP_dummy.msg_from = msg_from
SMTP_dummy.msg_to = msg_to
SMTP_dummy.msg = msg
def close(self):
"""Do nothing."""
def clear(self):
"""Reset class variables."""
SMTP_dummy.msg_from = None
SMTP_dummy.msg_to = []
SMTP_dummy.msg = None
| [
1,
9995,
29928,
11770,
13766,
3557,
3450,
1213,
15945,
13,
13,
13,
1990,
13766,
3557,
29918,
29881,
11770,
29898,
3318,
1125,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
375,
6393,
29899,
3318,
29899,
262,
27069,
749,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
978,
29892,
694,
29899,
1311,
29899,
1509,
13,
1678,
9995,
29928,
11770,
13766,
3557,
3450,
1213,
15945,
13,
13,
1678,
396,
4134,
3651,
5702,
4509,
740,
5717,
363,
2678,
8454,
29889,
13,
1678,
10191,
29918,
3166,
353,
6213,
13,
1678,
10191,
29918,
517,
353,
6213,
13,
1678,
10191,
353,
6213,
13,
13,
1678,
822,
6464,
29898,
1311,
29892,
6464,
29892,
4800,
1125,
13,
4706,
9995,
6132,
3078,
1213,
15945,
13,
13,
1678,
822,
3638,
2549,
29898,
1311,
29892,
10191,
29918,
3166,
29892,
10191,
29918,
517,
29892,
10191,
1125,
13,
4706,
9995,
7301,
1096,
278,
23957,
10070,
1213,
15945,
13,
4706,
13766,
3557,
29918,
29881,
11770,
29889,
7645,
29918,
3166,
353,
10191,
29918,
3166,
13,
4706,
13766,
3557,
29918,
29881,
11770,
29889,
7645,
29918,
517,
353,
10191,
29918,
517,
13,
4706,
13766,
3557,
29918,
29881,
11770,
29889,
7645,
353,
10191,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
9995,
6132,
3078,
1213,
15945,
13,
13,
1678,
822,
2821,
29898,
1311,
1125,
13,
4706,
9995,
27175,
770,
3651,
1213,
15945,
13,
4706,
13766,
3557,
29918,
29881,
11770,
29889,
7645,
29918,
3166,
353,
6213,
13,
4706,
13766,
3557,
29918,
29881,
11770,
29889,
7645,
29918,
517,
353,
5159,
13,
4706,
13766,
3557,
29918,
29881,
11770,
29889,
7645,
353,
6213,
13,
2
] |
phpme/binx/console.py | eghojansu/phpme | 0 | 39822 | import os, json, subprocess
class Console():
"""Run PHP job"""
def get_interface_methods(namespace):
try:
output = Console.run_command('interface-methods', [namespace])
return json.loads(output)
except Exception as e:
return {}
def get_class_methods(namespace):
try:
output = Console.run_command('class-methods', [namespace])
return json.loads(output)
except Exception as e:
return {}
def get_classes(symbol):
try:
output = Console.run_command('classes', [symbol])
return json.loads(output)
except Exception as e:
return []
def git_config(config):
try:
return subprocess.check_output(['git', 'config', '--get', config]).decode('utf-8')
except Exception as e:
print('[Phpme]', 'error: ' + str(e))
def run_command(command, args):
try:
console = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'console.php'
output = subprocess.check_output(['php', '-f', console, command] + args).decode('utf-8')
if output.startswith('error'):
print('[Phpme]', output)
else:
return output
except Exception as e:
print('[Phpme]', 'error: ' + str(e))
| [
1,
1053,
2897,
29892,
4390,
29892,
1014,
5014,
13,
13,
13,
1990,
9405,
7295,
13,
1678,
9995,
6558,
5048,
4982,
15945,
29908,
13,
13,
1678,
822,
679,
29918,
13248,
29918,
23515,
29898,
22377,
1125,
13,
4706,
1018,
29901,
13,
9651,
1962,
353,
9405,
29889,
3389,
29918,
6519,
877,
13248,
29899,
23515,
742,
518,
22377,
2314,
13,
13,
9651,
736,
4390,
29889,
18132,
29898,
4905,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
736,
6571,
13,
13,
1678,
822,
679,
29918,
1990,
29918,
23515,
29898,
22377,
1125,
13,
4706,
1018,
29901,
13,
9651,
1962,
353,
9405,
29889,
3389,
29918,
6519,
877,
1990,
29899,
23515,
742,
518,
22377,
2314,
13,
13,
9651,
736,
4390,
29889,
18132,
29898,
4905,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
736,
6571,
13,
13,
1678,
822,
679,
29918,
13203,
29898,
18098,
1125,
13,
4706,
1018,
29901,
13,
9651,
1962,
353,
9405,
29889,
3389,
29918,
6519,
877,
13203,
742,
518,
18098,
2314,
13,
13,
9651,
736,
4390,
29889,
18132,
29898,
4905,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
736,
5159,
13,
13,
1678,
822,
6315,
29918,
2917,
29898,
2917,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1014,
5014,
29889,
3198,
29918,
4905,
18959,
5559,
742,
525,
2917,
742,
525,
489,
657,
742,
2295,
14664,
13808,
877,
9420,
29899,
29947,
1495,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
877,
29961,
4819,
29886,
1004,
29962,
742,
525,
2704,
29901,
525,
718,
851,
29898,
29872,
876,
13,
13,
1678,
822,
1065,
29918,
6519,
29898,
6519,
29892,
6389,
1125,
13,
4706,
1018,
29901,
13,
9651,
2991,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
22168,
1445,
1649,
876,
718,
2897,
29889,
19570,
718,
525,
11058,
29889,
1961,
29915,
13,
9651,
1962,
353,
1014,
5014,
29889,
3198,
29918,
4905,
18959,
1961,
742,
17411,
29888,
742,
2991,
29892,
1899,
29962,
718,
6389,
467,
13808,
877,
9420,
29899,
29947,
1495,
13,
13,
9651,
565,
1962,
29889,
27382,
2541,
877,
2704,
29374,
13,
18884,
1596,
877,
29961,
4819,
29886,
1004,
29962,
742,
1962,
29897,
13,
9651,
1683,
29901,
13,
18884,
736,
1962,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
877,
29961,
4819,
29886,
1004,
29962,
742,
525,
2704,
29901,
525,
718,
851,
29898,
29872,
876,
13,
2
] |
rllib/agents/dqn/learner_thread.py | firebolt55439/ray | 3 | 74756 | <gh_stars>1-10
import queue
import threading
from ray.rllib.evaluation.metrics import get_learner_stats
from ray.rllib.policy.policy import LEARNER_STATS_KEY
from ray.rllib.utils.framework import try_import_tf
from ray.rllib.utils.timer import TimerStat
from ray.rllib.utils.window_stat import WindowStat
LEARNER_QUEUE_MAX_SIZE = 16
tf1, tf, tfv = try_import_tf()
class LearnerThread(threading.Thread):
"""Background thread that updates the local model from replay data.
The learner thread communicates with the main thread through Queues. This
is needed since Ray operations can only be run on the main thread. In
addition, moving heavyweight gradient ops session runs off the main thread
improves overall throughput.
"""
def __init__(self, local_worker):
threading.Thread.__init__(self)
self.learner_queue_size = WindowStat("size", 50)
self.local_worker = local_worker
self.inqueue = queue.Queue(maxsize=LEARNER_QUEUE_MAX_SIZE)
self.outqueue = queue.Queue()
self.queue_timer = TimerStat()
self.grad_timer = TimerStat()
self.overall_timer = TimerStat()
self.daemon = True
self.weights_updated = False
self.stopped = False
self.stats = {}
def run(self):
# Switch on eager mode if configured.
if self.local_worker.policy_config.get("framework") in ["tf2", "tfe"]:
tf1.enable_eager_execution()
while not self.stopped:
self.step()
def step(self):
with self.overall_timer:
with self.queue_timer:
ra, replay = self.inqueue.get()
if replay is not None:
prio_dict = {}
with self.grad_timer:
grad_out = self.local_worker.learn_on_batch(replay)
for pid, info in grad_out.items():
td_error = info.get(
"td_error",
info[LEARNER_STATS_KEY].get("td_error"))
prio_dict[pid] = (replay.policy_batches[pid].data.get(
"batch_indexes"), td_error)
self.stats[pid] = get_learner_stats(info)
self.grad_timer.push_units_processed(replay.count)
self.outqueue.put((ra, prio_dict, replay.count))
self.learner_queue_size.push(self.inqueue.qsize())
self.weights_updated = True
self.overall_timer.push_units_processed(replay and replay.count
or 0)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
9521,
13,
5215,
3244,
292,
13,
13,
3166,
15570,
29889,
2096,
1982,
29889,
24219,
362,
29889,
2527,
10817,
1053,
679,
29918,
1945,
1089,
29918,
16202,
13,
3166,
15570,
29889,
2096,
1982,
29889,
22197,
29889,
22197,
1053,
11060,
1718,
13865,
29918,
17816,
29903,
29918,
10818,
13,
3166,
15570,
29889,
2096,
1982,
29889,
13239,
29889,
4468,
1053,
1018,
29918,
5215,
29918,
13264,
13,
3166,
15570,
29889,
2096,
1982,
29889,
13239,
29889,
20404,
1053,
29168,
9513,
13,
3166,
15570,
29889,
2096,
1982,
29889,
13239,
29889,
7165,
29918,
6112,
1053,
18379,
9513,
13,
13,
1307,
1718,
13865,
29918,
11144,
4462,
29918,
12648,
29918,
14226,
353,
29871,
29896,
29953,
13,
13,
13264,
29896,
29892,
15886,
29892,
15886,
29894,
353,
1018,
29918,
5215,
29918,
13264,
580,
13,
13,
13,
1990,
19530,
1089,
4899,
29898,
7097,
292,
29889,
4899,
1125,
13,
1678,
9995,
10581,
3244,
393,
11217,
278,
1887,
1904,
515,
337,
1456,
848,
29889,
13,
13,
1678,
450,
24298,
1089,
3244,
7212,
1078,
411,
278,
1667,
3244,
1549,
5462,
1041,
29889,
910,
13,
1678,
338,
4312,
1951,
9596,
6931,
508,
871,
367,
1065,
373,
278,
1667,
3244,
29889,
512,
13,
1678,
6124,
29892,
8401,
9416,
7915,
16030,
288,
567,
4867,
6057,
1283,
278,
1667,
3244,
13,
1678,
4857,
1960,
12463,
1549,
649,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1887,
29918,
24602,
1125,
13,
4706,
3244,
292,
29889,
4899,
17255,
2344,
12035,
1311,
29897,
13,
4706,
1583,
29889,
1945,
1089,
29918,
9990,
29918,
2311,
353,
18379,
9513,
703,
2311,
613,
29871,
29945,
29900,
29897,
13,
4706,
1583,
29889,
2997,
29918,
24602,
353,
1887,
29918,
24602,
13,
4706,
1583,
29889,
262,
9990,
353,
9521,
29889,
10620,
29898,
3317,
2311,
29922,
1307,
1718,
13865,
29918,
11144,
4462,
29918,
12648,
29918,
14226,
29897,
13,
4706,
1583,
29889,
449,
9990,
353,
9521,
29889,
10620,
580,
13,
4706,
1583,
29889,
9990,
29918,
20404,
353,
29168,
9513,
580,
13,
4706,
1583,
29889,
5105,
29918,
20404,
353,
29168,
9513,
580,
13,
4706,
1583,
29889,
957,
497,
29918,
20404,
353,
29168,
9513,
580,
13,
4706,
1583,
29889,
1388,
9857,
353,
5852,
13,
4706,
1583,
29889,
705,
5861,
29918,
21402,
353,
7700,
13,
4706,
1583,
29889,
7864,
2986,
353,
7700,
13,
4706,
1583,
29889,
16202,
353,
6571,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
396,
28176,
373,
19888,
4464,
565,
13252,
29889,
13,
4706,
565,
1583,
29889,
2997,
29918,
24602,
29889,
22197,
29918,
2917,
29889,
657,
703,
4468,
1159,
297,
6796,
13264,
29906,
613,
376,
29873,
1725,
3108,
29901,
13,
9651,
15886,
29896,
29889,
12007,
29918,
29872,
1875,
29918,
22256,
580,
13,
4706,
1550,
451,
1583,
29889,
7864,
2986,
29901,
13,
9651,
1583,
29889,
10568,
580,
13,
13,
1678,
822,
4331,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
957,
497,
29918,
20404,
29901,
13,
9651,
411,
1583,
29889,
9990,
29918,
20404,
29901,
13,
18884,
1153,
29892,
337,
1456,
353,
1583,
29889,
262,
9990,
29889,
657,
580,
13,
9651,
565,
337,
1456,
338,
451,
6213,
29901,
13,
18884,
3691,
29877,
29918,
8977,
353,
6571,
13,
18884,
411,
1583,
29889,
5105,
29918,
20404,
29901,
13,
462,
1678,
4656,
29918,
449,
353,
1583,
29889,
2997,
29918,
24602,
29889,
19668,
29918,
265,
29918,
16175,
29898,
276,
1456,
29897,
13,
462,
1678,
363,
23107,
29892,
5235,
297,
4656,
29918,
449,
29889,
7076,
7295,
13,
462,
4706,
22599,
29918,
2704,
353,
5235,
29889,
657,
29898,
13,
462,
9651,
376,
1594,
29918,
2704,
613,
13,
462,
9651,
5235,
29961,
1307,
1718,
13865,
29918,
17816,
29903,
29918,
10818,
1822,
657,
703,
1594,
29918,
2704,
5783,
13,
462,
4706,
3691,
29877,
29918,
8977,
29961,
5935,
29962,
353,
313,
276,
1456,
29889,
22197,
29918,
16175,
267,
29961,
5935,
1822,
1272,
29889,
657,
29898,
13,
462,
9651,
376,
16175,
29918,
2248,
267,
4968,
22599,
29918,
2704,
29897,
13,
462,
4706,
1583,
29889,
16202,
29961,
5935,
29962,
353,
679,
29918,
1945,
1089,
29918,
16202,
29898,
3888,
29897,
13,
462,
1678,
1583,
29889,
5105,
29918,
20404,
29889,
5910,
29918,
348,
1169,
29918,
5014,
287,
29898,
276,
1456,
29889,
2798,
29897,
13,
18884,
1583,
29889,
449,
9990,
29889,
649,
3552,
336,
29892,
3691,
29877,
29918,
8977,
29892,
337,
1456,
29889,
2798,
876,
13,
9651,
1583,
29889,
1945,
1089,
29918,
9990,
29918,
2311,
29889,
5910,
29898,
1311,
29889,
262,
9990,
29889,
29939,
2311,
3101,
13,
9651,
1583,
29889,
705,
5861,
29918,
21402,
353,
5852,
13,
9651,
1583,
29889,
957,
497,
29918,
20404,
29889,
5910,
29918,
348,
1169,
29918,
5014,
287,
29898,
276,
1456,
322,
337,
1456,
29889,
2798,
13,
462,
462,
462,
1678,
470,
29871,
29900,
29897,
13,
2
] |
leetcode/python/359_logger_rate_limiter.py | VVKot/leetcode-solutions | 4 | 194667 | class Logger:
PRINT_INTERVAL = 10
def __init__(self):
self.buckets = [-1 for _ in range(self.PRINT_INTERVAL)]
self.sets = [set() for _ in range(self.PRINT_INTERVAL)]
def shouldPrintMessage(self, timestamp: int, message: str) -> bool:
bucket_index = timestamp % self.PRINT_INTERVAL
if self.buckets[bucket_index] != timestamp:
self.sets[bucket_index].clear()
self.buckets[bucket_index] = timestamp
for i, bucket_timestamp in enumerate(self.buckets):
if timestamp - bucket_timestamp < self.PRINT_INTERVAL:
if message in self.sets[i]:
return False
self.sets[bucket_index].add(message)
return True
| [
1,
770,
28468,
29901,
13,
13,
1678,
12089,
10192,
29918,
23845,
8932,
353,
29871,
29896,
29900,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
2423,
9737,
353,
21069,
29896,
363,
903,
297,
3464,
29898,
1311,
29889,
10593,
10192,
29918,
23845,
8932,
4638,
13,
4706,
1583,
29889,
7224,
353,
518,
842,
580,
363,
903,
297,
3464,
29898,
1311,
29889,
10593,
10192,
29918,
23845,
8932,
4638,
13,
13,
1678,
822,
881,
11816,
3728,
29898,
1311,
29892,
14334,
29901,
938,
29892,
2643,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
20968,
29918,
2248,
353,
14334,
1273,
1583,
29889,
10593,
10192,
29918,
23845,
8932,
13,
4706,
565,
1583,
29889,
2423,
9737,
29961,
21454,
29918,
2248,
29962,
2804,
14334,
29901,
13,
9651,
1583,
29889,
7224,
29961,
21454,
29918,
2248,
1822,
8551,
580,
13,
9651,
1583,
29889,
2423,
9737,
29961,
21454,
29918,
2248,
29962,
353,
14334,
13,
4706,
363,
474,
29892,
20968,
29918,
16394,
297,
26985,
29898,
1311,
29889,
2423,
9737,
1125,
13,
9651,
565,
14334,
448,
20968,
29918,
16394,
529,
1583,
29889,
10593,
10192,
29918,
23845,
8932,
29901,
13,
18884,
565,
2643,
297,
1583,
29889,
7224,
29961,
29875,
5387,
13,
462,
1678,
736,
7700,
13,
4706,
1583,
29889,
7224,
29961,
21454,
29918,
2248,
1822,
1202,
29898,
4906,
29897,
13,
4706,
736,
5852,
13,
2
] |
super32assembler/super32assembler/preprocessor/asmdirectives.py | Projektstudium-Mikroprozessor/Super32 | 1 | 19108 | """
Enum Assembler-Directives
"""
from enum import Enum, auto
class AssemblerDirectives(Enum):
START = auto()
END = auto()
ORG = auto()
DEFINE = auto()
@classmethod
def to_string(cls):
return "{START},{END},{ORG},{DEFINE}".format(
START=cls.START.name,
END=cls.END.name,
ORG=cls.ORG.name,
DEFINE=cls.DEFINE.name
)
| [
1,
9995,
13,
16854,
4007,
1590,
1358,
29899,
17392,
3145,
13,
15945,
29908,
13,
13,
3166,
14115,
1053,
1174,
398,
29892,
4469,
13,
13,
13,
1990,
4007,
1590,
1358,
17392,
3145,
29898,
16854,
1125,
13,
1678,
6850,
8322,
353,
4469,
580,
13,
1678,
11056,
353,
4469,
580,
13,
1678,
6323,
29954,
353,
4469,
580,
13,
1678,
5012,
29943,
8895,
353,
4469,
580,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
304,
29918,
1807,
29898,
25932,
1125,
13,
4706,
736,
29850,
25826,
29087,
11794,
29087,
1955,
29954,
29087,
24405,
8895,
29913,
1642,
4830,
29898,
13,
9651,
6850,
8322,
29922,
25932,
29889,
25826,
29889,
978,
29892,
13,
9651,
11056,
29922,
25932,
29889,
11794,
29889,
978,
29892,
13,
9651,
6323,
29954,
29922,
25932,
29889,
1955,
29954,
29889,
978,
29892,
13,
9651,
5012,
29943,
8895,
29922,
25932,
29889,
24405,
8895,
29889,
978,
13,
4706,
1723,
13,
2
] |
FSPSFiles.py | AlexaVillaume/FSPS | 1 | 91898 | import os
'''
Read an FSPS spec file
'''
class specmodel(object):
def __init__(self, attr, wave, flux):
self.agegyr = round(10**attr[0] / 1e9, 3)
self.mass = attr[1]
self.lbol = attr[2]
self.sfr = attr[3]
self.wave = wave
self.flux = flux
class readspec(object):
def __init__(self, fname):
self.data = open(fname, "r")
# Burn header
while True:
line = self.data.readline()
if line[0] != '#':
break
cols = line.split()
self.tstep = float(cols[0])
self.sdim = float(cols[1])
# Get wavelength
line = self.data.readline()
cols = line.split()
self.wave = map(lambda col: float(col)*1e-4, cols)
def next(self):
line = self.data.readline()
if line == "":
self.data.close()
raise StopIteration()
cols = line.split()
attr = map(lambda col: float(col), cols)
line = self.data.readline()
cols = line.split()
flux = map(lambda col: float(col), cols)
return specmodel(attr, self.wave, flux)
def __iter__(self):
return self
'''
For FSPS .cmd files
'''
class readcmd:
def __init__(self, fname):
self.data = open(fname, 'r')
# Read header to find the columns in the file
while True:
line = self.data.readline()
line = line.lstrip()
if line[0] == '#':
header = line.replace('#', '')
header = header.replace('mags', '')
header = header.split()
break
self.header = header
def next(self):
line = self.data.readline()
if line == "":
self.data.close()
raise StopIteration()
# Read in and assign the attributes of the models
cols = line.split()
for i, name in enumerate(self.header):
self.__dict__[name] = float(cols[i])
# Update the attributes with filter names and values
with open('/Users/alexawork/FSPS_python/filters.txt', 'r') as names:
for i, _filter in enumerate(names):
_filter = _filter.rstrip()
#print _filter, cols[i + len(self.header)]
self.__dict__.update({_filter:float(cols[i + len(self.header)])})
return self.__dict__.copy()
def __iter__(self):
return self
'''
For FSPS .mags files
'''
class readmags:
def __init__(self, fname):
self.data = open(fname, 'r')
# Read header to find the columns in the file
line_count = 0
while True:
if line_count < 7:
self.data.readline()
else:
line = self.data.readline()
line = line.lstrip()
if line[0] == '#':
header = line.replace('#', '')
header = header.replace('mags', '')
header = header.replace('(see FILTER_LIST)', '')
header = header.split()
break
line_count+=1
self.header = header
def next(self):
line = self.data.readline()
if line == "":
self.data.close()
raise StopIteration()
# Read in and assign the attributes of the models
cols = line.split()
for i, name in enumerate(self.header):
self.__dict__[name] = float(cols[i])
# Update the attributes with filter names and values
with open('/Users/alexawork/FSPS_python/filters.txt', 'r') as names:
for i, _filter in enumerate(names):
_filter = _filter.rstrip()
#print _filter, cols[i + len(self.header)]
self.__dict__.update({_filter:float(cols[i + len(self.header)])})
return self.__dict__.copy()
def __iter__(self):
return self
| [
1,
1053,
2897,
13,
13,
12008,
13,
6359,
385,
383,
5550,
29903,
1580,
934,
13,
12008,
13,
1990,
1580,
4299,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
12421,
29892,
10742,
29892,
19389,
1125,
13,
4706,
1583,
29889,
351,
387,
4316,
353,
4513,
29898,
29896,
29900,
1068,
5552,
29961,
29900,
29962,
847,
29871,
29896,
29872,
29929,
29892,
29871,
29941,
29897,
13,
4706,
1583,
29889,
25379,
259,
353,
12421,
29961,
29896,
29962,
13,
4706,
1583,
29889,
29880,
2095,
259,
353,
12421,
29961,
29906,
29962,
13,
4706,
1583,
29889,
29879,
1341,
1678,
353,
12421,
29961,
29941,
29962,
13,
4706,
1583,
29889,
27766,
259,
353,
10742,
13,
4706,
1583,
29889,
1579,
1314,
259,
353,
19389,
13,
13,
1990,
1303,
6550,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
285,
978,
1125,
13,
4706,
1583,
29889,
1272,
353,
1722,
29898,
29888,
978,
29892,
376,
29878,
1159,
13,
4706,
396,
16640,
4839,
13,
4706,
1550,
5852,
29901,
13,
9651,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
9651,
565,
1196,
29961,
29900,
29962,
2804,
16321,
2396,
13,
18884,
2867,
13,
4706,
28730,
353,
1196,
29889,
5451,
580,
13,
4706,
1583,
29889,
29873,
10568,
353,
5785,
29898,
22724,
29961,
29900,
2314,
13,
4706,
1583,
29889,
4928,
326,
353,
5785,
29898,
22724,
29961,
29896,
2314,
13,
13,
4706,
396,
3617,
281,
6447,
1477,
13,
4706,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
4706,
28730,
353,
1196,
29889,
5451,
580,
13,
4706,
1583,
29889,
27766,
353,
2910,
29898,
2892,
784,
29901,
5785,
29898,
1054,
11877,
29896,
29872,
29899,
29946,
29892,
28730,
29897,
13,
13,
1678,
822,
2446,
29898,
1311,
1125,
13,
4706,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
4706,
565,
1196,
1275,
376,
1115,
13,
9651,
1583,
29889,
1272,
29889,
5358,
580,
13,
9651,
12020,
22303,
13463,
362,
580,
13,
13,
4706,
28730,
353,
1196,
29889,
5451,
580,
13,
4706,
12421,
353,
2910,
29898,
2892,
784,
29901,
5785,
29898,
1054,
511,
28730,
29897,
13,
13,
4706,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
4706,
28730,
353,
1196,
29889,
5451,
580,
13,
4706,
19389,
353,
2910,
29898,
2892,
784,
29901,
5785,
29898,
1054,
511,
28730,
29897,
13,
13,
4706,
736,
1580,
4299,
29898,
5552,
29892,
1583,
29889,
27766,
29892,
19389,
29897,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
736,
1583,
13,
13,
12008,
13,
2831,
383,
5550,
29903,
869,
9006,
2066,
13,
12008,
13,
1990,
1303,
9006,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
285,
978,
1125,
13,
4706,
1583,
29889,
1272,
353,
1722,
29898,
29888,
978,
29892,
525,
29878,
1495,
13,
4706,
396,
7523,
4839,
304,
1284,
278,
4341,
297,
278,
934,
13,
4706,
1550,
5852,
29901,
13,
9651,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
9651,
1196,
353,
1196,
29889,
29880,
17010,
580,
13,
9651,
565,
1196,
29961,
29900,
29962,
1275,
16321,
2396,
13,
18884,
4839,
353,
1196,
29889,
6506,
14237,
742,
27255,
13,
18884,
4839,
353,
4839,
29889,
6506,
877,
29885,
810,
742,
27255,
13,
18884,
4839,
353,
29871,
4839,
29889,
5451,
580,
13,
18884,
2867,
13,
4706,
1583,
29889,
6672,
353,
4839,
13,
13,
1678,
822,
2446,
29898,
1311,
1125,
13,
4706,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
4706,
565,
1196,
1275,
376,
1115,
13,
9651,
1583,
29889,
1272,
29889,
5358,
580,
13,
9651,
12020,
22303,
13463,
362,
580,
13,
13,
4706,
396,
7523,
297,
322,
3566,
278,
29871,
8393,
310,
278,
4733,
13,
4706,
28730,
353,
1196,
29889,
5451,
580,
13,
4706,
363,
474,
29892,
1024,
297,
26985,
29898,
1311,
29889,
6672,
1125,
13,
9651,
1583,
17255,
8977,
1649,
29961,
978,
29962,
353,
5785,
29898,
22724,
29961,
29875,
2314,
13,
13,
4706,
396,
10318,
278,
8393,
411,
4175,
2983,
322,
1819,
13,
4706,
411,
1722,
11219,
5959,
29914,
744,
17367,
1287,
29914,
29943,
5550,
29903,
29918,
4691,
29914,
26705,
29889,
3945,
742,
525,
29878,
1495,
408,
2983,
29901,
13,
9651,
363,
474,
29892,
903,
4572,
297,
26985,
29898,
7039,
1125,
13,
18884,
903,
4572,
353,
903,
4572,
29889,
29878,
17010,
580,
13,
18884,
396,
2158,
903,
4572,
29892,
28730,
29961,
29875,
718,
7431,
29898,
1311,
29889,
6672,
4638,
13,
18884,
1583,
17255,
8977,
26914,
5504,
3319,
29918,
4572,
29901,
7411,
29898,
22724,
29961,
29875,
718,
7431,
29898,
1311,
29889,
6672,
29897,
2314,
1800,
13,
13,
4706,
736,
1583,
17255,
8977,
26914,
8552,
580,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
736,
1583,
13,
13,
12008,
13,
2831,
383,
5550,
29903,
869,
29885,
810,
2066,
13,
12008,
13,
1990,
1303,
29885,
810,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
285,
978,
1125,
13,
4706,
1583,
29889,
1272,
353,
1722,
29898,
29888,
978,
29892,
525,
29878,
1495,
13,
4706,
396,
7523,
4839,
304,
1284,
278,
4341,
297,
278,
934,
13,
4706,
1196,
29918,
2798,
353,
29871,
29900,
13,
4706,
1550,
5852,
29901,
13,
9651,
565,
1196,
29918,
2798,
529,
29871,
29955,
29901,
13,
18884,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
9651,
1683,
29901,
13,
18884,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
18884,
1196,
353,
1196,
29889,
29880,
17010,
580,
13,
18884,
565,
1196,
29961,
29900,
29962,
1275,
16321,
2396,
13,
462,
1678,
4839,
353,
1196,
29889,
6506,
14237,
742,
27255,
13,
462,
1678,
4839,
353,
4839,
29889,
6506,
877,
29885,
810,
742,
27255,
13,
462,
1678,
4839,
353,
4839,
29889,
6506,
877,
29898,
4149,
383,
6227,
4945,
29918,
24360,
29897,
742,
27255,
13,
462,
1678,
4839,
353,
29871,
4839,
29889,
5451,
580,
13,
462,
1678,
2867,
13,
9651,
1196,
29918,
2798,
23661,
29896,
13,
4706,
1583,
29889,
6672,
353,
4839,
13,
13,
1678,
822,
2446,
29898,
1311,
1125,
13,
4706,
1196,
353,
1583,
29889,
1272,
29889,
949,
1220,
580,
13,
4706,
565,
1196,
1275,
376,
1115,
13,
9651,
1583,
29889,
1272,
29889,
5358,
580,
13,
9651,
12020,
22303,
13463,
362,
580,
13,
13,
4706,
396,
7523,
297,
322,
3566,
278,
29871,
8393,
310,
278,
4733,
13,
4706,
28730,
353,
1196,
29889,
5451,
580,
13,
4706,
363,
474,
29892,
1024,
297,
26985,
29898,
1311,
29889,
6672,
1125,
13,
9651,
1583,
17255,
8977,
1649,
29961,
978,
29962,
353,
5785,
29898,
22724,
29961,
29875,
2314,
13,
13,
4706,
396,
10318,
278,
8393,
411,
4175,
2983,
322,
1819,
13,
4706,
411,
1722,
11219,
5959,
29914,
744,
17367,
1287,
29914,
29943,
5550,
29903,
29918,
4691,
29914,
26705,
29889,
3945,
742,
525,
29878,
1495,
408,
2983,
29901,
13,
9651,
363,
474,
29892,
903,
4572,
297,
26985,
29898,
7039,
1125,
13,
18884,
903,
4572,
353,
903,
4572,
29889,
29878,
17010,
580,
13,
18884,
396,
2158,
903,
4572,
29892,
28730,
29961,
29875,
718,
7431,
29898,
1311,
29889,
6672,
4638,
13,
18884,
1583,
17255,
8977,
26914,
5504,
3319,
29918,
4572,
29901,
7411,
29898,
22724,
29961,
29875,
718,
7431,
29898,
1311,
29889,
6672,
29897,
2314,
1800,
13,
13,
4706,
736,
1583,
17255,
8977,
26914,
8552,
580,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
736,
1583,
13,
13,
2
] |
tests/test_properties.py | Kapiche/gcloud-python-orm | 1 | 45505 | import six
import unittest2
from gcloud.datastore import helpers, key, set_default_dataset_id
from gcloudorm import model, properties
class TestProperties(unittest2.TestCase):
_DATASET_ID = 'DATASET'
def setUp(self):
set_default_dataset_id(self._DATASET_ID)
def testBooleanProperty(self):
class TestModel(model.Model):
test_bool = properties.BooleanProperty()
m = TestModel()
self.assertEqual(m.test_bool, None)
self.assertEqual(m['test_bool'], None)
m = TestModel(test_bool=False)
self.assertEqual(m.test_bool, False)
self.assertEqual(m['test_bool'], False)
m.test_bool = True
self.assertEqual(m.test_bool, True)
self.assertEqual(m['test_bool'], True)
class TestModel(model.Model):
test_bool = properties.BooleanProperty(default=True)
m = TestModel()
self.assertEqual(m.test_bool, True)
self.assertEqual(m['test_bool'], True)
def testIdProperty(self):
class TestModel(model.Model):
test_id = properties.IdProperty()
m = TestModel()
self.assertIsInstance(m.test_id, six.string_types)
self.assertIs(m.test_id, m.key.id_or_name)
def testIntegerProperty(self):
class TestModel(model.Model):
test_int = properties.IntegerProperty()
m = TestModel()
self.assertEqual(m.test_int, None)
self.assertEqual(m['test_int'], None)
class TestModel(model.Model):
test_int = properties.IntegerProperty(default=3)
m = TestModel()
self.assertEqual(m['test_int'], 3)
m.test_int = 4
self.assertEqual(m.test_int, 4)
self.assertEqual(m['test_int'], 4)
def testFloatproperty(self):
class TestModel(model.Model):
test_float = properties.FloatProperty()
m = TestModel()
self.assertEqual(m.test_float, None)
self.assertEqual(m['test_float'], None)
class TestModel(model.Model):
test_float = properties.FloatProperty(default=0.1)
m = TestModel()
self.assertEqual(m['test_float'], 0.1)
m.test_float = 0.2
self.assertEqual(m['test_float'], 0.2)
def testTextProperty(self):
class TestModel(model.Model):
test_text = properties.TextProperty()
m = TestModel()
self.assertEqual(m.test_text, None)
class TestModel(model.Model):
test_text = properties.TextProperty(default="")
m = TestModel()
self.assertEqual(m['test_text'], "")
class TestModel(model.Model):
test_text = properties.TextProperty(default=lambda: "")
m = TestModel()
self.assertEqual(m['test_text'], "")
def testPickleProperty(self):
class TestModel(model.Model):
test_pickle = properties.PickleProperty()
m = TestModel()
self.assertEqual(m.test_pickle, None)
m = TestModel(test_pickle={"123": "456"})
self.assertEqual(m.test_pickle, {"123": "456"})
m.test_pickle = {'456': '789'}
self.assertEqual(m.test_pickle, {'456': '789'})
def testJsonProperty(self):
class TestModel(model.Model):
test_pickle = properties.JsonProperty()
m = TestModel()
self.assertEqual(m.test_pickle, None)
m = TestModel(test_pickle={"123": "456"})
self.assertEqual(m.test_pickle, {"123": "456"})
m.test_pickle = {'456': '789'}
self.assertEqual(m.test_pickle, {'456': '789'})
def testDataTimeProperty(self):
import datetime
class TestModel(model.Model):
test_datetime = properties.DateTimeProperty()
m = TestModel()
self.assertEqual(m.test_datetime, None)
utcnow = datetime.datetime.utcnow()
m.test_datetime = utcnow
self.assertEqual(m.test_datetime, utcnow)
def testDateProperty(self):
import datetime
class TestModel(model.Model):
test_date = properties.DateProperty()
m = TestModel()
self.assertEqual(m.test_date, None)
today = datetime.date.today()
m.test_date = today
self.assertEqual(m.test_date, today)
def testTimeProperty(self):
import datetime
class TestModel(model.Model):
test_time = properties.TimeProperty()
m = TestModel()
self.assertEqual(m.test_time, None)
t = datetime.time()
m.test_time = t
self.assertEqual(m.test_time, t)
| [
1,
1053,
4832,
13,
5215,
443,
27958,
29906,
13,
13,
3166,
330,
9274,
29889,
4130,
579,
487,
1053,
1371,
414,
29892,
1820,
29892,
731,
29918,
4381,
29918,
24713,
29918,
333,
13,
13,
3166,
330,
9274,
555,
1053,
1904,
29892,
4426,
13,
13,
13,
1990,
4321,
11857,
29898,
348,
27958,
29906,
29889,
3057,
8259,
1125,
13,
1678,
903,
25832,
8127,
29911,
29918,
1367,
353,
525,
25832,
8127,
29911,
29915,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
731,
29918,
4381,
29918,
24713,
29918,
333,
29898,
1311,
3032,
25832,
8127,
29911,
29918,
1367,
29897,
13,
13,
1678,
822,
1243,
18146,
4854,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
11227,
353,
4426,
29889,
18146,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
11227,
29892,
6213,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
11227,
7464,
6213,
29897,
13,
13,
4706,
286,
353,
4321,
3195,
29898,
1688,
29918,
11227,
29922,
8824,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
11227,
29892,
7700,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
11227,
7464,
7700,
29897,
13,
13,
4706,
286,
29889,
1688,
29918,
11227,
353,
5852,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
11227,
29892,
5852,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
11227,
7464,
5852,
29897,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
11227,
353,
4426,
29889,
18146,
4854,
29898,
4381,
29922,
5574,
29897,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
11227,
29892,
5852,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
11227,
7464,
5852,
29897,
13,
13,
1678,
822,
1243,
1204,
4854,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
333,
353,
4426,
29889,
1204,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
29885,
29889,
1688,
29918,
333,
29892,
4832,
29889,
1807,
29918,
8768,
29897,
13,
4706,
1583,
29889,
9294,
3624,
29898,
29885,
29889,
1688,
29918,
333,
29892,
286,
29889,
1989,
29889,
333,
29918,
272,
29918,
978,
29897,
13,
13,
1678,
822,
1243,
7798,
4854,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
524,
353,
4426,
29889,
7798,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
524,
29892,
6213,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
524,
7464,
6213,
29897,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
524,
353,
4426,
29889,
7798,
4854,
29898,
4381,
29922,
29941,
29897,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
524,
7464,
29871,
29941,
29897,
13,
13,
4706,
286,
29889,
1688,
29918,
524,
353,
29871,
29946,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
524,
29892,
29871,
29946,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
524,
7464,
29871,
29946,
29897,
13,
13,
1678,
822,
1243,
11031,
6799,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
7411,
353,
4426,
29889,
11031,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
7411,
29892,
6213,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
7411,
7464,
6213,
29897,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
7411,
353,
4426,
29889,
11031,
4854,
29898,
4381,
29922,
29900,
29889,
29896,
29897,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
7411,
7464,
29871,
29900,
29889,
29896,
29897,
13,
13,
4706,
286,
29889,
1688,
29918,
7411,
353,
29871,
29900,
29889,
29906,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
7411,
7464,
29871,
29900,
29889,
29906,
29897,
13,
13,
1678,
822,
1243,
1626,
4854,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
726,
353,
4426,
29889,
1626,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
726,
29892,
6213,
29897,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
726,
353,
4426,
29889,
1626,
4854,
29898,
4381,
543,
1159,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
726,
7464,
20569,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
726,
353,
4426,
29889,
1626,
4854,
29898,
4381,
29922,
2892,
29901,
20569,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
1839,
1688,
29918,
726,
7464,
20569,
13,
13,
1678,
822,
1243,
29925,
860,
280,
4854,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
23945,
280,
353,
4426,
29889,
29925,
860,
280,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
23945,
280,
29892,
6213,
29897,
13,
4706,
286,
353,
4321,
3195,
29898,
1688,
29918,
23945,
280,
3790,
29908,
29896,
29906,
29941,
1115,
376,
29946,
29945,
29953,
29908,
1800,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
23945,
280,
29892,
8853,
29896,
29906,
29941,
1115,
376,
29946,
29945,
29953,
29908,
1800,
13,
13,
4706,
286,
29889,
1688,
29918,
23945,
280,
353,
11117,
29946,
29945,
29953,
2396,
525,
29955,
29947,
29929,
10827,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
23945,
280,
29892,
11117,
29946,
29945,
29953,
2396,
525,
29955,
29947,
29929,
29915,
1800,
13,
13,
1678,
822,
1243,
8148,
4854,
29898,
1311,
1125,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
23945,
280,
353,
4426,
29889,
8148,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
23945,
280,
29892,
6213,
29897,
13,
4706,
286,
353,
4321,
3195,
29898,
1688,
29918,
23945,
280,
3790,
29908,
29896,
29906,
29941,
1115,
376,
29946,
29945,
29953,
29908,
1800,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
23945,
280,
29892,
8853,
29896,
29906,
29941,
1115,
376,
29946,
29945,
29953,
29908,
1800,
13,
13,
4706,
286,
29889,
1688,
29918,
23945,
280,
353,
11117,
29946,
29945,
29953,
2396,
525,
29955,
29947,
29929,
10827,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
23945,
280,
29892,
11117,
29946,
29945,
29953,
2396,
525,
29955,
29947,
29929,
29915,
1800,
13,
13,
1678,
822,
1243,
1469,
2481,
4854,
29898,
1311,
1125,
13,
4706,
1053,
12865,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
12673,
353,
4426,
29889,
11384,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
12673,
29892,
6213,
29897,
13,
13,
4706,
3477,
29883,
3707,
353,
12865,
29889,
12673,
29889,
329,
29883,
3707,
580,
13,
4706,
286,
29889,
1688,
29918,
12673,
353,
3477,
29883,
3707,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
12673,
29892,
3477,
29883,
3707,
29897,
13,
13,
1678,
822,
1243,
2539,
4854,
29898,
1311,
1125,
13,
4706,
1053,
12865,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
1256,
353,
4426,
29889,
2539,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
1256,
29892,
6213,
29897,
13,
13,
4706,
9826,
353,
12865,
29889,
1256,
29889,
27765,
580,
13,
4706,
286,
29889,
1688,
29918,
1256,
353,
9826,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
1256,
29892,
9826,
29897,
13,
13,
1678,
822,
1243,
2481,
4854,
29898,
1311,
1125,
13,
4706,
1053,
12865,
13,
13,
4706,
770,
4321,
3195,
29898,
4299,
29889,
3195,
1125,
13,
9651,
1243,
29918,
2230,
353,
4426,
29889,
2481,
4854,
580,
13,
13,
4706,
286,
353,
4321,
3195,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
2230,
29892,
6213,
29897,
13,
13,
4706,
260,
353,
12865,
29889,
2230,
580,
13,
4706,
286,
29889,
1688,
29918,
2230,
353,
260,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29885,
29889,
1688,
29918,
2230,
29892,
260,
29897,
13,
2
] |
mall/celery_tasks/sms/tasks.py | DanaLee1990/meiduo | 0 | 54871 |
"""
任务:
1、就是普通函数
2、该函数必须通过celery的实例对象的tasks装饰其装饰
3、该任务需要让celery实例对象自动检测
4、任务(函数)需要使用任务名(函数名).delay() 进行调用
"""
from libs.yuntongxun.sms import CCP
from celery_tasks.main import app
@app.task
def send_sms_code(mobile,sms_code):
ccp = CCP()
ccp.send_template_sms(mobile, [sms_code, 5], 1)
| [
1,
29871,
13,
13,
13,
15945,
29908,
13,
31450,
31358,
30383,
13,
268,
29896,
30330,
31238,
30392,
233,
156,
177,
30768,
31629,
30354,
13,
268,
29906,
30330,
31751,
31629,
30354,
31641,
236,
164,
190,
30768,
31138,
2242,
708,
30210,
31195,
31507,
30783,
31133,
30210,
20673,
31905,
236,
168,
179,
31149,
31905,
236,
168,
179,
13,
268,
29941,
30330,
31751,
31450,
31358,
31383,
30698,
235,
177,
172,
2242,
708,
31195,
31507,
30783,
31133,
30688,
30846,
233,
166,
131,
31851,
13,
268,
29946,
30330,
31450,
31358,
30419,
31629,
30354,
30409,
31383,
30698,
30785,
30406,
31450,
31358,
30548,
30419,
31629,
30354,
30548,
30409,
29889,
18829,
580,
29871,
31174,
30448,
31268,
30406,
13,
15945,
29908,
13,
3166,
4303,
29879,
29889,
29891,
1657,
549,
29916,
348,
29889,
29879,
1516,
1053,
315,
6271,
13,
3166,
6432,
708,
29918,
20673,
29889,
3396,
1053,
623,
13,
13,
13,
29992,
932,
29889,
7662,
13,
1753,
3638,
29918,
29879,
1516,
29918,
401,
29898,
16769,
29892,
29879,
1516,
29918,
401,
1125,
13,
1678,
274,
6814,
353,
315,
6271,
580,
13,
1678,
274,
6814,
29889,
6717,
29918,
6886,
29918,
29879,
1516,
29898,
16769,
29892,
518,
29879,
1516,
29918,
401,
29892,
29871,
29945,
1402,
29871,
29896,
29897,
13,
2
] |
api/resources/__init__.py | wopost/opencmdb | 2 | 101142 | from flask import Blueprint
from flask_restful import Api
from api.resources.demo import DemoResource
from api.resources.login import LoginResource
api_bp_v1 = Blueprint('bp_v1', __name__)
api_v1 = Api(api_bp_v1, '/v1')
api_v1.add_resource(DemoResource, '/demo')
api_v1.add_resource(LoginResource, '/login')
BLUEPRINTS = [api_bp_v1]
__all__ = ['BLUEPRINTS']
| [
1,
515,
29784,
1053,
10924,
2158,
13,
3166,
29784,
29918,
5060,
1319,
1053,
29749,
13,
13,
3166,
7882,
29889,
13237,
29889,
17482,
1053,
27819,
6848,
13,
3166,
7882,
29889,
13237,
29889,
7507,
1053,
19130,
6848,
13,
13,
2754,
29918,
25288,
29918,
29894,
29896,
353,
10924,
2158,
877,
25288,
29918,
29894,
29896,
742,
4770,
978,
1649,
29897,
13,
2754,
29918,
29894,
29896,
353,
29749,
29898,
2754,
29918,
25288,
29918,
29894,
29896,
29892,
8207,
29894,
29896,
1495,
13,
13,
2754,
29918,
29894,
29896,
29889,
1202,
29918,
10314,
29898,
23444,
6848,
29892,
8207,
17482,
1495,
13,
2754,
29918,
29894,
29896,
29889,
1202,
29918,
10314,
29898,
11049,
6848,
29892,
8207,
7507,
1495,
13,
13,
13367,
4462,
10593,
1177,
9375,
353,
518,
2754,
29918,
25288,
29918,
29894,
29896,
29962,
13,
13,
1649,
497,
1649,
353,
6024,
13367,
4462,
10593,
1177,
9375,
2033,
13,
2
] |
src/simulation/entity.py | rah/optimal-search | 0 | 32758 | class Entity(object):
'''
An entity has:
- energy
- position(x,y)
- size(length, width)
An entity may have a parent entity
An entity may have child entities
'''
def __init__(
self,
p,
parent=None,
children=None):
self.p = p
self.energy = p.getfloat("ENTITY", "energy")
self.x_pos = p.getfloat("ENTITY", "x_pos")
self.y_pos = p.getfloat("ENTITY", "y_pos")
self.length = p.getint("ENTITY", "length")
self.width = p.getint("ENTITY", "width")
self.parent = parent
if children is None:
self.children = []
else:
self.children = children
def add_child(self, entity):
self.children.append(entity)
def remove_child(self, entity):
self.children.remove(entity)
def remove_self(self):
if self.parent is not None:
self.parent.children.remove(self)
def number_children(self):
if self.children:
return len(self.children)
else:
return 0
def total_energy(self):
'''
returns the sum of all energy
'''
total_energy = self.energy
for child in self.children:
total_energy += child.energy
return total_energy
def set_bounds(self, x, y):
'''
Ensure that x, y are within the bounds of this entity.
Reset x,y so that a torus is formed
'''
if x < 0.0:
x = self.length
if x > self.length:
x = 0.0
if y < 0.0:
y = self.width
if y > self.width:
y = 0.0
return x, y
| [
1,
770,
14945,
29898,
3318,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
530,
7855,
756,
29901,
30004,
13,
418,
448,
5864,
30004,
13,
418,
448,
2602,
29898,
29916,
29892,
29891,
8443,
13,
418,
448,
2159,
29898,
2848,
29892,
2920,
8443,
13,
1678,
530,
7855,
1122,
505,
263,
3847,
7855,
30004,
13,
1678,
530,
7855,
1122,
505,
2278,
16212,
30004,
13,
1678,
14550,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
30004,
13,
9651,
1583,
11167,
13,
9651,
282,
11167,
13,
9651,
3847,
29922,
8516,
11167,
13,
9651,
4344,
29922,
8516,
1125,
30004,
13,
4706,
1583,
29889,
29886,
353,
282,
30004,
13,
4706,
1583,
29889,
27548,
353,
282,
29889,
657,
7411,
703,
3919,
11937,
613,
376,
27548,
1159,
30004,
13,
4706,
1583,
29889,
29916,
29918,
1066,
353,
282,
29889,
657,
7411,
703,
3919,
11937,
613,
376,
29916,
29918,
1066,
1159,
30004,
13,
4706,
1583,
29889,
29891,
29918,
1066,
353,
282,
29889,
657,
7411,
703,
3919,
11937,
613,
376,
29891,
29918,
1066,
1159,
30004,
13,
4706,
1583,
29889,
2848,
353,
282,
29889,
657,
524,
703,
3919,
11937,
613,
376,
2848,
1159,
30004,
13,
4706,
1583,
29889,
2103,
353,
282,
29889,
657,
524,
703,
3919,
11937,
613,
376,
2103,
1159,
30004,
13,
4706,
1583,
29889,
3560,
353,
3847,
30004,
13,
4706,
565,
4344,
338,
6213,
29901,
30004,
13,
9651,
1583,
29889,
11991,
353,
5159,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
1583,
29889,
11991,
353,
4344,
30004,
13,
30004,
13,
1678,
822,
788,
29918,
5145,
29898,
1311,
29892,
7855,
1125,
30004,
13,
4706,
1583,
29889,
11991,
29889,
4397,
29898,
10041,
8443,
13,
30004,
13,
1678,
822,
3349,
29918,
5145,
29898,
1311,
29892,
7855,
1125,
30004,
13,
4706,
1583,
29889,
11991,
29889,
5992,
29898,
10041,
8443,
13,
30004,
13,
1678,
822,
3349,
29918,
1311,
29898,
1311,
1125,
30004,
13,
4706,
565,
1583,
29889,
3560,
338,
451,
6213,
29901,
30004,
13,
9651,
1583,
29889,
3560,
29889,
11991,
29889,
5992,
29898,
1311,
8443,
13,
30004,
13,
1678,
822,
1353,
29918,
11991,
29898,
1311,
1125,
30004,
13,
4706,
565,
1583,
29889,
11991,
29901,
30004,
13,
9651,
736,
7431,
29898,
1311,
29889,
11991,
8443,
13,
4706,
1683,
29901,
30004,
13,
9651,
736,
29871,
29900,
30004,
13,
30004,
13,
1678,
822,
3001,
29918,
27548,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
3639,
278,
2533,
310,
599,
5864,
30004,
13,
4706,
14550,
30004,
13,
4706,
3001,
29918,
27548,
353,
1583,
29889,
27548,
30004,
13,
4706,
363,
2278,
297,
1583,
29889,
11991,
29901,
30004,
13,
9651,
3001,
29918,
27548,
4619,
2278,
29889,
27548,
30004,
13,
30004,
13,
4706,
736,
3001,
29918,
27548,
30004,
13,
30004,
13,
1678,
822,
731,
29918,
23687,
29898,
1311,
29892,
921,
29892,
343,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
22521,
545,
393,
921,
29892,
343,
526,
2629,
278,
13451,
310,
445,
7855,
22993,
13,
4706,
2538,
300,
921,
29892,
29891,
577,
393,
263,
4842,
375,
338,
8429,
30004,
13,
4706,
14550,
30004,
13,
4706,
565,
921,
529,
29871,
29900,
29889,
29900,
29901,
30004,
13,
9651,
921,
353,
1583,
29889,
2848,
30004,
13,
4706,
565,
921,
1405,
1583,
29889,
2848,
29901,
30004,
13,
9651,
921,
353,
29871,
29900,
29889,
29900,
30004,
13,
30004,
13,
4706,
565,
343,
529,
29871,
29900,
29889,
29900,
29901,
30004,
13,
9651,
343,
353,
1583,
29889,
2103,
30004,
13,
4706,
565,
343,
1405,
1583,
29889,
2103,
29901,
30004,
13,
9651,
343,
353,
29871,
29900,
29889,
29900,
30004,
13,
30004,
13,
4706,
736,
921,
29892,
343,
30004,
13,
2
] |
mygallary/urls.py | mangowilliam/my_gallary | 0 | 5799 | <gh_stars>0
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from . import views
urlpatterns = [
url('^$', views.gallary,name = 'gallary'),
url(r'^search/', views.search_image, name='search_image'),
url(r'^details/(\d+)',views.search_location,name ='images')
]
if settings.DEBUG:
urlpatterns+= static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
5527,
29889,
26045,
29889,
7959,
1053,
2294,
13,
3166,
9557,
29889,
5527,
29889,
26045,
1053,
3142,
13,
3166,
869,
1053,
8386,
13,
13,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
3142,
877,
29985,
29938,
742,
8386,
29889,
29887,
497,
653,
29892,
978,
353,
525,
29887,
497,
653,
5477,
13,
1678,
3142,
29898,
29878,
29915,
29985,
4478,
29914,
742,
8386,
29889,
4478,
29918,
3027,
29892,
1024,
2433,
4478,
29918,
3027,
5477,
13,
1678,
3142,
29898,
29878,
29915,
29985,
14144,
29914,
1194,
29881,
28135,
742,
7406,
29889,
4478,
29918,
5479,
29892,
978,
353,
29915,
8346,
1495,
13,
29962,
13,
361,
6055,
29889,
18525,
29901,
13,
1678,
3142,
11037,
29879,
23661,
2294,
29898,
11027,
29889,
2303,
4571,
29909,
29918,
4219,
29892,
1842,
29918,
4632,
353,
6055,
29889,
2303,
4571,
29909,
29918,
21289,
29897,
13,
268,
13,
268,
13,
268,
13,
268,
13,
268,
13,
268,
13,
268,
13,
268,
13,
268,
2
] |
install/app_store/tk-framework-shotgunutils/v5.2.4/python/shotgun_globals/icon.py | JoanAzpeitia/lp_sg | 0 | 59064 | <reponame>JoanAzpeitia/lp_sg
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Shotgun Software Inc.
from sgtk.platform.qt import QtCore, QtGui
from .ui import resources_rc
# list of all entity types for which an icon exists
_entity_types_with_icons = ["Asset",
"ClientUser",
"EventLogEntry",
"Group",
"HumanUser",
"PublishedFile",
"TankPublishedFile",
"Note",
"Playlist",
"Project",
"Sequence",
"Shot",
"Tag",
"Task",
"Ticket",
"Version",
]
_cached_entity_icons = {}
def get_entity_type_icon_url(entity_type):
"""
Retrieve the icon resource path for the specified entity type if available.
This is useful if you want to include an icon in a ``QLabel`` using
an ``<img>`` html tag.
:param entity_type: The entity type to retrieve the icon for
:returns: A string url with a qt resource path
"""
if entity_type in _entity_types_with_icons:
return ":/tk-framework-shotgunutils/icon_%s_dark.png" % entity_type
else:
return None
def get_entity_type_icon(entity_type):
"""
Retrieve the icon for the specified entity type if available.
:param entity_type: The entity type to retrieve the icon for
:returns: A QIcon if an icon was found for the specified entity
type, otherwise None.
"""
global _cached_entity_icons
if entity_type not in _cached_entity_icons:
# not yet cached
icon = None
url = get_entity_type_icon_url(entity_type)
if url:
# create a QIcon for it
icon = QtGui.QIcon(QtGui.QPixmap(url))
# cache it
_cached_entity_icons[entity_type] = icon
# we've previously asked for the icon
return _cached_entity_icons[entity_type]
| [
1,
529,
276,
1112,
420,
29958,
10844,
273,
16748,
412,
277,
423,
29914,
22833,
29918,
5311,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29945,
1383,
327,
28798,
18540,
9266,
29889,
13,
29937,
29871,
13,
29937,
8707,
29943,
1367,
3919,
25758,
5300,
13756,
29829,
2544,
19926,
13,
29937,
29871,
13,
29937,
910,
664,
338,
4944,
376,
3289,
8519,
29908,
322,
4967,
304,
278,
1383,
327,
28798,
349,
23828,
21704,
7354,
29871,
13,
29937,
7562,
5920,
19245,
5134,
297,
445,
4978,
3577,
29889,
2823,
365,
2965,
1430,
1660,
29889,
13,
29937,
2648,
17378,
29892,
773,
29892,
17596,
470,
23815,
445,
664,
366,
12266,
596,
29871,
13,
29937,
17327,
304,
278,
1383,
327,
28798,
349,
23828,
21704,
7354,
7562,
5920,
19245,
29889,
2178,
10462,
29871,
13,
29937,
451,
4653,
368,
16896,
727,
262,
526,
21676,
491,
1383,
327,
28798,
18540,
9266,
29889,
13,
13,
3166,
269,
4141,
29895,
29889,
12120,
29889,
17915,
1053,
14705,
9203,
29892,
14705,
28707,
13,
3166,
869,
1481,
1053,
7788,
29918,
2214,
13,
13,
29937,
1051,
310,
599,
7855,
4072,
363,
607,
385,
9849,
4864,
13,
29918,
10041,
29918,
8768,
29918,
2541,
29918,
27078,
353,
6796,
26405,
613,
29871,
13,
462,
965,
376,
4032,
2659,
613,
13,
462,
965,
376,
2624,
3403,
9634,
613,
13,
462,
965,
376,
4782,
613,
13,
462,
965,
376,
29950,
7889,
2659,
613,
13,
462,
965,
376,
21076,
3726,
2283,
613,
13,
462,
965,
376,
29911,
804,
21076,
3726,
2283,
613,
13,
462,
965,
376,
9842,
613,
13,
462,
965,
376,
13454,
1761,
613,
13,
462,
965,
376,
7653,
613,
13,
462,
965,
376,
20529,
613,
13,
462,
965,
376,
2713,
327,
613,
13,
462,
965,
376,
8176,
613,
13,
462,
965,
376,
5398,
613,
13,
462,
965,
376,
29911,
8522,
613,
13,
462,
965,
376,
6594,
613,
13,
462,
965,
4514,
13,
13,
29918,
29883,
3791,
29918,
10041,
29918,
27078,
353,
6571,
13,
13,
13,
1753,
679,
29918,
10041,
29918,
1853,
29918,
4144,
29918,
2271,
29898,
10041,
29918,
1853,
1125,
13,
1678,
9995,
13,
1678,
4649,
29878,
2418,
278,
9849,
6503,
2224,
363,
278,
6790,
7855,
1134,
565,
3625,
29889,
13,
268,
13,
1678,
910,
338,
5407,
565,
366,
864,
304,
3160,
385,
9849,
297,
263,
4954,
2239,
1107,
16159,
773,
13,
1678,
385,
4954,
29966,
2492,
13885,
29952,
3472,
4055,
29889,
13,
13,
1678,
584,
3207,
7855,
29918,
1853,
29901,
450,
7855,
1134,
304,
10563,
278,
9849,
363,
13,
1678,
584,
18280,
29901,
965,
319,
1347,
3142,
411,
263,
3855,
29873,
6503,
2224,
13,
1678,
9995,
13,
1678,
565,
7855,
29918,
1853,
297,
903,
10041,
29918,
8768,
29918,
2541,
29918,
27078,
29901,
13,
4706,
736,
376,
8419,
11178,
29899,
4468,
29899,
8962,
28798,
13239,
29914,
4144,
29918,
29995,
29879,
29918,
26031,
29889,
2732,
29908,
1273,
7855,
29918,
1853,
13,
1678,
1683,
29901,
13,
4706,
736,
6213,
13,
13,
1753,
679,
29918,
10041,
29918,
1853,
29918,
4144,
29898,
10041,
29918,
1853,
1125,
13,
1678,
9995,
13,
1678,
4649,
29878,
2418,
278,
9849,
363,
278,
6790,
7855,
1134,
565,
3625,
29889,
13,
13,
1678,
584,
3207,
7855,
29918,
1853,
29901,
450,
7855,
1134,
304,
10563,
278,
9849,
363,
13,
1678,
584,
18280,
29901,
965,
319,
660,
12492,
565,
385,
9849,
471,
1476,
363,
278,
6790,
7855,
13,
462,
4706,
1134,
29892,
6467,
6213,
29889,
13,
1678,
9995,
13,
1678,
5534,
903,
29883,
3791,
29918,
10041,
29918,
27078,
13,
1678,
565,
7855,
29918,
1853,
451,
297,
903,
29883,
3791,
29918,
10041,
29918,
27078,
29901,
13,
4706,
396,
451,
3447,
22152,
13,
4706,
9849,
353,
6213,
13,
4706,
3142,
353,
679,
29918,
10041,
29918,
1853,
29918,
4144,
29918,
2271,
29898,
10041,
29918,
1853,
29897,
29871,
13,
4706,
565,
3142,
29901,
13,
9651,
396,
1653,
263,
660,
12492,
363,
372,
13,
9651,
9849,
353,
14705,
28707,
29889,
29984,
12492,
29898,
17303,
28707,
29889,
29984,
29925,
861,
1958,
29898,
2271,
876,
13,
4706,
396,
7090,
372,
13,
4706,
903,
29883,
3791,
29918,
10041,
29918,
27078,
29961,
10041,
29918,
1853,
29962,
353,
9849,
13,
308,
13,
1678,
396,
591,
29915,
345,
9251,
4433,
363,
278,
9849,
13,
1678,
736,
903,
29883,
3791,
29918,
10041,
29918,
27078,
29961,
10041,
29918,
1853,
29962,
13,
268,
13,
13,
13,
2
] |
Codewars/you're a square/you're a square.py | adoreblvnk/code_solutions | 0 | 26653 | from math import isqrt
is_square = lambda n: isqrt(n) ** 2 == n if n >= 0 else False
def is_square_soln(n):
pass
print(is_square(-1)) | [
1,
515,
5844,
1053,
338,
29939,
2273,
13,
13,
275,
29918,
17619,
353,
14013,
302,
29901,
338,
29939,
2273,
29898,
29876,
29897,
3579,
29871,
29906,
1275,
302,
565,
302,
6736,
29871,
29900,
1683,
7700,
13,
13,
1753,
338,
29918,
17619,
29918,
2929,
29876,
29898,
29876,
1125,
13,
1678,
1209,
13,
13,
13,
2158,
29898,
275,
29918,
17619,
6278,
29896,
876,
2
] |
pylibcamera_src/__init__.py | Jiangshan00001/pylibcamera | 0 | 191614 | import os
from .cffi_helpers import get_lib_handle
_this_path = os.path.dirname(os.path.realpath(__file__))
_library_dir = os.getenv('PI_LIBRARY_DIR')
if _library_dir is None:
_library_dir = os.path.join(_this_path, 'lib')
_include_dir = os.getenv('PI_INCLUDE_DIR')
if _include_dir is None:
_include_dir = os.path.join(_this_path, 'include')
lraw_api, ffi_raw = get_lib_handle(
['-DPI_API='],
'libcamera_raw_api.h',
'camera_raw_api',
_library_dir,
_include_dir
)
lvid_api, ffi_vid = get_lib_handle(
['-DPI_API='],
'libcamera_vid_api.h',
'camera_vid_api',
_library_dir,
_include_dir
)
| [
1,
1053,
2897,
13,
3166,
869,
29883,
600,
29875,
29918,
3952,
6774,
1053,
679,
29918,
1982,
29918,
8411,
13,
13,
13,
29918,
1366,
29918,
2084,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
6370,
2084,
22168,
1445,
1649,
876,
13,
13,
29918,
5258,
29918,
3972,
353,
2897,
29889,
657,
6272,
877,
2227,
29918,
5265,
15176,
19926,
29918,
9464,
1495,
13,
361,
903,
5258,
29918,
3972,
338,
6213,
29901,
13,
1678,
903,
5258,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
7373,
1366,
29918,
2084,
29892,
525,
1982,
1495,
13,
13,
29918,
2856,
29918,
3972,
353,
2897,
29889,
657,
6272,
877,
2227,
29918,
1177,
6154,
29965,
2287,
29918,
9464,
1495,
13,
361,
903,
2856,
29918,
3972,
338,
6213,
29901,
13,
1678,
903,
2856,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
7373,
1366,
29918,
2084,
29892,
525,
2856,
1495,
13,
13,
29880,
1610,
29918,
2754,
29892,
285,
7241,
29918,
1610,
353,
679,
29918,
1982,
29918,
8411,
29898,
13,
1678,
6024,
29899,
29928,
2227,
29918,
8787,
2433,
1402,
13,
1678,
525,
1982,
26065,
29918,
1610,
29918,
2754,
29889,
29882,
742,
13,
1678,
525,
26065,
29918,
1610,
29918,
2754,
742,
13,
1678,
903,
5258,
29918,
3972,
29892,
13,
1678,
903,
2856,
29918,
3972,
13,
29897,
13,
13,
29880,
8590,
29918,
2754,
29892,
285,
7241,
29918,
8590,
353,
679,
29918,
1982,
29918,
8411,
29898,
13,
1678,
6024,
29899,
29928,
2227,
29918,
8787,
2433,
1402,
13,
1678,
525,
1982,
26065,
29918,
8590,
29918,
2754,
29889,
29882,
742,
13,
1678,
525,
26065,
29918,
8590,
29918,
2754,
742,
13,
1678,
903,
5258,
29918,
3972,
29892,
13,
1678,
903,
2856,
29918,
3972,
13,
29897,
13,
13,
2
] |
boards/models.py | 6ba/bbgo | 22 | 113622 | <filename>boards/models.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse_lazy
from django.utils.translation import ugettext as _
class Board(models.Model):
"""Board of boards"""
BOARD_STATUS = {
('1normal', _('status_normal')),
('2temp', _('status_temp')),
('3notice', _('status_notice')),
('4warning', _('status_warning')),
('5hidden', _('status_hidden')),
('6deleted', _('status_deleted')),
}
table = models.IntegerField(default=0)
status = models.CharField(max_length=10, choices=BOARD_STATUS, default='1normal')
user = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now_add=True)
ip = models.GenericIPAddressField()
category = models.CharField(max_length=23, blank=True)
subject = models.CharField(max_length=41)
content = models.TextField()
view_count = models.IntegerField(default=0)
reply_count = models.IntegerField(default=0)
like_count = models.IntegerField(default=0)
dislike_count = models.IntegerField(default=0)
like_users = models.ManyToManyField(
User, related_name="board_like_users", default='', blank=True)
dislike_users = models.ManyToManyField(
User, related_name="board_dislike_users", default='', blank=True)
reference = models.CharField(max_length=1855, default='', blank=True)
has_image = models.BooleanField(default=False)
has_video = models.BooleanField(default=False)
def get_absolute_url(self):
"""Back to list"""
return reverse_lazy('boards:show_list', args=[self.table, 1])
def get_article_url(self):
"""Back to article"""
return reverse_lazy('boards:show_article', args=[self.id])
def get_edit_url(self):
"""Stay editing"""
return reverse_lazy('boards:edit_article', args=[self.id])
def get_status_text(self):
"""Get status text"""
if self.status == '1normal':
return _('status_normal')
elif self.status == '2temp':
return _('status_temp')
elif self.status == '3notice':
return _('status_notice')
elif self.status == '4warning':
return _('status_warning')
elif self.status == '5hidden':
return _('status_hidden')
elif self.status == '6deleted':
return _('status_deleted')
def get_image_text(self):
"""Get image text"""
return '<img src="/upload/django-summernote/'
def get_video_text(self):
"""Get video text"""
return '<iframe frameborder="0" src="//www.youtube.com/'
class Reply(models.Model):
"""Reply of boards"""
REPLY_STATUS = {
('1normal', _('status_normal')),
('5hidden', _('status_hidden')),
('6deleted', _('status_deleted')),
}
article_id = models.IntegerField(default=0)
reply_id = models.IntegerField(default=0)
reply_to = models.CharField(max_length=150, default='', blank=True)
status = models.CharField(
max_length=10, choices=REPLY_STATUS, default='1normal')
user = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now_add=True)
ip = models.GenericIPAddressField()
content = models.TextField(max_length=settings.REPLY_TEXT_MAX)
image = models.ImageField(upload_to="reply-images/%Y-%m-%d/", blank=True)
like_count = models.IntegerField(default=0)
dislike_count = models.IntegerField(default=0)
like_users = models.ManyToManyField(
User, related_name="reply_like_users", default='', blank=True)
dislike_users = models.ManyToManyField(
User, related_name="reply_dislike_users", default='', blank=True)
| [
1,
529,
9507,
29958,
24691,
29914,
9794,
29889,
2272,
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,
5527,
1053,
6055,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
1053,
4911,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
3166,
9557,
29889,
26045,
1053,
11837,
29918,
433,
1537,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
408,
903,
13,
13,
13,
1990,
12590,
29898,
9794,
29889,
3195,
1125,
13,
1678,
9995,
28397,
310,
1045,
3163,
15945,
29908,
13,
13,
1678,
16437,
17011,
29918,
27047,
353,
426,
13,
4706,
6702,
29896,
8945,
742,
903,
877,
4882,
29918,
8945,
1495,
511,
13,
4706,
6702,
29906,
7382,
742,
903,
877,
4882,
29918,
7382,
1495,
511,
13,
4706,
6702,
29941,
1333,
625,
742,
903,
877,
4882,
29918,
1333,
625,
1495,
511,
13,
4706,
6702,
29946,
27392,
742,
903,
877,
4882,
29918,
27392,
1495,
511,
13,
4706,
6702,
29945,
10892,
742,
903,
877,
4882,
29918,
10892,
1495,
511,
13,
4706,
6702,
29953,
311,
22742,
742,
903,
877,
4882,
29918,
311,
22742,
1495,
511,
13,
1678,
500,
13,
13,
1678,
1591,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
4660,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29892,
19995,
29922,
8456,
17011,
29918,
27047,
29892,
2322,
2433,
29896,
8945,
1495,
13,
1678,
1404,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
6055,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
373,
29918,
8143,
29922,
9794,
29889,
29907,
3289,
5454,
2287,
29897,
13,
1678,
2825,
29918,
271,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29897,
13,
1678,
9120,
29918,
271,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29897,
13,
1678,
10377,
353,
4733,
29889,
15809,
5690,
7061,
3073,
580,
13,
1678,
7663,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29941,
29892,
9654,
29922,
5574,
29897,
13,
1678,
4967,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29946,
29896,
29897,
13,
1678,
2793,
353,
4733,
29889,
15778,
580,
13,
1678,
1776,
29918,
2798,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
8908,
29918,
2798,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
763,
29918,
2798,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
766,
4561,
29918,
2798,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
763,
29918,
7193,
353,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
13,
4706,
4911,
29892,
4475,
29918,
978,
543,
3377,
29918,
4561,
29918,
7193,
613,
2322,
2433,
742,
9654,
29922,
5574,
29897,
13,
1678,
766,
4561,
29918,
7193,
353,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
13,
4706,
4911,
29892,
4475,
29918,
978,
543,
3377,
29918,
2218,
4561,
29918,
7193,
613,
2322,
2433,
742,
9654,
29922,
5574,
29897,
13,
1678,
3407,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29947,
29945,
29945,
29892,
2322,
2433,
742,
9654,
29922,
5574,
29897,
13,
1678,
756,
29918,
3027,
353,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
29897,
13,
1678,
756,
29918,
9641,
353,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
29897,
13,
13,
1678,
822,
679,
29918,
23552,
29918,
2271,
29898,
1311,
1125,
13,
4706,
9995,
5841,
304,
1051,
15945,
29908,
13,
4706,
736,
11837,
29918,
433,
1537,
877,
24691,
29901,
4294,
29918,
1761,
742,
6389,
11759,
1311,
29889,
2371,
29892,
29871,
29896,
2314,
13,
13,
1678,
822,
679,
29918,
7914,
29918,
2271,
29898,
1311,
1125,
13,
4706,
9995,
5841,
304,
4274,
15945,
29908,
13,
4706,
736,
11837,
29918,
433,
1537,
877,
24691,
29901,
4294,
29918,
7914,
742,
6389,
11759,
1311,
29889,
333,
2314,
13,
13,
1678,
822,
679,
29918,
5628,
29918,
2271,
29898,
1311,
1125,
13,
4706,
9995,
855,
388,
16278,
15945,
29908,
13,
4706,
736,
11837,
29918,
433,
1537,
877,
24691,
29901,
5628,
29918,
7914,
742,
6389,
11759,
1311,
29889,
333,
2314,
13,
13,
1678,
822,
679,
29918,
4882,
29918,
726,
29898,
1311,
1125,
13,
4706,
9995,
2577,
4660,
1426,
15945,
29908,
13,
4706,
565,
1583,
29889,
4882,
1275,
525,
29896,
8945,
2396,
13,
9651,
736,
903,
877,
4882,
29918,
8945,
1495,
13,
4706,
25342,
1583,
29889,
4882,
1275,
525,
29906,
7382,
2396,
13,
9651,
736,
903,
877,
4882,
29918,
7382,
1495,
13,
4706,
25342,
1583,
29889,
4882,
1275,
525,
29941,
1333,
625,
2396,
13,
9651,
736,
903,
877,
4882,
29918,
1333,
625,
1495,
13,
4706,
25342,
1583,
29889,
4882,
1275,
525,
29946,
27392,
2396,
13,
9651,
736,
903,
877,
4882,
29918,
27392,
1495,
13,
4706,
25342,
1583,
29889,
4882,
1275,
525,
29945,
10892,
2396,
13,
9651,
736,
903,
877,
4882,
29918,
10892,
1495,
13,
4706,
25342,
1583,
29889,
4882,
1275,
525,
29953,
311,
22742,
2396,
13,
9651,
736,
903,
877,
4882,
29918,
311,
22742,
1495,
13,
13,
1678,
822,
679,
29918,
3027,
29918,
726,
29898,
1311,
1125,
13,
4706,
9995,
2577,
1967,
1426,
15945,
29908,
13,
4706,
736,
12801,
2492,
4765,
13802,
9009,
29914,
14095,
29899,
2083,
29885,
824,
866,
22208,
13,
13,
1678,
822,
679,
29918,
9641,
29918,
726,
29898,
1311,
1125,
13,
4706,
9995,
2577,
4863,
1426,
15945,
29908,
13,
4706,
736,
12801,
22000,
3515,
11466,
543,
29900,
29908,
4765,
543,
458,
1636,
29889,
19567,
29889,
510,
22208,
13,
13,
13,
1990,
10088,
368,
29898,
9794,
29889,
3195,
1125,
13,
1678,
9995,
5612,
368,
310,
1045,
3163,
15945,
29908,
13,
13,
1678,
5195,
7390,
29979,
29918,
27047,
353,
426,
13,
4706,
6702,
29896,
8945,
742,
903,
877,
4882,
29918,
8945,
1495,
511,
13,
4706,
6702,
29945,
10892,
742,
903,
877,
4882,
29918,
10892,
1495,
511,
13,
4706,
6702,
29953,
311,
22742,
742,
903,
877,
4882,
29918,
311,
22742,
1495,
511,
13,
1678,
500,
13,
13,
1678,
4274,
29918,
333,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
8908,
29918,
333,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
8908,
29918,
517,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29945,
29900,
29892,
2322,
2433,
742,
9654,
29922,
5574,
29897,
13,
1678,
4660,
353,
4733,
29889,
27890,
29898,
13,
4706,
4236,
29918,
2848,
29922,
29896,
29900,
29892,
19995,
29922,
1525,
7390,
29979,
29918,
27047,
29892,
2322,
2433,
29896,
8945,
1495,
13,
1678,
1404,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
6055,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
373,
29918,
8143,
29922,
9794,
29889,
29907,
3289,
5454,
2287,
29897,
13,
1678,
2825,
29918,
271,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29897,
13,
1678,
9120,
29918,
271,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29897,
13,
1678,
10377,
353,
4733,
29889,
15809,
5690,
7061,
3073,
580,
13,
1678,
2793,
353,
4733,
29889,
15778,
29898,
3317,
29918,
2848,
29922,
11027,
29889,
1525,
7390,
29979,
29918,
16975,
29918,
12648,
29897,
13,
1678,
1967,
353,
4733,
29889,
2940,
3073,
29898,
9009,
29918,
517,
543,
3445,
368,
29899,
8346,
22584,
29979,
19222,
29885,
19222,
29881,
29914,
613,
9654,
29922,
5574,
29897,
13,
1678,
763,
29918,
2798,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
766,
4561,
29918,
2798,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29897,
13,
1678,
763,
29918,
7193,
353,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
13,
4706,
4911,
29892,
4475,
29918,
978,
543,
3445,
368,
29918,
4561,
29918,
7193,
613,
2322,
2433,
742,
9654,
29922,
5574,
29897,
13,
1678,
766,
4561,
29918,
7193,
353,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
13,
4706,
4911,
29892,
4475,
29918,
978,
543,
3445,
368,
29918,
2218,
4561,
29918,
7193,
613,
2322,
2433,
742,
9654,
29922,
5574,
29897,
13,
2
] |
src/pyphoplacecellanalysis/GUI/PyQtPlot/Flowchart/CustomNodes/Mixins/CtrlNodeMixins.py | CommanderPho/pyPhoPlaceCellAnalysis | 0 | 112471 | import numpy as np
class KeysListAccessingMixin:
""" Provides a helper function to get the keys from a variety of different data-types. Used for combo-boxes."""
@classmethod
def get_keys_list(cls, data):
if isinstance(data, dict):
keys = list(data.keys())
elif isinstance(data, list) or isinstance(data, tuple):
keys = data
elif isinstance(data, np.ndarray) or isinstance(data, np.void):
keys = data.dtype.names
else:
print("get_keys_list(data): Unknown data type:", type(data), data)
raise
return keys | [
1,
1053,
12655,
408,
7442,
13,
13,
1990,
4813,
952,
1293,
6638,
292,
29924,
861,
262,
29901,
13,
1678,
9995,
9133,
2247,
263,
16876,
740,
304,
679,
278,
6611,
515,
263,
12875,
310,
1422,
848,
29899,
8768,
29889,
501,
8485,
363,
419,
833,
29899,
1884,
267,
1213,
15945,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
679,
29918,
8149,
29918,
1761,
29898,
25932,
29892,
848,
1125,
13,
4706,
565,
338,
8758,
29898,
1272,
29892,
9657,
1125,
13,
9651,
6611,
353,
1051,
29898,
1272,
29889,
8149,
3101,
13,
4706,
25342,
338,
8758,
29898,
1272,
29892,
1051,
29897,
470,
338,
8758,
29898,
1272,
29892,
18761,
1125,
13,
9651,
6611,
353,
848,
13,
4706,
25342,
338,
8758,
29898,
1272,
29892,
7442,
29889,
299,
2378,
29897,
470,
338,
8758,
29898,
1272,
29892,
7442,
29889,
5405,
1125,
13,
9651,
6611,
353,
848,
29889,
29881,
1853,
29889,
7039,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
657,
29918,
8149,
29918,
1761,
29898,
1272,
1125,
853,
5203,
848,
1134,
29901,
613,
1134,
29898,
1272,
511,
848,
29897,
13,
9651,
12020,
13,
4706,
736,
6611,
2
] |
src/_zkapauthorizer/replicate.py | PrivateStorageio/SecureAccessTokenAuthorizer | 1 | 59898 | <reponame>PrivateStorageio/SecureAccessTokenAuthorizer
# Copyright 2022 PrivateStorage.io, 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.
from __future__ import annotations
"""
A system for replicating local SQLite3 database state to remote storage.
Theory of Operation
===================
A function to wrap a ``sqlite3.Connection`` in a new type is provided. This
new type provides facilities for accomplishing two goals:
* It (can someday) presents an expanded connection interface which includes
the ability to switch the database into "replicated" mode. This is an
application-facing interface meant to be used when the application is ready
to discharge its responsibilities in the replication process.
* It (can someday) expose the usual cursor interface wrapped around the usual
cursor behavior combined with extra logic to record statements which change
the underlying database (DDL and DML statements). This recorded data then
feeds into the above replication process once it is enabled.
An application's responsibilities in the replication process are to arrange
for remote storage of "snapshots" and "event streams". See the
replication/recovery design document for details of these concepts.
Once replication has been enabled, the application (can someday be) informed
whenever the event stream changes (respecting database transactionality) and
data can be shipped to remote storage as desired.
It is essential to good replication performance that once replication is
enabled all database-modifying actions are captured in the event stream. This
is the reason for providing a ``sqlite3.Connection``-like object for use by
application code rather than a separate side-car interface: it minimizes the
opportunities for database changes which are overlooked by this replication
system.
"""
__all__ = [
"ReplicationAlreadySetup",
"fail_setup_replication",
"setup_tahoe_lafs_replication",
"with_replication",
"statements_to_snapshot",
"connection_to_statements",
"snapshot",
]
import os
import re
from enum import Enum
from io import BytesIO
from sqlite3 import Connection as _SQLite3Connection
from sqlite3 import Cursor as _SQLite3Cursor
from typing import (
IO,
Any,
Awaitable,
Callable,
ClassVar,
Generator,
Iterable,
Iterator,
Optional,
Protocol,
Sequence,
)
import cbor2
from attrs import Factory, define, field, frozen
from compose import compose
from eliot import log_call
from twisted.application.service import IService, Service
from twisted.internet.defer import CancelledError, Deferred, DeferredQueue, succeed
from twisted.logger import Logger
from twisted.python.filepath import FilePath
from twisted.python.lockfile import FilesystemLock
from ._types import CapStr
from .config import REPLICA_RWCAP_BASENAME, Config
from .sql import Connection, Cursor, SQLRuntimeType, SQLType, statement_mutates
from .tahoe import DataProvider, DirectoryEntry, ITahoeClient, attenuate_writecap
# function which can set remote ZKAPAuthorizer state.
Uploader = Callable[[str, DataProvider], Awaitable[None]]
# function which can remove entries from ZKAPAuthorizer state.
Pruner = Callable[[Callable[[str], bool]], Awaitable[None]]
# functions which can list all entries in ZKAPAuthorizer state
Lister = Callable[[], Awaitable[list[str]]]
EntryLister = Callable[[], Awaitable[dict[str, DirectoryEntry]]]
class SnapshotPolicy(Protocol):
"""
Encode policy rules about when to take and upload a new snapshot.
"""
def should_snapshot(self, snapshot_size: int, replica_sizes: list[int]) -> bool:
"""
Given the size of a new snapshot and the size of an existing replica
(snapshot and event streams), is now a good time to take a new
snapshot?
"""
SNAPSHOT_NAME = "snapshot"
@frozen
class Replica:
"""
Manage a specific replica.
"""
upload: Uploader
prune: Pruner
entry_lister: EntryLister
async def list(self) -> list[str]:
return list(await self.entry_lister())
class ReplicationJob(Enum):
"""
The kinds of jobs that the Replication queue knows about
:ivar startup: The job that is run once when the replication service
starts and which is responsible for inspecting local and remote state
to determine if any actions are immediately necessary (even before any
further local changes are made).
:ivar event_stream: The job to upload a new event stream object.
:ivar snapshot: The job to upload a new snapshot object and prune
now-obsolete event stream objects.
:ivar consider_snapshot: The job to inspect replica event stream and
snapshot state and potentially schedule a new snapshot which will
allow pruning of existing event streams.
"""
startup = 1
event_stream = 2
snapshot = 3
consider_snapshot = 4
@frozen
class Change:
"""
Represent an item in a replication event stream
:ivar sequence: The sequence number of this event.
:ivar statement: The SQL statement associated with this event.
:ivar important: Whether this change was "important" or not.
:ivar arguments: Any arguments for the SQL statement.
"""
sequence: int
statement: str
arguments: Sequence[SQLType] = field(converter=tuple)
important: bool
@arguments.validator
def _validate_arguments(self, attribute, value) -> None:
"""
Require that the value has as elements only values are legal SQL values.
:note: attrs validators run after attrs converters.
"""
if all(isinstance(o, SQLRuntimeType) for o in value):
return None
raise ValueError("sequence contains values incompatible with SQL")
@frozen
class EventStream:
"""
A series of database operations represented as `Change` instances.
:ivar version: An identifier for the schema of the serialized form of this
event stream. This will appear inside the serialized form. A change
to the schema will be accompanied with an increment to this value.
"""
changes: Sequence[Change] = field(converter=tuple)
version: ClassVar[int] = 1
def highest_sequence(self) -> Optional[int]:
"""
:returns: the highest sequence number in this EventStream (or
None if there are no events)
"""
if not self.changes:
return None
return max(change.sequence for change in self.changes)
def to_bytes(self) -> IO[bytes]:
"""
:returns: a producer of bytes representing this EventStream.
"""
return BytesIO(
cbor2.dumps(
{
"version": self.version,
"events": tuple(
(
event.sequence,
event.statement,
event.arguments,
event.important,
)
for event in self.changes
),
}
)
)
@classmethod
def from_bytes(cls, stream: IO[bytes]) -> EventStream:
"""
:returns EventStream: an instance of EventStream from the given
bytes (which should have been produced by a prior call to
``to_bytes``)
"""
data = cbor2.load(stream)
serial_version = data.get("version", None)
if serial_version != cls.version:
raise ValueError(
f"Unknown serialized event stream version {serial_version}"
)
return cls(
changes=[
# List comprehension has incompatible type List[Change]; expected List[_T_co]
# https://github.com/python-attrs/attrs/issues/519
Change(*args) # type: ignore
for args in data["events"]
]
)
class AlreadySettingUp(Exception):
"""
Another setup attempt is currently in progress.
"""
class ReplicationAlreadySetup(Exception):
"""
An attempt was made to setup of replication but it is already set up.
"""
async def fail_setup_replication():
"""
A replication setup function that always fails.
"""
raise Exception("Test not set up for replication")
async def setup_tahoe_lafs_replication(client: ITahoeClient) -> str:
"""
Configure the ZKAPAuthorizer plugin that lives in the Tahoe-LAFS node with
the given configuration to replicate its state onto Tahoe-LAFS storage
servers using that Tahoe-LAFS node.
"""
# Find the configuration path for this node's replica.
config_path = client.get_private_path(REPLICA_RWCAP_BASENAME)
# Take an advisory lock on the configuration path to avoid concurrency
# shennanigans.
config_lock = FilesystemLock(config_path.asTextMode().path + ".lock")
if not config_lock.lock():
raise AlreadySettingUp()
try:
# Check to see if there is already configuration.
if config_path.exists():
raise ReplicationAlreadySetup()
# Create a directory with it
rw_cap = await client.make_directory()
# Store the resulting write-cap in the node's private directory
config_path.setContent(rw_cap.encode("ascii"))
finally:
# On success and failure, release the lock since we're done with the
# file for now.
config_lock.unlock()
# Attenuate it to a read-cap
rocap = attenuate_writecap(rw_cap)
# Return the read-cap
return rocap
def is_replication_setup(config: Config) -> bool:
"""
:return: ``True`` if and only if replication has previously been setup for
the Tahoe-LAFS node associated with the given configuration.
"""
# Find the configuration path for this node's replica.
return FilePath(config.get_private_path(REPLICA_RWCAP_BASENAME)).exists()
def get_replica_rwcap(config: Config) -> CapStr:
"""
:return: a mutable directory capability for our replica.
:raises: Exception if replication is not setup
"""
rwcap_file = FilePath(config.get_private_path(REPLICA_RWCAP_BASENAME))
return rwcap_file.getContent().decode("ascii")
@define
class _Important:
"""
A context-manager to set and unset the ._important flag on a
_ReplicationCapableConnection
"""
_replication_cursor: _ReplicationCapableCursor
def __enter__(self) -> None:
self._replication_cursor._important = True
def __exit__(self, *args) -> None:
self._replication_cursor._important = False
return None
def with_replication(
connection: _SQLite3Connection, enable_replication: bool
) -> _ReplicationCapableConnection:
"""
Wrap the given connection in a layer which is capable of entering a
"replication mode". In replication mode, the wrapper stores all changes
made through the connection so that they are available to be replicated by
another component. In normal mode, changes are not stored.
:param connection: The SQLite3 connection to wrap.
:param enable_replication: If ``True`` then the wrapper is placed in
"replication mode" initially. Otherwise it is not but it can be
switched into that mode later.
:return: The wrapper object.
"""
return _ReplicationCapableConnection(connection, enable_replication)
Mutation = tuple[bool, str, Iterable[tuple[SQLType, ...]]]
MutationObserver = Callable[[_SQLite3Cursor, Iterable[Mutation]], Callable[[], None]]
@define
class _ReplicationCapableConnection:
"""
Wrap a ``sqlite3.Connection`` to provide additional snapshot- and
streaming replication-related features.
All of this type's methods are intended to behave the same way as
``sqlite3.Connection``\ 's methods except they may also add some
additional functionality to support replication.
:ivar _replicating: ``True`` if this connection is currently in
replication mode and is recording all executed DDL and DML statements,
``False`` otherwise.
"""
# the "real" / normal sqlite connection
_conn: _SQLite3Connection
_replicating: bool
_observers: tuple[MutationObserver, ...] = Factory(tuple)
_mutations: list[Mutation] = Factory(list)
def enable_replication(self) -> None:
"""
Turn on replication support.
"""
self._replicating = True
def add_mutation_observer(self, fn: MutationObserver) -> None:
"""
Add another observer of changes made through this connection.
:param fn: An object to call after any transaction with changes is
committed on this connection.
"""
self._observers = self._observers + (fn,)
def iterdump(self) -> Iterator[str]:
"""
:return: SQL statements which can be used to reconstruct the database
state.
"""
return self._conn.iterdump()
def close(self) -> None:
return self._conn.close()
def __enter__(self) -> _ReplicationCapableConnection:
self._conn.__enter__()
return self
def __exit__(
self,
exc_type: Optional[type],
exc_value: Optional[BaseException],
exc_tb: Optional[Any],
) -> bool:
propagate = self._conn.__exit__(exc_type, exc_value, exc_tb)
if exc_type is None:
# There was no exception, signal observers that a change has been
# committed.
post_txn_fns: list[Callable[[], None]] = []
with self._conn:
curse = self._conn.cursor()
curse.execute("BEGIN IMMEDIATE TRANSACTION")
post_txn_fns.extend(self._maybe_signal_observers(curse))
for f in post_txn_fns:
f()
# Respect the underlying propagation decision.
return propagate
def _maybe_signal_observers(
self, cursor
) -> Generator[Callable[[], None], None, None]:
"""
If there are recorded mutations, deliver them to each of the observers and
then forget about them.
:return: A generator of the return values of the observers.
"""
if self._mutations:
to_signal = self._mutations
self._mutations = list()
for ob in self._observers:
yield ob(cursor, to_signal)
def cursor(self, factory: Optional[type] = None) -> _ReplicationCapableCursor:
"""
Get a replication-capable cursor for this connection.
"""
kwargs = {}
if factory is not None:
kwargs["factory"] = factory
cursor = self._conn.cursor(**kwargs)
# this cursor honors the ._replicating flag in this instance
return _ReplicationCapableCursor(cursor, self)
@define
class _ReplicationCapableCursor:
"""
Wrap a ``sqlite3.Cursor`` to provide additional streaming
replication-related features.
All of this type's attributes and methods are intended to behave the same
way as ``sqlite3.Cursor``\ 's methods except they may also add some
additional functionality to support replication.
"""
_cursor: _SQLite3Cursor
_connection: _ReplicationCapableConnection
# true while statements are "important" (which is pased along to
# the observers and interpreted as being "important data that the
# user will be interested in preserving")
_important: bool = field(init=False, default=False)
@property
def lastrowid(self):
return self._cursor.lastrowid
@property
def rowcount(self):
return self._cursor.rowcount
def close(self):
return self._cursor.close()
def execute(self, statement: str, row: Iterable[SQLType] = ()) -> Cursor:
"""
sqlite's Cursor API
:param row: the arguments
"""
assert isinstance(row, tuple)
self._cursor.execute(statement, row)
if self._connection._replicating and statement_mutates(statement):
# note that this interface is for multiple statements, so
# we turn our single row into a one-tuple
self._connection._mutations.append((self._important, statement, (row,)))
return self
def fetchall(self):
return self._cursor.fetchall()
def fetchmany(self, n):
return self._cursor.fetchmany(n)
def fetchone(self):
return self._cursor.fetchone()
def executemany(self, statement: str, rows: Iterable[Any]) -> Cursor:
self._cursor.executemany(statement, rows)
if self._connection._replicating and statement_mutates(statement):
self._connection._mutations.append((self._important, statement, rows))
return self
def important(self) -> _Important:
"""
Create a new context-manager that -- while active -- sets the
'important' flag to true and resets it afterwards.
"""
return _Important(self)
def statements_to_snapshot(statements: Iterator[str]) -> bytes:
"""
Take a snapshot of the database reachable via the given connection.
The snapshot is consistent and write transactions on the given connection
are blocked until it has been completed.
"""
return cbor2.dumps({"version": 1, "statements": [x for x in statements]})
def connection_to_statements(connection: Connection) -> Iterator[str]:
"""
Create an iterator of SQL statements as strings representing a consistent,
self-contained snapshot of the database reachable via the given
connection.
"""
return iter(connection.iterdump())
# Convenience API to dump statements and encode them for storage.
snapshot: Callable[[Connection], bytes] = compose(
statements_to_snapshot, connection_to_statements
)
async def tahoe_lafs_uploader(
client: ITahoeClient,
recovery_cap: str,
get_snapshot_data: DataProvider,
entry_name: str,
) -> None:
"""
Upload a replica to Tahoe, linking the result into the given recovery
mutable capbility under the name given by :py:data:`SNAPSHOT_NAME`.
"""
snapshot_immutable_cap = await client.upload(get_snapshot_data)
await client.link(recovery_cap, entry_name, snapshot_immutable_cap)
def get_tahoe_lafs_direntry_uploader(
client: ITahoeClient,
directory_mutable_cap: str,
) -> Callable[[str, DataProvider], Awaitable[None]]:
"""
Bind a Tahoe client to a mutable directory in a callable that will
upload some data and link it into the mutable directory under the
given name.
:return: A callable that will upload some data as the latest replica
snapshot. The data isn't given directly, but instead from a
zero-argument callable itself to facilitate retrying.
"""
async def upload(entry_name: str, get_data_provider: DataProvider) -> None:
await tahoe_lafs_uploader(
client, directory_mutable_cap, get_data_provider, entry_name
)
return upload
def get_tahoe_lafs_direntry_pruner(
client: ITahoeClient,
directory_mutable_cap: str,
) -> Callable[[Callable[[str], bool]], Awaitable[None]]:
"""
Bind a Tahoe client to a mutable directory in a callable that will
unlink some entries. Which entries to unlink are controlled by a predicate.
:return: A callable that will unlink some entries given a
predicate. The prediate is given a filename inside the mutable to
consider.
"""
async def maybe_unlink(predicate: Callable[[str], bool]) -> None:
"""
For each child of `directory_mutable_cap` delete it iff the
predicate returns True for that name
"""
entries = await client.list_directory(directory_mutable_cap)
for name in entries.keys():
if predicate(name):
await client.unlink(directory_mutable_cap, name)
return maybe_unlink
def get_tahoe_lafs_direntry_lister(
client: ITahoeClient, directory_mutable_cap: str
) -> EntryLister:
"""
Bind a Tahoe client to a mutable directory in a callable that will list
the entries of that directory.
"""
async def lister() -> dict[str, DirectoryEntry]:
entries = await client.list_directory(directory_mutable_cap)
return {
name: DirectoryEntry(kind, entry.get("size", 0))
for name, (kind, entry) in entries.items()
}
return lister
def get_tahoe_lafs_direntry_replica(
client: ITahoeClient, directory_mutable_cap: str
) -> Replica:
"""
Get an object that can interact with a replica stored in a Tahoe-LAFS
mutable directory.
"""
uploader = get_tahoe_lafs_direntry_uploader(client, directory_mutable_cap)
pruner = get_tahoe_lafs_direntry_pruner(client, directory_mutable_cap)
lister = get_tahoe_lafs_direntry_lister(client, directory_mutable_cap)
return Replica(uploader, pruner, lister)
def add_events(
cursor: _SQLite3Cursor,
events: Iterable[tuple[str, Sequence[SQLType]]],
important: bool,
) -> None:
"""
Add some new changes to the event-log.
"""
sql_args = []
for sql, args in events:
assert all(
isinstance(a, SQLRuntimeType) for a in args
), f"{args} contains non-SQL value"
sql_args.append((sql, cbor2.dumps(args), important))
cursor.executemany(
"""
INSERT INTO [event-stream]([statement], [serialized_arguments], [important])
VALUES (?, ?, ?)
""",
sql_args,
)
def get_events(conn: _SQLite3Connection) -> EventStream:
"""
Return all events currently in our event-log.
"""
with conn:
cursor = conn.cursor()
cursor.execute(
"""
SELECT [sequence-number], [statement], [serialized_arguments], [important]
FROM [event-stream]
"""
)
rows = cursor.fetchall()
return EventStream(
changes=[
# List comprehension has incompatible type List[Change]; expected List[_T_co]
# https://github.com/python-attrs/attrs/issues/519
Change(seq, stmt, cbor2.loads(arguments), important) # type: ignore
for seq, stmt, arguments, important in rows
]
)
def prune_events_to(conn: _SQLite3Connection, sequence_number: int) -> None:
"""
Remove all events <= sequence_number
"""
with conn:
cursor = conn.cursor()
cursor.execute(
"""
DELETE FROM [event-stream]
WHERE [sequence-number] <= (?)
""",
(sequence_number,),
)
cursor.fetchall()
@frozen
class AccumulatedChanges:
"""
A summary of some changes that have been made.
:ivar important: Are any of these "important" changes?
:ivar size: The approximate size in bytes to represent all of the changes.
"""
important: bool
size: int
@classmethod
def no_changes(cls) -> AccumulatedChanges:
"""
Create an ``AccumulatedChanges`` that represents no changes.
"""
return cls(False, 0)
@classmethod
def from_connection(cls, connection: _SQLite3Connection) -> AccumulatedChanges:
"""
Load information about unreplicated changes from the database.
"""
# this size is larger than what we would have computed via
# `from_changes` which only counts the statement-sizes .. but
# maybe fine? (also could fix by just accumulating the
# statement-sizes instead below)
events = get_events(connection)
data = events.to_bytes()
size = data.seek(0, os.SEEK_END)
any_important = any(change.important for change in events.changes)
return cls(any_important, size)
@classmethod
def from_statements(
cls,
important: bool,
statements: Iterable[tuple[str, Sequence[SQLType]]],
) -> AccumulatedChanges:
"""
Load information about unreplicated changes from SQL statements giving
those changes.
"""
# note that we're ignoring a certain amount of size overhead here: the
# _actual_ size will be some CBOR information and the sequence number,
# although the statement text should still dominate.
# XXX Fix the size calculation
return cls(important, sum(len(sql) for (sql, _) in statements))
def __add__(self, other: AccumulatedChanges) -> AccumulatedChanges:
return AccumulatedChanges(
self.important or other.important, self.size + other.size
)
def event_stream_name(high_seq: int) -> str:
"""
Construct the basename of the event stream object containing the given
highest sequence number.
"""
return f"event-stream-{high_seq}"
@define
class _ReplicationService(Service):
"""
Perform all activity related to maintaining a remote replica of the local
ZKAPAuthorizer database.
If this service is running for a database then the database is in
replication mode and changes will be uploaded.
:ivar _connection: A connection to the database being replicated.
:ivar _replicating: The long-running replication operation. This is never
expected to complete but it will be cancelled when the service stops.
"""
name = "replication-service" # type: ignore # Service assigns None, screws up type inference
_logger = Logger()
_connection: _ReplicationCapableConnection = field()
_replica: Replica
_snapshot_policy: SnapshotPolicy
_replicating: Optional[Deferred] = field(init=False, default=None)
_changes: AccumulatedChanges = AccumulatedChanges.no_changes()
_jobs: DeferredQueue = field(factory=DeferredQueue)
@property
def _unreplicated_connection(self):
"""
A normal SQLite3 connection object, changes made via which will not be
replicated.
"""
return self._connection._conn
def startService(self) -> None:
super().startService()
# Register ourselves as a change observer (first! we don't want to
# miss anything) and then put the database into replication mode so
# that there are recorded events for us to work with.
self._connection.add_mutation_observer(self.observed_event)
self._connection.enable_replication()
# Reflect whatever state is left over in the database from previous
# efforts.
self._changes = AccumulatedChanges.from_connection(
self._unreplicated_connection
)
self.queue_job(ReplicationJob.startup)
# Start the actual work of reacting to changes by uploading them (as
# appropriate).
self._replicating = Deferred.fromCoroutine(self._replicate())
async def _replicate(self) -> None:
"""
React to changes by replicating them to remote storage.
"""
try:
await self.wait_for_uploads()
except CancelledError:
# Ignore cancels; this will be the normal way we quit -- see
# stopService.
pass
except Exception:
# If something besides a cancel happens, at least make it visible.
self._logger.failure("unexpected wait_for_uploads error")
return None
def queue_job(self, job: ReplicationJob) -> None:
"""
Queue a job, if it is not already queued, to be executed after any other
queued jobs.
"""
if job not in self._jobs.pending:
self._jobs.put(job)
@log_call(action_type="zkapauthorizer:replicate:queue-event-upload")
def queue_event_upload(self) -> None:
"""
Request an event-stream upload of outstanding events.
"""
self.queue_job(ReplicationJob.event_stream)
@log_call(action_type="zkapauthorizer:replicate:queue-snapshot-upload")
def queue_snapshot_upload(self) -> None:
"""
Request that an upload of a new snapshot occur. Stale
event-streams will also be pruned after the snapshot is
successfully uploaded.
"""
self.queue_job(ReplicationJob.snapshot)
async def wait_for_uploads(self) -> None:
"""
An infinite async loop that processes uploads of event-streams or
snapshots
"""
while True:
job = await self._jobs.get()
if job == ReplicationJob.event_stream:
await self._do_one_event_upload()
elif job == ReplicationJob.snapshot:
await self._do_one_snapshot_upload()
elif job == ReplicationJob.consider_snapshot:
await self._do_consider_snapshot()
elif job == ReplicationJob.startup:
await self._do_startup()
else:
raise Exception("internal error") # pragma: nocover
async def _do_startup(self) -> None:
"""
Check local and remote state to determine if there is any work that should
be done immediately.
Currently, this will upload a snapshot if none exists in the replica,
or upload an event stream if there are events that warrant immediate
upload.
"""
if await self.should_upload_snapshot():
self.queue_snapshot_upload()
elif self.should_upload_eventstream(self._changes):
self.queue_event_upload()
@log_call(action_type="zkapauthorizer:replicate:snapshot-upload")
async def _do_one_snapshot_upload(self) -> None:
"""
Perform a single snapshot upload, including pruning event-streams
from the replica that are no longer relevant.
"""
# extract sequence-number and snapshot data
seqnum = 1
rows = (
self._connection.cursor()
.execute(
"SELECT seq FROM sqlite_sequence WHERE name = 'event-stream'", tuple()
)
.fetchall()
)
if len(rows):
seqnum = int(rows[0][0])
snap = snapshot(self._connection)
# upload snapshot
await self._replica.upload("snapshot", lambda: BytesIO(snap))
# remove local event history (that should now be encapsulated
# by the snapshot we just uploaded)
prune_events_to(self._connection._conn, seqnum)
# if we crash here, there will be extra event-stream objects
# in the replica. This will be fixed correctly upon our next
# snapshot upload. The extra event-stream objects will be
# ignored by the recovery code.
# prune old events from the replica
def is_old_eventstream(fname: str) -> bool:
"""
:returns: True if the `fname` is an event-stream object and the
sequence number is strictly less than our snapshot's
maximum sequence.
"""
m = re.match("event-stream-([0-9]*)", fname)
if m:
seq = int(m.group(1))
if seq <= seqnum:
return True
return False
await self._replica.prune(is_old_eventstream)
@log_call(action_type="zkapauthorizer:replicate:event-upload")
async def _do_one_event_upload(self) -> None:
"""
Process a single upload of all current events and then delete them
from our database.
"""
events = get_events(self._unreplicated_connection)
high_seq = events.highest_sequence()
# if this is None there are no events at all
if high_seq is None:
return
# otherwise, upload the events we found.
name = event_stream_name(high_seq)
await self._replica.upload(name, events.to_bytes)
# then discard the uploaded events from the local database.
prune_events_to(self._unreplicated_connection, high_seq)
# Arrange to examine replica state soon to determine whether taking a
# new snapshot and pruning existing event streams is useful.
self.queue_job(ReplicationJob.consider_snapshot)
async def _do_consider_snapshot(self) -> None:
"""
Inspect local and remote state to decide if the cost of taking and
uploading a new snapshot is worth the resulting savings in storage.
"""
local_size = await self._new_snapshot_size()
replica_size = await self._replica_size()
if self._snapshot_policy.should_snapshot(local_size, replica_size):
self.queue_snapshot_upload()
async def _new_snapshot_size(self) -> int:
"""
Measure the size of snapshot of the current database state, in bytes.
"""
return len(snapshot(self._connection))
async def _replica_size(self) -> list[int]:
"""
Retrieve the size of all the files that are part of the current on-grid
replica.
"""
entries = await self._replica.entry_lister()
return [
entry.size
for (name, entry) in entries.items()
if entry.kind == "filenode"
and name == "snapshot"
or name.startswith("event-stream-")
]
def stopService(self) -> Deferred[None]:
"""
Cancel the replication operation and then wait for it to complete.
"""
super().stopService()
replicating = self._replicating
if replicating is None:
return succeed(None)
self._replicating = None
replicating.cancel()
return replicating
def observed_event(
self,
unobserved_cursor: _SQLite3Cursor,
all_changes: Iterable[Mutation],
) -> Callable[[], None]:
"""
A mutating SQL statement was observed by the cursor. This is like
the executemany interface: there is always a list of args. For
a single statement, we call this with the len(args) == 1
:param all_changes: 3-tuples of (important, statement, args)
where important is whether this should trigger an
immediate upload; statement is the SQL statement; and args
are the arguments for the SQL.
"""
# A mutation contains one statement and one or more rows of arguments
# that go with it. We're going to generate an event per
# statement/argument pair - so "unroll" those rows and pair each
# individual argument tuple with its statement.
events = []
any_important = False
for (important, sql, manyargs) in all_changes:
any_important = any_important or important
for args in manyargs:
events.append((sql, args))
add_events(unobserved_cursor, events, any_important)
changes = AccumulatedChanges.from_statements(any_important, events)
self._changes = self._changes + changes
if self.should_upload_eventstream(self._changes):
return self._complete_upload
else:
return lambda: None
def _complete_upload(self) -> None:
"""
This is called after the transaction closes (because we return it
from our observer function). See
_ReplicationCapableConnection.__exit__
"""
self.queue_event_upload()
self._changes = AccumulatedChanges.no_changes()
async def should_upload_snapshot(self) -> bool:
"""
:returns: True if there is no remote snapshot
"""
entries = await self._replica.list()
return SNAPSHOT_NAME not in entries
def should_upload_eventstream(self, changes: AccumulatedChanges) -> bool:
"""
:returns: True if we have accumulated enough statements to upload
an event-stream record.
"""
return changes.important or changes.size >= 570000
def replication_service(
replicated_connection: _ReplicationCapableConnection,
replica: Replica,
snapshot_policy: SnapshotPolicy,
) -> IService:
"""
Return a service which implements the replication process documented in
the ``backup-recovery`` design document.
"""
return _ReplicationService(
connection=replicated_connection,
replica=replica,
snapshot_policy=snapshot_policy,
)
| [
1,
529,
276,
1112,
420,
29958,
25207,
10486,
601,
29914,
7898,
545,
6638,
6066,
13720,
3950,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29906,
12230,
10486,
29889,
601,
29892,
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,
3166,
4770,
29888,
9130,
1649,
1053,
25495,
13,
13,
15945,
29908,
13,
29909,
1788,
363,
1634,
506,
1218,
1887,
23299,
29941,
2566,
2106,
304,
7592,
8635,
29889,
13,
13,
1576,
706,
310,
20462,
13,
9166,
25512,
13,
13,
29909,
740,
304,
12244,
263,
4954,
22793,
29941,
29889,
5350,
16159,
297,
263,
716,
1134,
338,
4944,
29889,
29871,
910,
13,
1482,
1134,
8128,
23330,
363,
12709,
292,
1023,
14433,
29901,
13,
13,
29930,
739,
313,
3068,
1047,
287,
388,
29897,
22981,
385,
17832,
3957,
5067,
607,
7805,
13,
29871,
278,
11509,
304,
4607,
278,
2566,
964,
376,
3445,
9169,
29908,
4464,
29889,
29871,
910,
338,
385,
13,
29871,
2280,
29899,
29888,
9390,
5067,
6839,
304,
367,
1304,
746,
278,
2280,
338,
7960,
13,
29871,
304,
766,
23367,
967,
5544,
747,
9770,
297,
278,
1634,
1414,
1889,
29889,
13,
13,
29930,
739,
313,
3068,
1047,
287,
388,
29897,
24396,
278,
9670,
10677,
5067,
21021,
2820,
278,
9670,
13,
29871,
10677,
6030,
12420,
411,
4805,
5900,
304,
2407,
9506,
607,
1735,
13,
29871,
278,
14407,
2566,
313,
7858,
29931,
322,
360,
1988,
9506,
467,
29871,
910,
10478,
848,
769,
13,
29871,
1238,
5779,
964,
278,
2038,
1634,
1414,
1889,
2748,
372,
338,
9615,
29889,
13,
13,
2744,
2280,
29915,
29879,
5544,
747,
9770,
297,
278,
1634,
1414,
1889,
526,
304,
564,
3881,
13,
1454,
7592,
8635,
310,
376,
29879,
8971,
845,
1862,
29908,
322,
376,
3696,
20873,
1642,
29871,
2823,
278,
13,
3445,
1414,
29914,
3757,
22205,
2874,
1842,
363,
4902,
310,
1438,
22001,
29889,
13,
13,
26222,
1634,
1414,
756,
1063,
9615,
29892,
278,
2280,
313,
3068,
1047,
287,
388,
367,
29897,
23388,
13,
8256,
1310,
278,
1741,
4840,
3620,
313,
690,
1103,
292,
2566,
10804,
2877,
29897,
322,
13,
1272,
508,
367,
528,
16242,
304,
7592,
8635,
408,
7429,
29889,
13,
13,
3112,
338,
18853,
304,
1781,
1634,
1414,
4180,
393,
2748,
1634,
1414,
338,
13,
17590,
599,
2566,
29899,
1545,
9215,
8820,
526,
15468,
297,
278,
1741,
4840,
29889,
29871,
910,
13,
275,
278,
2769,
363,
13138,
263,
4954,
22793,
29941,
29889,
5350,
16159,
29899,
4561,
1203,
363,
671,
491,
13,
6214,
775,
3265,
1135,
263,
5004,
2625,
29899,
4287,
5067,
29901,
372,
6260,
7093,
278,
13,
29877,
3016,
348,
1907,
363,
2566,
3620,
607,
526,
975,
6914,
287,
491,
445,
1634,
1414,
13,
5205,
29889,
13,
15945,
29908,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
376,
5612,
1414,
2499,
2040,
26947,
613,
13,
1678,
376,
14057,
29918,
14669,
29918,
3445,
1414,
613,
13,
1678,
376,
14669,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3445,
1414,
613,
13,
1678,
376,
2541,
29918,
3445,
1414,
613,
13,
1678,
376,
6112,
4110,
29918,
517,
29918,
29879,
14551,
613,
13,
1678,
376,
9965,
29918,
517,
29918,
6112,
4110,
613,
13,
1678,
376,
29879,
14551,
613,
13,
29962,
13,
13,
5215,
2897,
13,
5215,
337,
13,
3166,
14115,
1053,
1174,
398,
13,
3166,
12013,
1053,
2648,
2167,
5971,
13,
3166,
21120,
29941,
1053,
15160,
408,
903,
4176,
568,
29941,
5350,
13,
3166,
21120,
29941,
1053,
315,
5966,
408,
903,
4176,
568,
29941,
19890,
13,
3166,
19229,
1053,
313,
13,
1678,
10663,
29892,
13,
1678,
3139,
29892,
13,
1678,
319,
10685,
519,
29892,
13,
1678,
8251,
519,
29892,
13,
1678,
4134,
9037,
29892,
13,
1678,
3251,
1061,
29892,
13,
1678,
20504,
519,
29892,
13,
1678,
20504,
1061,
29892,
13,
1678,
28379,
29892,
13,
1678,
1019,
5770,
29892,
13,
1678,
922,
3910,
29892,
13,
29897,
13,
13,
5215,
274,
4089,
29906,
13,
3166,
12421,
29879,
1053,
27561,
29892,
4529,
29892,
1746,
29892,
14671,
2256,
13,
3166,
27435,
1053,
27435,
13,
3166,
560,
24414,
1053,
1480,
29918,
4804,
13,
3166,
3252,
12652,
29889,
6214,
29889,
5509,
1053,
306,
3170,
29892,
6692,
13,
3166,
3252,
12652,
29889,
14168,
300,
29889,
311,
571,
1053,
1815,
2242,
839,
2392,
29892,
897,
14373,
29892,
897,
14373,
10620,
29892,
9269,
13,
3166,
3252,
12652,
29889,
21707,
1053,
28468,
13,
3166,
3252,
12652,
29889,
4691,
29889,
1445,
2084,
1053,
3497,
2605,
13,
3166,
3252,
12652,
29889,
4691,
29889,
908,
1445,
1053,
12745,
973,
16542,
13,
13,
3166,
869,
29918,
8768,
1053,
5915,
5015,
13,
3166,
869,
2917,
1053,
5195,
7390,
2965,
29909,
29918,
29934,
29956,
29907,
3301,
29918,
29933,
3289,
1430,
25797,
29892,
12782,
13,
3166,
869,
2850,
1053,
15160,
29892,
315,
5966,
29892,
3758,
7944,
1542,
29892,
3758,
1542,
29892,
3229,
29918,
6149,
1078,
13,
3166,
869,
29873,
801,
7297,
1053,
3630,
6980,
29892,
18862,
9634,
29892,
13315,
801,
7297,
4032,
29892,
472,
841,
27240,
29918,
3539,
5030,
13,
13,
29937,
740,
607,
508,
731,
7592,
796,
29968,
3301,
13720,
3950,
2106,
29889,
13,
3373,
12657,
353,
8251,
519,
8999,
710,
29892,
3630,
6980,
1402,
319,
10685,
519,
29961,
8516,
5262,
13,
13,
29937,
740,
607,
508,
3349,
9976,
515,
796,
29968,
3301,
13720,
3950,
2106,
29889,
13,
29925,
3389,
261,
353,
8251,
519,
8999,
5594,
519,
8999,
710,
1402,
6120,
20526,
319,
10685,
519,
29961,
8516,
5262,
13,
13,
29937,
3168,
607,
508,
1051,
599,
9976,
297,
796,
29968,
3301,
13720,
3950,
2106,
13,
29931,
1531,
353,
8251,
519,
8999,
1402,
319,
10685,
519,
29961,
1761,
29961,
710,
5262,
29962,
13,
9634,
29931,
1531,
353,
8251,
519,
8999,
1402,
319,
10685,
519,
29961,
8977,
29961,
710,
29892,
18862,
9634,
5262,
29962,
13,
13,
13,
1990,
317,
14551,
15644,
29898,
17830,
1125,
13,
1678,
9995,
13,
1678,
1174,
401,
8898,
6865,
1048,
746,
304,
2125,
322,
6441,
263,
716,
22395,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
881,
29918,
29879,
14551,
29898,
1311,
29892,
22395,
29918,
2311,
29901,
938,
29892,
1634,
10123,
29918,
29879,
7093,
29901,
1051,
29961,
524,
2314,
1599,
6120,
29901,
13,
4706,
9995,
13,
4706,
11221,
278,
2159,
310,
263,
716,
22395,
322,
278,
2159,
310,
385,
5923,
1634,
10123,
13,
4706,
313,
29879,
14551,
322,
1741,
20873,
511,
338,
1286,
263,
1781,
931,
304,
2125,
263,
716,
13,
4706,
22395,
29973,
13,
4706,
9995,
13,
13,
13,
19296,
3301,
7068,
2891,
29918,
5813,
353,
376,
29879,
14551,
29908,
13,
13,
13,
29992,
29888,
307,
2256,
13,
1990,
10088,
10123,
29901,
13,
1678,
9995,
13,
1678,
2315,
482,
263,
2702,
1634,
10123,
29889,
13,
1678,
9995,
13,
13,
1678,
6441,
29901,
5020,
12657,
13,
1678,
544,
1540,
29901,
1588,
348,
261,
13,
1678,
6251,
29918,
29880,
1531,
29901,
28236,
29931,
1531,
13,
13,
1678,
7465,
822,
1051,
29898,
1311,
29897,
1599,
1051,
29961,
710,
5387,
13,
4706,
736,
1051,
29898,
20675,
1583,
29889,
8269,
29918,
29880,
1531,
3101,
13,
13,
13,
1990,
10088,
1414,
11947,
29898,
16854,
1125,
13,
1678,
9995,
13,
1678,
450,
17690,
310,
17643,
393,
278,
10088,
1414,
9521,
9906,
1048,
13,
13,
1678,
584,
440,
279,
20234,
29901,
450,
4982,
393,
338,
1065,
2748,
746,
278,
1634,
1414,
2669,
13,
4706,
8665,
322,
607,
338,
14040,
363,
16096,
292,
1887,
322,
7592,
2106,
13,
4706,
304,
8161,
565,
738,
8820,
526,
7389,
5181,
313,
11884,
1434,
738,
13,
4706,
4340,
1887,
3620,
526,
1754,
467,
13,
13,
1678,
584,
440,
279,
1741,
29918,
5461,
29901,
450,
4982,
304,
6441,
263,
716,
1741,
4840,
1203,
29889,
13,
13,
1678,
584,
440,
279,
22395,
29901,
450,
4982,
304,
6441,
263,
716,
22395,
1203,
322,
544,
1540,
13,
4706,
1286,
29899,
711,
2170,
371,
1741,
4840,
3618,
29889,
13,
13,
1678,
584,
440,
279,
2050,
29918,
29879,
14551,
29901,
450,
4982,
304,
16096,
1634,
10123,
1741,
4840,
322,
13,
4706,
22395,
2106,
322,
19998,
20410,
263,
716,
22395,
607,
674,
13,
4706,
2758,
544,
27964,
310,
5923,
1741,
20873,
29889,
13,
1678,
9995,
13,
13,
1678,
20234,
353,
29871,
29896,
13,
1678,
1741,
29918,
5461,
353,
29871,
29906,
13,
1678,
22395,
353,
29871,
29941,
13,
1678,
2050,
29918,
29879,
14551,
353,
29871,
29946,
13,
13,
13,
29992,
29888,
307,
2256,
13,
1990,
10726,
29901,
13,
1678,
9995,
13,
1678,
16314,
385,
2944,
297,
263,
1634,
1414,
1741,
4840,
13,
13,
1678,
584,
440,
279,
5665,
29901,
450,
5665,
1353,
310,
445,
1741,
29889,
13,
1678,
584,
440,
279,
3229,
29901,
450,
3758,
3229,
6942,
411,
445,
1741,
29889,
13,
1678,
584,
440,
279,
4100,
29901,
26460,
445,
1735,
471,
376,
17001,
29908,
470,
451,
29889,
13,
1678,
584,
440,
279,
6273,
29901,
3139,
6273,
363,
278,
3758,
3229,
29889,
13,
1678,
9995,
13,
13,
1678,
5665,
29901,
938,
13,
1678,
3229,
29901,
851,
13,
1678,
6273,
29901,
922,
3910,
29961,
4176,
1542,
29962,
353,
1746,
29898,
535,
13549,
29922,
23583,
29897,
13,
1678,
4100,
29901,
6120,
13,
13,
1678,
732,
25699,
29889,
3084,
1061,
13,
1678,
822,
903,
15480,
29918,
25699,
29898,
1311,
29892,
5352,
29892,
995,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
830,
1548,
393,
278,
995,
756,
408,
3161,
871,
1819,
526,
11706,
3758,
1819,
29889,
13,
13,
4706,
584,
6812,
29901,
12421,
29879,
2854,
4097,
1065,
1156,
12421,
29879,
5486,
2153,
29889,
13,
4706,
9995,
13,
4706,
565,
599,
29898,
275,
8758,
29898,
29877,
29892,
3758,
7944,
1542,
29897,
363,
288,
297,
995,
1125,
13,
9651,
736,
6213,
13,
4706,
12020,
7865,
2392,
703,
16506,
3743,
1819,
297,
23712,
411,
3758,
1159,
13,
13,
13,
29992,
29888,
307,
2256,
13,
1990,
6864,
3835,
29901,
13,
1678,
9995,
13,
1678,
319,
3652,
310,
2566,
6931,
9875,
408,
421,
7277,
29952,
8871,
29889,
13,
13,
1678,
584,
440,
279,
1873,
29901,
530,
15882,
363,
278,
10938,
310,
278,
7797,
1891,
883,
310,
445,
13,
4706,
1741,
4840,
29889,
29871,
910,
674,
2615,
2768,
278,
7797,
1891,
883,
29889,
29871,
319,
1735,
13,
4706,
304,
278,
10938,
674,
367,
21302,
411,
385,
11924,
304,
445,
995,
29889,
13,
1678,
9995,
13,
13,
1678,
3620,
29901,
922,
3910,
29961,
7277,
29962,
353,
1746,
29898,
535,
13549,
29922,
23583,
29897,
13,
1678,
1873,
29901,
4134,
9037,
29961,
524,
29962,
353,
29871,
29896,
13,
13,
1678,
822,
9939,
29918,
16506,
29898,
1311,
29897,
1599,
28379,
29961,
524,
5387,
13,
4706,
9995,
13,
4706,
584,
18280,
29901,
278,
9939,
5665,
1353,
297,
445,
6864,
3835,
313,
272,
13,
9651,
6213,
565,
727,
526,
694,
4959,
29897,
13,
4706,
9995,
13,
4706,
565,
451,
1583,
29889,
25990,
29901,
13,
9651,
736,
6213,
13,
4706,
736,
4236,
29898,
3167,
29889,
16506,
363,
1735,
297,
1583,
29889,
25990,
29897,
13,
13,
1678,
822,
304,
29918,
13193,
29898,
1311,
29897,
1599,
10663,
29961,
13193,
5387,
13,
4706,
9995,
13,
4706,
584,
18280,
29901,
263,
14297,
310,
6262,
15783,
445,
6864,
3835,
29889,
13,
4706,
9995,
13,
4706,
736,
2648,
2167,
5971,
29898,
13,
9651,
274,
4089,
29906,
29889,
29881,
17204,
29898,
13,
18884,
426,
13,
462,
1678,
376,
3259,
1115,
1583,
29889,
3259,
29892,
13,
462,
1678,
376,
13604,
1115,
18761,
29898,
13,
462,
4706,
313,
13,
462,
9651,
1741,
29889,
16506,
29892,
13,
462,
9651,
1741,
29889,
20788,
29892,
13,
462,
9651,
1741,
29889,
25699,
29892,
13,
462,
9651,
1741,
29889,
17001,
29892,
13,
462,
4706,
1723,
13,
462,
4706,
363,
1741,
297,
1583,
29889,
25990,
13,
462,
1678,
10353,
13,
18884,
500,
13,
9651,
1723,
13,
4706,
1723,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
13193,
29898,
25932,
29892,
4840,
29901,
10663,
29961,
13193,
2314,
1599,
6864,
3835,
29901,
13,
4706,
9995,
13,
4706,
584,
18280,
6864,
3835,
29901,
385,
2777,
310,
6864,
3835,
515,
278,
2183,
13,
9651,
6262,
313,
4716,
881,
505,
1063,
7371,
491,
263,
7536,
1246,
304,
13,
9651,
4954,
517,
29918,
13193,
29952,
6348,
13,
4706,
9995,
13,
4706,
848,
353,
274,
4089,
29906,
29889,
1359,
29898,
5461,
29897,
13,
4706,
7797,
29918,
3259,
353,
848,
29889,
657,
703,
3259,
613,
6213,
29897,
13,
4706,
565,
7797,
29918,
3259,
2804,
1067,
29879,
29889,
3259,
29901,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
285,
29908,
14148,
7797,
1891,
1741,
4840,
1873,
426,
15550,
29918,
3259,
5038,
13,
9651,
1723,
13,
4706,
736,
1067,
29879,
29898,
13,
9651,
3620,
11759,
13,
18884,
396,
2391,
15171,
2673,
756,
297,
23712,
1134,
2391,
29961,
7277,
1385,
3806,
2391,
28513,
29911,
29918,
1111,
29962,
13,
18884,
396,
2045,
597,
3292,
29889,
510,
29914,
4691,
29899,
5552,
29879,
29914,
5552,
29879,
29914,
12175,
29914,
29945,
29896,
29929,
13,
18884,
10726,
10456,
5085,
29897,
29871,
396,
1134,
29901,
11455,
13,
18884,
363,
6389,
297,
848,
3366,
13604,
3108,
13,
9651,
4514,
13,
4706,
1723,
13,
13,
13,
1990,
838,
2040,
29020,
3373,
29898,
2451,
1125,
13,
1678,
9995,
13,
1678,
7280,
6230,
4218,
338,
5279,
297,
6728,
29889,
13,
1678,
9995,
13,
13,
13,
1990,
10088,
1414,
2499,
2040,
26947,
29898,
2451,
1125,
13,
1678,
9995,
13,
1678,
530,
4218,
471,
1754,
304,
6230,
310,
1634,
1414,
541,
372,
338,
2307,
731,
701,
29889,
13,
1678,
9995,
13,
13,
13,
12674,
822,
4418,
29918,
14669,
29918,
3445,
1414,
7295,
13,
1678,
9995,
13,
1678,
319,
1634,
1414,
6230,
740,
393,
2337,
8465,
29889,
13,
1678,
9995,
13,
1678,
12020,
8960,
703,
3057,
451,
731,
701,
363,
1634,
1414,
1159,
13,
13,
13,
12674,
822,
6230,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3445,
1414,
29898,
4645,
29901,
13315,
801,
7297,
4032,
29897,
1599,
851,
29901,
13,
1678,
9995,
13,
1678,
1281,
4532,
278,
796,
29968,
3301,
13720,
3950,
7079,
393,
12080,
297,
278,
323,
801,
7297,
29899,
4375,
9998,
2943,
411,
13,
1678,
278,
2183,
5285,
304,
1634,
5926,
967,
2106,
11480,
323,
801,
7297,
29899,
4375,
9998,
8635,
13,
1678,
12424,
773,
393,
323,
801,
7297,
29899,
4375,
9998,
2943,
29889,
13,
1678,
9995,
13,
1678,
396,
10987,
278,
5285,
2224,
363,
445,
2943,
29915,
29879,
1634,
10123,
29889,
13,
1678,
2295,
29918,
2084,
353,
3132,
29889,
657,
29918,
9053,
29918,
2084,
29898,
1525,
7390,
2965,
29909,
29918,
29934,
29956,
29907,
3301,
29918,
29933,
3289,
1430,
25797,
29897,
13,
13,
1678,
396,
11190,
385,
25228,
706,
7714,
373,
278,
5285,
2224,
304,
4772,
3022,
10880,
13,
1678,
396,
528,
2108,
273,
335,
550,
29889,
13,
1678,
2295,
29918,
908,
353,
12745,
973,
16542,
29898,
2917,
29918,
2084,
29889,
294,
1626,
6818,
2141,
2084,
718,
11393,
908,
1159,
13,
13,
1678,
565,
451,
2295,
29918,
908,
29889,
908,
7295,
13,
4706,
12020,
838,
2040,
29020,
3373,
580,
13,
1678,
1018,
29901,
13,
13,
4706,
396,
5399,
304,
1074,
565,
727,
338,
2307,
5285,
29889,
13,
4706,
565,
2295,
29918,
2084,
29889,
9933,
7295,
13,
9651,
12020,
10088,
1414,
2499,
2040,
26947,
580,
13,
13,
4706,
396,
6204,
263,
3884,
411,
372,
13,
4706,
364,
29893,
29918,
5030,
353,
7272,
3132,
29889,
5675,
29918,
12322,
580,
13,
13,
4706,
396,
14491,
278,
9819,
2436,
29899,
5030,
297,
278,
2943,
29915,
29879,
2024,
3884,
13,
4706,
2295,
29918,
2084,
29889,
842,
3916,
29898,
13975,
29918,
5030,
29889,
12508,
703,
294,
18869,
5783,
13,
13,
1678,
7146,
29901,
13,
4706,
396,
1551,
2551,
322,
10672,
29892,
6507,
278,
7714,
1951,
591,
29915,
276,
2309,
411,
278,
13,
4706,
396,
934,
363,
1286,
29889,
13,
4706,
2295,
29918,
908,
29889,
348,
908,
580,
13,
13,
1678,
396,
6212,
4814,
403,
372,
304,
263,
1303,
29899,
5030,
13,
1678,
696,
5030,
353,
472,
841,
27240,
29918,
3539,
5030,
29898,
13975,
29918,
5030,
29897,
13,
13,
1678,
396,
7106,
278,
1303,
29899,
5030,
13,
1678,
736,
696,
5030,
13,
13,
13,
1753,
338,
29918,
3445,
1414,
29918,
14669,
29898,
2917,
29901,
12782,
29897,
1599,
6120,
29901,
13,
1678,
9995,
13,
1678,
584,
2457,
29901,
4954,
5574,
16159,
565,
322,
871,
565,
1634,
1414,
756,
9251,
1063,
6230,
363,
13,
4706,
278,
323,
801,
7297,
29899,
4375,
9998,
2943,
6942,
411,
278,
2183,
5285,
29889,
13,
1678,
9995,
13,
1678,
396,
10987,
278,
5285,
2224,
363,
445,
2943,
29915,
29879,
1634,
10123,
29889,
13,
1678,
736,
3497,
2605,
29898,
2917,
29889,
657,
29918,
9053,
29918,
2084,
29898,
1525,
7390,
2965,
29909,
29918,
29934,
29956,
29907,
3301,
29918,
29933,
3289,
1430,
25797,
8106,
9933,
580,
13,
13,
13,
1753,
679,
29918,
3445,
10123,
29918,
13975,
5030,
29898,
2917,
29901,
12782,
29897,
1599,
5915,
5015,
29901,
13,
1678,
9995,
13,
1678,
584,
2457,
29901,
263,
26691,
3884,
2117,
3097,
363,
1749,
1634,
10123,
29889,
13,
1678,
584,
336,
4637,
29901,
8960,
565,
1634,
1414,
338,
451,
6230,
13,
1678,
9995,
13,
1678,
364,
29893,
5030,
29918,
1445,
353,
3497,
2605,
29898,
2917,
29889,
657,
29918,
9053,
29918,
2084,
29898,
1525,
7390,
2965,
29909,
29918,
29934,
29956,
29907,
3301,
29918,
29933,
3289,
1430,
25797,
876,
13,
1678,
736,
364,
29893,
5030,
29918,
1445,
29889,
657,
3916,
2141,
13808,
703,
294,
18869,
1159,
13,
13,
13,
29992,
7922,
13,
1990,
903,
17518,
424,
29901,
13,
1678,
9995,
13,
1678,
319,
3030,
29899,
12847,
304,
731,
322,
443,
842,
278,
869,
29918,
17001,
7353,
373,
263,
13,
1678,
903,
5612,
1414,
12415,
519,
5350,
13,
1678,
9995,
13,
13,
1678,
903,
3445,
1414,
29918,
18127,
29901,
903,
5612,
1414,
12415,
519,
19890,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
3445,
1414,
29918,
18127,
3032,
17001,
353,
5852,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
334,
5085,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
3445,
1414,
29918,
18127,
3032,
17001,
353,
7700,
13,
4706,
736,
6213,
13,
13,
13,
1753,
411,
29918,
3445,
1414,
29898,
13,
1678,
3957,
29901,
903,
4176,
568,
29941,
5350,
29892,
9025,
29918,
3445,
1414,
29901,
6120,
13,
29897,
1599,
903,
5612,
1414,
12415,
519,
5350,
29901,
13,
1678,
9995,
13,
1678,
399,
2390,
278,
2183,
3957,
297,
263,
7546,
607,
338,
15390,
310,
18055,
263,
13,
1678,
376,
3445,
1414,
4464,
1642,
29871,
512,
1634,
1414,
4464,
29892,
278,
14476,
14422,
599,
3620,
13,
1678,
1754,
1549,
278,
3957,
577,
393,
896,
526,
3625,
304,
367,
1634,
9169,
491,
13,
1678,
1790,
4163,
29889,
29871,
512,
4226,
4464,
29892,
3620,
526,
451,
6087,
29889,
13,
13,
1678,
584,
3207,
3957,
29901,
450,
23299,
29941,
3957,
304,
12244,
29889,
13,
13,
1678,
584,
3207,
9025,
29918,
3445,
1414,
29901,
960,
4954,
5574,
16159,
769,
278,
14476,
338,
7180,
297,
13,
4706,
376,
3445,
1414,
4464,
29908,
12919,
29889,
29871,
13466,
372,
338,
451,
541,
372,
508,
367,
13,
4706,
26263,
964,
393,
4464,
2678,
29889,
13,
13,
1678,
584,
2457,
29901,
450,
14476,
1203,
29889,
13,
1678,
9995,
13,
1678,
736,
903,
5612,
1414,
12415,
519,
5350,
29898,
9965,
29892,
9025,
29918,
3445,
1414,
29897,
13,
13,
13,
29924,
329,
362,
353,
18761,
29961,
11227,
29892,
851,
29892,
20504,
519,
29961,
23583,
29961,
4176,
1542,
29892,
2023,
5262,
29962,
13,
29924,
329,
362,
28066,
353,
8251,
519,
8999,
29918,
4176,
568,
29941,
19890,
29892,
20504,
519,
29961,
29924,
329,
362,
20526,
8251,
519,
8999,
1402,
6213,
5262,
13,
13,
13,
29992,
7922,
13,
1990,
903,
5612,
1414,
12415,
519,
5350,
29901,
13,
1678,
9995,
13,
1678,
399,
2390,
263,
4954,
22793,
29941,
29889,
5350,
16159,
304,
3867,
5684,
22395,
29899,
322,
13,
1678,
24820,
1634,
1414,
29899,
12817,
5680,
29889,
13,
13,
1678,
2178,
310,
445,
1134,
29915,
29879,
3519,
526,
9146,
304,
23389,
278,
1021,
982,
408,
13,
1678,
4954,
22793,
29941,
29889,
5350,
16159,
29905,
525,
29879,
3519,
5174,
896,
1122,
884,
788,
777,
13,
1678,
5684,
9863,
304,
2304,
1634,
1414,
29889,
13,
13,
1678,
584,
440,
279,
903,
3445,
506,
1218,
29901,
4954,
5574,
16159,
565,
445,
3957,
338,
5279,
297,
13,
4706,
1634,
1414,
4464,
322,
338,
16867,
599,
8283,
360,
19558,
322,
360,
1988,
9506,
29892,
13,
4706,
4954,
8824,
16159,
6467,
29889,
13,
1678,
9995,
13,
13,
1678,
396,
278,
376,
6370,
29908,
847,
4226,
21120,
3957,
13,
1678,
903,
13082,
29901,
903,
4176,
568,
29941,
5350,
13,
1678,
903,
3445,
506,
1218,
29901,
6120,
13,
1678,
903,
711,
643,
874,
29901,
18761,
29961,
29924,
329,
362,
28066,
29892,
2023,
29962,
353,
27561,
29898,
23583,
29897,
13,
1678,
903,
6149,
800,
29901,
1051,
29961,
29924,
329,
362,
29962,
353,
27561,
29898,
1761,
29897,
13,
13,
1678,
822,
9025,
29918,
3445,
1414,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
9603,
373,
1634,
1414,
2304,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
3445,
506,
1218,
353,
5852,
13,
13,
1678,
822,
788,
29918,
6149,
362,
29918,
711,
2974,
29898,
1311,
29892,
7876,
29901,
20749,
362,
28066,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
3462,
1790,
22944,
310,
3620,
1754,
1549,
445,
3957,
29889,
13,
13,
4706,
584,
3207,
7876,
29901,
530,
1203,
304,
1246,
1156,
738,
10804,
411,
3620,
338,
13,
9651,
19355,
373,
445,
3957,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
711,
643,
874,
353,
1583,
3032,
711,
643,
874,
718,
313,
9144,
29892,
29897,
13,
13,
1678,
822,
372,
2018,
3427,
29898,
1311,
29897,
1599,
20504,
1061,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
584,
2457,
29901,
3758,
9506,
607,
508,
367,
1304,
304,
337,
11433,
278,
2566,
13,
9651,
2106,
29889,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
13082,
29889,
1524,
15070,
580,
13,
13,
1678,
822,
3802,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
736,
1583,
3032,
13082,
29889,
5358,
580,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
29897,
1599,
903,
5612,
1414,
12415,
519,
5350,
29901,
13,
4706,
1583,
3032,
13082,
17255,
5893,
1649,
580,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
13322,
12035,
13,
4706,
1583,
29892,
13,
4706,
5566,
29918,
1853,
29901,
28379,
29961,
1853,
1402,
13,
4706,
5566,
29918,
1767,
29901,
28379,
29961,
5160,
2451,
1402,
13,
4706,
5566,
29918,
22625,
29901,
28379,
29961,
10773,
1402,
13,
1678,
1723,
1599,
6120,
29901,
13,
4706,
13089,
403,
353,
1583,
3032,
13082,
17255,
13322,
12035,
735,
29883,
29918,
1853,
29892,
5566,
29918,
1767,
29892,
5566,
29918,
22625,
29897,
13,
4706,
565,
5566,
29918,
1853,
338,
6213,
29901,
13,
9651,
396,
1670,
471,
694,
3682,
29892,
7182,
5366,
874,
393,
263,
1735,
756,
1063,
13,
9651,
396,
19355,
29889,
13,
9651,
1400,
29918,
7508,
29876,
29918,
29888,
1983,
29901,
1051,
29961,
5594,
519,
8999,
1402,
6213,
5262,
353,
5159,
13,
9651,
411,
1583,
3032,
13082,
29901,
13,
18884,
3151,
344,
353,
1583,
3032,
13082,
29889,
18127,
580,
13,
18884,
3151,
344,
29889,
7978,
703,
29933,
17958,
22313,
2303,
4571,
3040,
10014,
2190,
8132,
9838,
1159,
13,
18884,
1400,
29918,
7508,
29876,
29918,
29888,
1983,
29889,
21843,
29898,
1311,
3032,
26026,
29918,
25436,
29918,
711,
643,
874,
29898,
2764,
344,
876,
13,
9651,
363,
285,
297,
1400,
29918,
7508,
29876,
29918,
29888,
1983,
29901,
13,
18884,
285,
580,
13,
4706,
396,
2538,
1103,
278,
14407,
13089,
362,
10608,
29889,
13,
4706,
736,
13089,
403,
13,
13,
1678,
822,
903,
26026,
29918,
25436,
29918,
711,
643,
874,
29898,
13,
4706,
1583,
29892,
10677,
13,
1678,
1723,
1599,
3251,
1061,
29961,
5594,
519,
8999,
1402,
6213,
1402,
6213,
29892,
6213,
5387,
13,
4706,
9995,
13,
4706,
960,
727,
526,
10478,
5478,
800,
29892,
12021,
963,
304,
1269,
310,
278,
5366,
874,
322,
13,
4706,
769,
9566,
1048,
963,
29889,
13,
13,
4706,
584,
2457,
29901,
319,
15299,
310,
278,
736,
1819,
310,
278,
5366,
874,
29889,
13,
4706,
9995,
13,
4706,
565,
1583,
3032,
6149,
800,
29901,
13,
9651,
304,
29918,
25436,
353,
1583,
3032,
6149,
800,
13,
9651,
1583,
3032,
6149,
800,
353,
1051,
580,
13,
9651,
363,
704,
297,
1583,
3032,
711,
643,
874,
29901,
13,
18884,
7709,
704,
29898,
18127,
29892,
304,
29918,
25436,
29897,
13,
13,
1678,
822,
10677,
29898,
1311,
29892,
12529,
29901,
28379,
29961,
1853,
29962,
353,
6213,
29897,
1599,
903,
5612,
1414,
12415,
519,
19890,
29901,
13,
4706,
9995,
13,
4706,
3617,
263,
1634,
1414,
29899,
5030,
519,
10677,
363,
445,
3957,
29889,
13,
4706,
9995,
13,
4706,
9049,
5085,
353,
6571,
13,
4706,
565,
12529,
338,
451,
6213,
29901,
13,
9651,
9049,
5085,
3366,
14399,
3108,
353,
12529,
13,
4706,
10677,
353,
1583,
3032,
13082,
29889,
18127,
29898,
1068,
19290,
29897,
13,
4706,
396,
445,
10677,
4207,
943,
278,
869,
29918,
3445,
506,
1218,
7353,
297,
445,
2777,
13,
4706,
736,
903,
5612,
1414,
12415,
519,
19890,
29898,
18127,
29892,
1583,
29897,
13,
13,
13,
29992,
7922,
13,
1990,
903,
5612,
1414,
12415,
519,
19890,
29901,
13,
1678,
9995,
13,
1678,
399,
2390,
263,
4954,
22793,
29941,
29889,
19890,
16159,
304,
3867,
5684,
24820,
13,
1678,
1634,
1414,
29899,
12817,
5680,
29889,
13,
13,
1678,
2178,
310,
445,
1134,
29915,
29879,
8393,
322,
3519,
526,
9146,
304,
23389,
278,
1021,
13,
1678,
982,
408,
4954,
22793,
29941,
29889,
19890,
16159,
29905,
525,
29879,
3519,
5174,
896,
1122,
884,
788,
777,
13,
1678,
5684,
9863,
304,
2304,
1634,
1414,
29889,
13,
1678,
9995,
13,
13,
1678,
903,
18127,
29901,
903,
4176,
568,
29941,
19890,
13,
1678,
903,
9965,
29901,
903,
5612,
1414,
12415,
519,
5350,
13,
1678,
396,
1565,
1550,
9506,
526,
376,
17001,
29908,
313,
4716,
338,
282,
1463,
3412,
304,
13,
1678,
396,
278,
5366,
874,
322,
21551,
408,
1641,
376,
17001,
848,
393,
278,
13,
1678,
396,
1404,
674,
367,
8852,
297,
2225,
29530,
1159,
13,
1678,
903,
17001,
29901,
6120,
353,
1746,
29898,
2344,
29922,
8824,
29892,
2322,
29922,
8824,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1833,
798,
333,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18127,
29889,
4230,
798,
333,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1948,
2798,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18127,
29889,
798,
2798,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18127,
29889,
5358,
580,
13,
13,
1678,
822,
6222,
29898,
1311,
29892,
3229,
29901,
851,
29892,
1948,
29901,
20504,
519,
29961,
4176,
1542,
29962,
353,
313,
876,
1599,
315,
5966,
29901,
13,
4706,
9995,
13,
4706,
21120,
29915,
29879,
315,
5966,
3450,
13,
13,
4706,
584,
3207,
1948,
29901,
278,
6273,
13,
4706,
9995,
13,
4706,
4974,
338,
8758,
29898,
798,
29892,
18761,
29897,
13,
4706,
1583,
3032,
18127,
29889,
7978,
29898,
20788,
29892,
1948,
29897,
13,
4706,
565,
1583,
3032,
9965,
3032,
3445,
506,
1218,
322,
3229,
29918,
6149,
1078,
29898,
20788,
1125,
13,
9651,
396,
4443,
393,
445,
5067,
338,
363,
2999,
9506,
29892,
577,
13,
9651,
396,
591,
2507,
1749,
2323,
1948,
964,
263,
697,
29899,
23583,
13,
9651,
1583,
3032,
9965,
3032,
6149,
800,
29889,
4397,
3552,
1311,
3032,
17001,
29892,
3229,
29892,
313,
798,
29892,
4961,
13,
4706,
736,
1583,
13,
13,
1678,
822,
6699,
497,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18127,
29889,
9155,
497,
580,
13,
13,
1678,
822,
6699,
13011,
29898,
1311,
29892,
302,
1125,
13,
4706,
736,
1583,
3032,
18127,
29889,
9155,
13011,
29898,
29876,
29897,
13,
13,
1678,
822,
6699,
650,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18127,
29889,
9155,
650,
580,
13,
13,
1678,
822,
6704,
331,
1384,
29898,
1311,
29892,
3229,
29901,
851,
29892,
4206,
29901,
20504,
519,
29961,
10773,
2314,
1599,
315,
5966,
29901,
13,
4706,
1583,
3032,
18127,
29889,
4258,
329,
331,
1384,
29898,
20788,
29892,
4206,
29897,
13,
4706,
565,
1583,
3032,
9965,
3032,
3445,
506,
1218,
322,
3229,
29918,
6149,
1078,
29898,
20788,
1125,
13,
9651,
1583,
3032,
9965,
3032,
6149,
800,
29889,
4397,
3552,
1311,
3032,
17001,
29892,
3229,
29892,
4206,
876,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4100,
29898,
1311,
29897,
1599,
903,
17518,
424,
29901,
13,
4706,
9995,
13,
4706,
6204,
263,
716,
3030,
29899,
12847,
393,
1192,
1550,
6136,
1192,
6166,
278,
13,
4706,
525,
17001,
29915,
7353,
304,
1565,
322,
620,
1691,
372,
12335,
29889,
13,
4706,
9995,
13,
4706,
736,
903,
17518,
424,
29898,
1311,
29897,
13,
13,
13,
1753,
9506,
29918,
517,
29918,
29879,
14551,
29898,
6112,
4110,
29901,
20504,
1061,
29961,
710,
2314,
1599,
6262,
29901,
13,
1678,
9995,
13,
1678,
11190,
263,
22395,
310,
278,
2566,
6159,
519,
3025,
278,
2183,
3957,
29889,
13,
13,
1678,
450,
22395,
338,
13747,
322,
2436,
22160,
373,
278,
2183,
3957,
13,
1678,
526,
24370,
2745,
372,
756,
1063,
8676,
29889,
13,
1678,
9995,
13,
1678,
736,
274,
4089,
29906,
29889,
29881,
17204,
3319,
29908,
3259,
1115,
29871,
29896,
29892,
376,
6112,
4110,
1115,
518,
29916,
363,
921,
297,
9506,
29962,
1800,
13,
13,
13,
1753,
3957,
29918,
517,
29918,
6112,
4110,
29898,
9965,
29901,
15160,
29897,
1599,
20504,
1061,
29961,
710,
5387,
13,
1678,
9995,
13,
1678,
6204,
385,
20380,
310,
3758,
9506,
408,
6031,
15783,
263,
13747,
29892,
13,
1678,
1583,
29899,
1285,
7114,
22395,
310,
278,
2566,
6159,
519,
3025,
278,
2183,
13,
1678,
3957,
29889,
13,
1678,
9995,
13,
1678,
736,
4256,
29898,
9965,
29889,
1524,
15070,
3101,
13,
13,
13,
29937,
1281,
854,
5597,
3450,
304,
16766,
9506,
322,
19750,
963,
363,
8635,
29889,
13,
29879,
14551,
29901,
8251,
519,
8999,
5350,
1402,
6262,
29962,
353,
27435,
29898,
13,
1678,
9506,
29918,
517,
29918,
29879,
14551,
29892,
3957,
29918,
517,
29918,
6112,
4110,
13,
29897,
13,
13,
13,
12674,
822,
260,
801,
7297,
29918,
433,
5847,
29918,
9009,
261,
29898,
13,
1678,
3132,
29901,
13315,
801,
7297,
4032,
29892,
13,
1678,
24205,
29918,
5030,
29901,
851,
29892,
13,
1678,
679,
29918,
29879,
14551,
29918,
1272,
29901,
3630,
6980,
29892,
13,
1678,
6251,
29918,
978,
29901,
851,
29892,
13,
29897,
1599,
6213,
29901,
13,
1678,
9995,
13,
1678,
5020,
1359,
263,
1634,
10123,
304,
323,
801,
7297,
29892,
25236,
278,
1121,
964,
278,
2183,
24205,
13,
1678,
26691,
2117,
29890,
1793,
1090,
278,
1024,
2183,
491,
584,
2272,
29901,
1272,
18078,
19296,
3301,
7068,
2891,
29918,
5813,
1412,
13,
1678,
9995,
13,
1678,
22395,
29918,
326,
23975,
29918,
5030,
353,
7272,
3132,
29889,
9009,
29898,
657,
29918,
29879,
14551,
29918,
1272,
29897,
13,
1678,
7272,
3132,
29889,
2324,
29898,
3757,
22205,
29918,
5030,
29892,
6251,
29918,
978,
29892,
22395,
29918,
326,
23975,
29918,
5030,
29897,
13,
13,
13,
1753,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
9009,
261,
29898,
13,
1678,
3132,
29901,
13315,
801,
7297,
4032,
29892,
13,
1678,
3884,
29918,
23975,
29918,
5030,
29901,
851,
29892,
13,
29897,
1599,
8251,
519,
8999,
710,
29892,
3630,
6980,
1402,
319,
10685,
519,
29961,
8516,
5262,
29901,
13,
1678,
9995,
13,
1678,
29672,
263,
323,
801,
7297,
3132,
304,
263,
26691,
3884,
297,
263,
1246,
519,
393,
674,
13,
1678,
6441,
777,
848,
322,
1544,
372,
964,
278,
26691,
3884,
1090,
278,
13,
1678,
2183,
1024,
29889,
13,
13,
1678,
584,
2457,
29901,
319,
1246,
519,
393,
674,
6441,
777,
848,
408,
278,
9281,
1634,
10123,
13,
4706,
22395,
29889,
450,
848,
3508,
29915,
29873,
2183,
4153,
29892,
541,
2012,
515,
263,
13,
4706,
5225,
29899,
23516,
1246,
519,
3528,
304,
16089,
10388,
337,
2202,
292,
29889,
13,
1678,
9995,
13,
13,
1678,
7465,
822,
6441,
29898,
8269,
29918,
978,
29901,
851,
29892,
679,
29918,
1272,
29918,
18121,
29901,
3630,
6980,
29897,
1599,
6213,
29901,
13,
4706,
7272,
260,
801,
7297,
29918,
433,
5847,
29918,
9009,
261,
29898,
13,
9651,
3132,
29892,
3884,
29918,
23975,
29918,
5030,
29892,
679,
29918,
1272,
29918,
18121,
29892,
6251,
29918,
978,
13,
4706,
1723,
13,
13,
1678,
736,
6441,
13,
13,
13,
1753,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
558,
348,
261,
29898,
13,
1678,
3132,
29901,
13315,
801,
7297,
4032,
29892,
13,
1678,
3884,
29918,
23975,
29918,
5030,
29901,
851,
29892,
13,
29897,
1599,
8251,
519,
8999,
5594,
519,
8999,
710,
1402,
6120,
20526,
319,
10685,
519,
29961,
8516,
5262,
29901,
13,
1678,
9995,
13,
1678,
29672,
263,
323,
801,
7297,
3132,
304,
263,
26691,
3884,
297,
263,
1246,
519,
393,
674,
13,
1678,
443,
2324,
777,
9976,
29889,
8449,
9976,
304,
443,
2324,
526,
20704,
491,
263,
24384,
29889,
13,
13,
1678,
584,
2457,
29901,
319,
1246,
519,
393,
674,
443,
2324,
777,
9976,
2183,
263,
13,
4706,
24384,
29889,
450,
4450,
29347,
338,
2183,
263,
10422,
2768,
278,
26691,
304,
13,
4706,
2050,
29889,
13,
1678,
9995,
13,
13,
1678,
7465,
822,
5505,
29918,
348,
2324,
29898,
11965,
9593,
29901,
8251,
519,
8999,
710,
1402,
6120,
2314,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
1152,
1269,
2278,
310,
421,
12322,
29918,
23975,
29918,
5030,
29952,
5217,
372,
565,
29888,
278,
13,
4706,
24384,
3639,
5852,
363,
393,
1024,
13,
4706,
9995,
13,
4706,
9976,
353,
7272,
3132,
29889,
1761,
29918,
12322,
29898,
12322,
29918,
23975,
29918,
5030,
29897,
13,
4706,
363,
1024,
297,
9976,
29889,
8149,
7295,
13,
9651,
565,
24384,
29898,
978,
1125,
13,
18884,
7272,
3132,
29889,
348,
2324,
29898,
12322,
29918,
23975,
29918,
5030,
29892,
1024,
29897,
13,
13,
1678,
736,
5505,
29918,
348,
2324,
13,
13,
13,
1753,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
29880,
1531,
29898,
13,
1678,
3132,
29901,
13315,
801,
7297,
4032,
29892,
3884,
29918,
23975,
29918,
5030,
29901,
851,
13,
29897,
1599,
28236,
29931,
1531,
29901,
13,
1678,
9995,
13,
1678,
29672,
263,
323,
801,
7297,
3132,
304,
263,
26691,
3884,
297,
263,
1246,
519,
393,
674,
1051,
13,
1678,
278,
9976,
310,
393,
3884,
29889,
13,
1678,
9995,
13,
13,
1678,
7465,
822,
301,
1531,
580,
1599,
9657,
29961,
710,
29892,
18862,
9634,
5387,
13,
4706,
9976,
353,
7272,
3132,
29889,
1761,
29918,
12322,
29898,
12322,
29918,
23975,
29918,
5030,
29897,
13,
4706,
736,
426,
13,
9651,
1024,
29901,
18862,
9634,
29898,
14380,
29892,
6251,
29889,
657,
703,
2311,
613,
29871,
29900,
876,
13,
9651,
363,
1024,
29892,
313,
14380,
29892,
6251,
29897,
297,
9976,
29889,
7076,
580,
13,
4706,
500,
13,
13,
1678,
736,
301,
1531,
13,
13,
13,
1753,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
3445,
10123,
29898,
13,
1678,
3132,
29901,
13315,
801,
7297,
4032,
29892,
3884,
29918,
23975,
29918,
5030,
29901,
851,
13,
29897,
1599,
10088,
10123,
29901,
13,
1678,
9995,
13,
1678,
3617,
385,
1203,
393,
508,
16254,
411,
263,
1634,
10123,
6087,
297,
263,
323,
801,
7297,
29899,
4375,
9998,
13,
1678,
26691,
3884,
29889,
13,
1678,
9995,
13,
1678,
6441,
261,
353,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
9009,
261,
29898,
4645,
29892,
3884,
29918,
23975,
29918,
5030,
29897,
13,
1678,
544,
348,
261,
353,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
558,
348,
261,
29898,
4645,
29892,
3884,
29918,
23975,
29918,
5030,
29897,
13,
1678,
301,
1531,
353,
679,
29918,
29873,
801,
7297,
29918,
433,
5847,
29918,
3972,
8269,
29918,
29880,
1531,
29898,
4645,
29892,
3884,
29918,
23975,
29918,
5030,
29897,
13,
1678,
736,
10088,
10123,
29898,
9009,
261,
29892,
544,
348,
261,
29892,
301,
1531,
29897,
13,
13,
13,
1753,
788,
29918,
13604,
29898,
13,
1678,
10677,
29901,
903,
4176,
568,
29941,
19890,
29892,
13,
1678,
4959,
29901,
20504,
519,
29961,
23583,
29961,
710,
29892,
922,
3910,
29961,
4176,
1542,
5262,
1402,
13,
1678,
4100,
29901,
6120,
29892,
13,
29897,
1599,
6213,
29901,
13,
1678,
9995,
13,
1678,
3462,
777,
716,
3620,
304,
278,
1741,
29899,
1188,
29889,
13,
1678,
9995,
13,
1678,
4576,
29918,
5085,
353,
5159,
13,
1678,
363,
4576,
29892,
6389,
297,
4959,
29901,
13,
4706,
4974,
599,
29898,
13,
9651,
338,
8758,
29898,
29874,
29892,
3758,
7944,
1542,
29897,
363,
263,
297,
6389,
13,
4706,
10353,
285,
29908,
29912,
5085,
29913,
3743,
1661,
29899,
4176,
995,
29908,
13,
4706,
4576,
29918,
5085,
29889,
4397,
3552,
2850,
29892,
274,
4089,
29906,
29889,
29881,
17204,
29898,
5085,
511,
4100,
876,
13,
1678,
10677,
29889,
4258,
329,
331,
1384,
29898,
13,
4706,
9995,
13,
4706,
14482,
11646,
518,
3696,
29899,
5461,
850,
29961,
20788,
1402,
518,
15550,
1891,
29918,
25699,
1402,
518,
17001,
2314,
13,
4706,
15673,
313,
14579,
1577,
29892,
1577,
29897,
13,
4706,
5124,
613,
13,
4706,
4576,
29918,
5085,
29892,
13,
1678,
1723,
13,
13,
13,
1753,
679,
29918,
13604,
29898,
13082,
29901,
903,
4176,
568,
29941,
5350,
29897,
1599,
6864,
3835,
29901,
13,
1678,
9995,
13,
1678,
7106,
599,
4959,
5279,
297,
1749,
1741,
29899,
1188,
29889,
13,
1678,
9995,
13,
1678,
411,
11009,
29901,
13,
4706,
10677,
353,
11009,
29889,
18127,
580,
13,
4706,
10677,
29889,
7978,
29898,
13,
9651,
9995,
13,
9651,
5097,
518,
16506,
29899,
4537,
1402,
518,
20788,
1402,
518,
15550,
1891,
29918,
25699,
1402,
518,
17001,
29962,
13,
9651,
3895,
518,
3696,
29899,
5461,
29962,
13,
9651,
9995,
13,
4706,
1723,
13,
4706,
4206,
353,
10677,
29889,
9155,
497,
580,
13,
1678,
736,
6864,
3835,
29898,
13,
4706,
3620,
11759,
13,
9651,
396,
2391,
15171,
2673,
756,
297,
23712,
1134,
2391,
29961,
7277,
1385,
3806,
2391,
28513,
29911,
29918,
1111,
29962,
13,
9651,
396,
2045,
597,
3292,
29889,
510,
29914,
4691,
29899,
5552,
29879,
29914,
5552,
29879,
29914,
12175,
29914,
29945,
29896,
29929,
13,
9651,
10726,
29898,
11762,
29892,
380,
4378,
29892,
274,
4089,
29906,
29889,
18132,
29898,
25699,
511,
4100,
29897,
29871,
396,
1134,
29901,
11455,
13,
9651,
363,
19359,
29892,
380,
4378,
29892,
6273,
29892,
4100,
297,
4206,
13,
4706,
4514,
13,
1678,
1723,
13,
13,
13,
1753,
544,
1540,
29918,
13604,
29918,
517,
29898,
13082,
29901,
903,
4176,
568,
29941,
5350,
29892,
5665,
29918,
4537,
29901,
938,
29897,
1599,
6213,
29901,
13,
1678,
9995,
13,
1678,
15154,
599,
4959,
5277,
5665,
29918,
4537,
13,
1678,
9995,
13,
1678,
411,
11009,
29901,
13,
4706,
10677,
353,
11009,
29889,
18127,
580,
13,
4706,
10677,
29889,
7978,
29898,
13,
9651,
9995,
13,
9651,
5012,
18476,
3895,
518,
3696,
29899,
5461,
29962,
13,
9651,
5754,
518,
16506,
29899,
4537,
29962,
5277,
313,
7897,
13,
9651,
5124,
613,
13,
9651,
313,
16506,
29918,
4537,
29892,
511,
13,
4706,
1723,
13,
4706,
10677,
29889,
9155,
497,
580,
13,
13,
13,
29992,
29888,
307,
2256,
13,
1990,
4831,
398,
7964,
21459,
29901,
13,
1678,
9995,
13,
1678,
319,
15837,
310,
777,
3620,
393,
505,
1063,
1754,
29889,
13,
13,
1678,
584,
440,
279,
4100,
29901,
4683,
738,
310,
1438,
376,
17001,
29908,
3620,
29973,
13,
13,
1678,
584,
440,
279,
2159,
29901,
450,
26368,
2159,
297,
6262,
304,
2755,
599,
310,
278,
3620,
29889,
13,
1678,
9995,
13,
13,
1678,
4100,
29901,
6120,
13,
1678,
2159,
29901,
938,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
694,
29918,
25990,
29898,
25932,
29897,
1599,
4831,
398,
7964,
21459,
29901,
13,
4706,
9995,
13,
4706,
6204,
385,
4954,
7504,
398,
7964,
21459,
16159,
393,
11524,
694,
3620,
29889,
13,
4706,
9995,
13,
4706,
736,
1067,
29879,
29898,
8824,
29892,
29871,
29900,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
9965,
29898,
25932,
29892,
3957,
29901,
903,
4176,
568,
29941,
5350,
29897,
1599,
4831,
398,
7964,
21459,
29901,
13,
4706,
9995,
13,
4706,
16012,
2472,
1048,
443,
3445,
9169,
3620,
515,
278,
2566,
29889,
13,
4706,
9995,
13,
4706,
396,
445,
2159,
338,
7200,
1135,
825,
591,
723,
505,
15712,
3025,
13,
4706,
396,
421,
3166,
29918,
25990,
29952,
607,
871,
18139,
278,
3229,
29899,
29879,
7093,
6317,
541,
13,
4706,
396,
5505,
2691,
29973,
313,
15189,
1033,
2329,
491,
925,
18414,
18099,
278,
13,
4706,
396,
3229,
29899,
29879,
7093,
2012,
2400,
29897,
13,
4706,
4959,
353,
679,
29918,
13604,
29898,
9965,
29897,
13,
4706,
848,
353,
4959,
29889,
517,
29918,
13193,
580,
13,
4706,
2159,
353,
848,
29889,
344,
1416,
29898,
29900,
29892,
2897,
29889,
22048,
29968,
29918,
11794,
29897,
13,
4706,
738,
29918,
17001,
353,
738,
29898,
3167,
29889,
17001,
363,
1735,
297,
4959,
29889,
25990,
29897,
13,
4706,
736,
1067,
29879,
29898,
1384,
29918,
17001,
29892,
2159,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
6112,
4110,
29898,
13,
4706,
1067,
29879,
29892,
13,
4706,
4100,
29901,
6120,
29892,
13,
4706,
9506,
29901,
20504,
519,
29961,
23583,
29961,
710,
29892,
922,
3910,
29961,
4176,
1542,
5262,
1402,
13,
1678,
1723,
1599,
4831,
398,
7964,
21459,
29901,
13,
4706,
9995,
13,
4706,
16012,
2472,
1048,
443,
3445,
9169,
3620,
515,
3758,
9506,
6820,
13,
4706,
1906,
3620,
29889,
13,
4706,
9995,
13,
4706,
396,
4443,
393,
591,
29915,
276,
5330,
8253,
263,
3058,
5253,
310,
2159,
18702,
1244,
29901,
278,
13,
4706,
396,
903,
19304,
29918,
2159,
674,
367,
777,
315,
29933,
1955,
2472,
322,
278,
5665,
1353,
29892,
13,
4706,
396,
5998,
278,
3229,
1426,
881,
1603,
8022,
403,
29889,
13,
4706,
396,
22615,
24778,
278,
2159,
13944,
13,
4706,
736,
1067,
29879,
29898,
17001,
29892,
2533,
29898,
2435,
29898,
2850,
29897,
363,
313,
2850,
29892,
24459,
297,
9506,
876,
13,
13,
1678,
822,
4770,
1202,
12035,
1311,
29892,
916,
29901,
4831,
398,
7964,
21459,
29897,
1599,
4831,
398,
7964,
21459,
29901,
13,
4706,
736,
4831,
398,
7964,
21459,
29898,
13,
9651,
1583,
29889,
17001,
470,
916,
29889,
17001,
29892,
1583,
29889,
2311,
718,
916,
29889,
2311,
13,
4706,
1723,
13,
13,
13,
1753,
1741,
29918,
5461,
29918,
978,
29898,
9812,
29918,
11762,
29901,
938,
29897,
1599,
851,
29901,
13,
1678,
9995,
13,
1678,
1281,
4984,
278,
2362,
3871,
310,
278,
1741,
4840,
1203,
6943,
278,
2183,
13,
1678,
9939,
5665,
1353,
29889,
13,
1678,
9995,
13,
1678,
736,
285,
29908,
3696,
29899,
5461,
29899,
29912,
9812,
29918,
11762,
5038,
13,
13,
13,
29992,
7922,
13,
1990,
903,
5612,
1414,
3170,
29898,
3170,
1125,
13,
1678,
9995,
13,
1678,
27313,
599,
6354,
4475,
304,
7344,
292,
263,
7592,
1634,
10123,
310,
278,
1887,
13,
1678,
796,
29968,
3301,
13720,
3950,
2566,
29889,
13,
13,
1678,
960,
445,
2669,
338,
2734,
363,
263,
2566,
769,
278,
2566,
338,
297,
13,
1678,
1634,
1414,
4464,
322,
3620,
674,
367,
20373,
29889,
13,
13,
1678,
584,
440,
279,
903,
9965,
29901,
319,
3957,
304,
278,
2566,
1641,
1634,
9169,
29889,
13,
13,
1678,
584,
440,
279,
903,
3445,
506,
1218,
29901,
450,
1472,
29899,
21094,
1634,
1414,
5858,
29889,
29871,
910,
338,
2360,
13,
4706,
3806,
304,
4866,
541,
372,
674,
367,
12611,
839,
746,
278,
2669,
17726,
29889,
13,
1678,
9995,
13,
13,
1678,
1024,
353,
376,
3445,
1414,
29899,
5509,
29908,
29871,
396,
1134,
29901,
11455,
396,
6692,
3566,
29879,
6213,
29892,
885,
3973,
29879,
701,
1134,
27262,
13,
1678,
903,
21707,
353,
28468,
580,
13,
13,
1678,
903,
9965,
29901,
903,
5612,
1414,
12415,
519,
5350,
353,
1746,
580,
13,
1678,
903,
3445,
10123,
29901,
10088,
10123,
13,
1678,
903,
29879,
14551,
29918,
22197,
29901,
317,
14551,
15644,
13,
1678,
903,
3445,
506,
1218,
29901,
28379,
29961,
2772,
14373,
29962,
353,
1746,
29898,
2344,
29922,
8824,
29892,
2322,
29922,
8516,
29897,
13,
13,
1678,
903,
25990,
29901,
4831,
398,
7964,
21459,
353,
4831,
398,
7964,
21459,
29889,
1217,
29918,
25990,
580,
13,
1678,
903,
9057,
29879,
29901,
897,
14373,
10620,
353,
1746,
29898,
14399,
29922,
2772,
14373,
10620,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
903,
348,
3445,
9169,
29918,
9965,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
319,
4226,
23299,
29941,
3957,
1203,
29892,
3620,
1754,
3025,
607,
674,
451,
367,
13,
4706,
1634,
9169,
29889,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
9965,
3032,
13082,
13,
13,
1678,
822,
1369,
3170,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
2428,
2141,
2962,
3170,
580,
13,
13,
4706,
396,
12577,
20278,
408,
263,
1735,
22944,
313,
4102,
29991,
591,
1016,
29915,
29873,
864,
304,
13,
4706,
396,
3052,
3099,
29897,
322,
769,
1925,
278,
2566,
964,
1634,
1414,
4464,
577,
13,
4706,
396,
393,
727,
526,
10478,
4959,
363,
502,
304,
664,
411,
29889,
13,
4706,
1583,
3032,
9965,
29889,
1202,
29918,
6149,
362,
29918,
711,
2974,
29898,
1311,
29889,
711,
643,
1490,
29918,
3696,
29897,
13,
4706,
1583,
3032,
9965,
29889,
12007,
29918,
3445,
1414,
580,
13,
13,
4706,
396,
9897,
781,
6514,
2106,
338,
2175,
975,
297,
278,
2566,
515,
3517,
13,
4706,
396,
14231,
29889,
13,
4706,
1583,
3032,
25990,
353,
4831,
398,
7964,
21459,
29889,
3166,
29918,
9965,
29898,
13,
9651,
1583,
3032,
348,
3445,
9169,
29918,
9965,
13,
4706,
1723,
13,
13,
4706,
1583,
29889,
9990,
29918,
9057,
29898,
5612,
1414,
11947,
29889,
2962,
786,
29897,
13,
13,
4706,
396,
7370,
278,
3935,
664,
310,
7657,
292,
304,
3620,
491,
6441,
292,
963,
313,
294,
13,
4706,
396,
8210,
467,
13,
4706,
1583,
3032,
3445,
506,
1218,
353,
897,
14373,
29889,
3166,
12521,
449,
457,
29898,
1311,
3032,
3445,
5926,
3101,
13,
13,
1678,
7465,
822,
903,
3445,
5926,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
9537,
304,
3620,
491,
1634,
506,
1218,
963,
304,
7592,
8635,
29889,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
7272,
1583,
29889,
10685,
29918,
1454,
29918,
9009,
29879,
580,
13,
4706,
5174,
1815,
2242,
839,
2392,
29901,
13,
9651,
396,
18076,
487,
508,
29883,
1379,
29936,
445,
674,
367,
278,
4226,
982,
591,
23283,
1192,
1074,
13,
9651,
396,
5040,
3170,
29889,
13,
9651,
1209,
13,
4706,
5174,
8960,
29901,
13,
9651,
396,
960,
1554,
18034,
263,
12611,
5930,
29892,
472,
3203,
1207,
372,
7962,
29889,
13,
9651,
1583,
3032,
21707,
29889,
14057,
545,
703,
348,
9684,
4480,
29918,
1454,
29918,
9009,
29879,
1059,
1159,
13,
13,
4706,
736,
6213,
13,
13,
1678,
822,
9521,
29918,
9057,
29898,
1311,
29892,
4982,
29901,
10088,
1414,
11947,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
5462,
434,
263,
4982,
29892,
565,
372,
338,
451,
2307,
712,
6742,
29892,
304,
367,
8283,
1156,
738,
916,
13,
4706,
712,
6742,
17643,
29889,
13,
4706,
9995,
13,
4706,
565,
4982,
451,
297,
1583,
3032,
9057,
29879,
29889,
29886,
2548,
29901,
13,
9651,
1583,
3032,
9057,
29879,
29889,
649,
29898,
9057,
29897,
13,
13,
1678,
732,
1188,
29918,
4804,
29898,
2467,
29918,
1853,
543,
7730,
481,
8921,
3950,
29901,
3445,
5926,
29901,
9990,
29899,
3696,
29899,
9009,
1159,
13,
1678,
822,
9521,
29918,
3696,
29918,
9009,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
10729,
385,
1741,
29899,
5461,
6441,
310,
714,
11235,
4959,
29889,
13,
4706,
9995,
13,
4706,
1583,
29889,
9990,
29918,
9057,
29898,
5612,
1414,
11947,
29889,
3696,
29918,
5461,
29897,
13,
13,
1678,
732,
1188,
29918,
4804,
29898,
2467,
29918,
1853,
543,
7730,
481,
8921,
3950,
29901,
3445,
5926,
29901,
9990,
29899,
29879,
14551,
29899,
9009,
1159,
13,
1678,
822,
9521,
29918,
29879,
14551,
29918,
9009,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
10729,
393,
385,
6441,
310,
263,
716,
22395,
6403,
29889,
624,
744,
13,
4706,
1741,
29899,
5461,
29879,
674,
884,
367,
544,
348,
287,
1156,
278,
22395,
338,
13,
4706,
8472,
20373,
29889,
13,
4706,
9995,
13,
4706,
1583,
29889,
9990,
29918,
9057,
29898,
5612,
1414,
11947,
29889,
29879,
14551,
29897,
13,
13,
1678,
7465,
822,
4480,
29918,
1454,
29918,
9009,
29879,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
530,
10362,
7465,
2425,
393,
10174,
6441,
29879,
310,
1741,
29899,
5461,
29879,
470,
13,
4706,
15101,
845,
1862,
13,
4706,
9995,
13,
4706,
1550,
5852,
29901,
13,
9651,
4982,
353,
7272,
1583,
3032,
9057,
29879,
29889,
657,
580,
13,
9651,
565,
4982,
1275,
10088,
1414,
11947,
29889,
3696,
29918,
5461,
29901,
13,
18884,
7272,
1583,
3032,
1867,
29918,
650,
29918,
3696,
29918,
9009,
580,
13,
9651,
25342,
4982,
1275,
10088,
1414,
11947,
29889,
29879,
14551,
29901,
13,
18884,
7272,
1583,
3032,
1867,
29918,
650,
29918,
29879,
14551,
29918,
9009,
580,
13,
9651,
25342,
4982,
1275,
10088,
1414,
11947,
29889,
3200,
1241,
29918,
29879,
14551,
29901,
13,
18884,
7272,
1583,
3032,
1867,
29918,
3200,
1241,
29918,
29879,
14551,
580,
13,
9651,
25342,
4982,
1275,
10088,
1414,
11947,
29889,
2962,
786,
29901,
13,
18884,
7272,
1583,
3032,
1867,
29918,
2962,
786,
580,
13,
9651,
1683,
29901,
13,
18884,
12020,
8960,
703,
7564,
1059,
1159,
29871,
396,
282,
23929,
29901,
302,
542,
957,
13,
13,
1678,
7465,
822,
903,
1867,
29918,
2962,
786,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
5399,
1887,
322,
7592,
2106,
304,
8161,
565,
727,
338,
738,
664,
393,
881,
13,
4706,
367,
2309,
7389,
29889,
13,
13,
4706,
15447,
29892,
445,
674,
6441,
263,
22395,
565,
5642,
4864,
297,
278,
1634,
10123,
29892,
13,
4706,
470,
6441,
385,
1741,
4840,
565,
727,
526,
4959,
393,
1370,
21867,
16800,
13,
4706,
6441,
29889,
13,
4706,
9995,
13,
4706,
565,
7272,
1583,
29889,
9344,
29918,
9009,
29918,
29879,
14551,
7295,
13,
9651,
1583,
29889,
9990,
29918,
29879,
14551,
29918,
9009,
580,
13,
4706,
25342,
1583,
29889,
9344,
29918,
9009,
29918,
3696,
5461,
29898,
1311,
3032,
25990,
1125,
13,
9651,
1583,
29889,
9990,
29918,
3696,
29918,
9009,
580,
13,
13,
1678,
732,
1188,
29918,
4804,
29898,
2467,
29918,
1853,
543,
7730,
481,
8921,
3950,
29901,
3445,
5926,
29901,
29879,
14551,
29899,
9009,
1159,
13,
1678,
7465,
822,
903,
1867,
29918,
650,
29918,
29879,
14551,
29918,
9009,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
27313,
263,
2323,
22395,
6441,
29892,
3704,
544,
27964,
1741,
29899,
5461,
29879,
13,
4706,
515,
278,
1634,
10123,
393,
526,
694,
5520,
8018,
29889,
13,
4706,
9995,
13,
4706,
396,
6597,
5665,
29899,
4537,
322,
22395,
848,
13,
4706,
19359,
1949,
353,
29871,
29896,
13,
4706,
4206,
353,
313,
13,
9651,
1583,
3032,
9965,
29889,
18127,
580,
13,
9651,
869,
7978,
29898,
13,
18884,
376,
6404,
19359,
3895,
21120,
29918,
16506,
5754,
1024,
353,
525,
3696,
29899,
5461,
29915,
613,
18761,
580,
13,
9651,
1723,
13,
9651,
869,
9155,
497,
580,
13,
4706,
1723,
13,
4706,
565,
7431,
29898,
5727,
1125,
13,
9651,
19359,
1949,
353,
938,
29898,
5727,
29961,
29900,
3816,
29900,
2314,
13,
13,
4706,
15101,
353,
22395,
29898,
1311,
3032,
9965,
29897,
13,
13,
4706,
396,
6441,
22395,
13,
4706,
7272,
1583,
3032,
3445,
10123,
29889,
9009,
703,
29879,
14551,
613,
14013,
29901,
2648,
2167,
5971,
29898,
29879,
8971,
876,
13,
13,
4706,
396,
3349,
1887,
1741,
4955,
313,
5747,
881,
1286,
367,
2094,
2547,
7964,
13,
4706,
396,
491,
278,
22395,
591,
925,
20373,
29897,
13,
4706,
544,
1540,
29918,
13604,
29918,
517,
29898,
1311,
3032,
9965,
3032,
13082,
29892,
19359,
1949,
29897,
13,
13,
4706,
396,
565,
591,
8095,
1244,
29892,
727,
674,
367,
4805,
1741,
29899,
5461,
3618,
13,
4706,
396,
297,
278,
1634,
10123,
29889,
910,
674,
367,
4343,
5149,
2501,
1749,
2446,
13,
4706,
396,
22395,
6441,
29889,
450,
4805,
1741,
29899,
5461,
3618,
674,
367,
13,
4706,
396,
17262,
491,
278,
24205,
775,
29889,
13,
13,
4706,
396,
544,
1540,
2030,
4959,
515,
278,
1634,
10123,
13,
4706,
822,
338,
29918,
1025,
29918,
3696,
5461,
29898,
29888,
978,
29901,
851,
29897,
1599,
6120,
29901,
13,
9651,
9995,
13,
9651,
584,
18280,
29901,
5852,
565,
278,
421,
29888,
978,
29952,
338,
385,
1741,
29899,
5461,
1203,
322,
278,
13,
18884,
5665,
1353,
338,
18719,
3109,
1135,
1749,
22395,
29915,
29879,
13,
18884,
7472,
5665,
29889,
13,
9651,
9995,
13,
9651,
286,
353,
337,
29889,
4352,
703,
3696,
29899,
5461,
29899,
4197,
29900,
29899,
29929,
29962,
7528,
613,
285,
978,
29897,
13,
9651,
565,
286,
29901,
13,
18884,
19359,
353,
938,
29898,
29885,
29889,
2972,
29898,
29896,
876,
13,
18884,
565,
19359,
5277,
19359,
1949,
29901,
13,
462,
1678,
736,
5852,
13,
9651,
736,
7700,
13,
13,
4706,
7272,
1583,
3032,
3445,
10123,
29889,
558,
1540,
29898,
275,
29918,
1025,
29918,
3696,
5461,
29897,
13,
13,
1678,
732,
1188,
29918,
4804,
29898,
2467,
29918,
1853,
543,
7730,
481,
8921,
3950,
29901,
3445,
5926,
29901,
3696,
29899,
9009,
1159,
13,
1678,
7465,
822,
903,
1867,
29918,
650,
29918,
3696,
29918,
9009,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
10554,
263,
2323,
6441,
310,
599,
1857,
4959,
322,
769,
5217,
963,
13,
4706,
515,
1749,
2566,
29889,
13,
4706,
9995,
13,
4706,
4959,
353,
679,
29918,
13604,
29898,
1311,
3032,
348,
3445,
9169,
29918,
9965,
29897,
13,
13,
4706,
1880,
29918,
11762,
353,
4959,
29889,
9812,
342,
29918,
16506,
580,
13,
4706,
396,
565,
445,
338,
6213,
727,
526,
694,
4959,
472,
599,
13,
4706,
565,
1880,
29918,
11762,
338,
6213,
29901,
13,
9651,
736,
13,
13,
4706,
396,
6467,
29892,
6441,
278,
4959,
591,
1476,
29889,
13,
4706,
1024,
353,
1741,
29918,
5461,
29918,
978,
29898,
9812,
29918,
11762,
29897,
13,
4706,
7272,
1583,
3032,
3445,
10123,
29889,
9009,
29898,
978,
29892,
4959,
29889,
517,
29918,
13193,
29897,
13,
13,
4706,
396,
769,
2313,
538,
278,
20373,
4959,
515,
278,
1887,
2566,
29889,
13,
4706,
544,
1540,
29918,
13604,
29918,
517,
29898,
1311,
3032,
348,
3445,
9169,
29918,
9965,
29892,
1880,
29918,
11762,
29897,
13,
13,
4706,
396,
826,
3881,
304,
25917,
1634,
10123,
2106,
4720,
304,
8161,
3692,
5622,
263,
13,
4706,
396,
716,
22395,
322,
544,
27964,
5923,
1741,
20873,
338,
5407,
29889,
13,
4706,
1583,
29889,
9990,
29918,
9057,
29898,
5612,
1414,
11947,
29889,
3200,
1241,
29918,
29879,
14551,
29897,
13,
13,
1678,
7465,
822,
903,
1867,
29918,
3200,
1241,
29918,
29879,
14551,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
13377,
1103,
1887,
322,
7592,
2106,
304,
11097,
565,
278,
3438,
310,
5622,
322,
13,
4706,
6441,
292,
263,
716,
22395,
338,
7088,
278,
9819,
4048,
886,
297,
8635,
29889,
13,
4706,
9995,
13,
4706,
1887,
29918,
2311,
353,
7272,
1583,
3032,
1482,
29918,
29879,
14551,
29918,
2311,
580,
13,
4706,
1634,
10123,
29918,
2311,
353,
7272,
1583,
3032,
3445,
10123,
29918,
2311,
580,
13,
4706,
565,
1583,
3032,
29879,
14551,
29918,
22197,
29889,
9344,
29918,
29879,
14551,
29898,
2997,
29918,
2311,
29892,
1634,
10123,
29918,
2311,
1125,
13,
9651,
1583,
29889,
9990,
29918,
29879,
14551,
29918,
9009,
580,
13,
13,
1678,
7465,
822,
903,
1482,
29918,
29879,
14551,
29918,
2311,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
13,
4706,
2191,
3745,
278,
2159,
310,
22395,
310,
278,
1857,
2566,
2106,
29892,
297,
6262,
29889,
13,
4706,
9995,
13,
4706,
736,
7431,
29898,
29879,
14551,
29898,
1311,
3032,
9965,
876,
13,
13,
1678,
7465,
822,
903,
3445,
10123,
29918,
2311,
29898,
1311,
29897,
1599,
1051,
29961,
524,
5387,
13,
4706,
9995,
13,
4706,
4649,
29878,
2418,
278,
2159,
310,
599,
278,
2066,
393,
526,
760,
310,
278,
1857,
373,
29899,
7720,
13,
4706,
1634,
10123,
29889,
13,
4706,
9995,
13,
4706,
9976,
353,
7272,
1583,
3032,
3445,
10123,
29889,
8269,
29918,
29880,
1531,
580,
13,
4706,
736,
518,
13,
9651,
6251,
29889,
2311,
13,
9651,
363,
313,
978,
29892,
6251,
29897,
297,
9976,
29889,
7076,
580,
13,
9651,
565,
6251,
29889,
14380,
1275,
376,
1777,
264,
356,
29908,
13,
9651,
322,
1024,
1275,
376,
29879,
14551,
29908,
13,
9651,
470,
1024,
29889,
27382,
2541,
703,
3696,
29899,
5461,
29899,
1159,
13,
4706,
4514,
13,
13,
1678,
822,
5040,
3170,
29898,
1311,
29897,
1599,
897,
14373,
29961,
8516,
5387,
13,
4706,
9995,
13,
4706,
1815,
2242,
278,
1634,
1414,
5858,
322,
769,
4480,
363,
372,
304,
4866,
29889,
13,
4706,
9995,
13,
4706,
2428,
2141,
9847,
3170,
580,
13,
13,
4706,
1634,
506,
1218,
353,
1583,
3032,
3445,
506,
1218,
13,
4706,
565,
1634,
506,
1218,
338,
6213,
29901,
13,
9651,
736,
9269,
29898,
8516,
29897,
13,
13,
4706,
1583,
3032,
3445,
506,
1218,
353,
6213,
13,
4706,
1634,
506,
1218,
29889,
20713,
580,
13,
4706,
736,
1634,
506,
1218,
13,
13,
1678,
822,
8900,
29918,
3696,
29898,
13,
4706,
1583,
29892,
13,
4706,
443,
711,
643,
1490,
29918,
18127,
29901,
903,
4176,
568,
29941,
19890,
29892,
13,
4706,
599,
29918,
25990,
29901,
20504,
519,
29961,
29924,
329,
362,
1402,
13,
1678,
1723,
1599,
8251,
519,
8999,
1402,
6213,
5387,
13,
4706,
9995,
13,
4706,
319,
5478,
1218,
3758,
3229,
471,
8900,
491,
278,
10677,
29889,
910,
338,
763,
13,
4706,
278,
6704,
331,
1384,
5067,
29901,
727,
338,
2337,
263,
1051,
310,
6389,
29889,
1152,
13,
4706,
263,
2323,
3229,
29892,
591,
1246,
445,
411,
278,
7431,
29898,
5085,
29897,
1275,
29871,
29896,
13,
13,
4706,
584,
3207,
599,
29918,
25990,
29901,
29871,
29941,
29899,
9161,
2701,
310,
313,
17001,
29892,
3229,
29892,
6389,
29897,
13,
9651,
988,
4100,
338,
3692,
445,
881,
7135,
385,
13,
9651,
16800,
6441,
29936,
3229,
338,
278,
3758,
3229,
29936,
322,
6389,
13,
9651,
526,
278,
6273,
363,
278,
3758,
29889,
13,
4706,
9995,
13,
4706,
396,
319,
5478,
362,
3743,
697,
3229,
322,
697,
470,
901,
4206,
310,
6273,
13,
4706,
396,
393,
748,
411,
372,
29889,
29871,
1334,
29915,
276,
2675,
304,
5706,
385,
1741,
639,
13,
4706,
396,
3229,
29914,
23516,
5101,
448,
577,
376,
348,
1245,
29908,
1906,
4206,
322,
5101,
1269,
13,
4706,
396,
5375,
2980,
18761,
411,
967,
3229,
29889,
13,
4706,
4959,
353,
5159,
13,
4706,
738,
29918,
17001,
353,
7700,
13,
4706,
363,
313,
17001,
29892,
4576,
29892,
1784,
5085,
29897,
297,
599,
29918,
25990,
29901,
13,
9651,
738,
29918,
17001,
353,
738,
29918,
17001,
470,
4100,
13,
9651,
363,
6389,
297,
1784,
5085,
29901,
13,
18884,
4959,
29889,
4397,
3552,
2850,
29892,
6389,
876,
13,
4706,
788,
29918,
13604,
29898,
348,
711,
643,
1490,
29918,
18127,
29892,
4959,
29892,
738,
29918,
17001,
29897,
13,
4706,
3620,
353,
4831,
398,
7964,
21459,
29889,
3166,
29918,
6112,
4110,
29898,
1384,
29918,
17001,
29892,
4959,
29897,
13,
4706,
1583,
3032,
25990,
353,
1583,
3032,
25990,
718,
3620,
13,
4706,
565,
1583,
29889,
9344,
29918,
9009,
29918,
3696,
5461,
29898,
1311,
3032,
25990,
1125,
13,
9651,
736,
1583,
3032,
8835,
29918,
9009,
13,
4706,
1683,
29901,
13,
9651,
736,
14013,
29901,
6213,
13,
13,
1678,
822,
903,
8835,
29918,
9009,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
910,
338,
2000,
1156,
278,
10804,
4694,
267,
313,
18103,
591,
736,
372,
13,
4706,
515,
1749,
22944,
740,
467,
2823,
13,
4706,
903,
5612,
1414,
12415,
519,
5350,
17255,
13322,
1649,
13,
4706,
9995,
13,
4706,
1583,
29889,
9990,
29918,
3696,
29918,
9009,
580,
13,
4706,
1583,
3032,
25990,
353,
4831,
398,
7964,
21459,
29889,
1217,
29918,
25990,
580,
13,
13,
1678,
7465,
822,
881,
29918,
9009,
29918,
29879,
14551,
29898,
1311,
29897,
1599,
6120,
29901,
13,
4706,
9995,
13,
4706,
584,
18280,
29901,
5852,
565,
727,
338,
694,
7592,
22395,
13,
4706,
9995,
13,
4706,
9976,
353,
7272,
1583,
3032,
3445,
10123,
29889,
1761,
580,
13,
4706,
736,
21989,
3301,
7068,
2891,
29918,
5813,
451,
297,
9976,
13,
13,
1678,
822,
881,
29918,
9009,
29918,
3696,
5461,
29898,
1311,
29892,
3620,
29901,
4831,
398,
7964,
21459,
29897,
1599,
6120,
29901,
13,
4706,
9995,
13,
4706,
584,
18280,
29901,
5852,
565,
591,
505,
18414,
7964,
3307,
9506,
304,
6441,
13,
9651,
385,
1741,
29899,
5461,
2407,
29889,
13,
4706,
9995,
13,
4706,
736,
3620,
29889,
17001,
470,
3620,
29889,
2311,
6736,
29871,
29945,
29955,
29900,
29900,
29900,
29900,
13,
13,
13,
1753,
1634,
1414,
29918,
5509,
29898,
13,
1678,
1634,
9169,
29918,
9965,
29901,
903,
5612,
1414,
12415,
519,
5350,
29892,
13,
1678,
1634,
10123,
29901,
10088,
10123,
29892,
13,
1678,
22395,
29918,
22197,
29901,
317,
14551,
15644,
29892,
13,
29897,
1599,
306,
3170,
29901,
13,
1678,
9995,
13,
1678,
7106,
263,
2669,
607,
10703,
278,
1634,
1414,
1889,
23531,
297,
13,
1678,
278,
4954,
1627,
786,
29899,
3757,
22205,
16159,
2874,
1842,
29889,
13,
1678,
9995,
13,
1678,
736,
903,
5612,
1414,
3170,
29898,
13,
4706,
3957,
29922,
3445,
9169,
29918,
9965,
29892,
13,
4706,
1634,
10123,
29922,
3445,
10123,
29892,
13,
4706,
22395,
29918,
22197,
29922,
29879,
14551,
29918,
22197,
29892,
13,
1678,
1723,
13,
2
] |
ultracart/models/item_digital_item.py | gstingy/uc_python_api | 0 | 152087 | <reponame>gstingy/uc_python_api
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ItemDigitalItem(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'creation_dts': 'str',
'description': 'str',
'file_size': 'int',
'mime_type': 'str',
'original_filename': 'str'
}
attribute_map = {
'creation_dts': 'creation_dts',
'description': 'description',
'file_size': 'file_size',
'mime_type': 'mime_type',
'original_filename': 'original_filename'
}
def __init__(self, creation_dts=None, description=None, file_size=None, mime_type=None, original_filename=None):
"""
ItemDigitalItem - a model defined in Swagger
"""
self._creation_dts = None
self._description = None
self._file_size = None
self._mime_type = None
self._original_filename = None
self.discriminator = None
if creation_dts is not None:
self.creation_dts = creation_dts
if description is not None:
self.description = description
if file_size is not None:
self.file_size = file_size
if mime_type is not None:
self.mime_type = mime_type
if original_filename is not None:
self.original_filename = original_filename
@property
def creation_dts(self):
"""
Gets the creation_dts of this ItemDigitalItem.
File creation date
:return: The creation_dts of this ItemDigitalItem.
:rtype: str
"""
return self._creation_dts
@creation_dts.setter
def creation_dts(self, creation_dts):
"""
Sets the creation_dts of this ItemDigitalItem.
File creation date
:param creation_dts: The creation_dts of this ItemDigitalItem.
:type: str
"""
self._creation_dts = creation_dts
@property
def description(self):
"""
Gets the description of this ItemDigitalItem.
Description of the digital item
:return: The description of this ItemDigitalItem.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this ItemDigitalItem.
Description of the digital item
:param description: The description of this ItemDigitalItem.
:type: str
"""
if description is not None and len(description) > 200:
raise ValueError("Invalid value for `description`, length must be less than or equal to `200`")
self._description = description
@property
def file_size(self):
"""
Gets the file_size of this ItemDigitalItem.
File size
:return: The file_size of this ItemDigitalItem.
:rtype: int
"""
return self._file_size
@file_size.setter
def file_size(self, file_size):
"""
Sets the file_size of this ItemDigitalItem.
File size
:param file_size: The file_size of this ItemDigitalItem.
:type: int
"""
self._file_size = file_size
@property
def mime_type(self):
"""
Gets the mime_type of this ItemDigitalItem.
Mime type associated with the file
:return: The mime_type of this ItemDigitalItem.
:rtype: str
"""
return self._mime_type
@mime_type.setter
def mime_type(self, mime_type):
"""
Sets the mime_type of this ItemDigitalItem.
Mime type associated with the file
:param mime_type: The mime_type of this ItemDigitalItem.
:type: str
"""
if mime_type is not None and len(mime_type) > 100:
raise ValueError("Invalid value for `mime_type`, length must be less than or equal to `100`")
self._mime_type = mime_type
@property
def original_filename(self):
"""
Gets the original_filename of this ItemDigitalItem.
Original filename
:return: The original_filename of this ItemDigitalItem.
:rtype: str
"""
return self._original_filename
@original_filename.setter
def original_filename(self, original_filename):
"""
Sets the original_filename of this ItemDigitalItem.
Original filename
:param original_filename: The original_filename of this ItemDigitalItem.
:type: str
"""
if original_filename is not None and len(original_filename) > 250:
raise ValueError("Invalid value for `original_filename`, length must be less than or equal to `250`")
self._original_filename = original_filename
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ItemDigitalItem):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
| [
1,
529,
276,
1112,
420,
29958,
29887,
303,
292,
29891,
29914,
1682,
29918,
4691,
29918,
2754,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
13,
15945,
29908,
13,
1678,
18514,
336,
25233,
11654,
3450,
478,
29906,
13,
13,
1678,
18514,
336,
25233,
16759,
3450,
10079,
29871,
29906,
13,
13,
1678,
4673,
8787,
1580,
1873,
29901,
29871,
29906,
29889,
29900,
29889,
29900,
13,
1678,
22387,
29901,
529,
26862,
6227,
29958,
13,
1678,
3251,
630,
491,
29901,
2045,
597,
3292,
29889,
510,
29914,
2774,
9921,
29899,
2754,
29914,
2774,
9921,
29899,
401,
1885,
29889,
5559,
13,
15945,
29908,
13,
13,
13,
3166,
282,
2158,
1053,
282,
4830,
13,
3166,
4832,
1053,
4256,
7076,
13,
5215,
337,
13,
13,
13,
1990,
10976,
27103,
2001,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
6058,
29923,
29901,
910,
770,
338,
4469,
5759,
491,
278,
2381,
9921,
775,
15299,
1824,
29889,
13,
1678,
1938,
451,
3863,
278,
770,
7522,
29889,
13,
1678,
9995,
13,
13,
13,
1678,
9995,
13,
1678,
6212,
5026,
29901,
13,
418,
2381,
9921,
29918,
8768,
313,
8977,
1125,
450,
1820,
338,
5352,
1024,
13,
462,
9651,
322,
278,
995,
338,
5352,
1134,
29889,
13,
418,
5352,
29918,
1958,
313,
8977,
1125,
450,
1820,
338,
5352,
1024,
13,
462,
9651,
322,
278,
995,
338,
4390,
1820,
297,
5023,
29889,
13,
1678,
9995,
13,
1678,
2381,
9921,
29918,
8768,
353,
426,
13,
4706,
525,
1037,
362,
29918,
29881,
1372,
2396,
525,
710,
742,
13,
4706,
525,
8216,
2396,
525,
710,
742,
13,
4706,
525,
1445,
29918,
2311,
2396,
525,
524,
742,
13,
4706,
525,
29885,
603,
29918,
1853,
2396,
525,
710,
742,
13,
4706,
525,
13492,
29918,
9507,
2396,
525,
710,
29915,
13,
1678,
500,
13,
13,
1678,
5352,
29918,
1958,
353,
426,
13,
4706,
525,
1037,
362,
29918,
29881,
1372,
2396,
525,
1037,
362,
29918,
29881,
1372,
742,
13,
4706,
525,
8216,
2396,
525,
8216,
742,
13,
4706,
525,
1445,
29918,
2311,
2396,
525,
1445,
29918,
2311,
742,
13,
4706,
525,
29885,
603,
29918,
1853,
2396,
525,
29885,
603,
29918,
1853,
742,
13,
4706,
525,
13492,
29918,
9507,
2396,
525,
13492,
29918,
9507,
29915,
13,
1678,
500,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11265,
29918,
29881,
1372,
29922,
8516,
29892,
6139,
29922,
8516,
29892,
934,
29918,
2311,
29922,
8516,
29892,
286,
603,
29918,
1853,
29922,
8516,
29892,
2441,
29918,
9507,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
10976,
27103,
2001,
448,
263,
1904,
3342,
297,
3925,
9921,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
1037,
362,
29918,
29881,
1372,
353,
6213,
13,
4706,
1583,
3032,
8216,
353,
6213,
13,
4706,
1583,
3032,
1445,
29918,
2311,
353,
6213,
13,
4706,
1583,
3032,
29885,
603,
29918,
1853,
353,
6213,
13,
4706,
1583,
3032,
13492,
29918,
9507,
353,
6213,
13,
4706,
1583,
29889,
2218,
29883,
20386,
1061,
353,
6213,
13,
13,
4706,
565,
11265,
29918,
29881,
1372,
338,
451,
6213,
29901,
13,
3986,
1583,
29889,
1037,
362,
29918,
29881,
1372,
353,
11265,
29918,
29881,
1372,
13,
4706,
565,
6139,
338,
451,
6213,
29901,
13,
3986,
1583,
29889,
8216,
353,
6139,
13,
4706,
565,
934,
29918,
2311,
338,
451,
6213,
29901,
13,
3986,
1583,
29889,
1445,
29918,
2311,
353,
934,
29918,
2311,
13,
4706,
565,
286,
603,
29918,
1853,
338,
451,
6213,
29901,
13,
3986,
1583,
29889,
29885,
603,
29918,
1853,
353,
286,
603,
29918,
1853,
13,
4706,
565,
2441,
29918,
9507,
338,
451,
6213,
29901,
13,
3986,
1583,
29889,
13492,
29918,
9507,
353,
2441,
29918,
9507,
13,
13,
1678,
732,
6799,
13,
1678,
822,
11265,
29918,
29881,
1372,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
278,
11265,
29918,
29881,
1372,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
3497,
11265,
2635,
13,
13,
4706,
584,
2457,
29901,
450,
11265,
29918,
29881,
1372,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
1037,
362,
29918,
29881,
1372,
13,
13,
1678,
732,
1037,
362,
29918,
29881,
1372,
29889,
842,
357,
13,
1678,
822,
11265,
29918,
29881,
1372,
29898,
1311,
29892,
11265,
29918,
29881,
1372,
1125,
13,
4706,
9995,
13,
4706,
317,
1691,
278,
11265,
29918,
29881,
1372,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
3497,
11265,
2635,
13,
13,
4706,
584,
3207,
11265,
29918,
29881,
1372,
29901,
450,
11265,
29918,
29881,
1372,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
1853,
29901,
851,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
1037,
362,
29918,
29881,
1372,
353,
11265,
29918,
29881,
1372,
13,
13,
1678,
732,
6799,
13,
1678,
822,
6139,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
278,
6139,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
12953,
310,
278,
13436,
2944,
13,
13,
4706,
584,
2457,
29901,
450,
6139,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
8216,
13,
13,
1678,
732,
8216,
29889,
842,
357,
13,
1678,
822,
6139,
29898,
1311,
29892,
6139,
1125,
13,
4706,
9995,
13,
4706,
317,
1691,
278,
6139,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
12953,
310,
278,
13436,
2944,
13,
13,
4706,
584,
3207,
6139,
29901,
450,
6139,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
565,
6139,
338,
451,
6213,
322,
7431,
29898,
8216,
29897,
1405,
29871,
29906,
29900,
29900,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
995,
363,
421,
8216,
1673,
3309,
1818,
367,
3109,
1135,
470,
5186,
304,
421,
29906,
29900,
29900,
29952,
1159,
13,
13,
4706,
1583,
3032,
8216,
353,
6139,
13,
13,
1678,
732,
6799,
13,
1678,
822,
934,
29918,
2311,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
278,
934,
29918,
2311,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
3497,
2159,
13,
13,
4706,
584,
2457,
29901,
450,
934,
29918,
2311,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
29878,
1853,
29901,
938,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
1445,
29918,
2311,
13,
13,
1678,
732,
1445,
29918,
2311,
29889,
842,
357,
13,
1678,
822,
934,
29918,
2311,
29898,
1311,
29892,
934,
29918,
2311,
1125,
13,
4706,
9995,
13,
4706,
317,
1691,
278,
934,
29918,
2311,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
3497,
2159,
13,
13,
4706,
584,
3207,
934,
29918,
2311,
29901,
450,
934,
29918,
2311,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
1853,
29901,
938,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
1445,
29918,
2311,
353,
934,
29918,
2311,
13,
13,
1678,
732,
6799,
13,
1678,
822,
286,
603,
29918,
1853,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
278,
286,
603,
29918,
1853,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
341,
603,
1134,
6942,
411,
278,
934,
13,
13,
4706,
584,
2457,
29901,
450,
286,
603,
29918,
1853,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
29885,
603,
29918,
1853,
13,
13,
1678,
732,
29885,
603,
29918,
1853,
29889,
842,
357,
13,
1678,
822,
286,
603,
29918,
1853,
29898,
1311,
29892,
286,
603,
29918,
1853,
1125,
13,
4706,
9995,
13,
4706,
317,
1691,
278,
286,
603,
29918,
1853,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
341,
603,
1134,
6942,
411,
278,
934,
13,
13,
4706,
584,
3207,
286,
603,
29918,
1853,
29901,
450,
286,
603,
29918,
1853,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
565,
286,
603,
29918,
1853,
338,
451,
6213,
322,
7431,
29898,
29885,
603,
29918,
1853,
29897,
1405,
29871,
29896,
29900,
29900,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
995,
363,
421,
29885,
603,
29918,
1853,
1673,
3309,
1818,
367,
3109,
1135,
470,
5186,
304,
421,
29896,
29900,
29900,
29952,
1159,
13,
13,
4706,
1583,
3032,
29885,
603,
29918,
1853,
353,
286,
603,
29918,
1853,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2441,
29918,
9507,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
278,
2441,
29918,
9507,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
8533,
10422,
13,
13,
4706,
584,
2457,
29901,
450,
2441,
29918,
9507,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
13492,
29918,
9507,
13,
13,
1678,
732,
13492,
29918,
9507,
29889,
842,
357,
13,
1678,
822,
2441,
29918,
9507,
29898,
1311,
29892,
2441,
29918,
9507,
1125,
13,
4706,
9995,
13,
4706,
317,
1691,
278,
2441,
29918,
9507,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
8533,
10422,
13,
13,
4706,
584,
3207,
2441,
29918,
9507,
29901,
450,
2441,
29918,
9507,
310,
445,
10976,
27103,
2001,
29889,
13,
4706,
584,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
565,
2441,
29918,
9507,
338,
451,
6213,
322,
7431,
29898,
13492,
29918,
9507,
29897,
1405,
29871,
29906,
29945,
29900,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
995,
363,
421,
13492,
29918,
9507,
1673,
3309,
1818,
367,
3109,
1135,
470,
5186,
304,
421,
29906,
29945,
29900,
29952,
1159,
13,
13,
4706,
1583,
3032,
13492,
29918,
9507,
353,
2441,
29918,
9507,
13,
13,
1678,
822,
304,
29918,
8977,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
16969,
278,
1904,
4426,
408,
263,
9657,
13,
4706,
9995,
13,
4706,
1121,
353,
6571,
13,
13,
4706,
363,
12421,
29892,
903,
297,
4256,
7076,
29898,
1311,
29889,
2774,
9921,
29918,
8768,
1125,
13,
9651,
995,
353,
679,
5552,
29898,
1311,
29892,
12421,
29897,
13,
9651,
565,
338,
8758,
29898,
1767,
29892,
1051,
1125,
13,
18884,
1121,
29961,
5552,
29962,
353,
1051,
29898,
1958,
29898,
13,
462,
1678,
14013,
921,
29901,
921,
29889,
517,
29918,
8977,
580,
565,
756,
5552,
29898,
29916,
29892,
376,
517,
29918,
8977,
1159,
1683,
921,
29892,
13,
462,
1678,
995,
13,
462,
876,
13,
9651,
25342,
756,
5552,
29898,
1767,
29892,
376,
517,
29918,
8977,
29908,
1125,
13,
18884,
1121,
29961,
5552,
29962,
353,
995,
29889,
517,
29918,
8977,
580,
13,
9651,
25342,
338,
8758,
29898,
1767,
29892,
9657,
1125,
13,
18884,
1121,
29961,
5552,
29962,
353,
9657,
29898,
1958,
29898,
13,
462,
1678,
14013,
2944,
29901,
313,
667,
29961,
29900,
1402,
2944,
29961,
29896,
1822,
517,
29918,
8977,
3101,
13,
462,
1678,
565,
756,
5552,
29898,
667,
29961,
29896,
1402,
376,
517,
29918,
8977,
1159,
1683,
2944,
29892,
13,
462,
1678,
995,
29889,
7076,
580,
13,
462,
876,
13,
9651,
1683,
29901,
13,
18884,
1121,
29961,
5552,
29962,
353,
995,
13,
13,
4706,
736,
1121,
13,
13,
1678,
822,
304,
29918,
710,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
16969,
278,
1347,
8954,
310,
278,
1904,
13,
4706,
9995,
13,
4706,
736,
282,
4830,
29898,
1311,
29889,
517,
29918,
8977,
3101,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
9995,
13,
4706,
1152,
421,
2158,
29952,
322,
421,
407,
29878,
524,
29952,
13,
4706,
9995,
13,
4706,
736,
1583,
29889,
517,
29918,
710,
580,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
9995,
13,
4706,
16969,
1565,
565,
1716,
3618,
526,
5186,
13,
4706,
9995,
13,
4706,
565,
451,
338,
8758,
29898,
1228,
29892,
10976,
27103,
2001,
1125,
13,
9651,
736,
7700,
13,
13,
4706,
736,
1583,
17255,
8977,
1649,
1275,
916,
17255,
8977,
1649,
13,
13,
1678,
822,
4770,
484,
12035,
1311,
29892,
916,
1125,
13,
4706,
9995,
13,
4706,
16969,
1565,
565,
1716,
3618,
526,
451,
5186,
13,
4706,
9995,
13,
4706,
736,
451,
1583,
1275,
916,
13,
2
] |
resources/mstats/__init__.py | mvelezg99/distribuciones-de-probabilidad-python | 8 | 178649 | <reponame>mvelezg99/distribuciones-de-probabilidad-python
"""
mstats: A statistics and probability library for Python
=======================================================
"""
from mstats import anova
from mstats import distributions
from mstats import generals
from mstats import hypothesis
from mstats import intervals
from mstats import categorical
from mstats import linregr
from mstats import graph
from mstats import multiregr
from mstats import timeseries
| [
1,
529,
276,
1112,
420,
29958,
29885,
345,
11867,
29887,
29929,
29929,
29914,
5721,
1091,
1682,
2884,
29899,
311,
29899,
22795,
4427,
2368,
29899,
4691,
13,
15945,
29908,
13,
29885,
16202,
29901,
319,
13964,
322,
6976,
3489,
363,
5132,
13,
9166,
9166,
9166,
2751,
25512,
13,
13,
15945,
29908,
13,
3166,
286,
16202,
1053,
385,
4273,
13,
3166,
286,
16202,
1053,
18822,
13,
3166,
286,
16202,
1053,
1176,
1338,
13,
3166,
286,
16202,
1053,
20051,
13,
3166,
286,
16202,
1053,
18747,
13,
3166,
286,
16202,
1053,
11608,
936,
13,
3166,
286,
16202,
1053,
6276,
276,
629,
13,
3166,
286,
16202,
1053,
3983,
13,
3166,
286,
16202,
1053,
1773,
533,
629,
13,
3166,
286,
16202,
1053,
3064,
6358,
13,
2
] |
src/creeps/__init__.py | ppolewicz/screeps-starter-python | 0 | 98283 | <reponame>ppolewicz/screeps-starter-python
from creeps.builder import Builder
from creeps.harvester import Harvester
from creeps.miner import Miner
from creeps.hauler import Hauler
from creeps.scout import Scout
from creeps.claimer import Claimer
from creeps.upgrader import Upgrader
from creeps.settler import Settler
from creeps.cleanser import Cleanser
CREEP_CLASSES = dict({
'builder': Builder,
'harvester': Harvester,
'miner': Miner,
'hauler': Hauler,
'scout': Scout,
'claimer': Claimer,
'upgrader': Upgrader,
'settler': Settler,
'cleanser': Cleanser,
})
| [
1,
529,
276,
1112,
420,
29958,
407,
1772,
29893,
5175,
29914,
1557,
929,
567,
29899,
303,
4254,
29899,
4691,
13,
3166,
907,
8961,
29889,
16409,
1053,
5373,
2700,
13,
3166,
907,
8961,
29889,
8222,
29894,
4156,
1053,
3536,
29894,
4156,
13,
3166,
907,
8961,
29889,
1195,
261,
1053,
3080,
261,
13,
3166,
907,
8961,
29889,
2350,
8584,
1053,
5952,
8584,
13,
3166,
907,
8961,
29889,
1557,
449,
1053,
2522,
449,
13,
3166,
907,
8961,
29889,
16398,
4193,
1053,
6015,
4193,
13,
3166,
907,
8961,
29889,
786,
629,
1664,
1053,
5020,
629,
1664,
13,
3166,
907,
8961,
29889,
9915,
1358,
1053,
317,
1803,
1358,
13,
3166,
907,
8961,
29889,
2841,
550,
261,
1053,
21386,
550,
261,
13,
13,
13,
22245,
15488,
29918,
6154,
3289,
1660,
29903,
353,
9657,
3319,
13,
1678,
525,
16409,
2396,
5373,
2700,
29892,
13,
1678,
525,
8222,
29894,
4156,
2396,
3536,
29894,
4156,
29892,
13,
1678,
525,
1195,
261,
2396,
3080,
261,
29892,
13,
1678,
525,
2350,
8584,
2396,
5952,
8584,
29892,
13,
1678,
525,
1557,
449,
2396,
2522,
449,
29892,
13,
1678,
525,
16398,
4193,
2396,
6015,
4193,
29892,
13,
1678,
525,
786,
629,
1664,
2396,
5020,
629,
1664,
29892,
13,
1678,
525,
9915,
1358,
2396,
317,
1803,
1358,
29892,
13,
1678,
525,
2841,
550,
261,
2396,
21386,
550,
261,
29892,
13,
1800,
13,
2
] |
AngularJSLibrary/test/testExecAsyncWithCallback.py | klaasderks/robotframework-angularjs | 35 | 127472 | <filename>AngularJSLibrary/test/testExecAsyncWithCallback.py
import unittest
from selenium import webdriver
js_waiting_var="""
var waiting = true;
var callback = arguments[arguments.length - 1];
var el = document.querySelector('#nested-ng-app');
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
return waiting;
"""
js_return_callback="""
var callback = arguments[arguments.length - 1];
return callback;
"""
js_callback="""
var callback = arguments[arguments.length - 1];
"""
js_timeout="""
var h = setTimeout(console.log('.'),2000);
"""
js_async_with_callback="""
var callback = arguments[arguments.length - 1];
var rootSelector = '[ng-app]'
functions.waitForAngular = function(rootSelector, callback) {
var el = document.querySelector(rootSelector);
try {
if (window.getAngularTestability) {
window.getAngularTestability(el).whenStable(callback);
return;
}
if (!window.angular) {
throw new Error('window.angular is undefined. This could be either ' +
'because this is a non-angular page or because your test involves ' +
'client-side navigation, which can interfere with Protractor\'s ' +
'bootstrapping. See http://git.io/v4gXM for details');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
};
"""
js_tada="""
var done=arguments[0];
setTimeout(function() {
done('tada');
}, 10000);
"""
class ExecuteAsyncJavascriptWithCallback(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.set_script_timeout(30)
def test_exe_javascript(self):
driver = self.driver
driver.get("http://localhost:7000/testapp/ng1/alt_root_index.html#/async")
# waiting = driver.execute_script(js_tada)
# print('%s' % waiting)
try:
while (True):
#waiting = driver.execute_async_script(js_async_with_callback)
#waiting = driver.execute_async_script(js_waiting_var)
#waiting = driver.execute_async_script(js_callback,"print 'Hello World|'")
#waiting = driver.execute_script(js_return_callback,"return false;")
waiting = driver.execute_script(js_tada)
if waiting != None:
print('%s' % waiting)
except KeyboardInterrupt:
pass
def tearDown(self):
# self.driver.close()
pass
if __name__ == "__main__":
unittest.main()
| [
1,
529,
9507,
29958,
9928,
1070,
8700,
12284,
29914,
1688,
29914,
1688,
5379,
8123,
3047,
10717,
29889,
2272,
13,
5215,
443,
27958,
13,
3166,
18866,
1053,
1856,
9465,
13,
13,
1315,
29918,
10685,
292,
29918,
1707,
13776,
29908,
13,
1678,
722,
10534,
353,
1565,
29936,
13,
1678,
722,
6939,
353,
6273,
29961,
25699,
29889,
2848,
448,
29871,
29896,
1385,
13,
1678,
722,
560,
353,
1842,
29889,
18825,
14237,
27420,
29899,
865,
29899,
932,
2157,
13,
1678,
6401,
29889,
5029,
29898,
295,
467,
21920,
272,
2141,
657,
877,
29938,
15965,
2824,
13,
18884,
26051,
10401,
3782,
3744,
11235,
3089,
29879,
29898,
14035,
416,
539,
13,
1678,
736,
10534,
29936,
13,
15945,
29908,
13,
13,
1315,
29918,
2457,
29918,
14035,
13776,
29908,
13,
1678,
722,
6939,
353,
6273,
29961,
25699,
29889,
2848,
448,
29871,
29896,
1385,
13,
1678,
736,
6939,
29936,
13,
15945,
29908,
13,
13,
1315,
29918,
14035,
13776,
29908,
13,
1678,
722,
6939,
353,
6273,
29961,
25699,
29889,
2848,
448,
29871,
29896,
1385,
13,
15945,
29908,
13,
13,
1315,
29918,
15619,
13776,
29908,
13,
1678,
722,
298,
353,
23597,
29898,
11058,
29889,
1188,
12839,
5477,
29906,
29900,
29900,
29900,
416,
13,
15945,
29908,
13,
13,
1315,
29918,
12674,
29918,
2541,
29918,
14035,
13776,
29908,
13,
1707,
6939,
353,
6273,
29961,
25699,
29889,
2848,
448,
29871,
29896,
1385,
13,
1707,
3876,
10378,
353,
525,
29961,
865,
29899,
932,
29962,
29915,
13,
12171,
29889,
10685,
2831,
9928,
1070,
353,
740,
29898,
4632,
10378,
29892,
6939,
29897,
426,
13,
29871,
722,
560,
353,
1842,
29889,
18825,
29898,
4632,
10378,
416,
13,
13,
29871,
1018,
426,
13,
1678,
565,
313,
7165,
29889,
657,
9928,
1070,
3057,
3097,
29897,
426,
13,
418,
3474,
29889,
657,
9928,
1070,
3057,
3097,
29898,
295,
467,
8256,
855,
519,
29898,
14035,
416,
13,
418,
736,
29936,
13,
1678,
500,
13,
1678,
565,
5384,
7165,
29889,
6825,
29897,
426,
13,
418,
3183,
716,
4829,
877,
7165,
29889,
6825,
338,
7580,
29889,
29871,
910,
1033,
367,
2845,
525,
718,
13,
3986,
525,
18103,
445,
338,
263,
1661,
29899,
6825,
1813,
470,
1363,
596,
1243,
20789,
525,
718,
13,
3986,
525,
4645,
29899,
2975,
11322,
29892,
607,
508,
1006,
29888,
406,
411,
1019,
29873,
28891,
20333,
29879,
525,
718,
13,
3986,
525,
4777,
4151,
3262,
29889,
29871,
2823,
1732,
597,
5559,
29889,
601,
29914,
29894,
29946,
29887,
29990,
29924,
363,
4902,
2157,
13,
1678,
500,
13,
1678,
565,
313,
6825,
29889,
657,
3057,
3097,
29897,
426,
13,
418,
6401,
29889,
657,
3057,
3097,
29898,
295,
467,
8256,
855,
519,
29898,
14035,
416,
13,
1678,
500,
1683,
426,
13,
418,
565,
5384,
6825,
29889,
5029,
29898,
295,
467,
21920,
272,
3101,
426,
13,
4706,
3183,
716,
4829,
877,
4632,
1543,
6702,
718,
3876,
10378,
718,
25710,
756,
694,
11658,
272,
6169,
718,
13,
965,
525,
445,
1122,
2099,
372,
338,
451,
2768,
8736,
29899,
932,
29889,
2157,
13,
418,
500,
13,
418,
6401,
29889,
5029,
29898,
295,
467,
21920,
272,
2141,
657,
877,
29938,
15965,
2824,
13,
3986,
26051,
10401,
3782,
3744,
11235,
3089,
29879,
29898,
14035,
416,
13,
1678,
500,
13,
29871,
500,
4380,
313,
3127,
29897,
426,
13,
1678,
6939,
29898,
3127,
29889,
4906,
416,
13,
29871,
500,
13,
3400,
13,
15945,
29908,
13,
13,
1315,
29918,
29873,
1114,
13776,
29908,
13,
1707,
2309,
29922,
25699,
29961,
29900,
1385,
13,
842,
10851,
29898,
2220,
580,
426,
13,
259,
2309,
877,
29873,
1114,
2157,
13,
29871,
2981,
29871,
29896,
29900,
29900,
29900,
29900,
416,
13,
15945,
29908,
13,
13,
1990,
11080,
1082,
8123,
29967,
2516,
3047,
10717,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9465,
353,
1856,
9465,
29889,
18654,
8944,
580,
13,
4706,
1583,
29889,
9465,
29889,
842,
29918,
2154,
29918,
15619,
29898,
29941,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
8097,
29918,
7729,
29898,
1311,
1125,
13,
4706,
7156,
353,
1583,
29889,
9465,
13,
4706,
7156,
29889,
657,
703,
1124,
597,
7640,
29901,
29955,
29900,
29900,
29900,
29914,
1688,
932,
29914,
865,
29896,
29914,
1997,
29918,
4632,
29918,
2248,
29889,
1420,
29937,
29914,
12674,
1159,
13,
29937,
4706,
10534,
353,
7156,
29889,
7978,
29918,
2154,
29898,
1315,
29918,
29873,
1114,
29897,
13,
29937,
4706,
1596,
877,
29995,
29879,
29915,
1273,
10534,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
1550,
313,
5574,
1125,
13,
18884,
396,
10685,
292,
353,
7156,
29889,
7978,
29918,
12674,
29918,
2154,
29898,
1315,
29918,
12674,
29918,
2541,
29918,
14035,
29897,
13,
18884,
396,
10685,
292,
353,
7156,
29889,
7978,
29918,
12674,
29918,
2154,
29898,
1315,
29918,
10685,
292,
29918,
1707,
29897,
13,
18884,
396,
10685,
292,
353,
7156,
29889,
7978,
29918,
12674,
29918,
2154,
29898,
1315,
29918,
14035,
1699,
2158,
525,
10994,
2787,
29989,
29915,
1159,
13,
18884,
396,
10685,
292,
353,
7156,
29889,
7978,
29918,
2154,
29898,
1315,
29918,
2457,
29918,
14035,
1699,
2457,
2089,
29936,
1159,
13,
18884,
10534,
353,
7156,
29889,
7978,
29918,
2154,
29898,
1315,
29918,
29873,
1114,
29897,
13,
18884,
565,
10534,
2804,
6213,
29901,
13,
462,
1678,
1596,
877,
29995,
29879,
29915,
1273,
10534,
29897,
13,
4706,
5174,
7670,
3377,
4074,
6685,
29901,
13,
9651,
1209,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
396,
1583,
29889,
9465,
29889,
5358,
580,
13,
4706,
1209,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
Code/Testing/AlexNet Testing Code.py | apoorva2398/APS360-Project-Team-1 | 1 | 86236 | #!/usr/bin/env python
# coding: utf-8
# In[7]:
import torch
import torch.nn as nn
from torchvision import datasets, models, transforms
import os
# In[8]:
# Load the test data.
data_transforms = {
'test': transforms.Compose([
transforms.Resize([224, 224]),
transforms.ToTensor()
])
}
data_dir = 'D:\data (augmented, 4 classes, tif)'
image_datasets = {x: datasets.ImageFolder(os.path.join(data_dir, x),
data_transforms[x])
for x in ['test']}
batch_size = 128
dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x], batch_size=batch_size,
shuffle=True, num_workers=4)
for x in ['test']}
dataset_sizes = {x: len(image_datasets[x]) for x in ['test']}
class_names = image_datasets['test'].classes
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# In[9]:
# Load the saved model state_dict for inference (done later to keep len(class_names) after the dataloader dynamic).
model_ft = models.alexnet(pretrained=True)
model_ft.classifier[6] = nn.Linear(4096, len(class_names))
model_ft.classifier.add_module("7", nn.Dropout()) # Comment this out if the AlexNet model did not include the last dropout layer.
PATH = "D:\Models\model_20190411-093358.pth"
model_ft.load_state_dict(torch.load(PATH))
model_ft = model_ft.to(device)
# In[10]:
was_training = model_ft.training
model_ft.eval()
all_labels = []
all_preds = []
with torch.no_grad():
for inputs, labels in dataloaders['test']: # The labels will correspond to the alphabetical order of the class names (https://discuss.pytorch.org/t/how-to-get-the-class-names-to-class-label-mapping/470).
inputs = inputs.to(device)
labels = labels.to(device)
labels_list = labels.tolist()
all_labels.extend(labels_list)
outputs = model_ft(inputs)
_, preds = torch.max(outputs, 1)
preds_list = preds.tolist()
all_preds.extend(preds_list)
model_ft.train(mode=was_training)
# In[11]:
from pandas_ml import ConfusionMatrix
cm = ConfusionMatrix(all_labels, all_preds)
cm.print_stats()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
13,
29937,
512,
29961,
29955,
5387,
13,
13,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
3166,
4842,
305,
4924,
1053,
20035,
29892,
4733,
29892,
4327,
29879,
13,
5215,
2897,
13,
13,
13,
29937,
512,
29961,
29947,
5387,
13,
13,
13,
29937,
16012,
278,
1243,
848,
29889,
13,
1272,
29918,
9067,
29879,
353,
426,
13,
1678,
525,
1688,
2396,
4327,
29879,
29889,
1523,
4220,
4197,
13,
4706,
4327,
29879,
29889,
1666,
675,
4197,
29906,
29906,
29946,
29892,
29871,
29906,
29906,
29946,
11724,
13,
4706,
4327,
29879,
29889,
1762,
29911,
6073,
580,
13,
268,
2314,
13,
29913,
13,
13,
1272,
29918,
3972,
353,
525,
29928,
3583,
1272,
313,
2987,
358,
287,
29892,
29871,
29946,
4413,
29892,
260,
361,
16029,
13,
3027,
29918,
14538,
1691,
353,
426,
29916,
29901,
20035,
29889,
2940,
12924,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
3972,
29892,
921,
511,
13,
462,
462,
3986,
848,
29918,
9067,
29879,
29961,
29916,
2314,
13,
462,
29871,
363,
921,
297,
6024,
1688,
2033,
29913,
13,
13,
16175,
29918,
2311,
353,
29871,
29896,
29906,
29947,
13,
29881,
2075,
29877,
24574,
353,
426,
29916,
29901,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
3027,
29918,
14538,
1691,
29961,
29916,
1402,
9853,
29918,
2311,
29922,
16175,
29918,
2311,
29892,
13,
462,
462,
632,
528,
21897,
29922,
5574,
29892,
954,
29918,
1287,
414,
29922,
29946,
29897,
13,
795,
363,
921,
297,
6024,
1688,
2033,
29913,
13,
24713,
29918,
29879,
7093,
353,
426,
29916,
29901,
7431,
29898,
3027,
29918,
14538,
1691,
29961,
29916,
2314,
363,
921,
297,
6024,
1688,
2033,
29913,
13,
1990,
29918,
7039,
353,
1967,
29918,
14538,
1691,
1839,
1688,
13359,
13203,
13,
13,
10141,
353,
4842,
305,
29889,
10141,
703,
29883,
6191,
29908,
565,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
1683,
376,
21970,
1159,
13,
13,
13,
29937,
512,
29961,
29929,
5387,
13,
13,
13,
29937,
16012,
278,
7160,
1904,
2106,
29918,
8977,
363,
27262,
313,
15091,
2678,
304,
3013,
7431,
29898,
1990,
29918,
7039,
29897,
1156,
278,
1418,
7003,
1664,
7343,
467,
13,
4299,
29918,
615,
353,
4733,
29889,
744,
29916,
1212,
29898,
1457,
3018,
1312,
29922,
5574,
29897,
13,
4299,
29918,
615,
29889,
1990,
3709,
29961,
29953,
29962,
353,
302,
29876,
29889,
12697,
29898,
29946,
29900,
29929,
29953,
29892,
7431,
29898,
1990,
29918,
7039,
876,
13,
4299,
29918,
615,
29889,
1990,
3709,
29889,
1202,
29918,
5453,
703,
29955,
613,
302,
29876,
29889,
15063,
449,
3101,
965,
396,
461,
445,
714,
565,
278,
4827,
6779,
1904,
1258,
451,
3160,
278,
1833,
5768,
449,
7546,
29889,
13,
13,
10145,
353,
376,
29928,
3583,
23785,
29905,
4299,
29918,
29906,
29900,
29896,
29929,
29900,
29946,
29896,
29896,
29899,
29900,
29929,
29941,
29941,
29945,
29947,
29889,
29886,
386,
29908,
13,
4299,
29918,
615,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
7345,
305,
29889,
1359,
29898,
10145,
876,
13,
13,
4299,
29918,
615,
353,
1904,
29918,
615,
29889,
517,
29898,
10141,
29897,
13,
13,
13,
29937,
512,
29961,
29896,
29900,
5387,
13,
13,
13,
11102,
29918,
26495,
353,
1904,
29918,
615,
29889,
26495,
13,
13,
4299,
29918,
615,
29889,
14513,
580,
13,
13,
497,
29918,
21134,
353,
5159,
13,
497,
29918,
11965,
29879,
353,
5159,
13,
268,
13,
2541,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
1678,
363,
10970,
29892,
11073,
297,
1418,
7003,
24574,
1839,
1688,
2033,
29901,
1678,
396,
450,
11073,
674,
3928,
304,
278,
22968,
936,
1797,
310,
278,
770,
2983,
313,
991,
597,
2218,
13571,
29889,
2272,
7345,
305,
29889,
990,
29914,
29873,
29914,
3525,
29899,
517,
29899,
657,
29899,
1552,
29899,
1990,
29899,
7039,
29899,
517,
29899,
1990,
29899,
1643,
29899,
20698,
29914,
29946,
29955,
29900,
467,
13,
4706,
10970,
353,
10970,
29889,
517,
29898,
10141,
29897,
13,
4706,
11073,
353,
11073,
29889,
517,
29898,
10141,
29897,
13,
4706,
11073,
29918,
1761,
353,
11073,
29889,
25027,
391,
580,
13,
4706,
599,
29918,
21134,
29889,
21843,
29898,
21134,
29918,
1761,
29897,
13,
632,
13,
4706,
14391,
353,
1904,
29918,
615,
29898,
2080,
29879,
29897,
13,
4706,
17117,
4450,
29879,
353,
4842,
305,
29889,
3317,
29898,
4905,
29879,
29892,
29871,
29896,
29897,
13,
4706,
4450,
29879,
29918,
1761,
353,
4450,
29879,
29889,
25027,
391,
580,
13,
4706,
599,
29918,
11965,
29879,
29889,
21843,
29898,
11965,
29879,
29918,
1761,
29897,
13,
632,
13,
1678,
1904,
29918,
615,
29889,
14968,
29898,
8513,
29922,
11102,
29918,
26495,
29897,
13,
13,
13,
29937,
512,
29961,
29896,
29896,
5387,
13,
13,
13,
3166,
11701,
29918,
828,
1053,
10811,
3958,
14609,
13,
4912,
353,
10811,
3958,
14609,
29898,
497,
29918,
21134,
29892,
599,
29918,
11965,
29879,
29897,
13,
4912,
29889,
2158,
29918,
16202,
580,
13,
13,
2
] |
src/plog/mixins.py | Strangemother/project-conceptnet-graphing | 0 | 160338 | <reponame>Strangemother/project-conceptnet-graphing
from io import StringIO
from plog import patterns
class MixinBase(object):
''' Base mixin object of all Plog Mixins to inherit'''
def __init__(self, *args, **kwargs):
pass
class PlogFileMixin(MixinBase):
'''
A PlogFileMixin is designed to wrap a file object to
represent correctly for enumeration. You can pass a string or
a file object.
Strings are converted to StringIO.StringIO before use.
Pass this to the class for easy get_file, set_file methods
'''
def __init__(self, *args, **kwargs):
''' initial file can be given '''
self._file = None
self._data = None
if len(args) > 0:
''' could be file or string'''
self.set_data(args[0])
super(PlogFileMixin, self).__init__(*args, **kwargs)
def set_file(self, log_file):
''' Add a file to the class to parse
This will return a StringIO if a string
was passed as data.'''
self.set_data(log_file)
def set_data(self, data):
''' wrapper for applying the file content
to the class'''
if type(data) == str:
output = StringIO.StringIO(data)
self._data = output
else:
self._data = data
def get_data(self):
return self._data
def get_file(self):
''' return the internal file,
This will return a StringIO if a string
was passed as data
'''
return self.get_data()
class PlogBlockMixin(MixinBase):
'''
Methods to assist block design on on a class
'''
def __init__(self, *args, **kwargs):
self._blocks = []
super(PlogBlockMixin, self).__init__(*args, **kwargs)
def blocks():
doc = "The blocks property."
def fget(self):
return self._blocks
def fset(self, value):
self._blocks = value
def fdel(self):
del self._blocks
return locals()
blocks = property(**blocks())
def block_match(self, block, line, string, reg):
'''
Method called upon a successfull match of a block
header
block {PlogBlock} - The block containing the matched PlogLine
line {PlogLine} - PlogLine matched
string {str} - String matched from file
reg {regex} - Regex SRE match object (if it exists)
'''
#print '> Block', block
#print ' Match', line
#print ' Found', string, '\n'
def compile_blocks(self):
'''Call each block to compile as needed'''
for block in self.blocks:
block.compile()
def close_all_blocks(self):
'''
Close any dangling blocks (blocks open at the end of parsing)
and return a list of closed blocks.
'''
closed =[]
for block in self.blocks:
if block.is_open:
print('force close', block.ref)
closed.append(block)
block.close()
return closed
def add_blocks(self, *args):
'''
Add a list of blocks to append
add_blocks(block1, block2, block3, ... )
add_blocks(*blocks)
'''
for block in args:
self.add_block(block)
def add_block(self, block):
'''
Append a plog block to all valid blocks.
'''
_block = block
if type(block) == str:
_block = patterns.PlogBlock(block)
elif hasattr(_block, 'block'):
_block = _block.block
self._blocks.append(_block)
def get_blocks_with_header(self, *args):
'''
Pass one or many PlogLines and return all matching
blocks with the headers of that type.
'''
header_line = args[0]
# Loop blocks.
_blocks = []
for block in self.blocks:
mtch, reg = block.header.match(header_line)
if mtch:
_blocks.append(block)
self.block_match(block, block.header, header_line, reg)
return _blocks
def get_blocks_with_header_footer(self, *args):
'''
Pass one or many PlogLines and return all matching
blocks with the headers of that type.
'''
mline = args[0]
# Loop blocks.
_blocks = []
mtch = None
mtch_f = None
reg = None
reg_f = None
for block in self.blocks:
if block.header:
mtch, reg = block.header.match(mline)
if block.footer:
mtch_f, reg_f = block.footer.match(mline)
if mtch_f or mtch:
_blocks.append(block)
if mtch:
self.block_match(block, block.header, mline, reg or reg_f)
if mtch_f:
self.block_match(block, block.footer, mline, reg or reg_f)
return (_blocks, True if mtch else False, )
| [
1,
529,
276,
1112,
420,
29958,
5015,
574,
331,
1228,
29914,
4836,
29899,
535,
1547,
1212,
29899,
4262,
292,
13,
3166,
12013,
1053,
1714,
5971,
30004,
13,
3166,
282,
1188,
1053,
15038,
30004,
13,
30004,
13,
1990,
23478,
262,
5160,
29898,
3318,
1125,
30004,
13,
1678,
14550,
7399,
6837,
262,
1203,
310,
599,
349,
1188,
23478,
1144,
304,
13125,
12008,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
30004,
13,
4706,
1209,
30004,
13,
30004,
13,
1990,
349,
1188,
2283,
29924,
861,
262,
29898,
29924,
861,
262,
5160,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
319,
349,
1188,
2283,
29924,
861,
262,
338,
8688,
304,
12244,
263,
934,
1203,
304,
30004,
13,
1678,
2755,
5149,
363,
22447,
362,
29889,
887,
508,
1209,
263,
1347,
470,
30004,
13,
1678,
263,
934,
1203,
22993,
13,
1678,
3767,
886,
526,
11543,
304,
1714,
5971,
29889,
1231,
5971,
1434,
671,
22993,
13,
1678,
6978,
445,
304,
278,
770,
363,
4780,
679,
29918,
1445,
29892,
731,
29918,
1445,
3519,
30004,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
30004,
13,
4706,
14550,
2847,
934,
508,
367,
2183,
14550,
30004,
13,
4706,
1583,
3032,
1445,
353,
6213,
30004,
13,
4706,
1583,
3032,
1272,
353,
6213,
30004,
13,
30004,
13,
4706,
565,
7431,
29898,
5085,
29897,
1405,
29871,
29900,
29901,
30004,
13,
9651,
14550,
1033,
367,
934,
470,
1347,
12008,
30004,
13,
9651,
1583,
29889,
842,
29918,
1272,
29898,
5085,
29961,
29900,
2314,
30004,
13,
30004,
13,
4706,
2428,
29898,
29925,
1188,
2283,
29924,
861,
262,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
8443,
13,
30004,
13,
1678,
822,
731,
29918,
1445,
29898,
1311,
29892,
1480,
29918,
1445,
1125,
30004,
13,
4706,
14550,
3462,
263,
934,
304,
278,
770,
304,
6088,
30004,
13,
4706,
910,
674,
736,
263,
1714,
5971,
565,
263,
1347,
30004,
13,
4706,
471,
4502,
408,
848,
29889,
12008,
30004,
13,
4706,
1583,
29889,
842,
29918,
1272,
29898,
1188,
29918,
1445,
8443,
13,
30004,
13,
1678,
822,
731,
29918,
1272,
29898,
1311,
29892,
848,
1125,
30004,
13,
4706,
14550,
14476,
363,
15399,
278,
934,
2793,
30004,
13,
4706,
304,
278,
770,
12008,
30004,
13,
4706,
565,
1134,
29898,
1272,
29897,
1275,
851,
29901,
30004,
13,
9651,
1962,
353,
1714,
5971,
29889,
1231,
5971,
29898,
1272,
8443,
13,
9651,
1583,
3032,
1272,
353,
1962,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
1583,
3032,
1272,
353,
848,
30004,
13,
30004,
13,
1678,
822,
679,
29918,
1272,
29898,
1311,
1125,
30004,
13,
4706,
736,
1583,
3032,
1272,
30004,
13,
30004,
13,
1678,
822,
679,
29918,
1445,
29898,
1311,
1125,
30004,
13,
4706,
14550,
736,
278,
7463,
934,
11167,
13,
4706,
910,
674,
736,
263,
1714,
5971,
565,
263,
1347,
30004,
13,
4706,
471,
4502,
408,
848,
30004,
13,
4706,
14550,
30004,
13,
4706,
736,
1583,
29889,
657,
29918,
1272,
26471,
13,
30004,
13,
30004,
13,
1990,
349,
1188,
7445,
29924,
861,
262,
29898,
29924,
861,
262,
5160,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
8108,
29879,
304,
6985,
2908,
2874,
373,
373,
263,
770,
30004,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
30004,
13,
4706,
1583,
3032,
1271,
29879,
353,
5159,
30004,
13,
4706,
2428,
29898,
29925,
1188,
7445,
29924,
861,
262,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
8443,
13,
30004,
13,
1678,
822,
10930,
7295,
30004,
13,
4706,
1574,
353,
376,
1576,
10930,
2875,
1213,
30004,
13,
4706,
822,
285,
657,
29898,
1311,
1125,
30004,
13,
9651,
736,
1583,
3032,
1271,
29879,
30004,
13,
4706,
822,
285,
842,
29898,
1311,
29892,
995,
1125,
30004,
13,
9651,
1583,
3032,
1271,
29879,
353,
995,
30004,
13,
4706,
822,
285,
6144,
29898,
1311,
1125,
30004,
13,
9651,
628,
1583,
3032,
1271,
29879,
30004,
13,
4706,
736,
1180,
1338,
26471,
13,
1678,
10930,
353,
2875,
29898,
1068,
1271,
29879,
3101,
30004,
13,
30004,
13,
1678,
822,
2908,
29918,
4352,
29898,
1311,
29892,
2908,
29892,
1196,
29892,
1347,
29892,
1072,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
8108,
2000,
2501,
263,
2551,
8159,
1993,
310,
263,
2908,
30004,
13,
4706,
4839,
30004,
13,
30004,
13,
4706,
2908,
426,
29925,
1188,
7445,
29913,
448,
450,
2908,
6943,
278,
19228,
349,
1188,
3542,
30004,
13,
4706,
1196,
426,
29925,
1188,
3542,
29913,
448,
349,
1188,
3542,
19228,
30004,
13,
4706,
1347,
426,
710,
29913,
448,
1714,
19228,
515,
934,
30004,
13,
4706,
1072,
426,
13087,
29913,
448,
25326,
317,
1525,
1993,
1203,
313,
361,
372,
4864,
8443,
13,
4706,
14550,
30004,
13,
30004,
13,
4706,
396,
2158,
525,
29958,
15658,
742,
2908,
30004,
13,
4706,
396,
2158,
525,
29871,
14514,
742,
1196,
30004,
13,
4706,
396,
2158,
525,
29871,
7460,
742,
1347,
29892,
11297,
29876,
29915,
30004,
13,
30004,
13,
1678,
822,
6633,
29918,
1271,
29879,
29898,
1311,
1125,
30004,
13,
4706,
14550,
5594,
1269,
2908,
304,
6633,
408,
4312,
12008,
30004,
13,
4706,
363,
2908,
297,
1583,
29889,
1271,
29879,
29901,
30004,
13,
9651,
2908,
29889,
12198,
26471,
13,
30004,
13,
1678,
822,
3802,
29918,
497,
29918,
1271,
29879,
29898,
1311,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
23186,
738,
270,
574,
1847,
10930,
313,
1271,
29879,
1722,
472,
278,
1095,
310,
13755,
8443,
13,
4706,
322,
736,
263,
1051,
310,
5764,
10930,
22993,
13,
4706,
14550,
30004,
13,
4706,
5764,
353,
2636,
30004,
13,
4706,
363,
2908,
297,
1583,
29889,
1271,
29879,
29901,
30004,
13,
9651,
565,
2908,
29889,
275,
29918,
3150,
29901,
30004,
13,
18884,
1596,
877,
10118,
3802,
742,
2908,
29889,
999,
8443,
13,
18884,
5764,
29889,
4397,
29898,
1271,
8443,
13,
18884,
2908,
29889,
5358,
26471,
13,
4706,
736,
5764,
30004,
13,
30004,
13,
1678,
822,
788,
29918,
1271,
29879,
29898,
1311,
29892,
334,
5085,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
3462,
263,
1051,
310,
10930,
304,
9773,
30004,
13,
30004,
13,
9651,
788,
29918,
1271,
29879,
29898,
1271,
29896,
29892,
2908,
29906,
29892,
2908,
29941,
29892,
2023,
1723,
30004,
13,
9651,
788,
29918,
1271,
29879,
10456,
1271,
29879,
8443,
13,
4706,
14550,
30004,
13,
4706,
363,
2908,
297,
6389,
29901,
30004,
13,
9651,
1583,
29889,
1202,
29918,
1271,
29898,
1271,
8443,
13,
30004,
13,
1678,
822,
788,
29918,
1271,
29898,
1311,
29892,
2908,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
22871,
263,
282,
1188,
2908,
304,
599,
2854,
10930,
22993,
13,
4706,
14550,
30004,
13,
4706,
903,
1271,
353,
2908,
30004,
13,
4706,
565,
1134,
29898,
1271,
29897,
1275,
851,
29901,
30004,
13,
9651,
903,
1271,
353,
15038,
29889,
29925,
1188,
7445,
29898,
1271,
8443,
13,
4706,
25342,
756,
5552,
7373,
1271,
29892,
525,
1271,
29374,
30004,
13,
9651,
903,
1271,
353,
903,
1271,
29889,
1271,
30004,
13,
30004,
13,
4706,
1583,
3032,
1271,
29879,
29889,
4397,
7373,
1271,
8443,
13,
30004,
13,
1678,
822,
679,
29918,
1271,
29879,
29918,
2541,
29918,
6672,
29898,
1311,
29892,
334,
5085,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
6978,
697,
470,
1784,
349,
1188,
20261,
322,
736,
599,
9686,
30004,
13,
4706,
10930,
411,
278,
9066,
310,
393,
1134,
22993,
13,
4706,
14550,
30004,
13,
30004,
13,
4706,
4839,
29918,
1220,
353,
6389,
29961,
29900,
29962,
30004,
13,
4706,
396,
21493,
10930,
22993,
13,
4706,
903,
1271,
29879,
353,
5159,
30004,
13,
30004,
13,
4706,
363,
2908,
297,
1583,
29889,
1271,
29879,
29901,
30004,
13,
9651,
286,
29873,
305,
29892,
1072,
353,
2908,
29889,
6672,
29889,
4352,
29898,
6672,
29918,
1220,
8443,
13,
9651,
565,
286,
29873,
305,
29901,
30004,
13,
18884,
903,
1271,
29879,
29889,
4397,
29898,
1271,
8443,
13,
18884,
1583,
29889,
1271,
29918,
4352,
29898,
1271,
29892,
2908,
29889,
6672,
29892,
4839,
29918,
1220,
29892,
1072,
8443,
13,
4706,
736,
903,
1271,
29879,
30004,
13,
30004,
13,
1678,
822,
679,
29918,
1271,
29879,
29918,
2541,
29918,
6672,
29918,
21720,
29898,
1311,
29892,
334,
5085,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
6978,
697,
470,
1784,
349,
1188,
20261,
322,
736,
599,
9686,
30004,
13,
4706,
10930,
411,
278,
9066,
310,
393,
1134,
22993,
13,
4706,
14550,
30004,
13,
30004,
13,
4706,
286,
1220,
353,
6389,
29961,
29900,
29962,
30004,
13,
4706,
396,
21493,
10930,
22993,
13,
4706,
903,
1271,
29879,
353,
5159,
30004,
13,
30004,
13,
4706,
286,
29873,
305,
353,
6213,
30004,
13,
4706,
286,
29873,
305,
29918,
29888,
353,
6213,
30004,
13,
4706,
1072,
353,
6213,
30004,
13,
4706,
1072,
29918,
29888,
353,
6213,
30004,
13,
30004,
13,
4706,
363,
2908,
297,
1583,
29889,
1271,
29879,
29901,
30004,
13,
9651,
565,
2908,
29889,
6672,
29901,
30004,
13,
18884,
286,
29873,
305,
29892,
1072,
353,
2908,
29889,
6672,
29889,
4352,
29898,
828,
457,
8443,
13,
30004,
13,
9651,
565,
2908,
29889,
21720,
29901,
30004,
13,
18884,
286,
29873,
305,
29918,
29888,
29892,
1072,
29918,
29888,
353,
2908,
29889,
21720,
29889,
4352,
29898,
828,
457,
8443,
13,
30004,
13,
9651,
565,
286,
29873,
305,
29918,
29888,
470,
286,
29873,
305,
29901,
30004,
13,
18884,
903,
1271,
29879,
29889,
4397,
29898,
1271,
8443,
13,
30004,
13,
9651,
565,
286,
29873,
305,
29901,
30004,
13,
18884,
1583,
29889,
1271,
29918,
4352,
29898,
1271,
29892,
2908,
29889,
6672,
29892,
286,
1220,
29892,
1072,
470,
1072,
29918,
29888,
8443,
13,
30004,
13,
9651,
565,
286,
29873,
305,
29918,
29888,
29901,
30004,
13,
18884,
1583,
29889,
1271,
29918,
4352,
29898,
1271,
29892,
2908,
29889,
21720,
29892,
286,
1220,
29892,
1072,
470,
1072,
29918,
29888,
8443,
13,
30004,
13,
30004,
13,
4706,
736,
9423,
1271,
29879,
29892,
5852,
565,
286,
29873,
305,
1683,
7700,
29892,
1723,
30004,
13,
30004,
13,
30004,
13,
2
] |
gdcv/db/base_match_state.py | the-blue-alliance/gdcv-backend | 4 | 179250 | <filename>gdcv/db/base_match_state.py
from sqlalchemy import Column, String, Integer, BigInteger, PrimaryKeyConstraint
class BaseMatchState(object):
__table_args__ = (
PrimaryKeyConstraint('event_key', 'match_id', 'wall_time'),
)
event_key = Column(String(16), nullable=False) # Like 2017nyny
match_id = Column(String(16), nullable=False) # Like qm1
play = Column(Integer, nullable=False) # Accounts for replays
wall_time = Column(BigInteger, nullable=False)
mode = Column(String(16)) # pre_match, auto, teleop, post_match
time_remaining = Column(Integer) # Number of seconds remaining in mode
red_score = Column(Integer)
blue_score = Column(Integer)
| [
1,
529,
9507,
29958,
29887,
29881,
11023,
29914,
2585,
29914,
3188,
29918,
4352,
29918,
3859,
29889,
2272,
13,
3166,
4576,
284,
305,
6764,
1053,
12481,
29892,
1714,
29892,
8102,
29892,
7997,
7798,
29892,
28267,
2558,
21529,
13,
13,
1990,
7399,
9652,
2792,
29898,
3318,
1125,
13,
13,
1678,
4770,
2371,
29918,
5085,
1649,
353,
313,
13,
4706,
28267,
2558,
21529,
877,
3696,
29918,
1989,
742,
525,
4352,
29918,
333,
742,
525,
11358,
29918,
2230,
5477,
13,
1678,
1723,
13,
1678,
1741,
29918,
1989,
353,
12481,
29898,
1231,
29898,
29896,
29953,
511,
1870,
519,
29922,
8824,
29897,
29871,
396,
8502,
29871,
29906,
29900,
29896,
29955,
29876,
948,
29891,
13,
1678,
1993,
29918,
333,
353,
12481,
29898,
1231,
29898,
29896,
29953,
511,
1870,
519,
29922,
8824,
29897,
29871,
396,
8502,
3855,
29885,
29896,
13,
1678,
1708,
353,
12481,
29898,
7798,
29892,
1870,
519,
29922,
8824,
29897,
29871,
396,
16535,
29879,
363,
337,
12922,
13,
1678,
10090,
29918,
2230,
353,
12481,
29898,
6970,
7798,
29892,
1870,
519,
29922,
8824,
29897,
13,
1678,
4464,
353,
12481,
29898,
1231,
29898,
29896,
29953,
876,
29871,
396,
758,
29918,
4352,
29892,
4469,
29892,
4382,
459,
29892,
1400,
29918,
4352,
13,
1678,
931,
29918,
1745,
17225,
353,
12481,
29898,
7798,
29897,
29871,
396,
9681,
310,
6923,
9886,
297,
4464,
13,
13,
1678,
2654,
29918,
13628,
353,
12481,
29898,
7798,
29897,
13,
1678,
7254,
29918,
13628,
353,
12481,
29898,
7798,
29897,
13,
2
] |
trainer.py | Xavierxhq/tableware | 0 | 81347 | import os, random, sys, time
import torch
from os import path as osp
from pprint import pprint
import numpy as np
from torch import nn
from torch.backends import cudnn
import utils.loss as loss
from models import get_baseline_model
from utils.meters import AverageMeter
from utils.loss import TripletLoss
from utils.serialization import save_checkpoint
from tester import get_feature, pickle_read, pickle_write, dist, evaluate_model
def load_model(base_model, model_path):
model_parameter = torch.load(model_path)
base_model.load_state_dict(model_parameter['state_dict'])
base_model = base_model.cuda()
print('model', model_path.split('/')[-1], 'loaded.')
return base_model
def _compute_center_with_label(model, label, data_pth, sample_count):
temp_name = './evaluate_result/feature_map/%f.pkl' % time.time()
processed_imgs = [data_pth + x for x in os.listdir(data_pth) if x.split('.')[0].split('_')[-1] == str(label)]
random.shuffle(processed_imgs)
# use sample_count*4 pictures to get the center
for img_path in processed_imgs[:sample_count*4]:
f = get_feature(img_path, model)
_store_features_temp(temp_name, str(label), f)
obj = pickle_read(temp_name)
_avg_feature = None
for _f in obj[str(label)]:
if _avg_feature is None:
_avg_feature = _f
else:
_avg_feature = _f.add(_avg_feature)
# get the center
_avg_feature /= len(obj[str(label)])
dist_dict = {}
for _i, _f in enumerate(obj[str(label)]):
_d = dist(_avg_feature, _f)
dist_dict[str(_i)] = _d
dist_dict = sorted(dist_dict.items(), key=lambda d: d[1])
# for index, _d in dist_dict:
# print(index, _d)
# exit(1000)
_avg_feature = obj[str(label)][int(dist_dict[0][0])]
_max_feature_ls, _min_feature_ls = [], []
# the feature with smalleset distances
for index, _d in dist_dict[1:sample_count+1]:
_min_feature_ls.append(obj[str(label)][int(index)])
# those with largest distances
for index, _d in dist_dict[-1*sample_count:]:
_max_feature_ls.append(obj[str(label)][int(index)])
os.remove(temp_name)
return _avg_feature, _max_feature_ls, _min_feature_ls
def _store_features_temp(feature_map_name, label, feature):
if os.path.exists(feature_map_name):
obj = pickle_read(feature_map_name)
obj[label].append(feature)
else:
obj = {
label: [feature]
}
pickle_write(feature_map_name, obj)
def _get_negative_feature(model, label, data_pth):
all_nagative_imgs = [data_pth + x for x in os.listdir(data_pth) if x.split('.')[0].split('_')[-1] != str(label)]
random.shuffle(all_nagative_imgs)
return get_feature(all_nagative_imgs[0], model)
def _get_positive_feature(model, label, data_pth):
all_positive_imgs = [data_pth + x for x in os.listdir(data_pth) if x.split('.')[0].split('_')[-1] == str(label)]
random.shuffle(all_positive_imgs)
return get_feature(all_positive_imgs[0], model)
def _get_input_samples(model, labels, data_pth, sample_count=64):
if sample_count % len(labels) != 0:
print('sample_count should times the count of labels')
return
sample_count_for_one_label = int(sample_count / len(labels))
candidate_count_for_one_label = sample_count_for_one_label * 4
anchors, positives, negatives = [], [], []
for label in labels:
_avg_feature, _max_feature_ls, _min_feature_ls = _compute_center_with_label(model, label, data_pth, sample_count=sample_count_for_one_label)
for i in range(len(_max_feature_ls)):
anchors.append(_avg_feature)
if random.randint(1, 10) > 50:
positives.append(_max_feature_ls[i])
# positives.append(_min_feature_ls[i])
else :
positives.append(_get_positive_feature(model, label, data_pth))
negatives.append(_get_negative_feature(model, label, data_pth))
return anchors, positives, negatives
def train(model, optimizer, criterion, epoch, print_freq, data_loader, data_pth):
# model.train()
losses = AverageMeter()
is_add_margin = False
labels_count_in_one_batch = 8
labels_count_for_all = 40
iteration_count = 40
start = time.time()
for _j in range(iteration_count):
for i in range(int(labels_count_for_all / labels_count_in_one_batch)):
start_label = i * labels_count_in_one_batch + 1
model.eval()
feat1, feat2, feat3 = _get_input_samples(model, [x for x in range(start_label, start_label + labels_count_in_one_batch)], data_pth)
model.train()
loss = criterion(torch.stack(feat1), torch.stack(feat2), torch.stack(feat3))
optimizer.zero_grad()
# backward
loss.backward()
optimizer.step()
losses.update(loss.item())
if (_j * int(labels_count_for_all / labels_count_in_one_batch) + i + 1) % print_freq == 0:
print('Epoch: [{}][{}/{}]\t'
'Loss {:.6f} ({:.6f})\t'
.format(epoch, _j * int(labels_count_for_all / labels_count_in_one_batch) + i + 1, iteration_count * int(labels_count_for_all / labels_count_in_one_batch),
losses.val, losses.mean))
if losses.val < 1e-5:
is_add_margin = True
param_group = optimizer.param_groups
print('Epoch: [{}]\tEpoch Time {:.1f} s\tLoss {:.6f}\t'
'Lr {:.2e}'
.format(epoch, (time.time() - start), losses.mean, param_group[0]['lr']))
return is_add_margin
def trainer(data_pth, a, b, _time=0, layers=18):
seed = 0
# dataset options
height, width = 128, 128
# optimization options
optim = 'Adam'
max_epoch = 20
train_batch = 64
test_batch = 64
lr = 0.1
step_size = 40
gamma = 0.1
weight_decay = 5e-4
momentum = 0.9
test_margin = b
margin = a
num_instances = 4
num_gpu = 1
# model options
last_stride = 1
pretrained_model_18 = 'model/resnet18-5c106cde.pth'
pretrained_model_50 = 'model/resnet50-19c8e357.pth'
pretrained_model_34 = 'model/resnet34-333f7ec4.pth'
pretrained_model_101 = 'model/resnet101-5d3b4d8f.pth'
pretrained_model_152 = 'model/resnet152-b121ed2d.pth'
# miscs
print_freq = 10
eval_step = 1
save_dir = 'model/pytorch-ckpt/time%d' % _time
workers = 1
torch.manual_seed(seed)
use_gpu = torch.cuda.is_available()
if use_gpu:
print('currently using GPU')
cudnn.benchmark = True
torch.cuda.manual_seed_all(seed)
else:
print('currently using cpu')
pin_memory = True if use_gpu else False
# model, optim_policy = get_baseline_model(model_path=pretrained_model)
if layers == 18:
model, optim_policy = get_baseline_model(model_path=pretrained_model_18, layers=18)
else:
model, optim_policy = get_baseline_model(model_path=pretrained_model_50, layers=50)
# model, optim_policy = get_baseline_model(model_path=pretrained_model_18, layers=18)
# model, optim_policy = get_baseline_model(model_path=pretrained_model_34, layers=34)
# model, optim_policy = get_baseline_model(model_path=pretrained_model_101, layers=101)
# model = load_model(model, model_path='./model/pytorch-ckpt/87_layers18_margin20_epoch87.tar')
print('model\'s parameters size: {:.5f} M'.format(sum(p.numel() for p in model.parameters()) / 1e6))
tri_criterion = TripletLoss(margin)
# get optimizer
optimizer = torch.optim.Adam(
optim_policy, lr=lr, weight_decay=weight_decay
)
def adjust_lr(optimizer, ep):
if ep < 20:
lr = 1e-4 * (ep + 1) / 2
elif ep < 80:
lr = 1e-3 * num_gpu
elif ep < 180:
lr = 1e-4 * num_gpu
elif ep < 300:
lr = 1e-5 * num_gpu
elif ep < 320:
lr = 1e-5 * 0.1 ** ((ep - 320) / 80) *num_gpu
elif ep < 400:
lr = 1e-6
elif ep < 480:
lr = 1e-4 * num_gpu
else:
lr = 1e-5 * num_gpu
for p in optimizer.param_groups:
p['lr'] = lr
if use_gpu:
model = nn.DataParallel(model).cuda()
max_acc = .0
for epoch in range(max_epoch):
if step_size > 0:
adjust_lr(optimizer, epoch + 1)
next_margin = margin
# skip if not save model
if eval_step > 0 and (epoch + 1) % eval_step == 0 or (epoch + 1) == max_epoch:
_t1 =time.time()
train(model, optimizer, tri_criterion, epoch + 1, print_freq, None, data_pth=data_pth)
_t2 = time.time()
print('time for training:', '%.2f' % (_t2 - _t1), 's')
acc = evaluate_model(model, margin=20, epoch=1)
if acc > max_acc:
max_acc = acc
print('max acc:', max_acc, ', epoch:', epoch + 1)
if use_gpu:
state_dict = model.module.state_dict()
else:
state_dict = model.state_dict()
save_model_name = 'layers{}_margin{}_epoch{}.tar'.format(layers, margin, epoch+1)
save_checkpoint({
'state_dict': state_dict,
'epoch': epoch + 1,
}, is_best=False, save_dir=save_dir, filename=save_model_name)
margin = next_margin
return save_model_name
if __name__ == "__main__":
for _i in range(1):
trainer('/home/ubuntu/Program/xhq/dataset/temp/train_data/', 20, 0, _time=_i, layers=50)
| [
1,
1053,
2897,
29892,
4036,
29892,
10876,
29892,
931,
13,
5215,
4842,
305,
13,
3166,
2897,
1053,
2224,
408,
288,
1028,
13,
3166,
282,
2158,
1053,
282,
2158,
13,
5215,
12655,
408,
7442,
13,
3166,
4842,
305,
1053,
302,
29876,
13,
3166,
4842,
305,
29889,
1627,
1975,
1053,
274,
566,
15755,
13,
5215,
3667,
29879,
29889,
6758,
408,
6410,
13,
3166,
4733,
1053,
679,
29918,
6500,
5570,
29918,
4299,
13,
3166,
3667,
29879,
29889,
2527,
414,
1053,
319,
19698,
29924,
1308,
13,
3166,
3667,
29879,
29889,
6758,
1053,
8602,
552,
29873,
29931,
2209,
13,
3166,
3667,
29879,
29889,
15550,
2133,
1053,
4078,
29918,
3198,
3149,
13,
3166,
1243,
261,
1053,
679,
29918,
14394,
29892,
5839,
280,
29918,
949,
29892,
5839,
280,
29918,
3539,
29892,
1320,
29892,
14707,
29918,
4299,
13,
13,
13,
1753,
2254,
29918,
4299,
29898,
3188,
29918,
4299,
29892,
1904,
29918,
2084,
1125,
13,
1678,
1904,
29918,
15501,
353,
4842,
305,
29889,
1359,
29898,
4299,
29918,
2084,
29897,
13,
1678,
2967,
29918,
4299,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
4299,
29918,
15501,
1839,
3859,
29918,
8977,
11287,
13,
1678,
2967,
29918,
4299,
353,
2967,
29918,
4299,
29889,
29883,
6191,
580,
13,
1678,
1596,
877,
4299,
742,
1904,
29918,
2084,
29889,
5451,
11219,
1495,
14352,
29896,
1402,
525,
15638,
29889,
1495,
13,
1678,
736,
2967,
29918,
4299,
13,
13,
13,
1753,
903,
26017,
29918,
5064,
29918,
2541,
29918,
1643,
29898,
4299,
29892,
3858,
29892,
848,
29918,
29886,
386,
29892,
4559,
29918,
2798,
1125,
13,
1678,
5694,
29918,
978,
353,
19283,
24219,
403,
29918,
2914,
29914,
14394,
29918,
1958,
22584,
29888,
29889,
29886,
6321,
29915,
1273,
931,
29889,
2230,
580,
13,
1678,
19356,
29918,
2492,
29879,
353,
518,
1272,
29918,
29886,
386,
718,
921,
363,
921,
297,
2897,
29889,
1761,
3972,
29898,
1272,
29918,
29886,
386,
29897,
565,
921,
29889,
5451,
12839,
29861,
29900,
1822,
5451,
877,
29918,
1495,
14352,
29896,
29962,
1275,
851,
29898,
1643,
4638,
13,
1678,
4036,
29889,
845,
21897,
29898,
5014,
287,
29918,
2492,
29879,
29897,
13,
1678,
396,
671,
4559,
29918,
2798,
29930,
29946,
14956,
304,
679,
278,
4818,
13,
1678,
363,
10153,
29918,
2084,
297,
19356,
29918,
2492,
29879,
7503,
11249,
29918,
2798,
29930,
29946,
5387,
13,
4706,
285,
353,
679,
29918,
14394,
29898,
2492,
29918,
2084,
29892,
1904,
29897,
13,
4706,
903,
8899,
29918,
22100,
29918,
7382,
29898,
7382,
29918,
978,
29892,
851,
29898,
1643,
511,
285,
29897,
13,
1678,
5446,
353,
5839,
280,
29918,
949,
29898,
7382,
29918,
978,
29897,
13,
13,
1678,
903,
485,
29887,
29918,
14394,
353,
6213,
13,
1678,
363,
903,
29888,
297,
5446,
29961,
710,
29898,
1643,
4638,
29901,
13,
4706,
565,
903,
485,
29887,
29918,
14394,
338,
6213,
29901,
13,
9651,
903,
485,
29887,
29918,
14394,
353,
903,
29888,
13,
4706,
1683,
29901,
13,
9651,
903,
485,
29887,
29918,
14394,
353,
903,
29888,
29889,
1202,
7373,
485,
29887,
29918,
14394,
29897,
13,
1678,
396,
679,
278,
4818,
13,
1678,
903,
485,
29887,
29918,
14394,
847,
29922,
7431,
29898,
5415,
29961,
710,
29898,
1643,
29897,
2314,
13,
13,
1678,
1320,
29918,
8977,
353,
6571,
13,
1678,
363,
903,
29875,
29892,
903,
29888,
297,
26985,
29898,
5415,
29961,
710,
29898,
1643,
4638,
1125,
13,
4706,
903,
29881,
353,
1320,
7373,
485,
29887,
29918,
14394,
29892,
903,
29888,
29897,
13,
4706,
1320,
29918,
8977,
29961,
710,
7373,
29875,
4638,
353,
903,
29881,
13,
1678,
1320,
29918,
8977,
353,
12705,
29898,
5721,
29918,
8977,
29889,
7076,
3285,
1820,
29922,
2892,
270,
29901,
270,
29961,
29896,
2314,
13,
1678,
396,
363,
2380,
29892,
903,
29881,
297,
1320,
29918,
8977,
29901,
13,
1678,
396,
268,
1596,
29898,
2248,
29892,
903,
29881,
29897,
13,
1678,
396,
6876,
29898,
29896,
29900,
29900,
29900,
29897,
13,
13,
1678,
903,
485,
29887,
29918,
14394,
353,
5446,
29961,
710,
29898,
1643,
29897,
3816,
524,
29898,
5721,
29918,
8977,
29961,
29900,
3816,
29900,
2314,
29962,
13,
1678,
903,
3317,
29918,
14394,
29918,
3137,
29892,
903,
1195,
29918,
14394,
29918,
3137,
353,
19997,
5159,
13,
1678,
396,
278,
4682,
411,
2319,
267,
300,
24610,
13,
1678,
363,
2380,
29892,
903,
29881,
297,
1320,
29918,
8977,
29961,
29896,
29901,
11249,
29918,
2798,
29974,
29896,
5387,
13,
4706,
903,
1195,
29918,
14394,
29918,
3137,
29889,
4397,
29898,
5415,
29961,
710,
29898,
1643,
29897,
3816,
524,
29898,
2248,
29897,
2314,
13,
1678,
396,
1906,
411,
10150,
24610,
13,
1678,
363,
2380,
29892,
903,
29881,
297,
1320,
29918,
8977,
14352,
29896,
29930,
11249,
29918,
2798,
29901,
5387,
13,
4706,
903,
3317,
29918,
14394,
29918,
3137,
29889,
4397,
29898,
5415,
29961,
710,
29898,
1643,
29897,
3816,
524,
29898,
2248,
29897,
2314,
13,
13,
1678,
2897,
29889,
5992,
29898,
7382,
29918,
978,
29897,
13,
1678,
736,
903,
485,
29887,
29918,
14394,
29892,
903,
3317,
29918,
14394,
29918,
3137,
29892,
903,
1195,
29918,
14394,
29918,
3137,
13,
13,
13,
1753,
903,
8899,
29918,
22100,
29918,
7382,
29898,
14394,
29918,
1958,
29918,
978,
29892,
3858,
29892,
4682,
1125,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
14394,
29918,
1958,
29918,
978,
1125,
13,
4706,
5446,
353,
5839,
280,
29918,
949,
29898,
14394,
29918,
1958,
29918,
978,
29897,
13,
4706,
5446,
29961,
1643,
1822,
4397,
29898,
14394,
29897,
13,
1678,
1683,
29901,
13,
4706,
5446,
353,
426,
13,
9651,
3858,
29901,
518,
14394,
29962,
13,
4706,
500,
13,
1678,
5839,
280,
29918,
3539,
29898,
14394,
29918,
1958,
29918,
978,
29892,
5446,
29897,
13,
13,
13,
1753,
903,
657,
29918,
22198,
29918,
14394,
29898,
4299,
29892,
3858,
29892,
848,
29918,
29886,
386,
1125,
13,
1678,
599,
29918,
29876,
351,
1230,
29918,
2492,
29879,
353,
518,
1272,
29918,
29886,
386,
718,
921,
363,
921,
297,
2897,
29889,
1761,
3972,
29898,
1272,
29918,
29886,
386,
29897,
565,
921,
29889,
5451,
12839,
29861,
29900,
1822,
5451,
877,
29918,
1495,
14352,
29896,
29962,
2804,
851,
29898,
1643,
4638,
13,
1678,
4036,
29889,
845,
21897,
29898,
497,
29918,
29876,
351,
1230,
29918,
2492,
29879,
29897,
13,
1678,
736,
679,
29918,
14394,
29898,
497,
29918,
29876,
351,
1230,
29918,
2492,
29879,
29961,
29900,
1402,
1904,
29897,
13,
13,
13,
1753,
903,
657,
29918,
1066,
3321,
29918,
14394,
29898,
4299,
29892,
3858,
29892,
848,
29918,
29886,
386,
1125,
13,
1678,
599,
29918,
1066,
3321,
29918,
2492,
29879,
353,
518,
1272,
29918,
29886,
386,
718,
921,
363,
921,
297,
2897,
29889,
1761,
3972,
29898,
1272,
29918,
29886,
386,
29897,
565,
921,
29889,
5451,
12839,
29861,
29900,
1822,
5451,
877,
29918,
1495,
14352,
29896,
29962,
1275,
851,
29898,
1643,
4638,
13,
1678,
4036,
29889,
845,
21897,
29898,
497,
29918,
1066,
3321,
29918,
2492,
29879,
29897,
13,
1678,
736,
679,
29918,
14394,
29898,
497,
29918,
1066,
3321,
29918,
2492,
29879,
29961,
29900,
1402,
1904,
29897,
13,
13,
13,
1753,
903,
657,
29918,
2080,
29918,
27736,
29898,
4299,
29892,
11073,
29892,
848,
29918,
29886,
386,
29892,
4559,
29918,
2798,
29922,
29953,
29946,
1125,
13,
1678,
565,
4559,
29918,
2798,
1273,
7431,
29898,
21134,
29897,
2804,
29871,
29900,
29901,
13,
4706,
1596,
877,
11249,
29918,
2798,
881,
3064,
278,
2302,
310,
11073,
1495,
13,
4706,
736,
13,
1678,
4559,
29918,
2798,
29918,
1454,
29918,
650,
29918,
1643,
353,
938,
29898,
11249,
29918,
2798,
847,
7431,
29898,
21134,
876,
13,
1678,
14020,
29918,
2798,
29918,
1454,
29918,
650,
29918,
1643,
353,
4559,
29918,
2798,
29918,
1454,
29918,
650,
29918,
1643,
334,
29871,
29946,
13,
1678,
23791,
943,
29892,
13686,
3145,
29892,
3480,
5056,
353,
19997,
19997,
5159,
13,
1678,
363,
3858,
297,
11073,
29901,
13,
4706,
903,
485,
29887,
29918,
14394,
29892,
903,
3317,
29918,
14394,
29918,
3137,
29892,
903,
1195,
29918,
14394,
29918,
3137,
353,
903,
26017,
29918,
5064,
29918,
2541,
29918,
1643,
29898,
4299,
29892,
3858,
29892,
848,
29918,
29886,
386,
29892,
4559,
29918,
2798,
29922,
11249,
29918,
2798,
29918,
1454,
29918,
650,
29918,
1643,
29897,
13,
4706,
363,
474,
297,
3464,
29898,
2435,
7373,
3317,
29918,
14394,
29918,
3137,
22164,
13,
9651,
23791,
943,
29889,
4397,
7373,
485,
29887,
29918,
14394,
29897,
13,
9651,
565,
4036,
29889,
9502,
524,
29898,
29896,
29892,
29871,
29896,
29900,
29897,
1405,
29871,
29945,
29900,
29901,
13,
18884,
13686,
3145,
29889,
4397,
7373,
3317,
29918,
14394,
29918,
3137,
29961,
29875,
2314,
13,
18884,
396,
13686,
3145,
29889,
4397,
7373,
1195,
29918,
14394,
29918,
3137,
29961,
29875,
2314,
13,
9651,
1683,
584,
13,
18884,
13686,
3145,
29889,
4397,
7373,
657,
29918,
1066,
3321,
29918,
14394,
29898,
4299,
29892,
3858,
29892,
848,
29918,
29886,
386,
876,
13,
9651,
3480,
5056,
29889,
4397,
7373,
657,
29918,
22198,
29918,
14394,
29898,
4299,
29892,
3858,
29892,
848,
29918,
29886,
386,
876,
13,
1678,
736,
23791,
943,
29892,
13686,
3145,
29892,
3480,
5056,
13,
13,
13,
1753,
7945,
29898,
4299,
29892,
5994,
3950,
29892,
28770,
291,
29892,
21502,
305,
29892,
1596,
29918,
29888,
7971,
29892,
848,
29918,
12657,
29892,
848,
29918,
29886,
386,
1125,
13,
1678,
396,
1904,
29889,
14968,
580,
13,
1678,
28495,
353,
319,
19698,
29924,
1308,
580,
13,
1678,
338,
29918,
1202,
29918,
9264,
353,
7700,
13,
1678,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
353,
29871,
29947,
13,
1678,
11073,
29918,
2798,
29918,
1454,
29918,
497,
353,
29871,
29946,
29900,
13,
1678,
12541,
29918,
2798,
353,
29871,
29946,
29900,
13,
13,
1678,
1369,
353,
931,
29889,
2230,
580,
13,
1678,
363,
903,
29926,
297,
3464,
29898,
1524,
362,
29918,
2798,
1125,
13,
4706,
363,
474,
297,
3464,
29898,
524,
29898,
21134,
29918,
2798,
29918,
1454,
29918,
497,
847,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
22164,
13,
9651,
1369,
29918,
1643,
353,
474,
334,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
718,
29871,
29896,
13,
9651,
1904,
29889,
14513,
580,
13,
9651,
1238,
271,
29896,
29892,
1238,
271,
29906,
29892,
1238,
271,
29941,
353,
903,
657,
29918,
2080,
29918,
27736,
29898,
4299,
29892,
518,
29916,
363,
921,
297,
3464,
29898,
2962,
29918,
1643,
29892,
1369,
29918,
1643,
718,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
29897,
1402,
848,
29918,
29886,
386,
29897,
13,
13,
9651,
1904,
29889,
14968,
580,
13,
9651,
6410,
353,
28770,
291,
29898,
7345,
305,
29889,
1429,
29898,
1725,
271,
29896,
511,
4842,
305,
29889,
1429,
29898,
1725,
271,
29906,
511,
4842,
305,
29889,
1429,
29898,
1725,
271,
29941,
876,
13,
9651,
5994,
3950,
29889,
9171,
29918,
5105,
580,
13,
9651,
396,
1250,
1328,
13,
9651,
6410,
29889,
1627,
1328,
580,
13,
9651,
5994,
3950,
29889,
10568,
580,
13,
9651,
28495,
29889,
5504,
29898,
6758,
29889,
667,
3101,
13,
13,
9651,
565,
9423,
29926,
334,
938,
29898,
21134,
29918,
2798,
29918,
1454,
29918,
497,
847,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
29897,
718,
474,
718,
29871,
29896,
29897,
1273,
1596,
29918,
29888,
7971,
1275,
29871,
29900,
29901,
13,
18884,
1596,
877,
29923,
1129,
305,
29901,
518,
8875,
3816,
29912,
6822,
29912,
6525,
29905,
29873,
29915,
13,
462,
4706,
525,
29931,
2209,
12365,
29889,
29953,
29888,
29913,
21313,
29901,
29889,
29953,
29888,
11606,
29873,
29915,
13,
462,
3986,
869,
4830,
29898,
1022,
2878,
29892,
903,
29926,
334,
938,
29898,
21134,
29918,
2798,
29918,
1454,
29918,
497,
847,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
29897,
718,
474,
718,
29871,
29896,
29892,
12541,
29918,
2798,
334,
938,
29898,
21134,
29918,
2798,
29918,
1454,
29918,
497,
847,
11073,
29918,
2798,
29918,
262,
29918,
650,
29918,
16175,
511,
13,
462,
462,
29871,
28495,
29889,
791,
29892,
28495,
29889,
12676,
876,
13,
9651,
565,
28495,
29889,
791,
529,
29871,
29896,
29872,
29899,
29945,
29901,
13,
18884,
338,
29918,
1202,
29918,
9264,
353,
5852,
13,
13,
1678,
1828,
29918,
2972,
353,
5994,
3950,
29889,
3207,
29918,
13155,
13,
1678,
1596,
877,
29923,
1129,
305,
29901,
15974,
6525,
29905,
29873,
29923,
1129,
305,
5974,
12365,
29889,
29896,
29888,
29913,
269,
29905,
29873,
29931,
2209,
12365,
29889,
29953,
29888,
1012,
29873,
29915,
13,
795,
525,
29931,
29878,
12365,
29889,
29906,
29872,
10162,
13,
795,
869,
4830,
29898,
1022,
2878,
29892,
313,
2230,
29889,
2230,
580,
448,
1369,
511,
28495,
29889,
12676,
29892,
1828,
29918,
2972,
29961,
29900,
22322,
29212,
25901,
13,
1678,
736,
338,
29918,
1202,
29918,
9264,
13,
13,
13,
1753,
1020,
4983,
29898,
1272,
29918,
29886,
386,
29892,
263,
29892,
289,
29892,
903,
2230,
29922,
29900,
29892,
15359,
29922,
29896,
29947,
1125,
13,
1678,
16717,
353,
29871,
29900,
13,
1678,
396,
8783,
3987,
13,
1678,
3171,
29892,
2920,
353,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
13,
1678,
396,
13883,
3987,
13,
1678,
5994,
353,
525,
3253,
314,
29915,
13,
1678,
4236,
29918,
1022,
2878,
353,
29871,
29906,
29900,
13,
1678,
7945,
29918,
16175,
353,
29871,
29953,
29946,
13,
1678,
1243,
29918,
16175,
353,
29871,
29953,
29946,
13,
1678,
301,
29878,
353,
29871,
29900,
29889,
29896,
13,
1678,
4331,
29918,
2311,
353,
29871,
29946,
29900,
13,
1678,
330,
2735,
353,
29871,
29900,
29889,
29896,
13,
1678,
7688,
29918,
7099,
388,
353,
29871,
29945,
29872,
29899,
29946,
13,
1678,
19399,
353,
29871,
29900,
29889,
29929,
13,
1678,
1243,
29918,
9264,
353,
289,
13,
1678,
5906,
353,
263,
13,
1678,
954,
29918,
2611,
2925,
353,
29871,
29946,
13,
1678,
954,
29918,
29887,
3746,
353,
29871,
29896,
13,
1678,
396,
1904,
3987,
13,
1678,
1833,
29918,
303,
2426,
353,
29871,
29896,
13,
1678,
758,
3018,
1312,
29918,
4299,
29918,
29896,
29947,
353,
525,
4299,
29914,
690,
1212,
29896,
29947,
29899,
29945,
29883,
29896,
29900,
29953,
29883,
311,
29889,
29886,
386,
29915,
13,
1678,
758,
3018,
1312,
29918,
4299,
29918,
29945,
29900,
353,
525,
4299,
29914,
690,
1212,
29945,
29900,
29899,
29896,
29929,
29883,
29947,
29872,
29941,
29945,
29955,
29889,
29886,
386,
29915,
13,
1678,
758,
3018,
1312,
29918,
4299,
29918,
29941,
29946,
353,
525,
4299,
29914,
690,
1212,
29941,
29946,
29899,
29941,
29941,
29941,
29888,
29955,
687,
29946,
29889,
29886,
386,
29915,
13,
1678,
758,
3018,
1312,
29918,
4299,
29918,
29896,
29900,
29896,
353,
525,
4299,
29914,
690,
1212,
29896,
29900,
29896,
29899,
29945,
29881,
29941,
29890,
29946,
29881,
29947,
29888,
29889,
29886,
386,
29915,
13,
1678,
758,
3018,
1312,
29918,
4299,
29918,
29896,
29945,
29906,
353,
525,
4299,
29914,
690,
1212,
29896,
29945,
29906,
29899,
29890,
29896,
29906,
29896,
287,
29906,
29881,
29889,
29886,
386,
29915,
13,
1678,
396,
3984,
2395,
13,
1678,
1596,
29918,
29888,
7971,
353,
29871,
29896,
29900,
13,
1678,
19745,
29918,
10568,
353,
29871,
29896,
13,
1678,
4078,
29918,
3972,
353,
525,
4299,
29914,
2272,
7345,
305,
29899,
384,
415,
29914,
2230,
29995,
29881,
29915,
1273,
903,
2230,
13,
1678,
17162,
353,
29871,
29896,
13,
13,
1678,
4842,
305,
29889,
11288,
29918,
26776,
29898,
26776,
29897,
13,
1678,
671,
29918,
29887,
3746,
353,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
13,
1678,
565,
671,
29918,
29887,
3746,
29901,
13,
4706,
1596,
877,
3784,
368,
773,
22796,
1495,
13,
4706,
274,
566,
15755,
29889,
1785,
16580,
353,
5852,
13,
4706,
4842,
305,
29889,
29883,
6191,
29889,
11288,
29918,
26776,
29918,
497,
29898,
26776,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
877,
3784,
368,
773,
26403,
1495,
13,
13,
1678,
12534,
29918,
14834,
353,
5852,
565,
671,
29918,
29887,
3746,
1683,
7700,
13,
13,
1678,
396,
1904,
29892,
5994,
29918,
22197,
353,
679,
29918,
6500,
5570,
29918,
4299,
29898,
4299,
29918,
2084,
29922,
1457,
3018,
1312,
29918,
4299,
29897,
13,
1678,
565,
15359,
1275,
29871,
29896,
29947,
29901,
13,
4706,
1904,
29892,
5994,
29918,
22197,
353,
679,
29918,
6500,
5570,
29918,
4299,
29898,
4299,
29918,
2084,
29922,
1457,
3018,
1312,
29918,
4299,
29918,
29896,
29947,
29892,
15359,
29922,
29896,
29947,
29897,
13,
1678,
1683,
29901,
13,
4706,
1904,
29892,
5994,
29918,
22197,
353,
679,
29918,
6500,
5570,
29918,
4299,
29898,
4299,
29918,
2084,
29922,
1457,
3018,
1312,
29918,
4299,
29918,
29945,
29900,
29892,
15359,
29922,
29945,
29900,
29897,
13,
1678,
396,
1904,
29892,
5994,
29918,
22197,
353,
679,
29918,
6500,
5570,
29918,
4299,
29898,
4299,
29918,
2084,
29922,
1457,
3018,
1312,
29918,
4299,
29918,
29896,
29947,
29892,
15359,
29922,
29896,
29947,
29897,
13,
1678,
396,
1904,
29892,
5994,
29918,
22197,
353,
679,
29918,
6500,
5570,
29918,
4299,
29898,
4299,
29918,
2084,
29922,
1457,
3018,
1312,
29918,
4299,
29918,
29941,
29946,
29892,
15359,
29922,
29941,
29946,
29897,
13,
1678,
396,
1904,
29892,
5994,
29918,
22197,
353,
679,
29918,
6500,
5570,
29918,
4299,
29898,
4299,
29918,
2084,
29922,
1457,
3018,
1312,
29918,
4299,
29918,
29896,
29900,
29896,
29892,
15359,
29922,
29896,
29900,
29896,
29897,
13,
1678,
396,
1904,
353,
2254,
29918,
4299,
29898,
4299,
29892,
1904,
29918,
2084,
2433,
6904,
4299,
29914,
2272,
7345,
305,
29899,
384,
415,
29914,
29947,
29955,
29918,
29277,
29896,
29947,
29918,
9264,
29906,
29900,
29918,
1022,
2878,
29947,
29955,
29889,
12637,
1495,
13,
1678,
1596,
877,
4299,
20333,
29879,
4128,
2159,
29901,
12365,
29889,
29945,
29888,
29913,
341,
4286,
4830,
29898,
2083,
29898,
29886,
29889,
1949,
295,
580,
363,
282,
297,
1904,
29889,
16744,
3101,
847,
29871,
29896,
29872,
29953,
876,
13,
13,
1678,
3367,
29918,
29883,
5385,
291,
353,
8602,
552,
29873,
29931,
2209,
29898,
9264,
29897,
13,
13,
1678,
396,
679,
5994,
3950,
13,
1678,
5994,
3950,
353,
4842,
305,
29889,
20640,
29889,
3253,
314,
29898,
13,
4706,
5994,
29918,
22197,
29892,
301,
29878,
29922,
29212,
29892,
7688,
29918,
7099,
388,
29922,
7915,
29918,
7099,
388,
13,
1678,
1723,
13,
13,
1678,
822,
10365,
29918,
29212,
29898,
20640,
3950,
29892,
9358,
1125,
13,
4706,
565,
9358,
529,
29871,
29906,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29946,
334,
313,
1022,
718,
29871,
29896,
29897,
847,
29871,
29906,
13,
4706,
25342,
9358,
529,
29871,
29947,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29941,
334,
954,
29918,
29887,
3746,
13,
4706,
25342,
9358,
529,
29871,
29896,
29947,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29946,
334,
954,
29918,
29887,
3746,
13,
4706,
25342,
9358,
529,
29871,
29941,
29900,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29945,
334,
954,
29918,
29887,
3746,
13,
4706,
25342,
9358,
529,
29871,
29941,
29906,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29945,
334,
29871,
29900,
29889,
29896,
3579,
5135,
1022,
448,
29871,
29941,
29906,
29900,
29897,
847,
29871,
29947,
29900,
29897,
334,
1949,
29918,
29887,
3746,
13,
4706,
25342,
9358,
529,
29871,
29946,
29900,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29953,
13,
4706,
25342,
9358,
529,
29871,
29946,
29947,
29900,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29946,
334,
954,
29918,
29887,
3746,
13,
4706,
1683,
29901,
13,
9651,
301,
29878,
353,
29871,
29896,
29872,
29899,
29945,
334,
954,
29918,
29887,
3746,
13,
4706,
363,
282,
297,
5994,
3950,
29889,
3207,
29918,
13155,
29901,
13,
9651,
282,
1839,
29212,
2033,
353,
301,
29878,
13,
13,
1678,
565,
671,
29918,
29887,
3746,
29901,
13,
4706,
1904,
353,
302,
29876,
29889,
1469,
2177,
6553,
29898,
4299,
467,
29883,
6191,
580,
13,
13,
1678,
4236,
29918,
5753,
353,
869,
29900,
13,
1678,
363,
21502,
305,
297,
3464,
29898,
3317,
29918,
1022,
2878,
1125,
13,
4706,
565,
4331,
29918,
2311,
1405,
29871,
29900,
29901,
13,
9651,
10365,
29918,
29212,
29898,
20640,
3950,
29892,
21502,
305,
718,
29871,
29896,
29897,
13,
4706,
2446,
29918,
9264,
353,
5906,
13,
4706,
396,
14383,
565,
451,
4078,
1904,
13,
4706,
565,
19745,
29918,
10568,
1405,
29871,
29900,
322,
313,
1022,
2878,
718,
29871,
29896,
29897,
1273,
19745,
29918,
10568,
1275,
29871,
29900,
470,
313,
1022,
2878,
718,
29871,
29896,
29897,
1275,
4236,
29918,
1022,
2878,
29901,
13,
9651,
903,
29873,
29896,
353,
2230,
29889,
2230,
580,
13,
9651,
7945,
29898,
4299,
29892,
5994,
3950,
29892,
3367,
29918,
29883,
5385,
291,
29892,
21502,
305,
718,
29871,
29896,
29892,
1596,
29918,
29888,
7971,
29892,
6213,
29892,
848,
29918,
29886,
386,
29922,
1272,
29918,
29886,
386,
29897,
13,
9651,
903,
29873,
29906,
353,
931,
29889,
2230,
580,
13,
9651,
1596,
877,
2230,
363,
6694,
29901,
742,
14210,
29889,
29906,
29888,
29915,
1273,
9423,
29873,
29906,
448,
903,
29873,
29896,
511,
525,
29879,
1495,
13,
13,
9651,
1035,
353,
14707,
29918,
4299,
29898,
4299,
29892,
5906,
29922,
29906,
29900,
29892,
21502,
305,
29922,
29896,
29897,
13,
9651,
565,
1035,
1405,
4236,
29918,
5753,
29901,
13,
18884,
4236,
29918,
5753,
353,
1035,
13,
18884,
1596,
877,
3317,
1035,
29901,
742,
4236,
29918,
5753,
29892,
13420,
21502,
305,
29901,
742,
21502,
305,
718,
29871,
29896,
29897,
13,
18884,
565,
671,
29918,
29887,
3746,
29901,
13,
462,
1678,
2106,
29918,
8977,
353,
1904,
29889,
5453,
29889,
3859,
29918,
8977,
580,
13,
18884,
1683,
29901,
13,
462,
1678,
2106,
29918,
8977,
353,
1904,
29889,
3859,
29918,
8977,
580,
13,
13,
18884,
4078,
29918,
4299,
29918,
978,
353,
525,
29277,
29912,
2403,
9264,
29912,
2403,
1022,
2878,
29912,
1836,
12637,
4286,
4830,
29898,
29277,
29892,
5906,
29892,
21502,
305,
29974,
29896,
29897,
13,
18884,
4078,
29918,
3198,
3149,
3319,
13,
462,
1678,
525,
3859,
29918,
8977,
2396,
2106,
29918,
8977,
29892,
13,
462,
1678,
525,
1022,
2878,
2396,
21502,
305,
718,
29871,
29896,
29892,
13,
18884,
2981,
338,
29918,
13318,
29922,
8824,
29892,
4078,
29918,
3972,
29922,
7620,
29918,
3972,
29892,
10422,
29922,
7620,
29918,
4299,
29918,
978,
29897,
13,
13,
9651,
5906,
353,
2446,
29918,
9264,
13,
1678,
736,
4078,
29918,
4299,
29918,
978,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
363,
903,
29875,
297,
3464,
29898,
29896,
1125,
13,
4706,
1020,
4983,
11219,
5184,
29914,
8767,
29914,
9283,
29914,
29916,
29882,
29939,
29914,
24713,
29914,
7382,
29914,
14968,
29918,
1272,
29914,
742,
29871,
29906,
29900,
29892,
29871,
29900,
29892,
903,
2230,
29922,
29918,
29875,
29892,
15359,
29922,
29945,
29900,
29897,
13,
2
] |
care/facility/migrations/0010_auto_20200321_0758.py | tucosaurus/care | 189 | 1617112 | <reponame>tucosaurus/care<filename>care/facility/migrations/0010_auto_20200321_0758.py
# Generated by Django 2.2.11 on 2020-03-21 07:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('facility', '0009_auto_20200320_1850'),
]
operations = [
migrations.AlterField(
model_name='hospitaldoctors',
name='area',
field=models.IntegerField(choices=[(1, 'General Medicine'), (2, 'Pulmonology'), (3, 'Critical Care'), (4, 'Paediatrics')]),
),
]
| [
1,
529,
276,
1112,
420,
29958,
29873,
1682,
3628,
17142,
29914,
18020,
29966,
9507,
29958,
18020,
29914,
17470,
1793,
29914,
26983,
800,
29914,
29900,
29900,
29896,
29900,
29918,
6921,
29918,
29906,
29900,
29906,
29900,
29900,
29941,
29906,
29896,
29918,
29900,
29955,
29945,
29947,
29889,
2272,
13,
29937,
3251,
630,
491,
15337,
29871,
29906,
29889,
29906,
29889,
29896,
29896,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29941,
29899,
29906,
29896,
29871,
29900,
29955,
29901,
29945,
29947,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
17470,
1793,
742,
525,
29900,
29900,
29900,
29929,
29918,
6921,
29918,
29906,
29900,
29906,
29900,
29900,
29941,
29906,
29900,
29918,
29896,
29947,
29945,
29900,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
29882,
8189,
1867,
14359,
742,
13,
9651,
1024,
2433,
6203,
742,
13,
9651,
1746,
29922,
9794,
29889,
7798,
3073,
29898,
1859,
1575,
11759,
29898,
29896,
29892,
525,
15263,
27529,
5477,
313,
29906,
29892,
525,
29925,
352,
3712,
3002,
5477,
313,
29941,
29892,
525,
29907,
768,
936,
10057,
5477,
313,
29946,
29892,
525,
11868,
287,
7163,
10817,
1495,
11724,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
cepan/_utils.py | kanga333/cepan | 1 | 178845 | <filename>cepan/_utils.py
from typing import Any, Callable, Dict, Iterator, Optional
import boto3
def client(
service: str,
session: Optional[boto3.Session] = None,
) -> boto3.client:
if session is None:
return boto3.client(service)
return session.client(service)
def call_with_pagination(
client: boto3.client,
func_name: str,
args: Dict[str, Any],
) -> Iterator[Dict[str, Any]]:
func: Callable[..., Dict[str, Any]] = getattr(client, func_name)
response: Dict[str, Any] = func(**args)
yield response
token_key: Optional[str] = None
if "NextToken" in response:
token_key = "NextToken"
if "NextPageToken" in response:
token_key = "NextPageToken"
while token_key in response:
args[token_key] = response[token_key]
response = func(**args)
yield response
| [
1,
529,
9507,
29958,
346,
8357,
19891,
13239,
29889,
2272,
13,
3166,
19229,
1053,
3139,
29892,
8251,
519,
29892,
360,
919,
29892,
20504,
1061,
29892,
28379,
13,
13,
5215,
289,
3747,
29941,
13,
13,
13,
1753,
3132,
29898,
13,
1678,
2669,
29901,
851,
29892,
13,
1678,
4867,
29901,
28379,
29961,
29890,
3747,
29941,
29889,
7317,
29962,
353,
6213,
29892,
13,
29897,
1599,
289,
3747,
29941,
29889,
4645,
29901,
13,
1678,
565,
4867,
338,
6213,
29901,
13,
4706,
736,
289,
3747,
29941,
29889,
4645,
29898,
5509,
29897,
13,
13,
1678,
736,
4867,
29889,
4645,
29898,
5509,
29897,
13,
13,
13,
1753,
1246,
29918,
2541,
29918,
13573,
3381,
29898,
13,
1678,
3132,
29901,
289,
3747,
29941,
29889,
4645,
29892,
13,
1678,
3653,
29918,
978,
29901,
851,
29892,
13,
1678,
6389,
29901,
360,
919,
29961,
710,
29892,
3139,
1402,
13,
29897,
1599,
20504,
1061,
29961,
21533,
29961,
710,
29892,
3139,
5262,
29901,
13,
1678,
3653,
29901,
8251,
519,
29961,
16361,
360,
919,
29961,
710,
29892,
3139,
5262,
353,
679,
5552,
29898,
4645,
29892,
3653,
29918,
978,
29897,
13,
1678,
2933,
29901,
360,
919,
29961,
710,
29892,
3139,
29962,
353,
3653,
29898,
1068,
5085,
29897,
13,
1678,
7709,
2933,
13,
1678,
5993,
29918,
1989,
29901,
28379,
29961,
710,
29962,
353,
6213,
13,
1678,
565,
376,
9190,
6066,
29908,
297,
2933,
29901,
13,
4706,
5993,
29918,
1989,
353,
376,
9190,
6066,
29908,
13,
1678,
565,
376,
9190,
5074,
6066,
29908,
297,
2933,
29901,
13,
4706,
5993,
29918,
1989,
353,
376,
9190,
5074,
6066,
29908,
13,
1678,
1550,
5993,
29918,
1989,
297,
2933,
29901,
13,
4706,
6389,
29961,
6979,
29918,
1989,
29962,
353,
2933,
29961,
6979,
29918,
1989,
29962,
13,
4706,
2933,
353,
3653,
29898,
1068,
5085,
29897,
13,
4706,
7709,
2933,
13,
2
] |
src/ai/backend/kernel/git/__init__.py | hephaex/backend.ai-kernel-runner | 1 | 157332 | import asyncio
import json
import logging
import os
from pathlib import Path
import re
import subprocess
# import pygit2
# from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE
from .. import BaseRunner, Terminal
log = logging.getLogger()
CHILD_ENV = {
'TERM': 'xterm',
'LANG': 'C.UTF-8',
'SHELL': '/bin/bash',
'USER': 'work',
'HOME': '/home/work',
'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
'LD_PRELOAD': os.environ.get('LD_PRELOAD', '/home/sorna/libbaihook.so'),
}
class Runner(BaseRunner):
log_prefix = 'shell-kernel'
def __init__(self):
super().__init__()
self.child_env.update(CHILD_ENV)
async def init_with_loop(self):
self.user_input_queue = asyncio.Queue()
self.term = Terminal(
'/bin/bash',
self.stopped, self.outsock,
auto_restart=True,
)
parser_show = self.term.subparsers.add_parser('show')
parser_show.add_argument('target', choices=('graph',), default='graph')
parser_show.add_argument('path', type=str)
parser_show.set_defaults(func=self.do_show)
await self.term.start()
async def build_heuristic(self) -> int:
raise NotImplementedError
async def execute_heuristic(self) -> int:
raise NotImplementedError
async def query(self, code_text) -> int:
return await self.term.handle_command(code_text)
async def complete(self, data):
return []
async def interrupt(self):
# subproc interrupt is already handled by BaseRunner
pass
async def shutdown(self):
await self.term.shutdown()
def do_show(self, args):
if args.target == 'graph':
commit_branch_table = {}
commit_info = []
if args.path in ['.', None]:
current_dir = Path(f'/proc/{self.term.pid}/cwd').resolve()
else:
current_dir = Path(args.path).resolve()
os.chdir(current_dir)
# Create commit-branch matching table.
tree_cmd = ['git', 'log', '--pretty=oneline', '--graph',
'--source', '--branches']
run_res = subprocess.run(tree_cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout = run_res.stdout.decode('utf-8')
stderr = run_res.stderr.decode('utf-8')
prog = re.compile(r'([a-z0-9]+)\s+(\S+).*')
if stderr:
self.outsock.send_multipart([b'stderr', stderr.encode('utf-8')])
return
for line in stdout.split('\n'):
r = prog.search(line)
if r and hasattr(r, 'group') and r.group(1) and r.group(2):
oid = r.group(1)[:7] # short oid
branch = r.group(2)
commit_branch_table[oid] = branch
# Gather commit info w/ branch name.
log_cmd = ['git', 'log', '--pretty=format:%h||%p||%s||%cn',
'--all', '--topo-order', '--reverse']
run_res = subprocess.run(log_cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout = run_res.stdout.decode('utf-8')
for gitlog in stdout.split('\n'):
items = gitlog.split('||')
oid = items[0]
parent_ids = items[1].split(' ')
message = items[2]
author = items[3]
branch = commit_branch_table.get(oid, None)
parent_branches = [commit_branch_table.get(pid, None)
for pid in parent_ids]
info = dict(
oid=oid,
parent_ids=parent_ids,
author=author,
message=message,
branch=branch,
parent_branches=parent_branches
)
commit_info.append(info)
self.outsock.send_multipart([
b'media',
json.dumps({
'type': 'application/vnd.sorna.gitgraph',
'data': commit_info
}).encode('utf-8')
])
else:
raise ValueError('Unsupported show target', args.target)
| [
1,
1053,
408,
948,
3934,
13,
5215,
4390,
13,
5215,
12183,
13,
5215,
2897,
13,
3166,
2224,
1982,
1053,
10802,
13,
5215,
337,
13,
5215,
1014,
5014,
13,
13,
29937,
1053,
19484,
277,
29906,
13,
29937,
515,
19484,
277,
29906,
1053,
402,
1806,
29918,
29903,
8476,
29918,
29911,
4590,
29949,
14480,
2965,
1964,
29892,
402,
1806,
29918,
29903,
8476,
29918,
1525,
5348,
1660,
13,
13,
3166,
6317,
1053,
7399,
16802,
29892,
29175,
13,
13,
1188,
353,
12183,
29889,
657,
16363,
580,
13,
13,
3210,
6227,
29928,
29918,
25838,
353,
426,
13,
1678,
525,
4945,
29924,
2396,
525,
29916,
8489,
742,
13,
1678,
525,
29931,
19453,
2396,
525,
29907,
29889,
10496,
29899,
29947,
742,
13,
1678,
525,
7068,
29923,
2208,
2396,
8207,
2109,
29914,
13067,
742,
13,
1678,
525,
11889,
2396,
525,
1287,
742,
13,
1678,
525,
17353,
2396,
8207,
5184,
29914,
1287,
742,
13,
1678,
525,
10145,
2396,
8207,
4855,
29914,
2997,
29914,
29879,
2109,
8419,
4855,
29914,
2997,
29914,
2109,
8419,
4855,
29914,
29879,
2109,
8419,
4855,
29914,
2109,
8419,
29879,
2109,
8419,
2109,
742,
13,
1678,
525,
10249,
29918,
15094,
29428,
2396,
2897,
29889,
21813,
29889,
657,
877,
10249,
29918,
15094,
29428,
742,
8207,
5184,
29914,
29879,
272,
1056,
29914,
492,
1327,
1794,
20849,
29889,
578,
5477,
13,
29913,
13,
13,
13,
1990,
7525,
1089,
29898,
5160,
16802,
1125,
13,
13,
1678,
1480,
29918,
13506,
353,
525,
15903,
29899,
17460,
29915,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
5145,
29918,
6272,
29889,
5504,
29898,
3210,
6227,
29928,
29918,
25838,
29897,
13,
13,
1678,
7465,
822,
2069,
29918,
2541,
29918,
7888,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1792,
29918,
2080,
29918,
9990,
353,
408,
948,
3934,
29889,
10620,
580,
13,
4706,
1583,
29889,
8489,
353,
29175,
29898,
13,
9651,
8207,
2109,
29914,
13067,
742,
13,
9651,
1583,
29889,
7864,
2986,
29892,
1583,
29889,
449,
21852,
29892,
13,
9651,
4469,
29918,
5060,
442,
29922,
5574,
29892,
13,
4706,
1723,
13,
13,
4706,
13812,
29918,
4294,
353,
1583,
29889,
8489,
29889,
1491,
862,
4253,
29889,
1202,
29918,
16680,
877,
4294,
1495,
13,
4706,
13812,
29918,
4294,
29889,
1202,
29918,
23516,
877,
5182,
742,
19995,
29922,
877,
4262,
742,
511,
2322,
2433,
4262,
1495,
13,
4706,
13812,
29918,
4294,
29889,
1202,
29918,
23516,
877,
2084,
742,
1134,
29922,
710,
29897,
13,
4706,
13812,
29918,
4294,
29889,
842,
29918,
4381,
29879,
29898,
9891,
29922,
1311,
29889,
1867,
29918,
4294,
29897,
13,
13,
4706,
7272,
1583,
29889,
8489,
29889,
2962,
580,
13,
13,
1678,
7465,
822,
2048,
29918,
354,
332,
4695,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
7465,
822,
6222,
29918,
354,
332,
4695,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
7465,
822,
2346,
29898,
1311,
29892,
775,
29918,
726,
29897,
1599,
938,
29901,
13,
4706,
736,
7272,
1583,
29889,
8489,
29889,
8411,
29918,
6519,
29898,
401,
29918,
726,
29897,
13,
13,
1678,
7465,
822,
4866,
29898,
1311,
29892,
848,
1125,
13,
4706,
736,
5159,
13,
13,
1678,
7465,
822,
23754,
29898,
1311,
1125,
13,
4706,
396,
1014,
15439,
23754,
338,
2307,
16459,
491,
7399,
16802,
13,
4706,
1209,
13,
13,
1678,
7465,
822,
12522,
3204,
29898,
1311,
1125,
13,
4706,
7272,
1583,
29889,
8489,
29889,
845,
329,
3204,
580,
13,
13,
1678,
822,
437,
29918,
4294,
29898,
1311,
29892,
6389,
1125,
13,
4706,
565,
6389,
29889,
5182,
1275,
525,
4262,
2396,
13,
9651,
9063,
29918,
17519,
29918,
2371,
353,
6571,
13,
9651,
9063,
29918,
3888,
353,
5159,
13,
13,
9651,
565,
6389,
29889,
2084,
297,
518,
4286,
742,
6213,
5387,
13,
18884,
1857,
29918,
3972,
353,
10802,
29898,
29888,
29915,
29914,
15439,
19248,
1311,
29889,
8489,
29889,
5935,
6822,
29883,
9970,
2824,
17863,
580,
13,
9651,
1683,
29901,
13,
18884,
1857,
29918,
3972,
353,
10802,
29898,
5085,
29889,
2084,
467,
17863,
580,
13,
9651,
2897,
29889,
305,
3972,
29898,
3784,
29918,
3972,
29897,
13,
13,
9651,
396,
6204,
9063,
29899,
17519,
9686,
1591,
29889,
13,
9651,
5447,
29918,
9006,
353,
6024,
5559,
742,
525,
1188,
742,
525,
489,
1457,
4349,
29922,
265,
5570,
742,
525,
489,
4262,
742,
13,
462,
4706,
525,
489,
4993,
742,
525,
489,
17519,
267,
2033,
13,
9651,
1065,
29918,
690,
353,
1014,
5014,
29889,
3389,
29898,
8336,
29918,
9006,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
13,
462,
462,
268,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29897,
13,
9651,
27591,
353,
1065,
29918,
690,
29889,
25393,
29889,
13808,
877,
9420,
29899,
29947,
1495,
13,
9651,
380,
20405,
353,
1065,
29918,
690,
29889,
303,
20405,
29889,
13808,
877,
9420,
29899,
29947,
1495,
13,
9651,
410,
29887,
353,
337,
29889,
12198,
29898,
29878,
29915,
4197,
29874,
29899,
29920,
29900,
29899,
29929,
10062,
2144,
29879,
29974,
1194,
29903,
29974,
467,
29930,
1495,
13,
9651,
565,
380,
20405,
29901,
13,
18884,
1583,
29889,
449,
21852,
29889,
6717,
29918,
18056,
442,
4197,
29890,
29915,
303,
20405,
742,
380,
20405,
29889,
12508,
877,
9420,
29899,
29947,
1495,
2314,
13,
18884,
736,
13,
13,
9651,
363,
1196,
297,
27591,
29889,
5451,
28909,
29876,
29374,
13,
18884,
364,
353,
410,
29887,
29889,
4478,
29898,
1220,
29897,
13,
18884,
565,
364,
322,
756,
5552,
29898,
29878,
29892,
525,
2972,
1495,
322,
364,
29889,
2972,
29898,
29896,
29897,
322,
364,
29889,
2972,
29898,
29906,
1125,
13,
462,
1678,
288,
333,
353,
364,
29889,
2972,
29898,
29896,
29897,
7503,
29955,
29962,
29871,
396,
3273,
288,
333,
13,
462,
1678,
5443,
353,
364,
29889,
2972,
29898,
29906,
29897,
13,
462,
1678,
9063,
29918,
17519,
29918,
2371,
29961,
3398,
29962,
353,
5443,
13,
13,
9651,
396,
402,
1624,
9063,
5235,
281,
29914,
5443,
1024,
29889,
13,
9651,
1480,
29918,
9006,
353,
6024,
5559,
742,
525,
1188,
742,
525,
489,
1457,
4349,
29922,
4830,
16664,
29882,
8876,
29995,
29886,
8876,
29995,
29879,
8876,
29995,
18038,
742,
13,
462,
539,
525,
489,
497,
742,
525,
489,
3332,
29877,
29899,
2098,
742,
525,
489,
24244,
2033,
13,
9651,
1065,
29918,
690,
353,
1014,
5014,
29889,
3389,
29898,
1188,
29918,
9006,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
13,
462,
462,
268,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29897,
13,
9651,
27591,
353,
1065,
29918,
690,
29889,
25393,
29889,
13808,
877,
9420,
29899,
29947,
1495,
13,
9651,
363,
6315,
1188,
297,
27591,
29889,
5451,
28909,
29876,
29374,
13,
18884,
4452,
353,
6315,
1188,
29889,
5451,
877,
8876,
1495,
13,
18884,
288,
333,
353,
4452,
29961,
29900,
29962,
13,
18884,
3847,
29918,
4841,
353,
4452,
29961,
29896,
1822,
5451,
877,
25710,
13,
18884,
2643,
353,
4452,
29961,
29906,
29962,
13,
18884,
4148,
353,
4452,
29961,
29941,
29962,
13,
18884,
5443,
353,
9063,
29918,
17519,
29918,
2371,
29889,
657,
29898,
3398,
29892,
6213,
29897,
13,
18884,
3847,
29918,
17519,
267,
353,
518,
15060,
29918,
17519,
29918,
2371,
29889,
657,
29898,
5935,
29892,
6213,
29897,
13,
462,
462,
259,
363,
23107,
297,
3847,
29918,
4841,
29962,
13,
18884,
5235,
353,
9657,
29898,
13,
462,
1678,
288,
333,
29922,
3398,
29892,
13,
462,
1678,
3847,
29918,
4841,
29922,
3560,
29918,
4841,
29892,
13,
462,
1678,
4148,
29922,
8921,
29892,
13,
462,
1678,
2643,
29922,
4906,
29892,
13,
462,
1678,
5443,
29922,
17519,
29892,
13,
462,
1678,
3847,
29918,
17519,
267,
29922,
3560,
29918,
17519,
267,
13,
18884,
1723,
13,
18884,
9063,
29918,
3888,
29889,
4397,
29898,
3888,
29897,
13,
13,
9651,
1583,
29889,
449,
21852,
29889,
6717,
29918,
18056,
442,
4197,
13,
18884,
289,
29915,
9799,
742,
13,
18884,
4390,
29889,
29881,
17204,
3319,
13,
462,
1678,
525,
1853,
2396,
525,
6214,
29914,
29894,
299,
29889,
29879,
272,
1056,
29889,
5559,
4262,
742,
13,
462,
1678,
525,
1272,
2396,
9063,
29918,
3888,
13,
18884,
22719,
12508,
877,
9420,
29899,
29947,
1495,
13,
632,
2314,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
877,
25807,
29884,
3016,
287,
1510,
3646,
742,
6389,
29889,
5182,
29897,
13,
2
] |
code/bp_chrono/pull.py | niplav/site | 2 | 170857 | <gh_stars>1-10
import urllib2
from bs4 import BeautifulSoup
import sys
import datetime
for year in range(2006, datetime.datetime.now().year+1):
yearposts=[]
for page in range(1, 1000):
url='http://bit-player.org/{}/page/{}'.format(year, page)
req=urllib2.Request(url, headers={'User-Agent' : "Firefox"})
try:
con=urllib2.urlopen(req)
except urllib2.HTTPError, e:
break
data=con.read()
soup=BeautifulSoup(data, 'html.parser')
posts=soup.find_all(class_="post")
for p in posts:
title=p.find_all(class_="entry-title")[0].a.text
link=p.find_all(class_="entry-title")[0].a.get('href')
meta=p.find_all(class_="entry-meta")
author=p.find_all(class_="entry-meta")[0].find_all(class_='author')[0].a.text
date=p.find_all(class_="entry-meta")[0].find_all(class_='entry-date')[0].text
entry='* [{}]({}) ({}, {})'.format(title.encode('utf_8'), str(link), str(author), str(date))
yearposts.append(entry)
print('\n### {}\n'.format(year))
for t in reversed(yearposts):
print(t)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
3142,
1982,
29906,
13,
3166,
24512,
29946,
1053,
25685,
29903,
1132,
13,
5215,
10876,
13,
5215,
12865,
13,
13,
1454,
1629,
297,
3464,
29898,
29906,
29900,
29900,
29953,
29892,
12865,
29889,
12673,
29889,
3707,
2141,
6360,
29974,
29896,
1125,
13,
12,
6360,
14080,
29922,
2636,
13,
12,
1454,
1813,
297,
3464,
29898,
29896,
29892,
29871,
29896,
29900,
29900,
29900,
1125,
13,
12,
12,
2271,
2433,
1124,
597,
2966,
29899,
9106,
29889,
990,
19248,
6822,
3488,
29914,
8875,
4286,
4830,
29898,
6360,
29892,
1813,
29897,
13,
12,
12,
7971,
29922,
2271,
1982,
29906,
29889,
3089,
29898,
2271,
29892,
9066,
3790,
29915,
2659,
29899,
19661,
29915,
584,
376,
18654,
8944,
29908,
1800,
13,
12,
12,
2202,
29901,
13,
12,
12,
12,
535,
29922,
2271,
1982,
29906,
29889,
332,
417,
2238,
29898,
7971,
29897,
13,
12,
12,
19499,
3142,
1982,
29906,
29889,
10493,
2392,
29892,
321,
29901,
13,
12,
12,
12,
8690,
13,
12,
12,
1272,
29922,
535,
29889,
949,
580,
13,
12,
12,
29879,
1132,
29922,
3629,
1300,
6845,
29903,
1132,
29898,
1272,
29892,
525,
1420,
29889,
16680,
1495,
13,
12,
12,
14080,
29922,
29879,
1132,
29889,
2886,
29918,
497,
29898,
1990,
29918,
543,
2490,
1159,
13,
12,
12,
1454,
282,
297,
11803,
29901,
13,
12,
12,
12,
3257,
29922,
29886,
29889,
2886,
29918,
497,
29898,
1990,
29918,
543,
8269,
29899,
3257,
1159,
29961,
29900,
1822,
29874,
29889,
726,
13,
12,
12,
12,
2324,
29922,
29886,
29889,
2886,
29918,
497,
29898,
1990,
29918,
543,
8269,
29899,
3257,
1159,
29961,
29900,
1822,
29874,
29889,
657,
877,
12653,
1495,
13,
12,
12,
12,
7299,
29922,
29886,
29889,
2886,
29918,
497,
29898,
1990,
29918,
543,
8269,
29899,
7299,
1159,
13,
12,
12,
12,
8921,
29922,
29886,
29889,
2886,
29918,
497,
29898,
1990,
29918,
543,
8269,
29899,
7299,
1159,
29961,
29900,
1822,
2886,
29918,
497,
29898,
1990,
29918,
2433,
8921,
29861,
29900,
1822,
29874,
29889,
726,
13,
12,
12,
12,
1256,
29922,
29886,
29889,
2886,
29918,
497,
29898,
1990,
29918,
543,
8269,
29899,
7299,
1159,
29961,
29900,
1822,
2886,
29918,
497,
29898,
1990,
29918,
2433,
8269,
29899,
1256,
29861,
29900,
1822,
726,
13,
12,
12,
12,
8269,
2433,
29930,
518,
8875,
850,
29912,
1800,
21313,
1118,
426,
1800,
4286,
4830,
29898,
3257,
29889,
12508,
877,
9420,
29918,
29947,
5477,
851,
29898,
2324,
511,
851,
29898,
8921,
511,
851,
29898,
1256,
876,
13,
12,
12,
12,
6360,
14080,
29889,
4397,
29898,
8269,
29897,
13,
12,
2158,
28909,
29876,
2277,
29937,
426,
1012,
29876,
4286,
4830,
29898,
6360,
876,
13,
12,
1454,
260,
297,
18764,
287,
29898,
6360,
14080,
1125,
13,
12,
12,
2158,
29898,
29873,
29897,
13,
2
] |
sdk/python/pulumi_openstack/__init__.py | Frassle/pulumi-openstack | 0 | 68419 | # 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! ***
# Make subpackages available:
__all__ = ['blockstorage', 'compute', 'config', 'database', 'dns', 'firewall', 'identity', 'images', 'loadbalancer', 'networking', 'objectstorage', 'vpnaas']
| [
1,
396,
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,
29937,
8561,
1014,
8318,
3625,
29901,
13,
1649,
497,
1649,
353,
6024,
1271,
12925,
742,
525,
26017,
742,
525,
2917,
742,
525,
9803,
742,
525,
29881,
1983,
742,
525,
8696,
11358,
742,
525,
22350,
742,
525,
8346,
742,
525,
1359,
5521,
25856,
742,
525,
11618,
292,
742,
525,
3318,
12925,
742,
525,
29894,
29886,
1056,
294,
2033,
13,
2
] |
src/mem/slicc/ast/PeekStatementAST.py | qianlong4526888/haha | 31 | 143045 | # Copyright (c) 1999-2008 <NAME> and <NAME>
# Copyright (c) 2009 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer;
# 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;
# neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# 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.
from slicc.ast.StatementAST import StatementAST
from slicc.symbols import Var
class PeekStatementAST(StatementAST):
def __init__(self, slicc, queue_name, type_ast, pairs, statements, method):
super(PeekStatementAST, self).__init__(slicc, pairs)
self.queue_name = queue_name
self.type_ast = type_ast
self.statements = statements
self.method = method
def __repr__(self):
return "[PeekStatementAST: %r queue_name: %r type: %r %r]" % \
(self.method, self.queue_name, self.type_ast, self.statements)
def generate(self, code, return_type):
self.symtab.pushFrame()
msg_type = self.type_ast.type
# Add new local var to symbol table
var = Var(self.symtab, "in_msg", self.location, msg_type, "(*in_msg_ptr)",
self.pairs)
self.symtab.newSymbol(var)
# Check the queue type
self.queue_name.assertType("InPort")
# Declare the new "in_msg_ptr" variable
mtid = msg_type.ident
qcode = self.queue_name.var.code
code('''
{
// Declare message
const $mtid* in_msg_ptr M5_VAR_USED;
in_msg_ptr = dynamic_cast<const $mtid *>(($qcode).${{self.method}}());
assert(in_msg_ptr != NULL); // Check the cast result
''')
if self.pairs.has_key("block_on"):
address_field = self.pairs['block_on']
code('''
if (m_is_blocking &&
(m_block_map.count(in_msg_ptr->m_$address_field) == 1) &&
(m_block_map[in_msg_ptr->m_$address_field] != &$qcode)) {
$qcode.delayHead();
continue;
}
''')
if self.pairs.has_key("wake_up"):
address_field = self.pairs['wake_up']
code('''
if (m_waiting_buffers.count(in_msg_ptr->m_$address_field) > 0) {
wakeUpBuffers(in_msg_ptr->m_$address_field);
}
''')
# The other statements
self.statements.generate(code, return_type)
self.symtab.popFrame()
code("}")
def findResources(self, resources):
self.statements.findResources(resources)
| [
1,
396,
14187,
1266,
313,
29883,
29897,
29871,
29896,
29929,
29929,
29929,
29899,
29906,
29900,
29900,
29947,
529,
5813,
29958,
322,
529,
5813,
29958,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29900,
29929,
450,
379,
809,
13650,
29899,
16638,
538,
14650,
6938,
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,
13,
29937,
1539,
29901,
2654,
391,
3224,
29879,
310,
2752,
775,
1818,
11551,
278,
2038,
3509,
1266,
13,
29937,
8369,
29892,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
29936,
13,
29937,
2654,
391,
3224,
29879,
297,
7581,
883,
1818,
18532,
278,
2038,
3509,
1266,
13,
29937,
8369,
29892,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
297,
278,
13,
29937,
5106,
322,
29914,
272,
916,
17279,
4944,
411,
278,
4978,
29936,
13,
29937,
9561,
278,
1024,
310,
278,
3509,
1266,
4808,
414,
3643,
278,
2983,
310,
967,
13,
29937,
17737,
29560,
1122,
367,
1304,
304,
1095,
272,
344,
470,
27391,
9316,
10723,
515,
13,
29937,
445,
7047,
1728,
2702,
7536,
3971,
10751,
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,
13,
29937,
376,
3289,
8519,
29908,
5300,
13764,
29979,
8528,
15094,
1799,
6323,
306,
3580,
5265,
3352,
399,
1718,
29934,
13566,
29059,
29892,
2672,
6154,
15789,
4214,
29892,
350,
2692,
6058,
13,
29937,
27848,
3352,
7495,
29892,
6093,
306,
3580,
5265,
3352,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
5300,
383,
1806,
8186,
1799,
15842,
13,
29937,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
319,
1525,
28657,
13875,
8890,
29928,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
315,
4590,
29979,
22789,
3912,
13,
29937,
438,
29956,
13865,
6323,
8707,
29911,
3960,
29933,
2692,
24125,
20700,
17705,
6181,
15842,
13764,
29979,
22471,
26282,
29892,
2672,
4571,
26282,
29892,
2672,
29907,
1367,
3919,
1964,
29892,
13,
29937,
317,
4162,
8426,
1964,
29892,
8528,
29923,
3580,
29931,
19926,
29892,
6323,
8707,
1660,
13356,
3919,
25758,
21330,
1529,
1692,
29903,
313,
1177,
6154,
15789,
4214,
29892,
350,
2692,
6058,
13,
29937,
27848,
3352,
7495,
29892,
13756,
29907,
11499,
13780,
8079,
27092,
1254,
1806,
26027,
21947,
29949,
8452,
6323,
26996,
29963,
2965,
2890,
29936,
11247,
1799,
8079,
501,
1660,
29892,
13,
29937,
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,
6732,
13764,
29979,
13,
29937,
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,
13,
29937,
8079,
3446,
3235,
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,
13,
3166,
269,
506,
29883,
29889,
579,
29889,
14473,
28938,
1053,
6666,
882,
28938,
13,
3166,
269,
506,
29883,
29889,
18098,
29879,
1053,
11681,
13,
13,
1990,
3938,
1416,
14473,
28938,
29898,
14473,
28938,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
269,
506,
29883,
29892,
9521,
29918,
978,
29892,
1134,
29918,
579,
29892,
11000,
29892,
9506,
29892,
1158,
1125,
13,
4706,
2428,
29898,
15666,
1416,
14473,
28938,
29892,
1583,
467,
1649,
2344,
12035,
29879,
506,
29883,
29892,
11000,
29897,
13,
13,
4706,
1583,
29889,
9990,
29918,
978,
353,
9521,
29918,
978,
13,
4706,
1583,
29889,
1853,
29918,
579,
353,
1134,
29918,
579,
13,
4706,
1583,
29889,
6112,
4110,
353,
9506,
13,
4706,
1583,
29889,
5696,
353,
1158,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
14704,
15666,
1416,
14473,
28938,
29901,
1273,
29878,
9521,
29918,
978,
29901,
1273,
29878,
1134,
29901,
1273,
29878,
1273,
29878,
18017,
1273,
320,
13,
1669,
313,
1311,
29889,
5696,
29892,
1583,
29889,
9990,
29918,
978,
29892,
1583,
29889,
1853,
29918,
579,
29892,
1583,
29889,
6112,
4110,
29897,
13,
13,
1678,
822,
5706,
29898,
1311,
29892,
775,
29892,
736,
29918,
1853,
1125,
13,
4706,
1583,
29889,
11967,
3891,
29889,
5910,
4308,
580,
13,
13,
4706,
10191,
29918,
1853,
353,
1583,
29889,
1853,
29918,
579,
29889,
1853,
13,
13,
4706,
396,
3462,
716,
1887,
722,
304,
5829,
1591,
13,
4706,
722,
353,
11681,
29898,
1311,
29889,
11967,
3891,
29892,
376,
262,
29918,
7645,
613,
1583,
29889,
5479,
29892,
10191,
29918,
1853,
29892,
376,
10456,
262,
29918,
7645,
29918,
7414,
19123,
13,
462,
29871,
1583,
29889,
29886,
7121,
29897,
13,
4706,
1583,
29889,
11967,
3891,
29889,
1482,
14730,
29898,
1707,
29897,
13,
13,
4706,
396,
5399,
278,
9521,
1134,
13,
4706,
1583,
29889,
9990,
29918,
978,
29889,
9294,
1542,
703,
797,
2290,
1159,
13,
13,
4706,
396,
3826,
8663,
278,
716,
376,
262,
29918,
7645,
29918,
7414,
29908,
2286,
13,
4706,
286,
17681,
353,
10191,
29918,
1853,
29889,
1693,
13,
4706,
3855,
401,
353,
1583,
29889,
9990,
29918,
978,
29889,
1707,
29889,
401,
13,
4706,
775,
877,
4907,
13,
29912,
13,
1678,
849,
3826,
8663,
2643,
13,
1678,
1040,
395,
4378,
333,
29930,
297,
29918,
7645,
29918,
7414,
341,
29945,
29918,
26865,
29918,
17171,
29928,
29936,
13,
1678,
297,
29918,
7645,
29918,
7414,
353,
7343,
29918,
4384,
29966,
3075,
395,
4378,
333,
334,
5961,
1566,
29939,
401,
467,
5303,
29912,
1311,
29889,
5696,
930,
3310,
13,
1678,
4974,
29898,
262,
29918,
7645,
29918,
7414,
2804,
4265,
416,
849,
5399,
278,
4320,
1121,
13,
4907,
1495,
13,
13,
4706,
565,
1583,
29889,
29886,
7121,
29889,
5349,
29918,
1989,
703,
1271,
29918,
265,
29908,
1125,
13,
9651,
3211,
29918,
2671,
353,
1583,
29889,
29886,
7121,
1839,
1271,
29918,
265,
2033,
13,
9651,
775,
877,
4907,
13,
1678,
565,
313,
29885,
29918,
275,
29918,
1271,
292,
2607,
13,
4706,
313,
29885,
29918,
1271,
29918,
1958,
29889,
2798,
29898,
262,
29918,
7645,
29918,
7414,
976,
29885,
29918,
29938,
7328,
29918,
2671,
29897,
1275,
29871,
29896,
29897,
2607,
13,
4706,
313,
29885,
29918,
1271,
29918,
1958,
29961,
262,
29918,
7645,
29918,
7414,
976,
29885,
29918,
29938,
7328,
29918,
2671,
29962,
2804,
669,
29938,
29939,
401,
876,
426,
13,
9651,
395,
29939,
401,
29889,
18829,
5494,
890,
13,
9651,
6773,
29936,
13,
1678,
500,
13,
9651,
6629,
1495,
13,
13,
4706,
565,
1583,
29889,
29886,
7121,
29889,
5349,
29918,
1989,
703,
29893,
1296,
29918,
786,
29908,
1125,
13,
9651,
3211,
29918,
2671,
353,
1583,
29889,
29886,
7121,
1839,
29893,
1296,
29918,
786,
2033,
13,
9651,
775,
877,
4907,
13,
1678,
565,
313,
29885,
29918,
10685,
292,
29918,
28040,
414,
29889,
2798,
29898,
262,
29918,
7645,
29918,
7414,
976,
29885,
29918,
29938,
7328,
29918,
2671,
29897,
1405,
29871,
29900,
29897,
426,
13,
4706,
281,
1296,
3373,
29933,
3096,
414,
29898,
262,
29918,
7645,
29918,
7414,
976,
29885,
29918,
29938,
7328,
29918,
2671,
416,
13,
1678,
500,
13,
9651,
6629,
1495,
13,
13,
4706,
396,
450,
916,
9506,
13,
4706,
1583,
29889,
6112,
4110,
29889,
17158,
29898,
401,
29892,
736,
29918,
1853,
29897,
13,
4706,
1583,
29889,
11967,
3891,
29889,
7323,
4308,
580,
13,
4706,
775,
703,
27195,
13,
13,
1678,
822,
1284,
13770,
29898,
1311,
29892,
7788,
1125,
13,
4706,
1583,
29889,
6112,
4110,
29889,
2886,
13770,
29898,
13237,
29897,
13,
2
] |
image_classification/T2T_ViT/load_pytorch_weights.py | RangeKing/PaddleViT | 0 | 3288 | <reponame>RangeKing/PaddleViT<filename>image_classification/T2T_ViT/load_pytorch_weights.py
# Copyright (c) 2021 PPViT Authors. 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.
"""convert pytorch model weights to paddle pdparams"""
import os
import numpy as np
import paddle
import torch
import timm
from config import get_config
from t2t_vit import build_t2t_vit as build_model
from T2T_ViT_torch.models.t2t_vit import *
from T2T_ViT_torch.utils import load_for_transfer_learning
def print_model_named_params(model):
print('----------------------------------')
for name, param in model.named_parameters():
print(name, param.shape)
print('----------------------------------')
def print_model_named_buffers(model):
print('----------------------------------')
for name, param in model.named_buffers():
print(name, param.shape)
print('----------------------------------')
def torch_to_paddle_mapping(model_name, config):
# (torch_param_name, paddle_param_name)
mapping = [
('cls_token', 'cls_token'),
('pos_embed', 'pos_embed'),
]
for idx in range(1, 3):
th_prefix = f'tokens_to_token.attention{idx}'
pp_prefix = f'patch_embed.attn{idx}'
if '_t_' in model_name:
layer_mapping = [
(f'{th_prefix}.attn.qkv', f'{pp_prefix}.attn.qkv'),
(f'{th_prefix}.attn.proj', f'{pp_prefix}.attn.proj'),
(f'{th_prefix}.norm1', f'{pp_prefix}.norm1'),
(f'{th_prefix}.norm2', f'{pp_prefix}.norm2'),
(f'{th_prefix}.mlp.fc1', f'{pp_prefix}.mlp.fc1'),
(f'{th_prefix}.mlp.fc2', f'{pp_prefix}.mlp.fc2'),
]
else:
layer_mapping = [
(f'{th_prefix}.w', f'{pp_prefix}.w'),
(f'{th_prefix}.kqv', f'{pp_prefix}.kqv'),
(f'{th_prefix}.proj', f'{pp_prefix}.proj'),
(f'{th_prefix}.norm1', f'{pp_prefix}.norm1'),
(f'{th_prefix}.norm2', f'{pp_prefix}.norm2'),
(f'{th_prefix}.mlp.0', f'{pp_prefix}.mlp.0'),
(f'{th_prefix}.mlp.2', f'{pp_prefix}.mlp.2'),
]
mapping.extend(layer_mapping)
mapping.append(('tokens_to_token.project','patch_embed.proj'))
num_layers = config.MODEL.DEPTH
for idx in range(num_layers):
th_prefix = f'blocks.{idx}'
pp_prefix = f'blocks.{idx}'
layer_mapping = [
(f'{th_prefix}.norm1', f'{pp_prefix}.norm1'),
(f'{th_prefix}.attn.qkv', f'{pp_prefix}.attn.qkv'),
(f'{th_prefix}.attn.proj', f'{pp_prefix}.attn.proj'),
(f'{th_prefix}.norm2', f'{pp_prefix}.norm2'),
(f'{th_prefix}.mlp.fc1', f'{pp_prefix}.mlp.fc1'),
(f'{th_prefix}.mlp.fc2', f'{pp_prefix}.mlp.fc2'),
]
mapping.extend(layer_mapping)
head_mapping = [
('norm', 'norm'),
('head', 'head'),
]
mapping.extend(head_mapping)
return mapping
def convert(torch_model, paddle_model, model_name, config):
def _set_value(th_name, pd_name, transpose=True):
th_shape = th_params[th_name].shape
pd_shape = tuple(pd_params[pd_name].shape) # paddle shape default type is list
#assert th_shape == pd_shape, f'{th_shape} != {pd_shape}'
print(f'**SET** {th_name} {th_shape} **TO** {pd_name} {pd_shape}')
if isinstance(th_params[th_name], torch.nn.parameter.Parameter):
value = th_params[th_name].data.numpy()
else:
value = th_params[th_name].numpy()
if len(value.shape) == 2 and transpose:
value = value.transpose((1, 0))
pd_params[pd_name].set_value(value)
# 1. get paddle and torch model parameters
pd_params = {}
th_params = {}
for name, param in paddle_model.named_parameters():
pd_params[name] = param
for name, param in torch_model.named_parameters():
th_params[name] = param
for name, param in paddle_model.named_buffers():
pd_params[name] = param
for name, param in torch_model.named_buffers():
th_params[name] = param
# 2. get name mapping pairs
mapping = torch_to_paddle_mapping(model_name, config)
missing_keys_th = []
missing_keys_pd = []
zip_map = list(zip(*mapping))
th_keys = list(zip_map[0])
pd_keys = list(zip_map[1])
for key in th_params:
missing = False
if key not in th_keys:
missing = True
if key.endswith('.weight'):
if key[:-7] in th_keys:
missing = False
if key.endswith('.bias'):
if key[:-5] in th_keys:
missing = False
if missing:
missing_keys_th.append(key)
for key in pd_params:
missing = False
if key not in pd_keys:
missing = True
if key.endswith('.weight'):
if key[:-7] in pd_keys:
missing = False
if key.endswith('.bias'):
if key[:-5] in pd_keys:
missing = False
if missing:
missing_keys_pd.append(key)
print('====================================')
print('missing_keys_pytorch:')
print(missing_keys_th)
print('missing_keys_paddle:')
print(missing_keys_pd)
print('====================================')
# 3. set torch param values to paddle params: may needs transpose on weights
for th_name, pd_name in mapping:
if th_name in th_params and pd_name in pd_params: # nn.Parameters
if th_name.endswith('w'):
_set_value(th_name, pd_name, transpose=False)
else:
_set_value(th_name, pd_name)
else:
if f'{th_name}.weight' in th_params and f'{pd_name}.weight' in pd_params:
th_name_w = f'{th_name}.weight'
pd_name_w = f'{pd_name}.weight'
_set_value(th_name_w, pd_name_w)
if f'{th_name}.bias' in th_params and f'{pd_name}.bias' in pd_params:
th_name_b = f'{th_name}.bias'
pd_name_b = f'{pd_name}.bias'
_set_value(th_name_b, pd_name_b)
if f'{th_name}.running_mean' in th_params and f'{pd_name}._mean' in pd_params:
th_name_b = f'{th_name}.running_mean'
pd_name_b = f'{pd_name}._mean'
_set_value(th_name_b, pd_name_b)
if f'{th_name}.running_var' in th_params and f'{pd_name}._variance' in pd_params:
th_name_b = f'{th_name}.running_var'
pd_name_b = f'{pd_name}._variance'
_set_value(th_name_b, pd_name_b)
return paddle_model
def main():
paddle.set_device('cpu')
model_name_list = ['t2t_vit_7',
't2t_vit_10',
't2t_vit_12',
't2t_vit_14',
't2t_vit_14_384',
't2t_vit_19',
't2t_vit_24',
't2t_vit_24_token_labeling',
't2t_vit_t_14',
't2t_vit_t_19',
't2t_vit_t_24']
pth_model_path_list = ['./T2T_ViT_torch/t2t-vit-pth-models/71.7_T2T_ViT_7.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/75.2_T2T_ViT_10.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/76.5_T2T_ViT_12.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/81.5_T2T_ViT_14.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/83.3_T2T_ViT_14.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/81.9_T2T_ViT_19.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/82.3_T2T_ViT_24.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/84.2_T2T_ViT_24.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/81.7_T2T_ViTt_14.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/82.4_T2T_ViTt_19.pth.tar',
'./T2T_ViT_torch/t2t-vit-pth-models/82.6_T2T_ViTt_24.pth.tar']
for model_name, pth_model_path in zip(model_name_list, pth_model_path_list):
print(f'============= NOW: {model_name} =============')
sz = 384 if '384' in model_name else 224
if 'token_labeling' in model_name:
config = get_config(f'./configs/{model_name[:-15]}.yaml')
else:
config = get_config(f'./configs/{model_name}.yaml')
paddle_model = build_model(config)
paddle_model.eval()
print_model_named_params(paddle_model)
print_model_named_buffers(paddle_model)
print('+++++++++++++++++++++++++++++++++++')
device = torch.device('cpu')
if 'token_labeling' in model_name:
torch_model = eval(f'{model_name[:-15]}(img_size={sz})')
else:
if '384' in model_name:
torch_model = eval(f'{model_name[:-4]}(img_size={sz})')
else:
torch_model = eval(f'{model_name}(img_size={sz})')
load_for_transfer_learning(torch_model,
pth_model_path,
use_ema=True,
strict=False,
num_classes=1000)
torch_model = torch_model.to(device)
torch_model.eval()
print_model_named_params(torch_model)
print_model_named_buffers(torch_model)
# convert weights
paddle_model = convert(torch_model, paddle_model, model_name, config)
# check correctness
x = np.random.randn(2, 3, sz, sz).astype('float32')
x_paddle = paddle.to_tensor(x)
x_torch = torch.Tensor(x).to(device)
out_torch = torch_model(x_torch)
out_paddle = paddle_model(x_paddle)
out_torch = out_torch.data.cpu().numpy()
out_paddle = out_paddle.cpu().numpy()
print(out_torch.shape, out_paddle.shape)
print(out_torch[0, 0:100])
print('========================================================')
print(out_paddle[0, 0:100])
assert np.allclose(out_torch, out_paddle, atol = 1e-2)
# save weights for paddle model
model_path = os.path.join(f'./{model_name}.pdparams')
paddle.save(paddle_model.state_dict(), model_path)
print(f'{model_name} done')
print('all done')
if __name__ == "__main__":
main()
| [
1,
529,
276,
1112,
420,
29958,
6069,
29968,
292,
29914,
29925,
22352,
29963,
29875,
29911,
29966,
9507,
29958,
3027,
29918,
1990,
2450,
29914,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29914,
1359,
29918,
2272,
7345,
305,
29918,
705,
5861,
29889,
2272,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
349,
29925,
29963,
29875,
29911,
13189,
943,
29889,
2178,
26863,
2538,
9841,
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,
15945,
29908,
13441,
282,
3637,
25350,
1904,
18177,
304,
282,
22352,
10518,
7529,
15945,
29908,
13,
5215,
2897,
13,
5215,
12655,
408,
7442,
13,
5215,
282,
22352,
13,
5215,
4842,
305,
13,
5215,
5335,
29885,
13,
3166,
2295,
1053,
679,
29918,
2917,
13,
3166,
260,
29906,
29873,
29918,
29894,
277,
1053,
2048,
29918,
29873,
29906,
29873,
29918,
29894,
277,
408,
2048,
29918,
4299,
13,
13,
3166,
323,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29889,
9794,
29889,
29873,
29906,
29873,
29918,
29894,
277,
1053,
334,
13,
3166,
323,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29889,
13239,
1053,
2254,
29918,
1454,
29918,
3286,
571,
29918,
21891,
13,
13,
13,
1753,
1596,
29918,
4299,
29918,
17514,
29918,
7529,
29898,
4299,
1125,
13,
1678,
1596,
877,
2683,
2683,
489,
1495,
13,
1678,
363,
1024,
29892,
1828,
297,
1904,
29889,
17514,
29918,
16744,
7295,
13,
4706,
1596,
29898,
978,
29892,
1828,
29889,
12181,
29897,
13,
1678,
1596,
877,
2683,
2683,
489,
1495,
13,
13,
13,
1753,
1596,
29918,
4299,
29918,
17514,
29918,
28040,
414,
29898,
4299,
1125,
13,
1678,
1596,
877,
2683,
2683,
489,
1495,
13,
1678,
363,
1024,
29892,
1828,
297,
1904,
29889,
17514,
29918,
28040,
414,
7295,
13,
4706,
1596,
29898,
978,
29892,
1828,
29889,
12181,
29897,
13,
1678,
1596,
877,
2683,
2683,
489,
1495,
13,
13,
13,
1753,
4842,
305,
29918,
517,
29918,
29886,
22352,
29918,
20698,
29898,
4299,
29918,
978,
29892,
2295,
1125,
13,
29871,
12,
29937,
313,
7345,
305,
29918,
3207,
29918,
978,
29892,
282,
22352,
29918,
3207,
29918,
978,
29897,
13,
1678,
10417,
353,
518,
13,
4706,
6702,
25932,
29918,
6979,
742,
525,
25932,
29918,
6979,
5477,
13,
4706,
6702,
1066,
29918,
17987,
742,
525,
1066,
29918,
17987,
5477,
13,
1678,
4514,
13,
13,
1678,
363,
22645,
297,
3464,
29898,
29896,
29892,
29871,
29941,
1125,
13,
4706,
266,
29918,
13506,
353,
285,
29915,
517,
12360,
29918,
517,
29918,
6979,
29889,
1131,
2509,
29912,
13140,
10162,
13,
4706,
6499,
29918,
13506,
353,
285,
29915,
5041,
29918,
17987,
29889,
1131,
29876,
29912,
13140,
10162,
13,
4706,
565,
22868,
29873,
29918,
29915,
297,
1904,
29918,
978,
29901,
13,
308,
12,
13148,
29918,
20698,
353,
518,
13,
308,
12,
1678,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
1131,
29876,
29889,
29939,
27049,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
1131,
29876,
29889,
29939,
27049,
5477,
13,
308,
12,
1678,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
1131,
29876,
29889,
20865,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
1131,
29876,
29889,
20865,
5477,
13,
308,
12,
1678,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
12324,
29896,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
12324,
29896,
5477,
13,
308,
12,
1678,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
12324,
29906,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
12324,
29906,
5477,
13,
308,
12,
1678,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29896,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29896,
5477,
13,
308,
12,
1678,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29906,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29906,
5477,
13,
308,
12,
29962,
13,
4706,
1683,
29901,
13,
9651,
7546,
29918,
20698,
353,
518,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
29893,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
29893,
5477,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
29895,
29939,
29894,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
29895,
29939,
29894,
5477,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
20865,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
20865,
5477,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
12324,
29896,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
12324,
29896,
5477,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
12324,
29906,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
12324,
29906,
5477,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
828,
29886,
29889,
29900,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
828,
29886,
29889,
29900,
5477,
13,
18884,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
828,
29886,
29889,
29906,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
828,
29886,
29889,
29906,
5477,
13,
9651,
4514,
13,
4706,
10417,
29889,
21843,
29898,
13148,
29918,
20698,
29897,
13,
1678,
10417,
29889,
4397,
29898,
877,
517,
12360,
29918,
517,
29918,
6979,
29889,
4836,
3788,
5041,
29918,
17987,
29889,
20865,
8785,
13,
13,
13,
1678,
954,
29918,
29277,
353,
2295,
29889,
20387,
29931,
29889,
2287,
29925,
4690,
13,
1678,
363,
22645,
297,
3464,
29898,
1949,
29918,
29277,
1125,
13,
4706,
266,
29918,
13506,
353,
285,
29915,
1271,
29879,
29889,
29912,
13140,
10162,
13,
4706,
6499,
29918,
13506,
353,
285,
29915,
1271,
29879,
29889,
29912,
13140,
10162,
13,
4706,
7546,
29918,
20698,
353,
518,
13,
9651,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
12324,
29896,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
12324,
29896,
5477,
13,
9651,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
1131,
29876,
29889,
29939,
27049,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
1131,
29876,
29889,
29939,
27049,
5477,
13,
9651,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
1131,
29876,
29889,
20865,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
1131,
29876,
29889,
20865,
5477,
13,
9651,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
12324,
29906,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
12324,
29906,
5477,
13,
9651,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29896,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29896,
5477,
29871,
13,
9651,
313,
29888,
29915,
29912,
386,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29906,
742,
285,
29915,
29912,
407,
29918,
13506,
1836,
828,
29886,
29889,
13801,
29906,
5477,
29871,
13,
4706,
4514,
13,
4706,
10417,
29889,
21843,
29898,
13148,
29918,
20698,
29897,
13,
13,
1678,
2343,
29918,
20698,
353,
518,
13,
4706,
6702,
12324,
742,
525,
12324,
5477,
13,
4706,
6702,
2813,
742,
525,
2813,
5477,
13,
1678,
4514,
13,
1678,
10417,
29889,
21843,
29898,
2813,
29918,
20698,
29897,
13,
13,
1678,
736,
10417,
13,
13,
13,
1753,
3588,
29898,
7345,
305,
29918,
4299,
29892,
282,
22352,
29918,
4299,
29892,
1904,
29918,
978,
29892,
2295,
1125,
13,
1678,
822,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29892,
10518,
29918,
978,
29892,
1301,
4220,
29922,
5574,
1125,
13,
4706,
266,
29918,
12181,
353,
266,
29918,
7529,
29961,
386,
29918,
978,
1822,
12181,
13,
4706,
10518,
29918,
12181,
353,
18761,
29898,
15926,
29918,
7529,
29961,
15926,
29918,
978,
1822,
12181,
29897,
396,
282,
22352,
8267,
2322,
1134,
338,
1051,
13,
4706,
396,
9294,
266,
29918,
12181,
1275,
10518,
29918,
12181,
29892,
285,
29915,
29912,
386,
29918,
12181,
29913,
2804,
426,
15926,
29918,
12181,
10162,
13,
4706,
1596,
29898,
29888,
29915,
1068,
10490,
1068,
426,
386,
29918,
978,
29913,
426,
386,
29918,
12181,
29913,
3579,
4986,
1068,
426,
15926,
29918,
978,
29913,
426,
15926,
29918,
12181,
29913,
1495,
13,
4706,
565,
338,
8758,
29898,
386,
29918,
7529,
29961,
386,
29918,
978,
1402,
4842,
305,
29889,
15755,
29889,
15501,
29889,
9329,
1125,
13,
9651,
995,
353,
266,
29918,
7529,
29961,
386,
29918,
978,
1822,
1272,
29889,
23749,
580,
13,
4706,
1683,
29901,
13,
9651,
995,
353,
266,
29918,
7529,
29961,
386,
29918,
978,
1822,
23749,
580,
13,
13,
4706,
565,
7431,
29898,
1767,
29889,
12181,
29897,
1275,
29871,
29906,
322,
1301,
4220,
29901,
13,
9651,
995,
353,
995,
29889,
3286,
4220,
3552,
29896,
29892,
29871,
29900,
876,
13,
4706,
10518,
29918,
7529,
29961,
15926,
29918,
978,
1822,
842,
29918,
1767,
29898,
1767,
29897,
13,
13,
1678,
396,
29871,
29896,
29889,
679,
282,
22352,
322,
4842,
305,
1904,
4128,
13,
1678,
10518,
29918,
7529,
353,
6571,
13,
1678,
266,
29918,
7529,
353,
6571,
13,
1678,
363,
1024,
29892,
1828,
297,
282,
22352,
29918,
4299,
29889,
17514,
29918,
16744,
7295,
13,
4706,
10518,
29918,
7529,
29961,
978,
29962,
353,
1828,
13,
1678,
363,
1024,
29892,
1828,
297,
4842,
305,
29918,
4299,
29889,
17514,
29918,
16744,
7295,
13,
4706,
266,
29918,
7529,
29961,
978,
29962,
353,
1828,
13,
13,
1678,
363,
1024,
29892,
1828,
297,
282,
22352,
29918,
4299,
29889,
17514,
29918,
28040,
414,
7295,
13,
4706,
10518,
29918,
7529,
29961,
978,
29962,
353,
1828,
13,
1678,
363,
1024,
29892,
1828,
297,
4842,
305,
29918,
4299,
29889,
17514,
29918,
28040,
414,
7295,
13,
4706,
266,
29918,
7529,
29961,
978,
29962,
353,
1828,
13,
13,
1678,
396,
29871,
29906,
29889,
679,
1024,
10417,
11000,
13,
1678,
10417,
353,
4842,
305,
29918,
517,
29918,
29886,
22352,
29918,
20698,
29898,
4299,
29918,
978,
29892,
2295,
29897,
13,
13,
13,
1678,
4567,
29918,
8149,
29918,
386,
353,
5159,
13,
1678,
4567,
29918,
8149,
29918,
15926,
353,
5159,
13,
1678,
14319,
29918,
1958,
353,
1051,
29898,
7554,
10456,
20698,
876,
13,
1678,
266,
29918,
8149,
353,
1051,
29898,
7554,
29918,
1958,
29961,
29900,
2314,
13,
1678,
10518,
29918,
8149,
353,
1051,
29898,
7554,
29918,
1958,
29961,
29896,
2314,
13,
13,
1678,
363,
1820,
297,
266,
29918,
7529,
29901,
13,
4706,
4567,
353,
7700,
13,
4706,
565,
1820,
451,
297,
266,
29918,
8149,
29901,
13,
9651,
4567,
353,
5852,
13,
9651,
565,
1820,
29889,
1975,
2541,
12839,
7915,
29374,
13,
18884,
565,
1820,
7503,
29899,
29955,
29962,
297,
266,
29918,
8149,
29901,
13,
462,
1678,
4567,
353,
7700,
13,
9651,
565,
1820,
29889,
1975,
2541,
12839,
29890,
3173,
29374,
13,
18884,
565,
1820,
7503,
29899,
29945,
29962,
297,
266,
29918,
8149,
29901,
13,
462,
1678,
4567,
353,
7700,
13,
4706,
565,
4567,
29901,
13,
9651,
4567,
29918,
8149,
29918,
386,
29889,
4397,
29898,
1989,
29897,
13,
13,
1678,
363,
1820,
297,
10518,
29918,
7529,
29901,
13,
4706,
4567,
353,
7700,
13,
4706,
565,
1820,
451,
297,
10518,
29918,
8149,
29901,
13,
9651,
4567,
353,
5852,
13,
9651,
565,
1820,
29889,
1975,
2541,
12839,
7915,
29374,
13,
18884,
565,
1820,
7503,
29899,
29955,
29962,
297,
10518,
29918,
8149,
29901,
13,
462,
1678,
4567,
353,
7700,
13,
9651,
565,
1820,
29889,
1975,
2541,
12839,
29890,
3173,
29374,
13,
18884,
565,
1820,
7503,
29899,
29945,
29962,
297,
10518,
29918,
8149,
29901,
13,
462,
1678,
4567,
353,
7700,
13,
4706,
565,
4567,
29901,
13,
9651,
4567,
29918,
8149,
29918,
15926,
29889,
4397,
29898,
1989,
29897,
13,
13,
13,
1678,
1596,
877,
9166,
9166,
2751,
1495,
13,
1678,
1596,
877,
27259,
29918,
8149,
29918,
2272,
7345,
305,
29901,
1495,
13,
1678,
1596,
29898,
27259,
29918,
8149,
29918,
386,
29897,
13,
1678,
1596,
877,
27259,
29918,
8149,
29918,
29886,
22352,
29901,
1495,
13,
1678,
1596,
29898,
27259,
29918,
8149,
29918,
15926,
29897,
13,
1678,
1596,
877,
9166,
9166,
2751,
1495,
13,
13,
1678,
396,
29871,
29941,
29889,
731,
4842,
305,
1828,
1819,
304,
282,
22352,
8636,
29901,
1122,
4225,
1301,
4220,
373,
18177,
13,
1678,
363,
266,
29918,
978,
29892,
10518,
29918,
978,
297,
10417,
29901,
13,
4706,
565,
266,
29918,
978,
297,
266,
29918,
7529,
322,
10518,
29918,
978,
297,
10518,
29918,
7529,
29901,
396,
302,
29876,
29889,
11507,
13,
9651,
565,
266,
29918,
978,
29889,
1975,
2541,
877,
29893,
29374,
13,
18884,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29892,
10518,
29918,
978,
29892,
1301,
4220,
29922,
8824,
29897,
13,
9651,
1683,
29901,
13,
18884,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29892,
10518,
29918,
978,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
285,
29915,
29912,
386,
29918,
978,
1836,
7915,
29915,
297,
266,
29918,
7529,
322,
285,
29915,
29912,
15926,
29918,
978,
1836,
7915,
29915,
297,
10518,
29918,
7529,
29901,
13,
18884,
266,
29918,
978,
29918,
29893,
353,
285,
29915,
29912,
386,
29918,
978,
1836,
7915,
29915,
13,
18884,
10518,
29918,
978,
29918,
29893,
353,
285,
29915,
29912,
15926,
29918,
978,
1836,
7915,
29915,
13,
18884,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29918,
29893,
29892,
10518,
29918,
978,
29918,
29893,
29897,
13,
9651,
565,
285,
29915,
29912,
386,
29918,
978,
1836,
29890,
3173,
29915,
297,
266,
29918,
7529,
322,
285,
29915,
29912,
15926,
29918,
978,
1836,
29890,
3173,
29915,
297,
10518,
29918,
7529,
29901,
13,
18884,
266,
29918,
978,
29918,
29890,
353,
285,
29915,
29912,
386,
29918,
978,
1836,
29890,
3173,
29915,
13,
18884,
10518,
29918,
978,
29918,
29890,
353,
285,
29915,
29912,
15926,
29918,
978,
1836,
29890,
3173,
29915,
13,
18884,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29918,
29890,
29892,
10518,
29918,
978,
29918,
29890,
29897,
13,
9651,
565,
285,
29915,
29912,
386,
29918,
978,
1836,
21094,
29918,
12676,
29915,
297,
266,
29918,
7529,
322,
285,
29915,
29912,
15926,
29918,
978,
1836,
29918,
12676,
29915,
297,
10518,
29918,
7529,
29901,
13,
18884,
266,
29918,
978,
29918,
29890,
353,
285,
29915,
29912,
386,
29918,
978,
1836,
21094,
29918,
12676,
29915,
13,
18884,
10518,
29918,
978,
29918,
29890,
353,
285,
29915,
29912,
15926,
29918,
978,
1836,
29918,
12676,
29915,
13,
18884,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29918,
29890,
29892,
10518,
29918,
978,
29918,
29890,
29897,
13,
9651,
565,
285,
29915,
29912,
386,
29918,
978,
1836,
21094,
29918,
1707,
29915,
297,
266,
29918,
7529,
322,
285,
29915,
29912,
15926,
29918,
978,
1836,
29918,
1707,
8837,
29915,
297,
10518,
29918,
7529,
29901,
13,
18884,
266,
29918,
978,
29918,
29890,
353,
285,
29915,
29912,
386,
29918,
978,
1836,
21094,
29918,
1707,
29915,
13,
18884,
10518,
29918,
978,
29918,
29890,
353,
285,
29915,
29912,
15926,
29918,
978,
1836,
29918,
1707,
8837,
29915,
13,
18884,
903,
842,
29918,
1767,
29898,
386,
29918,
978,
29918,
29890,
29892,
10518,
29918,
978,
29918,
29890,
29897,
13,
13,
1678,
736,
282,
22352,
29918,
4299,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
282,
22352,
29889,
842,
29918,
10141,
877,
21970,
1495,
13,
1678,
1904,
29918,
978,
29918,
1761,
353,
6024,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29955,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29896,
29900,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29896,
29906,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29896,
29946,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29896,
29946,
29918,
29941,
29947,
29946,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29896,
29929,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29906,
29946,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29906,
29946,
29918,
6979,
29918,
1643,
292,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29873,
29918,
29896,
29946,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29873,
29918,
29896,
29929,
742,
13,
462,
539,
525,
29873,
29906,
29873,
29918,
29894,
277,
29918,
29873,
29918,
29906,
29946,
2033,
13,
1678,
282,
386,
29918,
4299,
29918,
2084,
29918,
1761,
353,
518,
4286,
29914,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29955,
29896,
29889,
29955,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29955,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29955,
29945,
29889,
29906,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29896,
29900,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29955,
29953,
29889,
29945,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29896,
29906,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29896,
29889,
29945,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29896,
29946,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29941,
29889,
29941,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29896,
29946,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29896,
29889,
29929,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29896,
29929,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29906,
29889,
29941,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29906,
29946,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29946,
29889,
29906,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
29906,
29946,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29896,
29889,
29955,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29873,
29918,
29896,
29946,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29906,
29889,
29946,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29873,
29918,
29896,
29929,
29889,
29886,
386,
29889,
12637,
742,
13,
462,
418,
19283,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29918,
7345,
305,
29914,
29873,
29906,
29873,
29899,
29894,
277,
29899,
29886,
386,
29899,
9794,
29914,
29947,
29906,
29889,
29953,
29918,
29911,
29906,
29911,
29918,
29963,
29875,
29911,
29873,
29918,
29906,
29946,
29889,
29886,
386,
29889,
12637,
2033,
13,
13,
1678,
363,
1904,
29918,
978,
29892,
282,
386,
29918,
4299,
29918,
2084,
297,
14319,
29898,
4299,
29918,
978,
29918,
1761,
29892,
282,
386,
29918,
4299,
29918,
2084,
29918,
1761,
1125,
13,
4706,
1596,
29898,
29888,
29915,
4936,
2751,
29922,
405,
9806,
29901,
426,
4299,
29918,
978,
29913,
1275,
4936,
25512,
1495,
13,
4706,
2268,
353,
29871,
29941,
29947,
29946,
565,
525,
29941,
29947,
29946,
29915,
297,
1904,
29918,
978,
1683,
29871,
29906,
29906,
29946,
13,
13,
4706,
565,
525,
6979,
29918,
1643,
292,
29915,
297,
1904,
29918,
978,
29901,
13,
9651,
2295,
353,
679,
29918,
2917,
29898,
29888,
4286,
29914,
2917,
29879,
19248,
4299,
29918,
978,
7503,
29899,
29896,
29945,
29962,
1836,
25162,
1495,
13,
4706,
1683,
29901,
13,
9651,
2295,
353,
679,
29918,
2917,
29898,
29888,
4286,
29914,
2917,
29879,
19248,
4299,
29918,
978,
1836,
25162,
1495,
13,
4706,
282,
22352,
29918,
4299,
353,
2048,
29918,
4299,
29898,
2917,
29897,
13,
13,
4706,
282,
22352,
29918,
4299,
29889,
14513,
580,
13,
4706,
1596,
29918,
4299,
29918,
17514,
29918,
7529,
29898,
29886,
22352,
29918,
4299,
29897,
13,
4706,
1596,
29918,
4299,
29918,
17514,
29918,
28040,
414,
29898,
29886,
22352,
29918,
4299,
29897,
13,
13,
4706,
1596,
877,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
1817,
29974,
1495,
13,
4706,
4742,
353,
4842,
305,
29889,
10141,
877,
21970,
1495,
13,
4706,
565,
525,
6979,
29918,
1643,
292,
29915,
297,
1904,
29918,
978,
29901,
13,
9651,
4842,
305,
29918,
4299,
353,
19745,
29898,
29888,
29915,
29912,
4299,
29918,
978,
7503,
29899,
29896,
29945,
29962,
2119,
2492,
29918,
2311,
3790,
3616,
1800,
1495,
13,
4706,
1683,
29901,
13,
9651,
565,
525,
29941,
29947,
29946,
29915,
297,
1904,
29918,
978,
29901,
13,
18884,
4842,
305,
29918,
4299,
353,
19745,
29898,
29888,
29915,
29912,
4299,
29918,
978,
7503,
29899,
29946,
29962,
2119,
2492,
29918,
2311,
3790,
3616,
1800,
1495,
13,
9651,
1683,
29901,
13,
18884,
4842,
305,
29918,
4299,
353,
19745,
29898,
29888,
29915,
29912,
4299,
29918,
978,
2119,
2492,
29918,
2311,
3790,
3616,
1800,
1495,
13,
13,
4706,
2254,
29918,
1454,
29918,
3286,
571,
29918,
21891,
29898,
7345,
305,
29918,
4299,
29892,
13,
462,
462,
259,
282,
386,
29918,
4299,
29918,
2084,
29892,
13,
462,
462,
259,
671,
29918,
2603,
29922,
5574,
29892,
13,
462,
462,
259,
9406,
29922,
8824,
29892,
13,
462,
462,
259,
954,
29918,
13203,
29922,
29896,
29900,
29900,
29900,
29897,
13,
4706,
4842,
305,
29918,
4299,
353,
4842,
305,
29918,
4299,
29889,
517,
29898,
10141,
29897,
13,
4706,
4842,
305,
29918,
4299,
29889,
14513,
580,
13,
4706,
1596,
29918,
4299,
29918,
17514,
29918,
7529,
29898,
7345,
305,
29918,
4299,
29897,
13,
4706,
1596,
29918,
4299,
29918,
17514,
29918,
28040,
414,
29898,
7345,
305,
29918,
4299,
29897,
13,
13,
4706,
396,
3588,
18177,
13,
4706,
282,
22352,
29918,
4299,
353,
3588,
29898,
7345,
305,
29918,
4299,
29892,
282,
22352,
29918,
4299,
29892,
1904,
29918,
978,
29892,
2295,
29897,
13,
13,
4706,
396,
1423,
1959,
2264,
13,
4706,
921,
353,
7442,
29889,
8172,
29889,
9502,
29876,
29898,
29906,
29892,
29871,
29941,
29892,
2268,
29892,
2268,
467,
579,
668,
877,
7411,
29941,
29906,
1495,
13,
4706,
921,
29918,
29886,
22352,
353,
282,
22352,
29889,
517,
29918,
20158,
29898,
29916,
29897,
13,
4706,
921,
29918,
7345,
305,
353,
4842,
305,
29889,
29911,
6073,
29898,
29916,
467,
517,
29898,
10141,
29897,
13,
13,
4706,
714,
29918,
7345,
305,
353,
4842,
305,
29918,
4299,
29898,
29916,
29918,
7345,
305,
29897,
13,
4706,
714,
29918,
29886,
22352,
353,
282,
22352,
29918,
4299,
29898,
29916,
29918,
29886,
22352,
29897,
13,
13,
4706,
714,
29918,
7345,
305,
353,
714,
29918,
7345,
305,
29889,
1272,
29889,
21970,
2141,
23749,
580,
13,
4706,
714,
29918,
29886,
22352,
353,
714,
29918,
29886,
22352,
29889,
21970,
2141,
23749,
580,
13,
13,
4706,
1596,
29898,
449,
29918,
7345,
305,
29889,
12181,
29892,
714,
29918,
29886,
22352,
29889,
12181,
29897,
13,
4706,
1596,
29898,
449,
29918,
7345,
305,
29961,
29900,
29892,
29871,
29900,
29901,
29896,
29900,
29900,
2314,
13,
4706,
1596,
877,
9166,
9166,
9166,
4936,
1495,
13,
4706,
1596,
29898,
449,
29918,
29886,
22352,
29961,
29900,
29892,
29871,
29900,
29901,
29896,
29900,
29900,
2314,
13,
4706,
4974,
7442,
29889,
497,
5358,
29898,
449,
29918,
7345,
305,
29892,
714,
29918,
29886,
22352,
29892,
472,
324,
353,
29871,
29896,
29872,
29899,
29906,
29897,
13,
13,
4706,
396,
4078,
18177,
363,
282,
22352,
1904,
13,
4706,
1904,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29888,
4286,
19248,
4299,
29918,
978,
1836,
15926,
7529,
1495,
13,
4706,
282,
22352,
29889,
7620,
29898,
29886,
22352,
29918,
4299,
29889,
3859,
29918,
8977,
3285,
1904,
29918,
2084,
29897,
13,
4706,
1596,
29898,
29888,
29915,
29912,
4299,
29918,
978,
29913,
2309,
1495,
13,
1678,
1596,
877,
497,
2309,
1495,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
Acquire/Client/_user.py | michellab/BioSimSpaceCloud | 2 | 15502 | <filename>Acquire/Client/_user.py
import os as _os
from enum import Enum as _Enum
from datetime import datetime as _datetime
import time as _time
from Acquire.Service import call_function as _call_function
from Acquire.Service import Service as _Service
from Acquire.ObjectStore import bytes_to_string as _bytes_to_string
from Acquire.ObjectStore import string_to_bytes as _string_to_bytes
from Acquire.Crypto import PrivateKey as _PrivateKey
from Acquire.Crypto import PublicKey as _PublicKey
from ._qrcode import create_qrcode as _create_qrcode
from ._qrcode import has_qrcode as _has_qrcode
from ._errors import UserError, LoginError
# If we can, import socket to get the hostname and IP address
try:
import socket as _socket
_has_socket = True
except:
_has_socket = False
__all__ = ["User", "username_to_uid", "uid_to_username", "get_session_keys"]
class _LoginStatus(_Enum):
EMPTY = 0
LOGGING_IN = 1
LOGGED_IN = 2
LOGGED_OUT = 3
ERROR = 4
def _get_identity_url():
"""Function to discover and return the default identity url"""
return "http://172.16.17.32:8080/t/identity"
def _get_identity_service(identity_url=None):
"""Function to return the identity service for the system"""
if identity_url is None:
identity_url = _get_identity_url()
privkey = _PrivateKey()
response = _call_function(identity_url, response_key=privkey)
try:
service = _Service.from_data(response["service_info"])
except:
raise LoginError("Have not received the identity service info from "
"the identity service at '%s' - got '%s'" %
(identity_url, response))
if not service.is_identity_service():
raise LoginError(
"You can only use a valid identity service to log in! "
"The service at '%s' is a '%s'" %
(identity_url, service.service_type()))
if identity_url != service.service_url():
service.update_service_url(identity_url)
return service
def uid_to_username(user_uid, identity_url=None):
"""Function to return the username for the passed uid"""
if identity_url is None:
identity_url = _get_identity_url()
response = _call_function(identity_url, "whois",
user_uid=str(user_uid))
return response["username"]
def username_to_uid(username, identity_url=None):
"""Function to return the uid for the passed username"""
if identity_url is None:
identity_url = _get_identity_url()
response = _call_function(identity_url, "whois",
username=str(username))
return response["user_uid"]
def get_session_keys(username=None, user_uid=None, session_uid=None,
identity_url=None):
"""Function to return the session keys for the specified user"""
if username is None and user_uid is None:
raise ValueError("You must supply either the username or user_uid!")
if session_uid is None:
raise ValueError("You must supply a valid UID for a login session")
if identity_url is None:
identity_url = _get_identity_url()
response = _call_function(identity_url, "whois",
username=username,
user_uid=user_uid,
session_uid=session_uid)
try:
response["public_key"] = _PublicKey.from_data(response["public_key"])
except:
pass
try:
response["public_cert"] = _PublicKey.from_data(response["public_cert"])
except:
pass
return response
class User:
"""This class holds all functionality that would be used
by a user to authenticate with and access the service.
This represents a single client login, and is the
user-facing part of Acquire
"""
def __init__(self, username, identity_url=None):
"""Construct a null user"""
self._username = username
self._status = _LoginStatus.EMPTY
self._identity_service = None
if identity_url:
self._identity_url = identity_url
self._user_uid = None
def __str__(self):
return "User(name='%s', status=%s)" % (self.username(), self.status())
def __enter__(self):
"""Enter function used by 'with' statements'"""
pass
def __exit__(self, exception_type, exception_value, traceback):
"""Ensure that we logout"""
self.logout()
def __del__(self):
"""Make sure that we log out before deleting this object"""
self.logout()
def _set_status(self, status):
"""Internal function used to set the status from the
string obtained from the LoginSession"""
if status == "approved":
self._status = _LoginStatus.LOGGED_IN
elif status == "denied":
self._set_error_state("Permission to log in was denied!")
elif status == "logged_out":
self._status = _LoginStatus.LOGGED_OUT
def username(self):
"""Return the username of the user"""
return self._username
def uid(self):
"""Return the UID of this user. This uniquely identifies the
user across all systems
"""
if self._user_uid is None:
self._user_uid = username_to_uid(self.username(),
self.identity_service_url())
return self._user_uid
def status(self):
"""Return the current status of this user"""
return self._status
def _check_for_error(self):
"""Call to ensure that this object is not in an error
state. If it is in an error state then raise an
exception"""
if self._status == _LoginStatus.ERROR:
raise LoginError(self._error_string)
def _set_error_state(self, message):
"""Put this object into an error state, displaying the
passed message if anyone tries to use this object"""
self._status = _LoginStatus.ERROR
self._error_string = message
def session_key(self):
"""Return the session key for the current login session"""
self._check_for_error()
try:
return self._session_key
except:
return None
def signing_key(self):
"""Return the signing key used for the current login session"""
self._check_for_error()
try:
return self._signing_key
except:
return None
def identity_service(self):
"""Return the identity service info object for the identity
service used to validate the identity of this user
"""
if self._identity_service:
return self._identity_service
self._identity_service = _get_identity_service(
self.identity_service_url())
return self._identity_service
def identity_service_url(self):
"""Return the URL to the identity service. This is the full URL
to the service, minus the actual function to be called, e.g.
https://function_service.com/t/identity
"""
self._check_for_error()
try:
return self._identity_url
except:
# return the default URL - this should be discovered...
return _get_identity_url()
def login_url(self):
"""Return the URL that the user must connect to to authenticate
this login session"""
self._check_for_error()
try:
return self._login_url
except:
return None
def login_qr_code(self):
"""Return a QR code of the login URL that the user must connect to
to authenticate this login session"""
self._check_for_error()
try:
return self._login_qrcode
except:
return None
def session_uid(self):
"""Return the UID of the current login session. Returns None
if there is no valid login session"""
self._check_for_error()
try:
return self._session_uid
except:
return None
def is_empty(self):
"""Return whether or not this is an empty login (so has not
been used for anything yet..."""
return self._status == _LoginStatus.EMPTY
def is_logged_in(self):
"""Return whether or not the user has successfully logged in"""
return self._status == _LoginStatus.LOGGED_IN
def is_logging_in(self):
"""Return whether or not the user is in the process of loggin in"""
return self._status == _LoginStatus.LOGGING_IN
def logout(self):
"""Log out from the current session"""
if self.is_logged_in() or self.is_logging_in():
identity_url = self.identity_service_url()
if identity_url is None:
return
# create a permission message that can be signed
# and then validated by the user
permission = "Log out request for %s" % self._session_uid
signature = self.signing_key().sign(permission)
print("Logging out %s from session %s" % (self._username,
self._session_uid))
result = _call_function(
identity_url, "logout",
args_key=self.identity_service().public_key(),
username=self._username,
session_uid=self._session_uid,
permission=permission,
signature=_bytes_to_string(signature))
print(result)
self._status = _LoginStatus.LOGGED_OUT
return result
def register(self, password, identity_url=None):
"""Request to register this user with the identity service running
at 'identity_url', using the supplied 'password'. This will
return a QR code that you must use immediately to add this
user on the identity service to a QR code generator"""
if self._username is None:
return None
if identity_url is None:
identity_url = _get_identity_url()
privkey = _PrivateKey()
result = _call_function(
identity_url, "register",
args_key=self.identity_service().public_key(),
response_key=privkey,
public_cert=self.identity_service().public_certificate(),
username=self._username, password=password)
try:
provisioning_uri = result["provisioning_uri"]
except:
raise UserError(
"Cannot register the user '%s' on "
"the identity service at '%s'!" %
(self._username, identity_url))
# return a QR code for the provisioning URI
return (provisioning_uri, _create_qrcode(provisioning_uri))
def request_login(self, login_message=None):
"""Request to authenticate as this user. This returns a login URL that
you must connect to to supply your login credentials
If 'login_message' is supplied, then this is passed to
the identity service so that it can be displayed
when the user accesses the login page. This helps
the user validate that they have accessed the correct
login page. Note that if the message is None,
then a random message will be generated.
"""
self._check_for_error()
if not self.is_empty():
raise LoginError("You cannot try to log in twice using the same "
"User object. Create another object if you want "
"to try to log in again.")
# first, create a private key that will be used
# to sign all requests and identify this login
session_key = _PrivateKey()
signing_key = _PrivateKey()
args = {"username": self._username,
"public_key": session_key.public_key().to_data(),
"public_certificate": signing_key.public_key().to_data(),
"ipaddr": None}
# get information from the local machine to help
# the user validate that the login details are correct
if _has_socket:
hostname = _socket.gethostname()
ipaddr = _socket.gethostbyname(hostname)
args["ipaddr"] = ipaddr
args["hostname"] = hostname
if login_message is None:
login_message = "User '%s' in process '%s' wants to log in..." % \
(_os.getlogin(), _os.getpid())
args["message"] = login_message
result = _call_function(
self.identity_service_url(), "request_login",
args_key=self.identity_service().public_key(),
response_key=session_key,
public_cert=self.identity_service().public_certificate(),
username=self._username,
public_key=session_key.public_key().to_data(),
public_certificate=signing_key.public_key().to_data(),
ipaddr=None,
message=login_message)
# look for status = 0
try:
status = int(result["status"])
except:
status = -1
try:
message = result["message"]
except:
message = str(result)
try:
prune_message = result["prune_message"]
print("Pruning old sessions...\n%s" % "\n".join(prune_message))
except:
pass
if status != 0:
error = "Failed to login. Error = %d. Message = %s" % \
(status, message)
self._set_error_state(error)
raise LoginError(error)
try:
login_url = result["login_url"]
except:
login_url = None
if login_url is None:
error = "Failed to login. Could not extract the login URL! " \
"Result is %s" % (str(result))
self._set_error_state(error)
raise LoginError(error)
try:
session_uid = result["session_uid"]
except:
session_uid = None
if session_uid is None:
error = "Failed to login. Could not extract the login " \
"session UID! Result is %s" % (str(result))
self._set_error_state(error)
raise LoginError(error)
# now save all of the needed data
self._login_url = result["login_url"]
self._session_key = session_key
self._signing_key = signing_key
self._session_uid = session_uid
self._status = _LoginStatus.LOGGING_IN
self._user_uid = result["user_uid"]
qrcode = None
if _has_qrcode():
try:
self._login_qrcode = _create_qrcode(self._login_url)
qrcode = self._login_qrcode
except:
pass
return (self._login_url, qrcode)
def _poll_session_status(self):
"""Function used to query the identity service for this session
to poll for the session status"""
identity_url = self.identity_service_url()
if identity_url is None:
return
result = _call_function(identity_url, "get_status",
username=self._username,
session_uid=self._session_uid)
# look for status = 0
try:
status = int(result["status"])
except:
status = -1
try:
message = result["message"]
except:
message = str(result)
if status != 0:
error = "Failed to query identity service. Error = %d. " \
"Message = %s" % (status, message)
self._set_error_state(error)
raise LoginError(error)
# now update the status...
status = result["session_status"]
self._set_status(status)
def wait_for_login(self, timeout=None, polling_delta=5):
"""Block until the user has logged in. If 'timeout' is set
then we will wait for a maximum of that number of seconds
This will check whether we have logged in by polling
the identity service every 'polling_delta' seconds.
"""
self._check_for_error()
if not self.is_logging_in():
return self.is_logged_in()
polling_delta = int(polling_delta)
if polling_delta > 60:
polling_delta = 60
elif polling_delta < 1:
polling_delta = 1
if timeout is None:
# block forever....
while True:
self._poll_session_status()
if self.is_logged_in():
return True
elif not self.is_logging_in():
return False
_time.sleep(polling_delta)
else:
# only block until the timeout has been reached
timeout = int(timeout)
if timeout < 1:
timeout = 1
start_time = _datetime.now()
while (_datetime.now() - start_time).seconds < timeout:
self._poll_session_status()
if self.is_logged_in():
return True
elif not self.is_logging_in():
return False
_time.sleep(polling_delta)
return False
| [
1,
529,
9507,
29958,
10644,
1548,
29914,
4032,
19891,
1792,
29889,
2272,
13,
13,
5215,
2897,
408,
903,
359,
13,
13,
3166,
14115,
1053,
1174,
398,
408,
903,
16854,
13,
13,
3166,
12865,
1053,
12865,
408,
903,
12673,
13,
5215,
931,
408,
903,
2230,
13,
13,
3166,
7255,
1548,
29889,
3170,
1053,
1246,
29918,
2220,
408,
903,
4804,
29918,
2220,
13,
3166,
7255,
1548,
29889,
3170,
1053,
6692,
408,
903,
3170,
13,
13,
3166,
7255,
1548,
29889,
2061,
9044,
1053,
6262,
29918,
517,
29918,
1807,
408,
903,
13193,
29918,
517,
29918,
1807,
13,
3166,
7255,
1548,
29889,
2061,
9044,
1053,
1347,
29918,
517,
29918,
13193,
408,
903,
1807,
29918,
517,
29918,
13193,
13,
13,
3166,
7255,
1548,
29889,
29907,
17929,
1053,
12230,
2558,
408,
903,
25207,
2558,
13,
3166,
7255,
1548,
29889,
29907,
17929,
1053,
5236,
2558,
408,
903,
19858,
2558,
13,
13,
3166,
869,
29918,
29939,
29878,
401,
1053,
1653,
29918,
29939,
29878,
401,
408,
903,
3258,
29918,
29939,
29878,
401,
13,
3166,
869,
29918,
29939,
29878,
401,
1053,
756,
29918,
29939,
29878,
401,
408,
903,
5349,
29918,
29939,
29878,
401,
13,
13,
3166,
869,
29918,
12523,
1053,
4911,
2392,
29892,
19130,
2392,
13,
13,
29937,
960,
591,
508,
29892,
1053,
9909,
304,
679,
278,
3495,
978,
322,
5641,
3211,
13,
2202,
29901,
13,
1678,
1053,
9909,
408,
903,
11514,
13,
1678,
903,
5349,
29918,
11514,
353,
5852,
13,
19499,
29901,
13,
1678,
903,
5349,
29918,
11514,
353,
7700,
13,
13,
1649,
497,
1649,
353,
6796,
2659,
613,
376,
6786,
29918,
517,
29918,
5416,
613,
376,
5416,
29918,
517,
29918,
6786,
613,
376,
657,
29918,
7924,
29918,
8149,
3108,
13,
13,
13,
1990,
903,
11049,
5709,
7373,
16854,
1125,
13,
1678,
382,
3580,
15631,
353,
29871,
29900,
13,
1678,
25401,
29954,
4214,
29918,
1177,
353,
29871,
29896,
13,
1678,
25401,
1692,
29928,
29918,
1177,
353,
29871,
29906,
13,
1678,
25401,
1692,
29928,
29918,
12015,
353,
29871,
29941,
13,
1678,
14431,
353,
29871,
29946,
13,
13,
13,
1753,
903,
657,
29918,
22350,
29918,
2271,
7295,
13,
1678,
9995,
6678,
304,
6523,
322,
736,
278,
2322,
10110,
3142,
15945,
29908,
13,
1678,
736,
376,
1124,
597,
29896,
29955,
29906,
29889,
29896,
29953,
29889,
29896,
29955,
29889,
29941,
29906,
29901,
29947,
29900,
29947,
29900,
29914,
29873,
29914,
22350,
29908,
13,
13,
13,
1753,
903,
657,
29918,
22350,
29918,
5509,
29898,
22350,
29918,
2271,
29922,
8516,
1125,
13,
1678,
9995,
6678,
304,
736,
278,
10110,
2669,
363,
278,
1788,
15945,
29908,
13,
1678,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
4706,
10110,
29918,
2271,
353,
903,
657,
29918,
22350,
29918,
2271,
580,
13,
13,
1678,
5999,
1989,
353,
903,
25207,
2558,
580,
13,
1678,
2933,
353,
903,
4804,
29918,
2220,
29898,
22350,
29918,
2271,
29892,
2933,
29918,
1989,
29922,
22534,
1989,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
2669,
353,
903,
3170,
29889,
3166,
29918,
1272,
29898,
5327,
3366,
5509,
29918,
3888,
20068,
13,
1678,
5174,
29901,
13,
4706,
12020,
19130,
2392,
703,
25559,
451,
4520,
278,
10110,
2669,
5235,
515,
376,
13,
462,
308,
376,
1552,
10110,
2669,
472,
14210,
29879,
29915,
448,
2355,
14210,
29879,
11838,
1273,
13,
462,
308,
313,
22350,
29918,
2271,
29892,
2933,
876,
13,
13,
1678,
565,
451,
2669,
29889,
275,
29918,
22350,
29918,
5509,
7295,
13,
4706,
12020,
19130,
2392,
29898,
13,
9651,
376,
3492,
508,
871,
671,
263,
2854,
10110,
2669,
304,
1480,
297,
29991,
376,
13,
9651,
376,
1576,
2669,
472,
14210,
29879,
29915,
338,
263,
14210,
29879,
11838,
1273,
13,
9651,
313,
22350,
29918,
2271,
29892,
2669,
29889,
5509,
29918,
1853,
22130,
13,
13,
1678,
565,
10110,
29918,
2271,
2804,
2669,
29889,
5509,
29918,
2271,
7295,
13,
4706,
2669,
29889,
5504,
29918,
5509,
29918,
2271,
29898,
22350,
29918,
2271,
29897,
13,
13,
1678,
736,
2669,
13,
13,
13,
1753,
318,
333,
29918,
517,
29918,
6786,
29898,
1792,
29918,
5416,
29892,
10110,
29918,
2271,
29922,
8516,
1125,
13,
1678,
9995,
6678,
304,
736,
278,
8952,
363,
278,
4502,
318,
333,
15945,
29908,
13,
1678,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
4706,
10110,
29918,
2271,
353,
903,
657,
29918,
22350,
29918,
2271,
580,
13,
13,
1678,
2933,
353,
903,
4804,
29918,
2220,
29898,
22350,
29918,
2271,
29892,
376,
15970,
275,
613,
13,
462,
795,
1404,
29918,
5416,
29922,
710,
29898,
1792,
29918,
5416,
876,
13,
13,
1678,
736,
2933,
3366,
6786,
3108,
13,
13,
13,
1753,
8952,
29918,
517,
29918,
5416,
29898,
6786,
29892,
10110,
29918,
2271,
29922,
8516,
1125,
13,
1678,
9995,
6678,
304,
736,
278,
318,
333,
363,
278,
4502,
8952,
15945,
29908,
13,
1678,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
4706,
10110,
29918,
2271,
353,
903,
657,
29918,
22350,
29918,
2271,
580,
13,
13,
1678,
2933,
353,
903,
4804,
29918,
2220,
29898,
22350,
29918,
2271,
29892,
376,
15970,
275,
613,
13,
462,
795,
8952,
29922,
710,
29898,
6786,
876,
13,
13,
1678,
736,
2933,
3366,
1792,
29918,
5416,
3108,
13,
13,
13,
1753,
679,
29918,
7924,
29918,
8149,
29898,
6786,
29922,
8516,
29892,
1404,
29918,
5416,
29922,
8516,
29892,
4867,
29918,
5416,
29922,
8516,
29892,
13,
462,
268,
10110,
29918,
2271,
29922,
8516,
1125,
13,
1678,
9995,
6678,
304,
736,
278,
4867,
6611,
363,
278,
6790,
1404,
15945,
29908,
13,
1678,
565,
8952,
338,
6213,
322,
1404,
29918,
5416,
338,
6213,
29901,
13,
4706,
12020,
7865,
2392,
703,
3492,
1818,
11421,
2845,
278,
8952,
470,
1404,
29918,
5416,
29991,
1159,
13,
13,
1678,
565,
4867,
29918,
5416,
338,
6213,
29901,
13,
4706,
12020,
7865,
2392,
703,
3492,
1818,
11421,
263,
2854,
501,
1367,
363,
263,
6464,
4867,
1159,
13,
13,
1678,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
4706,
10110,
29918,
2271,
353,
903,
657,
29918,
22350,
29918,
2271,
580,
13,
13,
1678,
2933,
353,
903,
4804,
29918,
2220,
29898,
22350,
29918,
2271,
29892,
376,
15970,
275,
613,
13,
462,
795,
8952,
29922,
6786,
29892,
13,
462,
795,
1404,
29918,
5416,
29922,
1792,
29918,
5416,
29892,
13,
462,
795,
4867,
29918,
5416,
29922,
7924,
29918,
5416,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
2933,
3366,
3597,
29918,
1989,
3108,
353,
903,
19858,
2558,
29889,
3166,
29918,
1272,
29898,
5327,
3366,
3597,
29918,
1989,
20068,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
13,
1678,
1018,
29901,
13,
4706,
2933,
3366,
3597,
29918,
6327,
3108,
353,
903,
19858,
2558,
29889,
3166,
29918,
1272,
29898,
5327,
3366,
3597,
29918,
6327,
20068,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
13,
1678,
736,
2933,
13,
13,
13,
1990,
4911,
29901,
13,
1678,
9995,
4013,
770,
8640,
599,
9863,
393,
723,
367,
1304,
13,
539,
491,
263,
1404,
304,
15585,
403,
411,
322,
2130,
278,
2669,
29889,
13,
539,
910,
11524,
263,
2323,
3132,
6464,
29892,
322,
338,
278,
13,
539,
1404,
29899,
29888,
9390,
760,
310,
7255,
1548,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8952,
29892,
10110,
29918,
2271,
29922,
8516,
1125,
13,
4706,
9995,
1168,
4984,
263,
1870,
1404,
15945,
29908,
13,
4706,
1583,
3032,
6786,
353,
8952,
13,
4706,
1583,
3032,
4882,
353,
903,
11049,
5709,
29889,
29923,
3580,
15631,
13,
4706,
1583,
3032,
22350,
29918,
5509,
353,
6213,
13,
13,
4706,
565,
10110,
29918,
2271,
29901,
13,
9651,
1583,
3032,
22350,
29918,
2271,
353,
10110,
29918,
2271,
13,
13,
4706,
1583,
3032,
1792,
29918,
5416,
353,
6213,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
376,
2659,
29898,
978,
2433,
29995,
29879,
742,
4660,
16328,
29879,
5513,
1273,
313,
1311,
29889,
6786,
3285,
1583,
29889,
4882,
3101,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
9995,
10399,
740,
1304,
491,
525,
2541,
29915,
9506,
11838,
15945,
13,
4706,
1209,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
3682,
29918,
1853,
29892,
3682,
29918,
1767,
29892,
9637,
1627,
1125,
13,
4706,
9995,
29923,
1983,
545,
393,
591,
1480,
449,
15945,
29908,
13,
4706,
1583,
29889,
1188,
449,
580,
13,
13,
1678,
822,
4770,
6144,
12035,
1311,
1125,
13,
4706,
9995,
9984,
1854,
393,
591,
1480,
714,
1434,
21228,
445,
1203,
15945,
29908,
13,
4706,
1583,
29889,
1188,
449,
580,
13,
13,
1678,
822,
903,
842,
29918,
4882,
29898,
1311,
29892,
4660,
1125,
13,
4706,
9995,
16491,
740,
1304,
304,
731,
278,
4660,
515,
278,
13,
965,
1347,
7625,
515,
278,
19130,
7317,
15945,
29908,
13,
13,
4706,
565,
4660,
1275,
376,
9961,
1490,
1115,
13,
9651,
1583,
3032,
4882,
353,
903,
11049,
5709,
29889,
14480,
1692,
29928,
29918,
1177,
13,
4706,
25342,
4660,
1275,
376,
1145,
1000,
1115,
13,
9651,
1583,
3032,
842,
29918,
2704,
29918,
3859,
703,
27293,
304,
1480,
297,
471,
17935,
29991,
1159,
13,
4706,
25342,
4660,
1275,
376,
1188,
3192,
29918,
449,
1115,
13,
9651,
1583,
3032,
4882,
353,
903,
11049,
5709,
29889,
14480,
1692,
29928,
29918,
12015,
13,
13,
1678,
822,
8952,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
8952,
310,
278,
1404,
15945,
29908,
13,
4706,
736,
1583,
3032,
6786,
13,
13,
1678,
822,
318,
333,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
501,
1367,
310,
445,
1404,
29889,
910,
20498,
873,
2893,
11057,
278,
13,
965,
1404,
4822,
599,
6757,
13,
4706,
9995,
13,
4706,
565,
1583,
3032,
1792,
29918,
5416,
338,
6213,
29901,
13,
9651,
1583,
3032,
1792,
29918,
5416,
353,
8952,
29918,
517,
29918,
5416,
29898,
1311,
29889,
6786,
3285,
13,
462,
462,
632,
1583,
29889,
22350,
29918,
5509,
29918,
2271,
3101,
13,
4706,
736,
1583,
3032,
1792,
29918,
5416,
13,
13,
1678,
822,
4660,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
1857,
4660,
310,
445,
1404,
15945,
29908,
13,
4706,
736,
1583,
3032,
4882,
13,
13,
1678,
822,
903,
3198,
29918,
1454,
29918,
2704,
29898,
1311,
1125,
13,
4706,
9995,
5594,
304,
9801,
393,
445,
1203,
338,
451,
297,
385,
1059,
13,
965,
2106,
29889,
960,
372,
338,
297,
385,
1059,
2106,
769,
12020,
385,
13,
965,
3682,
15945,
29908,
13,
4706,
565,
1583,
3032,
4882,
1275,
903,
11049,
5709,
29889,
11432,
29901,
13,
9651,
12020,
19130,
2392,
29898,
1311,
3032,
2704,
29918,
1807,
29897,
13,
13,
1678,
822,
903,
842,
29918,
2704,
29918,
3859,
29898,
1311,
29892,
2643,
1125,
13,
4706,
9995,
22908,
445,
1203,
964,
385,
1059,
2106,
29892,
16384,
278,
13,
965,
4502,
2643,
565,
5019,
14335,
304,
671,
445,
1203,
15945,
29908,
13,
4706,
1583,
3032,
4882,
353,
903,
11049,
5709,
29889,
11432,
13,
4706,
1583,
3032,
2704,
29918,
1807,
353,
2643,
13,
13,
1678,
822,
4867,
29918,
1989,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
4867,
1820,
363,
278,
1857,
6464,
4867,
15945,
29908,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
7924,
29918,
1989,
13,
4706,
5174,
29901,
13,
9651,
736,
6213,
13,
13,
1678,
822,
26188,
29918,
1989,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
26188,
1820,
1304,
363,
278,
1857,
6464,
4867,
15945,
29908,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
4530,
292,
29918,
1989,
13,
4706,
5174,
29901,
13,
9651,
736,
6213,
13,
13,
1678,
822,
10110,
29918,
5509,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
10110,
2669,
5235,
1203,
363,
278,
10110,
13,
965,
2669,
1304,
304,
12725,
278,
10110,
310,
445,
1404,
13,
4706,
9995,
13,
4706,
565,
1583,
3032,
22350,
29918,
5509,
29901,
13,
9651,
736,
1583,
3032,
22350,
29918,
5509,
13,
13,
4706,
1583,
3032,
22350,
29918,
5509,
353,
903,
657,
29918,
22350,
29918,
5509,
29898,
13,
462,
462,
1678,
1583,
29889,
22350,
29918,
5509,
29918,
2271,
3101,
13,
13,
4706,
736,
1583,
3032,
22350,
29918,
5509,
13,
13,
1678,
822,
10110,
29918,
5509,
29918,
2271,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
3988,
304,
278,
10110,
2669,
29889,
910,
338,
278,
2989,
3988,
13,
965,
304,
278,
2669,
29892,
26134,
278,
3935,
740,
304,
367,
2000,
29892,
321,
29889,
29887,
29889,
13,
965,
2045,
597,
2220,
29918,
5509,
29889,
510,
29914,
29873,
29914,
22350,
13,
4706,
9995,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
22350,
29918,
2271,
13,
4706,
5174,
29901,
13,
9651,
396,
736,
278,
2322,
3988,
448,
445,
881,
367,
10943,
856,
13,
9651,
736,
903,
657,
29918,
22350,
29918,
2271,
580,
13,
13,
1678,
822,
6464,
29918,
2271,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
3988,
393,
278,
1404,
1818,
4511,
304,
304,
15585,
403,
13,
965,
445,
6464,
4867,
15945,
29908,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
7507,
29918,
2271,
13,
4706,
5174,
29901,
13,
9651,
736,
6213,
13,
13,
1678,
822,
6464,
29918,
29939,
29878,
29918,
401,
29898,
1311,
1125,
13,
4706,
9995,
11609,
263,
660,
29934,
775,
310,
278,
6464,
3988,
393,
278,
1404,
1818,
4511,
304,
13,
965,
304,
15585,
403,
445,
6464,
4867,
15945,
29908,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
7507,
29918,
29939,
29878,
401,
13,
4706,
5174,
29901,
13,
9651,
736,
6213,
13,
13,
1678,
822,
4867,
29918,
5416,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
501,
1367,
310,
278,
1857,
6464,
4867,
29889,
16969,
6213,
13,
965,
565,
727,
338,
694,
2854,
6464,
4867,
15945,
29908,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
7924,
29918,
5416,
13,
4706,
5174,
29901,
13,
9651,
736,
6213,
13,
13,
1678,
822,
338,
29918,
6310,
29898,
1311,
1125,
13,
4706,
9995,
11609,
3692,
470,
451,
445,
338,
385,
4069,
6464,
313,
578,
756,
451,
13,
965,
1063,
1304,
363,
3099,
3447,
856,
15945,
29908,
13,
4706,
736,
1583,
3032,
4882,
1275,
903,
11049,
5709,
29889,
29923,
3580,
15631,
13,
13,
1678,
822,
338,
29918,
1188,
3192,
29918,
262,
29898,
1311,
1125,
13,
4706,
9995,
11609,
3692,
470,
451,
278,
1404,
756,
8472,
13817,
297,
15945,
29908,
13,
4706,
736,
1583,
3032,
4882,
1275,
903,
11049,
5709,
29889,
14480,
1692,
29928,
29918,
1177,
13,
13,
1678,
822,
338,
29918,
21027,
29918,
262,
29898,
1311,
1125,
13,
4706,
9995,
11609,
3692,
470,
451,
278,
1404,
338,
297,
278,
1889,
310,
1480,
5359,
297,
15945,
29908,
13,
4706,
736,
1583,
3032,
4882,
1275,
903,
11049,
5709,
29889,
14480,
29954,
4214,
29918,
1177,
13,
13,
1678,
822,
1480,
449,
29898,
1311,
1125,
13,
4706,
9995,
3403,
714,
515,
278,
1857,
4867,
15945,
29908,
13,
4706,
565,
1583,
29889,
275,
29918,
1188,
3192,
29918,
262,
580,
470,
1583,
29889,
275,
29918,
21027,
29918,
262,
7295,
13,
9651,
10110,
29918,
2271,
353,
1583,
29889,
22350,
29918,
5509,
29918,
2271,
580,
13,
13,
9651,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
18884,
736,
13,
13,
9651,
396,
1653,
263,
10751,
2643,
393,
508,
367,
8794,
13,
9651,
396,
322,
769,
2854,
630,
491,
278,
1404,
13,
9651,
10751,
353,
376,
3403,
714,
2009,
363,
1273,
29879,
29908,
1273,
1583,
3032,
7924,
29918,
5416,
13,
9651,
12608,
353,
1583,
29889,
4530,
292,
29918,
1989,
2141,
4530,
29898,
16074,
29897,
13,
13,
9651,
1596,
703,
3403,
3460,
714,
1273,
29879,
515,
4867,
1273,
29879,
29908,
1273,
313,
1311,
3032,
6786,
29892,
13,
462,
462,
462,
418,
1583,
3032,
7924,
29918,
5416,
876,
13,
13,
9651,
1121,
353,
903,
4804,
29918,
2220,
29898,
13,
462,
9651,
10110,
29918,
2271,
29892,
376,
1188,
449,
613,
13,
462,
9651,
6389,
29918,
1989,
29922,
1311,
29889,
22350,
29918,
5509,
2141,
3597,
29918,
1989,
3285,
13,
462,
9651,
8952,
29922,
1311,
3032,
6786,
29892,
13,
462,
9651,
4867,
29918,
5416,
29922,
1311,
3032,
7924,
29918,
5416,
29892,
13,
462,
9651,
10751,
29922,
16074,
29892,
13,
462,
9651,
12608,
29922,
29918,
13193,
29918,
517,
29918,
1807,
29898,
4530,
1535,
876,
13,
9651,
1596,
29898,
2914,
29897,
13,
13,
9651,
1583,
3032,
4882,
353,
903,
11049,
5709,
29889,
14480,
1692,
29928,
29918,
12015,
13,
13,
9651,
736,
1121,
13,
13,
1678,
822,
6036,
29898,
1311,
29892,
4800,
29892,
10110,
29918,
2271,
29922,
8516,
1125,
13,
4706,
9995,
3089,
304,
6036,
445,
1404,
411,
278,
10110,
2669,
2734,
13,
965,
472,
525,
22350,
29918,
2271,
742,
773,
278,
19056,
525,
5630,
4286,
910,
674,
13,
965,
736,
263,
660,
29934,
775,
393,
366,
1818,
671,
7389,
304,
788,
445,
13,
965,
1404,
373,
278,
10110,
2669,
304,
263,
660,
29934,
775,
15299,
15945,
29908,
13,
13,
4706,
565,
1583,
3032,
6786,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
13,
4706,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
9651,
10110,
29918,
2271,
353,
903,
657,
29918,
22350,
29918,
2271,
580,
13,
13,
4706,
5999,
1989,
353,
903,
25207,
2558,
580,
13,
13,
4706,
1121,
353,
903,
4804,
29918,
2220,
29898,
13,
462,
1678,
10110,
29918,
2271,
29892,
376,
9573,
613,
13,
462,
1678,
6389,
29918,
1989,
29922,
1311,
29889,
22350,
29918,
5509,
2141,
3597,
29918,
1989,
3285,
13,
462,
1678,
2933,
29918,
1989,
29922,
22534,
1989,
29892,
13,
462,
1678,
970,
29918,
6327,
29922,
1311,
29889,
22350,
29918,
5509,
2141,
3597,
29918,
6327,
8021,
3285,
13,
462,
1678,
8952,
29922,
1311,
3032,
6786,
29892,
4800,
29922,
5630,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
25161,
292,
29918,
5338,
353,
1121,
3366,
771,
4924,
292,
29918,
5338,
3108,
13,
4706,
5174,
29901,
13,
9651,
12020,
4911,
2392,
29898,
13,
18884,
376,
29089,
6036,
278,
1404,
14210,
29879,
29915,
373,
376,
13,
18884,
376,
1552,
10110,
2669,
472,
14210,
29879,
29915,
3850,
1273,
13,
18884,
313,
1311,
3032,
6786,
29892,
10110,
29918,
2271,
876,
13,
13,
4706,
396,
736,
263,
660,
29934,
775,
363,
278,
25161,
292,
23539,
13,
4706,
736,
313,
771,
4924,
292,
29918,
5338,
29892,
903,
3258,
29918,
29939,
29878,
401,
29898,
771,
4924,
292,
29918,
5338,
876,
13,
13,
1678,
822,
2009,
29918,
7507,
29898,
1311,
29892,
6464,
29918,
4906,
29922,
8516,
1125,
13,
4706,
9995,
3089,
304,
15585,
403,
408,
445,
1404,
29889,
910,
3639,
263,
6464,
3988,
393,
13,
965,
366,
1818,
4511,
304,
304,
11421,
596,
6464,
16140,
13,
13,
965,
960,
525,
7507,
29918,
4906,
29915,
338,
19056,
29892,
769,
445,
338,
4502,
304,
13,
965,
278,
10110,
2669,
577,
393,
372,
508,
367,
8833,
13,
965,
746,
278,
1404,
2130,
267,
278,
6464,
1813,
29889,
910,
6911,
13,
965,
278,
1404,
12725,
393,
896,
505,
20592,
278,
1959,
13,
965,
6464,
1813,
29889,
3940,
393,
565,
278,
2643,
338,
6213,
29892,
13,
965,
769,
263,
4036,
2643,
674,
367,
5759,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
565,
451,
1583,
29889,
275,
29918,
6310,
7295,
13,
9651,
12020,
19130,
2392,
703,
3492,
2609,
1018,
304,
1480,
297,
8951,
773,
278,
1021,
376,
13,
462,
632,
376,
2659,
1203,
29889,
6204,
1790,
1203,
565,
366,
864,
376,
13,
462,
632,
376,
517,
1018,
304,
1480,
297,
1449,
23157,
13,
13,
4706,
396,
937,
29892,
1653,
263,
2024,
1820,
393,
674,
367,
1304,
13,
4706,
396,
304,
1804,
599,
7274,
322,
12439,
445,
6464,
13,
4706,
4867,
29918,
1989,
353,
903,
25207,
2558,
580,
13,
4706,
26188,
29918,
1989,
353,
903,
25207,
2558,
580,
13,
13,
4706,
6389,
353,
8853,
6786,
1115,
1583,
3032,
6786,
29892,
13,
18884,
376,
3597,
29918,
1989,
1115,
4867,
29918,
1989,
29889,
3597,
29918,
1989,
2141,
517,
29918,
1272,
3285,
13,
18884,
376,
3597,
29918,
6327,
8021,
1115,
26188,
29918,
1989,
29889,
3597,
29918,
1989,
2141,
517,
29918,
1272,
3285,
13,
18884,
376,
666,
10030,
1115,
6213,
29913,
13,
13,
4706,
396,
679,
2472,
515,
278,
1887,
4933,
304,
1371,
13,
4706,
396,
278,
1404,
12725,
393,
278,
6464,
4902,
526,
1959,
13,
4706,
565,
903,
5349,
29918,
11514,
29901,
13,
9651,
3495,
978,
353,
903,
11514,
29889,
29887,
621,
520,
978,
580,
13,
9651,
10377,
10030,
353,
903,
11514,
29889,
29887,
621,
520,
29890,
948,
420,
29898,
28988,
29897,
13,
9651,
6389,
3366,
666,
10030,
3108,
353,
10377,
10030,
13,
9651,
6389,
3366,
28988,
3108,
353,
3495,
978,
13,
13,
4706,
565,
6464,
29918,
4906,
338,
6213,
29901,
13,
9651,
6464,
29918,
4906,
353,
376,
2659,
14210,
29879,
29915,
297,
1889,
14210,
29879,
29915,
10753,
304,
1480,
297,
17794,
1273,
320,
13,
462,
795,
9423,
359,
29889,
657,
7507,
3285,
903,
359,
29889,
657,
5935,
3101,
13,
13,
4706,
6389,
3366,
4906,
3108,
353,
6464,
29918,
4906,
13,
13,
4706,
1121,
353,
903,
4804,
29918,
2220,
29898,
13,
9651,
1583,
29889,
22350,
29918,
5509,
29918,
2271,
3285,
376,
3827,
29918,
7507,
613,
13,
9651,
6389,
29918,
1989,
29922,
1311,
29889,
22350,
29918,
5509,
2141,
3597,
29918,
1989,
3285,
13,
9651,
2933,
29918,
1989,
29922,
7924,
29918,
1989,
29892,
13,
9651,
970,
29918,
6327,
29922,
1311,
29889,
22350,
29918,
5509,
2141,
3597,
29918,
6327,
8021,
3285,
13,
9651,
8952,
29922,
1311,
3032,
6786,
29892,
13,
9651,
970,
29918,
1989,
29922,
7924,
29918,
1989,
29889,
3597,
29918,
1989,
2141,
517,
29918,
1272,
3285,
13,
9651,
970,
29918,
6327,
8021,
29922,
4530,
292,
29918,
1989,
29889,
3597,
29918,
1989,
2141,
517,
29918,
1272,
3285,
13,
9651,
10377,
10030,
29922,
8516,
29892,
13,
9651,
2643,
29922,
7507,
29918,
4906,
29897,
13,
13,
4706,
396,
1106,
363,
4660,
353,
29871,
29900,
13,
4706,
1018,
29901,
13,
9651,
4660,
353,
938,
29898,
2914,
3366,
4882,
20068,
13,
4706,
5174,
29901,
13,
9651,
4660,
353,
448,
29896,
13,
13,
4706,
1018,
29901,
13,
9651,
2643,
353,
1121,
3366,
4906,
3108,
13,
4706,
5174,
29901,
13,
9651,
2643,
353,
851,
29898,
2914,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
544,
1540,
29918,
4906,
353,
1121,
3366,
558,
1540,
29918,
4906,
3108,
13,
9651,
1596,
703,
29925,
3389,
292,
2030,
21396,
856,
29905,
29876,
29995,
29879,
29908,
1273,
6634,
29876,
1642,
7122,
29898,
558,
1540,
29918,
4906,
876,
13,
4706,
5174,
29901,
13,
9651,
1209,
13,
13,
4706,
565,
4660,
2804,
29871,
29900,
29901,
13,
9651,
1059,
353,
376,
17776,
304,
6464,
29889,
4829,
353,
1273,
29881,
29889,
7777,
353,
1273,
29879,
29908,
1273,
320,
13,
462,
18884,
313,
4882,
29892,
2643,
29897,
13,
9651,
1583,
3032,
842,
29918,
2704,
29918,
3859,
29898,
2704,
29897,
13,
9651,
12020,
19130,
2392,
29898,
2704,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
6464,
29918,
2271,
353,
1121,
3366,
7507,
29918,
2271,
3108,
13,
4706,
5174,
29901,
13,
9651,
6464,
29918,
2271,
353,
6213,
13,
13,
4706,
565,
6464,
29918,
2271,
338,
6213,
29901,
13,
9651,
1059,
353,
376,
17776,
304,
6464,
29889,
6527,
451,
6597,
278,
6464,
3988,
29991,
376,
320,
13,
462,
1678,
376,
3591,
338,
1273,
29879,
29908,
1273,
313,
710,
29898,
2914,
876,
13,
9651,
1583,
3032,
842,
29918,
2704,
29918,
3859,
29898,
2704,
29897,
13,
9651,
12020,
19130,
2392,
29898,
2704,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
4867,
29918,
5416,
353,
1121,
3366,
7924,
29918,
5416,
3108,
13,
4706,
5174,
29901,
13,
9651,
4867,
29918,
5416,
353,
6213,
13,
13,
4706,
565,
4867,
29918,
5416,
338,
6213,
29901,
13,
9651,
1059,
353,
376,
17776,
304,
6464,
29889,
6527,
451,
6597,
278,
6464,
376,
320,
13,
462,
1678,
376,
7924,
501,
1367,
29991,
7867,
338,
1273,
29879,
29908,
1273,
313,
710,
29898,
2914,
876,
13,
13,
9651,
1583,
3032,
842,
29918,
2704,
29918,
3859,
29898,
2704,
29897,
13,
9651,
12020,
19130,
2392,
29898,
2704,
29897,
13,
13,
4706,
396,
1286,
4078,
599,
310,
278,
4312,
848,
13,
4706,
1583,
3032,
7507,
29918,
2271,
353,
1121,
3366,
7507,
29918,
2271,
3108,
13,
4706,
1583,
3032,
7924,
29918,
1989,
353,
4867,
29918,
1989,
13,
4706,
1583,
3032,
4530,
292,
29918,
1989,
353,
26188,
29918,
1989,
13,
4706,
1583,
3032,
7924,
29918,
5416,
353,
4867,
29918,
5416,
13,
4706,
1583,
3032,
4882,
353,
903,
11049,
5709,
29889,
14480,
29954,
4214,
29918,
1177,
13,
4706,
1583,
3032,
1792,
29918,
5416,
353,
1121,
3366,
1792,
29918,
5416,
3108,
13,
13,
4706,
3855,
29878,
401,
353,
6213,
13,
13,
4706,
565,
903,
5349,
29918,
29939,
29878,
401,
7295,
13,
9651,
1018,
29901,
13,
18884,
1583,
3032,
7507,
29918,
29939,
29878,
401,
353,
903,
3258,
29918,
29939,
29878,
401,
29898,
1311,
3032,
7507,
29918,
2271,
29897,
13,
18884,
3855,
29878,
401,
353,
1583,
3032,
7507,
29918,
29939,
29878,
401,
13,
9651,
5174,
29901,
13,
18884,
1209,
13,
13,
4706,
736,
313,
1311,
3032,
7507,
29918,
2271,
29892,
3855,
29878,
401,
29897,
13,
13,
1678,
822,
903,
29886,
3028,
29918,
7924,
29918,
4882,
29898,
1311,
1125,
13,
4706,
9995,
6678,
1304,
304,
2346,
278,
10110,
2669,
363,
445,
4867,
13,
965,
304,
21180,
363,
278,
4867,
4660,
15945,
29908,
13,
13,
4706,
10110,
29918,
2271,
353,
1583,
29889,
22350,
29918,
5509,
29918,
2271,
580,
13,
13,
4706,
565,
10110,
29918,
2271,
338,
6213,
29901,
13,
9651,
736,
13,
13,
4706,
1121,
353,
903,
4804,
29918,
2220,
29898,
22350,
29918,
2271,
29892,
376,
657,
29918,
4882,
613,
13,
462,
18884,
8952,
29922,
1311,
3032,
6786,
29892,
13,
462,
18884,
4867,
29918,
5416,
29922,
1311,
3032,
7924,
29918,
5416,
29897,
13,
13,
4706,
396,
1106,
363,
4660,
353,
29871,
29900,
13,
4706,
1018,
29901,
13,
9651,
4660,
353,
938,
29898,
2914,
3366,
4882,
20068,
13,
4706,
5174,
29901,
13,
9651,
4660,
353,
448,
29896,
13,
13,
4706,
1018,
29901,
13,
9651,
2643,
353,
1121,
3366,
4906,
3108,
13,
4706,
5174,
29901,
13,
9651,
2643,
353,
851,
29898,
2914,
29897,
13,
13,
4706,
565,
4660,
2804,
29871,
29900,
29901,
13,
9651,
1059,
353,
376,
17776,
304,
2346,
10110,
2669,
29889,
4829,
353,
1273,
29881,
29889,
376,
320,
13,
462,
1678,
376,
3728,
353,
1273,
29879,
29908,
1273,
313,
4882,
29892,
2643,
29897,
13,
9651,
1583,
3032,
842,
29918,
2704,
29918,
3859,
29898,
2704,
29897,
13,
9651,
12020,
19130,
2392,
29898,
2704,
29897,
13,
13,
4706,
396,
1286,
2767,
278,
4660,
856,
13,
4706,
4660,
353,
1121,
3366,
7924,
29918,
4882,
3108,
13,
4706,
1583,
3032,
842,
29918,
4882,
29898,
4882,
29897,
13,
13,
1678,
822,
4480,
29918,
1454,
29918,
7507,
29898,
1311,
29892,
11815,
29922,
8516,
29892,
1248,
1847,
29918,
4181,
29922,
29945,
1125,
13,
4706,
9995,
7445,
2745,
278,
1404,
756,
13817,
297,
29889,
960,
525,
15619,
29915,
338,
731,
13,
965,
769,
591,
674,
4480,
363,
263,
7472,
310,
393,
1353,
310,
6923,
13,
13,
965,
910,
674,
1423,
3692,
591,
505,
13817,
297,
491,
1248,
1847,
13,
965,
278,
10110,
2669,
1432,
525,
3733,
1847,
29918,
4181,
29915,
6923,
29889,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
3198,
29918,
1454,
29918,
2704,
580,
13,
13,
4706,
565,
451,
1583,
29889,
275,
29918,
21027,
29918,
262,
7295,
13,
9651,
736,
1583,
29889,
275,
29918,
1188,
3192,
29918,
262,
580,
13,
13,
4706,
1248,
1847,
29918,
4181,
353,
938,
29898,
3733,
1847,
29918,
4181,
29897,
13,
4706,
565,
1248,
1847,
29918,
4181,
1405,
29871,
29953,
29900,
29901,
13,
9651,
1248,
1847,
29918,
4181,
353,
29871,
29953,
29900,
13,
4706,
25342,
1248,
1847,
29918,
4181,
529,
29871,
29896,
29901,
13,
9651,
1248,
1847,
29918,
4181,
353,
29871,
29896,
13,
13,
4706,
565,
11815,
338,
6213,
29901,
13,
9651,
396,
2908,
22296,
3045,
13,
9651,
1550,
5852,
29901,
13,
18884,
1583,
3032,
29886,
3028,
29918,
7924,
29918,
4882,
580,
13,
13,
18884,
565,
1583,
29889,
275,
29918,
1188,
3192,
29918,
262,
7295,
13,
462,
1678,
736,
5852,
13,
13,
18884,
25342,
451,
1583,
29889,
275,
29918,
21027,
29918,
262,
7295,
13,
462,
1678,
736,
7700,
13,
13,
18884,
903,
2230,
29889,
17059,
29898,
3733,
1847,
29918,
4181,
29897,
13,
4706,
1683,
29901,
13,
9651,
396,
871,
2908,
2745,
278,
11815,
756,
1063,
7450,
13,
9651,
11815,
353,
938,
29898,
15619,
29897,
13,
9651,
565,
11815,
529,
29871,
29896,
29901,
13,
18884,
11815,
353,
29871,
29896,
13,
13,
9651,
1369,
29918,
2230,
353,
903,
12673,
29889,
3707,
580,
13,
13,
9651,
1550,
9423,
12673,
29889,
3707,
580,
448,
1369,
29918,
2230,
467,
23128,
529,
11815,
29901,
13,
18884,
1583,
3032,
29886,
3028,
29918,
7924,
29918,
4882,
580,
13,
13,
18884,
565,
1583,
29889,
275,
29918,
1188,
3192,
29918,
262,
7295,
13,
462,
1678,
736,
5852,
13,
13,
18884,
25342,
451,
1583,
29889,
275,
29918,
21027,
29918,
262,
7295,
13,
462,
1678,
736,
7700,
13,
13,
18884,
903,
2230,
29889,
17059,
29898,
3733,
1847,
29918,
4181,
29897,
13,
13,
9651,
736,
7700,
13,
2
] |
tests/compilation/request/test_request_compiler.py | ymoch/preacher | 3 | 10668 | <reponame>ymoch/preacher<gh_stars>1-10
from unittest.mock import NonCallableMock, sentinel
from pytest import mark, raises, fixture
from preacher.compilation.argument import Argument
from preacher.compilation.error import CompilationError, NamedNode, IndexedNode
from preacher.compilation.request.request import RequestCompiler, RequestCompiled
from preacher.compilation.request.request_body import RequestBodyCompiler
from preacher.core.request import Method
PKG = "preacher.compilation.request.request"
@fixture
def body():
body = NonCallableMock(RequestBodyCompiler)
body.of_default.return_value = sentinel.new_body_compiler
return body
@fixture
def default() -> RequestCompiled:
return RequestCompiled(
method=sentinel.default_method,
path=sentinel.default_path,
headers=sentinel.default_headers,
params=sentinel.default_params,
body=sentinel.default_body,
)
@fixture
def compiler(body, default: RequestCompiled) -> RequestCompiler:
return RequestCompiler(body=body, default=default)
@mark.parametrize(
("obj", "expected_path"),
(
([], []),
({"method": 1}, [NamedNode("method")]),
({"method": "invalid"}, [NamedNode("method")]),
({"path": {"key": "value"}}, [NamedNode("path")]),
({"headers": ""}, [NamedNode("headers")]),
({"headers": {"int": 1}}, [NamedNode("headers")]),
({"headers": {1: "not-a-string-key"}}, [NamedNode("headers")]),
),
)
def test_given_an_invalid_obj(compiler: RequestCompiler, obj, expected_path):
with raises(CompilationError) as error_info:
compiler.compile(obj)
assert error_info.value.path == expected_path
def test_given_an_empty_mapping(compiler: RequestCompiler):
compiled = compiler.compile({})
assert compiled.method is sentinel.default_method
assert compiled.path is sentinel.default_path
assert compiled.headers is sentinel.default_headers
assert compiled.params is sentinel.default_params
assert compiled.body is sentinel.default_body
@mark.parametrize(
("method_obj", "expected"),
(
("get", Method.GET),
("POST", Method.POST),
("Put", Method.PUT),
("Delete", Method.DELETE),
),
)
def test_given_a_valid_method(compiler: RequestCompiler, method_obj, expected):
obj = {"method": Argument("method")}
arguments = {"method": method_obj}
compiled = compiler.compile(obj, arguments)
assert compiled.method is expected
@mark.parametrize(
("headers_obj", "expected"),
(
({}, {}),
({"null": None, "empty": ""}, {"empty": ""}),
({"n1": "v1", "n2": "v2"}, {"n1": "v1", "n2": "v2"}),
),
)
def test_given_valid_headers(compiler: RequestCompiler, headers_obj, expected):
obj = {"headers": Argument("headers")}
arguments = {"headers": headers_obj}
compiled = compiler.compile(obj, arguments)
assert compiled.headers == expected
def test_given_an_invalid_params(compiler: RequestCompiler, mocker):
compile_params = mocker.patch(f"{PKG}.compile_url_params")
compile_params.side_effect = CompilationError("msg", node=NamedNode("x"))
with raises(CompilationError) as error_info:
compiler.compile({"params": sentinel.params})
assert error_info.value.path == [NamedNode("params"), NamedNode("x")]
compile_params.assert_called_once_with(sentinel.params, None)
def test_given_valid_params(compiler: RequestCompiler, mocker):
compile_params = mocker.patch(f"{PKG}.compile_url_params")
compile_params.return_value = sentinel.compiled_params
compiled = compiler.compile({"params": sentinel.params}, sentinel.args)
assert compiled.params == sentinel.compiled_params
compile_params.assert_called_once_with(sentinel.params, sentinel.args)
def test_given_invalid_body(compiler: RequestCompiler, body):
body.compile.side_effect = CompilationError("x", node=IndexedNode(1))
with raises(CompilationError) as error_info:
compiler.compile({"body": sentinel.body_obj})
assert error_info.value.path == [NamedNode("body"), IndexedNode(1)]
body.compile.assert_called_once_with(sentinel.body_obj, None)
def test_given_valid_body(compiler: RequestCompiler, body):
body.compile.return_value = sentinel.body
compiled = compiler.compile({"body": sentinel.body_obj}, sentinel.args)
assert compiled.body is sentinel.body
body.compile.assert_called_once_with(sentinel.body_obj, sentinel.args)
def test_given_a_string(compiler: RequestCompiler):
compiled = compiler.compile(Argument("path"), {"path": "/path"})
assert compiled.method is sentinel.default_method
assert compiled.path == "/path"
assert compiled.headers is sentinel.default_headers
assert compiled.params is sentinel.default_params
assert compiled.body is sentinel.default_body
def test_of_default_no_body(compiler: RequestCompiler, body, mocker):
ctor = mocker.patch(f"{PKG}.RequestCompiler")
ctor.return_value = sentinel.compiler_of_default
new_default = RequestCompiled(
method=sentinel.new_default_method,
path=sentinel.new_default_path,
headers=sentinel.new_default_headers,
params=sentinel.new_default_params,
)
new_compiler = compiler.of_default(new_default)
assert new_compiler is sentinel.compiler_of_default
ctor.assert_called_once_with(
body=body,
default=RequestCompiled(
method=sentinel.new_default_method,
path=sentinel.new_default_path,
headers=sentinel.new_default_headers,
params=sentinel.new_default_params,
body=sentinel.default_body,
),
)
body.of_default.assert_not_called()
def test_of_default_body(compiler: RequestCompiler, body, mocker):
ctor = mocker.patch(f"{PKG}.RequestCompiler")
ctor.return_value = sentinel.compiler_of_default
new_default = RequestCompiled(body=sentinel.new_default_body)
new_compiler = compiler.of_default(new_default)
assert new_compiler is sentinel.compiler_of_default
ctor.assert_called_once_with(
body=sentinel.new_body_compiler,
default=RequestCompiled(
method=sentinel.default_method,
path=sentinel.default_path,
headers=sentinel.default_headers,
params=sentinel.default_params,
body=sentinel.new_default_body,
),
)
body.of_default.assert_called_once_with(sentinel.new_default_body)
| [
1,
529,
276,
1112,
420,
29958,
962,
2878,
29914,
1457,
11665,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
443,
27958,
29889,
17640,
1053,
10050,
5594,
519,
18680,
29892,
2665,
262,
295,
13,
13,
3166,
11451,
1688,
1053,
2791,
29892,
1153,
4637,
29892,
5713,
15546,
13,
13,
3166,
758,
11665,
29889,
2388,
8634,
29889,
23516,
1053,
23125,
13,
3166,
758,
11665,
29889,
2388,
8634,
29889,
2704,
1053,
3831,
8634,
2392,
29892,
405,
2795,
4247,
29892,
11374,
287,
4247,
13,
3166,
758,
11665,
29889,
2388,
8634,
29889,
3827,
29889,
3827,
1053,
10729,
25333,
29892,
10729,
6843,
2356,
13,
3166,
758,
11665,
29889,
2388,
8634,
29889,
3827,
29889,
3827,
29918,
2587,
1053,
10729,
8434,
25333,
13,
3166,
758,
11665,
29889,
3221,
29889,
3827,
1053,
8108,
13,
13,
21738,
29954,
353,
376,
1457,
11665,
29889,
2388,
8634,
29889,
3827,
29889,
3827,
29908,
13,
13,
13,
29992,
7241,
15546,
13,
1753,
3573,
7295,
13,
1678,
3573,
353,
10050,
5594,
519,
18680,
29898,
3089,
8434,
25333,
29897,
13,
1678,
3573,
29889,
974,
29918,
4381,
29889,
2457,
29918,
1767,
353,
2665,
262,
295,
29889,
1482,
29918,
2587,
29918,
21789,
13,
1678,
736,
3573,
13,
13,
13,
29992,
7241,
15546,
13,
1753,
2322,
580,
1599,
10729,
6843,
2356,
29901,
13,
1678,
736,
10729,
6843,
2356,
29898,
13,
4706,
1158,
29922,
29879,
15440,
295,
29889,
4381,
29918,
5696,
29892,
13,
4706,
2224,
29922,
29879,
15440,
295,
29889,
4381,
29918,
2084,
29892,
13,
4706,
9066,
29922,
29879,
15440,
295,
29889,
4381,
29918,
13662,
29892,
13,
4706,
8636,
29922,
29879,
15440,
295,
29889,
4381,
29918,
7529,
29892,
13,
4706,
3573,
29922,
29879,
15440,
295,
29889,
4381,
29918,
2587,
29892,
13,
1678,
1723,
13,
13,
13,
29992,
7241,
15546,
13,
1753,
6516,
29898,
2587,
29892,
2322,
29901,
10729,
6843,
2356,
29897,
1599,
10729,
25333,
29901,
13,
1678,
736,
10729,
25333,
29898,
2587,
29922,
2587,
29892,
2322,
29922,
4381,
29897,
13,
13,
13,
29992,
3502,
29889,
3207,
300,
374,
911,
29898,
13,
1678,
4852,
5415,
613,
376,
9684,
29918,
2084,
4968,
13,
1678,
313,
13,
4706,
9310,
1402,
5159,
511,
13,
4706,
313,
6377,
5696,
1115,
29871,
29896,
1118,
518,
22175,
4247,
703,
5696,
1159,
11724,
13,
4706,
313,
6377,
5696,
1115,
376,
20965,
10758,
518,
22175,
4247,
703,
5696,
1159,
11724,
13,
4706,
313,
6377,
2084,
1115,
8853,
1989,
1115,
376,
1767,
29908,
11656,
518,
22175,
4247,
703,
2084,
1159,
11724,
13,
4706,
313,
6377,
13662,
1115,
5124,
1118,
518,
22175,
4247,
703,
13662,
1159,
11724,
13,
4706,
313,
6377,
13662,
1115,
8853,
524,
1115,
29871,
29896,
11656,
518,
22175,
4247,
703,
13662,
1159,
11724,
13,
4706,
313,
6377,
13662,
1115,
426,
29896,
29901,
376,
1333,
29899,
29874,
29899,
1807,
29899,
1989,
29908,
11656,
518,
22175,
4247,
703,
13662,
1159,
11724,
13,
1678,
10353,
13,
29897,
13,
1753,
1243,
29918,
29887,
5428,
29918,
273,
29918,
20965,
29918,
5415,
29898,
21789,
29901,
10729,
25333,
29892,
5446,
29892,
3806,
29918,
2084,
1125,
13,
1678,
411,
1153,
4637,
29898,
6843,
8634,
2392,
29897,
408,
1059,
29918,
3888,
29901,
13,
4706,
6516,
29889,
12198,
29898,
5415,
29897,
13,
1678,
4974,
1059,
29918,
3888,
29889,
1767,
29889,
2084,
1275,
3806,
29918,
2084,
13,
13,
13,
1753,
1243,
29918,
29887,
5428,
29918,
273,
29918,
6310,
29918,
20698,
29898,
21789,
29901,
10729,
25333,
1125,
13,
1678,
13126,
353,
6516,
29889,
12198,
3319,
1800,
13,
1678,
4974,
13126,
29889,
5696,
338,
2665,
262,
295,
29889,
4381,
29918,
5696,
13,
1678,
4974,
13126,
29889,
2084,
338,
2665,
262,
295,
29889,
4381,
29918,
2084,
13,
1678,
4974,
13126,
29889,
13662,
338,
2665,
262,
295,
29889,
4381,
29918,
13662,
13,
1678,
4974,
13126,
29889,
7529,
338,
2665,
262,
295,
29889,
4381,
29918,
7529,
13,
1678,
4974,
13126,
29889,
2587,
338,
2665,
262,
295,
29889,
4381,
29918,
2587,
13,
13,
13,
29992,
3502,
29889,
3207,
300,
374,
911,
29898,
13,
1678,
4852,
5696,
29918,
5415,
613,
376,
9684,
4968,
13,
1678,
313,
13,
4706,
4852,
657,
613,
8108,
29889,
7194,
511,
13,
4706,
4852,
5438,
613,
8108,
29889,
5438,
511,
13,
4706,
4852,
22908,
613,
8108,
29889,
12336,
511,
13,
4706,
4852,
12498,
613,
8108,
29889,
2287,
18476,
511,
13,
1678,
10353,
13,
29897,
13,
1753,
1243,
29918,
29887,
5428,
29918,
29874,
29918,
3084,
29918,
5696,
29898,
21789,
29901,
10729,
25333,
29892,
1158,
29918,
5415,
29892,
3806,
1125,
13,
1678,
5446,
353,
8853,
5696,
1115,
23125,
703,
5696,
1159,
29913,
13,
1678,
6273,
353,
8853,
5696,
1115,
1158,
29918,
5415,
29913,
13,
1678,
13126,
353,
6516,
29889,
12198,
29898,
5415,
29892,
6273,
29897,
13,
1678,
4974,
13126,
29889,
5696,
338,
3806,
13,
13,
13,
29992,
3502,
29889,
3207,
300,
374,
911,
29898,
13,
1678,
4852,
13662,
29918,
5415,
613,
376,
9684,
4968,
13,
1678,
313,
13,
4706,
21313,
1118,
6571,
511,
13,
4706,
313,
6377,
4304,
1115,
6213,
29892,
376,
6310,
1115,
5124,
1118,
8853,
6310,
1115,
5124,
9594,
13,
4706,
313,
6377,
29876,
29896,
1115,
376,
29894,
29896,
613,
376,
29876,
29906,
1115,
376,
29894,
29906,
10758,
8853,
29876,
29896,
1115,
376,
29894,
29896,
613,
376,
29876,
29906,
1115,
376,
29894,
29906,
9092,
511,
13,
1678,
10353,
13,
29897,
13,
1753,
1243,
29918,
29887,
5428,
29918,
3084,
29918,
13662,
29898,
21789,
29901,
10729,
25333,
29892,
9066,
29918,
5415,
29892,
3806,
1125,
13,
1678,
5446,
353,
8853,
13662,
1115,
23125,
703,
13662,
1159,
29913,
13,
1678,
6273,
353,
8853,
13662,
1115,
9066,
29918,
5415,
29913,
13,
1678,
13126,
353,
6516,
29889,
12198,
29898,
5415,
29892,
6273,
29897,
13,
1678,
4974,
13126,
29889,
13662,
1275,
3806,
13,
13,
13,
1753,
1243,
29918,
29887,
5428,
29918,
273,
29918,
20965,
29918,
7529,
29898,
21789,
29901,
10729,
25333,
29892,
286,
8658,
1125,
13,
1678,
6633,
29918,
7529,
353,
286,
8658,
29889,
5041,
29898,
29888,
29908,
29912,
21738,
29954,
1836,
12198,
29918,
2271,
29918,
7529,
1159,
13,
1678,
6633,
29918,
7529,
29889,
2975,
29918,
15987,
353,
3831,
8634,
2392,
703,
7645,
613,
2943,
29922,
22175,
4247,
703,
29916,
5783,
13,
13,
1678,
411,
1153,
4637,
29898,
6843,
8634,
2392,
29897,
408,
1059,
29918,
3888,
29901,
13,
4706,
6516,
29889,
12198,
3319,
29908,
7529,
1115,
2665,
262,
295,
29889,
7529,
1800,
13,
1678,
4974,
1059,
29918,
3888,
29889,
1767,
29889,
2084,
1275,
518,
22175,
4247,
703,
7529,
4968,
405,
2795,
4247,
703,
29916,
13531,
13,
13,
1678,
6633,
29918,
7529,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
29879,
15440,
295,
29889,
7529,
29892,
6213,
29897,
13,
13,
13,
1753,
1243,
29918,
29887,
5428,
29918,
3084,
29918,
7529,
29898,
21789,
29901,
10729,
25333,
29892,
286,
8658,
1125,
13,
1678,
6633,
29918,
7529,
353,
286,
8658,
29889,
5041,
29898,
29888,
29908,
29912,
21738,
29954,
1836,
12198,
29918,
2271,
29918,
7529,
1159,
13,
1678,
6633,
29918,
7529,
29889,
2457,
29918,
1767,
353,
2665,
262,
295,
29889,
2388,
2356,
29918,
7529,
13,
13,
1678,
13126,
353,
6516,
29889,
12198,
3319,
29908,
7529,
1115,
2665,
262,
295,
29889,
7529,
1118,
2665,
262,
295,
29889,
5085,
29897,
13,
1678,
4974,
13126,
29889,
7529,
1275,
2665,
262,
295,
29889,
2388,
2356,
29918,
7529,
13,
13,
1678,
6633,
29918,
7529,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
29879,
15440,
295,
29889,
7529,
29892,
2665,
262,
295,
29889,
5085,
29897,
13,
13,
13,
1753,
1243,
29918,
29887,
5428,
29918,
20965,
29918,
2587,
29898,
21789,
29901,
10729,
25333,
29892,
3573,
1125,
13,
1678,
3573,
29889,
12198,
29889,
2975,
29918,
15987,
353,
3831,
8634,
2392,
703,
29916,
613,
2943,
29922,
3220,
287,
4247,
29898,
29896,
876,
13,
13,
1678,
411,
1153,
4637,
29898,
6843,
8634,
2392,
29897,
408,
1059,
29918,
3888,
29901,
13,
4706,
6516,
29889,
12198,
3319,
29908,
2587,
1115,
2665,
262,
295,
29889,
2587,
29918,
5415,
1800,
13,
1678,
4974,
1059,
29918,
3888,
29889,
1767,
29889,
2084,
1275,
518,
22175,
4247,
703,
2587,
4968,
11374,
287,
4247,
29898,
29896,
4638,
13,
13,
1678,
3573,
29889,
12198,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
29879,
15440,
295,
29889,
2587,
29918,
5415,
29892,
6213,
29897,
13,
13,
13,
1753,
1243,
29918,
29887,
5428,
29918,
3084,
29918,
2587,
29898,
21789,
29901,
10729,
25333,
29892,
3573,
1125,
13,
1678,
3573,
29889,
12198,
29889,
2457,
29918,
1767,
353,
2665,
262,
295,
29889,
2587,
13,
13,
1678,
13126,
353,
6516,
29889,
12198,
3319,
29908,
2587,
1115,
2665,
262,
295,
29889,
2587,
29918,
5415,
1118,
2665,
262,
295,
29889,
5085,
29897,
13,
1678,
4974,
13126,
29889,
2587,
338,
2665,
262,
295,
29889,
2587,
13,
13,
1678,
3573,
29889,
12198,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
29879,
15440,
295,
29889,
2587,
29918,
5415,
29892,
2665,
262,
295,
29889,
5085,
29897,
13,
13,
13,
1753,
1243,
29918,
29887,
5428,
29918,
29874,
29918,
1807,
29898,
21789,
29901,
10729,
25333,
1125,
13,
1678,
13126,
353,
6516,
29889,
12198,
29898,
15730,
703,
2084,
4968,
8853,
2084,
1115,
5591,
2084,
29908,
1800,
13,
1678,
4974,
13126,
29889,
5696,
338,
2665,
262,
295,
29889,
4381,
29918,
5696,
13,
1678,
4974,
13126,
29889,
2084,
1275,
5591,
2084,
29908,
13,
1678,
4974,
13126,
29889,
13662,
338,
2665,
262,
295,
29889,
4381,
29918,
13662,
13,
1678,
4974,
13126,
29889,
7529,
338,
2665,
262,
295,
29889,
4381,
29918,
7529,
13,
1678,
4974,
13126,
29889,
2587,
338,
2665,
262,
295,
29889,
4381,
29918,
2587,
13,
13,
13,
1753,
1243,
29918,
974,
29918,
4381,
29918,
1217,
29918,
2587,
29898,
21789,
29901,
10729,
25333,
29892,
3573,
29892,
286,
8658,
1125,
13,
1678,
274,
7345,
353,
286,
8658,
29889,
5041,
29898,
29888,
29908,
29912,
21738,
29954,
1836,
3089,
25333,
1159,
13,
1678,
274,
7345,
29889,
2457,
29918,
1767,
353,
2665,
262,
295,
29889,
21789,
29918,
974,
29918,
4381,
13,
13,
1678,
716,
29918,
4381,
353,
10729,
6843,
2356,
29898,
13,
4706,
1158,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
5696,
29892,
13,
4706,
2224,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
2084,
29892,
13,
4706,
9066,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
13662,
29892,
13,
4706,
8636,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
7529,
29892,
13,
1678,
1723,
13,
1678,
716,
29918,
21789,
353,
6516,
29889,
974,
29918,
4381,
29898,
1482,
29918,
4381,
29897,
13,
1678,
4974,
716,
29918,
21789,
338,
2665,
262,
295,
29889,
21789,
29918,
974,
29918,
4381,
13,
13,
1678,
274,
7345,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
3573,
29922,
2587,
29892,
13,
4706,
2322,
29922,
3089,
6843,
2356,
29898,
13,
9651,
1158,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
5696,
29892,
13,
9651,
2224,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
2084,
29892,
13,
9651,
9066,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
13662,
29892,
13,
9651,
8636,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
7529,
29892,
13,
9651,
3573,
29922,
29879,
15440,
295,
29889,
4381,
29918,
2587,
29892,
13,
4706,
10353,
13,
1678,
1723,
13,
1678,
3573,
29889,
974,
29918,
4381,
29889,
9294,
29918,
1333,
29918,
13998,
580,
13,
13,
13,
1753,
1243,
29918,
974,
29918,
4381,
29918,
2587,
29898,
21789,
29901,
10729,
25333,
29892,
3573,
29892,
286,
8658,
1125,
13,
1678,
274,
7345,
353,
286,
8658,
29889,
5041,
29898,
29888,
29908,
29912,
21738,
29954,
1836,
3089,
25333,
1159,
13,
1678,
274,
7345,
29889,
2457,
29918,
1767,
353,
2665,
262,
295,
29889,
21789,
29918,
974,
29918,
4381,
13,
13,
1678,
716,
29918,
4381,
353,
10729,
6843,
2356,
29898,
2587,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
2587,
29897,
13,
1678,
716,
29918,
21789,
353,
6516,
29889,
974,
29918,
4381,
29898,
1482,
29918,
4381,
29897,
13,
1678,
4974,
716,
29918,
21789,
338,
2665,
262,
295,
29889,
21789,
29918,
974,
29918,
4381,
13,
13,
1678,
274,
7345,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
3573,
29922,
29879,
15440,
295,
29889,
1482,
29918,
2587,
29918,
21789,
29892,
13,
4706,
2322,
29922,
3089,
6843,
2356,
29898,
13,
9651,
1158,
29922,
29879,
15440,
295,
29889,
4381,
29918,
5696,
29892,
13,
9651,
2224,
29922,
29879,
15440,
295,
29889,
4381,
29918,
2084,
29892,
13,
9651,
9066,
29922,
29879,
15440,
295,
29889,
4381,
29918,
13662,
29892,
13,
9651,
8636,
29922,
29879,
15440,
295,
29889,
4381,
29918,
7529,
29892,
13,
9651,
3573,
29922,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
2587,
29892,
13,
4706,
10353,
13,
1678,
1723,
13,
1678,
3573,
29889,
974,
29918,
4381,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
29879,
15440,
295,
29889,
1482,
29918,
4381,
29918,
2587,
29897,
13,
2
] |
skpr/inout/frc.py | PhilippPelz/scikit-pr-open | 0 | 1601830 | from pyE17.utils import imsave
from matplotlib import pyplot as plt
import numpy as np
from numpy.fft import fft2, ifftshift, fftshift, ifft2, fft, ifft
from scipy.ndimage.filters import gaussian_filter1d
from .plot import imsave
def taperarray(shape, edge):
xx, yy = np.mgrid[0:shape[0], 0:shape[1]]
xx1 = np.flipud(xx)
xx2 = np.minimum(xx, xx1)
yy1 = np.fliplr(yy)
yy2 = np.minimum(yy, yy1)
rr = np.minimum(xx2, yy2).astype(np.float)
rr[rr <= edge] /= edge
rr[rr > edge] = 1
rr *= np.pi / 2
rr = np.sin(rr)
# print xx2
# fig, ax = plt.subplots()
# imax = ax.imshow(rr)
# plt.colorbar(imax)
# plt.show()
return rr
def tapercircle(shape, edge, edgeloc=8 / 20.0, loc=(0, 0)):
x0, y0 = loc
xx, yy = np.meshgrid(np.arange(-shape[0] / 2, shape[0] / 2), np.arange(-shape[1] / 2, shape[1] / 2))
rr = np.sqrt((xx - x0) ** 2 + (yy - y0) ** 2)
rr -= (shape[0] * edgeloc - edge)
one = rr < 0
taper = np.logical_and(rr >= 0, rr <= edge)
zero = rr > edge
# rr[taper]
rr[zero] = 0
rr[taper] = np.abs(rr[taper] - np.max(rr[taper])) / np.max(rr[taper])
rr[one] = 1
return rr
def frc(im1, im2, annulus_width=1, edgetaper=5, edgeloc=8 / 20.0, loc=(0, 0), smooth=None, working_mask=None, x=None,
y=None, rmax=None, taper=None):
"""
r = radial_data(data,annulus_width,working_mask,x,y)
A function to reduce an image to a radial cross-section.
:INPUT:
data - whatever data you are radially averaging. Data is
binned into a series of annuli of width 'annulus_width'
pixels.
annulus_width - width of each annulus. Default is 1.
working_mask - array of same size as 'data', with zeros at
whichever 'data' points you don't want included
in the radial data computations.
x,y - coordinate system in which the data exists (used to set
the center of the data). By default, these are set to
integer meshgrids
rmax -- maximum radial value over which to compute statistics
:OUTPUT:
r - a data structure containing the following
statistics, computed across each annulus:
.r - the radial coordinate used (outer edge of annulus)
.mean - mean of the data in the annulus
.sum - the sum of all enclosed values at the given radius
.std - standard deviation of the data in the annulus
.median - median value in the annulus
.max - maximum value in the annulus
.min - minimum value in the annulus
.numel - number of elements in the annulus
:EXAMPLE:
::
import numpy as np
import pylab as py
import radial_data as rad
# Create coordinate grid
npix = 50.
x = np.arange(npix) - npix/2.
xx, yy = np.meshgrid(x, x)
r = np.sqrt(xx**2 + yy**2)
fake_psf = np.exp(-(r/5.)**2)
noise = 0.1 * np.random.normal(0, 1, r.size).reshape(r.shape)
simulation = fake_psf + noise
rad_stats = rad.radial_data(simulation, x=xx, y=yy)
py.figure()
py.plot(rad_stats.r, rad_stats.mean / rad_stats.std)
py.xlabel('Radial coordinate')
py.ylabel('Signal to Noise')
"""
# 2012-02-25 20:40 IJMC: Empty bins now have numel=0, not nan.
# 2012-02-04 17:41 IJMC: Added "SUM" flag
# 2010-11-19 16:36 IJC: Updated documentation for Sphinx
# 2010-03-10 19:22 IJC: Ported to python from Matlab
# 2005/12/19 Added 'working_region' option (IJC)
# 2005/12/15 Switched order of outputs (IJC)
# 2005/12/12 IJC: Removed decifact, changed name, wrote comments.
# 2005/11/04 by <NAME> at the Jet Propulsion Laboratory
import numpy as ny
class radialDat:
"""Empty object container.
"""
def __init__(self):
self.num = None
self.denom = None
self.T1bit = None
self.Thalfbit = None
# ---------------------
# Set up input parameters
# ---------------------
if working_mask == None:
working_mask = ny.ones(im1.shape, bool)
npix, npiy = im1.shape
if taper is not None:
taper0 = taper
else:
taper0 = tapercircle(im1.shape, edgetaper, edgeloc, loc)
f, a = plt.subplots()
a.imshow(imsave(im1 * taper0))
plt.title('tapered')
plt.show()
# taper0 = 1
F1 = fftshift(fft2(ifftshift(im1 * taper0)))
F2 = fftshift(fft2(ifftshift(im2 * taper0)))
F1F2_star = F1 * F2.conj()
if x == None or y == None:
x1 = ny.arange(-npix / 2., npix / 2.)
y1 = ny.arange(-npiy / 2., npiy / 2.)
x, y = ny.meshgrid(y1, x1)
r = abs(x + 1j * y)
if rmax == None:
rmax = r[working_mask].max()
# ---------------------
# Prepare the data container
# ---------------------
dr = ny.abs([x[0, 0] - x[0, 1]]) * annulus_width
radial = ny.arange(rmax / dr) * dr + dr / 2.
nrad = len(radial)
radialdata = radialDat()
radialdata.num = ny.zeros(nrad)
radialdata.denom = ny.zeros(nrad)
radialdata.T1bit = ny.zeros(nrad)
radialdata.Thalfbit = ny.zeros(nrad)
radialdata.r = radial / (npix / 2)
# ---------------------
# Loop through the bins
# ---------------------
for irad in range(nrad): # = 1:numel(radial)
minrad = irad * dr
maxrad = minrad + dr
thisindex = (r >= minrad) * (r < maxrad) * working_mask
# import pylab as py
# pdb.set_trace()
if not thisindex.ravel().any():
radialdata.num[irad] = ny.nan
radialdata.denom[irad] = ny.nan
radialdata.T1bit[irad] = ny.nan
radialdata.Thalfbit[irad] = ny.nan
else:
sqrt_n = np.sqrt(thisindex.astype(np.int).sum())
radialdata.num[irad] = np.real(F1F2_star[thisindex].sum())
radialdata.denom[irad] = ny.sqrt((ny.abs(F1[thisindex]) ** 2).sum() * (ny.abs(F2[thisindex]) ** 2).sum())
radialdata.T1bit[irad] = (0.5 + 2.4142 / sqrt_n) / (1.5 + 1.4142 / sqrt_n)
radialdata.Thalfbit[irad] = (0.2071 + 1.9102 / sqrt_n) / (1.2071 + 0.9102 / sqrt_n)
# ---------------------
# Return with data
# ---------------------
radialdata.frc = ny.nan_to_num(radialdata.num / radialdata.denom)
radialdata.frc[radialdata.frc < 0] = 0
if smooth is not None:
radialdata.frc = gaussian_filter1d(radialdata.frc, smooth)
take = radialdata.r <= 1.1
radialdata.r = radialdata.r[take]
radialdata.frc = radialdata.frc[take]
radialdata.T1bit = radialdata.T1bit[take]
radialdata.Thalfbit = radialdata.Thalfbit[take]
return radialdata | [
1,
515,
11451,
29923,
29896,
29955,
29889,
13239,
1053,
527,
7620,
13,
3166,
22889,
1053,
11451,
5317,
408,
14770,
13,
5215,
12655,
408,
7442,
13,
3166,
12655,
29889,
600,
29873,
1053,
285,
615,
29906,
29892,
565,
615,
10889,
29892,
285,
615,
10889,
29892,
565,
615,
29906,
29892,
285,
615,
29892,
565,
615,
13,
3166,
4560,
2272,
29889,
299,
3027,
29889,
26705,
1053,
330,
17019,
29918,
4572,
29896,
29881,
13,
3166,
869,
5317,
1053,
527,
7620,
13,
13,
1753,
260,
7202,
2378,
29898,
12181,
29892,
7636,
1125,
13,
1678,
15473,
29892,
343,
29891,
353,
7442,
29889,
29885,
7720,
29961,
29900,
29901,
12181,
29961,
29900,
1402,
29871,
29900,
29901,
12181,
29961,
29896,
5262,
13,
1678,
15473,
29896,
353,
7442,
29889,
29888,
3466,
566,
29898,
4419,
29897,
13,
1678,
15473,
29906,
353,
7442,
29889,
1195,
12539,
29898,
4419,
29892,
15473,
29896,
29897,
13,
1678,
343,
29891,
29896,
353,
7442,
29889,
20157,
572,
29878,
29898,
8071,
29897,
13,
1678,
343,
29891,
29906,
353,
7442,
29889,
1195,
12539,
29898,
8071,
29892,
343,
29891,
29896,
29897,
13,
1678,
364,
29878,
353,
7442,
29889,
1195,
12539,
29898,
4419,
29906,
29892,
343,
29891,
29906,
467,
579,
668,
29898,
9302,
29889,
7411,
29897,
13,
13,
1678,
364,
29878,
29961,
21478,
5277,
7636,
29962,
847,
29922,
7636,
13,
1678,
364,
29878,
29961,
21478,
1405,
7636,
29962,
353,
29871,
29896,
13,
1678,
364,
29878,
334,
29922,
7442,
29889,
1631,
847,
29871,
29906,
13,
1678,
364,
29878,
353,
7442,
29889,
5223,
29898,
21478,
29897,
13,
1678,
396,
1678,
1596,
15473,
29906,
13,
1678,
396,
1678,
2537,
29892,
4853,
353,
14770,
29889,
1491,
26762,
580,
13,
1678,
396,
1678,
527,
1165,
353,
4853,
29889,
326,
4294,
29898,
21478,
29897,
13,
1678,
396,
1678,
14770,
29889,
2780,
1646,
29898,
326,
1165,
29897,
13,
1678,
396,
1678,
14770,
29889,
4294,
580,
13,
1678,
736,
364,
29878,
13,
13,
13,
1753,
260,
7202,
16622,
29898,
12181,
29892,
7636,
29892,
1226,
7467,
542,
29922,
29947,
847,
29871,
29906,
29900,
29889,
29900,
29892,
1180,
7607,
29900,
29892,
29871,
29900,
22164,
13,
1678,
921,
29900,
29892,
343,
29900,
353,
1180,
13,
1678,
15473,
29892,
343,
29891,
353,
7442,
29889,
4467,
29882,
7720,
29898,
9302,
29889,
279,
927,
6278,
12181,
29961,
29900,
29962,
847,
29871,
29906,
29892,
8267,
29961,
29900,
29962,
847,
29871,
29906,
511,
7442,
29889,
279,
927,
6278,
12181,
29961,
29896,
29962,
847,
29871,
29906,
29892,
8267,
29961,
29896,
29962,
847,
29871,
29906,
876,
13,
1678,
364,
29878,
353,
7442,
29889,
3676,
3552,
4419,
448,
921,
29900,
29897,
3579,
29871,
29906,
718,
313,
8071,
448,
343,
29900,
29897,
3579,
29871,
29906,
29897,
13,
1678,
364,
29878,
22361,
313,
12181,
29961,
29900,
29962,
334,
1226,
7467,
542,
448,
7636,
29897,
13,
1678,
697,
353,
364,
29878,
529,
29871,
29900,
13,
1678,
260,
7202,
353,
7442,
29889,
1188,
936,
29918,
392,
29898,
21478,
6736,
29871,
29900,
29892,
364,
29878,
5277,
7636,
29897,
13,
1678,
5225,
353,
364,
29878,
1405,
7636,
13,
13,
1678,
396,
1678,
364,
29878,
29961,
29873,
7202,
29962,
13,
1678,
364,
29878,
29961,
9171,
29962,
353,
29871,
29900,
13,
1678,
364,
29878,
29961,
29873,
7202,
29962,
353,
7442,
29889,
6897,
29898,
21478,
29961,
29873,
7202,
29962,
448,
7442,
29889,
3317,
29898,
21478,
29961,
29873,
7202,
12622,
847,
7442,
29889,
3317,
29898,
21478,
29961,
29873,
7202,
2314,
13,
13,
1678,
364,
29878,
29961,
650,
29962,
353,
29871,
29896,
13,
13,
1678,
736,
364,
29878,
13,
13,
1753,
1424,
29883,
29898,
326,
29896,
29892,
527,
29906,
29892,
2889,
14999,
29918,
2103,
29922,
29896,
29892,
1226,
657,
7202,
29922,
29945,
29892,
1226,
7467,
542,
29922,
29947,
847,
29871,
29906,
29900,
29889,
29900,
29892,
1180,
7607,
29900,
29892,
29871,
29900,
511,
10597,
29922,
8516,
29892,
1985,
29918,
13168,
29922,
8516,
29892,
921,
29922,
8516,
29892,
13,
4706,
343,
29922,
8516,
29892,
364,
3317,
29922,
8516,
29892,
260,
7202,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
364,
353,
28373,
29918,
1272,
29898,
1272,
29892,
812,
14999,
29918,
2103,
29892,
22899,
29918,
13168,
29892,
29916,
29892,
29891,
29897,
13,
13,
1678,
319,
740,
304,
10032,
385,
1967,
304,
263,
28373,
4891,
29899,
2042,
29889,
13,
13,
1678,
584,
1177,
12336,
29901,
13,
418,
848,
259,
448,
6514,
848,
366,
526,
28373,
368,
4759,
6751,
29889,
29871,
3630,
338,
13,
795,
289,
27464,
964,
263,
3652,
310,
2889,
14549,
310,
2920,
525,
812,
14999,
29918,
2103,
29915,
13,
795,
17036,
29889,
13,
13,
418,
2889,
14999,
29918,
2103,
448,
2920,
310,
1269,
2889,
14999,
29889,
29871,
13109,
338,
29871,
29896,
29889,
13,
13,
418,
1985,
29918,
13168,
448,
1409,
310,
1021,
2159,
408,
525,
1272,
742,
411,
24786,
472,
13,
462,
4706,
377,
4070,
369,
525,
1272,
29915,
3291,
366,
1016,
29915,
29873,
864,
5134,
13,
462,
4706,
297,
278,
28373,
848,
2912,
800,
29889,
13,
13,
418,
921,
29892,
29891,
448,
14821,
1788,
297,
607,
278,
848,
4864,
313,
3880,
304,
731,
13,
1669,
278,
4818,
310,
278,
848,
467,
29871,
2648,
2322,
29892,
1438,
526,
731,
304,
13,
1669,
6043,
27716,
629,
4841,
13,
13,
418,
364,
3317,
1192,
7472,
28373,
995,
975,
607,
304,
10272,
13964,
13,
13,
1678,
584,
12015,
12336,
29901,
13,
4706,
364,
448,
263,
848,
3829,
6943,
278,
1494,
13,
462,
259,
13964,
29892,
15712,
4822,
1269,
2889,
14999,
29901,
13,
13,
3986,
869,
29878,
418,
448,
278,
28373,
14821,
1304,
313,
5561,
7636,
310,
2889,
14999,
29897,
13,
13,
3986,
869,
12676,
259,
448,
2099,
310,
278,
848,
297,
278,
2889,
14999,
13,
13,
3986,
869,
2083,
1678,
448,
278,
2533,
310,
599,
427,
15603,
1819,
472,
278,
2183,
11855,
13,
13,
3986,
869,
4172,
1678,
448,
3918,
29522,
310,
278,
848,
297,
278,
2889,
14999,
13,
13,
3986,
869,
2168,
713,
448,
19194,
995,
297,
278,
2889,
14999,
13,
13,
3986,
869,
3317,
1678,
448,
7472,
995,
297,
278,
2889,
14999,
13,
13,
3986,
869,
1195,
1678,
448,
9212,
995,
297,
278,
2889,
14999,
13,
13,
3986,
869,
1949,
295,
29871,
448,
1353,
310,
3161,
297,
278,
2889,
14999,
13,
13,
1678,
584,
5746,
19297,
1307,
29901,
13,
418,
4761,
13,
13,
4706,
1053,
12655,
408,
7442,
13,
4706,
1053,
282,
2904,
370,
408,
11451,
13,
4706,
1053,
28373,
29918,
1272,
408,
2971,
13,
13,
4706,
396,
6204,
14821,
6856,
13,
4706,
7442,
861,
353,
29871,
29945,
29900,
29889,
13,
4706,
921,
353,
7442,
29889,
279,
927,
29898,
9302,
861,
29897,
448,
7442,
861,
29914,
29906,
29889,
13,
4706,
15473,
29892,
343,
29891,
353,
7442,
29889,
4467,
29882,
7720,
29898,
29916,
29892,
921,
29897,
13,
4706,
364,
353,
7442,
29889,
3676,
29898,
4419,
1068,
29906,
718,
343,
29891,
1068,
29906,
29897,
13,
4706,
25713,
29918,
567,
29888,
353,
7442,
29889,
4548,
6278,
29898,
29878,
29914,
29945,
1846,
1068,
29906,
29897,
13,
4706,
11462,
353,
29871,
29900,
29889,
29896,
334,
7442,
29889,
8172,
29889,
8945,
29898,
29900,
29892,
29871,
29896,
29892,
364,
29889,
2311,
467,
690,
14443,
29898,
29878,
29889,
12181,
29897,
13,
4706,
17402,
353,
25713,
29918,
567,
29888,
718,
11462,
13,
13,
4706,
2971,
29918,
16202,
353,
2971,
29889,
3665,
616,
29918,
1272,
29898,
3601,
2785,
29892,
921,
29922,
4419,
29892,
343,
29922,
8071,
29897,
13,
13,
4706,
11451,
29889,
4532,
580,
13,
4706,
11451,
29889,
5317,
29898,
3665,
29918,
16202,
29889,
29878,
29892,
2971,
29918,
16202,
29889,
12676,
847,
2971,
29918,
16202,
29889,
4172,
29897,
13,
4706,
11451,
29889,
29916,
1643,
877,
9908,
616,
14821,
1495,
13,
4706,
11451,
29889,
29891,
1643,
877,
10140,
284,
304,
1939,
895,
1495,
13,
1678,
9995,
13,
13,
1678,
396,
29871,
29906,
29900,
29896,
29906,
29899,
29900,
29906,
29899,
29906,
29945,
29871,
29906,
29900,
29901,
29946,
29900,
306,
29967,
12513,
29901,
2812,
2349,
289,
1144,
1286,
505,
954,
295,
29922,
29900,
29892,
451,
23432,
29889,
13,
1678,
396,
29871,
29906,
29900,
29896,
29906,
29899,
29900,
29906,
29899,
29900,
29946,
29871,
29896,
29955,
29901,
29946,
29896,
306,
29967,
12513,
29901,
25601,
376,
25021,
29908,
7353,
13,
1678,
396,
29871,
29906,
29900,
29896,
29900,
29899,
29896,
29896,
29899,
29896,
29929,
29871,
29896,
29953,
29901,
29941,
29953,
306,
29967,
29907,
29901,
25723,
5106,
363,
317,
561,
14668,
13,
1678,
396,
29871,
29906,
29900,
29896,
29900,
29899,
29900,
29941,
29899,
29896,
29900,
29871,
29896,
29929,
29901,
29906,
29906,
306,
29967,
29907,
29901,
3371,
287,
304,
3017,
515,
5345,
8205,
13,
1678,
396,
29871,
29906,
29900,
29900,
29945,
29914,
29896,
29906,
29914,
29896,
29929,
25601,
525,
22899,
29918,
12803,
29915,
2984,
313,
29902,
29967,
29907,
29897,
13,
1678,
396,
29871,
29906,
29900,
29900,
29945,
29914,
29896,
29906,
29914,
29896,
29945,
28176,
287,
1797,
310,
14391,
313,
29902,
29967,
29907,
29897,
13,
1678,
396,
29871,
29906,
29900,
29900,
29945,
29914,
29896,
29906,
29914,
29896,
29906,
306,
29967,
29907,
29901,
5240,
8238,
1602,
7060,
29892,
3939,
1024,
29892,
5456,
6589,
29889,
13,
1678,
396,
29871,
29906,
29900,
29900,
29945,
29914,
29896,
29896,
29914,
29900,
29946,
491,
529,
5813,
29958,
472,
278,
27804,
18264,
25381,
16715,
7606,
13,
13,
1678,
1053,
12655,
408,
7098,
13,
13,
1678,
770,
28373,
16390,
29901,
13,
4706,
9995,
8915,
1203,
5639,
29889,
13,
4706,
9995,
13,
13,
4706,
822,
4770,
2344,
12035,
1311,
1125,
13,
9651,
1583,
29889,
1949,
353,
6213,
13,
9651,
1583,
29889,
1145,
290,
353,
6213,
13,
9651,
1583,
29889,
29911,
29896,
2966,
353,
6213,
13,
9651,
1583,
29889,
1349,
3131,
2966,
353,
6213,
13,
13,
1678,
396,
448,
2683,
807,
13,
1678,
396,
3789,
701,
1881,
4128,
13,
1678,
396,
448,
2683,
807,
13,
13,
1678,
565,
1985,
29918,
13168,
1275,
6213,
29901,
13,
4706,
1985,
29918,
13168,
353,
7098,
29889,
2873,
29898,
326,
29896,
29889,
12181,
29892,
6120,
29897,
13,
13,
1678,
7442,
861,
29892,
302,
1631,
29891,
353,
527,
29896,
29889,
12181,
13,
1678,
565,
260,
7202,
338,
451,
6213,
29901,
13,
4706,
260,
7202,
29900,
353,
260,
7202,
13,
1678,
1683,
29901,
13,
4706,
260,
7202,
29900,
353,
260,
7202,
16622,
29898,
326,
29896,
29889,
12181,
29892,
1226,
657,
7202,
29892,
1226,
7467,
542,
29892,
1180,
29897,
13,
1678,
285,
29892,
263,
353,
14770,
29889,
1491,
26762,
580,
13,
1678,
263,
29889,
326,
4294,
29898,
326,
7620,
29898,
326,
29896,
334,
260,
7202,
29900,
876,
13,
1678,
14770,
29889,
3257,
877,
29873,
7202,
287,
1495,
13,
1678,
14770,
29889,
4294,
580,
13,
1678,
396,
1678,
260,
7202,
29900,
353,
29871,
29896,
13,
1678,
383,
29896,
353,
285,
615,
10889,
29898,
600,
29873,
29906,
29898,
361,
615,
10889,
29898,
326,
29896,
334,
260,
7202,
29900,
4961,
13,
1678,
383,
29906,
353,
285,
615,
10889,
29898,
600,
29873,
29906,
29898,
361,
615,
10889,
29898,
326,
29906,
334,
260,
7202,
29900,
4961,
13,
1678,
383,
29896,
29943,
29906,
29918,
8508,
353,
383,
29896,
334,
383,
29906,
29889,
535,
29926,
580,
13,
13,
1678,
565,
921,
1275,
6213,
470,
343,
1275,
6213,
29901,
13,
4706,
921,
29896,
353,
7098,
29889,
279,
927,
6278,
9302,
861,
847,
29871,
29906,
1696,
7442,
861,
847,
29871,
29906,
1846,
13,
4706,
343,
29896,
353,
7098,
29889,
279,
927,
6278,
29876,
1631,
29891,
847,
29871,
29906,
1696,
302,
1631,
29891,
847,
29871,
29906,
1846,
13,
4706,
921,
29892,
343,
353,
7098,
29889,
4467,
29882,
7720,
29898,
29891,
29896,
29892,
921,
29896,
29897,
13,
13,
1678,
364,
353,
6425,
29898,
29916,
718,
29871,
29896,
29926,
334,
343,
29897,
13,
13,
1678,
565,
364,
3317,
1275,
6213,
29901,
13,
4706,
364,
3317,
353,
364,
29961,
22899,
29918,
13168,
1822,
3317,
580,
13,
13,
1678,
396,
448,
2683,
807,
13,
1678,
396,
349,
3445,
598,
278,
848,
5639,
13,
1678,
396,
448,
2683,
807,
13,
1678,
4192,
353,
7098,
29889,
6897,
4197,
29916,
29961,
29900,
29892,
29871,
29900,
29962,
448,
921,
29961,
29900,
29892,
29871,
29896,
24960,
334,
2889,
14999,
29918,
2103,
13,
1678,
28373,
353,
7098,
29889,
279,
927,
29898,
29878,
3317,
847,
4192,
29897,
334,
4192,
718,
4192,
847,
29871,
29906,
29889,
13,
1678,
302,
3665,
353,
7431,
29898,
3665,
616,
29897,
13,
1678,
28373,
1272,
353,
28373,
16390,
580,
13,
1678,
28373,
1272,
29889,
1949,
353,
7098,
29889,
3298,
359,
29898,
29876,
3665,
29897,
13,
1678,
28373,
1272,
29889,
1145,
290,
353,
7098,
29889,
3298,
359,
29898,
29876,
3665,
29897,
13,
1678,
28373,
1272,
29889,
29911,
29896,
2966,
353,
7098,
29889,
3298,
359,
29898,
29876,
3665,
29897,
13,
1678,
28373,
1272,
29889,
1349,
3131,
2966,
353,
7098,
29889,
3298,
359,
29898,
29876,
3665,
29897,
13,
1678,
28373,
1272,
29889,
29878,
353,
28373,
847,
313,
9302,
861,
847,
29871,
29906,
29897,
13,
13,
1678,
396,
448,
2683,
807,
13,
1678,
396,
21493,
1549,
278,
289,
1144,
13,
1678,
396,
448,
2683,
807,
13,
1678,
363,
3805,
328,
297,
3464,
29898,
29876,
3665,
1125,
29871,
396,
353,
29871,
29896,
29901,
1949,
295,
29898,
3665,
616,
29897,
13,
4706,
1375,
3665,
353,
3805,
328,
334,
4192,
13,
4706,
4236,
3665,
353,
1375,
3665,
718,
4192,
13,
4706,
445,
2248,
353,
313,
29878,
6736,
1375,
3665,
29897,
334,
313,
29878,
529,
4236,
3665,
29897,
334,
1985,
29918,
13168,
13,
4706,
396,
1053,
282,
2904,
370,
408,
11451,
13,
4706,
396,
282,
2585,
29889,
842,
29918,
15003,
580,
13,
4706,
565,
451,
445,
2248,
29889,
336,
955,
2141,
1384,
7295,
13,
9651,
28373,
1272,
29889,
1949,
29961,
381,
328,
29962,
353,
7098,
29889,
13707,
13,
9651,
28373,
1272,
29889,
1145,
290,
29961,
381,
328,
29962,
353,
7098,
29889,
13707,
13,
9651,
28373,
1272,
29889,
29911,
29896,
2966,
29961,
381,
328,
29962,
353,
7098,
29889,
13707,
13,
9651,
28373,
1272,
29889,
1349,
3131,
2966,
29961,
381,
328,
29962,
353,
7098,
29889,
13707,
13,
4706,
1683,
29901,
13,
9651,
18074,
2273,
29918,
29876,
353,
7442,
29889,
3676,
29898,
1366,
2248,
29889,
579,
668,
29898,
9302,
29889,
524,
467,
2083,
3101,
13,
9651,
28373,
1272,
29889,
1949,
29961,
381,
328,
29962,
353,
7442,
29889,
6370,
29898,
29943,
29896,
29943,
29906,
29918,
8508,
29961,
1366,
2248,
1822,
2083,
3101,
13,
9651,
28373,
1272,
29889,
1145,
290,
29961,
381,
328,
29962,
353,
7098,
29889,
3676,
3552,
1460,
29889,
6897,
29898,
29943,
29896,
29961,
1366,
2248,
2314,
3579,
29871,
29906,
467,
2083,
580,
334,
313,
1460,
29889,
6897,
29898,
29943,
29906,
29961,
1366,
2248,
2314,
3579,
29871,
29906,
467,
2083,
3101,
13,
9651,
28373,
1272,
29889,
29911,
29896,
2966,
29961,
381,
328,
29962,
353,
313,
29900,
29889,
29945,
718,
29871,
29906,
29889,
29946,
29896,
29946,
29906,
847,
18074,
2273,
29918,
29876,
29897,
847,
313,
29896,
29889,
29945,
718,
29871,
29896,
29889,
29946,
29896,
29946,
29906,
847,
18074,
2273,
29918,
29876,
29897,
13,
9651,
28373,
1272,
29889,
1349,
3131,
2966,
29961,
381,
328,
29962,
353,
313,
29900,
29889,
29906,
29900,
29955,
29896,
718,
29871,
29896,
29889,
29929,
29896,
29900,
29906,
847,
18074,
2273,
29918,
29876,
29897,
847,
313,
29896,
29889,
29906,
29900,
29955,
29896,
718,
29871,
29900,
29889,
29929,
29896,
29900,
29906,
847,
18074,
2273,
29918,
29876,
29897,
13,
13,
1678,
396,
448,
2683,
807,
13,
1678,
396,
7106,
411,
848,
13,
1678,
396,
448,
2683,
807,
13,
1678,
28373,
1272,
29889,
1341,
29883,
353,
7098,
29889,
13707,
29918,
517,
29918,
1949,
29898,
3665,
616,
1272,
29889,
1949,
847,
28373,
1272,
29889,
1145,
290,
29897,
13,
1678,
28373,
1272,
29889,
1341,
29883,
29961,
3665,
616,
1272,
29889,
1341,
29883,
529,
29871,
29900,
29962,
353,
29871,
29900,
13,
1678,
565,
10597,
338,
451,
6213,
29901,
13,
4706,
28373,
1272,
29889,
1341,
29883,
353,
330,
17019,
29918,
4572,
29896,
29881,
29898,
3665,
616,
1272,
29889,
1341,
29883,
29892,
10597,
29897,
13,
1678,
2125,
353,
28373,
1272,
29889,
29878,
5277,
29871,
29896,
29889,
29896,
13,
1678,
28373,
1272,
29889,
29878,
353,
28373,
1272,
29889,
29878,
29961,
19730,
29962,
13,
1678,
28373,
1272,
29889,
1341,
29883,
353,
28373,
1272,
29889,
1341,
29883,
29961,
19730,
29962,
13,
1678,
28373,
1272,
29889,
29911,
29896,
2966,
353,
28373,
1272,
29889,
29911,
29896,
2966,
29961,
19730,
29962,
13,
1678,
28373,
1272,
29889,
1349,
3131,
2966,
353,
28373,
1272,
29889,
1349,
3131,
2966,
29961,
19730,
29962,
13,
1678,
736,
28373,
1272,
2
] |
eval/beat_scores_calc.py | StoneYeY/Beat-Detection | 0 | 61620 | #!/usr/bin/env python
# encoding: utf-8
"""
calc beat score of files
copyright: www.mgtv.com
"""
import os
import sys
import argparse
import numpy as np
import traceback
import beat_evaluation_toolbox as be
def calc_beat_score_of_file(annotation_file, beat_file):
#check input params
if os.path.exists(annotation_file) == False:
print("failed! annotation_file:%s not exist\n" % (annotation_file))
return False, 0.0
if os.path.exists(beat_file) == False:
print("failed! beat_file:%s not exist\n" % (beat_file))
return False, 0.0
data_annotation = np.loadtxt(annotation_file, usecols=(0))
data_annotation = np.expand_dims(data_annotation, axis=0)
data_beat = np.loadtxt(beat_file, usecols=(0))
data_beat = np.expand_dims(data_beat, axis=0)
R = be.evaluate_db(data_annotation, data_beat, 'all', doCI=False)
#输出结果
print(R['scores'])
pscore = R['scores']['pScore'][0]
f_measure = R['scores']['fMeasure'][0]
aml_c = R['scores']['amlC'][0]
aml_t = R['scores']['amlT'][0]
cml_c = R['scores']['cmlC'][0]
cml_t = R['scores']['cmlT'][0]
cem_acc = R['scores']['cemgilAcc'][0]
total_score = (aml_c + cem_acc + cml_c + f_measure + pscore + cml_t + aml_t) / 7
print("[%s] score:%.4f"%(beat_file, total_score))
return True, total_score
def calc_avg_score_of_files(annotation_files_dir, beat_files_dir, file_extension):
#check input params
if os.path.exists(annotation_files_dir) == False:
print("failed! annotation_files_dir:%s not exist\n" % (annotation_files_dir))
return False, 0.0
if os.path.exists(beat_files_dir) == False:
print("failed! beat_files_dir:%s not exist\n" % (beat_files_dir))
return False, 0.0
if not annotation_files_dir.endswith("/"):
annotation_files_dir += "/"
if not beat_files_dir.endswith("/"):
beat_files_dir += "/"
annotation_files_url = [f for f in os.listdir(annotation_files_dir) if f.endswith((file_extension))]
nb_annotation_files = len(annotation_files_url)
beat_files_url = [f for f in os.listdir(beat_files_dir) if f.endswith((file_extension))]
nb_beat_files = len(beat_files_url)
if nb_annotation_files != nb_beat_files or nb_annotation_files == 0:
print("failed! annotation files num:%d beat files num:%d\n" % (nb_annotation_files, nb_beat_files))
return False, 0.0
sum_score = 0.0
for i in range(nb_annotation_files):
annotation_file = annotation_files_dir + annotation_files_url[i]
beat_file = beat_files_dir + annotation_files_url[i]
if os.path.exists(beat_file) == False:
print("failed! beat file:%s not exist\n" % (beat_file))
return False, 0.0
ret, score = calc_beat_score_of_file(annotation_file, beat_file)
if ret == False:
print("failed! calc_beat_score_of_file failed for file:%s\n" % (beat_file))
return False, 0.0
sum_score = sum_score + score
avg_score = sum_score / nb_annotation_files
return True, avg_score
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="calc avg score of beat(downbeat) files")
parser.add_argument("--annotation_files_dir", required=True, help="Path to input annotation files dir", default="")
parser.add_argument("--beat_files_dir", required=True, help="Path to input beats files dir", default="")
parser.add_argument("--file_extension", required=True, help="File ext, beat or downbeat", default="")
# 获得工作目录,程序模块名称,并切换工作目录
s_work_path, s_module_name = os.path.split(os.path.abspath(sys.argv[0]))
print(s_work_path, s_module_name)
os.chdir(s_work_path)
try:
args = parser.parse_args()
ret, score = calc_avg_score_of_files(args.annotation_files_dir, args.beat_files_dir, args.file_extension)
print("Final score:%.4f" % score)
except Exception as e:
traceback.print_exc()
print("Exception running beat_score_calc: [%s]" % (str(e)))
ret = False
if ret == True:
sys.exit(0)
else:
sys.exit(1)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
8025,
29901,
23616,
29899,
29947,
13,
15945,
29908,
13,
28667,
16646,
8158,
310,
2066,
13,
8552,
1266,
29901,
7821,
29889,
29885,
4141,
29894,
29889,
510,
13,
15945,
29908,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
1852,
5510,
13,
5215,
12655,
408,
7442,
13,
5215,
9637,
1627,
13,
5215,
16646,
29918,
24219,
362,
29918,
10154,
1884,
408,
367,
13,
13,
308,
13,
1753,
22235,
29918,
915,
271,
29918,
13628,
29918,
974,
29918,
1445,
29898,
18317,
29918,
1445,
29892,
16646,
29918,
1445,
1125,
13,
1678,
396,
3198,
1881,
8636,
308,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
18317,
29918,
1445,
29897,
1275,
7700,
29901,
13,
4706,
1596,
703,
26061,
29991,
17195,
29918,
1445,
16664,
29879,
451,
1863,
29905,
29876,
29908,
1273,
313,
18317,
29918,
1445,
876,
13,
4706,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
308,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
915,
271,
29918,
1445,
29897,
1275,
7700,
29901,
13,
4706,
1596,
703,
26061,
29991,
16646,
29918,
1445,
16664,
29879,
451,
1863,
29905,
29876,
29908,
1273,
313,
915,
271,
29918,
1445,
876,
13,
4706,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
308,
13,
308,
13,
1678,
848,
29918,
18317,
353,
7442,
29889,
1359,
3945,
29898,
18317,
29918,
1445,
29892,
671,
22724,
7607,
29900,
876,
13,
1678,
848,
29918,
18317,
353,
7442,
29889,
18837,
29918,
6229,
29879,
29898,
1272,
29918,
18317,
29892,
9685,
29922,
29900,
29897,
13,
13,
308,
13,
1678,
848,
29918,
915,
271,
353,
7442,
29889,
1359,
3945,
29898,
915,
271,
29918,
1445,
29892,
671,
22724,
7607,
29900,
876,
13,
1678,
848,
29918,
915,
271,
353,
7442,
29889,
18837,
29918,
6229,
29879,
29898,
1272,
29918,
915,
271,
29892,
9685,
29922,
29900,
29897,
13,
268,
13,
1678,
390,
353,
367,
29889,
24219,
403,
29918,
2585,
29898,
1272,
29918,
18317,
29892,
848,
29918,
915,
271,
29892,
525,
497,
742,
437,
8426,
29922,
8824,
29897,
13,
268,
13,
1678,
396,
31573,
30544,
31320,
30801,
13,
1678,
1596,
29898,
29934,
1839,
1557,
2361,
11287,
13,
1678,
282,
13628,
353,
390,
1839,
1557,
2361,
16215,
29886,
20097,
2033,
29961,
29900,
29962,
13,
1678,
285,
29918,
26658,
353,
390,
1839,
1557,
2361,
16215,
29888,
6816,
3745,
2033,
29961,
29900,
29962,
13,
268,
13,
1678,
626,
29880,
29918,
29883,
353,
390,
1839,
1557,
2361,
16215,
8807,
29907,
2033,
29961,
29900,
29962,
13,
1678,
626,
29880,
29918,
29873,
353,
390,
1839,
1557,
2361,
16215,
8807,
29911,
2033,
29961,
29900,
29962,
13,
1678,
274,
828,
29918,
29883,
353,
390,
1839,
1557,
2361,
16215,
29883,
828,
29907,
2033,
29961,
29900,
29962,
13,
1678,
274,
828,
29918,
29873,
353,
390,
1839,
1557,
2361,
16215,
29883,
828,
29911,
2033,
29961,
29900,
29962,
13,
268,
13,
1678,
274,
331,
29918,
5753,
353,
390,
1839,
1557,
2361,
16215,
19335,
29887,
309,
7504,
2033,
29961,
29900,
29962,
13,
268,
13,
1678,
3001,
29918,
13628,
353,
313,
8807,
29918,
29883,
718,
274,
331,
29918,
5753,
718,
274,
828,
29918,
29883,
29871,
718,
285,
29918,
26658,
718,
282,
13628,
718,
274,
828,
29918,
29873,
718,
626,
29880,
29918,
29873,
29897,
847,
29871,
29955,
13,
1678,
1596,
703,
29961,
29995,
29879,
29962,
8158,
29901,
15543,
29946,
29888,
29908,
29995,
29898,
915,
271,
29918,
1445,
29892,
3001,
29918,
13628,
876,
13,
1678,
736,
5852,
29892,
3001,
29918,
13628,
13,
13,
13,
13,
1753,
22235,
29918,
485,
29887,
29918,
13628,
29918,
974,
29918,
5325,
29898,
18317,
29918,
5325,
29918,
3972,
29892,
16646,
29918,
5325,
29918,
3972,
29892,
934,
29918,
17588,
1125,
13,
1678,
396,
3198,
1881,
8636,
308,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
18317,
29918,
5325,
29918,
3972,
29897,
1275,
7700,
29901,
13,
4706,
1596,
703,
26061,
29991,
17195,
29918,
5325,
29918,
3972,
16664,
29879,
451,
1863,
29905,
29876,
29908,
1273,
313,
18317,
29918,
5325,
29918,
3972,
876,
13,
4706,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
308,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
915,
271,
29918,
5325,
29918,
3972,
29897,
1275,
7700,
29901,
13,
4706,
1596,
703,
26061,
29991,
16646,
29918,
5325,
29918,
3972,
16664,
29879,
451,
1863,
29905,
29876,
29908,
1273,
313,
915,
271,
29918,
5325,
29918,
3972,
876,
13,
4706,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
308,
13,
1678,
565,
451,
17195,
29918,
5325,
29918,
3972,
29889,
1975,
2541,
11974,
29908,
1125,
13,
4706,
17195,
29918,
5325,
29918,
3972,
4619,
5591,
29908,
13,
13,
1678,
565,
451,
16646,
29918,
5325,
29918,
3972,
29889,
1975,
2541,
11974,
29908,
1125,
13,
4706,
16646,
29918,
5325,
29918,
3972,
4619,
5591,
29908,
13,
13,
1678,
17195,
29918,
5325,
29918,
2271,
353,
518,
29888,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
18317,
29918,
5325,
29918,
3972,
29897,
565,
285,
29889,
1975,
2541,
3552,
1445,
29918,
17588,
28166,
13,
1678,
302,
29890,
29918,
18317,
29918,
5325,
353,
7431,
29898,
18317,
29918,
5325,
29918,
2271,
29897,
13,
13,
1678,
16646,
29918,
5325,
29918,
2271,
353,
518,
29888,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
915,
271,
29918,
5325,
29918,
3972,
29897,
565,
285,
29889,
1975,
2541,
3552,
1445,
29918,
17588,
28166,
13,
1678,
302,
29890,
29918,
915,
271,
29918,
5325,
353,
7431,
29898,
915,
271,
29918,
5325,
29918,
2271,
29897,
13,
268,
13,
1678,
565,
302,
29890,
29918,
18317,
29918,
5325,
2804,
302,
29890,
29918,
915,
271,
29918,
5325,
470,
302,
29890,
29918,
18317,
29918,
5325,
1275,
29871,
29900,
29901,
13,
4706,
1596,
703,
26061,
29991,
17195,
2066,
954,
16664,
29881,
29871,
16646,
2066,
954,
16664,
29881,
29905,
29876,
29908,
1273,
313,
9877,
29918,
18317,
29918,
5325,
29892,
302,
29890,
29918,
915,
271,
29918,
5325,
876,
13,
4706,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
268,
13,
1678,
2533,
29918,
13628,
353,
29871,
29900,
29889,
29900,
13,
1678,
363,
474,
297,
3464,
29898,
9877,
29918,
18317,
29918,
5325,
1125,
13,
4706,
17195,
29918,
1445,
353,
17195,
29918,
5325,
29918,
3972,
718,
17195,
29918,
5325,
29918,
2271,
29961,
29875,
29962,
13,
4706,
16646,
29918,
1445,
353,
16646,
29918,
5325,
29918,
3972,
718,
17195,
29918,
5325,
29918,
2271,
29961,
29875,
29962,
13,
308,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
915,
271,
29918,
1445,
29897,
1275,
7700,
29901,
13,
9651,
1596,
703,
26061,
29991,
16646,
934,
16664,
29879,
451,
1863,
29905,
29876,
29908,
1273,
313,
915,
271,
29918,
1445,
876,
13,
9651,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
632,
13,
4706,
3240,
29892,
8158,
353,
22235,
29918,
915,
271,
29918,
13628,
29918,
974,
29918,
1445,
29898,
18317,
29918,
1445,
29892,
16646,
29918,
1445,
29897,
13,
4706,
565,
3240,
1275,
7700,
29901,
13,
9651,
1596,
703,
26061,
29991,
22235,
29918,
915,
271,
29918,
13628,
29918,
974,
29918,
1445,
5229,
363,
934,
16664,
29879,
29905,
29876,
29908,
1273,
313,
915,
271,
29918,
1445,
876,
13,
9651,
736,
7700,
29892,
29871,
29900,
29889,
29900,
13,
632,
13,
4706,
2533,
29918,
13628,
353,
2533,
29918,
13628,
718,
8158,
13,
268,
13,
1678,
1029,
29887,
29918,
13628,
353,
2533,
29918,
13628,
847,
302,
29890,
29918,
18317,
29918,
5325,
13,
1678,
13,
1678,
736,
5852,
29892,
1029,
29887,
29918,
13628,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
543,
28667,
1029,
29887,
8158,
310,
16646,
29898,
3204,
915,
271,
29897,
2066,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
18317,
29918,
5325,
29918,
3972,
613,
3734,
29922,
5574,
29892,
1371,
543,
2605,
304,
1881,
17195,
2066,
4516,
613,
2322,
543,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
915,
271,
29918,
5325,
29918,
3972,
613,
3734,
29922,
5574,
29892,
1371,
543,
2605,
304,
1881,
367,
1446,
2066,
4516,
613,
2322,
543,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
1445,
29918,
17588,
613,
3734,
29922,
5574,
29892,
1371,
543,
2283,
1294,
29892,
16646,
470,
1623,
915,
271,
613,
2322,
543,
1159,
13,
268,
13,
1678,
396,
29871,
31024,
31050,
31041,
30732,
30895,
31283,
30214,
31101,
31463,
31382,
232,
160,
154,
30548,
31685,
30214,
31666,
31757,
31640,
31041,
30732,
30895,
31283,
13,
1678,
269,
29918,
1287,
29918,
2084,
29892,
269,
29918,
5453,
29918,
978,
353,
2897,
29889,
2084,
29889,
5451,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
9675,
29889,
19218,
29961,
29900,
12622,
13,
1678,
1596,
29898,
29879,
29918,
1287,
29918,
2084,
29892,
269,
29918,
5453,
29918,
978,
29897,
13,
1678,
2897,
29889,
305,
3972,
29898,
29879,
29918,
1287,
29918,
2084,
29897,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
4706,
3240,
29892,
8158,
353,
22235,
29918,
485,
29887,
29918,
13628,
29918,
974,
29918,
5325,
29898,
5085,
29889,
18317,
29918,
5325,
29918,
3972,
29892,
6389,
29889,
915,
271,
29918,
5325,
29918,
3972,
29892,
6389,
29889,
1445,
29918,
17588,
29897,
13,
4706,
1596,
703,
15790,
8158,
29901,
15543,
29946,
29888,
29908,
1273,
8158,
29897,
13,
632,
13,
1678,
5174,
8960,
408,
321,
29901,
308,
13,
4706,
9637,
1627,
29889,
2158,
29918,
735,
29883,
580,
13,
4706,
1596,
703,
2451,
2734,
16646,
29918,
13628,
29918,
28667,
29901,
518,
29995,
29879,
18017,
1273,
313,
710,
29898,
29872,
4961,
13,
4706,
3240,
353,
7700,
13,
308,
13,
1678,
565,
3240,
1275,
5852,
29901,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
1678,
1683,
29901,
13,
4706,
10876,
29889,
13322,
29898,
29896,
29897,
13,
2
] |
Proxy_network/seq2seqSummariser.py | quilan78/MSC_project | 0 | 1601164 | <reponame>quilan78/MSC_project
import numpy as np
from encoder import *
from embedding import *
from decoder import *
from lstm import *
from utils import *
import sys
sys.path.append('/home/dwt17/MSc_project/neural_sum_1/code/Commons/')
sys.path.append('../Commons/')
from vocab import *
from stateReducer import *
from denseLayer import *
class Seq2seqSummariser:
"""
Class that represent the entire architecture end to end
Variable :
cellSize is the dimension of the hidden layers in the LSTM cell
embeddingSize is the dimension of the input
attentionSize is the dimension of the attention vector
vocabSize is the number of words
max_encoding_length is the size of the input sequence
max_decoding_length is the size of the output sequence
"""
def __init__(self, cellSize = 128, embeddingSize=64, attentionSize=128, vocabSize=150000, max_encoding_length=200, max_decoding_length=50, vocab_path="../data/useful files/"):
self.cellSize = cellSize
self.embeddingSize = embeddingSize
self.attentionSize = attentionSize
self.vocabSize = vocabSize
self.max_encoding_length = max_encoding_length
self.max_decoding_length = max_decoding_length
self.embedding = None
self.encoder = None
self.decoder = None
self.stateReducer = None
self.denseLayer = None
self.vocab = Vocab(path=vocab_path)
self.vocabSize =self. vocab.LoadVocab(max_size=vocabSize)
def _initialise_embedding(self, embedding_matrix):
self.embedding = Embedding(embedding_matrix)
assert self.vocabSize == self.embedding.vocabSize
assert self.embeddingSize == self.embedding.embeddingSize
def _initialise_encoder(self, kernel_forward, bias_forward, kernel_backward, bias_backward):
"""
Initialise the encoder
The kernel are as given by Tensorflow, so of size (embedding + cellSize) x 4*cellSize
Bias are of shape (4*cellSize, )
"""
lstm_forward = Lstm(kernel_forward, bias_forward, self.cellSize)
lstm_backward = Lstm(kernel_backward, bias_backward, self.cellSize)
assert lstm_forward.embeddingSize == self.embeddingSize
assert lstm_backward.embeddingSize == self.embeddingSize
self.encoder = Encoder( lstm_forward=lstm_forward, lstm_backward=lstm_backward, cellSize=self.cellSize, embeddingSize = self.embeddingSize, max_encoding_length=self.max_encoding_length)
def _initialise_stateReducer(self, W_h, W_c, b_h, b_c):
"""
Initialise the state Reducer from the encoder and the decoder
The matrices as given by tensorflow are transposed
"""
self.stateReducer = StateReducer(W_h = W_h,
W_c = W_c,
b_h = b_h,
b_c = b_c)
def _initialise_decoder(self, kernel, bias, memoryLayer, queryLayer, attentionV, attentonLayer):
cell = Lstm(kernel, bias, self.cellSize )
self.decoder = Decoder(lstm_cell=cell,
cellSize=self.cellSize,
attentionSize=self.attentionSize,
max_decoding_length=self.max_decoding_length,
memoryLayer=memoryLayer,
queryLayer=queryLayer,
attentionV = attentionV,
attentonLayer=attentonLayer)
def _initialise_DenseLayer(self, kernel, bias):
self.denseLayer = DenseLayer(kernel = kernel,
bias = bias)
def compute_forward(self, input_seq_int, dec_seq_int):
"""
Compute all the states of the network for the specific input
input : sequence of words
"""
#integer_seq_inp = self.vocab.TransalteSentence(input_seq)
#print(dec_seq_int)
embedded_inp_seq = self.embedding.transform_input(input_seq_int)
forward_encoder_states, backward_encoder_states = self.encoder.compute_encoding(embedded_inp_seq)
#print("Comparing the transmitted states C")
#print(np.linalg.norm(forward_encoder_states[-1]["c"]))
#print(np.linalg.norm(backward_encoder_states[0]["c"]))
h, c = self.stateReducer.compute_reduction(forward_encoder_states[-1], backward_encoder_states[0])
#integer_seq_out = self.vocab.TransalteSentence(dec_seq)
embedded_dec_seq = self.embedding.transform_input([self.vocab.start_decode_id] + dec_seq_int)
decoder_states = self.decoder.compute_decoding(embedded_dec_seq, h, c, forward_encoder_states, backward_encoder_states, self.denseLayer, self.embedding)
#print("compare context vectors")
#print(decoder_states[0]["lstm"]["last_c"][:10])
#print(np.max(decoder_states[0]["lstm"]["f"]))
#print(decoder_states[0]["lstm"]["f"][:10])
#print(c[:10])
return forward_encoder_states, backward_encoder_states, h, c, decoder_states
def countParams(self):
count = 0
count += self.embedding.countParams()
count += self.encoder.countParams()
count += self.decoder.countParams()
count += self.stateReducer.countParams()
count += self.denseLayer.countParams()
return count
def computeLRP(self, targets, start_decode=False):
"""
Compute the LRP for the entire network
Input :
targets : of shape (max_decoding_length, vocab_size). Table of True of False. If the position (i,j) is true, then we want to compute the relevance for the prediction we had of word number j at the decoding step i
"""
decoder_states = self.decoder.outputs
forward_encoder_states = self.encoder.forward_encoder_states
backward_encoder_states = self.encoder.backward_encoder_states
output_relevance = []
for i in range(self.max_decoding_length):
output_relevance.append(np.zeros((self.vocabSize, 1)))
for j in range(self.vocabSize):
if targets[i][j]:
output_relevance[i][j] = softmax(decoder_states[i]["output"])[j]
print(np.sum(output_relevance))
h_relevance, c_relevance, forward_encoder_relevance, backward_encoder_relevance, decoder_input_relevance, rest_relevance = self.decoder.computeLRP(output_relevance, self.denseLayer, forward_encoder_states, backward_encoder_states, transmit_input=False, start_decode=start_decode)
#h_relevance = np.random.random_sample((self.cellSize, 1)) *10 -5
#c_relevance = np.random.random_sample((self.cellSize, 1)) *10 -5
print("Check conservation After decoding")
print(np.sum(output_relevance))
print(np.sum(h_relevance)+ np.sum(c_relevance)+ np.sum(forward_encoder_relevance)+ np.sum(backward_encoder_relevance) + np.sum(np.sum(decoder_input_relevance)) + np.sum(rest_relevance))
#print(rest_relevance)
#print("Length of the attention shit")
#print(len(forward_encoder_relevance))
last_forward_h_relevance, last_backward_h_relevance, last_forward_c_relevance, last_backward_c_relevance = self.stateReducer.computeLRP(h_relevance, c_relevance)
#print(np.linalg.norm(last_forward_h_relevance))
#print(np.linalg.norm(last_backward_h_relevance))
#print(np.linalg.norm(last_forward_c_relevance))
#print(np.linalg.norm(last_backward_c_relevance))
print("Check conservation State reducer")
print(np.sum(h_relevance) + np.sum(c_relevance))
print(np.sum(last_forward_h_relevance)+ np.sum(last_backward_h_relevance)+ np.sum(last_forward_c_relevance)+ np.sum(last_backward_c_relevance))
input_relevance_forward, input_relevance_backward, h_relevance_rest_forward, c_relevance_rest_forward, h_relevance_rest_backward, c_relevance_rest_backward = self.encoder.computeLRP(last_forward_h_relevance, last_backward_h_relevance, last_forward_c_relevance, last_backward_c_relevance, forward_encoder_relevance, backward_encoder_relevance)
print("Check conservation State reducer")
print(np.sum(last_forward_h_relevance)+ np.sum(last_backward_h_relevance)+ np.sum(last_forward_c_relevance)+ np.sum(last_backward_c_relevance)+ np.sum(forward_encoder_relevance)+ np.sum(backward_encoder_relevance))
print(np.sum(input_relevance_forward)+ np.sum(input_relevance_backward) + np.sum(h_relevance_rest_forward)+ np.sum(c_relevance_rest_forward) + np.sum(h_relevance_rest_backward)+ np.sum(c_relevance_rest_backward))
print("Check conservation LRP")
print(np.sum(output_relevance))
print(np.sum(input_relevance_forward)+ np.sum(input_relevance_backward)+ np.sum(np.sum(decoder_input_relevance)) + np.sum(rest_relevance)+ np.sum(h_relevance_rest_forward)+ np.sum(c_relevance_rest_forward) + np.sum(h_relevance_rest_backward)+ np.sum(c_relevance_rest_backward))
print("Difference between start and attributed LRP")
print(np.sum(output_relevance))
print(np.sum(input_relevance_forward)+ np.sum(input_relevance_backward)+ np.sum(np.sum(decoder_input_relevance)))
print("Rest relevance in attention")
print(np.sum(rest_relevance))
print("Rest relevance in forward (h, c)")
print(np.sum(h_relevance_rest_forward))
print(np.sum(c_relevance_rest_forward))
print("Rest relevance in backward (h, c)")
print(np.sum(h_relevance_rest_backward))
print(np.sum(c_relevance_rest_backward))
# + np.sum(input_relevance_backward) + np.sum(decoder_input_relevance)
return input_relevance_forward, input_relevance_backward, decoder_input_relevance | [
1,
529,
276,
1112,
420,
29958,
339,
309,
273,
29955,
29947,
29914,
4345,
29907,
29918,
4836,
13,
5215,
12655,
408,
7442,
30004,
13,
3166,
2094,
6119,
1053,
334,
30004,
13,
3166,
23655,
1053,
334,
30004,
13,
3166,
1602,
6119,
1053,
334,
30004,
13,
3166,
24471,
29885,
1053,
334,
30004,
13,
3166,
3667,
29879,
1053,
334,
30004,
13,
5215,
10876,
30004,
13,
9675,
29889,
2084,
29889,
4397,
11219,
5184,
29914,
29881,
14554,
29896,
29955,
29914,
4345,
29883,
29918,
4836,
29914,
484,
3631,
29918,
2083,
29918,
29896,
29914,
401,
29914,
5261,
787,
29914,
1495,
30004,
13,
9675,
29889,
2084,
29889,
4397,
877,
6995,
5261,
787,
29914,
1495,
30004,
13,
3166,
7931,
370,
1053,
334,
30004,
13,
3166,
2106,
9039,
1682,
261,
1053,
334,
30004,
13,
3166,
20619,
14420,
1053,
334,
30004,
13,
1990,
25981,
29906,
11762,
11139,
3034,
7608,
29901,
30004,
13,
12,
15945,
19451,
13,
12,
12,
2385,
393,
2755,
278,
4152,
11258,
1095,
304,
1095,
30004,
13,
12,
12,
30004,
13,
12,
12,
16174,
584,
30004,
13,
12,
12,
12,
3729,
3505,
338,
278,
9927,
310,
278,
7934,
15359,
297,
278,
365,
1254,
29924,
3038,
30004,
13,
12,
12,
12,
17987,
8497,
3505,
338,
278,
9927,
310,
278,
1881,
30004,
13,
12,
12,
12,
1131,
2509,
3505,
338,
278,
9927,
310,
278,
8570,
4608,
30004,
13,
12,
12,
12,
29894,
542,
370,
3505,
338,
278,
1353,
310,
3838,
30004,
13,
12,
12,
12,
3317,
29918,
22331,
29918,
2848,
338,
278,
2159,
310,
278,
1881,
5665,
30004,
13,
12,
12,
12,
3317,
29918,
7099,
3689,
29918,
2848,
338,
278,
2159,
310,
278,
1962,
5665,
30004,
13,
12,
12,
12,
30004,
13,
12,
12,
12,
30004,
13,
12,
15945,
19451,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
3038,
3505,
353,
29871,
29896,
29906,
29947,
29892,
23655,
3505,
29922,
29953,
29946,
29892,
8570,
3505,
29922,
29896,
29906,
29947,
29892,
7931,
370,
3505,
29922,
29896,
29945,
29900,
29900,
29900,
29900,
29892,
4236,
29918,
22331,
29918,
2848,
29922,
29906,
29900,
29900,
29892,
4236,
29918,
7099,
3689,
29918,
2848,
29922,
29945,
29900,
29892,
7931,
370,
29918,
2084,
543,
6995,
1272,
29914,
1509,
1319,
2066,
12975,
1125,
30004,
13,
12,
12,
1311,
29889,
3729,
3505,
353,
3038,
3505,
30004,
13,
12,
12,
1311,
29889,
17987,
8497,
3505,
353,
23655,
3505,
30004,
13,
12,
12,
1311,
29889,
1131,
2509,
3505,
353,
8570,
3505,
30004,
13,
12,
12,
1311,
29889,
29894,
542,
370,
3505,
353,
7931,
370,
3505,
30004,
13,
12,
12,
1311,
29889,
3317,
29918,
22331,
29918,
2848,
353,
4236,
29918,
22331,
29918,
2848,
30004,
13,
12,
12,
1311,
29889,
3317,
29918,
7099,
3689,
29918,
2848,
353,
4236,
29918,
7099,
3689,
29918,
2848,
30004,
13,
30004,
13,
12,
12,
1311,
29889,
17987,
8497,
353,
6213,
30004,
13,
12,
12,
1311,
29889,
3977,
6119,
353,
6213,
30004,
13,
12,
12,
1311,
29889,
7099,
6119,
353,
6213,
30004,
13,
12,
12,
1311,
29889,
3859,
9039,
1682,
261,
353,
6213,
30004,
13,
12,
12,
1311,
29889,
1145,
344,
14420,
353,
6213,
30004,
13,
30004,
13,
12,
12,
1311,
29889,
29894,
542,
370,
353,
478,
542,
370,
29898,
2084,
29922,
29894,
542,
370,
29918,
2084,
8443,
13,
12,
12,
1311,
29889,
29894,
542,
370,
3505,
353,
1311,
29889,
7931,
370,
29889,
5896,
29963,
542,
370,
29898,
3317,
29918,
2311,
29922,
29894,
542,
370,
3505,
8443,
13,
30004,
13,
12,
1753,
903,
11228,
895,
29918,
17987,
8497,
29898,
1311,
29892,
23655,
29918,
5344,
1125,
30004,
13,
12,
12,
1311,
29889,
17987,
8497,
353,
2812,
2580,
8497,
29898,
17987,
8497,
29918,
5344,
8443,
13,
12,
12,
9294,
1583,
29889,
29894,
542,
370,
3505,
1275,
1583,
29889,
17987,
8497,
29889,
29894,
542,
370,
3505,
30004,
13,
12,
12,
9294,
1583,
29889,
17987,
8497,
3505,
1275,
1583,
29889,
17987,
8497,
29889,
17987,
8497,
3505,
30004,
13,
30004,
13,
12,
1753,
903,
11228,
895,
29918,
3977,
6119,
29898,
1311,
29892,
8466,
29918,
11333,
29892,
24003,
29918,
11333,
29892,
8466,
29918,
1627,
1328,
29892,
24003,
29918,
1627,
1328,
1125,
30004,
13,
12,
12,
15945,
19451,
13,
12,
12,
12,
15514,
895,
278,
2094,
6119,
30004,
13,
12,
12,
12,
1576,
8466,
526,
408,
2183,
491,
323,
6073,
1731,
29892,
577,
310,
2159,
313,
17987,
8497,
718,
3038,
3505,
29897,
921,
29871,
29946,
29930,
3729,
3505,
30004,
13,
12,
12,
12,
29933,
3173,
526,
310,
8267,
313,
29946,
29930,
3729,
3505,
29892,
1723,
30004,
13,
12,
12,
15945,
19451,
13,
30004,
13,
30004,
13,
12,
12,
20155,
29885,
29918,
11333,
353,
365,
303,
29885,
29898,
17460,
29918,
11333,
29892,
24003,
29918,
11333,
29892,
1583,
29889,
3729,
3505,
8443,
13,
12,
12,
20155,
29885,
29918,
1627,
1328,
353,
365,
303,
29885,
29898,
17460,
29918,
1627,
1328,
29892,
24003,
29918,
1627,
1328,
29892,
1583,
29889,
3729,
3505,
8443,
13,
12,
12,
9294,
24471,
29885,
29918,
11333,
29889,
17987,
8497,
3505,
1275,
1583,
29889,
17987,
8497,
3505,
30004,
13,
12,
12,
9294,
24471,
29885,
29918,
1627,
1328,
29889,
17987,
8497,
3505,
1275,
1583,
29889,
17987,
8497,
3505,
30004,
13,
30004,
13,
12,
12,
1311,
29889,
3977,
6119,
353,
11346,
6119,
29898,
24471,
29885,
29918,
11333,
29922,
20155,
29885,
29918,
11333,
29892,
24471,
29885,
29918,
1627,
1328,
29922,
20155,
29885,
29918,
1627,
1328,
29892,
3038,
3505,
29922,
1311,
29889,
3729,
3505,
29892,
23655,
3505,
353,
1583,
29889,
17987,
8497,
3505,
29892,
4236,
29918,
22331,
29918,
2848,
29922,
1311,
29889,
3317,
29918,
22331,
29918,
2848,
8443,
13,
30004,
13,
12,
1753,
903,
11228,
895,
29918,
3859,
9039,
1682,
261,
29898,
1311,
29892,
399,
29918,
29882,
29892,
399,
29918,
29883,
29892,
289,
29918,
29882,
29892,
289,
29918,
29883,
1125,
30004,
13,
12,
12,
15945,
19451,
13,
12,
12,
12,
15514,
895,
278,
2106,
4367,
1682,
261,
515,
278,
2094,
6119,
322,
278,
1602,
6119,
30004,
13,
12,
12,
12,
1576,
13516,
408,
2183,
491,
26110,
526,
1301,
4752,
30004,
13,
30004,
13,
12,
12,
15945,
19451,
13,
12,
12,
1311,
29889,
3859,
9039,
1682,
261,
353,
4306,
9039,
1682,
261,
29898,
29956,
29918,
29882,
353,
399,
29918,
29882,
11167,
13,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
29956,
29918,
29883,
353,
399,
29918,
29883,
11167,
13,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
29890,
29918,
29882,
353,
289,
29918,
29882,
11167,
13,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
29890,
29918,
29883,
353,
289,
29918,
29883,
8443,
13,
30004,
13,
12,
1753,
903,
11228,
895,
29918,
7099,
6119,
29898,
1311,
29892,
8466,
29892,
24003,
29892,
3370,
14420,
29892,
2346,
14420,
29892,
8570,
29963,
29892,
1098,
296,
265,
14420,
1125,
30004,
13,
12,
12,
3729,
353,
365,
303,
29885,
29898,
17460,
29892,
24003,
29892,
1583,
29889,
3729,
3505,
12,
8443,
13,
12,
12,
1311,
29889,
7099,
6119,
353,
3826,
6119,
29898,
20155,
29885,
29918,
3729,
29922,
3729,
29892,
6756,
13,
12,
12,
12,
12,
12,
12,
12,
12,
3729,
3505,
29922,
1311,
29889,
3729,
3505,
29892,
6756,
13,
12,
12,
12,
12,
12,
12,
12,
12,
1131,
2509,
3505,
29922,
1311,
29889,
1131,
2509,
3505,
29892,
6756,
13,
12,
12,
12,
12,
12,
12,
12,
12,
3317,
29918,
7099,
3689,
29918,
2848,
29922,
1311,
29889,
3317,
29918,
7099,
3689,
29918,
2848,
11167,
13,
12,
12,
12,
12,
12,
12,
12,
12,
14834,
14420,
29922,
14834,
14420,
29892,
6756,
13,
12,
12,
12,
12,
12,
12,
12,
12,
1972,
14420,
29922,
1972,
14420,
29892,
6756,
13,
12,
12,
12,
12,
12,
12,
12,
12,
1131,
2509,
29963,
353,
8570,
29963,
29892,
6756,
13,
12,
12,
12,
12,
12,
12,
12,
12,
1131,
296,
265,
14420,
29922,
1131,
296,
265,
14420,
8443,
13,
30004,
13,
12,
1753,
903,
11228,
895,
29918,
29928,
1947,
14420,
29898,
1311,
29892,
8466,
29892,
24003,
1125,
30004,
13,
12,
12,
1311,
29889,
1145,
344,
14420,
353,
360,
1947,
14420,
29898,
17460,
353,
8466,
11167,
13,
12,
12,
12,
12,
12,
12,
12,
12,
12,
29890,
3173,
353,
24003,
8443,
13,
30004,
13,
12,
1753,
10272,
29918,
11333,
29898,
1311,
29892,
1881,
29918,
11762,
29918,
524,
29892,
1602,
29918,
11762,
29918,
524,
1125,
30004,
13,
12,
12,
15945,
19451,
13,
12,
12,
20606,
29872,
599,
278,
5922,
310,
278,
3564,
363,
278,
2702,
1881,
30004,
13,
12,
12,
30004,
13,
12,
12,
2080,
584,
5665,
310,
3838,
30004,
13,
30004,
13,
12,
12,
15945,
19451,
13,
12,
12,
29937,
16031,
29918,
11762,
29918,
262,
29886,
353,
1583,
29889,
29894,
542,
370,
29889,
4300,
284,
371,
29903,
296,
663,
29898,
2080,
29918,
11762,
8443,
13,
12,
12,
29937,
2158,
29898,
7099,
29918,
11762,
29918,
524,
8443,
13,
12,
12,
17987,
7176,
29918,
262,
29886,
29918,
11762,
353,
1583,
29889,
17987,
8497,
29889,
9067,
29918,
2080,
29898,
2080,
29918,
11762,
29918,
524,
8443,
13,
12,
12,
11333,
29918,
3977,
6119,
29918,
28631,
29892,
1250,
1328,
29918,
3977,
6119,
29918,
28631,
353,
1583,
29889,
3977,
6119,
29889,
26017,
29918,
22331,
29898,
17987,
7176,
29918,
262,
29886,
29918,
11762,
8443,
13,
12,
12,
29937,
2158,
703,
1523,
862,
292,
278,
18750,
4430,
5922,
315,
1159,
30004,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
11333,
29918,
3977,
6119,
29918,
28631,
14352,
29896,
29962,
3366,
29883,
3108,
876,
30004,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
1627,
1328,
29918,
3977,
6119,
29918,
28631,
29961,
29900,
29962,
3366,
29883,
3108,
876,
30004,
13,
12,
12,
29882,
29892,
274,
353,
1583,
29889,
3859,
9039,
1682,
261,
29889,
26017,
29918,
9313,
428,
29898,
11333,
29918,
3977,
6119,
29918,
28631,
14352,
29896,
1402,
1250,
1328,
29918,
3977,
6119,
29918,
28631,
29961,
29900,
2314,
30004,
13,
30004,
13,
12,
12,
29937,
16031,
29918,
11762,
29918,
449,
353,
1583,
29889,
29894,
542,
370,
29889,
4300,
284,
371,
29903,
296,
663,
29898,
7099,
29918,
11762,
8443,
13,
12,
12,
17987,
7176,
29918,
7099,
29918,
11762,
353,
1583,
29889,
17987,
8497,
29889,
9067,
29918,
2080,
4197,
1311,
29889,
29894,
542,
370,
29889,
2962,
29918,
13808,
29918,
333,
29962,
718,
1602,
29918,
11762,
29918,
524,
8443,
13,
30004,
13,
12,
12,
7099,
6119,
29918,
28631,
353,
1583,
29889,
7099,
6119,
29889,
26017,
29918,
7099,
3689,
29898,
17987,
7176,
29918,
7099,
29918,
11762,
29892,
298,
29892,
274,
29892,
6375,
29918,
3977,
6119,
29918,
28631,
29892,
1250,
1328,
29918,
3977,
6119,
29918,
28631,
29892,
1583,
29889,
1145,
344,
14420,
29892,
1583,
29889,
17987,
8497,
8443,
13,
12,
12,
29937,
2158,
703,
18307,
3030,
12047,
1159,
30004,
13,
12,
12,
29937,
2158,
29898,
7099,
6119,
29918,
28631,
29961,
29900,
29962,
3366,
20155,
29885,
3108,
3366,
4230,
29918,
29883,
3108,
7503,
29896,
29900,
2314,
30004,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
3317,
29898,
7099,
6119,
29918,
28631,
29961,
29900,
29962,
3366,
20155,
29885,
3108,
3366,
29888,
3108,
876,
30004,
13,
12,
12,
29937,
2158,
29898,
7099,
6119,
29918,
28631,
29961,
29900,
29962,
3366,
20155,
29885,
3108,
3366,
29888,
3108,
7503,
29896,
29900,
2314,
30004,
13,
12,
12,
29937,
2158,
29898,
29883,
7503,
29896,
29900,
2314,
30004,
13,
30004,
13,
12,
12,
2457,
6375,
29918,
3977,
6119,
29918,
28631,
29892,
1250,
1328,
29918,
3977,
6119,
29918,
28631,
29892,
298,
29892,
274,
29892,
1602,
6119,
29918,
28631,
30004,
13,
30004,
13,
12,
1753,
2302,
9629,
29898,
1311,
1125,
30004,
13,
12,
12,
2798,
353,
29871,
29900,
30004,
13,
12,
12,
2798,
4619,
1583,
29889,
17987,
8497,
29889,
2798,
9629,
26471,
13,
12,
12,
2798,
4619,
1583,
29889,
3977,
6119,
29889,
2798,
9629,
26471,
13,
12,
12,
2798,
4619,
1583,
29889,
7099,
6119,
29889,
2798,
9629,
26471,
13,
12,
12,
2798,
4619,
1583,
29889,
3859,
9039,
1682,
261,
29889,
2798,
9629,
26471,
13,
12,
12,
2798,
4619,
1583,
29889,
1145,
344,
14420,
29889,
2798,
9629,
26471,
13,
12,
12,
2457,
2302,
30004,
13,
30004,
13,
12,
1753,
10272,
29519,
29925,
29898,
1311,
29892,
22525,
29892,
1369,
29918,
13808,
29922,
8824,
1125,
30004,
13,
12,
12,
15945,
19451,
13,
12,
12,
12,
20606,
29872,
278,
365,
29934,
29925,
363,
278,
4152,
3564,
30004,
13,
12,
12,
30004,
13,
12,
12,
12,
4290,
584,
30004,
13,
12,
12,
12,
5182,
29879,
584,
310,
8267,
313,
3317,
29918,
7099,
3689,
29918,
2848,
29892,
7931,
370,
29918,
2311,
467,
6137,
310,
5852,
310,
7700,
29889,
960,
278,
2602,
313,
29875,
29892,
29926,
29897,
338,
1565,
29892,
769,
591,
864,
304,
10272,
278,
29527,
749,
363,
278,
18988,
591,
750,
310,
1734,
1353,
432,
472,
278,
1602,
3689,
4331,
474,
30004,
13,
12,
12,
30004,
13,
12,
12,
15945,
19451,
13,
30004,
13,
12,
12,
7099,
6119,
29918,
28631,
353,
1583,
29889,
7099,
6119,
29889,
4905,
29879,
30004,
13,
12,
12,
11333,
29918,
3977,
6119,
29918,
28631,
29871,
353,
1583,
29889,
3977,
6119,
29889,
11333,
29918,
3977,
6119,
29918,
28631,
30004,
13,
12,
12,
1627,
1328,
29918,
3977,
6119,
29918,
28631,
353,
1583,
29889,
3977,
6119,
29889,
1627,
1328,
29918,
3977,
6119,
29918,
28631,
30004,
13,
30004,
13,
12,
12,
4905,
29918,
276,
2608,
749,
353,
5159,
30004,
13,
12,
12,
1454,
474,
297,
3464,
29898,
1311,
29889,
3317,
29918,
7099,
3689,
29918,
2848,
1125,
30004,
13,
12,
12,
12,
4905,
29918,
276,
2608,
749,
29889,
4397,
29898,
9302,
29889,
3298,
359,
3552,
1311,
29889,
29894,
542,
370,
3505,
29892,
29871,
29896,
4961,
30004,
13,
12,
12,
12,
1454,
432,
297,
3464,
29898,
1311,
29889,
29894,
542,
370,
3505,
1125,
30004,
13,
12,
12,
12,
12,
361,
22525,
29961,
29875,
3816,
29926,
5387,
30004,
13,
12,
12,
12,
12,
12,
4905,
29918,
276,
2608,
749,
29961,
29875,
3816,
29926,
29962,
353,
4964,
3317,
29898,
7099,
6119,
29918,
28631,
29961,
29875,
29962,
3366,
4905,
20068,
29961,
29926,
29962,
30004,
13,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
4905,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
29882,
29918,
276,
2608,
749,
29892,
274,
29918,
276,
2608,
749,
29892,
6375,
29918,
3977,
6119,
29918,
276,
2608,
749,
29892,
1250,
1328,
29918,
3977,
6119,
29918,
276,
2608,
749,
29892,
1602,
6119,
29918,
2080,
29918,
276,
2608,
749,
29892,
1791,
29918,
276,
2608,
749,
353,
1583,
29889,
7099,
6119,
29889,
26017,
29519,
29925,
29898,
4905,
29918,
276,
2608,
749,
29892,
1583,
29889,
1145,
344,
14420,
29892,
6375,
29918,
3977,
6119,
29918,
28631,
29892,
1250,
1328,
29918,
3977,
6119,
29918,
28631,
29892,
22649,
29918,
2080,
29922,
8824,
29892,
1369,
29918,
13808,
29922,
2962,
29918,
13808,
8443,
13,
30004,
13,
12,
12,
29937,
29882,
29918,
276,
2608,
749,
353,
7442,
29889,
8172,
29889,
8172,
29918,
11249,
3552,
1311,
29889,
3729,
3505,
29892,
29871,
29896,
876,
334,
29896,
29900,
448,
29945,
30004,
13,
12,
12,
29937,
29883,
29918,
276,
2608,
749,
353,
7442,
29889,
8172,
29889,
8172,
29918,
11249,
3552,
1311,
29889,
3729,
3505,
29892,
29871,
29896,
876,
334,
29896,
29900,
448,
29945,
30004,
13,
30004,
13,
12,
12,
2158,
703,
5596,
24201,
2860,
1602,
3689,
1159,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
4905,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
11333,
29918,
3977,
6119,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
1627,
1328,
29918,
3977,
6119,
29918,
276,
2608,
749,
29897,
29871,
718,
7442,
29889,
2083,
29898,
9302,
29889,
2083,
29898,
7099,
6119,
29918,
2080,
29918,
276,
2608,
749,
876,
718,
7442,
29889,
2083,
29898,
5060,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
29937,
2158,
29898,
5060,
29918,
276,
2608,
749,
8443,
13,
30004,
13,
12,
12,
29937,
2158,
703,
6513,
310,
278,
8570,
528,
277,
1159,
30004,
13,
12,
12,
29937,
2158,
29898,
2435,
29898,
11333,
29918,
3977,
6119,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
4230,
29918,
11333,
29918,
29882,
29918,
276,
2608,
749,
29892,
1833,
29918,
1627,
1328,
29918,
29882,
29918,
276,
2608,
749,
29892,
1833,
29918,
11333,
29918,
29883,
29918,
276,
2608,
749,
29892,
1833,
29918,
1627,
1328,
29918,
29883,
29918,
276,
2608,
749,
353,
1583,
29889,
3859,
9039,
1682,
261,
29889,
26017,
29519,
29925,
29898,
29882,
29918,
276,
2608,
749,
29892,
274,
29918,
276,
2608,
749,
8443,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
4230,
29918,
11333,
29918,
29882,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
4230,
29918,
1627,
1328,
29918,
29882,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
4230,
29918,
11333,
29918,
29883,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
29937,
2158,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
4230,
29918,
1627,
1328,
29918,
29883,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
30004,
13,
12,
12,
2158,
703,
5596,
24201,
4306,
3724,
2265,
1159,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29897,
718,
7442,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
4230,
29918,
11333,
29918,
29882,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
4230,
29918,
1627,
1328,
29918,
29882,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
4230,
29918,
11333,
29918,
29883,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
4230,
29918,
1627,
1328,
29918,
29883,
29918,
276,
2608,
749,
876,
30004,
13,
30004,
13,
12,
12,
2080,
29918,
276,
2608,
749,
29918,
11333,
29892,
1881,
29918,
276,
2608,
749,
29918,
1627,
1328,
29892,
298,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
29892,
274,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
29892,
298,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
29892,
274,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
353,
1583,
29889,
3977,
6119,
29889,
26017,
29519,
29925,
29898,
4230,
29918,
11333,
29918,
29882,
29918,
276,
2608,
749,
29892,
1833,
29918,
1627,
1328,
29918,
29882,
29918,
276,
2608,
749,
29892,
1833,
29918,
11333,
29918,
29883,
29918,
276,
2608,
749,
29892,
1833,
29918,
1627,
1328,
29918,
29883,
29918,
276,
2608,
749,
29892,
6375,
29918,
3977,
6119,
29918,
276,
2608,
749,
29892,
1250,
1328,
29918,
3977,
6119,
29918,
276,
2608,
749,
8443,
13,
30004,
13,
30004,
13,
12,
12,
2158,
703,
5596,
24201,
4306,
3724,
2265,
1159,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
4230,
29918,
11333,
29918,
29882,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
4230,
29918,
1627,
1328,
29918,
29882,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
4230,
29918,
11333,
29918,
29883,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
4230,
29918,
1627,
1328,
29918,
29883,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
11333,
29918,
3977,
6119,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
1627,
1328,
29918,
3977,
6119,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
11333,
7240,
7442,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
1627,
1328,
29897,
718,
7442,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
7240,
7442,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
29897,
718,
7442,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
7240,
7442,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
876,
30004,
13,
30004,
13,
12,
12,
2158,
703,
5596,
24201,
365,
29934,
29925,
1159,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
4905,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
11333,
7240,
7442,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
1627,
1328,
7240,
7442,
29889,
2083,
29898,
9302,
29889,
2083,
29898,
7099,
6119,
29918,
2080,
29918,
276,
2608,
749,
876,
718,
7442,
29889,
2083,
29898,
5060,
29918,
276,
2608,
749,
7240,
7442,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
7240,
7442,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
29897,
718,
7442,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
7240,
7442,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
876,
30004,
13,
30004,
13,
30004,
13,
12,
12,
2158,
703,
29928,
17678,
1546,
1369,
322,
29393,
365,
29934,
29925,
1159,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
4905,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
11333,
7240,
7442,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
1627,
1328,
7240,
7442,
29889,
2083,
29898,
9302,
29889,
2083,
29898,
7099,
6119,
29918,
2080,
29918,
276,
2608,
749,
4961,
30004,
13,
30004,
13,
12,
12,
2158,
703,
15078,
29527,
749,
297,
8570,
1159,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
5060,
29918,
276,
2608,
749,
876,
30004,
13,
12,
12,
2158,
703,
15078,
29527,
749,
297,
6375,
313,
29882,
29892,
274,
25760,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
29918,
5060,
29918,
11333,
876,
30004,
13,
12,
12,
2158,
703,
15078,
29527,
749,
297,
1250,
1328,
313,
29882,
29892,
274,
25760,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
29882,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
876,
30004,
13,
12,
12,
2158,
29898,
9302,
29889,
2083,
29898,
29883,
29918,
276,
2608,
749,
29918,
5060,
29918,
1627,
1328,
876,
30004,
13,
12,
12,
29937,
718,
7442,
29889,
2083,
29898,
2080,
29918,
276,
2608,
749,
29918,
1627,
1328,
29897,
718,
7442,
29889,
2083,
29898,
7099,
6119,
29918,
2080,
29918,
276,
2608,
749,
8443,
13,
12,
12,
2457,
1881,
29918,
276,
2608,
749,
29918,
11333,
29892,
1881,
29918,
276,
2608,
749,
29918,
1627,
1328,
29892,
1602,
6119,
29918,
2080,
29918,
276,
2608,
749,
2
] |
src/lesson_mathematics/math_frexp.py | jasonwee/asus-rt-n14uhp-mrtg | 3 | 114105 | import math
print('{:^7} {:^7} {:^7}'.format('x', 'm', 'e'))
print('{:-^7} {:-^7} {:-^7}'.format('', '', ''))
for x in [0.1, 0.5, 4.0]:
m, e = math.frexp(x)
print('{:7.2f} {:7.2f} {:7d}'.format(x, m, e))
| [
1,
1053,
5844,
13,
13,
2158,
877,
25641,
29985,
29955,
29913,
12365,
29985,
29955,
29913,
12365,
29985,
29955,
29913,
4286,
4830,
877,
29916,
742,
525,
29885,
742,
525,
29872,
8785,
13,
2158,
877,
29912,
13018,
29985,
29955,
29913,
12365,
29899,
29985,
29955,
29913,
12365,
29899,
29985,
29955,
29913,
4286,
4830,
877,
742,
15516,
6629,
876,
13,
13,
1454,
921,
297,
518,
29900,
29889,
29896,
29892,
29871,
29900,
29889,
29945,
29892,
29871,
29946,
29889,
29900,
5387,
13,
1678,
286,
29892,
321,
353,
5844,
29889,
10745,
26330,
29898,
29916,
29897,
13,
1678,
1596,
877,
25641,
29955,
29889,
29906,
29888,
29913,
12365,
29955,
29889,
29906,
29888,
29913,
12365,
29955,
29881,
29913,
4286,
4830,
29898,
29916,
29892,
286,
29892,
321,
876,
13,
2
] |
apps/plea/exceptions.py | uk-gov-mirror/ministryofjustice.manchester_traffic_offences_pleas | 3 | 173209 | """
Exceptions
==========
"""
class AuditEventException(BaseException):
pass
| [
1,
9995,
13,
2451,
29879,
13,
4936,
1360,
13,
15945,
29908,
13,
13,
1990,
8612,
277,
2624,
2451,
29898,
5160,
2451,
1125,
13,
1678,
1209,
13,
13,
13,
2
] |
zenbot/logging/__init__.py | Dmunch04/ZenBot | 7 | 125957 | <filename>zenbot/logging/__init__.py<gh_stars>1-10
from .console_logger import ConsoleLogger
from .file_logger import FileLogger
from .logger import Logger
from .logmanager import LogManager
| [
1,
529,
9507,
29958,
2256,
7451,
29914,
21027,
29914,
1649,
2344,
26914,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
869,
11058,
29918,
21707,
1053,
9405,
16363,
13,
3166,
869,
1445,
29918,
21707,
1053,
3497,
16363,
13,
3166,
869,
21707,
1053,
28468,
13,
3166,
869,
1188,
12847,
1053,
4522,
3260,
13,
2
] |
10_ExtractUniqueSents.py | bjascob/SmartLMVocabs | 10 | 125060 | #!/usr/bin/python3
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import os
import io
import math
import random
from subprocess import Popen, PIPE
from tflmlib import ProgressBar
from configs import config
# Billion Word Corpus
# To create the training-monolingual directory ..
# wget http://statmt.org/wmt11/training-monolingual.tgz
# tar xvf training-monolingual.tgz --wildcards training-monolingual/news.20??.en.shuffled
# The 9.9 GB file extracts to 25GB without the wildcards. Other files are non-english.
bw_raw_dir = config.bw_rawdir
bw_unique_dir = os.path.join(config.bw_corpus, 'BWUniqueSents_FirstPass')
# Get the number of lines in a file
def getFileLines(fname):
p = Popen(['wc', '-l', fname], stdout=PIPE, stderr=PIPE)
result, err = p.communicate()
if p.returncode != 0:
raise IOError(err)
return int(result.strip().split()[0])
if __name__ == '__main__':
print('*' * 80)
print()
nshards = 100
test = False
# Loop through the corpus
# Note this takes about 3 minutes, uses 6.5GB of RAM and 3.9GB disk space
print('#' * 40)
print('Loading the raw corpus')
fns = sorted([os.path.join(bw_raw_dir, fn) for fn in os.listdir(bw_raw_dir)])
bw_set = set()
sent_ctr = 0
for i, fn in enumerate(fns):
print(' %d/%d : %s' % (i + 1, len(fns), fn))
nlines = getFileLines(fn)
pb = ProgressBar(nlines)
with io.open(fn, 'r', encoding='utf8') as f:
for j, line in enumerate(f):
line = line.strip()
bw_set.add(line)
if 0 == j % 100: pb.update(j)
if test and j > 100000: break
pb.clear()
sent_ctr += nlines
if test and i >= 0: break
nunique = len(bw_set)
print('Corpus has {:,} unique sentences out of {:,} read.'.format(nunique, sent_ctr))
print()
# Create the output directory
if not os.path.exists(bw_unique_dir):
os.mkdir(bw_unique_dir)
# Split the sentences into shards and save them
print('Converting to a list and shuffling')
bw_set = list(bw_set)
random.shuffle(bw_set)
sents_per_shard = int(math.ceil(nunique / float(nshards)))
for i in range(nshards):
fn = os.path.join(bw_unique_dir, 'bw_%02d.txt' % i)
print('Saving the data to ', fn)
with io.open(fn, 'w', encoding='utf8') as f:
for sent in bw_set[i * sents_per_shard:(i + 1) * sents_per_shard]:
f.write('%s\n' % sent)
print('done')
print()
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
29941,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
529,
5813,
29958,
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,
1678,
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,
3166,
259,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
5215,
2897,
13,
5215,
12013,
13,
5215,
5844,
13,
5215,
4036,
13,
3166,
259,
1014,
5014,
259,
1053,
349,
3150,
29892,
349,
29902,
4162,
13,
3166,
259,
260,
1579,
29885,
1982,
418,
1053,
20018,
4297,
13,
3166,
259,
2295,
29879,
418,
1053,
2295,
13,
13,
29937,
6682,
291,
10803,
2994,
13364,
13,
29937,
1763,
1653,
278,
6694,
29899,
3712,
324,
292,
950,
3884,
6317,
13,
29937,
259,
281,
657,
1732,
597,
6112,
4378,
29889,
990,
29914,
29893,
4378,
29896,
29896,
29914,
26495,
29899,
3712,
324,
292,
950,
29889,
29873,
18828,
13,
29937,
259,
9913,
921,
29894,
29888,
6694,
29899,
3712,
324,
292,
950,
29889,
29873,
18828,
1192,
29893,
789,
28160,
6694,
29899,
3712,
324,
292,
950,
29914,
15753,
29889,
29906,
29900,
8773,
29889,
264,
29889,
845,
3096,
839,
13,
29937,
259,
450,
29871,
29929,
29889,
29929,
19289,
934,
6597,
29879,
304,
29871,
29906,
29945,
7210,
1728,
278,
8775,
28160,
29889,
5901,
2066,
526,
1661,
29899,
996,
1674,
29889,
13,
29890,
29893,
29918,
1610,
29918,
3972,
1678,
353,
2295,
29889,
29890,
29893,
29918,
1610,
3972,
13,
29890,
29893,
29918,
13092,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2917,
29889,
29890,
29893,
29918,
2616,
13364,
29892,
525,
29933,
29956,
8110,
802,
29903,
1237,
29918,
6730,
7129,
1495,
13,
13,
13,
29937,
3617,
278,
1353,
310,
3454,
297,
263,
934,
13,
1753,
679,
2283,
20261,
29898,
29888,
978,
1125,
13,
1678,
282,
353,
349,
3150,
18959,
29893,
29883,
742,
17411,
29880,
742,
285,
978,
1402,
27591,
29922,
2227,
4162,
29892,
380,
20405,
29922,
2227,
4162,
29897,
13,
1678,
1121,
29892,
4589,
353,
282,
29889,
27820,
403,
580,
13,
1678,
565,
282,
29889,
2457,
401,
2804,
29871,
29900,
29901,
13,
4706,
12020,
10663,
2392,
29898,
3127,
29897,
13,
1678,
736,
938,
29898,
2914,
29889,
17010,
2141,
5451,
580,
29961,
29900,
2314,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1596,
877,
29930,
29915,
334,
29871,
29947,
29900,
29897,
13,
1678,
1596,
580,
13,
13,
1678,
302,
845,
3163,
353,
29871,
29896,
29900,
29900,
13,
1678,
1243,
353,
7700,
13,
13,
1678,
396,
21493,
1549,
278,
1034,
13364,
13,
1678,
396,
3940,
445,
4893,
1048,
29871,
29941,
6233,
29892,
3913,
29871,
29953,
29889,
29945,
7210,
310,
18113,
322,
29871,
29941,
29889,
29929,
7210,
8086,
2913,
13,
1678,
1596,
14237,
29915,
334,
29871,
29946,
29900,
29897,
13,
1678,
1596,
877,
23456,
278,
10650,
1034,
13364,
1495,
13,
1678,
285,
1983,
353,
12705,
4197,
359,
29889,
2084,
29889,
7122,
29898,
29890,
29893,
29918,
1610,
29918,
3972,
29892,
7876,
29897,
363,
7876,
297,
2897,
29889,
1761,
3972,
29898,
29890,
29893,
29918,
1610,
29918,
3972,
29897,
2314,
13,
1678,
289,
29893,
29918,
842,
353,
731,
580,
13,
1678,
2665,
29918,
9988,
353,
29871,
29900,
13,
1678,
363,
474,
29892,
7876,
297,
26985,
29898,
29888,
1983,
1125,
13,
4706,
1596,
877,
29871,
1273,
29881,
22584,
29881,
584,
1273,
29879,
29915,
1273,
313,
29875,
718,
29871,
29896,
29892,
7431,
29898,
29888,
1983,
511,
7876,
876,
13,
4706,
302,
9012,
353,
679,
2283,
20261,
29898,
9144,
29897,
13,
4706,
282,
29890,
353,
20018,
4297,
29898,
29876,
9012,
29897,
13,
4706,
411,
12013,
29889,
3150,
29898,
9144,
29892,
525,
29878,
742,
8025,
2433,
9420,
29947,
1495,
408,
285,
29901,
13,
9651,
363,
432,
29892,
1196,
297,
26985,
29898,
29888,
1125,
13,
18884,
1196,
353,
1196,
29889,
17010,
580,
13,
18884,
289,
29893,
29918,
842,
29889,
1202,
29898,
1220,
29897,
13,
18884,
565,
29871,
29900,
1275,
432,
1273,
29871,
29896,
29900,
29900,
29901,
282,
29890,
29889,
5504,
29898,
29926,
29897,
13,
18884,
565,
1243,
322,
432,
1405,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29901,
2867,
13,
4706,
282,
29890,
29889,
8551,
580,
13,
4706,
2665,
29918,
9988,
4619,
302,
9012,
13,
4706,
565,
1243,
322,
474,
6736,
29871,
29900,
29901,
2867,
13,
1678,
11923,
1387,
353,
7431,
29898,
29890,
29893,
29918,
842,
29897,
13,
1678,
1596,
877,
12521,
13364,
756,
12365,
29892,
29913,
5412,
25260,
714,
310,
12365,
29892,
29913,
1303,
29889,
4286,
4830,
29898,
29876,
13092,
29892,
2665,
29918,
9988,
876,
13,
1678,
1596,
580,
13,
13,
1678,
396,
6204,
278,
1962,
3884,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
29890,
29893,
29918,
13092,
29918,
3972,
1125,
13,
4706,
2897,
29889,
11256,
3972,
29898,
29890,
29893,
29918,
13092,
29918,
3972,
29897,
13,
13,
1678,
396,
26178,
278,
25260,
964,
528,
3163,
322,
4078,
963,
13,
1678,
1596,
877,
1168,
369,
1259,
304,
263,
1051,
322,
528,
3096,
1847,
1495,
13,
1678,
289,
29893,
29918,
842,
353,
1051,
29898,
29890,
29893,
29918,
842,
29897,
13,
1678,
4036,
29889,
845,
21897,
29898,
29890,
29893,
29918,
842,
29897,
13,
1678,
269,
1237,
29918,
546,
29918,
845,
538,
353,
938,
29898,
755,
29889,
27696,
29898,
29876,
13092,
847,
5785,
29898,
29876,
845,
3163,
4961,
13,
1678,
363,
474,
297,
3464,
29898,
29876,
845,
3163,
1125,
13,
4706,
7876,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29890,
29893,
29918,
13092,
29918,
3972,
29892,
525,
29890,
29893,
29918,
29995,
29900,
29906,
29881,
29889,
3945,
29915,
1273,
474,
29897,
13,
4706,
1596,
877,
29903,
5555,
278,
848,
304,
13420,
7876,
29897,
13,
4706,
411,
12013,
29889,
3150,
29898,
9144,
29892,
525,
29893,
742,
8025,
2433,
9420,
29947,
1495,
408,
285,
29901,
13,
9651,
363,
2665,
297,
289,
29893,
29918,
842,
29961,
29875,
334,
269,
1237,
29918,
546,
29918,
845,
538,
5919,
29875,
718,
29871,
29896,
29897,
334,
269,
1237,
29918,
546,
29918,
845,
538,
5387,
13,
18884,
285,
29889,
3539,
877,
29995,
29879,
29905,
29876,
29915,
1273,
2665,
29897,
13,
1678,
1596,
877,
15091,
1495,
13,
1678,
1596,
580,
13,
2
] |
23_Basic_testbench_1.0/testbench.py | raysalemi/python4uvm_examples | 1 | 107834 | <gh_stars>1-10
# ## Importing modules
# Figure 3: Importing needed resources
import cocotb
from cocotb.triggers import FallingEdge
import random
# ### The tinyalu_utils module
# All testbenches use tinyalu_utils, so store it in a central
# place and add its path to the sys path so we can import it
from pathlib import Path
parent_path = Path("..").resolve()
import sys # noqa: E402
sys.path.insert(0, str(parent_path))
from tinyalu_utils import Ops, alu_prediction, logger, get_int # noqa: E402
# ## Setting up the cocotb TinyALU test
# Figure 7: The start of the TinyALU. Reset the DUT
@cocotb.test()
async def alu_test(dut):
passed = True
cvg = set() # functional coverage
await FallingEdge(dut.clk)
dut.reset_n.value = 0
dut.start.value = 0
await FallingEdge(dut.clk)
dut.reset_n.value = 1
# ### Sending commands
# Figure 8: Creating one transaction for each operation
cmd_count = 1
op_list = list(Ops)
num_ops = len(op_list)
while cmd_count <= num_ops:
await FallingEdge(dut.clk)
st = get_int(dut.start)
dn = get_int(dut.done)
# ### Sending a command and waiting for it to complete
# Figure 9: Creating a TinyALU command
if st == 0 and dn == 0:
aa = random.randint(0, 255)
bb = random.randint(0, 255)
op = op_list.pop(0)
cvg.add(op)
dut.A.value = aa
dut.B.value = bb
dut.op.value = op
dut.start.value = 1
# Figure 10: Asserting that a failure state never happens
if st == 0 and dn == 1:
raise AssertionError("DUT Error: done set to 1 without start")
# Figure 11: If we are in an operation, continue
if st == 1 and dn == 0:
continue
# ### Checking the result
# Figure 12: The operation is complete
if st == 1 and dn == 1:
dut.start.value = 0
cmd_count += 1
result = get_int(dut.result)
# Figure 13: Checking results against the prediction
pr = alu_prediction(aa, bb, op)
if result == pr:
logger.info(
f"PASSED: {aa:2x} {op.name} {bb:2x} = {result:04x}")
else:
logger.error(
f"FAILED: {aa:2x} {op.name} {bb:2x} ="
f" {result:04x} - predicted {pr:04x}")
passed = False
# ### Finishing the test
# Figure 14: Checking functional coverage using a set
if len(set(Ops) - cvg) > 0:
logger.error(f"Functional coverage error. Missed: {set(Ops)-cvg}")
passed = False
else:
logger.info("Covered all operations")
# Figure 15: This assertion relays pass/fail to cocotb
assert passed
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
444,
16032,
292,
10585,
13,
13,
29937,
11479,
29871,
29941,
29901,
16032,
292,
4312,
7788,
13,
5215,
274,
542,
327,
29890,
13,
3166,
274,
542,
327,
29890,
29889,
509,
335,
5743,
1053,
14053,
292,
23894,
13,
5215,
4036,
13,
13,
29937,
835,
450,
27773,
4605,
29884,
29918,
13239,
3883,
13,
13,
29937,
2178,
1243,
1785,
6609,
671,
27773,
4605,
29884,
29918,
13239,
29892,
577,
3787,
372,
297,
263,
6555,
13,
29937,
2058,
322,
788,
967,
2224,
304,
278,
10876,
2224,
577,
591,
508,
1053,
372,
13,
13,
3166,
2224,
1982,
1053,
10802,
13,
3560,
29918,
2084,
353,
10802,
703,
636,
2564,
17863,
580,
13,
13,
5215,
10876,
29871,
396,
694,
25621,
29901,
382,
29946,
29900,
29906,
13,
9675,
29889,
2084,
29889,
7851,
29898,
29900,
29892,
851,
29898,
3560,
29918,
2084,
876,
13,
13,
3166,
27773,
4605,
29884,
29918,
13239,
1053,
438,
567,
29892,
394,
29884,
29918,
11965,
2463,
29892,
17927,
29892,
679,
29918,
524,
29871,
396,
694,
25621,
29901,
382,
29946,
29900,
29906,
13,
13,
13,
29937,
444,
21605,
701,
278,
274,
542,
327,
29890,
323,
4901,
1964,
29965,
1243,
13,
13,
29937,
11479,
29871,
29955,
29901,
450,
1369,
310,
278,
323,
4901,
1964,
29965,
29889,
2538,
300,
278,
360,
2692,
13,
29992,
29883,
542,
327,
29890,
29889,
1688,
580,
13,
12674,
822,
394,
29884,
29918,
1688,
29898,
29881,
329,
1125,
13,
1678,
4502,
353,
5852,
13,
1678,
13850,
29887,
353,
731,
580,
29871,
396,
13303,
23746,
13,
1678,
7272,
14053,
292,
23894,
29898,
29881,
329,
29889,
20495,
29897,
13,
1678,
9379,
29889,
12071,
29918,
29876,
29889,
1767,
353,
29871,
29900,
13,
1678,
9379,
29889,
2962,
29889,
1767,
353,
29871,
29900,
13,
1678,
7272,
14053,
292,
23894,
29898,
29881,
329,
29889,
20495,
29897,
13,
1678,
9379,
29889,
12071,
29918,
29876,
29889,
1767,
353,
29871,
29896,
13,
29937,
835,
317,
2548,
8260,
13,
29937,
11479,
29871,
29947,
29901,
26221,
697,
10804,
363,
1269,
5858,
13,
1678,
9920,
29918,
2798,
353,
29871,
29896,
13,
1678,
1015,
29918,
1761,
353,
1051,
29898,
29949,
567,
29897,
13,
1678,
954,
29918,
3554,
353,
7431,
29898,
459,
29918,
1761,
29897,
13,
1678,
1550,
9920,
29918,
2798,
5277,
954,
29918,
3554,
29901,
13,
4706,
7272,
14053,
292,
23894,
29898,
29881,
329,
29889,
20495,
29897,
13,
4706,
380,
353,
679,
29918,
524,
29898,
29881,
329,
29889,
2962,
29897,
13,
4706,
270,
29876,
353,
679,
29918,
524,
29898,
29881,
329,
29889,
15091,
29897,
13,
29937,
835,
317,
2548,
263,
1899,
322,
10534,
363,
372,
304,
4866,
13,
29937,
11479,
29871,
29929,
29901,
26221,
263,
323,
4901,
1964,
29965,
1899,
13,
4706,
565,
380,
1275,
29871,
29900,
322,
270,
29876,
1275,
29871,
29900,
29901,
13,
9651,
29099,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
29871,
29906,
29945,
29945,
29897,
13,
9651,
289,
29890,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
29871,
29906,
29945,
29945,
29897,
13,
9651,
1015,
353,
1015,
29918,
1761,
29889,
7323,
29898,
29900,
29897,
13,
9651,
13850,
29887,
29889,
1202,
29898,
459,
29897,
13,
9651,
9379,
29889,
29909,
29889,
1767,
353,
29099,
13,
9651,
9379,
29889,
29933,
29889,
1767,
353,
289,
29890,
13,
9651,
9379,
29889,
459,
29889,
1767,
353,
1015,
13,
9651,
9379,
29889,
2962,
29889,
1767,
353,
29871,
29896,
13,
29937,
11479,
29871,
29896,
29900,
29901,
1094,
643,
1259,
393,
263,
10672,
2106,
2360,
5930,
13,
4706,
565,
380,
1275,
29871,
29900,
322,
270,
29876,
1275,
29871,
29896,
29901,
13,
9651,
12020,
16499,
291,
2392,
703,
29928,
2692,
4829,
29901,
2309,
731,
304,
29871,
29896,
1728,
1369,
1159,
13,
29937,
11479,
29871,
29896,
29896,
29901,
960,
591,
526,
297,
385,
5858,
29892,
6773,
13,
4706,
565,
380,
1275,
29871,
29896,
322,
270,
29876,
1275,
29871,
29900,
29901,
13,
9651,
6773,
13,
29937,
835,
5399,
292,
278,
1121,
13,
29937,
11479,
29871,
29896,
29906,
29901,
450,
5858,
338,
4866,
13,
4706,
565,
380,
1275,
29871,
29896,
322,
270,
29876,
1275,
29871,
29896,
29901,
13,
9651,
9379,
29889,
2962,
29889,
1767,
353,
29871,
29900,
13,
9651,
9920,
29918,
2798,
4619,
29871,
29896,
13,
9651,
1121,
353,
679,
29918,
524,
29898,
29881,
329,
29889,
2914,
29897,
13,
29937,
11479,
29871,
29896,
29941,
29901,
5399,
292,
2582,
2750,
278,
18988,
13,
9651,
544,
353,
394,
29884,
29918,
11965,
2463,
29898,
7340,
29892,
289,
29890,
29892,
1015,
29897,
13,
9651,
565,
1121,
1275,
544,
29901,
13,
18884,
17927,
29889,
3888,
29898,
13,
462,
1678,
285,
29908,
29925,
3289,
1660,
29928,
29901,
426,
7340,
29901,
29906,
29916,
29913,
426,
459,
29889,
978,
29913,
426,
1327,
29901,
29906,
29916,
29913,
353,
426,
2914,
29901,
29900,
29946,
29916,
27195,
13,
9651,
1683,
29901,
13,
18884,
17927,
29889,
2704,
29898,
13,
462,
1678,
285,
29908,
4519,
29902,
20566,
29901,
426,
7340,
29901,
29906,
29916,
29913,
426,
459,
29889,
978,
29913,
426,
1327,
29901,
29906,
29916,
29913,
29465,
13,
462,
1678,
285,
29908,
426,
2914,
29901,
29900,
29946,
29916,
29913,
448,
25383,
426,
558,
29901,
29900,
29946,
29916,
27195,
13,
18884,
4502,
353,
7700,
13,
29937,
835,
4231,
14424,
278,
1243,
13,
29937,
11479,
29871,
29896,
29946,
29901,
5399,
292,
13303,
23746,
773,
263,
731,
13,
1678,
565,
7431,
29898,
842,
29898,
29949,
567,
29897,
448,
13850,
29887,
29897,
1405,
29871,
29900,
29901,
13,
4706,
17927,
29889,
2704,
29898,
29888,
29908,
6678,
284,
23746,
1059,
29889,
4750,
287,
29901,
426,
842,
29898,
29949,
567,
6817,
11023,
29887,
27195,
13,
4706,
4502,
353,
7700,
13,
1678,
1683,
29901,
13,
4706,
17927,
29889,
3888,
703,
29907,
957,
287,
599,
6931,
1159,
13,
29937,
11479,
29871,
29896,
29945,
29901,
910,
28306,
1104,
1036,
1209,
29914,
14057,
304,
274,
542,
327,
29890,
13,
1678,
4974,
4502,
13,
2
] |
nutsml/examples/pytorch_/mnist/mlp_train.py | maet3608/nuts-ml | 39 | 19605 | """
.. module:: cnn_train
:synopsis: Example nuts-ml pipeline for training a MLP on MNIST
"""
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.optim as optim
import nutsflow as nf
import nutsml as nm
import numpy as np
from nutsml.network import PytorchNetwork
from utils import download_mnist, load_mnist
class Model(nn.Module):
"""Pytorch model"""
def __init__(self, device):
"""Construct model on given device, e.g. 'cpu' or 'cuda'"""
super(Model, self).__init__()
self.fc1 = nn.Linear(28 * 28, 500)
self.fc2 = nn.Linear(500, 256)
self.fc3 = nn.Linear(256, 10)
self.to(device) # set device before constructing optimizer
# required properties of a model to be wrapped as PytorchNetwork!
self.device = device # 'cuda', 'cuda:0' or 'gpu'
self.losses = nn.CrossEntropyLoss() # can be list of loss functions
self.optimizer = optim.Adam(self.parameters())
def forward(self, x):
"""Forward pass through network for input x"""
x = x.view(-1, 28 * 28)
x = F.relu(self.fc1(x))
x = F.relu(self.fc2(x))
x = self.fc3(x)
return x
def accuracy(y_true, y_pred):
"""Compute accuracy"""
from sklearn.metrics import accuracy_score
y_pred = [yp.argmax() for yp in y_pred]
return 100 * accuracy_score(y_true, y_pred)
def evaluate(network, x, y):
"""Evaluate network performance (here accuracy)"""
metrics = [accuracy]
build_batch = (nm.BuildBatch(64)
.input(0, 'vector', 'float32')
.output(1, 'number', 'int64'))
acc = zip(x, y) >> build_batch >> network.evaluate(metrics)
return acc
def train(network, epochs=3):
"""Train network for given number of epochs"""
print('loading data...')
filepath = download_mnist()
x_train, y_train, x_test, y_test = load_mnist(filepath)
plot = nm.PlotLines(None, every_sec=0.2)
build_batch = (nm.BuildBatch(128)
.input(0, 'vector', 'float32')
.output(1, 'number', 'int64'))
for epoch in range(epochs):
print('epoch', epoch + 1)
losses = (zip(x_train, y_train) >> nf.PrintProgress(x_train) >>
nf.Shuffle(1000) >> build_batch >>
network.train() >> plot >> nf.Collect())
acc_test = evaluate(network, x_test, y_test)
acc_train = evaluate(network, x_train, y_train)
print('train loss : {:.6f}'.format(np.mean(losses)))
print('train acc : {:.1f}'.format(acc_train))
print('test acc : {:.1f}'.format(acc_test))
if __name__ == '__main__':
print('creating model...')
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = Model(device)
network = PytorchNetwork(model)
# network.load_weights()
network.print_layers((28 * 28,))
print('training network...')
train(network, epochs=3)
| [
1,
9995,
13,
636,
3883,
1057,
274,
15755,
29918,
14968,
13,
259,
584,
19274,
15368,
29901,
8741,
302,
8842,
29899,
828,
16439,
363,
6694,
263,
341,
13208,
373,
341,
29940,
9047,
13,
15945,
29908,
13,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
4842,
305,
29889,
20640,
408,
5994,
13,
5215,
302,
8842,
1731,
408,
302,
29888,
13,
5215,
302,
8842,
828,
408,
302,
29885,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
302,
8842,
828,
29889,
11618,
1053,
349,
3637,
25350,
13724,
13,
3166,
3667,
29879,
1053,
5142,
29918,
23521,
391,
29892,
2254,
29918,
23521,
391,
13,
13,
13,
1990,
8125,
29898,
15755,
29889,
7355,
1125,
13,
1678,
9995,
29925,
3637,
25350,
1904,
15945,
29908,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4742,
1125,
13,
4706,
9995,
1168,
4984,
1904,
373,
2183,
4742,
29892,
321,
29889,
29887,
29889,
525,
21970,
29915,
470,
525,
29883,
6191,
11838,
15945,
13,
4706,
2428,
29898,
3195,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
13801,
29896,
353,
302,
29876,
29889,
12697,
29898,
29906,
29947,
334,
29871,
29906,
29947,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
13801,
29906,
353,
302,
29876,
29889,
12697,
29898,
29945,
29900,
29900,
29892,
29871,
29906,
29945,
29953,
29897,
13,
4706,
1583,
29889,
13801,
29941,
353,
302,
29876,
29889,
12697,
29898,
29906,
29945,
29953,
29892,
29871,
29896,
29900,
29897,
13,
13,
4706,
1583,
29889,
517,
29898,
10141,
29897,
29871,
396,
731,
4742,
1434,
3386,
292,
5994,
3950,
13,
13,
4706,
396,
3734,
4426,
310,
263,
1904,
304,
367,
21021,
408,
349,
3637,
25350,
13724,
29991,
13,
4706,
1583,
29889,
10141,
353,
4742,
29871,
396,
525,
29883,
6191,
742,
525,
29883,
6191,
29901,
29900,
29915,
470,
525,
29887,
3746,
29915,
13,
4706,
1583,
29889,
6758,
267,
353,
302,
29876,
29889,
29907,
2124,
5292,
14441,
29931,
2209,
580,
29871,
396,
508,
367,
1051,
310,
6410,
3168,
13,
4706,
1583,
29889,
20640,
3950,
353,
5994,
29889,
3253,
314,
29898,
1311,
29889,
16744,
3101,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
9995,
2831,
1328,
1209,
1549,
3564,
363,
1881,
921,
15945,
29908,
13,
4706,
921,
353,
921,
29889,
1493,
6278,
29896,
29892,
29871,
29906,
29947,
334,
29871,
29906,
29947,
29897,
13,
4706,
921,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
13801,
29896,
29898,
29916,
876,
13,
4706,
921,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
13801,
29906,
29898,
29916,
876,
13,
4706,
921,
353,
1583,
29889,
13801,
29941,
29898,
29916,
29897,
13,
4706,
736,
921,
13,
13,
13,
1753,
13600,
29898,
29891,
29918,
3009,
29892,
343,
29918,
11965,
1125,
13,
1678,
9995,
20606,
29872,
13600,
15945,
29908,
13,
1678,
515,
2071,
19668,
29889,
2527,
10817,
1053,
13600,
29918,
13628,
13,
1678,
343,
29918,
11965,
353,
518,
1478,
29889,
1191,
3317,
580,
363,
343,
29886,
297,
343,
29918,
11965,
29962,
13,
1678,
736,
29871,
29896,
29900,
29900,
334,
13600,
29918,
13628,
29898,
29891,
29918,
3009,
29892,
343,
29918,
11965,
29897,
13,
13,
13,
1753,
14707,
29898,
11618,
29892,
921,
29892,
343,
1125,
13,
1678,
9995,
29923,
4387,
403,
3564,
4180,
313,
4150,
13600,
5513,
15945,
13,
1678,
21556,
353,
518,
562,
2764,
4135,
29962,
13,
1678,
2048,
29918,
16175,
353,
313,
22882,
29889,
8893,
23145,
29898,
29953,
29946,
29897,
13,
462,
259,
869,
2080,
29898,
29900,
29892,
525,
8111,
742,
525,
7411,
29941,
29906,
1495,
13,
462,
259,
869,
4905,
29898,
29896,
29892,
525,
4537,
742,
525,
524,
29953,
29946,
8785,
13,
1678,
1035,
353,
14319,
29898,
29916,
29892,
343,
29897,
5099,
2048,
29918,
16175,
5099,
3564,
29889,
24219,
403,
29898,
2527,
10817,
29897,
13,
1678,
736,
1035,
13,
13,
13,
1753,
7945,
29898,
11618,
29892,
21502,
12168,
29922,
29941,
1125,
13,
1678,
9995,
5323,
262,
3564,
363,
2183,
1353,
310,
21502,
12168,
15945,
29908,
13,
1678,
1596,
877,
13234,
848,
856,
1495,
13,
1678,
934,
2084,
353,
5142,
29918,
23521,
391,
580,
13,
1678,
921,
29918,
14968,
29892,
343,
29918,
14968,
29892,
921,
29918,
1688,
29892,
343,
29918,
1688,
353,
2254,
29918,
23521,
391,
29898,
1445,
2084,
29897,
13,
13,
1678,
6492,
353,
302,
29885,
29889,
20867,
20261,
29898,
8516,
29892,
1432,
29918,
3471,
29922,
29900,
29889,
29906,
29897,
13,
1678,
2048,
29918,
16175,
353,
313,
22882,
29889,
8893,
23145,
29898,
29896,
29906,
29947,
29897,
13,
462,
259,
869,
2080,
29898,
29900,
29892,
525,
8111,
742,
525,
7411,
29941,
29906,
1495,
13,
462,
259,
869,
4905,
29898,
29896,
29892,
525,
4537,
742,
525,
524,
29953,
29946,
8785,
13,
13,
1678,
363,
21502,
305,
297,
3464,
29898,
1022,
2878,
29879,
1125,
13,
4706,
1596,
877,
1022,
2878,
742,
21502,
305,
718,
29871,
29896,
29897,
13,
4706,
28495,
353,
313,
7554,
29898,
29916,
29918,
14968,
29892,
343,
29918,
14968,
29897,
5099,
302,
29888,
29889,
11816,
14470,
29898,
29916,
29918,
14968,
29897,
5099,
13,
462,
29871,
302,
29888,
29889,
2713,
21897,
29898,
29896,
29900,
29900,
29900,
29897,
5099,
2048,
29918,
16175,
5099,
13,
462,
29871,
3564,
29889,
14968,
580,
5099,
6492,
5099,
302,
29888,
29889,
28916,
3101,
13,
4706,
1035,
29918,
1688,
353,
14707,
29898,
11618,
29892,
921,
29918,
1688,
29892,
343,
29918,
1688,
29897,
13,
4706,
1035,
29918,
14968,
353,
14707,
29898,
11618,
29892,
921,
29918,
14968,
29892,
343,
29918,
14968,
29897,
13,
4706,
1596,
877,
14968,
6410,
584,
12365,
29889,
29953,
29888,
29913,
4286,
4830,
29898,
9302,
29889,
12676,
29898,
6758,
267,
4961,
13,
4706,
1596,
877,
14968,
1035,
29871,
584,
12365,
29889,
29896,
29888,
29913,
4286,
4830,
29898,
5753,
29918,
14968,
876,
13,
4706,
1596,
877,
1688,
1035,
259,
584,
12365,
29889,
29896,
29888,
29913,
4286,
4830,
29898,
5753,
29918,
1688,
876,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1596,
877,
1037,
1218,
1904,
856,
1495,
13,
1678,
4742,
353,
525,
29883,
6191,
29915,
565,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
1683,
525,
21970,
29915,
13,
1678,
1904,
353,
8125,
29898,
10141,
29897,
13,
1678,
3564,
353,
349,
3637,
25350,
13724,
29898,
4299,
29897,
13,
13,
1678,
396,
3564,
29889,
1359,
29918,
705,
5861,
580,
13,
1678,
3564,
29889,
2158,
29918,
29277,
3552,
29906,
29947,
334,
29871,
29906,
29947,
29892,
876,
13,
13,
1678,
1596,
877,
26495,
3564,
856,
1495,
13,
1678,
7945,
29898,
11618,
29892,
21502,
12168,
29922,
29941,
29897,
13,
2
] |
gcp-cloud-function/send_email/main.py | duongphannamhung/atom-assignments | 3 | 89885 | <gh_stars>1-10
def send_email(request):
"""Responds to any HTTP request.
Args:
request (flask.Request): HTTP request object.
Returns:
The response text or any set of values that can be turned into a
Response object using
`make_response <http://flask.pocoo.org/docs/1.0/api/#flask.Flask.make_response>`.
"""
import os
import json
import email, smtplib, ssl
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import datetime as dt # to work with date, time
import sys
request_json = request.get_json() #--> get the request json
if request_json and 'subject' in request_json:
print('subject ==> {}'.format(request_json['subject']))
if request_json and 'receiver_email' in request_json:
print('receiver_email ==> {}'.format(request_json['receiver_email']))
## 1A - Take input from request json
receiver_email = request_json['receiver_email']
subject = request_json['subject']
## 1B - Get ENV set in Cloud
#sender_email = os.getenv('SENDER_EMAIL') ## PLEASE MEMBER TO SET THE ENV VARIABLES IN YOUR CLOUD FUNC
sender_email = os.environ.get('SENDER_EMAIL')
password = os.environ.get('PWD_EMAIL')
print('=== Step 1: Get Input')
## 2 - Email Set
email = MIMEMultipart()
email["From"] = sender_email
email["To"] = receiver_email
email["Subject"] = subject
## 3 - Email Contents
# We use html, you can convert word to html: https://wordtohtml.net/
html1 = """
<html>
<h1><strong>Hello World</strong></h1>
<body>
<p>Hi!<br>
How are you?<br>
Here is the <a href="https://docs.python.org/3.4/library/email-examples.html">link</a> you wanted.
</p>
</body>
</html>
"""
html2 = """
<html>
Email sent at <b>{}</b><br>
</html>
""".format(dt.datetime.now().isoformat())
text3 = '--- End ----'
# Combine parts
part1 = MIMEText(html1, 'html')
part2 = MIMEText(html2, 'html')
part3 = MIMEText(text3, 'plain')
email.attach(part1)
email.attach(part2)
email.attach(part3)
print('=== Step 2: Prep Contents')
## 4 - Create SMTP session for sending the mail
try:
session = smtplib.SMTP('smtp.gmail.com', 587) #use gmail with port
session.starttls() #enable security
print('=== Step 3: Enable Security')
session.login(sender_email, password) #login with mail_id and password
print('=== Step 4: Login Success!')
text = email.as_string()
session.sendmail(sender_email, receiver_email, text)
session.quit()
print('DONE! Mail Sent from {} to {}'.format(sender_email, receiver_email))
message = 'DONE! Mail Sent from {} to {}'.format(sender_email, receiver_email)
status = 'OK'
except:
print('=== ERROR: {}'.format(sys.exc_info()[0]))
message = 'ERROR: {}'.format(sys.exc_info()[0])
status = 'FAIL'
out = {'status': status, 'message': message}
headers= {
'Access-Control-Allow-Origin': '*',
'Content-Type':'application/json'
}
return (json.dumps(out), 200, headers) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
1753,
3638,
29918,
5269,
29898,
3827,
1125,
13,
1678,
9995,
1666,
2818,
29879,
304,
738,
7331,
2009,
29889,
13,
1678,
826,
3174,
29901,
13,
4706,
2009,
313,
1579,
1278,
29889,
3089,
1125,
7331,
2009,
1203,
29889,
13,
1678,
16969,
29901,
13,
4706,
450,
2933,
1426,
470,
738,
731,
310,
1819,
393,
508,
367,
6077,
964,
263,
13,
4706,
13291,
1203,
773,
13,
4706,
421,
5675,
29918,
5327,
529,
1124,
597,
1579,
1278,
29889,
29886,
542,
3634,
29889,
990,
29914,
2640,
29914,
29896,
29889,
29900,
29914,
2754,
8484,
1579,
1278,
29889,
8754,
1278,
29889,
5675,
29918,
5327,
29958,
1412,
13,
1678,
9995,
13,
1678,
1053,
2897,
13,
1678,
1053,
4390,
13,
1678,
1053,
4876,
29892,
1560,
9392,
1982,
29892,
24250,
13,
1678,
515,
4876,
1053,
2094,
397,
414,
13,
1678,
515,
4876,
29889,
29885,
603,
29889,
3188,
1053,
341,
8890,
5160,
13,
1678,
515,
4876,
29889,
29885,
603,
29889,
18056,
442,
1053,
341,
8890,
6857,
27494,
13,
1678,
515,
4876,
29889,
29885,
603,
29889,
726,
1053,
341,
8890,
1626,
13,
1678,
1053,
12865,
408,
11636,
396,
304,
664,
411,
2635,
29892,
931,
13,
1678,
1053,
10876,
13,
13,
1678,
2009,
29918,
3126,
353,
2009,
29889,
657,
29918,
3126,
580,
396,
15110,
679,
278,
2009,
4390,
13,
1678,
565,
2009,
29918,
3126,
322,
525,
16009,
29915,
297,
2009,
29918,
3126,
29901,
13,
4706,
1596,
877,
16009,
25230,
6571,
4286,
4830,
29898,
3827,
29918,
3126,
1839,
16009,
25901,
13,
1678,
565,
2009,
29918,
3126,
322,
525,
13556,
2147,
29918,
5269,
29915,
297,
2009,
29918,
3126,
29901,
13,
4706,
1596,
877,
13556,
2147,
29918,
5269,
25230,
6571,
4286,
4830,
29898,
3827,
29918,
3126,
1839,
13556,
2147,
29918,
5269,
25901,
13,
268,
13,
268,
13,
1678,
444,
29871,
29896,
29909,
448,
11190,
1881,
515,
2009,
4390,
13,
1678,
19870,
29918,
5269,
353,
2009,
29918,
3126,
1839,
13556,
2147,
29918,
5269,
2033,
13,
1678,
4967,
353,
2009,
29918,
3126,
1839,
16009,
2033,
13,
268,
13,
1678,
444,
29871,
29896,
29933,
448,
3617,
12524,
29963,
731,
297,
14293,
13,
1678,
396,
15452,
29918,
5269,
353,
2897,
29889,
657,
6272,
877,
29903,
1430,
8032,
29918,
26862,
6227,
1495,
444,
349,
14063,
22986,
9486,
1001,
7495,
11368,
6093,
12524,
29963,
478,
1718,
29902,
6181,
29903,
2672,
612,
22970,
315,
3927,
15789,
383,
3904,
29907,
13,
1678,
10004,
29918,
5269,
353,
2897,
29889,
21813,
29889,
657,
877,
29903,
1430,
8032,
29918,
26862,
6227,
1495,
13,
1678,
4800,
353,
2897,
29889,
21813,
29889,
657,
877,
29925,
24668,
29918,
26862,
6227,
1495,
13,
1678,
1596,
877,
25512,
16696,
29871,
29896,
29901,
3617,
10567,
1495,
29871,
13,
268,
13,
1678,
444,
29871,
29906,
448,
22608,
3789,
13,
1678,
4876,
353,
341,
8890,
6857,
27494,
580,
13,
1678,
4876,
3366,
4591,
3108,
353,
10004,
29918,
5269,
13,
1678,
4876,
3366,
1762,
3108,
353,
19870,
29918,
5269,
29871,
13,
1678,
4876,
3366,
20622,
3108,
353,
4967,
13,
13,
13,
1678,
444,
29871,
29941,
448,
22608,
2866,
1237,
13,
1678,
396,
1334,
671,
3472,
29892,
366,
508,
3588,
1734,
304,
3472,
29901,
2045,
597,
1742,
517,
1420,
29889,
1212,
29914,
13,
1678,
3472,
29896,
353,
9995,
13,
1678,
529,
1420,
29958,
13,
1678,
529,
29882,
29896,
5299,
1110,
29958,
10994,
2787,
829,
1110,
2565,
29882,
29896,
29958,
13,
1678,
529,
2587,
29958,
13,
1678,
529,
29886,
29958,
18567,
29991,
29966,
1182,
29958,
13,
539,
1128,
526,
366,
29973,
29966,
1182,
29958,
13,
539,
2266,
338,
278,
529,
29874,
2822,
543,
991,
597,
2640,
29889,
4691,
29889,
990,
29914,
29941,
29889,
29946,
29914,
5258,
29914,
5269,
29899,
19057,
29889,
1420,
1013,
2324,
829,
29874,
29958,
366,
5131,
29889,
13,
1678,
1533,
29886,
29958,
13,
1678,
1533,
2587,
29958,
13,
1678,
1533,
1420,
29958,
13,
1678,
9995,
13,
1678,
3472,
29906,
353,
9995,
13,
1678,
529,
1420,
29958,
13,
1678,
22608,
2665,
472,
529,
29890,
29958,
8875,
829,
29890,
5299,
1182,
29958,
13,
1678,
1533,
1420,
29958,
13,
1678,
5124,
1642,
4830,
29898,
6008,
29889,
12673,
29889,
3707,
2141,
10718,
4830,
3101,
13,
13,
1678,
1426,
29941,
353,
525,
5634,
2796,
23250,
29915,
13,
13,
1678,
396,
422,
26062,
5633,
13,
1678,
760,
29896,
353,
341,
8890,
1626,
29898,
1420,
29896,
29892,
525,
1420,
1495,
13,
1678,
760,
29906,
353,
341,
8890,
1626,
29898,
1420,
29906,
29892,
525,
1420,
1495,
13,
1678,
760,
29941,
353,
341,
8890,
1626,
29898,
726,
29941,
29892,
525,
24595,
1495,
13,
13,
1678,
4876,
29889,
14930,
29898,
1595,
29896,
29897,
13,
1678,
4876,
29889,
14930,
29898,
1595,
29906,
29897,
13,
1678,
4876,
29889,
14930,
29898,
1595,
29941,
29897,
13,
1678,
1596,
877,
25512,
16696,
29871,
29906,
29901,
349,
3445,
2866,
1237,
1495,
13,
13,
1678,
444,
29871,
29946,
448,
6204,
13766,
3557,
4867,
363,
9348,
278,
10524,
13,
1678,
1018,
29901,
13,
4706,
4867,
353,
1560,
9392,
1982,
29889,
17061,
3557,
877,
3844,
9392,
29889,
21980,
29889,
510,
742,
29871,
29945,
29947,
29955,
29897,
396,
1509,
330,
2549,
411,
2011,
13,
4706,
4867,
29889,
2962,
29873,
3137,
580,
396,
12007,
6993,
13,
4706,
1596,
877,
25512,
16696,
29871,
29941,
29901,
1174,
519,
14223,
1495,
13,
4706,
4867,
29889,
7507,
29898,
15452,
29918,
5269,
29892,
4800,
29897,
396,
7507,
411,
10524,
29918,
333,
322,
4800,
13,
4706,
1596,
877,
25512,
16696,
29871,
29946,
29901,
19130,
21397,
29991,
1495,
13,
4706,
1426,
353,
4876,
29889,
294,
29918,
1807,
580,
13,
4706,
4867,
29889,
6717,
2549,
29898,
15452,
29918,
5269,
29892,
19870,
29918,
5269,
29892,
1426,
29897,
13,
4706,
4867,
29889,
28358,
580,
13,
4706,
1596,
877,
29928,
12413,
29991,
18623,
28048,
515,
6571,
304,
6571,
4286,
4830,
29898,
15452,
29918,
5269,
29892,
19870,
29918,
5269,
876,
13,
4706,
2643,
353,
525,
29928,
12413,
29991,
18623,
28048,
515,
6571,
304,
6571,
4286,
4830,
29898,
15452,
29918,
5269,
29892,
19870,
29918,
5269,
29897,
13,
4706,
4660,
353,
525,
8949,
29915,
13,
1678,
5174,
29901,
13,
4706,
1596,
877,
25512,
14431,
29901,
6571,
4286,
4830,
29898,
9675,
29889,
735,
29883,
29918,
3888,
580,
29961,
29900,
12622,
13,
4706,
2643,
353,
525,
11432,
29901,
6571,
4286,
4830,
29898,
9675,
29889,
735,
29883,
29918,
3888,
580,
29961,
29900,
2314,
13,
4706,
4660,
353,
525,
4519,
6227,
29915,
13,
13,
268,
13,
1678,
714,
353,
11117,
4882,
2396,
4660,
29892,
525,
4906,
2396,
2643,
29913,
13,
1678,
9066,
29922,
426,
13,
4706,
525,
6638,
29899,
4809,
29899,
15930,
29899,
23182,
2396,
525,
29930,
742,
13,
4706,
525,
3916,
29899,
1542,
22099,
6214,
29914,
3126,
29915,
13,
4706,
500,
13,
1678,
736,
313,
3126,
29889,
29881,
17204,
29898,
449,
511,
29871,
29906,
29900,
29900,
29892,
9066,
29897,
2
] |
model_based/svms/test_model_compression.py | vohoaiviet/tag-image-retrieval | 50 | 28844 |
import sys
import os
import time
from basic.common import ROOT_PATH,checkToSkip,makedirsforfile
from basic.util import readImageSet
from simpleknn.bigfile import BigFile, StreamFile
from basic.annotationtable import readConcepts,readAnnotationsFrom
from basic.metric import getScorer
if __name__ == "__main__":
try:
rootpath = sys.argv[1]
except:
rootpath = ROOT_PATH
metric = 'AP'
feature = "dsift"
trainCollection = 'voc2008train'
trainAnnotationName = 'conceptsvoc2008train.txt'
testCollection = 'voc2008val'
testAnnotationName = 'conceptsvoc2008val.txt'
testset = testCollection
modelName = 'fik50'
modelName = 'fastlinear'
if 'fastlinear' == modelName:
from fastlinear.fastlinear import fastlinear_load_model as load_model
else:
from fiksvm.fiksvm import fiksvm_load_model as load_model
scorer = getScorer(metric)
imset = readImageSet(testCollection,testset,rootpath=rootpath)
concepts = readConcepts(testCollection,testAnnotationName,rootpath=rootpath)
feat_dir = os.path.join(rootpath, testCollection, "FeatureData", feature)
feat_file = BigFile(feat_dir)
_renamed, _vectors = feat_file.read(imset)
nr_of_images = len(_renamed)
nr_of_concepts = len(concepts)
mAP = 0.0
models = [None] * len(concepts)
for i,concept in enumerate(concepts):
model_file_name = os.path.join(rootpath,trainCollection,'Models',trainAnnotationName,feature, modelName, '%s.model'%concept)
model1 = load_model(model_file_name)
(pA,pB) = model1.get_probAB()
model2 = load_model(model_file_name)
model2.add_fastsvm(model1, 0.8, 1)
names,labels = readAnnotationsFrom(testCollection, testAnnotationName, concept, rootpath=rootpath)
name2label = dict(zip(names,labels))
ranklist1 = [(_id, model1.predict(_vec)) for _id,_vec in zip(_renamed, _vectors)]
ranklist2 = [(_id, model2.predict(_vec)) for _id,_vec in zip(_renamed, _vectors)]
model_file_name = os.path.join(rootpath,trainCollection,'Models', 'bag' + trainAnnotationName,feature, modelName, '%s.model'%concept)
model3 = load_model(model_file_name)
ranklist3 = [(_id, model3.predict(_vec)) for _id,_vec in zip(_renamed, _vectors)]
print concept,
for ranklist in [ranklist1, ranklist2, ranklist3]:
ranklist.sort(key=lambda v:v[1], reverse=True)
sorted_labels = [name2label[x[0]] for x in ranklist if x[0] in name2label]
print '%.3f'%scorer.score(sorted_labels),
print ''
| [
1,
29871,
13,
5215,
10876,
13,
5215,
2897,
13,
5215,
931,
13,
13,
3166,
6996,
29889,
9435,
1053,
16641,
2891,
29918,
10145,
29892,
3198,
1762,
15797,
666,
29892,
29885,
12535,
12935,
1454,
1445,
13,
3166,
6996,
29889,
4422,
1053,
1303,
2940,
2697,
13,
3166,
2560,
3959,
29876,
29889,
3752,
1445,
1053,
7997,
2283,
29892,
13763,
2283,
13,
3166,
6996,
29889,
18317,
2371,
1053,
1303,
1168,
1547,
29879,
29892,
949,
2744,
1333,
800,
4591,
13,
3166,
6996,
29889,
16414,
1053,
679,
29903,
2616,
261,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1018,
29901,
13,
4706,
3876,
2084,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
1678,
5174,
29901,
13,
4706,
3876,
2084,
353,
16641,
2891,
29918,
10145,
13,
13,
1678,
12714,
353,
525,
3301,
29915,
13,
1678,
4682,
353,
376,
6289,
2027,
29908,
13,
268,
13,
1678,
7945,
7196,
353,
525,
29894,
542,
29906,
29900,
29900,
29947,
14968,
29915,
13,
1678,
7945,
21978,
1170,
353,
525,
535,
1547,
4501,
542,
29906,
29900,
29900,
29947,
14968,
29889,
3945,
29915,
13,
1678,
1243,
7196,
353,
525,
29894,
542,
29906,
29900,
29900,
29947,
791,
29915,
13,
1678,
1243,
21978,
1170,
353,
525,
535,
1547,
4501,
542,
29906,
29900,
29900,
29947,
791,
29889,
3945,
29915,
13,
1678,
1243,
842,
353,
1243,
7196,
13,
13,
1678,
1904,
1170,
353,
525,
19631,
29945,
29900,
29915,
29871,
13,
1678,
1904,
1170,
353,
525,
11255,
10660,
29915,
13,
1678,
565,
525,
11255,
10660,
29915,
1275,
1904,
1170,
29901,
13,
4706,
515,
5172,
10660,
29889,
11255,
10660,
1053,
5172,
10660,
29918,
1359,
29918,
4299,
408,
2254,
29918,
4299,
13,
1678,
1683,
29901,
13,
4706,
515,
285,
638,
4501,
29885,
29889,
19631,
4501,
29885,
1053,
285,
638,
4501,
29885,
29918,
1359,
29918,
4299,
408,
2254,
29918,
4299,
13,
13,
13,
1678,
885,
9386,
353,
679,
29903,
2616,
261,
29898,
16414,
29897,
13,
268,
13,
268,
13,
13,
1678,
527,
842,
353,
1303,
2940,
2697,
29898,
1688,
7196,
29892,
1688,
842,
29892,
4632,
2084,
29922,
4632,
2084,
29897,
13,
1678,
22001,
353,
1303,
1168,
1547,
29879,
29898,
1688,
7196,
29892,
1688,
21978,
1170,
29892,
4632,
2084,
29922,
4632,
2084,
29897,
13,
1678,
1238,
271,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
2084,
29892,
1243,
7196,
29892,
376,
19132,
1469,
613,
4682,
29897,
13,
1678,
1238,
271,
29918,
1445,
353,
7997,
2283,
29898,
1725,
271,
29918,
3972,
29897,
13,
13,
1678,
903,
1267,
2795,
29892,
903,
345,
14359,
353,
1238,
271,
29918,
1445,
29889,
949,
29898,
326,
842,
29897,
13,
13,
1678,
17114,
29918,
974,
29918,
8346,
353,
7431,
7373,
1267,
2795,
29897,
13,
1678,
17114,
29918,
974,
29918,
535,
1547,
29879,
353,
7431,
29898,
535,
1547,
29879,
29897,
13,
268,
13,
1678,
286,
3301,
353,
29871,
29900,
29889,
29900,
13,
1678,
4733,
353,
518,
8516,
29962,
334,
7431,
29898,
535,
1547,
29879,
29897,
13,
13,
13,
1678,
363,
474,
29892,
535,
1547,
297,
26985,
29898,
535,
1547,
29879,
1125,
13,
4706,
1904,
29918,
1445,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
2084,
29892,
14968,
7196,
5501,
23785,
742,
14968,
21978,
1170,
29892,
14394,
29892,
1904,
1170,
29892,
14210,
29879,
29889,
4299,
29915,
29995,
535,
1547,
29897,
13,
4706,
1904,
29896,
353,
2254,
29918,
4299,
29898,
4299,
29918,
1445,
29918,
978,
29897,
13,
4706,
313,
29886,
29909,
29892,
29886,
29933,
29897,
353,
1904,
29896,
29889,
657,
29918,
22795,
2882,
580,
13,
308,
13,
13,
4706,
1904,
29906,
353,
2254,
29918,
4299,
29898,
4299,
29918,
1445,
29918,
978,
29897,
13,
4706,
1904,
29906,
29889,
1202,
29918,
11255,
4501,
29885,
29898,
4299,
29896,
29892,
29871,
29900,
29889,
29947,
29892,
29871,
29896,
29897,
13,
13,
4706,
2983,
29892,
21134,
353,
1303,
2744,
1333,
800,
4591,
29898,
1688,
7196,
29892,
1243,
21978,
1170,
29892,
6964,
29892,
3876,
2084,
29922,
4632,
2084,
29897,
13,
4706,
1024,
29906,
1643,
353,
9657,
29898,
7554,
29898,
7039,
29892,
21134,
876,
13,
13,
4706,
7115,
1761,
29896,
353,
518,
7373,
333,
29892,
1904,
29896,
29889,
27711,
7373,
2003,
876,
363,
903,
333,
29892,
29918,
2003,
297,
14319,
7373,
1267,
2795,
29892,
903,
345,
14359,
4638,
13,
4706,
7115,
1761,
29906,
353,
518,
7373,
333,
29892,
1904,
29906,
29889,
27711,
7373,
2003,
876,
363,
903,
333,
29892,
29918,
2003,
297,
14319,
7373,
1267,
2795,
29892,
903,
345,
14359,
4638,
13,
308,
13,
13,
4706,
1904,
29918,
1445,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
2084,
29892,
14968,
7196,
5501,
23785,
742,
525,
23156,
29915,
718,
7945,
21978,
1170,
29892,
14394,
29892,
1904,
1170,
29892,
14210,
29879,
29889,
4299,
29915,
29995,
535,
1547,
29897,
13,
4706,
1904,
29941,
353,
2254,
29918,
4299,
29898,
4299,
29918,
1445,
29918,
978,
29897,
13,
4706,
7115,
1761,
29941,
353,
518,
7373,
333,
29892,
1904,
29941,
29889,
27711,
7373,
2003,
876,
363,
903,
333,
29892,
29918,
2003,
297,
14319,
7373,
1267,
2795,
29892,
903,
345,
14359,
4638,
13,
308,
13,
4706,
1596,
6964,
29892,
13,
13,
4706,
363,
7115,
1761,
297,
518,
10003,
1761,
29896,
29892,
7115,
1761,
29906,
29892,
7115,
1761,
29941,
5387,
13,
9651,
7115,
1761,
29889,
6605,
29898,
1989,
29922,
2892,
325,
29901,
29894,
29961,
29896,
1402,
11837,
29922,
5574,
29897,
13,
9651,
12705,
29918,
21134,
353,
518,
978,
29906,
1643,
29961,
29916,
29961,
29900,
5262,
363,
921,
297,
7115,
1761,
565,
921,
29961,
29900,
29962,
297,
1024,
29906,
1643,
29962,
13,
9651,
1596,
14210,
29889,
29941,
29888,
29915,
29995,
1557,
9386,
29889,
13628,
29898,
24582,
29918,
21134,
511,
13,
4706,
1596,
6629,
13,
13,
13,
268,
13,
308,
13,
2
] |
airtableio/api.py | Parapheen/airtableio | 0 | 175213 | <reponame>Parapheen/airtableio<filename>airtableio/api.py
import logging
import os
from http import HTTPStatus
import aiohttp
from .exceptions import AirtableAPIError
LOG = logging.getLogger("airtable")
API_URL = "https://api.airtable.com/v0/{app_id}/{table_name}"
async def make_request(
session, token, method, app_id, table_name, data=None, record_id=None, **kwargs
):
LOG.debug('Make request: "%s" with data: "%r', method, data)
url = Methods.api_url(app_id=app_id, table_name=table_name, record_id=record_id)
req = data
headers = {"Authorization": "Bearer {}".format(token)}
method = method.lower()
if method == "post":
try:
async with session.post(
url, json=req, headers=headers, **kwargs
) as response:
result = await response.json()
return result
except aiohttp.ClientError as e:
raise AirtableAPIError(
f"aiohttp client throws an error: {e.__class__.__name__}: {e}"
)
elif method == "get":
try:
async with session.get(url, headers=headers, **kwargs) as response:
result = await response.json()
LOG.debug("Got result from get query: {}".format(result))
return result
except aiohttp.ClientError as e:
raise AirtableAPIError(
f"aiohttp client throws an error: {e.__class__.__name__}: {e}"
)
elif method == "put":
try:
async with session.put(
url, data=req, headers=headers, **kwargs
) as response:
result = await response.json()
return result
except aiohttp.ClientError as e:
raise AirtableAPIError(
f"aiohttp client throws an error: {e.__class__.__name__}: {e}"
)
elif method == "patch":
try:
async with session.patch(
url, data=req, headers=headers, **kwargs
) as response:
result = await response.json()
return result
except aiohttp.ClientError as e:
raise AirtableAPIError(
f"aiohttp client throws an error: {e.__class__.__name__}: {e}"
)
def compose_data(params=None):
"""
Prepare request data
:param params:
:return:
"""
data = aiohttp.formdata.FormData(quote_fields=False)
if params:
for key, value in params.items():
data.add_field(key, str(value))
return data
class Methods:
GET_RECORDS = "get"
GET_RECORD = "get"
CREATE_RECORDS = "post"
UPDATE_RECORDS = "patch"
@staticmethod
def api_url(app_id, table_name, record_id=None):
"""
Generate API URL with included token and method name
:param app_id:
:param table_name:
:return:
"""
if record_id:
return (
API_URL.format(app_id=app_id, table_name=table_name) + "/" + record_id
)
else:
return API_URL.format(app_id=app_id, table_name=table_name)
| [
1,
529,
276,
1112,
420,
29958,
2177,
481,
354,
264,
29914,
1466,
2371,
601,
29966,
9507,
29958,
1466,
2371,
601,
29914,
2754,
29889,
2272,
13,
5215,
12183,
13,
5215,
2897,
13,
3166,
1732,
1053,
7331,
5709,
13,
13,
5215,
263,
601,
1124,
13,
13,
3166,
869,
11739,
29879,
1053,
5593,
2371,
8787,
2392,
13,
13,
14480,
353,
12183,
29889,
657,
16363,
703,
1466,
2371,
1159,
13,
13,
8787,
29918,
4219,
353,
376,
991,
597,
2754,
29889,
1466,
2371,
29889,
510,
29914,
29894,
29900,
19248,
932,
29918,
333,
6822,
29912,
2371,
29918,
978,
5038,
13,
13,
13,
12674,
822,
1207,
29918,
3827,
29898,
13,
1678,
4867,
29892,
5993,
29892,
1158,
29892,
623,
29918,
333,
29892,
1591,
29918,
978,
29892,
848,
29922,
8516,
29892,
2407,
29918,
333,
29922,
8516,
29892,
3579,
19290,
13,
1125,
13,
1678,
25401,
29889,
8382,
877,
9984,
2009,
29901,
11860,
29879,
29908,
411,
848,
29901,
11860,
29878,
742,
1158,
29892,
848,
29897,
13,
13,
1678,
3142,
353,
8108,
29879,
29889,
2754,
29918,
2271,
29898,
932,
29918,
333,
29922,
932,
29918,
333,
29892,
1591,
29918,
978,
29922,
2371,
29918,
978,
29892,
2407,
29918,
333,
29922,
11651,
29918,
333,
29897,
13,
13,
1678,
12428,
353,
848,
13,
1678,
9066,
353,
8853,
25471,
1115,
376,
29933,
799,
261,
6571,
1642,
4830,
29898,
6979,
2915,
13,
1678,
1158,
353,
1158,
29889,
13609,
580,
13,
1678,
565,
1158,
1275,
376,
2490,
1115,
13,
4706,
1018,
29901,
13,
9651,
7465,
411,
4867,
29889,
2490,
29898,
13,
18884,
3142,
29892,
4390,
29922,
7971,
29892,
9066,
29922,
13662,
29892,
3579,
19290,
13,
9651,
1723,
408,
2933,
29901,
13,
18884,
1121,
353,
7272,
2933,
29889,
3126,
580,
13,
18884,
736,
1121,
13,
4706,
5174,
263,
601,
1124,
29889,
4032,
2392,
408,
321,
29901,
13,
9651,
12020,
5593,
2371,
8787,
2392,
29898,
13,
18884,
285,
29908,
29874,
601,
1124,
3132,
8026,
385,
1059,
29901,
426,
29872,
17255,
1990,
1649,
17255,
978,
1649,
6177,
426,
29872,
5038,
13,
9651,
1723,
13,
1678,
25342,
1158,
1275,
376,
657,
1115,
13,
4706,
1018,
29901,
13,
9651,
7465,
411,
4867,
29889,
657,
29898,
2271,
29892,
9066,
29922,
13662,
29892,
3579,
19290,
29897,
408,
2933,
29901,
13,
18884,
1121,
353,
7272,
2933,
29889,
3126,
580,
13,
18884,
25401,
29889,
8382,
703,
29954,
327,
1121,
515,
679,
2346,
29901,
6571,
1642,
4830,
29898,
2914,
876,
13,
18884,
736,
1121,
13,
4706,
5174,
263,
601,
1124,
29889,
4032,
2392,
408,
321,
29901,
13,
9651,
12020,
5593,
2371,
8787,
2392,
29898,
13,
18884,
285,
29908,
29874,
601,
1124,
3132,
8026,
385,
1059,
29901,
426,
29872,
17255,
1990,
1649,
17255,
978,
1649,
6177,
426,
29872,
5038,
13,
9651,
1723,
13,
1678,
25342,
1158,
1275,
376,
649,
1115,
13,
4706,
1018,
29901,
13,
9651,
7465,
411,
4867,
29889,
649,
29898,
13,
18884,
3142,
29892,
848,
29922,
7971,
29892,
9066,
29922,
13662,
29892,
3579,
19290,
13,
9651,
1723,
408,
2933,
29901,
13,
18884,
1121,
353,
7272,
2933,
29889,
3126,
580,
13,
18884,
736,
1121,
13,
4706,
5174,
263,
601,
1124,
29889,
4032,
2392,
408,
321,
29901,
13,
9651,
12020,
5593,
2371,
8787,
2392,
29898,
13,
18884,
285,
29908,
29874,
601,
1124,
3132,
8026,
385,
1059,
29901,
426,
29872,
17255,
1990,
1649,
17255,
978,
1649,
6177,
426,
29872,
5038,
13,
9651,
1723,
13,
1678,
25342,
1158,
1275,
376,
5041,
1115,
13,
4706,
1018,
29901,
13,
9651,
7465,
411,
4867,
29889,
5041,
29898,
13,
18884,
3142,
29892,
848,
29922,
7971,
29892,
9066,
29922,
13662,
29892,
3579,
19290,
13,
9651,
1723,
408,
2933,
29901,
13,
18884,
1121,
353,
7272,
2933,
29889,
3126,
580,
13,
18884,
736,
1121,
13,
4706,
5174,
263,
601,
1124,
29889,
4032,
2392,
408,
321,
29901,
13,
9651,
12020,
5593,
2371,
8787,
2392,
29898,
13,
18884,
285,
29908,
29874,
601,
1124,
3132,
8026,
385,
1059,
29901,
426,
29872,
17255,
1990,
1649,
17255,
978,
1649,
6177,
426,
29872,
5038,
13,
9651,
1723,
13,
13,
13,
1753,
27435,
29918,
1272,
29898,
7529,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
349,
3445,
598,
2009,
848,
13,
1678,
584,
3207,
8636,
29901,
13,
1678,
584,
2457,
29901,
13,
1678,
9995,
13,
1678,
848,
353,
263,
601,
1124,
29889,
689,
1272,
29889,
2500,
1469,
29898,
1396,
29918,
9621,
29922,
8824,
29897,
13,
13,
1678,
565,
8636,
29901,
13,
4706,
363,
1820,
29892,
995,
297,
8636,
29889,
7076,
7295,
13,
9651,
848,
29889,
1202,
29918,
2671,
29898,
1989,
29892,
851,
29898,
1767,
876,
13,
13,
1678,
736,
848,
13,
13,
13,
1990,
8108,
29879,
29901,
13,
13,
1678,
12354,
29918,
1525,
29907,
1955,
8452,
353,
376,
657,
29908,
13,
1678,
12354,
29918,
1525,
29907,
25593,
353,
376,
657,
29908,
13,
1678,
14602,
29918,
1525,
29907,
1955,
8452,
353,
376,
2490,
29908,
13,
1678,
16924,
29918,
1525,
29907,
1955,
8452,
353,
376,
5041,
29908,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
7882,
29918,
2271,
29898,
932,
29918,
333,
29892,
1591,
29918,
978,
29892,
2407,
29918,
333,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
3251,
403,
3450,
3988,
411,
5134,
5993,
322,
1158,
1024,
13,
4706,
584,
3207,
623,
29918,
333,
29901,
13,
4706,
584,
3207,
1591,
29918,
978,
29901,
13,
4706,
584,
2457,
29901,
13,
4706,
9995,
13,
4706,
565,
2407,
29918,
333,
29901,
13,
9651,
736,
313,
13,
18884,
3450,
29918,
4219,
29889,
4830,
29898,
932,
29918,
333,
29922,
932,
29918,
333,
29892,
1591,
29918,
978,
29922,
2371,
29918,
978,
29897,
718,
5591,
29908,
718,
2407,
29918,
333,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
736,
3450,
29918,
4219,
29889,
4830,
29898,
932,
29918,
333,
29922,
932,
29918,
333,
29892,
1591,
29918,
978,
29922,
2371,
29918,
978,
29897,
13,
2
] |
office365/onedrive/permissions/sharing_invitation.py | theodoriss/Office365-REST-Python-Client | 0 | 193186 | from office365.directory.identities.identity_set import IdentitySet
from office365.runtime.client_value import ClientValue
class SharingInvitation(ClientValue):
"""The SharingInvitation resource groups invitation-related data items into a single structure."""
def __init__(self, email=None, invited_by=IdentitySet(), redeemed_by=None, signin_required=None):
"""
:param str email: The email address provided for the recipient of the sharing invitation. Read-only.
:param IdentitySet invited_by: Provides information about who sent the invitation that created this permission,
if that information is available. Read-only.
:param str redeemed_by:
:param bool signin_required: If true the recipient of the invitation needs to sign in in order
to access the shared item. Read-only.
"""
super(SharingInvitation, self).__init__()
self.email = email
self.invitedBy = invited_by
self.redeemedBy = redeemed_by
self.signInRequired = signin_required
| [
1,
515,
8034,
29941,
29953,
29945,
29889,
12322,
29889,
1693,
1907,
29889,
22350,
29918,
842,
1053,
27486,
2697,
13,
3166,
8034,
29941,
29953,
29945,
29889,
15634,
29889,
4645,
29918,
1767,
1053,
12477,
1917,
13,
13,
13,
1990,
1383,
4362,
12165,
7018,
29898,
4032,
1917,
1125,
13,
1678,
9995,
1576,
1383,
4362,
12165,
7018,
6503,
6471,
2437,
7018,
29899,
12817,
848,
4452,
964,
263,
2323,
3829,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4876,
29922,
8516,
29892,
23610,
29918,
1609,
29922,
18415,
2697,
3285,
337,
311,
22580,
29918,
1609,
29922,
8516,
29892,
1804,
262,
29918,
12403,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
584,
3207,
851,
4876,
29901,
450,
4876,
3211,
4944,
363,
278,
23957,
993,
310,
278,
19383,
2437,
7018,
29889,
7523,
29899,
6194,
29889,
13,
4706,
584,
3207,
27486,
2697,
23610,
29918,
1609,
29901,
9133,
2247,
2472,
1048,
1058,
2665,
278,
2437,
7018,
393,
2825,
445,
10751,
29892,
13,
9651,
565,
393,
2472,
338,
3625,
29889,
7523,
29899,
6194,
29889,
13,
4706,
584,
3207,
851,
337,
311,
22580,
29918,
1609,
29901,
13,
4706,
584,
3207,
6120,
1804,
262,
29918,
12403,
29901,
960,
1565,
278,
23957,
993,
310,
278,
2437,
7018,
4225,
304,
1804,
297,
297,
1797,
13,
9651,
304,
2130,
278,
7258,
2944,
29889,
7523,
29899,
6194,
29889,
13,
4706,
9995,
13,
4706,
2428,
29898,
2713,
4362,
12165,
7018,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
5269,
353,
4876,
13,
4706,
1583,
29889,
11569,
1573,
2059,
353,
23610,
29918,
1609,
13,
4706,
1583,
29889,
276,
311,
22580,
2059,
353,
337,
311,
22580,
29918,
1609,
13,
4706,
1583,
29889,
4530,
797,
19347,
353,
1804,
262,
29918,
12403,
13,
2
] |
Python/Advanced OOP/Problems/10. Rhombus of stars.py | teodoramilcheva/softuni-software-engineering | 0 | 155320 | <gh_stars>0
INCREASE: int = 1 # global namespace
DECREASE: int = -1
space = ' '
sign = '* '
def print_rhombus(n: int): # global namespace
# fn-in-fn: closure
def print_line(i: int, direction: int): # local namespace visible in print_rhombus
if i == 0: # i is part of the local namespace of print_line
return
line = (n - i) * space + i * sign
print(line.rstrip())
if i == n:
direction = DECREASE # change is happening in the local namespace of print_line
print_line(i + direction, direction) # recusrion
print_line(1, INCREASE)
n = int(input())
print_rhombus(n) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
1177,
22245,
8127,
29901,
938,
353,
29871,
29896,
396,
5534,
7397,
30004,
13,
2287,
22245,
8127,
29901,
938,
353,
448,
29896,
30004,
13,
3493,
353,
525,
525,
30004,
13,
4530,
353,
525,
29930,
525,
30004,
13,
30004,
13,
30004,
13,
1753,
1596,
29918,
19046,
3424,
375,
29898,
29876,
29901,
938,
1125,
396,
5534,
7397,
30004,
13,
1678,
396,
7876,
29899,
262,
29899,
9144,
29901,
18424,
30004,
13,
1678,
822,
1596,
29918,
1220,
29898,
29875,
29901,
938,
29892,
5305,
29901,
938,
1125,
396,
1887,
7397,
7962,
297,
1596,
29918,
19046,
3424,
375,
30004,
13,
4706,
565,
474,
1275,
29871,
29900,
29901,
396,
474,
338,
760,
310,
278,
1887,
7397,
310,
1596,
29918,
1220,
30004,
13,
9651,
736,
30004,
13,
4706,
1196,
353,
313,
29876,
448,
474,
29897,
334,
2913,
718,
474,
334,
1804,
30004,
13,
4706,
1596,
29898,
1220,
29889,
29878,
17010,
3101,
30004,
13,
4706,
565,
474,
1275,
302,
29901,
30004,
13,
9651,
5305,
353,
5012,
22245,
8127,
396,
1735,
338,
10464,
297,
278,
1887,
7397,
310,
1596,
29918,
1220,
30004,
13,
4706,
1596,
29918,
1220,
29898,
29875,
718,
5305,
29892,
5305,
29897,
396,
1162,
4855,
291,
30004,
13,
30004,
13,
1678,
1596,
29918,
1220,
29898,
29896,
29892,
2672,
22245,
8127,
8443,
13,
30004,
13,
30004,
13,
29876,
353,
938,
29898,
2080,
3101,
30004,
13,
2158,
29918,
19046,
3424,
375,
29898,
29876,
29897,
2
] |
main.py | angmont/PIA_PC | 1 | 48521 | import subprocess
import cifrado
import enviocorreos
import puertos
import metadata
import webscraping
import argparse
import os, time
import logging
logging.basicConfig(filename='app.log', level=logging.INFO)
if __name__ == "__main__":
description= ("Este script realiza una gran diversa cantidad de tareas " +
"las cuales son las siguientes: realizar cifrados, obtener metadata, " +
"escaneo de puertos, envio de correos y webscraping")
parser = argparse.ArgumentParser(description="PIA", epilog=description, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-t", metavar='TAREA', dest="tarea", choices=['cifrar','correos', 'dns', 'puertos', 'metadata', 'web', 'hash'] , help='Se elige la tarea a realizar', required=True)
parser.add_argument("-m", metavar='MODO', dest="modo",
choices=['cifmensaje', 'desmensaje', 'cifgithub', 'destxt', 'ciftxt', 'busqueda', 'emails', 'pdf', 'img'] , help='Si desea utilizar la tarea de cifrado o de web scraping, es necesario especificiar el modo')
parser.add_argument("-msj", metavar='MENSAJE', dest="mensaje", type=str, help='Se debe poner un mensaje el cual se quiera cifrar o descifrar.')
parser.add_argument("-key", metavar='LLAVE', dest="llave", type=int, help='Se utiliza para saber a base de cual llave se cifra o descifra el mensaje')
parser.add_argument("-user", metavar='USUARIO', dest="usuario", type=str, help='Es un argumento necesario para la funcion de cifrar los resultados obtenidos de la API de Github')
parser.add_argument("-ru", metavar='RUTA', dest="ruta", type=str, help='Ruta necesaria para el txt que se va a descifrar o donde se encuentran los arctivos pata la funcion de metadata')
parser.add_argument("-rem", metavar='REMITENTE', dest="remitente", type=str, help='Correo del que se enviará el mensaje.')
parser.add_argument("-des", metavar='DESTINATARIO', dest="destinatario", type=str, help='Correo que recibirá el mensaje.')
parser.add_argument("-url", metavar= 'URL', dest="dominio", type=str, help='Url a investigar.')
parser.add_argument("-cont", metavar='CONTENIDO', dest="contenido", type=str, help='Se debe poner un mensaje el cual se quiera enviar.', default="Hola mundo mundial")
parser.add_argument("-asu", metavar='ASUNTO', dest="asunto", type=str, help='Se utiliza para poner el titulo que tendrá el correo.', default="Hola!")
parser.add_argument("-ip", metavar='IP', dest="ip", type=str, help='Se debe introducir la ip a consultar, solo el ID de red.', default="172.217.15.")
parser.add_argument("-ports", metavar='PUERTOS', dest="puertos", help='Introduce los puertos a revisar separados por una coma [80,800]', default= "80,800")
parser.add_argument("-a", metavar='ARCHIVO', dest="archivo", choices=['imagen', 'imagenes', 'pdf', 'pdfs', 'word', 'words', 'mp3', 'mp3s'] , help='Si desea utilizar la tarea de sacar la metadata, es necesario especificiar el tipo de archivo')
parser.add_argument("-mp", metavar= 'METAPATH', dest="metapath", type=str, help='Ruta donde se guardarán los metadatas encontrados.')
parser.add_argument("-bus", metavar='BUSQUEDA', dest="busqueda", type=str, help='Busqueda para realizar en google')
params = parser.parse_args()
try:
logging.info("Se escogió la tarea: ")
logging.info(params.tarea)
tarea = (params.tarea)
except Exception as e:
logging.error("Ocurrió un error: " + str(e))
print(e)
exit
try:
if tarea == 'cifrar':
modo = (params.modo)
logging.info("El modo es: " + modo)
llave = (params.llave)
if (modo == 'cifmensaje') or (modo == 'desmensaje'):
mensaje = (params.mensaje)
logging.info("El mensaje es: " + str(mensaje))
if modo == 'cifmensaje':
print(cifrado.cifrar_mensaje(mensaje, llave))
else:
print(cifrado.descifrar_mensaje(mensaje, llave))
elif modo == 'cifgithub':
usuario = (params.usuario)
logging.info("El usuario es: " + usuario)
cifrado.cifrar_github(usuario, llave)
elif modo == 'destxt':
ruta = (params.ruta)
logging.info("Usaremos la ruta: " + ruta)
cifrado.descifrar_txt(ruta, llave)
elif modo == 'ciftxt':
ruta = params.ruta
logging.info("Usaremos la ruta: " + ruta)
cifrado.cifrar_txt(ruta, llave)
else:
logging.error("Opcion no válida para cifrado")
print('Opción no válida para cifrado')
elif tarea == 'correos':
remitente = (params.remitente)
logging.info("El remitente es: " + remitente)
destinatario = (params.destinatario)
logging.info("El destinatario es: " + destinatario)
mensaje = (params.contenido)
logging.info("El mensaje es: " + mensaje)
asunto = (params.asunto)
logging.info("El asunto es: " + asunto)
orga = (params.dominio)
logging.info("La organizacion es: " + orga)
datos_encontrados = enviocorreos.Busqueda(orga)
if datos_encontrados is None:
logging.info("No se encontró nada")
print("No se encontró nada")
exit()
else:
enviocorreos.GuardarInformacion(datos_encontrados, orga, remitente, destinatario, asunto, mensaje)
elif tarea == 'dns':
logging.info("Se inicia la tarea de dns")
print()
script_p = subprocess.Popen([r'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe','-ExecutionPolicy', 'Unrestricted', './dns.ps1'], cwd=os.getcwd())
script_p.wait()
elif tarea == 'metadata':
logging.info("Tipo de archivo:")
archivo = (params.archivo)
logging.info(archivo)
if (archivo == 'imagen') or (archivo == 'imagenes'):
ruta = (params.ruta)
logging.info("En la ruta: " + ruta)
metapath = (params.metapath)
logging.info("El metadata se guardará en la ruta: " + metapath)
if archivo == 'imagen':
logging.info("Ingresamos a la función printOneMetaImg")
metadata.printOneMetaImg(ruta, metapath)
else:
logging.info("Ingresamos a la función printAllMetaImg")
metadata.printAllMetaImg(ruta, metapath)
elif (archivo == 'pdf') or (archivo == 'pdfs'):
ruta = (params.ruta)
logging.info("Usaremos la ruta: " + ruta)
metapath = (params.metapath)
logging.info("Guardaremos la metadata en: " + metapath)
if archivo == 'pdf':
logging.info("Ingresamos a la función printOneMetaPDF")
metadata.printOneMetaPDf(ruta, metapath)
else:
logging.info("Ingresamos a la función printAllMetaPDF")
metadata.printAllMetaPDf(ruta, metapath)
elif (archivo == 'word') or (archivo == 'words'):
ruta = (params.ruta)
logging.info("Usaremos la ruta: " + ruta)
metapath = (params.metapath)
logging.info("Guardaremos la metadata en: " + metapath)
if archivo == 'word':
logging.info("Ingresamos a la función printOneMetaDocx")
metadata.printOneMetaDocx(ruta, metapath)
else:
logging.info("Ingresamos a la función printAllMetaDocx")
metadata.printAllMetaDocx(ruta, metapath)
else:
ruta = (params.ruta)
logging.info("Usaremos la ruta: " + ruta)
metapath = (params.metapath)
logging.info("Guardaremos la metadata en: " + metapath)
if archivo == 'mp3':
logging.info("Ingresamos a la función printOneMetaMp3")
metadata.printOneMetaMp3(ruta, metapath)
else:
logging.info("Ingresamos a la función printAllMetaMp3")
metadata.printAllMetaMp3(ruta, metapath)
elif tarea == 'puertos':
logging.info("Se introdujo la ip: ")
ip = params.ip
logging.info(ip)
print("Se revisará la ip: " + ip)
logging.info("Se escanearan los puertos: ")
puertoss = params.puertos
logging.info(puertoss)
portlist = params.puertos.split(',')
for i in range (len(portlist)):
print("Con los puertos: " + portlist[i])
portlist[i] = int(portlist[i])
puertos.checoPuertos(ip, portlist, puertoss)
elif tarea == 'web':
logging.info("Con el modo: ")
modo = params.modo
logging.info(modo)
if modo == 'emails' or modo == 'pdf' or modo == 'img':
url = params.dominio
logging.info("El dominio es: ")
logging.info(url)
if modo == 'emails':
logging.info("Si el \"modo\" es: emails")
webscraping.find_mails(url)
elif modo == 'pdf':
logging.info("Si el \"modo\" es: pdf")
webscraping.descargar_pdfs(url)
else:
logging.info("Si el \"modo\" es: img")
webscraping.download_images(url)
elif modo == 'busqueda':
logging.info("Se buscará:")
busqueda = params.busqueda
logging.info(busqueda)
webscraping.busqueda_google(busqueda)
else:
logging.info("Ninguna opción es valida para hacer Web Scrapping" )
print('Opcion no válida para web scraping')
else:
print()
script_p = subprocess.Popen([r'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe',
'-ExecutionPolicy', 'Unrestricted', './rutas.ps1'], cwd=os.getcwd())
script_p.wait()
except Exception as e:
logging.error("Ha ocurrido un error: " + str(e))
print(e)
exit
| [
1,
1053,
1014,
5014,
13,
5215,
274,
361,
26881,
13,
5215,
21061,
542,
272,
276,
359,
13,
5215,
2653,
814,
359,
13,
5215,
15562,
13,
5215,
1856,
1557,
2390,
292,
13,
5215,
1852,
5510,
13,
5215,
2897,
29892,
931,
13,
5215,
12183,
29871,
13,
13,
21027,
29889,
16121,
3991,
29898,
9507,
2433,
932,
29889,
1188,
742,
3233,
29922,
21027,
29889,
11690,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
29871,
6139,
29922,
4852,
29923,
1655,
2471,
1855,
6619,
1185,
3803,
6894,
29874,
5107,
2368,
316,
260,
598,
294,
376,
718,
13,
29871,
376,
3333,
28276,
1487,
1869,
29673,
29901,
8869,
279,
274,
361,
29878,
2255,
29892,
14403,
759,
15562,
29892,
376,
718,
13,
29871,
376,
9977,
1662,
29877,
316,
2653,
814,
359,
29892,
8829,
601,
316,
14515,
359,
343,
1856,
1557,
2390,
292,
1159,
13,
29871,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
543,
2227,
29909,
613,
9358,
26140,
29922,
8216,
29892,
883,
2620,
29918,
1990,
29922,
1191,
5510,
29889,
22131,
9868,
29648,
18522,
29897,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29873,
613,
1539,
485,
279,
2433,
6040,
1525,
29909,
742,
2731,
543,
29873,
6203,
613,
19995,
29922,
1839,
29883,
361,
13678,
3788,
2616,
276,
359,
742,
525,
29881,
1983,
742,
525,
3746,
814,
359,
742,
525,
19635,
742,
525,
2676,
742,
525,
8568,
2033,
1919,
1371,
2433,
2008,
560,
2231,
425,
260,
6203,
263,
8869,
279,
742,
3734,
29922,
5574,
29897,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29885,
613,
1539,
485,
279,
2433,
6720,
3970,
742,
2731,
543,
1545,
29877,
613,
29871,
13,
29871,
19995,
29922,
1839,
29883,
361,
29885,
575,
8339,
742,
525,
2783,
29885,
575,
8339,
742,
525,
29883,
361,
3292,
742,
525,
7854,
486,
742,
525,
29883,
2027,
486,
742,
525,
8262,
339,
8710,
742,
525,
331,
2234,
742,
525,
5140,
742,
525,
2492,
2033,
1919,
1371,
2433,
25598,
553,
11248,
11824,
279,
425,
260,
6203,
316,
274,
361,
26881,
288,
316,
1856,
885,
2390,
292,
29892,
831,
16632,
2628,
13894,
928,
4447,
560,
13963,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
1516,
29926,
613,
1539,
485,
279,
2433,
29924,
1430,
8132,
29967,
29923,
742,
2731,
543,
29885,
575,
8339,
613,
1134,
29922,
710,
29892,
1371,
2433,
2008,
27021,
12509,
261,
443,
18664,
8339,
560,
8351,
409,
439,
8311,
274,
361,
13678,
288,
5153,
361,
13678,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
1989,
613,
1539,
485,
279,
2433,
2208,
7520,
29923,
742,
2731,
543,
13520,
345,
613,
1134,
29922,
524,
29892,
1371,
2433,
2008,
3667,
6619,
1702,
15296,
261,
263,
2967,
316,
8351,
301,
18398,
409,
274,
361,
336,
288,
5153,
361,
336,
560,
18664,
8339,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
1792,
613,
1539,
485,
279,
2433,
3308,
29965,
1718,
5971,
742,
2731,
543,
375,
22223,
613,
1134,
29922,
710,
29892,
1371,
2433,
14190,
443,
2980,
29877,
16632,
2628,
1702,
425,
21802,
316,
274,
361,
13678,
1232,
1121,
2255,
16219,
4396,
316,
425,
3450,
316,
402,
2985,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
582,
613,
1539,
485,
279,
2433,
29934,
2692,
29909,
742,
2731,
543,
29878,
6637,
613,
1134,
29922,
710,
29892,
1371,
2433,
29934,
6637,
16632,
4568,
1702,
560,
13872,
712,
409,
2947,
263,
5153,
361,
13678,
288,
8334,
409,
10671,
661,
1232,
564,
312,
12927,
282,
532,
425,
21802,
316,
15562,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
1745,
613,
1539,
485,
279,
2433,
1525,
26349,
3919,
29923,
742,
2731,
543,
1745,
277,
2016,
613,
1134,
29922,
710,
29892,
1371,
2433,
12521,
276,
29877,
628,
712,
409,
21061,
20484,
560,
18664,
8339,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
2783,
613,
1539,
485,
279,
2433,
2287,
1254,
1177,
1299,
1718,
5971,
742,
2731,
543,
7854,
262,
271,
2628,
613,
1134,
29922,
710,
29892,
1371,
2433,
12521,
276,
29877,
712,
9522,
20397,
29976,
560,
18664,
8339,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
2271,
613,
1539,
485,
279,
29922,
525,
4219,
742,
2731,
543,
24130,
601,
613,
1134,
29922,
710,
29892,
1371,
2433,
5983,
263,
7405,
279,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
1285,
613,
1539,
485,
279,
2433,
22412,
1430,
1367,
29949,
742,
2731,
543,
535,
841,
1941,
613,
1134,
29922,
710,
29892,
1371,
2433,
2008,
27021,
12509,
261,
443,
18664,
8339,
560,
8351,
409,
439,
8311,
21061,
279,
29889,
742,
2322,
543,
29950,
2963,
13864,
28743,
1159,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
294,
29884,
613,
1539,
485,
279,
2433,
3289,
3904,
4986,
742,
2731,
543,
294,
12578,
613,
1134,
29922,
710,
29892,
1371,
2433,
2008,
3667,
6619,
1702,
12509,
261,
560,
4329,
7207,
712,
10331,
6135,
560,
14515,
29877,
29889,
742,
2322,
543,
29950,
2963,
29991,
1159,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
666,
613,
1539,
485,
279,
2433,
5690,
742,
2731,
543,
666,
613,
1134,
29922,
710,
29892,
1371,
2433,
2008,
27021,
4547,
19052,
425,
10377,
263,
8799,
279,
29892,
6651,
560,
3553,
316,
2654,
29889,
742,
2322,
543,
29896,
29955,
29906,
29889,
29906,
29896,
29955,
29889,
29896,
29945,
23157,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
4011,
613,
1539,
485,
279,
2433,
7056,
20161,
3267,
742,
2731,
543,
3746,
814,
359,
613,
1371,
2433,
2928,
3518,
346,
1232,
2653,
814,
359,
263,
23484,
279,
2903,
2255,
1277,
1185,
419,
29874,
518,
29947,
29900,
29892,
29947,
29900,
29900,
29962,
742,
2322,
29922,
376,
29947,
29900,
29892,
29947,
29900,
29900,
1159,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29874,
613,
1539,
485,
279,
2433,
1718,
3210,
5667,
29949,
742,
2731,
543,
1279,
4243,
613,
19995,
29922,
1839,
326,
5370,
742,
525,
326,
5370,
267,
742,
525,
5140,
742,
525,
5140,
29879,
742,
525,
1742,
742,
525,
9303,
742,
525,
1526,
29941,
742,
525,
1526,
29941,
29879,
2033,
1919,
1371,
2433,
25598,
553,
11248,
11824,
279,
425,
260,
6203,
316,
7067,
279,
425,
15562,
29892,
831,
16632,
2628,
13894,
928,
4447,
560,
13306,
316,
3190,
4243,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
1526,
613,
1539,
485,
279,
29922,
525,
2303,
29911,
3301,
7534,
742,
2731,
543,
2527,
481,
493,
613,
1134,
29922,
710,
29892,
1371,
2433,
29934,
6637,
8334,
409,
8372,
279,
1715,
1232,
1539,
328,
271,
294,
14567,
2255,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
703,
29899,
8262,
613,
1539,
485,
279,
2433,
29933,
3308,
13356,
3352,
29909,
742,
2731,
543,
8262,
339,
8710,
613,
1134,
29922,
710,
29892,
1371,
2433,
29933,
8555,
8710,
1702,
8869,
279,
427,
5386,
1495,
13,
29871,
8636,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
2202,
29901,
13,
1678,
12183,
29889,
3888,
703,
2008,
3966,
468,
3556,
425,
260,
6203,
29901,
16521,
13,
1678,
12183,
29889,
3888,
29898,
7529,
29889,
29873,
6203,
29897,
13,
1678,
260,
6203,
353,
313,
7529,
29889,
29873,
6203,
29897,
13,
19499,
8960,
408,
321,
29901,
13,
1678,
12183,
29889,
2704,
703,
29949,
2764,
24584,
443,
1059,
29901,
376,
718,
851,
29898,
29872,
876,
13,
1678,
1596,
29898,
29872,
29897,
13,
1678,
6876,
13,
13,
2202,
29901,
13,
1678,
565,
260,
6203,
1275,
525,
29883,
361,
13678,
2396,
13,
13,
4706,
13963,
353,
313,
7529,
29889,
1545,
29877,
29897,
13,
4706,
12183,
29889,
3888,
703,
6489,
13963,
831,
29901,
376,
718,
13963,
29897,
13,
4706,
301,
18398,
353,
313,
7529,
29889,
13520,
345,
29897,
13,
13,
4706,
565,
313,
1545,
29877,
1275,
525,
29883,
361,
29885,
575,
8339,
1495,
470,
313,
1545,
29877,
1275,
525,
2783,
29885,
575,
8339,
29374,
13,
9651,
18664,
8339,
353,
313,
7529,
29889,
29885,
575,
8339,
29897,
13,
9651,
12183,
29889,
3888,
703,
6489,
18664,
8339,
831,
29901,
376,
718,
851,
29898,
29885,
575,
8339,
876,
13,
9651,
565,
13963,
1275,
525,
29883,
361,
29885,
575,
8339,
2396,
13,
18884,
1596,
29898,
29883,
361,
26881,
29889,
29883,
361,
13678,
29918,
29885,
575,
8339,
29898,
29885,
575,
8339,
29892,
301,
18398,
876,
13,
9651,
1683,
29901,
13,
18884,
1596,
29898,
29883,
361,
26881,
29889,
14273,
361,
13678,
29918,
29885,
575,
8339,
29898,
29885,
575,
8339,
29892,
301,
18398,
876,
13,
13,
4706,
25342,
13963,
1275,
525,
29883,
361,
3292,
2396,
13,
9651,
502,
22223,
353,
313,
7529,
29889,
375,
22223,
29897,
13,
9651,
12183,
29889,
3888,
703,
6489,
502,
22223,
831,
29901,
376,
718,
502,
22223,
29897,
13,
9651,
274,
361,
26881,
29889,
29883,
361,
13678,
29918,
3292,
29898,
375,
22223,
29892,
301,
18398,
29897,
13,
4706,
25342,
13963,
1275,
525,
7854,
486,
2396,
13,
9651,
364,
6637,
353,
313,
7529,
29889,
29878,
6637,
29897,
13,
9651,
12183,
29889,
3888,
703,
15922,
598,
7681,
425,
364,
6637,
29901,
376,
718,
364,
6637,
29897,
13,
9651,
274,
361,
26881,
29889,
14273,
361,
13678,
29918,
3945,
29898,
29878,
6637,
29892,
301,
18398,
29897,
13,
4706,
25342,
13963,
1275,
525,
29883,
2027,
486,
2396,
13,
9651,
364,
6637,
353,
8636,
29889,
29878,
6637,
13,
9651,
12183,
29889,
3888,
703,
15922,
598,
7681,
425,
364,
6637,
29901,
376,
718,
364,
6637,
29897,
13,
9651,
274,
361,
26881,
29889,
29883,
361,
13678,
29918,
3945,
29898,
29878,
6637,
29892,
301,
18398,
29897,
13,
4706,
1683,
29901,
13,
9651,
12183,
29889,
2704,
703,
29949,
6739,
291,
694,
12196,
1458,
1702,
274,
361,
26881,
1159,
13,
9651,
1596,
877,
11746,
1290,
694,
12196,
1458,
1702,
274,
361,
26881,
1495,
13,
13,
1678,
25342,
260,
6203,
1275,
525,
2616,
276,
359,
2396,
13,
13,
4706,
1083,
277,
2016,
353,
313,
7529,
29889,
1745,
277,
2016,
29897,
13,
4706,
12183,
29889,
3888,
703,
6489,
1083,
277,
2016,
831,
29901,
376,
718,
1083,
277,
2016,
29897,
13,
4706,
15422,
271,
2628,
353,
313,
7529,
29889,
7854,
262,
271,
2628,
29897,
13,
4706,
12183,
29889,
3888,
703,
6489,
15422,
271,
2628,
831,
29901,
376,
718,
15422,
271,
2628,
29897,
13,
4706,
18664,
8339,
353,
313,
7529,
29889,
535,
841,
1941,
29897,
13,
4706,
12183,
29889,
3888,
703,
6489,
18664,
8339,
831,
29901,
376,
718,
18664,
8339,
29897,
13,
4706,
408,
12578,
353,
313,
7529,
29889,
294,
12578,
29897,
13,
4706,
12183,
29889,
3888,
703,
6489,
408,
12578,
831,
29901,
376,
718,
408,
12578,
29897,
13,
4706,
1638,
29874,
353,
313,
7529,
29889,
24130,
601,
29897,
13,
4706,
12183,
29889,
3888,
703,
5661,
8674,
16337,
831,
29901,
376,
718,
1638,
29874,
29897,
13,
13,
4706,
18683,
29918,
264,
9996,
2255,
353,
21061,
542,
272,
276,
359,
29889,
29933,
8555,
8710,
29898,
990,
29874,
29897,
13,
4706,
565,
18683,
29918,
264,
9996,
2255,
338,
6213,
29901,
13,
9651,
12183,
29889,
3888,
703,
3782,
409,
14567,
29980,
25801,
1159,
13,
9651,
1596,
703,
3782,
409,
14567,
29980,
25801,
1159,
13,
9651,
6876,
580,
13,
4706,
1683,
29901,
13,
9651,
21061,
542,
272,
276,
359,
29889,
9485,
538,
279,
797,
689,
16337,
29898,
4130,
359,
29918,
264,
9996,
2255,
29892,
1638,
29874,
29892,
1083,
277,
2016,
29892,
15422,
271,
2628,
29892,
408,
12578,
29892,
18664,
8339,
29897,
13,
13,
1678,
25342,
260,
6203,
1275,
525,
29881,
1983,
2396,
259,
13,
9651,
12183,
29889,
3888,
703,
2008,
297,
11477,
425,
260,
6203,
316,
270,
1983,
1159,
13,
9651,
1596,
580,
13,
9651,
2471,
29918,
29886,
353,
1014,
5014,
29889,
29925,
3150,
4197,
29878,
29915,
29907,
3583,
25152,
3970,
7811,
29905,
5205,
29941,
29906,
29905,
7685,
21472,
16037,
29905,
29894,
29896,
29889,
29900,
29905,
12248,
27456,
29889,
8097,
3788,
29899,
20418,
15644,
742,
525,
2525,
5060,
4146,
287,
742,
19283,
29881,
1983,
29889,
567,
29896,
7464,
274,
9970,
29922,
359,
29889,
657,
29883,
9970,
3101,
13,
268,
13,
9651,
2471,
29918,
29886,
29889,
10685,
580,
13,
13,
1678,
25342,
260,
6203,
1275,
525,
19635,
2396,
13,
13,
4706,
12183,
29889,
3888,
703,
29911,
22955,
316,
3190,
4243,
29901,
1159,
13,
4706,
3190,
4243,
353,
313,
7529,
29889,
1279,
4243,
29897,
13,
4706,
12183,
29889,
3888,
29898,
1279,
4243,
29897,
13,
4706,
565,
313,
1279,
4243,
1275,
525,
326,
5370,
1495,
470,
313,
1279,
4243,
1275,
525,
326,
5370,
267,
29374,
13,
9651,
364,
6637,
353,
313,
7529,
29889,
29878,
6637,
29897,
13,
9651,
12183,
29889,
3888,
703,
2369,
425,
364,
6637,
29901,
376,
718,
364,
6637,
29897,
13,
9651,
1539,
481,
493,
353,
313,
7529,
29889,
2527,
481,
493,
29897,
13,
9651,
12183,
29889,
3888,
703,
6489,
15562,
409,
8372,
20484,
427,
425,
364,
6637,
29901,
376,
718,
1539,
481,
493,
29897,
13,
9651,
565,
3190,
4243,
1275,
525,
326,
5370,
2396,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
6716,
19346,
25518,
1159,
13,
18884,
15562,
29889,
2158,
6716,
19346,
25518,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
9651,
1683,
29901,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
3596,
19346,
25518,
1159,
13,
18884,
15562,
29889,
2158,
3596,
19346,
25518,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
4706,
25342,
313,
1279,
4243,
1275,
525,
5140,
1495,
470,
313,
1279,
4243,
1275,
525,
5140,
29879,
29374,
13,
9651,
364,
6637,
353,
313,
7529,
29889,
29878,
6637,
29897,
13,
9651,
12183,
29889,
3888,
703,
15922,
598,
7681,
425,
364,
6637,
29901,
376,
718,
364,
6637,
29897,
13,
9651,
1539,
481,
493,
353,
313,
7529,
29889,
2527,
481,
493,
29897,
13,
9651,
12183,
29889,
3888,
703,
9485,
538,
598,
7681,
425,
15562,
427,
29901,
376,
718,
1539,
481,
493,
29897,
13,
9651,
565,
3190,
4243,
1275,
525,
5140,
2396,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
6716,
19346,
8493,
1159,
13,
18884,
15562,
29889,
2158,
6716,
19346,
25014,
29888,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
9651,
1683,
29901,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
3596,
19346,
8493,
1159,
13,
18884,
15562,
29889,
2158,
3596,
19346,
25014,
29888,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
4706,
25342,
313,
1279,
4243,
1275,
525,
1742,
1495,
470,
313,
1279,
4243,
1275,
525,
9303,
29374,
13,
9651,
364,
6637,
353,
313,
7529,
29889,
29878,
6637,
29897,
13,
9651,
12183,
29889,
3888,
703,
15922,
598,
7681,
425,
364,
6637,
29901,
376,
718,
364,
6637,
29897,
13,
9651,
1539,
481,
493,
353,
313,
7529,
29889,
2527,
481,
493,
29897,
13,
9651,
12183,
29889,
3888,
703,
9485,
538,
598,
7681,
425,
15562,
427,
29901,
376,
718,
1539,
481,
493,
29897,
13,
9651,
565,
3190,
4243,
1275,
525,
1742,
2396,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
6716,
19346,
14526,
29916,
1159,
13,
18884,
15562,
29889,
2158,
6716,
19346,
14526,
29916,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
9651,
1683,
29901,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
3596,
19346,
14526,
29916,
1159,
13,
18884,
15562,
29889,
2158,
3596,
19346,
14526,
29916,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
4706,
1683,
29901,
13,
9651,
364,
6637,
353,
313,
7529,
29889,
29878,
6637,
29897,
13,
9651,
12183,
29889,
3888,
703,
15922,
598,
7681,
425,
364,
6637,
29901,
376,
718,
364,
6637,
29897,
13,
9651,
1539,
481,
493,
353,
313,
7529,
29889,
2527,
481,
493,
29897,
13,
9651,
12183,
29889,
3888,
703,
9485,
538,
598,
7681,
425,
15562,
427,
29901,
376,
718,
1539,
481,
493,
29897,
13,
9651,
565,
3190,
4243,
1275,
525,
1526,
29941,
2396,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
6716,
19346,
29924,
29886,
29941,
1159,
13,
18884,
15562,
29889,
2158,
6716,
19346,
29924,
29886,
29941,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
9651,
1683,
29901,
13,
18884,
12183,
29889,
3888,
703,
797,
7201,
14054,
263,
425,
2090,
1290,
1596,
3596,
19346,
29924,
29886,
29941,
1159,
13,
18884,
15562,
29889,
2158,
3596,
19346,
29924,
29886,
29941,
29898,
29878,
6637,
29892,
1539,
481,
493,
29897,
13,
13,
1678,
25342,
260,
6203,
1275,
525,
3746,
814,
359,
2396,
12,
13,
13,
418,
12183,
29889,
3888,
703,
2008,
4547,
2212,
425,
10377,
29901,
16521,
13,
418,
10377,
353,
8636,
29889,
666,
13,
418,
12183,
29889,
3888,
29898,
666,
29897,
13,
418,
1596,
703,
2008,
23484,
20484,
425,
10377,
29901,
376,
718,
10377,
29897,
13,
13,
418,
12183,
29889,
3888,
703,
2008,
831,
3068,
799,
273,
1232,
2653,
814,
359,
29901,
16521,
13,
418,
2653,
814,
2209,
353,
8636,
29889,
3746,
814,
359,
13,
418,
12183,
29889,
3888,
29898,
3746,
814,
2209,
29897,
13,
418,
2011,
1761,
353,
8636,
29889,
3746,
814,
359,
29889,
5451,
29317,
1495,
13,
418,
363,
474,
297,
3464,
313,
2435,
29898,
637,
1761,
22164,
13,
4706,
1596,
703,
1168,
1232,
2653,
814,
359,
29901,
376,
718,
2011,
1761,
29961,
29875,
2314,
13,
4706,
2011,
1761,
29961,
29875,
29962,
353,
938,
29898,
637,
1761,
29961,
29875,
2314,
13,
12,
12,
13,
418,
2653,
814,
359,
29889,
305,
687,
29877,
29925,
29884,
814,
359,
29898,
666,
29892,
2011,
1761,
29892,
2653,
814,
2209,
29897,
13,
13,
13,
1678,
25342,
260,
6203,
1275,
525,
2676,
2396,
13,
13,
4706,
12183,
29889,
3888,
703,
1168,
560,
13963,
29901,
16521,
13,
4706,
13963,
353,
8636,
29889,
1545,
29877,
13,
4706,
12183,
29889,
3888,
29898,
1545,
29877,
29897,
13,
4706,
565,
13963,
1275,
525,
331,
2234,
29915,
470,
13963,
1275,
525,
5140,
29915,
470,
13963,
1275,
525,
2492,
2396,
13,
9651,
3142,
353,
8636,
29889,
24130,
601,
13,
9651,
12183,
29889,
3888,
703,
6489,
8022,
601,
831,
29901,
16521,
13,
9651,
12183,
29889,
3888,
29898,
2271,
29897,
13,
9651,
565,
13963,
1275,
525,
331,
2234,
2396,
13,
18884,
12183,
29889,
3888,
703,
25598,
560,
13218,
1545,
29877,
5931,
831,
29901,
24609,
1159,
13,
18884,
1856,
1557,
2390,
292,
29889,
2886,
29918,
2549,
29879,
29898,
2271,
29897,
13,
9651,
25342,
13963,
1275,
525,
5140,
2396,
13,
18884,
12183,
29889,
3888,
703,
25598,
560,
13218,
1545,
29877,
5931,
831,
29901,
13552,
1159,
13,
18884,
1856,
1557,
2390,
292,
29889,
14273,
1191,
279,
29918,
5140,
29879,
29898,
2271,
29897,
13,
9651,
1683,
29901,
13,
18884,
12183,
29889,
3888,
703,
25598,
560,
13218,
1545,
29877,
5931,
831,
29901,
10153,
1159,
13,
18884,
1856,
1557,
2390,
292,
29889,
10382,
29918,
8346,
29898,
2271,
29897,
13,
4706,
25342,
13963,
1275,
525,
8262,
339,
8710,
2396,
13,
9651,
12183,
29889,
3888,
703,
2008,
3593,
4287,
29976,
29901,
1159,
13,
9651,
3593,
339,
8710,
353,
8636,
29889,
8262,
339,
8710,
13,
9651,
12183,
29889,
3888,
29898,
8262,
339,
8710,
29897,
13,
9651,
1856,
1557,
2390,
292,
29889,
8262,
339,
8710,
29918,
3608,
29898,
8262,
339,
8710,
29897,
13,
4706,
1683,
29901,
13,
9651,
12183,
29889,
3888,
703,
29940,
292,
4347,
1015,
1290,
831,
659,
1458,
1702,
14557,
2563,
2522,
336,
3262,
29908,
1723,
13,
9651,
1596,
877,
29949,
6739,
291,
694,
12196,
1458,
1702,
1856,
885,
2390,
292,
1495,
13,
1678,
1683,
29901,
13,
13,
12,
1678,
1596,
580,
13,
12,
1678,
2471,
29918,
29886,
353,
1014,
5014,
29889,
29925,
3150,
4197,
29878,
29915,
29907,
3583,
25152,
3970,
7811,
29905,
5205,
29941,
29906,
29905,
7685,
21472,
16037,
29905,
29894,
29896,
29889,
29900,
29905,
12248,
27456,
29889,
8097,
742,
13,
462,
9651,
17411,
20418,
15644,
742,
525,
2525,
5060,
4146,
287,
742,
19283,
23798,
294,
29889,
567,
29896,
7464,
274,
9970,
29922,
359,
29889,
657,
29883,
9970,
3101,
13,
268,
13,
12,
1678,
2471,
29918,
29886,
29889,
10685,
580,
4706,
13,
19499,
8960,
408,
321,
29901,
13,
1678,
12183,
29889,
2704,
703,
24704,
12954,
1038,
1941,
443,
1059,
29901,
376,
718,
851,
29898,
29872,
876,
13,
1678,
1596,
29898,
29872,
29897,
13,
1678,
6876,
13,
2
] |
ch10/myproject_virtualenv/src/django-myproject/myproject/settings/production.py | PacktPublishing/Django-3-Web-Development-Cookbook | 159 | 22663 | from ._base import *
DEBUG = False
WEBSITE_URL = "https://example.com" # without trailing slash
MEDIA_URL = f"{WEBSITE_URL}/media/"
| [
1,
515,
869,
29918,
3188,
1053,
334,
13,
13,
18525,
353,
7700,
13,
13,
8851,
9851,
9094,
29918,
4219,
353,
376,
991,
597,
4773,
29889,
510,
29908,
29871,
396,
1728,
25053,
24765,
13,
2303,
4571,
29909,
29918,
4219,
353,
285,
29908,
29912,
8851,
9851,
9094,
29918,
4219,
6822,
9799,
12975,
13,
2
] |
tests/unit/server/test_get_model_metadata_utils.py | rasapala/OpenVINO-model-server | 0 | 78469 | <reponame>rasapala/OpenVINO-model-server<gh_stars>0
#
# Copyright (c) 2018 Intel Corporation
#
# 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 tensorflow.python.framework import dtypes as dtypes
import numpy as np
import pytest
from ie_serving.server.get_model_metadata_utils import \
_prepare_signature, prepare_get_metadata_output
from conftest import MockedIOInfo
@pytest.mark.parametrize("layers, tensor_key, np_type", [
({'tensor': MockedIOInfo('FP32', (1, 1, 1), 'NCHW'),
'test_tensor': MockedIOInfo('FP32', (1, 1, 1), 'NCHW')},
{'new_key': 'tensor', 'client_key': 'test_tensor'}, np.float32),
({'tensor': MockedIOInfo('I32', (1, 1, 1), 'NCHW')}, {'new_key': 'tensor'},
np.int32),
])
def test_prepare_signature(layers, tensor_key, np_type):
dtype_model = dtypes.as_dtype(np_type)
output = _prepare_signature(
layers=layers, model_keys=tensor_key)
for key, value in tensor_key.items():
assert key in output
assert value in output[key].name
shape = [d.size for d in output[key].tensor_shape.dim]
assert list(layers[value].shape) == shape
tensor_dtype = dtypes.as_dtype(output[key].dtype)
assert dtype_model == tensor_dtype
def test_prepare_get_metadata_output():
inputs = {'tensor_input': MockedIOInfo('FP32', (1, 1, 1), 'NCHW')}
outputs = {'tensor_output': MockedIOInfo('FP32', (1, 1, 1), 'NCHW')}
model_keys = {'inputs': {'name': 'tensor_input'},
'outputs': {'output_name': 'tensor_output'}}
output = prepare_get_metadata_output(
inputs=inputs, outputs=outputs, model_keys=model_keys)
assert "tensorflow/serving/predict" == output.method_name
| [
1,
529,
276,
1112,
420,
29958,
3417,
481,
2883,
29914,
6585,
29963,
1177,
29949,
29899,
4299,
29899,
2974,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
30004,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29947,
18555,
15025,
30004,
13,
29937,
30004,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
18584,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
22993,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
30004,
13,
29937,
30004,
13,
29937,
418,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
30004,
13,
29937,
30004,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
30004,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
11167,
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,
22993,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
30004,
13,
29937,
27028,
1090,
278,
19245,
22993,
13,
29937,
30004,
13,
30004,
13,
3166,
26110,
29889,
4691,
29889,
4468,
1053,
270,
8768,
408,
270,
8768,
30004,
13,
5215,
12655,
408,
7442,
30004,
13,
5215,
11451,
1688,
30004,
13,
3166,
19282,
29918,
643,
1747,
29889,
2974,
29889,
657,
29918,
4299,
29918,
19635,
29918,
13239,
1053,
320,
30004,
13,
1678,
903,
19125,
29918,
4530,
1535,
29892,
19012,
29918,
657,
29918,
19635,
29918,
4905,
30004,
13,
3166,
378,
615,
342,
1053,
26297,
287,
5971,
3401,
30004,
13,
30004,
13,
30004,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
29277,
29892,
12489,
29918,
1989,
29892,
7442,
29918,
1853,
613,
518,
30004,
13,
1678,
313,
10998,
20158,
2396,
26297,
287,
5971,
3401,
877,
26353,
29941,
29906,
742,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
525,
29940,
3210,
29956,
5477,
30004,
13,
418,
525,
1688,
29918,
20158,
2396,
26297,
287,
5971,
3401,
877,
26353,
29941,
29906,
742,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
525,
29940,
3210,
29956,
1495,
1118,
30004,
13,
268,
11117,
1482,
29918,
1989,
2396,
525,
20158,
742,
525,
4645,
29918,
1989,
2396,
525,
1688,
29918,
20158,
16675,
7442,
29889,
7411,
29941,
29906,
511,
30004,
13,
1678,
313,
10998,
20158,
2396,
26297,
287,
5971,
3401,
877,
29902,
29941,
29906,
742,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
525,
29940,
3210,
29956,
1495,
1118,
11117,
1482,
29918,
1989,
2396,
525,
20158,
16675,
30004,
13,
268,
7442,
29889,
524,
29941,
29906,
511,
30004,
13,
2314,
30004,
13,
1753,
1243,
29918,
19125,
29918,
4530,
1535,
29898,
29277,
29892,
12489,
29918,
1989,
29892,
7442,
29918,
1853,
1125,
30004,
13,
1678,
26688,
29918,
4299,
353,
270,
8768,
29889,
294,
29918,
29881,
1853,
29898,
9302,
29918,
1853,
8443,
13,
1678,
1962,
353,
903,
19125,
29918,
4530,
1535,
29898,
30004,
13,
4706,
15359,
29922,
29277,
29892,
1904,
29918,
8149,
29922,
20158,
29918,
1989,
8443,
13,
30004,
13,
1678,
363,
1820,
29892,
995,
297,
12489,
29918,
1989,
29889,
7076,
7295,
30004,
13,
4706,
4974,
1820,
297,
1962,
30004,
13,
4706,
4974,
995,
297,
1962,
29961,
1989,
1822,
978,
30004,
13,
30004,
13,
4706,
8267,
353,
518,
29881,
29889,
2311,
363,
270,
297,
1962,
29961,
1989,
1822,
20158,
29918,
12181,
29889,
6229,
29962,
30004,
13,
4706,
4974,
1051,
29898,
29277,
29961,
1767,
1822,
12181,
29897,
1275,
8267,
30004,
13,
30004,
13,
4706,
12489,
29918,
29881,
1853,
353,
270,
8768,
29889,
294,
29918,
29881,
1853,
29898,
4905,
29961,
1989,
1822,
29881,
1853,
8443,
13,
4706,
4974,
26688,
29918,
4299,
1275,
12489,
29918,
29881,
1853,
30004,
13,
30004,
13,
30004,
13,
1753,
1243,
29918,
19125,
29918,
657,
29918,
19635,
29918,
4905,
7295,
30004,
13,
1678,
10970,
353,
11117,
20158,
29918,
2080,
2396,
26297,
287,
5971,
3401,
877,
26353,
29941,
29906,
742,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
525,
29940,
3210,
29956,
1495,
8117,
13,
1678,
14391,
353,
11117,
20158,
29918,
4905,
2396,
26297,
287,
5971,
3401,
877,
26353,
29941,
29906,
742,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
525,
29940,
3210,
29956,
1495,
8117,
13,
1678,
1904,
29918,
8149,
353,
11117,
2080,
29879,
2396,
11117,
978,
2396,
525,
20158,
29918,
2080,
16675,
30004,
13,
462,
29871,
525,
4905,
29879,
2396,
11117,
4905,
29918,
978,
2396,
525,
20158,
29918,
4905,
29915,
930,
30004,
13,
1678,
1962,
353,
19012,
29918,
657,
29918,
19635,
29918,
4905,
29898,
30004,
13,
4706,
10970,
29922,
2080,
29879,
29892,
14391,
29922,
4905,
29879,
29892,
1904,
29918,
8149,
29922,
4299,
29918,
8149,
8443,
13,
30004,
13,
1678,
4974,
376,
29056,
29914,
643,
1747,
29914,
27711,
29908,
1275,
1962,
29889,
5696,
29918,
978,
30004,
13,
2
] |
faketranslate/metadata.py | HeywoodKing/faketranslate | 0 | 23745 | <filename>faketranslate/metadata.py
# -*- encoding: utf-8 -*-
"""
@File : metadata.py
@Time : 2020/1/1
@Author : flack
@Email : <EMAIL>
@ide : PyCharm
@project : faketranslate
@description : 描述
""" | [
1,
529,
9507,
29958,
29888,
557,
18184,
550,
9632,
29914,
19635,
29889,
2272,
13,
29937,
448,
29930,
29899,
8025,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
29992,
2283,
965,
584,
15562,
29889,
2272,
13,
29992,
2481,
965,
584,
29871,
29906,
29900,
29906,
29900,
29914,
29896,
29914,
29896,
13,
29992,
13720,
308,
584,
285,
2364,
13,
29992,
9823,
3986,
584,
529,
26862,
6227,
29958,
13,
29992,
680,
9651,
584,
10772,
1451,
2817,
13,
29992,
4836,
4706,
584,
285,
557,
18184,
550,
9632,
13,
29992,
8216,
1678,
584,
29871,
233,
146,
146,
235,
194,
179,
13,
15945,
29908,
2
] |
problems/problem3.py | JakobHavtorn/euler | 0 | 23420 | """Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
"""
import math
import numpy as np
def largest_prime_factor_naive(number):
"""
Let the given number be n and let k = 2, 3, 4, 5, ... .
For each k, if it is a factor of n then we divide n by k and completely divide out each k before moving to the next k.
It can be seen that when k is a factor it will necessarily be prime, as all smaller factors have been removed,
and the final result of this process will be n = 1.
"""
factor = 2
factors = []
while number > 1:
if number % factor == 0:
factors.append(factor)
number = number // factor # Remainder guarenteed to be zero
while number % factor == 0:
number = number // factor # Remainder guarenteed to be zero
factor += 1
return factors
def largest_prime_factor_even_optimized(number):
"""
We know that, excluding 2, there are no even prime numbers.
So we can increase factor by 2 per iteration after having found the
"""
factors = []
factor = 2
if number % factor == 0:
number = number // factor
factors.append(factor)
while number % factor == 0:
number = number // factor
factor = 3
while number > 1:
if number % factor == 0:
factors.append(factor)
number = number // factor # Remainder guarenteed to be zero
while number % factor == 0:
number = number // factor # Remainder guarenteed to be zero
factor += 2
return factors
def largest_prime_factor_square_optimized(number):
"""
Every number n can at most have one prime factor greater than n.
If we, after dividing out some prime factor, calculate the square root of the remaining number
we can use that square root as upper limit for factor.
If factor exceeds this square root we know the remaining number is prime.
"""
factors = []
factor = 2
if number % factor == 0:
number = number // factor
factors.append(factor)
while number % factor == 0:
number = number // factor
factor = 3
max_factor = math.sqrt(number)
while number > 1 and factor <= max_factor:
if number % factor == 0:
factors.append(factor)
number = number // factor
while number % factor == 0:
number = number // factor
max_factor = math.sqrt(number)
factor += 2
return factors
def idx_sieve(length):
"""Static length sieve-based prime generator"""
primes = []
is_prime = np.array([True]*length)
i = 2
while i < length:
if is_prime[i]:
is_prime[np.arange(i, length, i)] = False
primes.append(i)
else:
i += 1
return primes
def prime_factor(n, primes):
i = 0
factors = []
while n != 1:
while (n % primes[i]) != 0:
i += 1
factors.append(primes[i])
n = n / primes[i]
return factors
if __name__ == '__main__':
number = 600851475143
print(largest_prime_factor_naive(number))
print(largest_prime_factor_even_optimized(number))
print(largest_prime_factor_square_optimized(number))
number = 600851475143
primes = idx_sieve(20000)
print(max(prime_factor(number, primes)))
| [
1,
9995,
29931,
1191,
342,
6019,
7329,
13,
13,
1576,
6019,
13879,
310,
29871,
29896,
29941,
29896,
29929,
29945,
526,
29871,
29945,
29892,
29871,
29955,
29892,
29871,
29896,
29941,
322,
29871,
29906,
29929,
29889,
13,
5618,
338,
278,
10150,
6019,
7329,
310,
278,
1353,
29871,
29953,
29900,
29900,
29947,
29945,
29896,
29946,
29955,
29945,
29896,
29946,
29941,
29973,
13,
15945,
29908,
13,
13,
5215,
5844,
13,
5215,
12655,
408,
7442,
13,
13,
13,
1753,
10150,
29918,
10080,
29918,
19790,
29918,
1056,
573,
29898,
4537,
1125,
13,
1678,
9995,
13,
1678,
2803,
278,
2183,
1353,
367,
302,
322,
1235,
413,
353,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
2023,
869,
13,
13,
1678,
1152,
1269,
413,
29892,
565,
372,
338,
263,
7329,
310,
302,
769,
591,
16429,
302,
491,
413,
322,
6446,
16429,
714,
1269,
413,
1434,
8401,
304,
278,
2446,
413,
29889,
13,
13,
1678,
739,
508,
367,
3595,
393,
746,
413,
338,
263,
7329,
372,
674,
12695,
367,
6019,
29892,
408,
599,
7968,
13879,
505,
1063,
6206,
29892,
13,
1678,
322,
278,
2186,
1121,
310,
445,
1889,
674,
367,
302,
353,
29871,
29896,
29889,
13,
1678,
9995,
13,
1678,
7329,
353,
29871,
29906,
13,
1678,
13879,
353,
5159,
13,
1678,
1550,
1353,
1405,
29871,
29896,
29901,
13,
4706,
565,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
9651,
13879,
29889,
4397,
29898,
19790,
29897,
13,
9651,
1353,
353,
1353,
849,
7329,
29871,
396,
5240,
475,
672,
1410,
279,
2016,
287,
304,
367,
5225,
13,
9651,
1550,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
18884,
1353,
353,
1353,
849,
7329,
29871,
396,
5240,
475,
672,
1410,
279,
2016,
287,
304,
367,
5225,
13,
4706,
7329,
4619,
29871,
29896,
13,
1678,
736,
13879,
13,
13,
13,
1753,
10150,
29918,
10080,
29918,
19790,
29918,
11884,
29918,
20640,
1891,
29898,
4537,
1125,
13,
1678,
9995,
13,
1678,
1334,
1073,
393,
29892,
429,
22368,
29871,
29906,
29892,
727,
526,
694,
1584,
6019,
3694,
29889,
13,
1678,
1105,
591,
508,
7910,
7329,
491,
29871,
29906,
639,
12541,
1156,
2534,
1476,
278,
29871,
13,
1678,
9995,
13,
1678,
13879,
353,
5159,
13,
1678,
7329,
353,
29871,
29906,
13,
1678,
565,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
4706,
1353,
353,
1353,
849,
7329,
13,
4706,
13879,
29889,
4397,
29898,
19790,
29897,
13,
4706,
1550,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
9651,
1353,
353,
1353,
849,
7329,
13,
13,
1678,
7329,
353,
29871,
29941,
13,
1678,
1550,
1353,
1405,
29871,
29896,
29901,
13,
4706,
565,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
9651,
13879,
29889,
4397,
29898,
19790,
29897,
13,
9651,
1353,
353,
1353,
849,
7329,
29871,
396,
5240,
475,
672,
1410,
279,
2016,
287,
304,
367,
5225,
13,
9651,
1550,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
18884,
1353,
353,
1353,
849,
7329,
29871,
396,
5240,
475,
672,
1410,
279,
2016,
287,
304,
367,
5225,
13,
4706,
7329,
4619,
29871,
29906,
13,
1678,
736,
13879,
13,
13,
13,
1753,
10150,
29918,
10080,
29918,
19790,
29918,
17619,
29918,
20640,
1891,
29898,
4537,
1125,
13,
1678,
9995,
13,
1678,
7569,
1353,
302,
508,
472,
1556,
505,
697,
6019,
7329,
7621,
1135,
302,
29889,
13,
13,
1678,
960,
591,
29892,
1156,
1933,
4821,
714,
777,
6019,
7329,
29892,
8147,
278,
6862,
3876,
310,
278,
9886,
1353,
13,
1678,
591,
508,
671,
393,
6862,
3876,
408,
7568,
4046,
363,
7329,
29889,
13,
268,
13,
1678,
960,
7329,
13461,
29879,
445,
6862,
3876,
591,
1073,
278,
9886,
1353,
338,
6019,
29889,
13,
1678,
9995,
13,
1678,
13879,
353,
5159,
13,
1678,
7329,
353,
29871,
29906,
13,
1678,
565,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
4706,
1353,
353,
1353,
849,
7329,
13,
4706,
13879,
29889,
4397,
29898,
19790,
29897,
13,
4706,
1550,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
9651,
1353,
353,
1353,
849,
7329,
13,
13,
1678,
7329,
353,
29871,
29941,
13,
1678,
4236,
29918,
19790,
353,
5844,
29889,
3676,
29898,
4537,
29897,
13,
1678,
1550,
1353,
1405,
29871,
29896,
322,
7329,
5277,
4236,
29918,
19790,
29901,
13,
4706,
565,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
9651,
13879,
29889,
4397,
29898,
19790,
29897,
13,
9651,
1353,
353,
1353,
849,
7329,
13,
9651,
1550,
1353,
1273,
7329,
1275,
29871,
29900,
29901,
13,
18884,
1353,
353,
1353,
849,
7329,
13,
18884,
4236,
29918,
19790,
353,
5844,
29889,
3676,
29898,
4537,
29897,
13,
4706,
7329,
4619,
29871,
29906,
13,
13,
1678,
736,
13879,
13,
13,
13,
1753,
22645,
29918,
29879,
2418,
29898,
2848,
1125,
13,
1678,
9995,
17046,
3309,
269,
2418,
29899,
6707,
6019,
15299,
15945,
29908,
13,
1678,
544,
1355,
353,
5159,
13,
1678,
338,
29918,
10080,
353,
7442,
29889,
2378,
4197,
5574,
14178,
2848,
29897,
13,
1678,
474,
353,
29871,
29906,
13,
1678,
1550,
474,
529,
3309,
29901,
13,
4706,
565,
338,
29918,
10080,
29961,
29875,
5387,
13,
9651,
338,
29918,
10080,
29961,
9302,
29889,
279,
927,
29898,
29875,
29892,
3309,
29892,
474,
4638,
353,
7700,
13,
9651,
544,
1355,
29889,
4397,
29898,
29875,
29897,
13,
4706,
1683,
29901,
13,
9651,
474,
4619,
29871,
29896,
13,
1678,
736,
544,
1355,
13,
13,
13,
1753,
6019,
29918,
19790,
29898,
29876,
29892,
544,
1355,
1125,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
13879,
353,
5159,
13,
1678,
1550,
302,
2804,
29871,
29896,
29901,
13,
4706,
1550,
313,
29876,
1273,
544,
1355,
29961,
29875,
2314,
2804,
29871,
29900,
29901,
13,
9651,
474,
4619,
29871,
29896,
13,
4706,
13879,
29889,
4397,
29898,
558,
1355,
29961,
29875,
2314,
13,
4706,
302,
353,
302,
847,
544,
1355,
29961,
29875,
29962,
13,
1678,
736,
13879,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1353,
353,
29871,
29953,
29900,
29900,
29947,
29945,
29896,
29946,
29955,
29945,
29896,
29946,
29941,
13,
1678,
1596,
29898,
27489,
342,
29918,
10080,
29918,
19790,
29918,
1056,
573,
29898,
4537,
876,
13,
1678,
1596,
29898,
27489,
342,
29918,
10080,
29918,
19790,
29918,
11884,
29918,
20640,
1891,
29898,
4537,
876,
13,
1678,
1596,
29898,
27489,
342,
29918,
10080,
29918,
19790,
29918,
17619,
29918,
20640,
1891,
29898,
4537,
876,
13,
13,
1678,
1353,
353,
29871,
29953,
29900,
29900,
29947,
29945,
29896,
29946,
29955,
29945,
29896,
29946,
29941,
13,
1678,
544,
1355,
353,
22645,
29918,
29879,
2418,
29898,
29906,
29900,
29900,
29900,
29900,
29897,
13,
268,
13,
1678,
1596,
29898,
3317,
29898,
10080,
29918,
19790,
29898,
4537,
29892,
544,
1355,
4961,
13,
2
] |
apps/utils/errors.py | osw4l/villas-de-san-pablo | 0 | 171375 | <filename>apps/utils/errors.py
__author__ = 'osw4l'
from django.shortcuts import render
def error400(request):
return render(request, '400.html', status=400)
def error403(request):
return render(request, '403.html', status=403)
def error404(request):
return render(request, '404.html', status=404)
def error500(request):
return render(request, '500.html', status=500) | [
1,
529,
9507,
29958,
13371,
29914,
13239,
29914,
12523,
29889,
2272,
13,
1649,
8921,
1649,
353,
525,
359,
29893,
29946,
29880,
29915,
13,
13,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
13,
13,
1753,
1059,
29946,
29900,
29900,
29898,
3827,
1125,
13,
1678,
736,
4050,
29898,
3827,
29892,
525,
29946,
29900,
29900,
29889,
1420,
742,
4660,
29922,
29946,
29900,
29900,
29897,
13,
13,
1753,
1059,
29946,
29900,
29941,
29898,
3827,
1125,
13,
1678,
736,
4050,
29898,
3827,
29892,
525,
29946,
29900,
29941,
29889,
1420,
742,
4660,
29922,
29946,
29900,
29941,
29897,
13,
13,
1753,
1059,
29946,
29900,
29946,
29898,
3827,
1125,
13,
1678,
736,
4050,
29898,
3827,
29892,
525,
29946,
29900,
29946,
29889,
1420,
742,
4660,
29922,
29946,
29900,
29946,
29897,
13,
13,
1753,
1059,
29945,
29900,
29900,
29898,
3827,
1125,
13,
1678,
736,
4050,
29898,
3827,
29892,
525,
29945,
29900,
29900,
29889,
1420,
742,
4660,
29922,
29945,
29900,
29900,
29897,
2
] |
molior/api/mirror.py | randombenj/molior | 0 | 182905 | <gh_stars>0
"""
Provides functions for managing aptly mirrors.
"""
from aiohttp import web
import logging
from molior.model.build import Build
from molior.model.project import Project
from molior.model.projectversion import ProjectVersion
from molior.model.buildvariant import BuildVariant
from molior.molior.utils import get_aptly_connection
# FIXME: cannot import in here from molior.molior.notifier import build_added
from .app import app
logger = logging.getLogger("molior-web")
def error(status, msg, *args):
"""
Logs an error message and returns an error to
the web client.
Args:
status (int): The http response status.
msg (str): The message to display.
args (tuple): Arguments for string format on msg.
"""
logger.error(msg.format(*args))
return web.Response(status=status, text=msg.format(*args))
@app.http_post("/api/mirror")
@app.req_admin
# FIXME: req_role
async def create_mirror(request):
"""
Create a debian aptly mirror.
---
description: Create a debian aptly mirror.
tags:
- Mirrors
consumes:
- application/x-www-form-urlencoded
parameters:
- name: name
in: query
required: true
type: string
description: name of the mirror
- name: url
in: query
required: true
type: string
description: http://host of source
- name: distribution
in: query
required: true
type: string
description: trusty, wheezy, jessie, etc.
- name: components
in: query
required: false
type: array
description: components to be mirrored
default: main
- name: keys
in: query
required: false
type: array
uniqueItems: true
collectionFormat: multi
allowEmptyValue: true
minItems: 0
items:
type: string
description: repository keys
- name: keyserver
in: query
required: false
type: string
description: host name where the keys are
- name: is_basemirror
in: query
required: false
type: boolean
description: use this mirror for chroot
- name: architectures
in: query
required: false
type: array
description: i386,amd64,arm64,armhf,...
- name: version
in: query
required: false
type: string
- name: armored_key_url
in: query
required: false
type: string
- name: basemirror_id
in: query
required: false
type: string
- name: download_sources
in: query
required: false
type: boolean
- name: download_installer
in: query
required: false
type: boolean
produces:
- text/json
responses:
"200":
description: successful
"400":
description: mirror creation failed.
"412":
description: key error.
"409":
description: mirror already exists.
"500":
description: internal server error.
"503":
description: aptly not available.
"501":
description: database error occurred.
"""
params = await request.json()
mirror = params.get("name")
url = params.get("url")
mirror_distribution = params.get("distribution")
components = params.get("components", [])
keys = params.get("keys", [])
keyserver = params.get("keyserver")
is_basemirror = params.get("is_basemirror")
architectures = params.get("architectures", [])
version = params.get("version")
key_url = params.get("armored_key_url")
basemirror_id = params.get("basemirror_id")
download_sources = params.get("download_sources")
download_installer = params.get("download_installer")
if not components:
components = ["main"]
if not isinstance(is_basemirror, bool):
return web.Response(status=400, text="is_basemirror not a bool")
args = {
"create_mirror": [
mirror,
url,
mirror_distribution,
components,
keys,
keyserver,
is_basemirror,
architectures,
version,
key_url,
basemirror_id,
download_sources,
download_installer,
]
}
await request.cirrina.aptly_queue.put(args)
return web.Response(
status=200, text="Mirror {} successfully created.".format(mirror)
)
@app.http_get("/api/mirror")
@app.authenticated
async def get_mirrors(request):
"""
Returns all mirrors from database.
---
description: Returns mirrors from database.
tags:
- Mirrors
consumes:
- application/x-www-form-urlencoded
parameters:
- name: page
in: query
required: false
type: integer
default: 1
description: page number
- name: page_size
in: query
required: false
type: integer
default: 10
description: max. mirrors per page
- name: q
in: query
required: false
type: string
description: filter criteria
produces:
- text/json
responses:
"200":
description: successful
"400":
description: bad request
"""
page = request.GET.getone("page", None)
page_size = request.GET.getone("page_size", None)
filter_name = request.GET.getone("q", "")
if page:
try:
page = int(page)
except (ValueError, TypeError):
return web.Response(text="Incorrect value for page", status=400)
if page_size:
try:
page_size = int(page_size)
except (ValueError, TypeError):
return web.Response(text="Incorrect value for page_size", status=400)
page_size = 1 if page_size < 1 else page_size
query = request.cirrina.db_session.query(
ProjectVersion
) # pylint: disable=no-member
query = query.join(Project, Project.id == ProjectVersion.project_id)
query = query.filter(Project.is_mirror == "true").order_by(Project.name)
if filter_name:
query = query.filter(Project.name.like("%{}%".format(filter_name)))
query = query.order_by(Project.name, ProjectVersion.name)
nb_results = query.count()
if page is not None and page_size:
query = query.offset(page * page_size)
query = query.limit(page_size)
results = query.all()
data = {"total_result_count": nb_results, "results": []}
for mirror in results:
apt_url = mirror.get_apt_repo(url_only=True)
base_mirror_url = str()
if not mirror.project.is_basemirror and mirror.buildvariants:
# FIXME: only one buildvariant supported
base_mirror = mirror.buildvariants[0].base_mirror
base_mirror_url = base_mirror.get_apt_repo(url_only=True)
data["results"].append(
{
"id": mirror.id,
"name": mirror.project.name,
"version": mirror.name,
"url": mirror.mirror_url,
"base_mirror": base_mirror_url,
"distribution": mirror.mirror_distribution,
"components": mirror.mirror_components,
"is_basemirror": mirror.project.is_basemirror,
"architectures": mirror.mirror_architectures[1:-1],
"is_locked": mirror.is_locked,
"with_sources": mirror.mirror_with_sources,
"with_installer": mirror.mirror_with_installer,
"project_id": mirror.project.id,
"state": mirror.mirror_state,
"apt_url": apt_url,
}
)
return web.json_response(data)
@app.http_delete("/api/mirror/{id}")
@app.req_admin
# FIXME: req_role
async def delete_mirror(request):
"""
Delete a single mirror on aptly and from database.
---
description: Delete a single mirror on aptly and from database.
tags:
- Mirrors
consumes:
- application/x-www-form-urlencoded
parameters:
- name: id
in: path
required: true
type: integer
description: id of the mirror
produces:
- text/json
responses:
"200":
description: successful
"400":
description: removal failed from aptly.
"404":
description: mirror not found on aptly.
"500":
description: internal server error.
"503":
description: removal failed from database.
"""
apt = get_aptly_connection()
mirror_id = request.match_info["id"]
query = request.cirrina.db_session.query(ProjectVersion) # pylint: disable=no-member
query = query.join(Project, Project.id == ProjectVersion.project_id)
query = query.filter(Project.is_mirror.is_(True))
entry = query.filter(ProjectVersion.id == mirror_id).first()
if not entry:
logger.warning("error deleting mirror '%s': mirror not found", mirror_id)
return error(404, "Error deleting mirror '%d': mirror not found", mirror_id)
# FIXME: check state, do not delete ready/updating/...
mirrorname = "{}-{}".format(entry.project.name, entry.name)
# check relations
if entry.sourcerepositories:
logger.warning("error deleting mirror '%s': referenced by one or more source repositories", mirrorname)
return error(412, "Error deleting mirror {}: still referenced by one or more source repositories", mirrorname)
if entry.buildconfiguration:
logger.warning("error deleting mirror '%s': referenced by one or more build configurations", mirrorname)
return error(412, "Error deleting mirror {}: still referenced by one or more build configurations", mirrorname)
if entry.dependents:
logger.warning("error deleting mirror '%s': referenced by one or project versions", mirrorname)
return error(412, "Error deleting mirror {}: still referenced by one or more project versions", mirrorname)
base_mirror = ""
if not entry.project.is_basemirror:
basemirror = entry.buildvariants[0].base_mirror
base_mirror = basemirror.project.name + "-" + basemirror.name
# FIXME: cleanup chroot table, schroots, debootstrap,
try:
# FIXME: use altpy queue !
await apt.mirror_delete(base_mirror, entry.project.name, entry.name, entry.mirror_distribution)
except Exception as exc:
# mirror did not exist
# FIXME: handle mirror has snapshots and cannot be deleted?
pass
project = entry.project
bvs = request.cirrina.db_session.query(BuildVariant).filter(
BuildVariant.base_mirror_id == entry.id).all() # pylint: disable=no-member
for bvariant in bvs:
# FIXME: delete buildconfigurations
request.cirrina.db_session.delete(bvariant) # pylint: disable=no-member
builds = request.cirrina.db_session.query(Build) .filter(Build.projectversion_id == entry.id).all()
for build in builds:
# FIXME: delete buildconfigurations
# FIXME: remove buildout dir
request.cirrina.db_session.delete(build) # pylint: disable=no-member
request.cirrina.db_session.delete(entry) # pylint: disable=no-member
request.cirrina.db_session.commit() # pylint: disable=no-member
if not project.projectversions:
request.cirrina.db_session.delete(project) # pylint: disable=no-member
request.cirrina.db_session.commit() # pylint: disable=no-member
return web.Response(status=200, text="Successfully deleted mirror: {}".format(mirrorname))
@app.http_put("/api/mirror/{id}")
@app.req_admin
# FIXME: req_role
async def put_update_mirror(request):
"""
Updates a mirror.
---
description: Updates a mirror.
tags:
- Mirrors
consumes:
- application/x-www-form-urlencoded
parameters:
- name: name
in: path
required: true
type: integer
description: name of the mirror
produces:
- text/json
responses:
"200":
description: Mirror update successfully started.
"400":
description: Mirror not in error state.
"500":
description: Internal server error.
"""
mirror_id = request.match_info["id"]
project_v = (
request.cirrina.db_session.query(ProjectVersion)
.filter(ProjectVersion.id == mirror_id) # pylint: disable=no-member
.first()
)
if project_v.is_locked:
return error(400, "Mirror locked. Update not allowed.")
if project_v.mirror_state != "error":
return error(400, "Mirror not in error state.")
components = project_v.mirror_components.split(",")
# FIXME: only one build variant supported
base_mirror = None
base_mirror_version = None
if not project_v.project.is_basemirror:
base_mirror = project_v.buildvariants[0].base_mirror.project.name
base_mirror_version = project_v.buildvariants[0].base_mirror.name
build = (
request.cirrina.db_session.query(Build)
.filter(Build.buildtype == "mirror", Build.projectversion_id == project_v.id)
.first()
)
if not build:
logger.error("update mirror: no build found for mirror %d", mirror_id)
return error(400, "no build found for mirror")
args = {
"update_mirror": [
build.id,
project_v.id,
base_mirror,
base_mirror_version,
project_v.project.name,
project_v.name,
components,
]
}
await request.cirrina.aptly_queue.put(args)
return web.Response(status=200, text="Successfully started update on mirror")
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
13,
1184,
29894,
2247,
3168,
363,
767,
6751,
10882,
368,
19571,
29879,
29889,
13,
15945,
29908,
13,
3166,
263,
601,
1124,
1053,
1856,
13,
5215,
12183,
13,
13,
3166,
6062,
1611,
29889,
4299,
29889,
4282,
1053,
8878,
13,
3166,
6062,
1611,
29889,
4299,
29889,
4836,
1053,
8010,
13,
3166,
6062,
1611,
29889,
4299,
29889,
4836,
3259,
1053,
8010,
6594,
13,
3166,
6062,
1611,
29889,
4299,
29889,
4282,
19365,
1053,
8878,
10444,
424,
13,
13,
3166,
6062,
1611,
29889,
29885,
324,
1611,
29889,
13239,
1053,
679,
29918,
2156,
368,
29918,
9965,
13,
13,
29937,
383,
6415,
2303,
29901,
2609,
1053,
297,
1244,
515,
6062,
1611,
29889,
29885,
324,
1611,
29889,
1333,
3709,
1053,
2048,
29918,
23959,
13,
13,
13,
3166,
869,
932,
1053,
623,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
703,
29885,
324,
1611,
29899,
2676,
1159,
13,
13,
13,
1753,
1059,
29898,
4882,
29892,
10191,
29892,
334,
5085,
1125,
13,
1678,
9995,
13,
1678,
4522,
29879,
385,
1059,
2643,
322,
3639,
385,
1059,
304,
13,
1678,
278,
1856,
3132,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
4660,
313,
524,
1125,
450,
1732,
2933,
4660,
29889,
13,
4706,
10191,
313,
710,
1125,
450,
2643,
304,
2479,
29889,
13,
4706,
6389,
313,
23583,
1125,
11842,
9331,
363,
1347,
3402,
373,
10191,
29889,
13,
1678,
9995,
13,
1678,
17927,
29889,
2704,
29898,
7645,
29889,
4830,
10456,
5085,
876,
13,
1678,
736,
1856,
29889,
5103,
29898,
4882,
29922,
4882,
29892,
1426,
29922,
7645,
29889,
4830,
10456,
5085,
876,
13,
13,
13,
29992,
932,
29889,
1124,
29918,
2490,
11974,
2754,
29914,
11038,
729,
1159,
13,
29992,
932,
29889,
7971,
29918,
6406,
13,
29937,
383,
6415,
2303,
29901,
12428,
29918,
12154,
13,
12674,
822,
1653,
29918,
11038,
729,
29898,
3827,
1125,
13,
1678,
9995,
13,
1678,
6204,
263,
2553,
713,
10882,
368,
19571,
29889,
13,
13,
1678,
11474,
13,
1678,
6139,
29901,
6204,
263,
2553,
713,
10882,
368,
19571,
29889,
13,
1678,
8282,
29901,
13,
4706,
448,
11612,
729,
29879,
13,
1678,
1136,
9351,
29901,
13,
4706,
448,
2280,
29914,
29916,
29899,
1636,
29899,
689,
29899,
2271,
26716,
13,
1678,
4128,
29901,
13,
4706,
448,
1024,
29901,
1024,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
1565,
13,
3986,
1134,
29901,
1347,
13,
3986,
6139,
29901,
1024,
310,
278,
19571,
13,
4706,
448,
1024,
29901,
3142,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
1565,
13,
3986,
1134,
29901,
1347,
13,
3986,
6139,
29901,
1732,
597,
3069,
310,
2752,
13,
4706,
448,
1024,
29901,
4978,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
1565,
13,
3986,
1134,
29901,
1347,
13,
3986,
6139,
29901,
9311,
29891,
29892,
21266,
29872,
1537,
29892,
432,
404,
347,
29892,
2992,
29889,
13,
4706,
448,
1024,
29901,
7117,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1409,
13,
3986,
6139,
29901,
7117,
304,
367,
19571,
287,
13,
3986,
2322,
29901,
1667,
13,
4706,
448,
1024,
29901,
6611,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1409,
13,
3986,
5412,
6913,
29901,
1565,
13,
3986,
4333,
5809,
29901,
2473,
13,
3986,
2758,
8915,
1917,
29901,
1565,
13,
3986,
1375,
6913,
29901,
29871,
29900,
13,
3986,
4452,
29901,
13,
795,
1134,
29901,
1347,
13,
3986,
6139,
29901,
9810,
6611,
13,
4706,
448,
1024,
29901,
1820,
2974,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1347,
13,
3986,
6139,
29901,
3495,
1024,
988,
278,
6611,
526,
13,
4706,
448,
1024,
29901,
338,
29918,
6500,
331,
381,
729,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
7223,
13,
3986,
6139,
29901,
671,
445,
19571,
363,
521,
4632,
13,
4706,
448,
1024,
29901,
6956,
1973,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1409,
13,
3986,
6139,
29901,
474,
29941,
29947,
29953,
29892,
22490,
29953,
29946,
29892,
2817,
29953,
29946,
29892,
2817,
29882,
29888,
29892,
856,
13,
4706,
448,
1024,
29901,
1873,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1347,
13,
4706,
448,
1024,
29901,
5075,
4395,
29918,
1989,
29918,
2271,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1347,
13,
4706,
448,
1024,
29901,
2362,
331,
381,
729,
29918,
333,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1347,
13,
4706,
448,
1024,
29901,
5142,
29918,
29879,
2863,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
7223,
13,
4706,
448,
1024,
29901,
5142,
29918,
6252,
261,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
7223,
13,
1678,
13880,
29901,
13,
4706,
448,
1426,
29914,
3126,
13,
1678,
20890,
29901,
13,
4706,
376,
29906,
29900,
29900,
1115,
13,
9651,
6139,
29901,
9150,
13,
4706,
376,
29946,
29900,
29900,
1115,
13,
9651,
6139,
29901,
19571,
11265,
5229,
29889,
13,
4706,
376,
29946,
29896,
29906,
1115,
13,
9651,
6139,
29901,
1820,
1059,
29889,
13,
4706,
376,
29946,
29900,
29929,
1115,
13,
9651,
6139,
29901,
19571,
2307,
4864,
29889,
13,
4706,
376,
29945,
29900,
29900,
1115,
13,
9651,
6139,
29901,
7463,
1923,
1059,
29889,
13,
4706,
376,
29945,
29900,
29941,
1115,
13,
9651,
6139,
29901,
10882,
368,
451,
3625,
29889,
13,
4706,
376,
29945,
29900,
29896,
1115,
13,
9651,
6139,
29901,
2566,
1059,
10761,
29889,
13,
1678,
9995,
13,
1678,
8636,
353,
7272,
2009,
29889,
3126,
580,
13,
13,
1678,
19571,
353,
8636,
29889,
657,
703,
978,
1159,
13,
1678,
3142,
353,
8636,
29889,
657,
703,
2271,
1159,
13,
1678,
19571,
29918,
27691,
353,
8636,
29889,
657,
703,
27691,
1159,
13,
1678,
7117,
353,
8636,
29889,
657,
703,
14036,
613,
518,
2314,
13,
1678,
6611,
353,
8636,
29889,
657,
703,
8149,
613,
518,
2314,
13,
1678,
1820,
2974,
353,
8636,
29889,
657,
703,
1989,
2974,
1159,
13,
1678,
338,
29918,
6500,
331,
381,
729,
353,
8636,
29889,
657,
703,
275,
29918,
6500,
331,
381,
729,
1159,
13,
1678,
6956,
1973,
353,
8636,
29889,
657,
703,
1279,
4496,
1973,
613,
518,
2314,
13,
1678,
1873,
353,
8636,
29889,
657,
703,
3259,
1159,
13,
1678,
1820,
29918,
2271,
353,
8636,
29889,
657,
703,
2817,
4395,
29918,
1989,
29918,
2271,
1159,
13,
1678,
2362,
331,
381,
729,
29918,
333,
353,
8636,
29889,
657,
703,
6500,
331,
381,
729,
29918,
333,
1159,
13,
1678,
5142,
29918,
29879,
2863,
353,
8636,
29889,
657,
703,
10382,
29918,
29879,
2863,
1159,
13,
1678,
5142,
29918,
6252,
261,
353,
8636,
29889,
657,
703,
10382,
29918,
6252,
261,
1159,
13,
13,
1678,
565,
451,
7117,
29901,
13,
4706,
7117,
353,
6796,
3396,
3108,
13,
13,
1678,
565,
451,
338,
8758,
29898,
275,
29918,
6500,
331,
381,
729,
29892,
6120,
1125,
13,
4706,
736,
1856,
29889,
5103,
29898,
4882,
29922,
29946,
29900,
29900,
29892,
1426,
543,
275,
29918,
6500,
331,
381,
729,
451,
263,
6120,
1159,
13,
13,
1678,
6389,
353,
426,
13,
4706,
376,
3258,
29918,
11038,
729,
1115,
518,
13,
9651,
19571,
29892,
13,
9651,
3142,
29892,
13,
9651,
19571,
29918,
27691,
29892,
13,
9651,
7117,
29892,
13,
9651,
6611,
29892,
13,
9651,
1820,
2974,
29892,
13,
9651,
338,
29918,
6500,
331,
381,
729,
29892,
13,
9651,
6956,
1973,
29892,
13,
9651,
1873,
29892,
13,
9651,
1820,
29918,
2271,
29892,
13,
9651,
2362,
331,
381,
729,
29918,
333,
29892,
13,
9651,
5142,
29918,
29879,
2863,
29892,
13,
9651,
5142,
29918,
6252,
261,
29892,
13,
4706,
4514,
13,
1678,
500,
13,
1678,
7272,
2009,
29889,
19052,
29878,
1099,
29889,
2156,
368,
29918,
9990,
29889,
649,
29898,
5085,
29897,
13,
13,
1678,
736,
1856,
29889,
5103,
29898,
13,
4706,
4660,
29922,
29906,
29900,
29900,
29892,
1426,
543,
29924,
381,
729,
6571,
8472,
2825,
1213,
29889,
4830,
29898,
11038,
729,
29897,
13,
1678,
1723,
13,
13,
13,
29992,
932,
29889,
1124,
29918,
657,
11974,
2754,
29914,
11038,
729,
1159,
13,
29992,
932,
29889,
27218,
630,
13,
12674,
822,
679,
29918,
11038,
729,
29879,
29898,
3827,
1125,
13,
1678,
9995,
13,
1678,
16969,
599,
19571,
29879,
515,
2566,
29889,
13,
13,
1678,
11474,
13,
1678,
6139,
29901,
16969,
19571,
29879,
515,
2566,
29889,
13,
1678,
8282,
29901,
13,
4706,
448,
11612,
729,
29879,
13,
1678,
1136,
9351,
29901,
13,
4706,
448,
2280,
29914,
29916,
29899,
1636,
29899,
689,
29899,
2271,
26716,
13,
1678,
4128,
29901,
13,
4706,
448,
1024,
29901,
1813,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
6043,
13,
3986,
2322,
29901,
29871,
29896,
13,
3986,
6139,
29901,
1813,
1353,
13,
4706,
448,
1024,
29901,
1813,
29918,
2311,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
6043,
13,
3986,
2322,
29901,
29871,
29896,
29900,
13,
3986,
6139,
29901,
4236,
29889,
19571,
29879,
639,
1813,
13,
4706,
448,
1024,
29901,
3855,
13,
3986,
297,
29901,
2346,
13,
3986,
3734,
29901,
2089,
13,
3986,
1134,
29901,
1347,
13,
3986,
6139,
29901,
4175,
16614,
13,
1678,
13880,
29901,
13,
4706,
448,
1426,
29914,
3126,
13,
1678,
20890,
29901,
13,
4706,
376,
29906,
29900,
29900,
1115,
13,
9651,
6139,
29901,
9150,
13,
4706,
376,
29946,
29900,
29900,
1115,
13,
9651,
6139,
29901,
4319,
2009,
13,
1678,
9995,
13,
1678,
1813,
353,
2009,
29889,
7194,
29889,
657,
650,
703,
3488,
613,
6213,
29897,
13,
1678,
1813,
29918,
2311,
353,
2009,
29889,
7194,
29889,
657,
650,
703,
3488,
29918,
2311,
613,
6213,
29897,
13,
1678,
4175,
29918,
978,
353,
2009,
29889,
7194,
29889,
657,
650,
703,
29939,
613,
20569,
13,
13,
1678,
565,
1813,
29901,
13,
4706,
1018,
29901,
13,
9651,
1813,
353,
938,
29898,
3488,
29897,
13,
4706,
5174,
313,
1917,
2392,
29892,
20948,
1125,
13,
9651,
736,
1856,
29889,
5103,
29898,
726,
543,
797,
15728,
995,
363,
1813,
613,
4660,
29922,
29946,
29900,
29900,
29897,
13,
13,
1678,
565,
1813,
29918,
2311,
29901,
13,
4706,
1018,
29901,
13,
9651,
1813,
29918,
2311,
353,
938,
29898,
3488,
29918,
2311,
29897,
13,
4706,
5174,
313,
1917,
2392,
29892,
20948,
1125,
13,
9651,
736,
1856,
29889,
5103,
29898,
726,
543,
797,
15728,
995,
363,
1813,
29918,
2311,
613,
4660,
29922,
29946,
29900,
29900,
29897,
13,
4706,
1813,
29918,
2311,
353,
29871,
29896,
565,
1813,
29918,
2311,
529,
29871,
29896,
1683,
1813,
29918,
2311,
13,
13,
1678,
2346,
353,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
1972,
29898,
13,
4706,
8010,
6594,
13,
1678,
1723,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
1678,
2346,
353,
2346,
29889,
7122,
29898,
7653,
29892,
8010,
29889,
333,
1275,
8010,
6594,
29889,
4836,
29918,
333,
29897,
13,
1678,
2346,
353,
2346,
29889,
4572,
29898,
7653,
29889,
275,
29918,
11038,
729,
1275,
376,
3009,
2564,
2098,
29918,
1609,
29898,
7653,
29889,
978,
29897,
13,
13,
1678,
565,
4175,
29918,
978,
29901,
13,
4706,
2346,
353,
2346,
29889,
4572,
29898,
7653,
29889,
978,
29889,
4561,
11702,
8875,
29995,
1642,
4830,
29898,
4572,
29918,
978,
4961,
13,
13,
1678,
2346,
353,
2346,
29889,
2098,
29918,
1609,
29898,
7653,
29889,
978,
29892,
8010,
6594,
29889,
978,
29897,
13,
1678,
302,
29890,
29918,
9902,
353,
2346,
29889,
2798,
580,
13,
13,
1678,
565,
1813,
338,
451,
6213,
322,
1813,
29918,
2311,
29901,
13,
4706,
2346,
353,
2346,
29889,
10289,
29898,
3488,
334,
1813,
29918,
2311,
29897,
13,
4706,
2346,
353,
2346,
29889,
13400,
29898,
3488,
29918,
2311,
29897,
13,
13,
1678,
2582,
353,
2346,
29889,
497,
580,
13,
13,
1678,
848,
353,
8853,
7827,
29918,
2914,
29918,
2798,
1115,
302,
29890,
29918,
9902,
29892,
376,
9902,
1115,
5159,
29913,
13,
13,
1678,
363,
19571,
297,
2582,
29901,
13,
4706,
10882,
29918,
2271,
353,
19571,
29889,
657,
29918,
2156,
29918,
20095,
29898,
2271,
29918,
6194,
29922,
5574,
29897,
13,
4706,
2967,
29918,
11038,
729,
29918,
2271,
353,
851,
580,
13,
4706,
565,
451,
19571,
29889,
4836,
29889,
275,
29918,
6500,
331,
381,
729,
322,
19571,
29889,
4282,
5927,
1934,
29901,
13,
9651,
396,
383,
6415,
2303,
29901,
871,
697,
2048,
19365,
6969,
13,
9651,
2967,
29918,
11038,
729,
353,
19571,
29889,
4282,
5927,
1934,
29961,
29900,
1822,
3188,
29918,
11038,
729,
13,
9651,
2967,
29918,
11038,
729,
29918,
2271,
353,
2967,
29918,
11038,
729,
29889,
657,
29918,
2156,
29918,
20095,
29898,
2271,
29918,
6194,
29922,
5574,
29897,
13,
13,
4706,
848,
3366,
9902,
16862,
4397,
29898,
13,
9651,
426,
13,
18884,
376,
333,
1115,
19571,
29889,
333,
29892,
13,
18884,
376,
978,
1115,
19571,
29889,
4836,
29889,
978,
29892,
13,
18884,
376,
3259,
1115,
19571,
29889,
978,
29892,
13,
18884,
376,
2271,
1115,
19571,
29889,
11038,
729,
29918,
2271,
29892,
13,
18884,
376,
3188,
29918,
11038,
729,
1115,
2967,
29918,
11038,
729,
29918,
2271,
29892,
13,
18884,
376,
27691,
1115,
19571,
29889,
11038,
729,
29918,
27691,
29892,
13,
18884,
376,
14036,
1115,
19571,
29889,
11038,
729,
29918,
14036,
29892,
13,
18884,
376,
275,
29918,
6500,
331,
381,
729,
1115,
19571,
29889,
4836,
29889,
275,
29918,
6500,
331,
381,
729,
29892,
13,
18884,
376,
1279,
4496,
1973,
1115,
19571,
29889,
11038,
729,
29918,
1279,
4496,
1973,
29961,
29896,
13018,
29896,
1402,
13,
18884,
376,
275,
29918,
29113,
1115,
19571,
29889,
275,
29918,
29113,
29892,
13,
18884,
376,
2541,
29918,
29879,
2863,
1115,
19571,
29889,
11038,
729,
29918,
2541,
29918,
29879,
2863,
29892,
13,
18884,
376,
2541,
29918,
6252,
261,
1115,
19571,
29889,
11038,
729,
29918,
2541,
29918,
6252,
261,
29892,
13,
18884,
376,
4836,
29918,
333,
1115,
19571,
29889,
4836,
29889,
333,
29892,
13,
18884,
376,
3859,
1115,
19571,
29889,
11038,
729,
29918,
3859,
29892,
13,
18884,
376,
2156,
29918,
2271,
1115,
10882,
29918,
2271,
29892,
13,
9651,
500,
13,
4706,
1723,
13,
13,
1678,
736,
1856,
29889,
3126,
29918,
5327,
29898,
1272,
29897,
13,
13,
13,
29992,
932,
29889,
1124,
29918,
8143,
11974,
2754,
29914,
11038,
729,
19248,
333,
27195,
13,
29992,
932,
29889,
7971,
29918,
6406,
13,
29937,
383,
6415,
2303,
29901,
12428,
29918,
12154,
13,
12674,
822,
5217,
29918,
11038,
729,
29898,
3827,
1125,
13,
1678,
9995,
13,
1678,
21267,
263,
2323,
19571,
373,
10882,
368,
322,
515,
2566,
29889,
13,
13,
1678,
11474,
13,
1678,
6139,
29901,
21267,
263,
2323,
19571,
373,
10882,
368,
322,
515,
2566,
29889,
13,
1678,
8282,
29901,
13,
4706,
448,
11612,
729,
29879,
13,
1678,
1136,
9351,
29901,
13,
4706,
448,
2280,
29914,
29916,
29899,
1636,
29899,
689,
29899,
2271,
26716,
13,
1678,
4128,
29901,
13,
4706,
448,
1024,
29901,
1178,
13,
3986,
297,
29901,
2224,
13,
3986,
3734,
29901,
1565,
13,
3986,
1134,
29901,
6043,
13,
3986,
6139,
29901,
1178,
310,
278,
19571,
13,
1678,
13880,
29901,
13,
4706,
448,
1426,
29914,
3126,
13,
1678,
20890,
29901,
13,
4706,
376,
29906,
29900,
29900,
1115,
13,
9651,
6139,
29901,
9150,
13,
4706,
376,
29946,
29900,
29900,
1115,
13,
9651,
6139,
29901,
28744,
5229,
515,
10882,
368,
29889,
13,
4706,
376,
29946,
29900,
29946,
1115,
13,
9651,
6139,
29901,
19571,
451,
1476,
373,
10882,
368,
29889,
13,
4706,
376,
29945,
29900,
29900,
1115,
13,
9651,
6139,
29901,
7463,
1923,
1059,
29889,
13,
4706,
376,
29945,
29900,
29941,
1115,
13,
9651,
6139,
29901,
28744,
5229,
515,
2566,
29889,
13,
1678,
9995,
13,
1678,
10882,
353,
679,
29918,
2156,
368,
29918,
9965,
580,
13,
1678,
19571,
29918,
333,
353,
2009,
29889,
4352,
29918,
3888,
3366,
333,
3108,
13,
13,
1678,
2346,
353,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
1972,
29898,
7653,
6594,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
1678,
2346,
353,
2346,
29889,
7122,
29898,
7653,
29892,
8010,
29889,
333,
1275,
8010,
6594,
29889,
4836,
29918,
333,
29897,
13,
1678,
2346,
353,
2346,
29889,
4572,
29898,
7653,
29889,
275,
29918,
11038,
729,
29889,
275,
23538,
5574,
876,
13,
1678,
6251,
353,
2346,
29889,
4572,
29898,
7653,
6594,
29889,
333,
1275,
19571,
29918,
333,
467,
4102,
580,
13,
13,
1678,
565,
451,
6251,
29901,
13,
4706,
17927,
29889,
27392,
703,
2704,
21228,
19571,
14210,
29879,
2396,
19571,
451,
1476,
613,
19571,
29918,
333,
29897,
13,
4706,
736,
1059,
29898,
29946,
29900,
29946,
29892,
376,
2392,
21228,
19571,
14210,
29881,
2396,
19571,
451,
1476,
613,
19571,
29918,
333,
29897,
13,
13,
1678,
396,
383,
6415,
2303,
29901,
1423,
2106,
29892,
437,
451,
5217,
7960,
29914,
786,
26747,
29914,
856,
13,
13,
1678,
19571,
978,
353,
29850,
7402,
8875,
1642,
4830,
29898,
8269,
29889,
4836,
29889,
978,
29892,
6251,
29889,
978,
29897,
13,
13,
1678,
396,
1423,
5302,
13,
1678,
565,
6251,
29889,
29879,
473,
29883,
406,
1066,
20106,
29901,
13,
4706,
17927,
29889,
27392,
703,
2704,
21228,
19571,
14210,
29879,
2396,
16180,
491,
697,
470,
901,
2752,
28914,
613,
19571,
978,
29897,
13,
4706,
736,
1059,
29898,
29946,
29896,
29906,
29892,
376,
2392,
21228,
19571,
426,
6177,
1603,
16180,
491,
697,
470,
901,
2752,
28914,
613,
19571,
978,
29897,
13,
1678,
565,
6251,
29889,
4282,
13305,
29901,
13,
4706,
17927,
29889,
27392,
703,
2704,
21228,
19571,
14210,
29879,
2396,
16180,
491,
697,
470,
901,
2048,
22920,
613,
19571,
978,
29897,
13,
4706,
736,
1059,
29898,
29946,
29896,
29906,
29892,
376,
2392,
21228,
19571,
426,
6177,
1603,
16180,
491,
697,
470,
901,
2048,
22920,
613,
19571,
978,
29897,
13,
1678,
565,
6251,
29889,
2716,
355,
1237,
29901,
13,
4706,
17927,
29889,
27392,
703,
2704,
21228,
19571,
14210,
29879,
2396,
16180,
491,
697,
470,
2060,
6910,
613,
19571,
978,
29897,
13,
4706,
736,
1059,
29898,
29946,
29896,
29906,
29892,
376,
2392,
21228,
19571,
426,
6177,
1603,
16180,
491,
697,
470,
901,
2060,
6910,
613,
19571,
978,
29897,
13,
13,
1678,
2967,
29918,
11038,
729,
353,
5124,
13,
1678,
565,
451,
6251,
29889,
4836,
29889,
275,
29918,
6500,
331,
381,
729,
29901,
13,
4706,
2362,
331,
381,
729,
353,
6251,
29889,
4282,
5927,
1934,
29961,
29900,
1822,
3188,
29918,
11038,
729,
13,
4706,
2967,
29918,
11038,
729,
353,
2362,
331,
381,
729,
29889,
4836,
29889,
978,
718,
11663,
29908,
718,
2362,
331,
381,
729,
29889,
978,
13,
4706,
396,
383,
6415,
2303,
29901,
5941,
786,
521,
4632,
1591,
29892,
1364,
307,
1862,
29892,
316,
8704,
29892,
13,
13,
1678,
1018,
29901,
13,
4706,
396,
383,
6415,
2303,
29901,
671,
5272,
2272,
9521,
1738,
13,
4706,
7272,
10882,
29889,
11038,
729,
29918,
8143,
29898,
3188,
29918,
11038,
729,
29892,
6251,
29889,
4836,
29889,
978,
29892,
6251,
29889,
978,
29892,
6251,
29889,
11038,
729,
29918,
27691,
29897,
13,
1678,
5174,
8960,
408,
5566,
29901,
13,
4706,
396,
19571,
1258,
451,
1863,
13,
4706,
396,
383,
6415,
2303,
29901,
4386,
19571,
756,
15101,
845,
1862,
322,
2609,
367,
11132,
29973,
13,
4706,
1209,
13,
13,
1678,
2060,
353,
6251,
29889,
4836,
13,
13,
1678,
289,
4270,
353,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
1972,
29898,
8893,
10444,
424,
467,
4572,
29898,
13,
9651,
8878,
10444,
424,
29889,
3188,
29918,
11038,
729,
29918,
333,
1275,
6251,
29889,
333,
467,
497,
580,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
1678,
363,
289,
19365,
297,
289,
4270,
29901,
13,
4706,
396,
383,
6415,
2303,
29901,
5217,
2048,
2917,
332,
800,
13,
4706,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
8143,
29898,
29890,
19365,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
13,
1678,
23315,
353,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
1972,
29898,
8893,
29897,
869,
4572,
29898,
8893,
29889,
4836,
3259,
29918,
333,
1275,
6251,
29889,
333,
467,
497,
580,
13,
1678,
363,
2048,
297,
23315,
29901,
13,
4706,
396,
383,
6415,
2303,
29901,
5217,
2048,
2917,
332,
800,
13,
4706,
396,
383,
6415,
2303,
29901,
3349,
2048,
449,
4516,
13,
4706,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
8143,
29898,
4282,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
13,
1678,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
8143,
29898,
8269,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
1678,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
15060,
580,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
13,
1678,
565,
451,
2060,
29889,
4836,
26100,
29901,
13,
4706,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
8143,
29898,
4836,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
13,
1678,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
15060,
580,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
13,
1678,
736,
1856,
29889,
5103,
29898,
4882,
29922,
29906,
29900,
29900,
29892,
1426,
543,
14191,
3730,
11132,
19571,
29901,
6571,
1642,
4830,
29898,
11038,
729,
978,
876,
13,
13,
13,
29992,
932,
29889,
1124,
29918,
649,
11974,
2754,
29914,
11038,
729,
19248,
333,
27195,
13,
29992,
932,
29889,
7971,
29918,
6406,
13,
29937,
383,
6415,
2303,
29901,
12428,
29918,
12154,
13,
12674,
822,
1925,
29918,
5504,
29918,
11038,
729,
29898,
3827,
1125,
13,
1678,
9995,
13,
1678,
5020,
15190,
263,
19571,
29889,
13,
13,
1678,
11474,
13,
1678,
6139,
29901,
5020,
15190,
263,
19571,
29889,
13,
1678,
8282,
29901,
13,
4706,
448,
11612,
729,
29879,
13,
1678,
1136,
9351,
29901,
13,
4706,
448,
2280,
29914,
29916,
29899,
1636,
29899,
689,
29899,
2271,
26716,
13,
1678,
4128,
29901,
13,
4706,
448,
1024,
29901,
1024,
13,
3986,
297,
29901,
2224,
13,
3986,
3734,
29901,
1565,
13,
3986,
1134,
29901,
6043,
13,
3986,
6139,
29901,
1024,
310,
278,
19571,
13,
1678,
13880,
29901,
13,
4706,
448,
1426,
29914,
3126,
13,
1678,
20890,
29901,
13,
4706,
376,
29906,
29900,
29900,
1115,
13,
9651,
6139,
29901,
11612,
729,
2767,
8472,
4687,
29889,
13,
4706,
376,
29946,
29900,
29900,
1115,
13,
9651,
6139,
29901,
11612,
729,
451,
297,
1059,
2106,
29889,
13,
4706,
376,
29945,
29900,
29900,
1115,
13,
9651,
6139,
29901,
512,
1890,
1923,
1059,
29889,
13,
1678,
9995,
13,
1678,
19571,
29918,
333,
353,
2009,
29889,
4352,
29918,
3888,
3366,
333,
3108,
13,
1678,
2060,
29918,
29894,
353,
313,
13,
4706,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
1972,
29898,
7653,
6594,
29897,
13,
4706,
869,
4572,
29898,
7653,
6594,
29889,
333,
1275,
19571,
29918,
333,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
4706,
869,
4102,
580,
13,
1678,
1723,
13,
13,
1678,
565,
2060,
29918,
29894,
29889,
275,
29918,
29113,
29901,
13,
4706,
736,
1059,
29898,
29946,
29900,
29900,
29892,
376,
29924,
381,
729,
22822,
29889,
10318,
451,
6068,
23157,
13,
13,
1678,
565,
2060,
29918,
29894,
29889,
11038,
729,
29918,
3859,
2804,
376,
2704,
1115,
13,
4706,
736,
1059,
29898,
29946,
29900,
29900,
29892,
376,
29924,
381,
729,
451,
297,
1059,
2106,
23157,
13,
13,
1678,
7117,
353,
2060,
29918,
29894,
29889,
11038,
729,
29918,
14036,
29889,
5451,
28165,
1159,
13,
13,
1678,
396,
383,
6415,
2303,
29901,
871,
697,
2048,
17305,
6969,
13,
1678,
2967,
29918,
11038,
729,
353,
6213,
13,
1678,
2967,
29918,
11038,
729,
29918,
3259,
353,
6213,
13,
1678,
565,
451,
2060,
29918,
29894,
29889,
4836,
29889,
275,
29918,
6500,
331,
381,
729,
29901,
13,
4706,
2967,
29918,
11038,
729,
353,
2060,
29918,
29894,
29889,
4282,
5927,
1934,
29961,
29900,
1822,
3188,
29918,
11038,
729,
29889,
4836,
29889,
978,
13,
4706,
2967,
29918,
11038,
729,
29918,
3259,
353,
2060,
29918,
29894,
29889,
4282,
5927,
1934,
29961,
29900,
1822,
3188,
29918,
11038,
729,
29889,
978,
13,
13,
1678,
2048,
353,
313,
13,
4706,
2009,
29889,
19052,
29878,
1099,
29889,
2585,
29918,
7924,
29889,
1972,
29898,
8893,
29897,
13,
4706,
869,
4572,
29898,
8893,
29889,
4282,
1853,
1275,
376,
11038,
729,
613,
8878,
29889,
4836,
3259,
29918,
333,
1275,
2060,
29918,
29894,
29889,
333,
29897,
13,
4706,
869,
4102,
580,
13,
1678,
1723,
13,
13,
1678,
565,
451,
2048,
29901,
13,
4706,
17927,
29889,
2704,
703,
5504,
19571,
29901,
694,
2048,
1476,
363,
19571,
1273,
29881,
613,
19571,
29918,
333,
29897,
13,
4706,
736,
1059,
29898,
29946,
29900,
29900,
29892,
376,
1217,
2048,
1476,
363,
19571,
1159,
13,
13,
1678,
6389,
353,
426,
13,
4706,
376,
5504,
29918,
11038,
729,
1115,
518,
13,
9651,
2048,
29889,
333,
29892,
13,
9651,
2060,
29918,
29894,
29889,
333,
29892,
13,
9651,
2967,
29918,
11038,
729,
29892,
13,
9651,
2967,
29918,
11038,
729,
29918,
3259,
29892,
13,
9651,
2060,
29918,
29894,
29889,
4836,
29889,
978,
29892,
13,
9651,
2060,
29918,
29894,
29889,
978,
29892,
13,
9651,
7117,
29892,
13,
4706,
4514,
13,
1678,
500,
13,
1678,
7272,
2009,
29889,
19052,
29878,
1099,
29889,
2156,
368,
29918,
9990,
29889,
649,
29898,
5085,
29897,
13,
13,
1678,
736,
1856,
29889,
5103,
29898,
4882,
29922,
29906,
29900,
29900,
29892,
1426,
543,
14191,
3730,
4687,
2767,
373,
19571,
1159,
13,
2
] |
QA system/main.py | yiwen26/NLP_banking_chatbot | 2 | 199785 | import os
import argparse
from gensim.models.keyedvectors import KeyedVectors
from preprocess import *
from model import *
import torch
if __name__ == '__main__':
# parse command line argument
parser = argparse.ArgumentParser()
parser.add_argument('--mode', default='training', type=str,
help='training, evaluation and simulation mode are supported')
parser.add_argument('--testset', default='test1', type=str, help='Define testset type: [dev/test1/test2] ')
parser.add_argument('--nn_type', default='attention', type=str,
help='3 type to reduce rnn output: max_pooling, mean_pooling, attention')
parser.add_argument('--data_path', default='./data', type=str, metavar='PATH',
help='insurance input data directory')
parser.add_argument('--checkpoint_path', default='./checkpoints', type=str, metavar='PATH',
help='model saving directory')
parser.add_argument('--embd_type', default='google', type=str,
help='word embedding mode selection [none/google], default set to google embedding')
parser.add_argument("--embed_path", default="./embedding/GoogleNews-vectors-negative300.bin", type=str,
metavar='PATH',
help="pre-trained word embedding path (Google news word embedding)")
parser.add_argument("--model_path", default="./model/demo.model", type=str,
metavar='PATH', help="pre-trained QA model for evaluation and simulation")
parser.add_argument('--data_version', default='V1', type=str, help='insurance QA dataset version')
parser.add_argument('--batch_size', type=int, default=128, help='input batch size')
parser.add_argument('--n_epochs', type=int, default=5, help='epoch num')
parser.add_argument('--embd_size', type=int, default=300, help='word embedding size')
parser.add_argument('--hidden_size', type=int, default=128, help='hidden size of one-directional LSTM')
parser.add_argument('--max_sent_len', type=int, default=200, help='max sentence length')
parser.add_argument('--margin', type=float, default=0.2, help='margin for loss function')
parser.add_argument('--neg_pos_rate', type=int, default=2,
help='training negative samples and positive samples rate')
args = parser.parse_args()
mode = args.mode
model_type = args.nn_type
model_path = args.model_path
testset_type = args.testset
data_path = os.path.join(args.data_path, args.data_version)
checkpoint_path = os.path.join(args.checkpoint_path, model_type)
if not os.path.exists(checkpoint_path):
os.mkdir(checkpoint_path)
version = args.data_version
embedding_type = args.embd_type
embedding_size = args.embd_size
hidden_size = args.hidden_size
max_sentence_len = args.max_sent_len
batch_size = args.batch_size
margin = args.margin
epoch_num = args.n_epochs
neg_pos_rate = args.neg_pos_rate
print("============================ Parameters ==================================")
print("-- Model bi-lstm +", model_type)
print("-- Dataset Version = ", version)
print("-- Hidden Size = ", hidden_size)
print("-- Embedding type = ", embedding_type)
print("-- Embedding size = ", embedding_size)
print("-- Epoch Num = ", epoch_num)
print("-- Batch Size = ", batch_size)
print("-- Margin = ", margin)
print("-- Negative / Positive = ", neg_pos_rate)
print("-- Checkpoint path: ", checkpoint_path)
print("============================ Parameters ==================================")
vocabulary_path = os.path.join(data_path, "vocabulary")
if version == "V1":
answer_path = os.path.join(data_path, "answers.label.token_idx")
qa_training_data_path = os.path.join(data_path, "question.train.token_idx.label")
qa_test_data_path = os.path.join(data_path, "question.{}.label.token_idx.pool".format(testset_type))
elif version == "V2":
answer_path = os.path.join(data_path, "InsuranceQA.label2answer.token.encoded")
qa_training_data_path = os.path.join(data_path,
"InsuranceQA.question.anslabel.token.100.pool.solr.train.encoded")
qa_test_data_path = os.path.join(data_path,
"InsuranceQA.question.anslabel.token.100.pool.solr.test.encoded")
else:
print("[Error]: invalid dataset version setting, please use -h to check legal parameter setting")
exit(1)
id_2_word = load_vocabulary(vocabulary_path)
word_to_id = {w: i for i, w in enumerate(id_2_word.values(), 1)}
word_to_id['<PAD>'] = 0
vocabulary_size = len(word_to_id)
id_2_answers, id_2_answer_text = load_id_2_answer_data(answer_path, id_2_word)
print("answer size: ", len(id_2_answer_text))
print("raw vocabulary size: ", len(word_to_id))
if version == "V1":
training_data = load_v1_training_answer_data(qa_training_data_path, id_2_word, id_2_answer_text)
test_data = load_v1_test_answer_data(qa_test_data_path, id_2_word)
validation_data = test_data[:100]
if version == "V2":
training_data = load_training_answer_data(qa_training_data_path, id_2_word, id_2_answer_text)
test_data = load_test_answer_data(qa_test_data_path, id_2_word)
validation_data = test_data[:100]
print("============================ Checking data ==================================")
print("word to id sample: ")
head_data(word_to_id, 10)
print("data sample: ")
sample_id = random.randint(0, len(test_data))
print("-- question: ", " ".join(test_data[sample_id][0]))
print("-- pos: ", " ".join(id_2_answer_text[test_data[sample_id][1][0]]))
print("-- neg: ", " ".join(id_2_answer_text[test_data[sample_id][2][0]]))
print("============================ Checking data done =============================")
word_embedding = None
if embedding_type == "google" and mode == "training":
print('[Word Embedding]: load google news word embedding')
word2vec = KeyedVectors.load_word2vec_format(args.embed_path, binary=True)
word_embedding = load_word_embedding(word2vec, vocabulary_size, args.embd_size, word_to_id)
model = QA_LSTM(vocabulary_size, args.embd_size, args.hidden_size, word_embedding, model_type)
if torch.cuda.is_available():
model.cuda()
optimizer = torch.optim.Adam(filter(lambda p: p.requires_grad, model.parameters()))
if mode == "training":
train_batch(model, training_data, validation_data, optimizer, word_to_id, id_2_answer_text, max_sentence_len,
epoch_num, batch_size, margin, neg_pos_rate, checkpoint_path)
if mode == "evaluation":
print("Load pre-trained model at ", model_path)
checkpoint = torch.load(model_path)
model.load_state_dict(checkpoint['state_dict'])
test(model, test_data, id_2_answer_text, max_sentence_len, word_to_id)
if mode == "simulation":
print("============================ Simulation ========================")
print("Load pre-trained model at ", model_path)
checkpoint = torch.load(model_path)
model.load_state_dict(checkpoint['state_dict'])
# candidate question
questions = generate_candidate_questions(training_data)
print("candidate questions: ", questions)
simulation(model, list(id_2_answer_text.values()), word_to_id, max_sentence_len)
| [
1,
1053,
2897,
30004,
13,
5215,
1852,
5510,
30004,
13,
3166,
26943,
326,
29889,
9794,
29889,
1989,
287,
345,
14359,
1053,
7670,
287,
29963,
11142,
30004,
13,
30004,
13,
3166,
758,
5014,
1053,
334,
30004,
13,
3166,
1904,
1053,
334,
30004,
13,
30004,
13,
5215,
4842,
305,
30004,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
30004,
13,
1678,
396,
6088,
1899,
1196,
2980,
30004,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
26471,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
8513,
742,
2322,
2433,
26495,
742,
1134,
29922,
710,
11167,
13,
462,
4706,
1371,
2433,
26495,
29892,
17983,
322,
17402,
4464,
526,
6969,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1688,
842,
742,
2322,
2433,
1688,
29896,
742,
1134,
29922,
710,
29892,
1371,
2433,
3206,
457,
1243,
842,
1134,
29901,
518,
3359,
29914,
1688,
29896,
29914,
1688,
29906,
29962,
525,
8443,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
15755,
29918,
1853,
742,
2322,
2433,
1131,
2509,
742,
1134,
29922,
710,
11167,
13,
462,
4706,
1371,
2433,
29941,
1134,
304,
10032,
364,
15755,
1962,
29901,
4236,
29918,
10109,
292,
29892,
2099,
29918,
10109,
292,
29892,
8570,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1272,
29918,
2084,
742,
2322,
2433,
6904,
1272,
742,
1134,
29922,
710,
29892,
1539,
485,
279,
2433,
10145,
23592,
13,
462,
4706,
1371,
2433,
1144,
18541,
1881,
848,
3884,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
3198,
3149,
29918,
2084,
742,
2322,
2433,
6904,
3198,
9748,
742,
1134,
29922,
710,
29892,
1539,
485,
279,
2433,
10145,
23592,
13,
462,
4706,
1371,
2433,
4299,
14238,
3884,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1590,
29881,
29918,
1853,
742,
2322,
2433,
3608,
742,
1134,
29922,
710,
11167,
13,
462,
4706,
1371,
2433,
1742,
23655,
4464,
9262,
518,
9290,
29914,
3608,
1402,
2322,
731,
304,
5386,
23655,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
17987,
29918,
2084,
613,
2322,
543,
6904,
17987,
8497,
29914,
14207,
29328,
29899,
345,
14359,
29899,
22198,
29941,
29900,
29900,
29889,
2109,
613,
1134,
29922,
710,
11167,
13,
462,
4706,
1539,
485,
279,
2433,
10145,
23592,
13,
462,
4706,
1371,
543,
1457,
29899,
3018,
1312,
1734,
23655,
2224,
313,
14207,
9763,
1734,
23655,
25760,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
4299,
29918,
2084,
613,
2322,
543,
6904,
4299,
29914,
17482,
29889,
4299,
613,
1134,
29922,
710,
11167,
13,
462,
4706,
1539,
485,
279,
2433,
10145,
742,
1371,
543,
1457,
29899,
3018,
1312,
660,
29909,
1904,
363,
17983,
322,
17402,
1159,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1272,
29918,
3259,
742,
2322,
2433,
29963,
29896,
742,
1134,
29922,
710,
29892,
1371,
2433,
1144,
18541,
660,
29909,
8783,
1873,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
16175,
29918,
2311,
742,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29906,
29947,
29892,
1371,
2433,
2080,
9853,
2159,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
29876,
29918,
1022,
2878,
29879,
742,
1134,
29922,
524,
29892,
2322,
29922,
29945,
29892,
1371,
2433,
1022,
2878,
954,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1590,
29881,
29918,
2311,
742,
1134,
29922,
524,
29892,
2322,
29922,
29941,
29900,
29900,
29892,
1371,
2433,
1742,
23655,
2159,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
10892,
29918,
2311,
742,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29906,
29947,
29892,
1371,
2433,
10892,
2159,
310,
697,
29899,
20845,
284,
365,
1254,
29924,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
3317,
29918,
18616,
29918,
2435,
742,
1134,
29922,
524,
29892,
2322,
29922,
29906,
29900,
29900,
29892,
1371,
2433,
3317,
10541,
3309,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
9264,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29906,
29892,
1371,
2433,
9264,
363,
6410,
740,
1495,
30004,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
10052,
29918,
1066,
29918,
10492,
742,
1134,
29922,
524,
29892,
2322,
29922,
29906,
11167,
13,
462,
4706,
1371,
2433,
26495,
8178,
11916,
322,
6374,
11916,
6554,
1495,
30004,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
26471,
13,
30004,
13,
1678,
4464,
353,
6389,
29889,
8513,
30004,
13,
1678,
1904,
29918,
1853,
353,
6389,
29889,
15755,
29918,
1853,
30004,
13,
1678,
1904,
29918,
2084,
353,
6389,
29889,
4299,
29918,
2084,
30004,
13,
1678,
1243,
842,
29918,
1853,
353,
6389,
29889,
1688,
842,
30004,
13,
1678,
848,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
1272,
29918,
2084,
29892,
6389,
29889,
1272,
29918,
3259,
8443,
13,
1678,
1423,
3149,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
3198,
3149,
29918,
2084,
29892,
1904,
29918,
1853,
8443,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
3198,
3149,
29918,
2084,
1125,
30004,
13,
4706,
2897,
29889,
11256,
3972,
29898,
3198,
3149,
29918,
2084,
8443,
13,
1678,
1873,
353,
6389,
29889,
1272,
29918,
3259,
30004,
13,
1678,
23655,
29918,
1853,
353,
6389,
29889,
1590,
29881,
29918,
1853,
30004,
13,
1678,
23655,
29918,
2311,
353,
6389,
29889,
1590,
29881,
29918,
2311,
30004,
13,
1678,
7934,
29918,
2311,
353,
6389,
29889,
10892,
29918,
2311,
30004,
13,
1678,
4236,
29918,
18616,
663,
29918,
2435,
353,
6389,
29889,
3317,
29918,
18616,
29918,
2435,
30004,
13,
1678,
9853,
29918,
2311,
353,
6389,
29889,
16175,
29918,
2311,
30004,
13,
1678,
5906,
353,
6389,
29889,
9264,
30004,
13,
1678,
21502,
305,
29918,
1949,
353,
6389,
29889,
29876,
29918,
1022,
2878,
29879,
30004,
13,
1678,
3480,
29918,
1066,
29918,
10492,
353,
6389,
29889,
10052,
29918,
1066,
29918,
10492,
30004,
13,
30004,
13,
1678,
1596,
703,
9166,
4936,
2751,
12662,
2699,
1275,
9166,
4936,
2751,
25512,
543,
8443,
13,
1678,
1596,
703,
489,
8125,
4768,
29899,
20155,
29885,
718,
613,
1904,
29918,
1853,
8443,
13,
1678,
1596,
703,
489,
13373,
24541,
10079,
353,
9162,
1873,
8443,
13,
1678,
1596,
703,
489,
379,
4215,
21179,
353,
9162,
7934,
29918,
2311,
8443,
13,
1678,
1596,
703,
489,
2812,
2580,
8497,
1134,
353,
9162,
23655,
29918,
1853,
8443,
13,
1678,
1596,
703,
489,
2812,
2580,
8497,
2159,
353,
9162,
23655,
29918,
2311,
8443,
13,
1678,
1596,
703,
489,
382,
1129,
305,
11848,
353,
9162,
21502,
305,
29918,
1949,
8443,
13,
1678,
1596,
703,
489,
350,
905,
21179,
353,
29871,
9162,
9853,
29918,
2311,
8443,
13,
1678,
1596,
703,
489,
1085,
5359,
353,
9162,
5906,
8443,
13,
1678,
1596,
703,
489,
12610,
1230,
847,
10321,
3321,
353,
9162,
3480,
29918,
1066,
29918,
10492,
8443,
13,
1678,
1596,
703,
489,
5399,
3149,
2224,
29901,
9162,
1423,
3149,
29918,
2084,
8443,
13,
1678,
1596,
703,
9166,
4936,
2751,
12662,
2699,
1275,
9166,
4936,
2751,
25512,
543,
8443,
13,
30004,
13,
1678,
7931,
370,
352,
653,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
29892,
376,
29894,
542,
370,
352,
653,
1159,
30004,
13,
1678,
565,
1873,
1275,
376,
29963,
29896,
1115,
30004,
13,
4706,
1234,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
29892,
376,
550,
17538,
29889,
1643,
29889,
6979,
29918,
13140,
1159,
30004,
13,
4706,
3855,
29874,
29918,
26495,
29918,
1272,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
29892,
376,
12470,
29889,
14968,
29889,
6979,
29918,
13140,
29889,
1643,
1159,
30004,
13,
4706,
3855,
29874,
29918,
1688,
29918,
1272,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
29892,
376,
12470,
29889,
29912,
1836,
1643,
29889,
6979,
29918,
13140,
29889,
10109,
1642,
4830,
29898,
1688,
842,
29918,
1853,
876,
30004,
13,
1678,
25342,
1873,
1275,
376,
29963,
29906,
1115,
30004,
13,
4706,
1234,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
29892,
376,
797,
7610,
749,
29984,
29909,
29889,
1643,
29906,
12011,
29889,
6979,
29889,
26716,
1159,
30004,
13,
4706,
3855,
29874,
29918,
26495,
29918,
1272,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
11167,
13,
462,
462,
632,
376,
797,
7610,
749,
29984,
29909,
29889,
12470,
29889,
550,
1643,
29889,
6979,
29889,
29896,
29900,
29900,
29889,
10109,
29889,
2929,
29878,
29889,
14968,
29889,
26716,
1159,
30004,
13,
4706,
3855,
29874,
29918,
1688,
29918,
1272,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1272,
29918,
2084,
11167,
13,
462,
462,
308,
376,
797,
7610,
749,
29984,
29909,
29889,
12470,
29889,
550,
1643,
29889,
6979,
29889,
29896,
29900,
29900,
29889,
10109,
29889,
2929,
29878,
29889,
1688,
29889,
26716,
1159,
30004,
13,
1678,
1683,
29901,
30004,
13,
4706,
1596,
703,
29961,
2392,
5387,
8340,
8783,
1873,
4444,
29892,
3113,
671,
448,
29882,
304,
1423,
11706,
3443,
4444,
1159,
30004,
13,
4706,
6876,
29898,
29896,
8443,
13,
30004,
13,
1678,
1178,
29918,
29906,
29918,
1742,
353,
2254,
29918,
29894,
542,
370,
352,
653,
29898,
29894,
542,
370,
352,
653,
29918,
2084,
8443,
13,
1678,
1734,
29918,
517,
29918,
333,
353,
426,
29893,
29901,
474,
363,
474,
29892,
281,
297,
26985,
29898,
333,
29918,
29906,
29918,
1742,
29889,
5975,
3285,
29871,
29896,
2915,
30004,
13,
1678,
1734,
29918,
517,
29918,
333,
1839,
29966,
29925,
3035,
29958,
2033,
353,
29871,
29900,
30004,
13,
1678,
7931,
370,
352,
653,
29918,
2311,
353,
7431,
29898,
1742,
29918,
517,
29918,
333,
8443,
13,
30004,
13,
1678,
1178,
29918,
29906,
29918,
550,
17538,
29892,
1178,
29918,
29906,
29918,
12011,
29918,
726,
353,
2254,
29918,
333,
29918,
29906,
29918,
12011,
29918,
1272,
29898,
12011,
29918,
2084,
29892,
1178,
29918,
29906,
29918,
1742,
8443,
13,
1678,
1596,
703,
12011,
2159,
29901,
9162,
7431,
29898,
333,
29918,
29906,
29918,
12011,
29918,
726,
876,
30004,
13,
30004,
13,
1678,
1596,
703,
1610,
7931,
370,
352,
653,
2159,
29901,
9162,
7431,
29898,
1742,
29918,
517,
29918,
333,
876,
30004,
13,
1678,
565,
1873,
1275,
376,
29963,
29896,
1115,
30004,
13,
4706,
6694,
29918,
1272,
353,
2254,
29918,
29894,
29896,
29918,
26495,
29918,
12011,
29918,
1272,
29898,
25621,
29918,
26495,
29918,
1272,
29918,
2084,
29892,
1178,
29918,
29906,
29918,
1742,
29892,
1178,
29918,
29906,
29918,
12011,
29918,
726,
8443,
13,
4706,
1243,
29918,
1272,
353,
2254,
29918,
29894,
29896,
29918,
1688,
29918,
12011,
29918,
1272,
29898,
25621,
29918,
1688,
29918,
1272,
29918,
2084,
29892,
1178,
29918,
29906,
29918,
1742,
8443,
13,
4706,
8845,
29918,
1272,
353,
1243,
29918,
1272,
7503,
29896,
29900,
29900,
29962,
30004,
13,
30004,
13,
1678,
565,
1873,
1275,
376,
29963,
29906,
1115,
30004,
13,
4706,
6694,
29918,
1272,
353,
2254,
29918,
26495,
29918,
12011,
29918,
1272,
29898,
25621,
29918,
26495,
29918,
1272,
29918,
2084,
29892,
1178,
29918,
29906,
29918,
1742,
29892,
1178,
29918,
29906,
29918,
12011,
29918,
726,
8443,
13,
4706,
1243,
29918,
1272,
353,
2254,
29918,
1688,
29918,
12011,
29918,
1272,
29898,
25621,
29918,
1688,
29918,
1272,
29918,
2084,
29892,
1178,
29918,
29906,
29918,
1742,
8443,
13,
4706,
8845,
29918,
1272,
353,
1243,
29918,
1272,
7503,
29896,
29900,
29900,
29962,
30004,
13,
30004,
13,
1678,
1596,
703,
9166,
4936,
2751,
5399,
292,
848,
1275,
9166,
4936,
2751,
25512,
543,
8443,
13,
1678,
1596,
703,
1742,
304,
1178,
4559,
29901,
376,
8443,
13,
1678,
2343,
29918,
1272,
29898,
1742,
29918,
517,
29918,
333,
29892,
29871,
29896,
29900,
8443,
13,
1678,
1596,
703,
1272,
4559,
29901,
376,
8443,
13,
1678,
4559,
29918,
333,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
7431,
29898,
1688,
29918,
1272,
876,
30004,
13,
1678,
1596,
703,
489,
1139,
29901,
9162,
376,
11393,
7122,
29898,
1688,
29918,
1272,
29961,
11249,
29918,
333,
3816,
29900,
12622,
30004,
13,
1678,
1596,
703,
489,
926,
29901,
9162,
376,
11393,
7122,
29898,
333,
29918,
29906,
29918,
12011,
29918,
726,
29961,
1688,
29918,
1272,
29961,
11249,
29918,
333,
3816,
29896,
3816,
29900,
5262,
876,
30004,
13,
1678,
1596,
703,
489,
3480,
29901,
9162,
376,
11393,
7122,
29898,
333,
29918,
29906,
29918,
12011,
29918,
726,
29961,
1688,
29918,
1272,
29961,
11249,
29918,
333,
3816,
29906,
3816,
29900,
5262,
876,
30004,
13,
1678,
1596,
703,
9166,
4936,
2751,
5399,
292,
848,
2309,
1275,
9166,
4936,
1360,
543,
8443,
13,
30004,
13,
1678,
1734,
29918,
17987,
8497,
353,
6213,
30004,
13,
1678,
565,
23655,
29918,
1853,
1275,
376,
3608,
29908,
322,
4464,
1275,
376,
26495,
1115,
30004,
13,
4706,
1596,
877,
29961,
14463,
2812,
2580,
8497,
5387,
2254,
5386,
9763,
1734,
23655,
1495,
30004,
13,
4706,
1734,
29906,
2003,
353,
7670,
287,
29963,
11142,
29889,
1359,
29918,
1742,
29906,
2003,
29918,
4830,
29898,
5085,
29889,
17987,
29918,
2084,
29892,
7581,
29922,
5574,
8443,
13,
4706,
1734,
29918,
17987,
8497,
353,
2254,
29918,
1742,
29918,
17987,
8497,
29898,
1742,
29906,
2003,
29892,
7931,
370,
352,
653,
29918,
2311,
29892,
6389,
29889,
1590,
29881,
29918,
2311,
29892,
1734,
29918,
517,
29918,
333,
8443,
13,
30004,
13,
1678,
1904,
353,
660,
29909,
29918,
29931,
1254,
29924,
29898,
29894,
542,
370,
352,
653,
29918,
2311,
29892,
6389,
29889,
1590,
29881,
29918,
2311,
29892,
6389,
29889,
10892,
29918,
2311,
29892,
1734,
29918,
17987,
8497,
29892,
1904,
29918,
1853,
8443,
13,
1678,
565,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
7295,
30004,
13,
4706,
1904,
29889,
29883,
6191,
26471,
13,
1678,
5994,
3950,
353,
4842,
305,
29889,
20640,
29889,
3253,
314,
29898,
4572,
29898,
2892,
282,
29901,
282,
29889,
276,
339,
2658,
29918,
5105,
29892,
1904,
29889,
16744,
22130,
30004,
13,
30004,
13,
1678,
565,
4464,
1275,
376,
26495,
1115,
30004,
13,
4706,
7945,
29918,
16175,
29898,
4299,
29892,
6694,
29918,
1272,
29892,
8845,
29918,
1272,
29892,
5994,
3950,
29892,
1734,
29918,
517,
29918,
333,
29892,
1178,
29918,
29906,
29918,
12011,
29918,
726,
29892,
4236,
29918,
18616,
663,
29918,
2435,
11167,
13,
462,
1678,
21502,
305,
29918,
1949,
29892,
9853,
29918,
2311,
29892,
5906,
29892,
3480,
29918,
1066,
29918,
10492,
29892,
1423,
3149,
29918,
2084,
8443,
13,
1678,
565,
4464,
1275,
376,
24219,
362,
1115,
30004,
13,
4706,
1596,
703,
5896,
758,
29899,
3018,
1312,
1904,
472,
9162,
1904,
29918,
2084,
8443,
13,
4706,
1423,
3149,
353,
4842,
305,
29889,
1359,
29898,
4299,
29918,
2084,
8443,
13,
4706,
1904,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3198,
3149,
1839,
3859,
29918,
8977,
2033,
8443,
13,
30004,
13,
4706,
1243,
29898,
4299,
29892,
1243,
29918,
1272,
29892,
1178,
29918,
29906,
29918,
12011,
29918,
726,
29892,
4236,
29918,
18616,
663,
29918,
2435,
29892,
1734,
29918,
517,
29918,
333,
8443,
13,
30004,
13,
1678,
565,
4464,
1275,
376,
3601,
2785,
1115,
30004,
13,
4706,
1596,
703,
9166,
4936,
2751,
3439,
2785,
1275,
9166,
2751,
26359,
8443,
13,
4706,
1596,
703,
5896,
758,
29899,
3018,
1312,
1904,
472,
9162,
1904,
29918,
2084,
8443,
13,
4706,
1423,
3149,
353,
4842,
305,
29889,
1359,
29898,
4299,
29918,
2084,
8443,
13,
4706,
1904,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3198,
3149,
1839,
3859,
29918,
8977,
2033,
8443,
13,
4706,
396,
14020,
1139,
30004,
13,
4706,
5155,
353,
5706,
29918,
29883,
5380,
403,
29918,
2619,
29898,
26495,
29918,
1272,
8443,
13,
4706,
1596,
703,
29883,
5380,
403,
5155,
29901,
9162,
5155,
8443,
13,
30004,
13,
4706,
17402,
29898,
4299,
29892,
1051,
29898,
333,
29918,
29906,
29918,
12011,
29918,
726,
29889,
5975,
25739,
1734,
29918,
517,
29918,
333,
29892,
4236,
29918,
18616,
663,
29918,
2435,
8443,
13,
2
] |
old-code/enzfam-molfunc3.py | rwst/wikidata-molbio | 2 | 84836 | import pronto, six, csv
from sys import *
reader = csv.DictReader(open('goid.tab', 'r'), delimiter='\t')
efs = {}
for item in reader:
go = item.get('goid')
iturl = item.get('p')
it = iturl[iturl.rfind('/')+1:]
git = efs.get(go)
if git is None:
efs[go] = it
else:
print('============= {}'.format(go))
reader = csv.DictReader(open('t.tab', 'r'), delimiter='\t')
mfs = {}
for item in reader:
ec = item.get('ecLabel')
iturl = item.get('p')
it = iturl[iturl.rfind('/')+1:]
git = mfs.get(it)
if git is None:
mfs[it] = ec
else:
print(it)
reader = csv.DictReader(open('efnames.tab', 'r'), delimiter='\t')
ns = {}
for item in reader:
ec = item.get('pLabel')
iturl = item.get('p')
it = iturl[iturl.rfind('/')+1:]
git = ns.get(it)
if git is None:
ns[it] = ec
else:
print(it)
reader = csv.DictReader(open('mf.tab', 'r'), delimiter='\t')
ms = {}
for item in reader:
lab = item.get('pLabel')
iturl = item.get('p')
it = iturl[iturl.rfind('/')+1:]
git = ms.get(it)
if git is None:
ms[it] = lab
else:
print(it)
reader = csv.DictReader(open('ec2go.tab', 'r'), delimiter='\t')
ecgo = {}
for item in reader:
ec = item.get('ec')
go = item.get('goid')
git = ecgo.get(ec)
if git is None:
ecgo[ec] = [go]
else:
git.append(go)
for tup in mfs.items():
red = False
ec = tup[1].replace('.-', '')
goecl = ecgo.get(ec)
while goecl is None:
red = True
ec = ec[:ec.rfind('.')]
goecl = ecgo.get(ec)
if None is efs.get(goecl[0]):
print(tup[0])
continue
if len(goecl) == 1:
pass #print('{}|P680|{}'.format(tup[0], efs.get(goecl[0]), goecl[0]))
else:
for e in goecl:
print('{}|P680|{} x {} {}'.format(tup[0], efs.get(e), ns.get(tup[0]), ms.get(efs.get(e))))
| [
1,
1053,
544,
10268,
29892,
4832,
29892,
11799,
13,
3166,
10876,
1053,
334,
13,
13,
16950,
353,
11799,
29889,
21533,
6982,
29898,
3150,
877,
1484,
333,
29889,
3891,
742,
525,
29878,
5477,
28552,
2433,
29905,
29873,
1495,
13,
1389,
29879,
353,
6571,
13,
1454,
2944,
297,
9591,
29901,
13,
1678,
748,
353,
2944,
29889,
657,
877,
1484,
333,
1495,
13,
1678,
372,
2271,
353,
2944,
29889,
657,
877,
29886,
1495,
13,
1678,
372,
353,
372,
2271,
29961,
277,
2271,
29889,
29878,
2886,
11219,
1495,
29974,
29896,
17531,
13,
1678,
6315,
353,
321,
5847,
29889,
657,
29898,
1484,
29897,
13,
1678,
565,
6315,
338,
6213,
29901,
13,
4706,
321,
5847,
29961,
1484,
29962,
353,
372,
13,
1678,
1683,
29901,
13,
4706,
1596,
877,
4936,
2751,
29922,
6571,
4286,
4830,
29898,
1484,
876,
13,
13,
16950,
353,
11799,
29889,
21533,
6982,
29898,
3150,
877,
29873,
29889,
3891,
742,
525,
29878,
5477,
28552,
2433,
29905,
29873,
1495,
13,
29885,
5847,
353,
6571,
13,
1454,
2944,
297,
9591,
29901,
13,
1678,
21226,
353,
2944,
29889,
657,
877,
687,
4775,
1495,
13,
1678,
372,
2271,
353,
2944,
29889,
657,
877,
29886,
1495,
13,
1678,
372,
353,
372,
2271,
29961,
277,
2271,
29889,
29878,
2886,
11219,
1495,
29974,
29896,
17531,
13,
1678,
6315,
353,
286,
5847,
29889,
657,
29898,
277,
29897,
13,
1678,
565,
6315,
338,
6213,
29901,
13,
4706,
286,
5847,
29961,
277,
29962,
353,
21226,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
277,
29897,
13,
13,
16950,
353,
11799,
29889,
21533,
6982,
29898,
3150,
877,
1389,
7039,
29889,
3891,
742,
525,
29878,
5477,
28552,
2433,
29905,
29873,
1495,
13,
1983,
353,
6571,
13,
1454,
2944,
297,
9591,
29901,
13,
1678,
21226,
353,
2944,
29889,
657,
877,
29886,
4775,
1495,
13,
1678,
372,
2271,
353,
2944,
29889,
657,
877,
29886,
1495,
13,
1678,
372,
353,
372,
2271,
29961,
277,
2271,
29889,
29878,
2886,
11219,
1495,
29974,
29896,
17531,
13,
1678,
6315,
353,
17534,
29889,
657,
29898,
277,
29897,
13,
1678,
565,
6315,
338,
6213,
29901,
13,
4706,
17534,
29961,
277,
29962,
353,
21226,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
277,
29897,
13,
13,
16950,
353,
11799,
29889,
21533,
6982,
29898,
3150,
877,
29885,
29888,
29889,
3891,
742,
525,
29878,
5477,
28552,
2433,
29905,
29873,
1495,
13,
1516,
353,
6571,
13,
1454,
2944,
297,
9591,
29901,
13,
1678,
9775,
353,
2944,
29889,
657,
877,
29886,
4775,
1495,
13,
1678,
372,
2271,
353,
2944,
29889,
657,
877,
29886,
1495,
13,
1678,
372,
353,
372,
2271,
29961,
277,
2271,
29889,
29878,
2886,
11219,
1495,
29974,
29896,
17531,
13,
1678,
6315,
353,
10887,
29889,
657,
29898,
277,
29897,
13,
1678,
565,
6315,
338,
6213,
29901,
13,
4706,
10887,
29961,
277,
29962,
353,
9775,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
277,
29897,
13,
13,
16950,
353,
11799,
29889,
21533,
6982,
29898,
3150,
877,
687,
29906,
1484,
29889,
3891,
742,
525,
29878,
5477,
28552,
2433,
29905,
29873,
1495,
13,
687,
1484,
353,
6571,
13,
1454,
2944,
297,
9591,
29901,
13,
1678,
21226,
353,
2944,
29889,
657,
877,
687,
1495,
13,
1678,
748,
353,
2944,
29889,
657,
877,
1484,
333,
1495,
13,
1678,
6315,
353,
21226,
1484,
29889,
657,
29898,
687,
29897,
13,
1678,
565,
6315,
338,
6213,
29901,
13,
4706,
21226,
1484,
29961,
687,
29962,
353,
518,
1484,
29962,
13,
1678,
1683,
29901,
13,
4706,
6315,
29889,
4397,
29898,
1484,
29897,
13,
13,
1454,
260,
786,
297,
286,
5847,
29889,
7076,
7295,
13,
1678,
2654,
353,
7700,
13,
1678,
21226,
353,
260,
786,
29961,
29896,
1822,
6506,
877,
9229,
742,
27255,
13,
1678,
748,
687,
29880,
353,
21226,
1484,
29889,
657,
29898,
687,
29897,
13,
1678,
1550,
748,
687,
29880,
338,
6213,
29901,
13,
4706,
2654,
353,
5852,
13,
4706,
21226,
353,
21226,
7503,
687,
29889,
29878,
2886,
12839,
1495,
29962,
13,
4706,
748,
687,
29880,
353,
21226,
1484,
29889,
657,
29898,
687,
29897,
13,
1678,
565,
6213,
338,
321,
5847,
29889,
657,
29898,
1484,
687,
29880,
29961,
29900,
29962,
1125,
13,
4706,
1596,
29898,
29873,
786,
29961,
29900,
2314,
13,
4706,
6773,
13,
1678,
565,
7431,
29898,
1484,
687,
29880,
29897,
1275,
29871,
29896,
29901,
13,
4706,
1209,
396,
2158,
877,
8875,
29989,
29925,
29953,
29947,
29900,
29989,
8875,
4286,
4830,
29898,
29873,
786,
29961,
29900,
1402,
321,
5847,
29889,
657,
29898,
1484,
687,
29880,
29961,
29900,
11724,
748,
687,
29880,
29961,
29900,
12622,
13,
1678,
1683,
29901,
13,
4706,
363,
321,
297,
748,
687,
29880,
29901,
13,
9651,
1596,
877,
8875,
29989,
29925,
29953,
29947,
29900,
29989,
8875,
921,
6571,
6571,
4286,
4830,
29898,
29873,
786,
29961,
29900,
1402,
321,
5847,
29889,
657,
29898,
29872,
511,
17534,
29889,
657,
29898,
29873,
786,
29961,
29900,
11724,
10887,
29889,
657,
29898,
1389,
29879,
29889,
657,
29898,
29872,
13697,
13,
2
] |
nekoyume/app.py | lux600/nekoyume | 0 | 80594 | <reponame>lux600/nekoyume
import os
from flask import Flask
from raven.contrib.flask import Sentry
from nekoyume.models import cache, db
from nekoyume.api import api
from nekoyume.game import babel, game
from nekoyume.tasks import celery
def make_celery(app):
celery.name = app.import_name
celery.conf.update(
result_backend=app.config['CELERY_RESULT_BACKEND'],
broker_url=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
TaskBase = celery.Task
class ContextTask(TaskBase):
abstract = True
def __call__(self, *args, **kwargs):
with app.app_context():
return TaskBase.__call__(self, *args, **kwargs)
celery.Task = ContextTask
return celery
def create_app():
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'DATABASE_URL', 'sqlite:///yume.db')
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
try:
with open('.secret_key', 'rb') as f:
app.secret_key = f.read()
except FileNotFoundError:
app.secret_key = os.urandom(64)
f = open('.secret_key', 'wb')
f.write(app.secret_key)
f.close()
app.register_blueprint(api)
app.register_blueprint(game)
db.app = app
db.init_app(app)
babel.app = app
babel.init_app(app)
app.config.update(
CELERY_BROKER_URL=os.environ.get(
'CELERY_BROKER_URL', 'sqla+sqlite:///yume_broker.db'),
CELERY_RESULT_BACKEND=os.environ.get(
'CELERY_RESULT_BACKEND', 'db+sqlite:///yume_reuslt.db'))
return app
app = create_app()
cel = make_celery(app)
cache_type = os.environ.get('CACHE_TYPE', 'filesystem')
if cache_type == 'redis':
cache_config = {
'CACHE_TYPE': cache_type,
'CACHE_REDIS_URL': os.environ.get(
'REDIS_URL', 'redis://localhost:6379'
),
}
else:
cache_config = {
'CACHE_TYPE': cache_type,
'CACHE_DIR': os.environ.get('CACHE_DIR', '.yumecache'),
}
cache.init_app(app, cache_config)
sentry = Sentry(app)
def run():
from gunicorn.app import wsgiapp
wsgiapp.run()
| [
1,
529,
276,
1112,
420,
29958,
29880,
1314,
29953,
29900,
29900,
29914,
484,
2901,
29891,
2017,
13,
5215,
2897,
13,
13,
3166,
29784,
1053,
2379,
1278,
13,
3166,
1153,
854,
29889,
21570,
29889,
1579,
1278,
1053,
317,
8269,
13,
13,
3166,
452,
2901,
29891,
2017,
29889,
9794,
1053,
7090,
29892,
4833,
13,
3166,
452,
2901,
29891,
2017,
29889,
2754,
1053,
7882,
13,
3166,
452,
2901,
29891,
2017,
29889,
11802,
1053,
289,
1107,
29892,
3748,
13,
3166,
452,
2901,
29891,
2017,
29889,
20673,
1053,
6432,
708,
13,
13,
13,
1753,
1207,
29918,
2242,
708,
29898,
932,
1125,
13,
1678,
6432,
708,
29889,
978,
353,
623,
29889,
5215,
29918,
978,
13,
1678,
6432,
708,
29889,
5527,
29889,
5504,
29898,
13,
4706,
1121,
29918,
27852,
29922,
932,
29889,
2917,
1839,
4741,
29931,
24422,
29918,
15989,
8647,
29918,
29933,
11375,
11794,
7464,
13,
4706,
2545,
3946,
29918,
2271,
29922,
932,
29889,
2917,
1839,
4741,
29931,
24422,
29918,
29933,
1672,
29968,
1001,
29918,
4219,
11287,
13,
1678,
6432,
708,
29889,
5527,
29889,
5504,
29898,
932,
29889,
2917,
29897,
13,
1678,
9330,
5160,
353,
6432,
708,
29889,
5398,
13,
13,
1678,
770,
15228,
5398,
29898,
5398,
5160,
1125,
13,
4706,
9846,
353,
5852,
13,
13,
4706,
822,
4770,
4804,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
9651,
411,
623,
29889,
932,
29918,
4703,
7295,
13,
18884,
736,
9330,
5160,
17255,
4804,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
6432,
708,
29889,
5398,
353,
15228,
5398,
13,
1678,
736,
6432,
708,
13,
13,
13,
1753,
1653,
29918,
932,
7295,
13,
1678,
623,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
1678,
623,
29889,
2917,
1839,
4176,
1964,
3210,
12665,
29979,
29918,
25832,
27982,
29918,
15551,
2033,
353,
2897,
29889,
21813,
29889,
657,
29898,
13,
4706,
525,
25832,
27982,
29918,
4219,
742,
525,
22793,
597,
29914,
29891,
2017,
29889,
2585,
1495,
13,
1678,
623,
29889,
2917,
1839,
4330,
3580,
29931,
1299,
2890,
29918,
20656,
29949,
29918,
1525,
29428,
2033,
353,
5852,
13,
1678,
623,
29889,
2917,
1839,
4176,
1964,
3210,
12665,
29979,
29918,
5659,
11375,
29918,
6720,
4571,
29943,
28541,
29903,
2033,
353,
7700,
13,
13,
1678,
1018,
29901,
13,
4706,
411,
1722,
12839,
19024,
29918,
1989,
742,
525,
6050,
1495,
408,
285,
29901,
13,
9651,
623,
29889,
19024,
29918,
1989,
353,
285,
29889,
949,
580,
13,
1678,
5174,
3497,
17413,
2392,
29901,
13,
4706,
623,
29889,
19024,
29918,
1989,
353,
2897,
29889,
332,
2685,
29898,
29953,
29946,
29897,
13,
4706,
285,
353,
1722,
12839,
19024,
29918,
1989,
742,
525,
29893,
29890,
1495,
13,
4706,
285,
29889,
3539,
29898,
932,
29889,
19024,
29918,
1989,
29897,
13,
4706,
285,
29889,
5358,
580,
13,
13,
1678,
623,
29889,
9573,
29918,
9539,
2158,
29898,
2754,
29897,
13,
1678,
623,
29889,
9573,
29918,
9539,
2158,
29898,
11802,
29897,
13,
13,
1678,
4833,
29889,
932,
353,
623,
13,
1678,
4833,
29889,
2344,
29918,
932,
29898,
932,
29897,
13,
13,
1678,
289,
1107,
29889,
932,
353,
623,
13,
1678,
289,
1107,
29889,
2344,
29918,
932,
29898,
932,
29897,
13,
13,
1678,
623,
29889,
2917,
29889,
5504,
29898,
13,
4706,
315,
6670,
24422,
29918,
29933,
1672,
29968,
1001,
29918,
4219,
29922,
359,
29889,
21813,
29889,
657,
29898,
13,
9651,
525,
4741,
29931,
24422,
29918,
29933,
1672,
29968,
1001,
29918,
4219,
742,
525,
3044,
433,
29974,
22793,
597,
29914,
29891,
2017,
29918,
6729,
3946,
29889,
2585,
5477,
13,
4706,
315,
6670,
24422,
29918,
15989,
8647,
29918,
29933,
11375,
11794,
29922,
359,
29889,
21813,
29889,
657,
29898,
13,
9651,
525,
4741,
29931,
24422,
29918,
15989,
8647,
29918,
29933,
11375,
11794,
742,
525,
2585,
29974,
22793,
597,
29914,
29891,
2017,
29918,
276,
375,
1896,
29889,
2585,
8785,
13,
1678,
736,
623,
13,
13,
13,
932,
353,
1653,
29918,
932,
580,
13,
2242,
353,
1207,
29918,
2242,
708,
29898,
932,
29897,
13,
13,
8173,
29918,
1853,
353,
2897,
29889,
21813,
29889,
657,
877,
29907,
2477,
9606,
29918,
11116,
742,
525,
5325,
973,
1495,
13,
361,
7090,
29918,
1853,
1275,
525,
1127,
275,
2396,
13,
1678,
7090,
29918,
2917,
353,
426,
13,
4706,
525,
29907,
2477,
9606,
29918,
11116,
2396,
7090,
29918,
1853,
29892,
13,
4706,
525,
29907,
2477,
9606,
29918,
19386,
3235,
29918,
4219,
2396,
2897,
29889,
21813,
29889,
657,
29898,
13,
9651,
525,
19386,
3235,
29918,
4219,
742,
525,
1127,
275,
597,
7640,
29901,
29953,
29941,
29955,
29929,
29915,
13,
4706,
10353,
13,
1678,
500,
13,
2870,
29901,
13,
1678,
7090,
29918,
2917,
353,
426,
13,
4706,
525,
29907,
2477,
9606,
29918,
11116,
2396,
7090,
29918,
1853,
29892,
13,
4706,
525,
29907,
2477,
9606,
29918,
9464,
2396,
2897,
29889,
21813,
29889,
657,
877,
29907,
2477,
9606,
29918,
9464,
742,
15300,
29891,
398,
687,
1829,
5477,
13,
1678,
500,
13,
13,
8173,
29889,
2344,
29918,
932,
29898,
932,
29892,
7090,
29918,
2917,
29897,
13,
29879,
8269,
353,
317,
8269,
29898,
932,
29897,
13,
13,
13,
1753,
1065,
7295,
13,
1678,
515,
330,
2523,
1398,
29889,
932,
1053,
281,
5311,
423,
407,
13,
1678,
281,
5311,
423,
407,
29889,
3389,
580,
13,
2
] |
dagology/__init__.py | JamesClough/dagology | 5 | 89263 | <gh_stars>1-10
from algorithms import *
from generators import *
from utils import *
from metrics import *
from matrix import *
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
14009,
1053,
334,
13,
3166,
1176,
4097,
1053,
334,
13,
3166,
3667,
29879,
1053,
334,
13,
3166,
21556,
1053,
334,
13,
3166,
4636,
1053,
334,
13,
2
] |
setup.py | aidan-fitz/opwen-cloudserver | 0 | 124067 | <filename>setup.py
from setuptools import find_packages
from setuptools import setup
with open('requirements.txt') as fobj:
install_requires = [line.strip() for line in fobj]
with open('README.rst') as fobj:
long_description = fobj.read()
with open('version.txt') as fobj:
version = fobj.read().strip()
packages = find_packages(exclude=['tests*'])
scripts = [
'runserver.py',
'registerclient.py',
]
setup(
name='opwen_email_server',
version=version,
author='<NAME>',
author_email='<EMAIL>',
packages=packages,
url='https://github.com/ascoderu/opwen-cloudserver',
license='Apache Software License',
description='Email server for the Lokole project: https://ascoderu.ca',
long_description=long_description,
scripts=scripts,
include_package_data=True,
install_requires=install_requires,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Topic :: Communications :: Email',
])
| [
1,
529,
9507,
29958,
14669,
29889,
2272,
13,
3166,
731,
21245,
8789,
1053,
1284,
29918,
8318,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
13,
2541,
1722,
877,
12277,
1860,
29889,
3945,
1495,
408,
285,
5415,
29901,
13,
1678,
2601,
29918,
276,
339,
2658,
353,
518,
1220,
29889,
17010,
580,
363,
1196,
297,
285,
5415,
29962,
13,
13,
13,
2541,
1722,
877,
16310,
2303,
29889,
29878,
303,
1495,
408,
285,
5415,
29901,
13,
1678,
1472,
29918,
8216,
353,
285,
5415,
29889,
949,
580,
13,
13,
13,
2541,
1722,
877,
3259,
29889,
3945,
1495,
408,
285,
5415,
29901,
13,
1678,
1873,
353,
285,
5415,
29889,
949,
2141,
17010,
580,
13,
13,
13,
8318,
353,
1284,
29918,
8318,
29898,
735,
2325,
29922,
1839,
21150,
29930,
11287,
13,
16713,
353,
518,
13,
1678,
525,
3389,
2974,
29889,
2272,
742,
13,
1678,
525,
9573,
4645,
29889,
2272,
742,
13,
29962,
13,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
459,
15556,
29918,
5269,
29918,
2974,
742,
13,
1678,
1873,
29922,
3259,
29892,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
1678,
9741,
29922,
8318,
29892,
13,
1678,
3142,
2433,
991,
597,
3292,
29889,
510,
29914,
6151,
6119,
29884,
29914,
459,
15556,
29899,
9274,
2974,
742,
13,
1678,
19405,
2433,
17396,
1829,
18540,
19245,
742,
13,
1678,
6139,
2433,
9823,
1923,
363,
278,
26469,
1772,
2060,
29901,
2045,
597,
6151,
6119,
29884,
29889,
1113,
742,
13,
1678,
1472,
29918,
8216,
29922,
5426,
29918,
8216,
29892,
13,
1678,
12078,
29922,
16713,
29892,
13,
1678,
3160,
29918,
5113,
29918,
1272,
29922,
5574,
29892,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
6252,
29918,
276,
339,
2658,
29892,
13,
1678,
770,
14903,
11759,
13,
4706,
525,
21956,
358,
16034,
4761,
29871,
29941,
448,
838,
2026,
742,
13,
4706,
525,
18649,
4761,
2563,
16738,
742,
13,
4706,
525,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
13380,
18540,
19245,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
742,
13,
4706,
525,
7031,
293,
4761,
22365,
800,
4761,
22608,
742,
13,
268,
2314,
13,
2
] |
setup.py | walwe/autolabel | 1 | 25027 | #!/usr/bin/env python
from pkg_resources import get_distribution
from setuptools import setup, find_packages
with open("README.md", "r") as f:
long_description = f.read()
version = get_distribution("autolabel").version
setup(
packages=find_packages(),
install_requires=[
'click',
'more-itertools',
'torchvision',
'torch',
'pillow',
'numpy'
],
entry_points='''
[console_scripts]
autolabel=autolabel.cli:main
''',
url='https://github.com/walwe/autolabel',
version=version,
author='walwe',
python_requires='>=3.6',
description='Autolabel is an image labeling tool using Neural Network',
long_description_content_type="text/markdown",
long_description=long_description,
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
3166,
282,
9415,
29918,
13237,
1053,
679,
29918,
27691,
13,
3166,
731,
21245,
8789,
1053,
6230,
29892,
1284,
29918,
8318,
13,
13,
2541,
1722,
703,
16310,
2303,
29889,
3487,
613,
376,
29878,
1159,
408,
285,
29901,
13,
1678,
1472,
29918,
8216,
353,
285,
29889,
949,
580,
13,
13,
3259,
353,
679,
29918,
27691,
703,
1300,
324,
1107,
2564,
3259,
13,
13,
14669,
29898,
13,
1678,
9741,
29922,
2886,
29918,
8318,
3285,
13,
1678,
2601,
29918,
276,
339,
2658,
11759,
13,
4706,
525,
3808,
742,
13,
4706,
525,
5514,
29899,
1524,
8504,
742,
13,
4706,
525,
7345,
305,
4924,
742,
13,
4706,
525,
7345,
305,
742,
13,
4706,
525,
29886,
453,
340,
742,
13,
4706,
525,
23749,
29915,
13,
1678,
21251,
13,
1678,
6251,
29918,
9748,
2433,
4907,
13,
4706,
518,
11058,
29918,
16713,
29962,
13,
4706,
1120,
324,
1107,
29922,
1300,
324,
1107,
29889,
11303,
29901,
3396,
13,
1678,
6629,
742,
13,
1678,
3142,
2433,
991,
597,
3292,
29889,
510,
29914,
14625,
705,
29914,
1300,
324,
1107,
742,
13,
1678,
1873,
29922,
3259,
29892,
13,
1678,
4148,
2433,
14625,
705,
742,
13,
1678,
3017,
29918,
276,
339,
2658,
2433,
18572,
29941,
29889,
29953,
742,
13,
1678,
6139,
2433,
6147,
324,
1107,
338,
385,
1967,
3858,
292,
5780,
773,
2448,
3631,
8527,
742,
13,
1678,
1472,
29918,
8216,
29918,
3051,
29918,
1853,
543,
726,
29914,
3502,
3204,
613,
13,
1678,
1472,
29918,
8216,
29922,
5426,
29918,
8216,
29892,
13,
1678,
770,
14903,
11759,
13,
4706,
376,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
613,
13,
4706,
376,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
341,
1806,
19245,
613,
13,
4706,
376,
7094,
1218,
2184,
4761,
6570,
25266,
613,
13,
1678,
4514,
13,
29897,
13,
2
] |
workflow/scripts/sample_comp_plot.py | snakemake-workflows/dna-seq-neoantigen-prediction | 6 | 120081 | import os
import glob
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from pysam import VariantFile
variant_df = pd.read_csv(snakemake.input[0], sep='\t').fillna(0.0)
variant_df = variant_df[["CHROM", "POS"] + [c for c in variant_df.columns if c.endswith("Freq")]]
## tidy data - for facet plot
tidy_df = variant_df.melt(id_vars=["CHROM", "POS"], var_name="Sample", value_name="VAF")
g = sns.FacetGrid(tidy_df, col="Sample")
g = g.map(sns.distplot, "VAF", hist=False)
g.savefig(snakemake.output["facet"])
plt.close()
## pairplot
sns.pairplot(variant_df.drop(["CHROM", "POS"],axis=1), diag_kind="kde")
plt.savefig(snakemake.output["pairplot"])
plt.close()
def overlap_pct(x, y, **kws):
n = 0
for i in range(0,len(x)):
if (x[i] > 0) & (y[i] > 0):
n += 1
overlap=n/len([e for e in x if e > 0])
ax = plt.gca()
ax.annotate("Shared Fraction: {:.2f}".format(overlap), xy=(.2, .4))
ax.annotate("Shared Variants: {}".format(n), xy=(.2, .6))
def variants(x, **kws):
positive = len([e for e in x if e > 0])
ax = plt.gca()
ax.annotate("#Variants: {}".format(positive), xy=(.2, .5),
xycoords=ax.transAxes)
g = sns.PairGrid(variant_df.drop(["CHROM", "POS"], axis=1))
g.map_offdiag(overlap_pct)
g.map_diag(variants)
g.savefig(snakemake.output["grid"])
plt.close()
#def neg_overlap_pct(x, y, **kws):
# n = 0
# for i in range(0,len(x)):
# if (x[i] == 0) & (y[i] == 0):
# n += 1
# overlap=n/len([e for e in x if e == 0])
# ax = plt.gca()
# ax.annotate("Shared Fraction: {:.2f}".format(overlap), xy=(.2, .4))
# ax.annotate("Shared missing variants: {}".format(n), xy=(.2, .6))
#def neg_variants(x, **kws):
# zero = len([e for e in x if e == 0])
# ax = plt.gca()
# ax.annotate("#Missing Variants: {}".format(zero), xy=(.2, .5),
#xycoords=ax.transAxes)
#g = sns.PairGrid(variant_df.drop(["CHROM", "POS"], axis=1))
#g.map_offdiag(neg_overlap_pct)
#g.map_diag(neg_variants)
#g.savefig("plots/Mssing_Variant_table.pdf")
#plt.close()
for c in variant_df.drop(["CHROM", "POS"], axis=1).columns:
sns.distplot(variant_df[[c]][variant_df[c] > 0])
plt.title(c)
plt.savefig("plots/positive_" + c +".distplot.pdf")
plt.close()
sns.distplot(variant_df[[c]])
plt.savefig("plots/all_" + c +".distplot.pdf")
plt.close()
| [
1,
1053,
2897,
13,
5215,
13149,
13,
5215,
11701,
408,
10518,
13,
5215,
12655,
408,
7442,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
282,
952,
314,
1053,
9586,
424,
2283,
13,
13,
19365,
29918,
2176,
353,
10518,
29889,
949,
29918,
7638,
29898,
29879,
8546,
331,
1296,
29889,
2080,
29961,
29900,
1402,
16345,
2433,
29905,
29873,
2824,
5589,
1056,
29898,
29900,
29889,
29900,
29897,
13,
19365,
29918,
2176,
353,
17305,
29918,
2176,
29961,
3366,
3210,
3491,
613,
376,
24815,
3108,
718,
518,
29883,
363,
274,
297,
17305,
29918,
2176,
29889,
13099,
565,
274,
29889,
1975,
2541,
703,
29943,
7971,
1159,
5262,
13,
2277,
10668,
29891,
848,
448,
363,
4024,
300,
6492,
13,
17681,
29891,
29918,
2176,
353,
17305,
29918,
2176,
29889,
29885,
2152,
29898,
333,
29918,
16908,
29922,
3366,
3210,
3491,
613,
376,
24815,
12436,
722,
29918,
978,
543,
17708,
613,
995,
29918,
978,
543,
29963,
5098,
1159,
13,
29887,
353,
269,
1983,
29889,
29943,
562,
300,
5756,
29898,
17681,
29891,
29918,
2176,
29892,
784,
543,
17708,
1159,
13,
29887,
353,
330,
29889,
1958,
29898,
29879,
1983,
29889,
5721,
5317,
29892,
376,
29963,
5098,
613,
9825,
29922,
8824,
29897,
13,
29887,
29889,
7620,
1003,
29898,
29879,
8546,
331,
1296,
29889,
4905,
3366,
17470,
300,
20068,
13,
572,
29873,
29889,
5358,
580,
13,
2277,
5101,
5317,
13,
29879,
1983,
29889,
18784,
5317,
29898,
19365,
29918,
2176,
29889,
8865,
29898,
3366,
3210,
3491,
613,
376,
24815,
12436,
8990,
29922,
29896,
511,
7936,
29918,
14380,
543,
29895,
311,
1159,
13,
572,
29873,
29889,
7620,
1003,
29898,
29879,
8546,
331,
1296,
29889,
4905,
3366,
18784,
5317,
20068,
13,
572,
29873,
29889,
5358,
580,
13,
13,
1753,
25457,
29918,
29886,
312,
29898,
29916,
29892,
343,
29892,
3579,
29895,
5652,
1125,
13,
1678,
302,
353,
29871,
29900,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
2435,
29898,
29916,
22164,
13,
4706,
565,
313,
29916,
29961,
29875,
29962,
1405,
29871,
29900,
29897,
669,
313,
29891,
29961,
29875,
29962,
1405,
29871,
29900,
1125,
13,
9651,
302,
4619,
29871,
29896,
13,
1678,
25457,
29922,
29876,
29914,
2435,
4197,
29872,
363,
321,
297,
921,
565,
321,
1405,
29871,
29900,
2314,
13,
1678,
4853,
353,
14770,
29889,
29887,
1113,
580,
13,
1678,
4853,
29889,
6735,
403,
703,
21741,
7347,
428,
29901,
12365,
29889,
29906,
29888,
29913,
1642,
4830,
29898,
957,
6984,
511,
921,
29891,
7607,
29889,
29906,
29892,
869,
29946,
876,
13,
1678,
4853,
29889,
6735,
403,
703,
21741,
9586,
1934,
29901,
6571,
1642,
4830,
29898,
29876,
511,
921,
29891,
7607,
29889,
29906,
29892,
869,
29953,
876,
13,
13,
1753,
29161,
29898,
29916,
29892,
3579,
29895,
5652,
1125,
13,
1678,
6374,
353,
7431,
4197,
29872,
363,
321,
297,
921,
565,
321,
1405,
29871,
29900,
2314,
13,
1678,
4853,
353,
14770,
29889,
29887,
1113,
580,
29871,
13,
1678,
4853,
29889,
6735,
403,
14822,
10444,
1934,
29901,
6571,
1642,
4830,
29898,
1066,
3321,
511,
921,
29891,
7607,
29889,
29906,
29892,
869,
29945,
511,
13,
3594,
1111,
4339,
29922,
1165,
29889,
3286,
29909,
9100,
29897,
13,
13,
29887,
353,
269,
1983,
29889,
20547,
5756,
29898,
19365,
29918,
2176,
29889,
8865,
29898,
3366,
3210,
3491,
613,
376,
24815,
12436,
9685,
29922,
29896,
876,
13,
13,
29887,
29889,
1958,
29918,
2696,
6051,
351,
29898,
957,
6984,
29918,
29886,
312,
29897,
13,
29887,
29889,
1958,
29918,
6051,
351,
29898,
5927,
1934,
29897,
13,
29887,
29889,
7620,
1003,
29898,
29879,
8546,
331,
1296,
29889,
4905,
3366,
7720,
20068,
13,
572,
29873,
29889,
5358,
580,
13,
13,
29937,
1753,
3480,
29918,
957,
6984,
29918,
29886,
312,
29898,
29916,
29892,
343,
29892,
3579,
29895,
5652,
1125,
13,
29937,
1678,
302,
353,
29871,
29900,
13,
29937,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
2435,
29898,
29916,
22164,
13,
29937,
4706,
565,
313,
29916,
29961,
29875,
29962,
1275,
29871,
29900,
29897,
669,
313,
29891,
29961,
29875,
29962,
1275,
29871,
29900,
1125,
13,
29937,
9651,
302,
4619,
29871,
29896,
13,
29937,
1678,
25457,
29922,
29876,
29914,
2435,
4197,
29872,
363,
321,
297,
921,
565,
321,
1275,
29871,
29900,
2314,
13,
29937,
1678,
4853,
353,
14770,
29889,
29887,
1113,
580,
13,
29937,
1678,
4853,
29889,
6735,
403,
703,
21741,
7347,
428,
29901,
12365,
29889,
29906,
29888,
29913,
1642,
4830,
29898,
957,
6984,
511,
921,
29891,
7607,
29889,
29906,
29892,
869,
29946,
876,
13,
29937,
1678,
4853,
29889,
6735,
403,
703,
21741,
4567,
29161,
29901,
6571,
1642,
4830,
29898,
29876,
511,
921,
29891,
7607,
29889,
29906,
29892,
869,
29953,
876,
13,
13,
29937,
1753,
3480,
29918,
5927,
1934,
29898,
29916,
29892,
3579,
29895,
5652,
1125,
13,
29937,
1678,
5225,
353,
7431,
4197,
29872,
363,
321,
297,
921,
565,
321,
1275,
29871,
29900,
2314,
13,
29937,
1678,
4853,
353,
14770,
29889,
29887,
1113,
580,
29871,
13,
29937,
1678,
4853,
29889,
6735,
403,
14822,
18552,
292,
9586,
1934,
29901,
6571,
1642,
4830,
29898,
9171,
511,
921,
29891,
7607,
29889,
29906,
29892,
869,
29945,
511,
13,
29937,
3594,
1111,
4339,
29922,
1165,
29889,
3286,
29909,
9100,
29897,
13,
13,
29937,
29887,
353,
269,
1983,
29889,
20547,
5756,
29898,
19365,
29918,
2176,
29889,
8865,
29898,
3366,
3210,
3491,
613,
376,
24815,
12436,
9685,
29922,
29896,
876,
13,
13,
29937,
29887,
29889,
1958,
29918,
2696,
6051,
351,
29898,
10052,
29918,
957,
6984,
29918,
29886,
312,
29897,
13,
29937,
29887,
29889,
1958,
29918,
6051,
351,
29898,
10052,
29918,
5927,
1934,
29897,
13,
29937,
29887,
29889,
7620,
1003,
703,
26762,
29914,
29924,
893,
292,
29918,
10444,
424,
29918,
2371,
29889,
5140,
1159,
13,
29937,
572,
29873,
29889,
5358,
580,
13,
13,
1454,
274,
297,
17305,
29918,
2176,
29889,
8865,
29898,
3366,
3210,
3491,
613,
376,
24815,
12436,
9685,
29922,
29896,
467,
13099,
29901,
29871,
13,
1678,
269,
1983,
29889,
5721,
5317,
29898,
19365,
29918,
2176,
8999,
29883,
29962,
3816,
19365,
29918,
2176,
29961,
29883,
29962,
1405,
29871,
29900,
2314,
29871,
13,
1678,
14770,
29889,
3257,
29898,
29883,
29897,
29871,
13,
1678,
14770,
29889,
7620,
1003,
703,
26762,
29914,
1066,
3321,
27508,
718,
274,
718,
1642,
5721,
5317,
29889,
5140,
1159,
13,
1678,
14770,
29889,
5358,
580,
13,
1678,
269,
1983,
29889,
5721,
5317,
29898,
19365,
29918,
2176,
8999,
29883,
24960,
13,
1678,
14770,
29889,
7620,
1003,
703,
26762,
29914,
497,
27508,
718,
274,
718,
1642,
5721,
5317,
29889,
5140,
1159,
13,
1678,
14770,
29889,
5358,
580,
13,
13,
2
] |
LossAug/OpticalFlowLoss.py | gexahedron/pytti | 0 | 30730 | <reponame>gexahedron/pytti
from pytti.LossAug import MSELoss, LatentLoss
import sys, os, gc
import argparse
import os
import cv2
import glob
import math, copy
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from PIL import Image
import imageio
import matplotlib.pyplot as plt
from pytti.Notebook import Rotoscoper
from torchvision.transforms import functional as TF
os.chdir('GMA')
try:
sys.path.append('core')
from network import RAFTGMA
from utils import flow_viz
from utils.utils import InputPadder
finally:
os.chdir('..')
from pytti.Transforms import apply_flow
from pytti import fetch, to_pil, DEVICE, vram_usage_mode
from pytti.Image.RGBImage import RGBImage
GMA = None
def init_GMA(checkpoint_path):
global GMA
if GMA is None:
with vram_usage_mode('GMA'):
parser = argparse.ArgumentParser()
parser.add_argument('--model', help="restore checkpoint", default=checkpoint_path)
parser.add_argument('--model_name', help="define model name", default="GMA")
parser.add_argument('--path', help="dataset for evaluation")
parser.add_argument('--num_heads', default=1, type=int,
help='number of heads in attention and aggregation')
parser.add_argument('--position_only', default=False, action='store_true',
help='only use position-wise attention')
parser.add_argument('--position_and_content', default=False, action='store_true',
help='use position and content-wise attention')
parser.add_argument('--mixed_precision', action='store_true', help='use mixed precision')
args = parser.parse_args([])
GMA = torch.nn.DataParallel(RAFTGMA(args))
GMA.load_state_dict(torch.load(checkpoint_path))
GMA.to(DEVICE)
GMA.eval()
def sample(tensor, uv, device=DEVICE):
height, width = tensor.shape[-2:]
max_pos = torch.tensor([width-1,height-1], device=device).view(2,1,1)
grid = uv.div(max_pos/2).sub(1).movedim(0,-1).unsqueeze(0)
return F.grid_sample(tensor.unsqueeze(0), grid, align_corners = True).squeeze(0)
class TargetFlowLoss(MSELoss):
def __init__(self, comp, weight = 0.5, stop = -math.inf, name = "direct target loss", image_shape = None):
super().__init__(comp, weight, stop, name, image_shape)
with torch.no_grad():
self.register_buffer('last_step', comp.clone())
self.mag = 1
@torch.no_grad()
def set_target_flow(self, flow, device=DEVICE):
self.comp.set_(flow.movedim(-1,1).to(device, memory_format = torch.channels_last))
self.mag = float(torch.linalg.norm(self.comp, dim = 1).square().mean())
@torch.no_grad()
def set_last_step(self, last_step_pil, device = DEVICE):
last_step = TF.to_tensor(last_step_pil).unsqueeze(0).to(device, memory_format = torch.channels_last)
self.last_step.set_(last_step)
def get_loss(self, input, img, device=DEVICE):
os.chdir('GMA')
try:
init_GMA('checkpoints/gma-sintel.pth')
image1 = self.last_step
image2 = input
padder = InputPadder(image1.shape)
image1, image2 = padder.pad(image1, image2)
_, flow = GMA(image1, image2, iters=3, test_mode=True)
flow = flow.to(device, memory_format = torch.channels_last)
finally:
os.chdir('..')
return super().get_loss(TF.resize(flow, self.comp.shape[-2:]), img)/self.mag
class OpticalFlowLoss(MSELoss):
@staticmethod
@torch.no_grad()
def motion_edge_map(flow_forward, flow_backward, img, border_mode = 'smear', sampling_mode = 'bilinear',device=DEVICE):
# algorithm based on https://github.com/manuelruder/artistic-videos/blob/master/consistencyChecker/consistencyChecker.cpp
# reimplemented in pytorch by <NAME>
# // consistencyChecker
# // Check consistency of forward flow via backward flow.
# //
# // (c) <NAME>, <NAME>, <NAME> 2016
dx_ker = torch.tensor([[[[0,0,0],[1,0,-1],[0, 0,0]]]], device = device).float().div(2).repeat(2,2,1,1)
dy_ker = torch.tensor([[[[0,1,0],[0,0, 0],[0,-1,0]]]], device = device).float().div(2).repeat(2,2,1,1)
f_x = nn.functional.conv2d(flow_backward, dx_ker, padding='same')
f_y = nn.functional.conv2d(flow_backward, dy_ker, padding='same')
motionedge = torch.cat([f_x,f_y]).square().sum(dim=(0,1))
height, width = flow_forward.shape[-2:]
y,x = torch.meshgrid([torch.arange(0,height), torch.arange(0,width)])
x = x.to(device)
y = y.to(device)
p1 = torch.stack([x,y])
v1 = flow_forward.squeeze(0)
p0 = p1 + flow_backward.squeeze()
v0 = sample(v1, p0)
p1_back = p0 + v0
v1_back = flow_backward.squeeze(0)
r1 = torch.floor(p0)
r2 = r1 + 1
max_pos = torch.tensor([width-1,height-1], device=device).view(2,1,1)
min_pos = torch.tensor([0, 0], device=device).view(2,1,1)
overshoot = torch.logical_or(r1.lt(min_pos),r2.gt(max_pos))
overshoot = torch.logical_or(overshoot[0],overshoot[1])
missed = (p1_back - p1).square().sum(dim=0).ge(torch.stack([v1_back,v0]).square().sum(dim=(0,1)).mul(0.01).add(0.5))
motion_boundary = motionedge.ge(v1_back.square().sum(dim=0).mul(0.01).add(0.002))
reliable = torch.ones((height, width), device=device)
reliable[motion_boundary] = 0
reliable[missed] = -1
reliable[overshoot] = 0
mask = TF.gaussian_blur(reliable.unsqueeze(0), 3).clip(0,1)
return mask
@staticmethod
@torch.no_grad()
def get_flow(image1, image2, device=DEVICE):
os.chdir('GMA')
try:
init_GMA('checkpoints/gma-sintel.pth')
if isinstance(image1, Image.Image):
image1 = TF.to_tensor(image1).unsqueeze(0).to(device)
if isinstance(image2, Image.Image):
image2 = TF.to_tensor(image2).unsqueeze(0).to(device)
padder = InputPadder(image1.shape)
image1, image2 = padder.pad(image1, image2)
flow_low, flow_up = GMA(image1, image2, iters=12, test_mode=True)
finally:
os.chdir('..')
return flow_up
def __init__(self, comp, weight = 0.5, stop = -math.inf, name = "direct target loss", image_shape = None):
super().__init__(comp, weight, stop, name, image_shape)
with torch.no_grad():
self.latent_loss = MSELoss(comp.new_zeros((1,1,1,1)), weight, stop, name, image_shape)
self.register_buffer('bg_mask',comp.new_zeros((1,1,1,1)))
@torch.no_grad()
def set_flow(self, frame_prev, frame_next, img, path, border_mode = 'smear', sampling_mode = 'bilinear', device = DEVICE):
if path is not None:
img = img.clone()
state_dict = torch.load(path)
img.load_state_dict(state_dict)
gc.collect()
torch.cuda.empty_cache()
image1 = TF.to_tensor(frame_prev).unsqueeze(0).to(device)
image2 = TF.to_tensor(frame_next).unsqueeze(0).to(device)
if self.bg_mask.shape[-2:] != image1.shape[-2:]:
bg_mask = TF.resize(self.bg_mask, image1.shape[-2:])
self.bg_mask.set_(bg_mask)
noise = torch.empty_like(image2)
noise.normal_(mean = 0, std = 0.05)
noise.mul_(self.bg_mask)
#adding the same noise vectors to both images forces
#the flow model to match those parts of the frame, effectively
#disabling the flow in those areas.
image1.add_(noise)
image2.add_(noise)
# bdy = image2.clone().squeeze(0).mean(dim = 0)
# h, w = bdy.shape
# s = 4
# bdy[s:-s,s:-s] = 0
# mean = bdy.sum().div(w*h - (w-2*s)*(h-s*2))
# overlay = image2.gt(0.5) if mean > 0.5 else image2.lt(0.5)
# noise = torch.empty_like(image2)
# noise.normal_(mean = 0, std = 0.05)
# noise[torch.logical_not(overlay)] = 0
# image1.add_(noise)
# image2.add_(noise)
flow_forward = OpticalFlowLoss.get_flow(image1, image2)
flow_backward = OpticalFlowLoss.get_flow(image2, image1)
unwarped_target_direct = img.decode_tensor()
flow_target_direct = apply_flow(img, -flow_backward, border_mode = border_mode, sampling_mode = sampling_mode)
fancy_mask = OpticalFlowLoss.motion_edge_map(flow_forward, flow_backward, img, border_mode, sampling_mode)
target_direct = flow_target_direct
target_latent = img.get_latent_tensor(detach = True)
mask = fancy_mask.unsqueeze(0)
self.comp.set_(target_direct)
self.latent_loss.comp.set_(target_latent)
self.set_flow_mask(mask)
array = flow_target_direct.squeeze(0).movedim(0,-1).mul(255).clamp(0, 255).cpu().detach().numpy().astype(np.uint8)[:,:,:]
return Image.fromarray(array), fancy_mask
@torch.no_grad()
def set_flow_mask(self,mask):
super().set_mask(TF.resize(mask, self.comp.shape[-2:]))
if mask is not None:
self.latent_loss.set_mask(TF.resize(mask, self.latent_loss.comp.shape[-2:]))
else:
self.latent_loss.set_mask(None)
@torch.no_grad()
def set_mask(self, mask, inverted = False, device = DEVICE):
if isinstance(mask, str) and mask != '':
if mask[0] == '-':
mask = mask[1:]
inverted = True
if mask.strip()[-4:] == '.mp4':
r = Rotoscoper(mask,self)
r.update(0)
return
mask = Image.open(fetch(mask)).convert('L')
if isinstance(mask, Image.Image):
with vram_usage_mode('Masks'):
mask = TF.to_tensor(mask).unsqueeze(0).to(device, memory_format = torch.channels_last)
if mask not in ['',None]:
#this is where the inversion is. This mask is naturally inverted :)
#since it selects the background
self.bg_mask.set_(mask if inverted else (1-mask))
def get_loss(self, input, img):
l1 = super().get_loss(input, img)
l2 = self.latent_loss.get_loss(img.get_latent_tensor(), img)
#print(float(l1),float(l2))
return l1+l2*img.latent_strength
| [
1,
529,
276,
1112,
420,
29958,
5082,
801,
287,
1617,
29914,
2272,
698,
29875,
13,
3166,
11451,
698,
29875,
29889,
29931,
2209,
29909,
688,
1053,
341,
1660,
29931,
2209,
29892,
7053,
296,
29931,
2209,
30004,
13,
5215,
10876,
29892,
2897,
29892,
330,
29883,
30004,
13,
5215,
1852,
5510,
30004,
13,
5215,
2897,
30004,
13,
5215,
13850,
29906,
30004,
13,
5215,
13149,
30004,
13,
5215,
5844,
29892,
3509,
30004,
13,
5215,
12655,
408,
7442,
30004,
13,
5215,
4842,
305,
30004,
13,
3166,
4842,
305,
1053,
302,
29876,
30004,
13,
3166,
4842,
305,
29889,
15755,
1053,
13303,
408,
383,
30004,
13,
3166,
349,
6227,
1053,
7084,
30004,
13,
5215,
1967,
601,
30004,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
30004,
13,
3166,
11451,
698,
29875,
29889,
3664,
19273,
1053,
9664,
14174,
3372,
30004,
13,
3166,
4842,
305,
4924,
29889,
9067,
29879,
1053,
13303,
408,
323,
29943,
30004,
13,
30004,
13,
359,
29889,
305,
3972,
877,
29954,
1529,
1495,
30004,
13,
2202,
29901,
30004,
13,
29871,
10876,
29889,
2084,
29889,
4397,
877,
3221,
1495,
30004,
13,
29871,
515,
3564,
1053,
390,
5098,
29911,
29954,
1529,
30004,
13,
29871,
515,
3667,
29879,
1053,
4972,
29918,
29894,
466,
30004,
13,
29871,
515,
3667,
29879,
29889,
13239,
1053,
10567,
20369,
672,
30004,
13,
4951,
635,
29901,
30004,
13,
29871,
2897,
29889,
305,
3972,
877,
636,
1495,
30004,
13,
30004,
13,
3166,
11451,
698,
29875,
29889,
4300,
9514,
1053,
3394,
29918,
1731,
30004,
13,
3166,
11451,
698,
29875,
1053,
6699,
29892,
304,
29918,
29886,
309,
29892,
5012,
19059,
29892,
325,
2572,
29918,
21125,
29918,
8513,
30004,
13,
3166,
11451,
698,
29875,
29889,
2940,
29889,
28212,
2940,
1053,
390,
7210,
2940,
30004,
13,
30004,
13,
29954,
1529,
353,
6213,
30004,
13,
1753,
2069,
29918,
29954,
1529,
29898,
3198,
3149,
29918,
2084,
1125,
30004,
13,
29871,
5534,
402,
1529,
30004,
13,
29871,
565,
402,
1529,
338,
6213,
29901,
30004,
13,
1678,
411,
325,
2572,
29918,
21125,
29918,
8513,
877,
29954,
1529,
29374,
30004,
13,
418,
13812,
353,
1852,
5510,
29889,
15730,
11726,
26471,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
4299,
742,
1371,
543,
5060,
487,
1423,
3149,
613,
2322,
29922,
3198,
3149,
29918,
2084,
8443,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
4299,
29918,
978,
742,
1371,
543,
7922,
1904,
1024,
613,
2322,
543,
29954,
1529,
1159,
30004,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
2084,
742,
1371,
543,
24713,
363,
17983,
1159,
30004,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
1949,
29918,
2813,
29879,
742,
2322,
29922,
29896,
29892,
1134,
29922,
524,
11167,
13,
462,
3986,
1371,
2433,
4537,
310,
15883,
297,
8570,
322,
11404,
362,
1495,
30004,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
3283,
29918,
6194,
742,
2322,
29922,
8824,
29892,
3158,
2433,
8899,
29918,
3009,
23592,
13,
462,
3986,
1371,
2433,
6194,
671,
2602,
29899,
3538,
8570,
1495,
30004,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
3283,
29918,
392,
29918,
3051,
742,
2322,
29922,
8824,
29892,
3158,
2433,
8899,
29918,
3009,
23592,
13,
462,
3986,
1371,
2433,
1509,
2602,
322,
2793,
29899,
3538,
8570,
1495,
30004,
13,
418,
13812,
29889,
1202,
29918,
23516,
877,
489,
29885,
11925,
29918,
17990,
2459,
742,
3158,
2433,
8899,
29918,
3009,
742,
1371,
2433,
1509,
12849,
16716,
1495,
30004,
13,
418,
6389,
353,
13812,
29889,
5510,
29918,
5085,
4197,
2314,
30004,
13,
418,
402,
1529,
353,
4842,
305,
29889,
15755,
29889,
1469,
2177,
6553,
29898,
4717,
7818,
29954,
1529,
29898,
5085,
876,
30004,
13,
418,
402,
1529,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
7345,
305,
29889,
1359,
29898,
3198,
3149,
29918,
2084,
876,
30004,
13,
418,
402,
1529,
29889,
517,
29898,
2287,
19059,
8443,
13,
418,
402,
1529,
29889,
14513,
26471,
13,
30004,
13,
1753,
4559,
29898,
20158,
29892,
318,
29894,
29892,
4742,
29922,
2287,
19059,
1125,
30004,
13,
29871,
3171,
29892,
2920,
353,
12489,
29889,
12181,
14352,
29906,
17531,
30004,
13,
29871,
4236,
29918,
1066,
353,
4842,
305,
29889,
20158,
4197,
2103,
29899,
29896,
29892,
3545,
29899,
29896,
1402,
4742,
29922,
10141,
467,
1493,
29898,
29906,
29892,
29896,
29892,
29896,
8443,
13,
29871,
6856,
353,
318,
29894,
29889,
4563,
29898,
3317,
29918,
1066,
29914,
29906,
467,
1491,
29898,
29896,
467,
29885,
8238,
326,
29898,
29900,
6653,
29896,
467,
6948,
802,
29872,
911,
29898,
29900,
8443,
13,
29871,
736,
383,
29889,
7720,
29918,
11249,
29898,
20158,
29889,
6948,
802,
29872,
911,
29898,
29900,
511,
6856,
29892,
7595,
29918,
29883,
1398,
414,
353,
5852,
467,
29879,
802,
29872,
911,
29898,
29900,
8443,
13,
30004,
13,
1990,
17157,
17907,
29931,
2209,
29898,
29924,
1660,
29931,
2209,
1125,
30004,
13,
29871,
822,
4770,
2344,
12035,
1311,
29892,
752,
29892,
7688,
353,
29871,
29900,
29889,
29945,
29892,
5040,
353,
448,
755,
29889,
7192,
29892,
1024,
353,
376,
11851,
3646,
6410,
613,
1967,
29918,
12181,
353,
6213,
1125,
30004,
13,
1678,
2428,
2141,
1649,
2344,
12035,
2388,
29892,
7688,
29892,
5040,
29892,
1024,
29892,
1967,
29918,
12181,
8443,
13,
1678,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
30004,
13,
418,
1583,
29889,
9573,
29918,
9040,
877,
4230,
29918,
10568,
742,
752,
29889,
16513,
3101,
30004,
13,
418,
1583,
29889,
11082,
353,
29871,
29896,
30004,
13,
30004,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
731,
29918,
5182,
29918,
1731,
29898,
1311,
29892,
4972,
29892,
4742,
29922,
2287,
19059,
1125,
30004,
13,
1678,
1583,
29889,
2388,
29889,
842,
23538,
1731,
29889,
29885,
8238,
326,
6278,
29896,
29892,
29896,
467,
517,
29898,
10141,
29892,
3370,
29918,
4830,
353,
4842,
305,
29889,
305,
12629,
29918,
4230,
876,
30004,
13,
1678,
1583,
29889,
11082,
353,
5785,
29898,
7345,
305,
29889,
29880,
979,
29887,
29889,
12324,
29898,
1311,
29889,
2388,
29892,
3964,
353,
29871,
29896,
467,
17619,
2141,
12676,
3101,
30004,
13,
29871,
6756,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
731,
29918,
4230,
29918,
10568,
29898,
1311,
29892,
1833,
29918,
10568,
29918,
29886,
309,
29892,
4742,
353,
5012,
19059,
1125,
30004,
13,
1678,
1833,
29918,
10568,
353,
323,
29943,
29889,
517,
29918,
20158,
29898,
4230,
29918,
10568,
29918,
29886,
309,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
517,
29898,
10141,
29892,
3370,
29918,
4830,
353,
4842,
305,
29889,
305,
12629,
29918,
4230,
8443,
13,
1678,
1583,
29889,
4230,
29918,
10568,
29889,
842,
23538,
4230,
29918,
10568,
8443,
13,
30004,
13,
29871,
822,
679,
29918,
6758,
29898,
1311,
29892,
1881,
29892,
10153,
29892,
4742,
29922,
2287,
19059,
1125,
30004,
13,
1678,
2897,
29889,
305,
3972,
877,
29954,
1529,
1495,
30004,
13,
1678,
1018,
29901,
30004,
13,
418,
2069,
29918,
29954,
1529,
877,
3198,
9748,
29914,
29887,
655,
29899,
29879,
524,
295,
29889,
29886,
386,
1495,
30004,
13,
418,
1967,
29896,
353,
1583,
29889,
4230,
29918,
10568,
30004,
13,
418,
1967,
29906,
353,
1881,
30004,
13,
418,
17132,
672,
353,
10567,
20369,
672,
29898,
3027,
29896,
29889,
12181,
8443,
13,
418,
1967,
29896,
29892,
1967,
29906,
353,
17132,
672,
29889,
8305,
29898,
3027,
29896,
29892,
1967,
29906,
8443,
13,
418,
17117,
4972,
353,
402,
1529,
29898,
3027,
29896,
29892,
1967,
29906,
29892,
372,
414,
29922,
29941,
29892,
1243,
29918,
8513,
29922,
5574,
8443,
13,
418,
4972,
353,
4972,
29889,
517,
29898,
10141,
29892,
3370,
29918,
4830,
353,
4842,
305,
29889,
305,
12629,
29918,
4230,
8443,
13,
1678,
7146,
29901,
30004,
13,
418,
2897,
29889,
305,
3972,
877,
636,
1495,
30004,
13,
1678,
736,
2428,
2141,
657,
29918,
6758,
29898,
8969,
29889,
21476,
29898,
1731,
29892,
1583,
29889,
2388,
29889,
12181,
14352,
29906,
29901,
11724,
10153,
6802,
1311,
29889,
11082,
30004,
13,
30004,
13,
30004,
13,
1990,
20693,
936,
17907,
29931,
2209,
29898,
29924,
1660,
29931,
2209,
1125,
30004,
13,
29871,
732,
7959,
5696,
30004,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
10884,
29918,
12864,
29918,
1958,
29898,
1731,
29918,
11333,
29892,
4972,
29918,
1627,
1328,
29892,
10153,
29892,
5139,
29918,
8513,
353,
525,
3844,
799,
742,
23460,
29918,
8513,
353,
525,
18152,
457,
279,
742,
10141,
29922,
2287,
19059,
1125,
30004,
13,
1678,
396,
5687,
2729,
373,
2045,
597,
3292,
29889,
510,
29914,
22670,
29878,
18309,
29914,
442,
4695,
29899,
29894,
7958,
29914,
10054,
29914,
6207,
29914,
3200,
391,
3819,
5596,
261,
29914,
3200,
391,
3819,
5596,
261,
29889,
8223,
30004,
13,
1678,
396,
337,
326,
2037,
287,
297,
282,
3637,
25350,
491,
529,
5813,
3238,
13,
1678,
396,
849,
5718,
3819,
5596,
261,
30004,
13,
1678,
396,
849,
5399,
5718,
3819,
310,
6375,
4972,
3025,
1250,
1328,
4972,
22993,
13,
1678,
396,
849,
30004,
13,
1678,
396,
849,
313,
29883,
29897,
529,
5813,
10202,
529,
5813,
10202,
529,
5813,
29958,
29871,
29906,
29900,
29896,
29953,
30004,
13,
1678,
15414,
29918,
3946,
353,
4842,
305,
29889,
20158,
4197,
8999,
29961,
29900,
29892,
29900,
29892,
29900,
16272,
29896,
29892,
29900,
6653,
29896,
16272,
29900,
29892,
29871,
29900,
29892,
29900,
5262,
20526,
4742,
353,
4742,
467,
7411,
2141,
4563,
29898,
29906,
467,
14358,
29898,
29906,
29892,
29906,
29892,
29896,
29892,
29896,
8443,
13,
1678,
13475,
29918,
3946,
353,
4842,
305,
29889,
20158,
4197,
8999,
29961,
29900,
29892,
29896,
29892,
29900,
16272,
29900,
29892,
29900,
29892,
29871,
29900,
16272,
29900,
6653,
29896,
29892,
29900,
5262,
20526,
4742,
353,
4742,
467,
7411,
2141,
4563,
29898,
29906,
467,
14358,
29898,
29906,
29892,
29906,
29892,
29896,
29892,
29896,
8443,
13,
1678,
285,
29918,
29916,
353,
302,
29876,
29889,
2220,
284,
29889,
20580,
29906,
29881,
29898,
1731,
29918,
1627,
1328,
29892,
15414,
29918,
3946,
29892,
29871,
7164,
2433,
17642,
1495,
30004,
13,
1678,
285,
29918,
29891,
353,
302,
29876,
29889,
2220,
284,
29889,
20580,
29906,
29881,
29898,
1731,
29918,
1627,
1328,
29892,
13475,
29918,
3946,
29892,
29871,
7164,
2433,
17642,
1495,
30004,
13,
1678,
10884,
12864,
353,
4842,
305,
29889,
4117,
4197,
29888,
29918,
29916,
29892,
29888,
29918,
29891,
14664,
17619,
2141,
2083,
29898,
6229,
7607,
29900,
29892,
29896,
876,
30004,
13,
30004,
13,
1678,
3171,
29892,
2920,
353,
4972,
29918,
11333,
29889,
12181,
14352,
29906,
17531,
30004,
13,
1678,
343,
29892,
29916,
353,
4842,
305,
29889,
4467,
29882,
7720,
4197,
7345,
305,
29889,
279,
927,
29898,
29900,
29892,
3545,
511,
4842,
305,
29889,
279,
927,
29898,
29900,
29892,
2103,
29897,
2314,
30004,
13,
1678,
921,
353,
921,
29889,
517,
29898,
10141,
8443,
13,
1678,
343,
353,
343,
29889,
517,
29898,
10141,
8443,
13,
30004,
13,
1678,
282,
29896,
353,
4842,
305,
29889,
1429,
4197,
29916,
29892,
29891,
2314,
30004,
13,
1678,
325,
29896,
353,
4972,
29918,
11333,
29889,
29879,
802,
29872,
911,
29898,
29900,
8443,
13,
1678,
282,
29900,
353,
282,
29896,
718,
4972,
29918,
1627,
1328,
29889,
29879,
802,
29872,
911,
26471,
13,
1678,
325,
29900,
353,
4559,
29898,
29894,
29896,
29892,
282,
29900,
8443,
13,
1678,
282,
29896,
29918,
1627,
353,
282,
29900,
718,
325,
29900,
30004,
13,
1678,
325,
29896,
29918,
1627,
353,
4972,
29918,
1627,
1328,
29889,
29879,
802,
29872,
911,
29898,
29900,
8443,
13,
29871,
6756,
13,
1678,
364,
29896,
353,
4842,
305,
29889,
14939,
29898,
29886,
29900,
8443,
13,
1678,
364,
29906,
353,
364,
29896,
718,
29871,
29896,
30004,
13,
1678,
4236,
29918,
1066,
353,
4842,
305,
29889,
20158,
4197,
2103,
29899,
29896,
29892,
3545,
29899,
29896,
1402,
4742,
29922,
10141,
467,
1493,
29898,
29906,
29892,
29896,
29892,
29896,
8443,
13,
1678,
1375,
29918,
1066,
353,
4842,
305,
29889,
20158,
4197,
29900,
29892,
29871,
29900,
1402,
4742,
29922,
10141,
467,
1493,
29898,
29906,
29892,
29896,
29892,
29896,
8443,
13,
1678,
975,
845,
3155,
353,
4842,
305,
29889,
1188,
936,
29918,
272,
29898,
29878,
29896,
29889,
1896,
29898,
1195,
29918,
1066,
511,
29878,
29906,
29889,
4141,
29898,
3317,
29918,
1066,
876,
30004,
13,
1678,
975,
845,
3155,
353,
4842,
305,
29889,
1188,
936,
29918,
272,
29898,
957,
845,
3155,
29961,
29900,
1402,
957,
845,
3155,
29961,
29896,
2314,
30004,
13,
30004,
13,
1678,
13726,
353,
313,
29886,
29896,
29918,
1627,
448,
282,
29896,
467,
17619,
2141,
2083,
29898,
6229,
29922,
29900,
467,
479,
29898,
7345,
305,
29889,
1429,
4197,
29894,
29896,
29918,
1627,
29892,
29894,
29900,
14664,
17619,
2141,
2083,
29898,
6229,
7607,
29900,
29892,
29896,
8106,
16109,
29898,
29900,
29889,
29900,
29896,
467,
1202,
29898,
29900,
29889,
29945,
876,
30004,
13,
1678,
10884,
29918,
9917,
653,
353,
10884,
12864,
29889,
479,
29898,
29894,
29896,
29918,
1627,
29889,
17619,
2141,
2083,
29898,
6229,
29922,
29900,
467,
16109,
29898,
29900,
29889,
29900,
29896,
467,
1202,
29898,
29900,
29889,
29900,
29900,
29906,
876,
30004,
13,
30004,
13,
1678,
23279,
353,
4842,
305,
29889,
2873,
3552,
3545,
29892,
2920,
511,
4742,
29922,
10141,
8443,
13,
1678,
23279,
29961,
29885,
8194,
29918,
9917,
653,
29962,
353,
29871,
29900,
30004,
13,
1678,
23279,
29961,
9894,
287,
29962,
353,
448,
29896,
30004,
13,
1678,
23279,
29961,
957,
845,
3155,
29962,
353,
29871,
29900,
30004,
13,
1678,
11105,
353,
323,
29943,
29889,
29887,
17019,
29918,
2204,
332,
29898,
276,
492,
519,
29889,
6948,
802,
29872,
911,
29898,
29900,
511,
29871,
29941,
467,
24049,
29898,
29900,
29892,
29896,
8443,
13,
30004,
13,
1678,
736,
11105,
30004,
13,
30004,
13,
29871,
732,
7959,
5696,
30004,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
679,
29918,
1731,
29898,
3027,
29896,
29892,
1967,
29906,
29892,
4742,
29922,
2287,
19059,
1125,
30004,
13,
1678,
2897,
29889,
305,
3972,
877,
29954,
1529,
1495,
30004,
13,
1678,
1018,
29901,
30004,
13,
418,
2069,
29918,
29954,
1529,
877,
3198,
9748,
29914,
29887,
655,
29899,
29879,
524,
295,
29889,
29886,
386,
1495,
30004,
13,
418,
565,
338,
8758,
29898,
3027,
29896,
29892,
7084,
29889,
2940,
1125,
30004,
13,
4706,
1967,
29896,
353,
323,
29943,
29889,
517,
29918,
20158,
29898,
3027,
29896,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
517,
29898,
10141,
8443,
13,
418,
565,
338,
8758,
29898,
3027,
29906,
29892,
7084,
29889,
2940,
1125,
30004,
13,
4706,
1967,
29906,
353,
323,
29943,
29889,
517,
29918,
20158,
29898,
3027,
29906,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
517,
29898,
10141,
8443,
13,
418,
17132,
672,
353,
10567,
20369,
672,
29898,
3027,
29896,
29889,
12181,
8443,
13,
418,
1967,
29896,
29892,
1967,
29906,
353,
17132,
672,
29889,
8305,
29898,
3027,
29896,
29892,
1967,
29906,
8443,
13,
418,
4972,
29918,
677,
29892,
4972,
29918,
786,
353,
402,
1529,
29898,
3027,
29896,
29892,
1967,
29906,
29892,
372,
414,
29922,
29896,
29906,
29892,
1243,
29918,
8513,
29922,
5574,
8443,
13,
1678,
7146,
29901,
30004,
13,
418,
2897,
29889,
305,
3972,
877,
636,
1495,
30004,
13,
1678,
736,
4972,
29918,
786,
30004,
13,
30004,
13,
29871,
822,
4770,
2344,
12035,
1311,
29892,
752,
29892,
7688,
353,
29871,
29900,
29889,
29945,
29892,
5040,
353,
448,
755,
29889,
7192,
29892,
1024,
353,
376,
11851,
3646,
6410,
613,
1967,
29918,
12181,
353,
6213,
1125,
30004,
13,
1678,
2428,
2141,
1649,
2344,
12035,
2388,
29892,
7688,
29892,
5040,
29892,
1024,
29892,
1967,
29918,
12181,
8443,
13,
1678,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
30004,
13,
418,
1583,
29889,
5066,
296,
29918,
6758,
353,
341,
1660,
29931,
2209,
29898,
2388,
29889,
1482,
29918,
3298,
359,
3552,
29896,
29892,
29896,
29892,
29896,
29892,
29896,
8243,
7688,
29892,
5040,
29892,
1024,
29892,
1967,
29918,
12181,
8443,
13,
418,
1583,
29889,
9573,
29918,
9040,
877,
16264,
29918,
13168,
742,
2388,
29889,
1482,
29918,
3298,
359,
3552,
29896,
29892,
29896,
29892,
29896,
29892,
29896,
4961,
30004,
13,
30004,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
731,
29918,
1731,
29898,
1311,
29892,
3515,
29918,
16304,
29892,
3515,
29918,
4622,
29892,
10153,
29892,
2224,
29892,
5139,
29918,
8513,
353,
525,
3844,
799,
742,
23460,
29918,
8513,
353,
525,
18152,
457,
279,
742,
4742,
353,
5012,
19059,
1125,
30004,
13,
1678,
565,
2224,
338,
451,
6213,
29901,
30004,
13,
418,
10153,
353,
10153,
29889,
16513,
26471,
13,
418,
2106,
29918,
8977,
353,
4842,
305,
29889,
1359,
29898,
2084,
8443,
13,
418,
10153,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3859,
29918,
8977,
8443,
13,
30004,
13,
1678,
330,
29883,
29889,
15914,
26471,
13,
1678,
4842,
305,
29889,
29883,
6191,
29889,
6310,
29918,
8173,
26471,
13,
30004,
13,
1678,
1967,
29896,
353,
323,
29943,
29889,
517,
29918,
20158,
29898,
2557,
29918,
16304,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
517,
29898,
10141,
8443,
13,
1678,
1967,
29906,
353,
323,
29943,
29889,
517,
29918,
20158,
29898,
2557,
29918,
4622,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
517,
29898,
10141,
8443,
13,
30004,
13,
1678,
565,
1583,
29889,
16264,
29918,
13168,
29889,
12181,
14352,
29906,
17531,
2804,
1967,
29896,
29889,
12181,
14352,
29906,
29901,
5387,
30004,
13,
418,
25989,
29918,
13168,
353,
323,
29943,
29889,
21476,
29898,
1311,
29889,
16264,
29918,
13168,
29892,
1967,
29896,
29889,
12181,
14352,
29906,
29901,
2314,
30004,
13,
418,
1583,
29889,
16264,
29918,
13168,
29889,
842,
23538,
16264,
29918,
13168,
8443,
13,
1678,
11462,
353,
4842,
305,
29889,
6310,
29918,
4561,
29898,
3027,
29906,
8443,
13,
1678,
11462,
29889,
8945,
23538,
12676,
353,
29871,
29900,
29892,
3659,
353,
29871,
29900,
29889,
29900,
29945,
8443,
13,
1678,
11462,
29889,
16109,
23538,
1311,
29889,
16264,
29918,
13168,
8443,
13,
1678,
396,
4676,
278,
1021,
11462,
12047,
304,
1716,
4558,
8249,
30004,
13,
1678,
396,
1552,
4972,
1904,
304,
1993,
1906,
5633,
310,
278,
3515,
29892,
17583,
30004,
13,
1678,
396,
2218,
17961,
278,
4972,
297,
1906,
10161,
22993,
13,
1678,
1967,
29896,
29889,
1202,
23538,
1217,
895,
8443,
13,
1678,
1967,
29906,
29889,
1202,
23538,
1217,
895,
8443,
13,
30004,
13,
1678,
396,
289,
4518,
353,
1967,
29906,
29889,
16513,
2141,
29879,
802,
29872,
911,
29898,
29900,
467,
12676,
29898,
6229,
353,
29871,
29900,
8443,
13,
1678,
396,
298,
29892,
281,
353,
289,
4518,
29889,
12181,
30004,
13,
1678,
396,
269,
353,
29871,
29946,
30004,
13,
1678,
396,
289,
4518,
29961,
29879,
13018,
29879,
29892,
29879,
13018,
29879,
29962,
353,
29871,
29900,
30004,
13,
1678,
396,
2099,
353,
289,
4518,
29889,
2083,
2141,
4563,
29898,
29893,
29930,
29882,
448,
313,
29893,
29899,
29906,
29930,
29879,
11877,
29898,
29882,
29899,
29879,
29930,
29906,
876,
30004,
13,
1678,
396,
27292,
353,
1967,
29906,
29889,
4141,
29898,
29900,
29889,
29945,
29897,
565,
2099,
1405,
29871,
29900,
29889,
29945,
1683,
1967,
29906,
29889,
1896,
29898,
29900,
29889,
29945,
8443,
13,
1678,
396,
11462,
353,
4842,
305,
29889,
6310,
29918,
4561,
29898,
3027,
29906,
8443,
13,
1678,
396,
11462,
29889,
8945,
23538,
12676,
353,
29871,
29900,
29892,
3659,
353,
29871,
29900,
29889,
29900,
29945,
8443,
13,
1678,
396,
11462,
29961,
7345,
305,
29889,
1188,
936,
29918,
1333,
29898,
957,
8387,
4638,
353,
29871,
29900,
30004,
13,
1678,
396,
1967,
29896,
29889,
1202,
23538,
1217,
895,
8443,
13,
1678,
396,
1967,
29906,
29889,
1202,
23538,
1217,
895,
8443,
13,
30004,
13,
1678,
4972,
29918,
11333,
353,
20693,
936,
17907,
29931,
2209,
29889,
657,
29918,
1731,
29898,
3027,
29896,
29892,
1967,
29906,
8443,
13,
1678,
4972,
29918,
1627,
1328,
353,
20693,
936,
17907,
29931,
2209,
29889,
657,
29918,
1731,
29898,
3027,
29906,
29892,
1967,
29896,
8443,
13,
1678,
443,
4495,
9795,
29918,
5182,
29918,
11851,
353,
10153,
29889,
13808,
29918,
20158,
26471,
13,
1678,
4972,
29918,
5182,
29918,
11851,
353,
3394,
29918,
1731,
29898,
2492,
29892,
448,
1731,
29918,
1627,
1328,
29892,
5139,
29918,
8513,
353,
5139,
29918,
8513,
29892,
23460,
29918,
8513,
353,
23460,
29918,
8513,
8443,
13,
1678,
6756,
13,
1678,
19231,
29918,
13168,
353,
20693,
936,
17907,
29931,
2209,
29889,
29885,
8194,
29918,
12864,
29918,
1958,
29898,
1731,
29918,
11333,
29892,
4972,
29918,
1627,
1328,
29892,
10153,
29892,
5139,
29918,
8513,
29892,
23460,
29918,
8513,
8443,
13,
1678,
6756,
13,
1678,
3646,
29918,
11851,
353,
4972,
29918,
5182,
29918,
11851,
30004,
13,
1678,
3646,
29918,
5066,
296,
353,
10153,
29889,
657,
29918,
5066,
296,
29918,
20158,
29898,
4801,
496,
353,
5852,
8443,
13,
1678,
11105,
353,
19231,
29918,
13168,
29889,
6948,
802,
29872,
911,
29898,
29900,
8443,
13,
30004,
13,
1678,
1583,
29889,
2388,
29889,
842,
23538,
5182,
29918,
11851,
8443,
13,
1678,
1583,
29889,
5066,
296,
29918,
6758,
29889,
2388,
29889,
842,
23538,
5182,
29918,
5066,
296,
8443,
13,
1678,
1583,
29889,
842,
29918,
1731,
29918,
13168,
29898,
13168,
8443,
13,
30004,
13,
1678,
1409,
353,
4972,
29918,
5182,
29918,
11851,
29889,
29879,
802,
29872,
911,
29898,
29900,
467,
29885,
8238,
326,
29898,
29900,
6653,
29896,
467,
16109,
29898,
29906,
29945,
29945,
467,
695,
1160,
29898,
29900,
29892,
29871,
29906,
29945,
29945,
467,
21970,
2141,
4801,
496,
2141,
23749,
2141,
579,
668,
29898,
9302,
29889,
13470,
29947,
29897,
7503,
29892,
29901,
29892,
17531,
30004,
13,
1678,
736,
7084,
29889,
3166,
2378,
29898,
2378,
511,
19231,
29918,
13168,
30004,
13,
30004,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
731,
29918,
1731,
29918,
13168,
29898,
1311,
29892,
13168,
1125,
30004,
13,
1678,
2428,
2141,
842,
29918,
13168,
29898,
8969,
29889,
21476,
29898,
13168,
29892,
1583,
29889,
2388,
29889,
12181,
14352,
29906,
29901,
12622,
30004,
13,
1678,
565,
11105,
338,
451,
6213,
29901,
30004,
13,
418,
1583,
29889,
5066,
296,
29918,
6758,
29889,
842,
29918,
13168,
29898,
8969,
29889,
21476,
29898,
13168,
29892,
1583,
29889,
5066,
296,
29918,
6758,
29889,
2388,
29889,
12181,
14352,
29906,
29901,
12622,
30004,
13,
1678,
1683,
29901,
30004,
13,
418,
1583,
29889,
5066,
296,
29918,
6758,
29889,
842,
29918,
13168,
29898,
8516,
8443,
13,
30004,
13,
29871,
732,
7345,
305,
29889,
1217,
29918,
5105,
26471,
13,
29871,
822,
731,
29918,
13168,
29898,
1311,
29892,
11105,
29892,
21292,
287,
353,
7700,
29892,
4742,
353,
5012,
19059,
1125,
30004,
13,
1678,
565,
338,
8758,
29898,
13168,
29892,
851,
29897,
322,
11105,
2804,
525,
2396,
30004,
13,
418,
565,
11105,
29961,
29900,
29962,
1275,
17411,
2396,
30004,
13,
4706,
11105,
353,
11105,
29961,
29896,
17531,
30004,
13,
4706,
21292,
287,
353,
5852,
30004,
13,
418,
565,
11105,
29889,
17010,
580,
14352,
29946,
17531,
1275,
15300,
1526,
29946,
2396,
30004,
13,
4706,
364,
353,
9664,
14174,
3372,
29898,
13168,
29892,
1311,
8443,
13,
4706,
364,
29889,
5504,
29898,
29900,
8443,
13,
4706,
736,
30004,
13,
418,
11105,
353,
7084,
29889,
3150,
29898,
9155,
29898,
13168,
8106,
13441,
877,
29931,
1495,
30004,
13,
1678,
565,
338,
8758,
29898,
13168,
29892,
7084,
29889,
2940,
1125,
30004,
13,
418,
411,
325,
2572,
29918,
21125,
29918,
8513,
877,
19832,
29879,
29374,
30004,
13,
4706,
11105,
353,
323,
29943,
29889,
517,
29918,
20158,
29898,
13168,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
517,
29898,
10141,
29892,
3370,
29918,
4830,
353,
4842,
305,
29889,
305,
12629,
29918,
4230,
8443,
13,
1678,
565,
11105,
451,
297,
6024,
742,
8516,
5387,
30004,
13,
418,
396,
1366,
338,
988,
278,
297,
3259,
338,
29889,
910,
11105,
338,
18180,
21292,
287,
4248,
30004,
13,
418,
396,
16076,
372,
27778,
278,
3239,
30004,
13,
418,
1583,
29889,
16264,
29918,
13168,
29889,
842,
23538,
13168,
565,
21292,
287,
1683,
313,
29896,
29899,
13168,
876,
30004,
13,
418,
6756,
13,
29871,
822,
679,
29918,
6758,
29898,
1311,
29892,
1881,
29892,
10153,
1125,
30004,
13,
1678,
301,
29896,
353,
2428,
2141,
657,
29918,
6758,
29898,
2080,
29892,
10153,
8443,
13,
1678,
301,
29906,
353,
1583,
29889,
5066,
296,
29918,
6758,
29889,
657,
29918,
6758,
29898,
2492,
29889,
657,
29918,
5066,
296,
29918,
20158,
3285,
10153,
8443,
13,
1678,
396,
2158,
29898,
7411,
29898,
29880,
29896,
511,
7411,
29898,
29880,
29906,
876,
30004,
13,
1678,
736,
301,
29896,
29974,
29880,
29906,
29930,
2492,
29889,
5066,
296,
29918,
710,
1477,
30004,
13,
30004,
13,
30004,
13,
1678,
6756,
13,
2
] |
pythainlp/corpus/__init__.py | petetanru/pythainlp | 1 | 21571 | # -*- coding: utf-8 -*-
from __future__ import absolute_import,unicode_literals
from pythainlp.tools import get_path_db,get_path_data
from tinydb import TinyDB,Query
from future.moves.urllib.request import urlopen
from tqdm import tqdm
import requests
import os
import math
import requests
from nltk.corpus import names
#__all__ = ["thaipos", "thaiword","alphabet","tone","country","wordnet"]
path_db_=get_path_db()
def get_file(name):
db=TinyDB(path_db_)
temp = Query()
if len(db.search(temp.name==name))>0:
path= get_path_data(db.search(temp.name==name)[0]['file'])
db.close()
if not os.path.exists(path):
download(name)
return path
def download_(url, dst):
"""
@param: url to download file
@param: dst place to put the file
"""
file_size = int(urlopen(url).info().get('Content-Length', -1))
if os.path.exists(dst):
first_byte = os.path.getsize(dst)
else:
first_byte = 0
if first_byte >= file_size:
return file_size
header = {"Range": "bytes=%s-%s" % (first_byte, file_size)}
pbar = tqdm(
total=file_size, initial=first_byte,
unit='B', unit_scale=True, desc=url.split('/')[-1])
req = requests.get(url, headers=header, stream=True)
with(open(get_path_data(dst), 'wb')) as f:
for chunk in req.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
pbar.update(1024)
pbar.close()
#return file_size
def download(name,force=False):
db=TinyDB(path_db_)
temp = Query()
data=requests.get("https://raw.githubusercontent.com/PyThaiNLP/pythainlp-corpus/master/db.json")
data_json=data.json()
if name in list(data_json.keys()):
temp_name=data_json[name]
print("Download : "+name)
if len(db.search(temp.name==name))==0:
print(name+" "+temp_name['version'])
download_(temp_name['download'],temp_name['file_name'])
db.insert({'name': name, 'version': temp_name['version'],'file':temp_name['file_name']})
else:
if len(db.search(temp.name==name and temp.version==temp_name['version']))==0:
print("have update")
print("from "+name+" "+db.search(temp.name==name)[0]['version']+" update to "+name+" "+temp_name['version'])
yes_no="y"
if force==False:
yes_no=str(input("y or n : ")).lower()
if "y"==yes_no:
download_(temp_name['download'],temp_name['file_name'])
db.update({'version':temp_name['version']},temp.name==name)
else:
print("re-download")
print("from "+name+" "+db.search(temp.name==name)[0]['version']+" update to "+name+" "+temp_name['version'])
yes_no="y"
if force==False:
yes_no=str(input("y or n : ")).lower()
if "y"==yes_no:
download_(temp_name['download'],temp_name['file_name'])
db.update({'version':temp_name['version']},temp.name==name)
db.close() | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
2523,
356,
29918,
20889,
1338,
13,
3166,
282,
1541,
475,
22833,
29889,
8504,
1053,
679,
29918,
2084,
29918,
2585,
29892,
657,
29918,
2084,
29918,
1272,
13,
3166,
21577,
2585,
1053,
323,
4901,
4051,
29892,
3010,
13,
3166,
5434,
29889,
13529,
267,
29889,
2271,
1982,
29889,
3827,
1053,
5065,
417,
2238,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
5215,
7274,
13,
5215,
2897,
13,
5215,
5844,
13,
5215,
7274,
13,
3166,
302,
1896,
29895,
29889,
2616,
13364,
1053,
2983,
13,
29937,
1649,
497,
1649,
353,
6796,
15457,
666,
359,
613,
376,
386,
1794,
1742,
3284,
284,
17416,
3284,
29873,
650,
3284,
13509,
3284,
1742,
1212,
3108,
13,
2084,
29918,
2585,
29918,
29922,
657,
29918,
2084,
29918,
2585,
580,
13,
1753,
679,
29918,
1445,
29898,
978,
1125,
13,
1678,
4833,
29922,
29911,
4901,
4051,
29898,
2084,
29918,
2585,
19925,
13,
1678,
5694,
353,
13641,
580,
13,
1678,
565,
7431,
29898,
2585,
29889,
4478,
29898,
7382,
29889,
978,
1360,
978,
876,
29958,
29900,
29901,
13,
4706,
2224,
29922,
679,
29918,
2084,
29918,
1272,
29898,
2585,
29889,
4478,
29898,
7382,
29889,
978,
1360,
978,
9601,
29900,
22322,
1445,
11287,
13,
4706,
4833,
29889,
5358,
580,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
2084,
1125,
13,
9651,
5142,
29898,
978,
29897,
13,
4706,
736,
2224,
13,
1753,
5142,
23538,
2271,
29892,
29743,
1125,
13,
1678,
9995,
13,
1678,
732,
3207,
29901,
3142,
304,
5142,
934,
13,
1678,
732,
3207,
29901,
29743,
2058,
304,
1925,
278,
934,
13,
1678,
9995,
13,
1678,
934,
29918,
2311,
353,
938,
29898,
332,
417,
2238,
29898,
2271,
467,
3888,
2141,
657,
877,
3916,
29899,
6513,
742,
448,
29896,
876,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
22992,
1125,
13,
4706,
937,
29918,
10389,
353,
2897,
29889,
2084,
29889,
657,
2311,
29898,
22992,
29897,
13,
1678,
1683,
29901,
13,
4706,
937,
29918,
10389,
353,
29871,
29900,
13,
1678,
565,
937,
29918,
10389,
6736,
934,
29918,
2311,
29901,
13,
4706,
736,
934,
29918,
2311,
13,
1678,
4839,
353,
8853,
6069,
1115,
376,
13193,
16328,
29879,
19222,
29879,
29908,
1273,
313,
4102,
29918,
10389,
29892,
934,
29918,
2311,
2915,
13,
1678,
282,
1646,
353,
260,
29939,
18933,
29898,
13,
4706,
3001,
29922,
1445,
29918,
2311,
29892,
2847,
29922,
4102,
29918,
10389,
29892,
13,
4706,
5190,
2433,
29933,
742,
5190,
29918,
7052,
29922,
5574,
29892,
5153,
29922,
2271,
29889,
5451,
11219,
1495,
14352,
29896,
2314,
13,
1678,
12428,
353,
7274,
29889,
657,
29898,
2271,
29892,
9066,
29922,
6672,
29892,
4840,
29922,
5574,
29897,
13,
1678,
411,
29898,
3150,
29898,
657,
29918,
2084,
29918,
1272,
29898,
22992,
511,
525,
29893,
29890,
8785,
408,
285,
29901,
13,
4706,
363,
19875,
297,
12428,
29889,
1524,
29918,
3051,
29898,
29812,
29918,
2311,
29922,
29896,
29900,
29906,
29946,
1125,
13,
9651,
565,
19875,
29901,
13,
18884,
285,
29889,
3539,
29898,
29812,
29897,
13,
18884,
282,
1646,
29889,
5504,
29898,
29896,
29900,
29906,
29946,
29897,
13,
1678,
282,
1646,
29889,
5358,
580,
13,
1678,
396,
2457,
934,
29918,
2311,
13,
1753,
5142,
29898,
978,
29892,
10118,
29922,
8824,
1125,
13,
1678,
4833,
29922,
29911,
4901,
4051,
29898,
2084,
29918,
2585,
19925,
13,
1678,
5694,
353,
13641,
580,
13,
1678,
848,
29922,
24830,
29889,
657,
703,
991,
597,
1610,
29889,
3292,
1792,
3051,
29889,
510,
29914,
19737,
1349,
1794,
29940,
13208,
29914,
29886,
1541,
475,
22833,
29899,
2616,
13364,
29914,
6207,
29914,
2585,
29889,
3126,
1159,
13,
1678,
848,
29918,
3126,
29922,
1272,
29889,
3126,
580,
13,
1678,
565,
1024,
297,
1051,
29898,
1272,
29918,
3126,
29889,
8149,
580,
1125,
13,
4706,
5694,
29918,
978,
29922,
1272,
29918,
3126,
29961,
978,
29962,
13,
4706,
1596,
703,
22954,
584,
15691,
978,
29897,
13,
4706,
565,
7431,
29898,
2585,
29889,
4478,
29898,
7382,
29889,
978,
1360,
978,
876,
1360,
29900,
29901,
13,
9651,
1596,
29898,
978,
13578,
15691,
7382,
29918,
978,
1839,
3259,
11287,
13,
9651,
5142,
23538,
7382,
29918,
978,
1839,
10382,
7464,
7382,
29918,
978,
1839,
1445,
29918,
978,
11287,
13,
9651,
4833,
29889,
7851,
3319,
29915,
978,
2396,
1024,
29892,
525,
3259,
2396,
5694,
29918,
978,
1839,
3259,
7464,
29915,
1445,
2396,
7382,
29918,
978,
1839,
1445,
29918,
978,
2033,
1800,
13,
4706,
1683,
29901,
13,
9651,
565,
7431,
29898,
2585,
29889,
4478,
29898,
7382,
29889,
978,
1360,
978,
322,
5694,
29889,
3259,
1360,
7382,
29918,
978,
1839,
3259,
25901,
1360,
29900,
29901,
13,
18884,
1596,
703,
17532,
2767,
1159,
13,
18884,
1596,
703,
3166,
15691,
978,
13578,
15691,
2585,
29889,
4478,
29898,
7382,
29889,
978,
1360,
978,
9601,
29900,
22322,
3259,
2033,
13578,
2767,
304,
15691,
978,
13578,
15691,
7382,
29918,
978,
1839,
3259,
11287,
13,
18884,
4874,
29918,
1217,
543,
29891,
29908,
13,
18884,
565,
4889,
1360,
8824,
29901,
13,
462,
1678,
4874,
29918,
1217,
29922,
710,
29898,
2080,
703,
29891,
470,
302,
584,
376,
8106,
13609,
580,
13,
18884,
565,
376,
29891,
29908,
1360,
3582,
29918,
1217,
29901,
13,
462,
1678,
5142,
23538,
7382,
29918,
978,
1839,
10382,
7464,
7382,
29918,
978,
1839,
1445,
29918,
978,
11287,
13,
462,
1678,
4833,
29889,
5504,
3319,
29915,
3259,
2396,
7382,
29918,
978,
1839,
3259,
2033,
1118,
7382,
29889,
978,
1360,
978,
29897,
13,
9651,
1683,
29901,
13,
18884,
1596,
703,
276,
29899,
10382,
1159,
13,
18884,
1596,
703,
3166,
15691,
978,
13578,
15691,
2585,
29889,
4478,
29898,
7382,
29889,
978,
1360,
978,
9601,
29900,
22322,
3259,
2033,
13578,
2767,
304,
15691,
978,
13578,
15691,
7382,
29918,
978,
1839,
3259,
11287,
13,
18884,
4874,
29918,
1217,
543,
29891,
29908,
13,
18884,
565,
4889,
1360,
8824,
29901,
13,
462,
1678,
4874,
29918,
1217,
29922,
710,
29898,
2080,
703,
29891,
470,
302,
584,
376,
8106,
13609,
580,
13,
18884,
565,
376,
29891,
29908,
1360,
3582,
29918,
1217,
29901,
13,
462,
1678,
5142,
23538,
7382,
29918,
978,
1839,
10382,
7464,
7382,
29918,
978,
1839,
1445,
29918,
978,
11287,
13,
462,
1678,
4833,
29889,
5504,
3319,
29915,
3259,
2396,
7382,
29918,
978,
1839,
3259,
2033,
1118,
7382,
29889,
978,
1360,
978,
29897,
13,
1678,
4833,
29889,
5358,
580,
2
] |
paper/figures/make_photometry_table.py | abostroem/asassn15oz | 0 | 39479 | <reponame>abostroem/asassn15oz
# coding: utf-8
# Creates a table of all imaging observations in the database for paper:
# * lc_obs.tex
# In[1]:
import numpy as np
from astropy import table
from astropy.table import Table
from astropy.time import Time
from utilities_az import supernova, connect_to_sndavis
# In[2]:
db, cursor = connect_to_sndavis.get_cursor()
# In[3]:
sn15oz = supernova.LightCurve2('asassn-15oz')
# In[4]:
query_str = '''
SELECT DISTINCT mag, magerr, BINARY(filter), jd, source
FROM photometry
WHERE targetid = 322
ORDER BY jd'''
# In[5]:
cursor.execute(query_str)
results = cursor.fetchall()
# In[6]:
loc_dict = {
1: {'short':'OGG 2m', 'long': 'Haleakala Observatory - 2m'}, #ogg2m001-fs02 2m0
2: {'short':'COJ 2m', 'long': 'Siding Springs Observatory - 2m'}, #coj2m002-fs03
3: {'short':'COJ 1m', 'long': 'Siding Springs Observatory - 1m'}, #coj1m003-kb71
4: {'short':'LSC 1m', 'long': 'CTIO - Region IV'}, #lsc1m004-kb77 1m0
5: {'short':'LSC 1m', 'long': 'CTIO - Region IV'}, #lsc1m005-kb78 1m0
8: {'short':'ELP 1m', 'long': 'McDonald Observatory - 1m'},#elp1m008-kb74 1m0
9: {'short':'LSC 1m', 'long': 'CTIO - Region IV'}, #lsc1m009-fl03 1m0
10: {'short': 'CPT 1m', 'long': 'SAAO - Sutherland Facilities - 1m'}, #cpt1m010
11: {'short': 'COJ 1m', 'long': 'Siding Springs Observatory - 1m'}, #coj1m011-kb05 1m0
12: {'short': 'CPT 1m', 'long': 'SAAO - Sutherland Facilities - 1m'}, #cpt1m012-kb75 1m0
13: {'short': 'CPT 1m', 'long': 'SAAO - Sutherland Facilities - 1m '},#cpt1m013-kb76 1m0
88: {'short': 'Swift', 'long': 'Swift'}, #Swift
-88: {'short': 'Swift', 'long': 'Swift'}} #Swift; non-detections in the DB have negative sources
# In[7]:
band = []
jd = []
date = []
mag = []
mag_err = []
source = []
phase = []
for iresult in results:
#rename the Swift filters to their proper names
ifilter = iresult['BINARY(filter)']
if ifilter in [b'us', b'bs', b'vs']:
band.append(ifilter.decode('utf-8')[0])
elif ifilter in [b'uw1', b'uw2', b'um2']:
band.append('uv'+ifilter.decode('utf-8')[1:])
else:
band.append(ifilter)
jd.append(iresult['jd'])
mag.append(iresult['mag'])
mag_err.append(iresult['magerr'])
if ifilter in [b'J', b'H', b'K']:
source.append('NTT')
else:
source.append(loc_dict[iresult['source']]['short'])
date.append(Time(iresult['jd'], format='jd', out_subfmt='date').iso)
phase.append((Time(iresult['jd'], format='jd') - Time(sn15oz.jdexpl, format='jd')).value)
tbdata = Table([date, jd, phase, mag, mag_err, band, source],
names=['Date-Obs','JD', 'Phase (Day)',
'Apparent Magnitude',
'Apparent Magnitude Error',
'Filter',
'Source'])
tbdata.sort(keys=['JD', 'Filter'])
# In[8]:
#tbdata.write('../lc_obs.tex', format='aastex',
# formats={'JD':'%8.2f',
# 'Phase (Day)':'%4.2f',
# 'Apparent Magnitude':'%2.2f',
# 'Apparent Magnitude Error': '%1.2f'}, overwrite=True,
# latexdict={'preamble':r'\centering',
# 'caption':r'Imaging Observations of ASASSN-15oz.\label{tab:LcObs}',
# 'data_start':r'\hline'})
# In[9]:
tbdata_short = tbdata[0:5].copy()
tbdata_short.write('../lc_obs_short.tex', format='latex',
formats={'JD':'%8.2f',
'Phase (Day)':'%4.2f',
'Apparent Magnitude':'%2.2f',
'Apparent Magnitude Error': '%1.2f'}, overwrite=True,
latexdict={'preamble':r'\centering',
'caption':r'Sample of Imaging Observations of ASASSN-15oz. Full table available on-line.\label{tab:LcObs}',
'data_start':r'\hline',
'data_end':r'\hline',
'header_start':r'\hline',
'tabletype': 'table*'})
# In[10]:
#tbdata.write('../lc_obs.dat', overwrite=True, format='ascii')
#ofile = open('../lc_obs.dat', 'r')
#all_lines = ofile.readlines()
#ofile.close()
#header = '''#Photometric observations of ASASSN-15oz.
##Columns:
##Date-Obs: (str) Human readable date of observation
##JD: (float) Julian Date of observation
##Phase: (float) Days since explosion, where explosion is defined as {}
##Apparent Magnitude: (float)
##Apparent Magntidue Error: (float)
##Filter: (str) Filter used for observation
##Source: (str) Observatory used to take the data. OGG, COJ, LSC, ELP, and CPT are Las Cumbres Observatory Telescopes.\n
#'''.format(sn15oz.jdexpl)
#ofile = open('../asassn15oz_lc_obs.dat', 'w')
#ofile.write(header)
#for iline in all_lines[1:]:
# ofile.write(iline)
#ofile.close()
# In[11]:
tbdata.write('../lc_obs.csv', overwrite=True)
ofile = open('../lc_obs.csv', 'r')
all_lines = ofile.readlines()
ofile.close()
header = '''#Photometric observations of ASASSN-15oz.
#Columns:
#Date-Obs: (str) Human readable date of observation
#JD: (float) Julian Date of observation
#Phase: (float) Days since explosion, where explosion is defined as {}
#Apparent Magnitude: (float)
#Apparent Magntidue Error: (float)
#Filter: (str) Filter used for observation
#Source: (str) Observatory used to take the data. OGG, COJ, LSC, ELP, and CPT are Las Cumbres Observatory Telescopes.\n
'''.format(sn15oz.jdexpl)
ofile = open('../asassn15oz_lc_obs.csv', 'w')
ofile.write(header)
for iline in all_lines[1:]:
ofile.write(iline)
ofile.close()
| [
1,
529,
276,
1112,
420,
29958,
370,
520,
307,
331,
29914,
294,
465,
29876,
29896,
29945,
2112,
13,
29871,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
13,
29937,
6760,
1078,
263,
1591,
310,
599,
6382,
292,
13917,
297,
278,
2566,
363,
5650,
29901,
13,
29937,
334,
301,
29883,
29918,
26290,
29889,
4776,
13,
13,
29871,
13,
29937,
512,
29961,
29896,
5387,
13,
13,
13,
5215,
12655,
408,
7442,
13,
3166,
8717,
14441,
1053,
1591,
13,
3166,
8717,
14441,
29889,
2371,
1053,
6137,
13,
3166,
8717,
14441,
29889,
2230,
1053,
5974,
13,
13,
3166,
3667,
1907,
29918,
834,
1053,
2428,
29876,
4273,
29892,
4511,
29918,
517,
29918,
29879,
299,
485,
275,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29906,
5387,
13,
13,
13,
2585,
29892,
10677,
353,
4511,
29918,
517,
29918,
29879,
299,
485,
275,
29889,
657,
29918,
18127,
580,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29941,
5387,
13,
13,
13,
16586,
29896,
29945,
2112,
353,
2428,
29876,
4273,
29889,
20769,
23902,
345,
29906,
877,
294,
465,
29876,
29899,
29896,
29945,
2112,
1495,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29946,
5387,
13,
13,
13,
1972,
29918,
710,
353,
14550,
13,
6404,
360,
9047,
28852,
2320,
29892,
286,
1875,
29878,
29892,
350,
1177,
19926,
29898,
4572,
511,
432,
29881,
29892,
2752,
29871,
13,
21482,
6731,
7843,
29871,
13,
22043,
3646,
333,
353,
29871,
29941,
29906,
29906,
13,
22364,
6770,
432,
29881,
12008,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29945,
5387,
13,
13,
13,
18127,
29889,
7978,
29898,
1972,
29918,
710,
29897,
13,
9902,
353,
10677,
29889,
9155,
497,
580,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29953,
5387,
13,
13,
13,
2029,
29918,
8977,
353,
426,
13,
29896,
29901,
11117,
12759,
22099,
29949,
26788,
29871,
29906,
29885,
742,
525,
5426,
2396,
525,
29950,
744,
557,
2883,
21651,
7606,
448,
29871,
29906,
29885,
16675,
396,
468,
29887,
29906,
29885,
29900,
29900,
29896,
29899,
5847,
29900,
29906,
1678,
29906,
29885,
29900,
13,
29906,
29901,
11117,
12759,
22099,
3217,
29967,
29871,
29906,
29885,
742,
525,
5426,
2396,
525,
29903,
4821,
14314,
886,
21651,
7606,
448,
29871,
29906,
29885,
16675,
29871,
396,
1111,
29926,
29906,
29885,
29900,
29900,
29906,
29899,
5847,
29900,
29941,
13,
29941,
29901,
11117,
12759,
22099,
3217,
29967,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
29903,
4821,
14314,
886,
21651,
7606,
448,
29871,
29896,
29885,
16675,
29871,
396,
1111,
29926,
29896,
29885,
29900,
29900,
29941,
29899,
21066,
29955,
29896,
13,
29946,
29901,
11117,
12759,
22099,
29931,
7187,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
1783,
5971,
448,
11069,
6599,
16675,
396,
29880,
1557,
29896,
29885,
29900,
29900,
29946,
29899,
21066,
29955,
29955,
29871,
29896,
29885,
29900,
13,
29945,
29901,
11117,
12759,
22099,
29931,
7187,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
1783,
5971,
448,
11069,
6599,
16675,
396,
29880,
1557,
29896,
29885,
29900,
29900,
29945,
29899,
21066,
29955,
29947,
29871,
29896,
29885,
29900,
13,
29947,
29901,
11117,
12759,
22099,
6670,
29925,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
27297,
28080,
21651,
7606,
448,
29871,
29896,
29885,
16675,
29937,
295,
29886,
29896,
29885,
29900,
29900,
29947,
29899,
21066,
29955,
29946,
29871,
29896,
29885,
29900,
13,
29929,
29901,
11117,
12759,
22099,
29931,
7187,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
1783,
5971,
448,
11069,
6599,
16675,
396,
29880,
1557,
29896,
29885,
29900,
29900,
29929,
29899,
1579,
29900,
29941,
29871,
29896,
29885,
29900,
13,
29896,
29900,
29901,
11117,
12759,
2396,
525,
6271,
29911,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
29903,
6344,
29949,
448,
317,
14107,
1049,
14184,
9770,
448,
29871,
29896,
29885,
16675,
396,
29883,
415,
29896,
29885,
29900,
29896,
29900,
13,
29896,
29896,
29901,
11117,
12759,
2396,
525,
3217,
29967,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
29903,
4821,
14314,
886,
21651,
7606,
448,
29871,
29896,
29885,
16675,
396,
1111,
29926,
29896,
29885,
29900,
29896,
29896,
29899,
21066,
29900,
29945,
29871,
29896,
29885,
29900,
13,
29896,
29906,
29901,
11117,
12759,
2396,
525,
6271,
29911,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
29903,
6344,
29949,
448,
317,
14107,
1049,
14184,
9770,
448,
29871,
29896,
29885,
16675,
396,
29883,
415,
29896,
29885,
29900,
29896,
29906,
29899,
21066,
29955,
29945,
29871,
29896,
29885,
29900,
13,
29896,
29941,
29901,
11117,
12759,
2396,
525,
6271,
29911,
29871,
29896,
29885,
742,
525,
5426,
2396,
525,
29903,
6344,
29949,
448,
317,
14107,
1049,
14184,
9770,
448,
29871,
29896,
29885,
525,
1118,
29937,
29883,
415,
29896,
29885,
29900,
29896,
29941,
29899,
21066,
29955,
29953,
29871,
29896,
29885,
29900,
13,
29947,
29947,
29901,
11117,
12759,
2396,
525,
10840,
2027,
742,
525,
5426,
2396,
525,
10840,
2027,
16675,
396,
10840,
2027,
13,
29899,
29947,
29947,
29901,
11117,
12759,
2396,
525,
10840,
2027,
742,
525,
5426,
2396,
525,
10840,
2027,
29915,
930,
396,
10840,
2027,
29936,
1661,
29899,
29881,
2650,
1953,
297,
278,
6535,
505,
8178,
8974,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29955,
5387,
13,
13,
13,
4980,
353,
5159,
13,
26012,
353,
5159,
13,
1256,
353,
5159,
13,
11082,
353,
5159,
13,
11082,
29918,
3127,
353,
5159,
13,
4993,
353,
5159,
13,
21646,
353,
5159,
13,
1454,
29871,
2658,
499,
297,
2582,
29901,
13,
1678,
396,
1267,
420,
278,
14156,
18094,
304,
1009,
1571,
2983,
13,
1678,
565,
309,
357,
353,
29871,
2658,
499,
1839,
29933,
1177,
19926,
29898,
4572,
29897,
2033,
13,
1678,
565,
565,
309,
357,
297,
518,
29890,
29915,
375,
742,
289,
29915,
5824,
742,
289,
29915,
4270,
2033,
29901,
13,
4706,
3719,
29889,
4397,
29898,
361,
309,
357,
29889,
13808,
877,
9420,
29899,
29947,
29861,
29900,
2314,
13,
1678,
25342,
565,
309,
357,
297,
518,
29890,
29915,
7262,
29896,
742,
289,
29915,
7262,
29906,
742,
289,
29915,
398,
29906,
2033,
29901,
13,
4706,
3719,
29889,
4397,
877,
4090,
18717,
361,
309,
357,
29889,
13808,
877,
9420,
29899,
29947,
29861,
29896,
29901,
2314,
13,
1678,
1683,
29901,
13,
4706,
3719,
29889,
4397,
29898,
361,
309,
357,
29897,
13,
1678,
432,
29881,
29889,
4397,
29898,
2658,
499,
1839,
26012,
11287,
13,
1678,
2320,
29889,
4397,
29898,
2658,
499,
1839,
11082,
11287,
13,
1678,
2320,
29918,
3127,
29889,
4397,
29898,
2658,
499,
1839,
29885,
1875,
29878,
11287,
13,
1678,
565,
565,
309,
357,
297,
518,
29890,
29915,
29967,
742,
289,
29915,
29950,
742,
289,
29915,
29968,
2033,
29901,
13,
4706,
2752,
29889,
4397,
877,
29940,
19988,
1495,
13,
1678,
1683,
29901,
13,
4706,
2752,
29889,
4397,
29898,
2029,
29918,
8977,
29961,
2658,
499,
1839,
4993,
2033,
22322,
12759,
11287,
13,
1678,
2635,
29889,
4397,
29898,
2481,
29898,
2658,
499,
1839,
26012,
7464,
3402,
2433,
26012,
742,
714,
29918,
1491,
23479,
2433,
1256,
2824,
10718,
29897,
13,
1678,
8576,
29889,
4397,
3552,
2481,
29898,
2658,
499,
1839,
26012,
7464,
3402,
2433,
26012,
1495,
448,
5974,
29898,
16586,
29896,
29945,
2112,
29889,
29926,
1390,
572,
29892,
3402,
2433,
26012,
1495,
467,
1767,
29897,
13,
22625,
1272,
353,
6137,
4197,
1256,
29892,
432,
29881,
29892,
8576,
29892,
2320,
29892,
2320,
29918,
3127,
29892,
3719,
29892,
2752,
1402,
29871,
13,
1669,
2983,
29922,
1839,
2539,
29899,
29949,
5824,
3788,
29967,
29928,
742,
525,
4819,
559,
313,
12742,
29897,
742,
13,
462,
418,
525,
2052,
279,
296,
19975,
4279,
742,
29871,
13,
462,
418,
525,
2052,
279,
296,
19975,
4279,
4829,
742,
29871,
13,
462,
418,
525,
5072,
742,
29871,
13,
462,
418,
525,
4435,
11287,
13,
22625,
1272,
29889,
6605,
29898,
8149,
29922,
1839,
29967,
29928,
742,
525,
5072,
11287,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29947,
5387,
13,
13,
13,
29937,
22625,
1272,
29889,
3539,
877,
6995,
29880,
29883,
29918,
26290,
29889,
4776,
742,
3402,
2433,
29874,
4350,
29916,
742,
29871,
13,
29937,
632,
21971,
3790,
29915,
29967,
29928,
22099,
29995,
29947,
29889,
29906,
29888,
742,
29871,
13,
29937,
462,
418,
525,
4819,
559,
313,
12742,
29897,
22099,
29995,
29946,
29889,
29906,
29888,
742,
13,
29937,
462,
418,
525,
2052,
279,
296,
19975,
4279,
22099,
29995,
29906,
29889,
29906,
29888,
742,
13,
29937,
462,
418,
525,
2052,
279,
296,
19975,
4279,
4829,
2396,
14210,
29896,
29889,
29906,
29888,
16675,
26556,
29922,
5574,
29892,
13,
29937,
9651,
5683,
29916,
8977,
3790,
29915,
1457,
314,
569,
2396,
29878,
12764,
9525,
742,
13,
29937,
462,
539,
525,
6671,
2396,
29878,
29915,
1888,
6751,
21651,
800,
310,
3339,
29909,
13429,
29899,
29896,
29945,
2112,
7790,
1643,
29912,
3891,
29901,
29931,
29883,
29949,
5824,
29913,
742,
13,
29937,
462,
539,
525,
1272,
29918,
2962,
2396,
29878,
12764,
7760,
29915,
1800,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29929,
5387,
13,
13,
13,
22625,
1272,
29918,
12759,
353,
260,
29890,
1272,
29961,
29900,
29901,
29945,
1822,
8552,
580,
13,
22625,
1272,
29918,
12759,
29889,
3539,
877,
6995,
29880,
29883,
29918,
26290,
29918,
12759,
29889,
4776,
742,
3402,
2433,
25694,
742,
29871,
13,
632,
21971,
3790,
29915,
29967,
29928,
22099,
29995,
29947,
29889,
29906,
29888,
742,
29871,
13,
462,
418,
525,
4819,
559,
313,
12742,
29897,
22099,
29995,
29946,
29889,
29906,
29888,
742,
13,
462,
418,
525,
2052,
279,
296,
19975,
4279,
22099,
29995,
29906,
29889,
29906,
29888,
742,
13,
462,
418,
525,
2052,
279,
296,
19975,
4279,
4829,
2396,
14210,
29896,
29889,
29906,
29888,
16675,
26556,
29922,
5574,
29892,
13,
9651,
5683,
29916,
8977,
3790,
29915,
1457,
314,
569,
2396,
29878,
12764,
9525,
742,
13,
462,
539,
525,
6671,
2396,
29878,
29915,
17708,
310,
1954,
6751,
21651,
800,
310,
3339,
29909,
13429,
29899,
29896,
29945,
2112,
29889,
14846,
1591,
3625,
373,
29899,
1220,
7790,
1643,
29912,
3891,
29901,
29931,
29883,
29949,
5824,
29913,
742,
13,
462,
539,
525,
1272,
29918,
2962,
2396,
29878,
12764,
7760,
742,
13,
462,
539,
525,
1272,
29918,
355,
2396,
29878,
12764,
7760,
742,
13,
462,
539,
525,
6672,
29918,
2962,
2396,
29878,
12764,
7760,
742,
13,
462,
539,
525,
2371,
1853,
2396,
525,
2371,
29930,
29915,
1800,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29896,
29900,
5387,
13,
13,
13,
29937,
22625,
1272,
29889,
3539,
877,
6995,
29880,
29883,
29918,
26290,
29889,
4130,
742,
29871,
26556,
29922,
5574,
29892,
3402,
2433,
294,
18869,
1495,
13,
29937,
974,
488,
353,
1722,
877,
6995,
29880,
29883,
29918,
26290,
29889,
4130,
742,
525,
29878,
1495,
13,
29937,
497,
29918,
9012,
353,
310,
488,
29889,
949,
9012,
580,
13,
29937,
974,
488,
29889,
5358,
580,
13,
29937,
6672,
353,
14550,
29937,
4819,
327,
14066,
13917,
310,
3339,
29909,
13429,
29899,
29896,
29945,
2112,
29889,
13,
2277,
14289,
29901,
13,
2277,
2539,
29899,
29949,
5824,
29901,
313,
710,
29897,
12968,
19909,
2635,
310,
15500,
13,
2277,
29967,
29928,
29901,
313,
7411,
29897,
27180,
4712,
310,
15500,
13,
2277,
4819,
559,
29901,
313,
7411,
29897,
24728,
1951,
20389,
291,
29892,
988,
20389,
291,
338,
3342,
408,
6571,
13,
2277,
2052,
279,
296,
19975,
4279,
29901,
313,
7411,
29897,
13,
2277,
2052,
279,
296,
3561,
593,
333,
434,
4829,
29901,
313,
7411,
29897,
13,
2277,
5072,
29901,
313,
710,
29897,
19916,
1304,
363,
15500,
13,
2277,
4435,
29901,
313,
710,
29897,
21651,
7606,
1304,
304,
2125,
278,
848,
29889,
438,
26788,
29892,
4810,
29967,
29892,
365,
7187,
29892,
29871,
382,
13208,
29892,
322,
315,
7982,
526,
7413,
315,
3774,
690,
21651,
7606,
323,
5830,
9708,
267,
7790,
29876,
13,
29937,
4907,
4286,
4830,
29898,
16586,
29896,
29945,
2112,
29889,
29926,
1390,
572,
29897,
13,
29937,
974,
488,
353,
1722,
877,
6995,
294,
465,
29876,
29896,
29945,
2112,
29918,
29880,
29883,
29918,
26290,
29889,
4130,
742,
525,
29893,
1495,
13,
29937,
974,
488,
29889,
3539,
29898,
6672,
29897,
13,
29937,
1454,
980,
457,
297,
599,
29918,
9012,
29961,
29896,
29901,
5387,
13,
29937,
1678,
310,
488,
29889,
3539,
29898,
309,
457,
29897,
13,
29937,
974,
488,
29889,
5358,
580,
13,
13,
13,
29871,
13,
29871,
13,
29937,
512,
29961,
29896,
29896,
5387,
13,
13,
13,
22625,
1272,
29889,
3539,
877,
6995,
29880,
29883,
29918,
26290,
29889,
7638,
742,
29871,
26556,
29922,
5574,
29897,
13,
974,
488,
353,
1722,
877,
6995,
29880,
29883,
29918,
26290,
29889,
7638,
742,
525,
29878,
1495,
13,
497,
29918,
9012,
353,
310,
488,
29889,
949,
9012,
580,
13,
974,
488,
29889,
5358,
580,
13,
6672,
353,
14550,
29937,
4819,
327,
14066,
13917,
310,
3339,
29909,
13429,
29899,
29896,
29945,
2112,
29889,
13,
29937,
14289,
29901,
13,
29937,
2539,
29899,
29949,
5824,
29901,
313,
710,
29897,
12968,
19909,
2635,
310,
15500,
13,
29937,
29967,
29928,
29901,
313,
7411,
29897,
27180,
4712,
310,
15500,
13,
29937,
4819,
559,
29901,
313,
7411,
29897,
24728,
1951,
20389,
291,
29892,
988,
20389,
291,
338,
3342,
408,
6571,
13,
29937,
2052,
279,
296,
19975,
4279,
29901,
313,
7411,
29897,
13,
29937,
2052,
279,
296,
3561,
593,
333,
434,
4829,
29901,
313,
7411,
29897,
13,
29937,
5072,
29901,
313,
710,
29897,
19916,
1304,
363,
15500,
13,
29937,
4435,
29901,
313,
710,
29897,
21651,
7606,
1304,
304,
2125,
278,
848,
29889,
438,
26788,
29892,
4810,
29967,
29892,
365,
7187,
29892,
29871,
382,
13208,
29892,
322,
315,
7982,
526,
7413,
315,
3774,
690,
21651,
7606,
323,
5830,
9708,
267,
7790,
29876,
13,
4907,
4286,
4830,
29898,
16586,
29896,
29945,
2112,
29889,
29926,
1390,
572,
29897,
13,
974,
488,
353,
1722,
877,
6995,
294,
465,
29876,
29896,
29945,
2112,
29918,
29880,
29883,
29918,
26290,
29889,
7638,
742,
525,
29893,
1495,
13,
974,
488,
29889,
3539,
29898,
6672,
29897,
13,
1454,
980,
457,
297,
599,
29918,
9012,
29961,
29896,
29901,
5387,
13,
1678,
310,
488,
29889,
3539,
29898,
309,
457,
29897,
13,
974,
488,
29889,
5358,
580,
13,
13,
13,
29871,
2
] |
datasets/few_shot_test_pickle.py | PengWan-Yang/few-shot-transformer | 4 | 23240 | <filename>datasets/few_shot_test_pickle.py
import pickle
# modify validation data
_few_shot_pickle_file = 'few_shot_test_data.pkl'
_few_shot_file = open(_few_shot_pickle_file, 'rb')
data_few_shot = pickle.load(_few_shot_file)
_few_shot_pickle_file = 'few_shot_val_data.pkl'
_few_shot_file = open(_few_shot_pickle_file, 'rb')
data_val = pickle.load(_few_shot_file)
_few_shot_pickle_file = 'few_shot_train_data.pkl'
_few_shot_file = open(_few_shot_pickle_file, 'rb')
data_train = pickle.load(_few_shot_file)
raise 1
for _list in data_few_shot:
for _video in _list:
_video['fg_name'] = _video['fg_name'].replace('/home/tao/dataset/v1-3/train_val_frames_3',
'datasets/activitynet13')
_video['bg_name'] = _video['bg_name'].replace('/home/tao/dataset/v1-3/train_val_frames_3',
'datasets/activitynet13')
pickle.dump(data_few_shot, open(_few_shot_pickle_file, "wb"))
print("done")
# modify testing data
_few_shot_pickle_file = 'few_shot_test_data.pkl'
_few_shot_file = open(_few_shot_pickle_file, 'rb')
data_few_shot = pickle.load(_few_shot_file)
for _list in data_few_shot:
for _video in _list:
_video['fg_name'] = _video['fg_name'].replace('/home/tao/dataset/v1-3/train_val_frames_3',
'datasets/activitynet13')
_video['bg_name'] = _video['bg_name'].replace('/home/tao/dataset/v1-3/train_val_frames_3',
'datasets/activitynet13')
pickle.dump(data_few_shot, open(_few_shot_pickle_file, "wb"))
print("done")
# modify training data
_few_shot_pickle_file = 'few_shot_train_data.pkl'
_few_shot_file = open(_few_shot_pickle_file, 'rb')
data_few_shot = pickle.load(_few_shot_file)
index = 0
for k, _list in data_few_shot.items():
for _video in _list:
_video['video_id'] = "query_{:0>5d}".format(index)
_video['fg_name'] = _video['fg_name'].replace('dataset/activitynet13/train_val_frames_3',
'datasets/activitynet13')
_video['bg_name'] = _video['bg_name'].replace('dataset/activitynet13/train_val_frames_3',
'datasets/activitynet13')
index = index + 1
pickle.dump(data_few_shot, open(_few_shot_pickle_file, "wb"))
print("done")
| [
1,
529,
9507,
29958,
14538,
1691,
29914,
29888,
809,
29918,
8962,
29918,
1688,
29918,
23945,
280,
29889,
2272,
13,
13,
13,
5215,
5839,
280,
13,
13,
29937,
6623,
8845,
848,
13,
13,
29918,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
353,
525,
29888,
809,
29918,
8962,
29918,
1688,
29918,
1272,
29889,
29886,
6321,
29915,
13,
29918,
29888,
809,
29918,
8962,
29918,
1445,
353,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
525,
6050,
1495,
13,
1272,
29918,
29888,
809,
29918,
8962,
353,
5839,
280,
29889,
1359,
7373,
29888,
809,
29918,
8962,
29918,
1445,
29897,
13,
13,
29918,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
353,
525,
29888,
809,
29918,
8962,
29918,
791,
29918,
1272,
29889,
29886,
6321,
29915,
13,
29918,
29888,
809,
29918,
8962,
29918,
1445,
353,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
525,
6050,
1495,
13,
1272,
29918,
791,
353,
5839,
280,
29889,
1359,
7373,
29888,
809,
29918,
8962,
29918,
1445,
29897,
13,
13,
29918,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
353,
525,
29888,
809,
29918,
8962,
29918,
14968,
29918,
1272,
29889,
29886,
6321,
29915,
13,
29918,
29888,
809,
29918,
8962,
29918,
1445,
353,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
525,
6050,
1495,
13,
1272,
29918,
14968,
353,
5839,
280,
29889,
1359,
7373,
29888,
809,
29918,
8962,
29918,
1445,
29897,
13,
13,
22692,
29871,
29896,
13,
13,
1454,
903,
1761,
297,
848,
29918,
29888,
809,
29918,
8962,
29901,
13,
1678,
363,
903,
9641,
297,
903,
1761,
29901,
13,
4706,
903,
9641,
1839,
16434,
29918,
978,
2033,
353,
903,
9641,
1839,
16434,
29918,
978,
13359,
6506,
11219,
5184,
29914,
941,
29877,
29914,
24713,
29914,
29894,
29896,
29899,
29941,
29914,
14968,
29918,
791,
29918,
19935,
29918,
29941,
742,
13,
462,
462,
462,
418,
525,
14538,
1691,
29914,
10072,
1212,
29896,
29941,
1495,
13,
4706,
903,
9641,
1839,
16264,
29918,
978,
2033,
353,
903,
9641,
1839,
16264,
29918,
978,
13359,
6506,
11219,
5184,
29914,
941,
29877,
29914,
24713,
29914,
29894,
29896,
29899,
29941,
29914,
14968,
29918,
791,
29918,
19935,
29918,
29941,
742,
13,
462,
462,
462,
418,
525,
14538,
1691,
29914,
10072,
1212,
29896,
29941,
1495,
13,
23945,
280,
29889,
15070,
29898,
1272,
29918,
29888,
809,
29918,
8962,
29892,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
376,
29893,
29890,
5783,
13,
2158,
703,
15091,
1159,
13,
13,
29937,
6623,
6724,
848,
13,
13,
29918,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
353,
525,
29888,
809,
29918,
8962,
29918,
1688,
29918,
1272,
29889,
29886,
6321,
29915,
13,
29918,
29888,
809,
29918,
8962,
29918,
1445,
353,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
525,
6050,
1495,
13,
1272,
29918,
29888,
809,
29918,
8962,
353,
5839,
280,
29889,
1359,
7373,
29888,
809,
29918,
8962,
29918,
1445,
29897,
13,
13,
1454,
903,
1761,
297,
848,
29918,
29888,
809,
29918,
8962,
29901,
13,
1678,
363,
903,
9641,
297,
903,
1761,
29901,
13,
4706,
903,
9641,
1839,
16434,
29918,
978,
2033,
353,
903,
9641,
1839,
16434,
29918,
978,
13359,
6506,
11219,
5184,
29914,
941,
29877,
29914,
24713,
29914,
29894,
29896,
29899,
29941,
29914,
14968,
29918,
791,
29918,
19935,
29918,
29941,
742,
13,
462,
462,
462,
418,
525,
14538,
1691,
29914,
10072,
1212,
29896,
29941,
1495,
13,
4706,
903,
9641,
1839,
16264,
29918,
978,
2033,
353,
903,
9641,
1839,
16264,
29918,
978,
13359,
6506,
11219,
5184,
29914,
941,
29877,
29914,
24713,
29914,
29894,
29896,
29899,
29941,
29914,
14968,
29918,
791,
29918,
19935,
29918,
29941,
742,
13,
462,
462,
462,
418,
525,
14538,
1691,
29914,
10072,
1212,
29896,
29941,
1495,
13,
23945,
280,
29889,
15070,
29898,
1272,
29918,
29888,
809,
29918,
8962,
29892,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
376,
29893,
29890,
5783,
13,
2158,
703,
15091,
1159,
13,
13,
29937,
6623,
6694,
848,
13,
13,
29918,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
353,
525,
29888,
809,
29918,
8962,
29918,
14968,
29918,
1272,
29889,
29886,
6321,
29915,
13,
29918,
29888,
809,
29918,
8962,
29918,
1445,
353,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
525,
6050,
1495,
13,
1272,
29918,
29888,
809,
29918,
8962,
353,
5839,
280,
29889,
1359,
7373,
29888,
809,
29918,
8962,
29918,
1445,
29897,
13,
13,
2248,
353,
29871,
29900,
13,
1454,
413,
29892,
903,
1761,
297,
848,
29918,
29888,
809,
29918,
8962,
29889,
7076,
7295,
13,
1678,
363,
903,
9641,
297,
903,
1761,
29901,
13,
4706,
903,
9641,
1839,
9641,
29918,
333,
2033,
353,
376,
1972,
648,
29901,
29900,
29958,
29945,
29881,
29913,
1642,
4830,
29898,
2248,
29897,
13,
4706,
903,
9641,
1839,
16434,
29918,
978,
2033,
353,
903,
9641,
1839,
16434,
29918,
978,
13359,
6506,
877,
24713,
29914,
10072,
1212,
29896,
29941,
29914,
14968,
29918,
791,
29918,
19935,
29918,
29941,
742,
13,
462,
462,
462,
418,
525,
14538,
1691,
29914,
10072,
1212,
29896,
29941,
1495,
13,
4706,
903,
9641,
1839,
16264,
29918,
978,
2033,
353,
903,
9641,
1839,
16264,
29918,
978,
13359,
6506,
877,
24713,
29914,
10072,
1212,
29896,
29941,
29914,
14968,
29918,
791,
29918,
19935,
29918,
29941,
742,
13,
462,
462,
462,
418,
525,
14538,
1691,
29914,
10072,
1212,
29896,
29941,
1495,
13,
4706,
2380,
353,
2380,
718,
29871,
29896,
13,
13,
23945,
280,
29889,
15070,
29898,
1272,
29918,
29888,
809,
29918,
8962,
29892,
1722,
7373,
29888,
809,
29918,
8962,
29918,
23945,
280,
29918,
1445,
29892,
376,
29893,
29890,
5783,
13,
2158,
703,
15091,
1159,
13,
2
] |
var/spack/repos/builtin/packages/r-xde/package.py | nkianggiss/spack | 3 | 168095 | <filename>var/spack/repos/builtin/packages/r-xde/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RXde(RPackage):
"""Multi-level model for cross-study detection of differential gene
expression."""
homepage = "https://www.bioconductor.org/packages/XDE/"
git = "https://git.bioconductor.org/packages/XDE.git"
version('2.22.0', commit='<PASSWORD>')
depends_on('r-biobase', type=('build', 'run'))
depends_on('r-biocgenerics', type=('build', 'run'))
depends_on('r-genefilter', type=('build', 'run'))
depends_on('r-gtools', type=('build', 'run'))
depends_on('r-mergemaid', type=('build', 'run'))
depends_on('r-mvtnorm', type=('build', 'run'))
depends_on('[email protected]:3.4.9', when='@2.22.0')
| [
1,
529,
9507,
29958,
1707,
29914,
1028,
547,
29914,
276,
1066,
29914,
16145,
262,
29914,
8318,
29914,
29878,
29899,
29916,
311,
29914,
5113,
29889,
2272,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29941,
29899,
29906,
29900,
29896,
29929,
19520,
22469,
5514,
3086,
14223,
29892,
365,
12182,
322,
916,
13,
29937,
1706,
547,
8010,
10682,
414,
29889,
2823,
278,
2246,
29899,
5563,
315,
4590,
29979,
22789,
3912,
934,
363,
4902,
29889,
13,
29937,
13,
29937,
10937,
29928,
29990,
29899,
29931,
293,
1947,
29899,
12889,
29901,
313,
17396,
1829,
29899,
29906,
29889,
29900,
6323,
341,
1806,
29897,
13,
13,
3166,
805,
547,
1053,
334,
13,
13,
13,
1990,
390,
29990,
311,
29898,
29934,
14459,
1125,
13,
1678,
9995,
15329,
29899,
5563,
1904,
363,
4891,
29899,
18082,
29891,
15326,
310,
16712,
18530,
13,
539,
4603,
1213,
15945,
13,
13,
1678,
3271,
3488,
353,
376,
991,
597,
1636,
29889,
24840,
535,
2199,
272,
29889,
990,
29914,
8318,
29914,
29990,
2287,
12975,
13,
1678,
6315,
418,
353,
376,
991,
597,
5559,
29889,
24840,
535,
2199,
272,
29889,
990,
29914,
8318,
29914,
29990,
2287,
29889,
5559,
29908,
13,
13,
1678,
1873,
877,
29906,
29889,
29906,
29906,
29889,
29900,
742,
9063,
2433,
29966,
25711,
17013,
29958,
1495,
13,
13,
1678,
7111,
29918,
265,
877,
29878,
29899,
24840,
3188,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
29878,
29899,
5365,
542,
4738,
1199,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
29878,
29899,
1885,
1389,
309,
357,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
29878,
29899,
29887,
8504,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
29878,
29899,
1050,
29887,
2603,
333,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
29878,
29899,
29324,
6277,
555,
742,
1134,
29922,
877,
4282,
742,
525,
3389,
8785,
13,
1678,
7111,
29918,
265,
877,
29878,
29992,
29941,
29889,
29946,
29889,
29900,
29901,
29941,
29889,
29946,
29889,
29929,
742,
746,
2433,
29992,
29906,
29889,
29906,
29906,
29889,
29900,
1495,
13,
2
] |
tests/test_engagement_query_set.py | Asday/keiyakusha | 2 | 1605076 | from datetime import date, timedelta
import pytest
from engagements.models import Engagement
from factories.auth import UserFactory
from factories.clients import ClientFactory
from factories.engagements import EngagementFactory
@pytest.mark.django_db
def test_active_at():
user = UserFactory()
client_a = ClientFactory()
client_b = ClientFactory()
engagement_a_active = EngagementFactory(
start=date(2018, 8, 23),
duration=timedelta(days=1),
user=user,
client=client_a,
)
EngagementFactory(
start=date(2018, 8, 21),
duration=timedelta(days=1),
user=user,
client=client_a,
)
EngagementFactory(
start=date(2018, 8, 23),
duration=timedelta(days=1),
user=user,
client=client_b,
)
assert Engagement.objects.all().count() == 3 # Just checkin'.
active_at = Engagement.objects \
.filter(client=client_a) \
.active_at(date(2018, 8, 23))
assert engagement_a_active in active_at
assert active_at.count() == 1
| [
1,
515,
12865,
1053,
2635,
29892,
5335,
287,
2554,
13,
13,
5215,
11451,
1688,
13,
13,
3166,
27010,
4110,
29889,
9794,
1053,
2201,
5049,
13,
3166,
2114,
3842,
29889,
5150,
1053,
4911,
5126,
13,
3166,
2114,
3842,
29889,
11303,
1237,
1053,
12477,
5126,
13,
3166,
2114,
3842,
29889,
996,
351,
4110,
1053,
2201,
5049,
5126,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
14095,
29918,
2585,
13,
1753,
1243,
29918,
4925,
29918,
271,
7295,
13,
1678,
1404,
353,
4911,
5126,
580,
13,
13,
1678,
3132,
29918,
29874,
353,
12477,
5126,
580,
13,
1678,
3132,
29918,
29890,
353,
12477,
5126,
580,
13,
13,
1678,
3033,
5049,
29918,
29874,
29918,
4925,
353,
2201,
5049,
5126,
29898,
13,
4706,
1369,
29922,
1256,
29898,
29906,
29900,
29896,
29947,
29892,
29871,
29947,
29892,
29871,
29906,
29941,
511,
13,
4706,
14385,
29922,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
13,
4706,
1404,
29922,
1792,
29892,
13,
4706,
3132,
29922,
4645,
29918,
29874,
29892,
13,
1678,
1723,
13,
1678,
2201,
5049,
5126,
29898,
13,
4706,
1369,
29922,
1256,
29898,
29906,
29900,
29896,
29947,
29892,
29871,
29947,
29892,
29871,
29906,
29896,
511,
13,
4706,
14385,
29922,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
13,
4706,
1404,
29922,
1792,
29892,
13,
4706,
3132,
29922,
4645,
29918,
29874,
29892,
13,
1678,
1723,
13,
1678,
2201,
5049,
5126,
29898,
13,
4706,
1369,
29922,
1256,
29898,
29906,
29900,
29896,
29947,
29892,
29871,
29947,
29892,
29871,
29906,
29941,
511,
13,
4706,
14385,
29922,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
13,
4706,
1404,
29922,
1792,
29892,
13,
4706,
3132,
29922,
4645,
29918,
29890,
29892,
13,
1678,
1723,
13,
13,
1678,
4974,
2201,
5049,
29889,
12650,
29889,
497,
2141,
2798,
580,
1275,
29871,
29941,
29871,
396,
3387,
1423,
262,
4286,
13,
13,
1678,
6136,
29918,
271,
353,
2201,
5049,
29889,
12650,
320,
13,
4706,
869,
4572,
29898,
4645,
29922,
4645,
29918,
29874,
29897,
320,
13,
4706,
869,
4925,
29918,
271,
29898,
1256,
29898,
29906,
29900,
29896,
29947,
29892,
29871,
29947,
29892,
29871,
29906,
29941,
876,
13,
13,
1678,
4974,
3033,
5049,
29918,
29874,
29918,
4925,
297,
6136,
29918,
271,
13,
1678,
4974,
6136,
29918,
271,
29889,
2798,
580,
1275,
29871,
29896,
13,
2
] |
lib/utils/__init__.py | jwyang/C3Net.pytorch | 43 | 19886 | from .verbo import *
| [
1,
515,
869,
369,
833,
1053,
334,
13,
2
] |
training/rootnav2/accuracy/__init__.py | robail-yasrab/6-RootNav-2.0 | 23 | 187358 | <reponame>robail-yasrab/6-RootNav-2.0<gh_stars>10-100
from .nms import nonmaximalsuppression, rrtree, evaluate_points | [
1,
529,
276,
1112,
420,
29958,
13716,
737,
29899,
29891,
294,
4201,
29914,
29953,
29899,
10303,
22107,
29899,
29906,
29889,
29900,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
869,
29876,
1516,
1053,
1661,
27525,
1338,
14889,
23881,
29892,
364,
2273,
929,
29892,
14707,
29918,
9748,
2
] |
utils/experiment_utils.py | samuelfneumann/RLControl | 0 | 119224 | #!/usr/bin/env python3
import pickle
import os
import numpy as np
def get_sweep_parameters(parameters, env_config, index):
"""
Gets the parameters for the hyperparameter sweep defined by the index.
Each hyperparameter setting has a specific index number, and this function
will get the appropriate parameters for the argument index. In addition,
this the indices will wrap around, so if there are a total of 10 different
hyperparameter settings, then the indices 0 and 10 will return the same
hyperparameter settings. This is useful for performing loops.
For example, if you had 10 hyperparameter settings and you wanted to do
10 runs, the you could just call this for indices in range(0, 10*10). If
you only wanted to do runs for hyperparameter setting i, then you would
use indices in range(i, 10, 10*10)
Parameters
----------
parameters : dict
The dictionary of parameters, as found in the agent's json
configuration file
env_config : dict
The environment configuration dictionary, as found in the environment's
json configuration file
index : int
The index of the hyperparameters configuration to return
Returns
-------
dict, int
The dictionary of hyperparameters to use for the agent and the total
number of combinations of hyperparameters (highest possible unique
index)
"""
out_params = {}
out_params["gamma"] = env_config["gamma"]
accum = 1
for key in parameters:
num = len(parameters[key])
out_params[key] = parameters[key][(index // accum) % num]
accum *= num
return (out_params, accum)
def get_sweep_num(parameters):
"""
Similar to get_sweep_parameters but only returns the total number of
hyperparameter combinations. This number is the total number of distinct
hyperparameter settings. If this function returns k, then there are k
distinct hyperparameter settings, and indices 0 and k refer to the same
distinct hyperparameter setting.
Parameters
----------
parameters : dict
The dictionary of parameters, as found in the agent's json
configuration file
Returns
-------
int
The number of distinct hyperparameter settings
"""
accum = 1
for key in parameters:
num = len(parameters[key])
accum *= num
return accum
def get_hyperparam_indices(data, hp_name, hp_value):
"""
Gets all hyperparameter indices that have the hyperparameter hp_name
having the value hp_value.
Parameters
----------
data : dict
The data dictionary generated from running main.py
hp_name : str
The name of the hyperparameter to check the value of
hp_value : object
The value that the hyperparameter should have in each hyperparameter
settings index
Returns
-------
list of int
The hyperparameter settings that have the argument hyperparameter
hp_name having the argument value hp_value
"""
agent_param = data["experiment"]["agent"]["parameters"]
env_config = data["experiment"]["environment"]
hp_indices = []
for i in range(get_sweep_num(agent_param)):
# Get the hyperparameters for each hyperparameter setting
hp_setting = get_sweep_parameters(agent_param, env_config, i)[0]
if hp_setting[hp_name] == hp_value:
hp_indices.append(i)
return hp_indices
def get_varying_single_hyperparam(data, hp_name):
"""
Gets the hyperparameter indices where only a single hyperparameter is
varying and all other hyperparameters remain constant.
Parameters
----------
data : dict
The data dictionary generated from running main.py
hp_name : str
The name of the hyperparameter to vary
Returns
-------
n-tuple of m-tuple of int
Gets and returns the hyperparameter indices where only a single
hyperparameter is varying and all others remain constant. The
total number of values that the varying hyperparameter can take on
is m; n is the total number of hyperparameter combinations // m.
For example, if the hyperparameter is the decay rate and it can take
on values in [0.0, 0.1, 0.5] and there are a total of 81 hyperparameter
settings combinations, then m = 3 and n = 81 // 3 = 27
"""
agent_param = data["experiment"]["agent"]["parameters"]
hps = [] # set(range(exp.get_sweep_num(agent_param)))
for hp_value in agent_param[hp_name]:
hps.append(get_hyperparam_indices(data, hp_name, hp_value))
return tuple(zip(*hps))
def get_best_hp(data, type_, after=0):
"""
Gets and returns a list of the hyperparameter settings, sorted by average
return.
Parameters
----------
data : dict
They Python data dictionary generated from running main.py
type_ : str
The type of return by which to compare hyperparameter settings, one of
"train" or "eval"
after : int, optional
Hyperparameters will only be compared by their performance after
training for this many episodes (in continuing tasks, this is the
number of times the task is restarted). For example, if after = -10,
then only the last 10 returns from training/evaluation are taken
into account when comparing the hyperparameters. As usual, positive
values index from the front, and negative values index from the back.
Returns
-------
n-tuple of 2-tuple(int, float)
A tuple with the number of elements equal to the total number of
hyperparameter combinations. Each sub-tuple is a tuple of (hyperparameter
setting number, mean return over all runs and episodes)
"""
if type_ not in ("train", "eval"):
raise ValueError("type_ should be one of 'train', 'eval'")
return_type = "train_episode_rewards" if type_ == "train" \
else "eval_episode_rewards"
mean_returns = []
hp_settings = sorted(list(data["experiment_data"].keys()))
for hp_setting in hp_settings:
hp_returns = []
for run in data["experiment_data"][hp_setting]["runs"]:
hp_returns.append(run[return_type])
hp_returns = np.stack(hp_returns)
# If evaluating, use the mean return over all episodes for each
# evaluation interval. That is, if 10 eval episodes for each evaluation
# the take the average return over all these eval episodes
if type_ == "eval":
hp_returns = hp_returns.mean(axis=-1)
# Calculate the average return over all runs
hp_returns = hp_returns[after:, :].mean(axis=0)
# Calculate the average return over all "episodes"
hp_returns = hp_returns.mean(axis=0)
# Save mean return
mean_returns.append(hp_returns)
# Return the best hyperparam settings in order with the
# mean returns sorted by hyperparmater setting performance
best_hp_settings = np.argsort(mean_returns)
mean_returns = np.array(mean_returns)[best_hp_settings]
return tuple(zip(best_hp_settings, mean_returns))
def combine_runs(data1, data2):
"""
Adds the runs for each hyperparameter setting in data2 to the runs for the
corresponding hyperparameter setting in data1.
Given two data dictionaries, this function will get each hyperparameter
setting and extend the runs done on this hyperparameter setting and saved
in data1 by the runs of this hyperparameter setting and saved in data2.
In short, this function extends the lists
data1["experiment_data"][i]["runs"] by the lists
data2["experiment_data"][i]["runs"] for all i. This is useful if
multiple runs are done at different times, and the two data files need
to be combined.
Parameters
----------
data1 : dict
A data dictionary as generated by main.py
data2 : dict
A data dictionary as generated by main.py
Raises
------
KeyError
If a hyperparameter setting exists in data2 but not in data1. This
signals that the hyperparameter settings indices are most likely
different, so the hyperparameter index i in data1 does not correspond
to the same hyperparameter index in data2. In addition, all other
functions expect the number of runs to be consistent for each
hyperparameter setting, which would be violated in this case.
"""
for hp_setting in data1["experiment_data"]:
if hp_setting not in data2.keys():
# Ensure consistent hyperparam settings indices
raise KeyError("hyperparameter settings are different " +
"between the two experiments")
extra_runs = data2["experiment_data"][hp_setting]["runs"]
data1["experiment_data"][hp_setting]["runs"].extend(extra_runs)
def get_returns(data, type_, ind):
"""
Gets the returns seen by an agent
Gets the online or offline returns seen by an agent trained with
hyperparameter settings index ind.
Parameters
----------
data : dict
The Python data dictionary generated from running main.py
type_ : str
Whether to get the training or evaluation returns, one of 'train',
'eval'
ind : int
Gets the returns of the agent trained with this hyperparameter
settings index
Returns
-------
array_like
The array of returns of the form (N, R, C) where N is the number of
runs, R is the number of times a performance was measured, and C is the
number of returns generated each time performance was measured
(offline >= 1; online = 1). For the online setting, N is the number of
runs, and R is the number of episodes and C = 1. For the offline
setting, N is the number of runs, R is the number of times offline
evaluation was performed, and C is the number of episodes run each
time performance was evaluated offline.
"""
returns = []
if type_ == "eval":
# Get the offline evaluation episode returns per run
for run in data["experiment_data"][ind]["runs"]:
returns.append(run["eval_episode_rewards"])
returns = np.stack(returns)
elif type_ == "train":
# Get the returns per episode per run
for run in data["experiment_data"][ind]["runs"]:
returns.append(run["train_episode_rewards"])
returns = np.expand_dims(np.stack(returns), axis=2)
return returns
def get_hyperparams(data, ind):
"""
Gets the hyperparameters for hyperparameter settings index ind
data : dict
The Python data dictionary generated from running main.py
ind : int
Gets the returns of the agent trained with this hyperparameter
settings index
Returns
-------
dict
The dictionary of hyperparameters
"""
return data["experiment_data"][ind]["agent_params"]
def get_mean_returns_with_stderr_hp_varying(data, type_, hp_name, combo,
after=0):
"""
Calculate mean and standard error of return for each hyperparameter value.
Gets the mean returns for each variation of a single hyperparameter,
with all other hyperparameters remaining constant. Since there are
many different ways this can happen (the hyperparameter can vary
with all other remaining constant, but there are many combinations
of these constant hyperparameters), the combo argument cycles through
the combinations of constant hyperparameters.
Given hyperparameters a, b, and c, let's say we want to get all
hyperparameter settings indices where a varies, and b and c are constant.
if a, b, and c can each be 1 or 2, then there are four ways that a can
vary with b and c remaining constant:
[
((a=1, b=1, c=1), (a=2, b=1, c=1)), combo = 0
((a=1, b=2, c=1), (a=2, b=2, c=1)), combo = 1
((a=1, b=1, c=2), (a=2, b=1, c=2)), combo = 2
((a=1, b=2, c=2), (a=2, b=2, c=2)) combo = 3
]
The combo argument indexes into this list of hyperparameter settings
Parameters
----------
data : dict
The Python data dictionary generated from running main.py
type_ : str
Which type of data to plot, one of "eval" or "train"
combo : int
Determines the values of the constant hyperparameters. Given that
only one hyperparameter may vary, there are many different sets
having this hyperparameter varying with all others remaining constant
since each constant hyperparameter may take on many values. This
argument cycles through all sets of hyperparameter settings indices
that have only one hyperparameter varying and all others constant.
"""
hp_combo = get_varying_single_hyperparam(data, hp_name)[combo]
mean_returns = []
stderr_returns = []
for hp in hp_combo:
mean_return = get_returns(data, type_, hp)
# If evaluating, use the mean return over all episodes for each
# evaluation interval. That is, if 10 eval episodes for each evaluation
# the take the average return over all these eval episodes.
# If online returns, this axis has a length of 1 so we reduce it
mean_return = mean_return.mean(axis=-1)
# Calculate the average return over all "episodes"
# print(mean_return[:, after:].shape)
mean_return = mean_return[:, after:].mean(axis=1)
# Calculate the average return over all runs
stderr_return = np.std(mean_return, axis=0) / \
np.sqrt(mean_return.shape[0])
mean_return = mean_return.mean(axis=0)
mean_returns.append(mean_return)
stderr_returns.append(stderr_return)
# Get each hp value and sort all results by hp value
hp_values = np.array(data["experiment"]["agent"]["parameters"][hp_name])
indices = np.argsort(hp_values)
mean_returns = np.array(mean_returns)[indices]
stderr_returns = np.array(stderr_returns)[indices]
hp_values = hp_values[indices]
return hp_values, mean_returns, stderr_returns
def get_mean_stderr(data, type_, ind, smooth_over):
"""
Gets the timesteps, mean, and standard error to be plotted for
a given hyperparameter settings index
Parameters
----------
data : dict
The Python data dictionary generated from running main.py
type_ : str
Which type of data to plot, one of "eval" or "train"
ind : int
The hyperparameter settings index to plot
smooth_over : int
The number of previous data points to smooth over. Note that this
is *not* the number of timesteps to smooth over, but rather the number
of data points to smooth over. For example, if you save the return
every 1,000 timesteps, then setting this value to 15 will smooth
over the last 15 readings, or 15,000 timesteps.
Returns
-------
3-tuple of list(int), list(float), list(float)
The timesteps, mean episodic returns, and standard errors of the
episodic returns
"""
timesteps = None # So the linter doesn't have a temper tantrum
# Determine the timesteps to plot at
if type_ == "eval":
timesteps = \
data["experiment_data"][ind]["runs"][0]["timesteps_at_eval"]
elif type_ == "train":
timesteps_per_ep = \
data["experiment_data"][ind]["runs"][0]["train_episode_steps"]
timesteps = get_cumulative_timesteps(timesteps_per_ep)
# Get the mean over all episodes per evaluation step (for online
# returns, this axis will have length 1 so we squeeze it)
returns = get_returns(data, type_, ind)
mean = returns.mean(axis=-1)
# Get the standard deviation of mean episodes per evaluation
# step over all runs
runs = returns.shape[0]
std = np.std(mean, axis=0) / np.sqrt(runs)
# Get the mean over all runs
mean = mean.mean(axis=0)
# Smooth of last k returns if applicable, convolve will initially only
# start sliding from the beginning, so we need to cut off the initial
# averages which are incomplete
if smooth_over > 1:
mean = np.convolve(mean, np.ones(smooth_over) /
smooth_over, mode="valid") #[smooth_over:mean.shape[0]]
std = np.convolve(std, np.ones(smooth_over) /
smooth_over, mode="valid") #[smooth_over:std.shape[0]]
# np.convolve only goes until the last element of the convolution
# lines up with the last element of the data, so smooth_over elements
# will be lost
timesteps = timesteps[:-smooth_over + 1]
return timesteps, mean, std
def get_cumulative_timesteps(timesteps_per_episode):
"""
Creates an array of cumulative timesteps.
Creates an array of timesteps, where each timestep is the cumulative
number of timesteps up until that point. This is needed for plotting the
training data, where the training timesteps are stored for each episode,
and we need to plot on the x-axis the cumulative timesteps, not the
timesteps per episode.
Parameters
----------
timesteps_per_episode : list
A list where each element in the list denotes the amount of timesteps
for the corresponding episode.
Returns
-------
array_like
An array where each element is the cumulative number of timesteps up
until that point.
"""
timesteps_per_episode = np.array(timesteps_per_episode)
cumulative_timesteps = [timesteps_per_episode[:i].sum()
for i in range(timesteps_per_episode.shape[0])]
return np.array(cumulative_timesteps)
def combine_data_dictionaries(files, save=True, save_dir=".", filename="data"):
"""
Combine data dictionaries given a list of filenames
Given a list of paths to data dictionaries, combines each data dictionary
into a single one.
Parameters
----------
files : list of str
A list of the paths to data dictionary files to combine
save : bool
Whether or not to save the data
save_dir : str, optional
The directory containing the saved dictionaries
filename : str, optional
The name of the file to save which stores the combined data, by default
'data'
Returns
-------
dict
The combined dictionary
"""
# Use first dictionary as base dictionary
with open(os.path.join(save_dir, files[0]), "rb") as in_file:
data = pickle.load(in_file)
# Add data from all other dictionaries
for file in files[1:]:
with open(os.path.join(save_dir, file), "rb") as in_file:
# Read in the new dictionary
in_data = pickle.load(in_file)
# Add experiment data to running dictionary
for key in in_data["experiment_data"]:
# Check if key exists
if key in data["experiment_data"]:
# Append data if existing
data["experiment_data"][key]["runs"] \
.extend(in_data["experiment_data"][key]["runs"])
else:
# Key doesn't exist - add data to dictionary
data["experiment_data"][key] = \
in_data["experiment_data"][key]
if save:
with open(os.path.join(save_dir, f"{filename}.pkl"), "wb") as out_file:
pickle.dump(data, out_file)
return data
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
5215,
5839,
280,
13,
5215,
2897,
13,
5215,
12655,
408,
7442,
13,
13,
13,
1753,
679,
29918,
29879,
705,
1022,
29918,
16744,
29898,
16744,
29892,
8829,
29918,
2917,
29892,
2380,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
278,
4128,
363,
278,
11266,
15501,
7901,
1022,
3342,
491,
278,
2380,
29889,
13,
13,
1678,
7806,
11266,
15501,
4444,
756,
263,
2702,
2380,
1353,
29892,
322,
445,
740,
13,
1678,
674,
679,
278,
8210,
4128,
363,
278,
2980,
2380,
29889,
512,
6124,
29892,
13,
1678,
445,
278,
16285,
674,
12244,
2820,
29892,
577,
565,
727,
526,
263,
3001,
310,
29871,
29896,
29900,
1422,
13,
1678,
11266,
15501,
6055,
29892,
769,
278,
16285,
29871,
29900,
322,
29871,
29896,
29900,
674,
736,
278,
1021,
13,
1678,
11266,
15501,
6055,
29889,
910,
338,
5407,
363,
15859,
12104,
29889,
13,
13,
1678,
1152,
1342,
29892,
565,
366,
750,
29871,
29896,
29900,
11266,
15501,
6055,
322,
366,
5131,
304,
437,
13,
268,
29896,
29900,
6057,
29892,
278,
366,
1033,
925,
1246,
445,
363,
16285,
297,
3464,
29898,
29900,
29892,
29871,
29896,
29900,
29930,
29896,
29900,
467,
960,
13,
1678,
366,
871,
5131,
304,
437,
6057,
363,
11266,
15501,
4444,
474,
29892,
769,
366,
723,
13,
1678,
671,
16285,
297,
3464,
29898,
29875,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29930,
29896,
29900,
29897,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
4128,
584,
9657,
13,
4706,
450,
8600,
310,
4128,
29892,
408,
1476,
297,
278,
10823,
29915,
29879,
4390,
13,
4706,
5285,
934,
13,
1678,
8829,
29918,
2917,
584,
9657,
13,
4706,
450,
5177,
5285,
8600,
29892,
408,
1476,
297,
278,
5177,
29915,
29879,
13,
4706,
4390,
5285,
934,
13,
1678,
2380,
584,
938,
13,
4706,
450,
2380,
310,
278,
11266,
16744,
5285,
304,
736,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
9657,
29892,
938,
13,
4706,
450,
8600,
310,
11266,
16744,
304,
671,
363,
278,
10823,
322,
278,
3001,
13,
4706,
1353,
310,
18240,
310,
11266,
16744,
313,
9812,
342,
1950,
5412,
13,
4706,
2380,
29897,
13,
1678,
9995,
13,
1678,
714,
29918,
7529,
353,
6571,
13,
1678,
714,
29918,
7529,
3366,
4283,
3108,
353,
8829,
29918,
2917,
3366,
4283,
3108,
13,
1678,
18414,
353,
29871,
29896,
13,
1678,
363,
1820,
297,
4128,
29901,
13,
4706,
954,
353,
7431,
29898,
16744,
29961,
1989,
2314,
13,
4706,
714,
29918,
7529,
29961,
1989,
29962,
353,
4128,
29961,
1989,
3816,
29898,
2248,
849,
18414,
29897,
1273,
954,
29962,
13,
4706,
18414,
334,
29922,
954,
13,
1678,
736,
313,
449,
29918,
7529,
29892,
18414,
29897,
13,
13,
13,
1753,
679,
29918,
29879,
705,
1022,
29918,
1949,
29898,
16744,
1125,
13,
1678,
9995,
13,
1678,
13999,
304,
679,
29918,
29879,
705,
1022,
29918,
16744,
541,
871,
3639,
278,
3001,
1353,
310,
13,
1678,
11266,
15501,
18240,
29889,
910,
1353,
338,
278,
3001,
1353,
310,
8359,
13,
1678,
11266,
15501,
6055,
29889,
960,
445,
740,
3639,
413,
29892,
769,
727,
526,
413,
13,
1678,
8359,
11266,
15501,
6055,
29892,
322,
16285,
29871,
29900,
322,
413,
2737,
304,
278,
1021,
13,
1678,
8359,
11266,
15501,
4444,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
4128,
584,
9657,
13,
4706,
450,
8600,
310,
4128,
29892,
408,
1476,
297,
278,
10823,
29915,
29879,
4390,
13,
4706,
5285,
934,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
938,
13,
4706,
450,
1353,
310,
8359,
11266,
15501,
6055,
13,
1678,
9995,
13,
1678,
18414,
353,
29871,
29896,
13,
1678,
363,
1820,
297,
4128,
29901,
13,
4706,
954,
353,
7431,
29898,
16744,
29961,
1989,
2314,
13,
4706,
18414,
334,
29922,
954,
13,
1678,
736,
18414,
13,
13,
13,
1753,
679,
29918,
24947,
3207,
29918,
513,
1575,
29898,
1272,
29892,
298,
29886,
29918,
978,
29892,
298,
29886,
29918,
1767,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
599,
11266,
15501,
16285,
393,
505,
278,
11266,
15501,
298,
29886,
29918,
978,
13,
1678,
2534,
278,
995,
298,
29886,
29918,
1767,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
9657,
13,
4706,
450,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
298,
29886,
29918,
978,
584,
851,
13,
4706,
450,
1024,
310,
278,
11266,
15501,
304,
1423,
278,
995,
310,
13,
1678,
298,
29886,
29918,
1767,
584,
1203,
13,
4706,
450,
995,
393,
278,
11266,
15501,
881,
505,
297,
1269,
11266,
15501,
13,
4706,
6055,
2380,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
1051,
310,
938,
13,
4706,
450,
11266,
15501,
6055,
393,
505,
278,
2980,
11266,
15501,
13,
4706,
298,
29886,
29918,
978,
2534,
278,
2980,
995,
298,
29886,
29918,
1767,
13,
1678,
9995,
13,
1678,
10823,
29918,
3207,
353,
848,
3366,
735,
15362,
3108,
3366,
14748,
3108,
3366,
16744,
3108,
13,
1678,
8829,
29918,
2917,
353,
848,
3366,
735,
15362,
3108,
3366,
20944,
3108,
13,
13,
1678,
298,
29886,
29918,
513,
1575,
353,
5159,
13,
1678,
363,
474,
297,
3464,
29898,
657,
29918,
29879,
705,
1022,
29918,
1949,
29898,
14748,
29918,
3207,
22164,
13,
4706,
396,
3617,
278,
11266,
16744,
363,
1269,
11266,
15501,
4444,
13,
4706,
298,
29886,
29918,
26740,
353,
679,
29918,
29879,
705,
1022,
29918,
16744,
29898,
14748,
29918,
3207,
29892,
8829,
29918,
2917,
29892,
474,
9601,
29900,
29962,
13,
13,
4706,
565,
298,
29886,
29918,
26740,
29961,
28887,
29918,
978,
29962,
1275,
298,
29886,
29918,
1767,
29901,
13,
9651,
298,
29886,
29918,
513,
1575,
29889,
4397,
29898,
29875,
29897,
13,
13,
1678,
736,
298,
29886,
29918,
513,
1575,
13,
13,
13,
1753,
679,
29918,
29894,
653,
292,
29918,
14369,
29918,
24947,
3207,
29898,
1272,
29892,
298,
29886,
29918,
978,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
278,
11266,
15501,
16285,
988,
871,
263,
2323,
11266,
15501,
338,
13,
1678,
24099,
322,
599,
916,
11266,
16744,
3933,
4868,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
9657,
13,
4706,
450,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
298,
29886,
29918,
978,
584,
851,
13,
4706,
450,
1024,
310,
278,
11266,
15501,
304,
13100,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
302,
29899,
23583,
310,
286,
29899,
23583,
310,
938,
13,
4706,
402,
1691,
322,
3639,
278,
11266,
15501,
16285,
988,
871,
263,
2323,
13,
4706,
11266,
15501,
338,
24099,
322,
599,
4045,
3933,
4868,
29889,
450,
13,
4706,
3001,
1353,
310,
1819,
393,
278,
24099,
11266,
15501,
508,
2125,
373,
13,
4706,
338,
286,
29936,
302,
338,
278,
3001,
1353,
310,
11266,
15501,
18240,
849,
286,
29889,
13,
13,
4706,
1152,
1342,
29892,
565,
278,
11266,
15501,
338,
278,
20228,
6554,
322,
372,
508,
2125,
13,
4706,
373,
1819,
297,
518,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29896,
29892,
29871,
29900,
29889,
29945,
29962,
322,
727,
526,
263,
3001,
310,
29871,
29947,
29896,
11266,
15501,
13,
4706,
6055,
18240,
29892,
769,
286,
353,
29871,
29941,
322,
302,
353,
29871,
29947,
29896,
849,
29871,
29941,
353,
29871,
29906,
29955,
13,
1678,
9995,
13,
1678,
10823,
29918,
3207,
353,
848,
3366,
735,
15362,
3108,
3366,
14748,
3108,
3366,
16744,
3108,
13,
1678,
298,
567,
353,
5159,
29871,
396,
731,
29898,
3881,
29898,
4548,
29889,
657,
29918,
29879,
705,
1022,
29918,
1949,
29898,
14748,
29918,
3207,
4961,
13,
1678,
363,
298,
29886,
29918,
1767,
297,
10823,
29918,
3207,
29961,
28887,
29918,
978,
5387,
13,
4706,
298,
567,
29889,
4397,
29898,
657,
29918,
24947,
3207,
29918,
513,
1575,
29898,
1272,
29892,
298,
29886,
29918,
978,
29892,
298,
29886,
29918,
1767,
876,
13,
13,
1678,
736,
18761,
29898,
7554,
10456,
29882,
567,
876,
13,
13,
13,
1753,
679,
29918,
13318,
29918,
28887,
29898,
1272,
29892,
1134,
3383,
1156,
29922,
29900,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
322,
3639,
263,
1051,
310,
278,
11266,
15501,
6055,
29892,
12705,
491,
6588,
13,
1678,
736,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
9657,
13,
4706,
2688,
5132,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
1134,
29918,
584,
851,
13,
4706,
450,
1134,
310,
736,
491,
607,
304,
7252,
11266,
15501,
6055,
29892,
697,
310,
13,
4706,
376,
14968,
29908,
470,
376,
14513,
29908,
13,
1678,
1156,
584,
938,
29892,
13136,
13,
4706,
26078,
16744,
674,
871,
367,
9401,
491,
1009,
4180,
1156,
13,
4706,
6694,
363,
445,
1784,
23238,
313,
262,
3133,
292,
9595,
29892,
445,
338,
278,
13,
4706,
1353,
310,
3064,
278,
3414,
338,
10715,
287,
467,
1152,
1342,
29892,
565,
1156,
353,
448,
29896,
29900,
29892,
13,
4706,
769,
871,
278,
1833,
29871,
29896,
29900,
3639,
515,
6694,
29914,
24219,
362,
526,
4586,
13,
4706,
964,
3633,
746,
17420,
278,
11266,
16744,
29889,
1094,
9670,
29892,
6374,
13,
4706,
1819,
2380,
515,
278,
4565,
29892,
322,
8178,
1819,
2380,
515,
278,
1250,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
4706,
302,
29899,
23583,
310,
29871,
29906,
29899,
23583,
29898,
524,
29892,
5785,
29897,
13,
1678,
319,
18761,
411,
278,
1353,
310,
3161,
5186,
304,
278,
3001,
1353,
310,
13,
1678,
11266,
15501,
18240,
29889,
7806,
1014,
29899,
23583,
338,
263,
18761,
310,
313,
24947,
15501,
13,
1678,
4444,
1353,
29892,
2099,
736,
975,
599,
6057,
322,
23238,
29897,
13,
1678,
9995,
13,
1678,
565,
1134,
29918,
451,
297,
4852,
14968,
613,
376,
14513,
29908,
1125,
13,
4706,
12020,
7865,
2392,
703,
1853,
29918,
881,
367,
697,
310,
525,
14968,
742,
525,
14513,
29915,
1159,
13,
13,
1678,
736,
29918,
1853,
353,
376,
14968,
29918,
1022,
275,
356,
29918,
276,
2935,
29908,
565,
1134,
29918,
1275,
376,
14968,
29908,
320,
13,
4706,
1683,
376,
14513,
29918,
1022,
275,
356,
29918,
276,
2935,
29908,
13,
13,
1678,
2099,
29918,
18280,
353,
5159,
13,
1678,
298,
29886,
29918,
11027,
353,
12705,
29898,
1761,
29898,
1272,
3366,
735,
15362,
29918,
1272,
16862,
8149,
22130,
13,
1678,
363,
298,
29886,
29918,
26740,
297,
298,
29886,
29918,
11027,
29901,
13,
4706,
298,
29886,
29918,
18280,
353,
5159,
13,
4706,
363,
1065,
297,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
28887,
29918,
26740,
29962,
3366,
3389,
29879,
3108,
29901,
13,
9651,
298,
29886,
29918,
18280,
29889,
4397,
29898,
3389,
29961,
2457,
29918,
1853,
2314,
13,
4706,
298,
29886,
29918,
18280,
353,
7442,
29889,
1429,
29898,
28887,
29918,
18280,
29897,
13,
13,
4706,
396,
960,
6161,
1218,
29892,
671,
278,
2099,
736,
975,
599,
23238,
363,
1269,
13,
4706,
396,
17983,
7292,
29889,
2193,
338,
29892,
565,
29871,
29896,
29900,
19745,
23238,
363,
1269,
17983,
13,
4706,
396,
278,
2125,
278,
6588,
736,
975,
599,
1438,
19745,
23238,
13,
4706,
565,
1134,
29918,
1275,
376,
14513,
1115,
13,
9651,
298,
29886,
29918,
18280,
353,
298,
29886,
29918,
18280,
29889,
12676,
29898,
8990,
10457,
29896,
29897,
13,
13,
4706,
396,
20535,
403,
278,
6588,
736,
975,
599,
6057,
13,
4706,
298,
29886,
29918,
18280,
353,
298,
29886,
29918,
18280,
29961,
7045,
29901,
29892,
584,
1822,
12676,
29898,
8990,
29922,
29900,
29897,
13,
13,
4706,
396,
20535,
403,
278,
6588,
736,
975,
599,
376,
1022,
275,
2631,
29908,
13,
4706,
298,
29886,
29918,
18280,
353,
298,
29886,
29918,
18280,
29889,
12676,
29898,
8990,
29922,
29900,
29897,
13,
13,
4706,
396,
16913,
2099,
736,
13,
4706,
2099,
29918,
18280,
29889,
4397,
29898,
28887,
29918,
18280,
29897,
13,
13,
1678,
396,
7106,
278,
1900,
11266,
3207,
6055,
297,
1797,
411,
278,
13,
1678,
396,
2099,
3639,
12705,
491,
11266,
862,
29885,
1008,
4444,
4180,
13,
1678,
1900,
29918,
28887,
29918,
11027,
353,
7442,
29889,
5085,
441,
29898,
12676,
29918,
18280,
29897,
13,
1678,
2099,
29918,
18280,
353,
7442,
29889,
2378,
29898,
12676,
29918,
18280,
9601,
13318,
29918,
28887,
29918,
11027,
29962,
13,
13,
1678,
736,
18761,
29898,
7554,
29898,
13318,
29918,
28887,
29918,
11027,
29892,
2099,
29918,
18280,
876,
13,
13,
13,
1753,
14405,
29918,
3389,
29879,
29898,
1272,
29896,
29892,
848,
29906,
1125,
13,
1678,
9995,
13,
1678,
3462,
29879,
278,
6057,
363,
1269,
11266,
15501,
4444,
297,
848,
29906,
304,
278,
6057,
363,
278,
13,
1678,
6590,
11266,
15501,
4444,
297,
848,
29896,
29889,
13,
13,
1678,
11221,
1023,
848,
21503,
4314,
29892,
445,
740,
674,
679,
1269,
11266,
15501,
13,
1678,
4444,
322,
10985,
278,
6057,
2309,
373,
445,
11266,
15501,
4444,
322,
7160,
13,
1678,
297,
848,
29896,
491,
278,
6057,
310,
445,
11266,
15501,
4444,
322,
7160,
297,
848,
29906,
29889,
13,
1678,
512,
3273,
29892,
445,
740,
4988,
278,
8857,
13,
1678,
848,
29896,
3366,
735,
15362,
29918,
1272,
3108,
29961,
29875,
29962,
3366,
3389,
29879,
3108,
491,
278,
8857,
13,
1678,
848,
29906,
3366,
735,
15362,
29918,
1272,
3108,
29961,
29875,
29962,
3366,
3389,
29879,
3108,
363,
599,
474,
29889,
910,
338,
5407,
565,
13,
1678,
2999,
6057,
526,
2309,
472,
1422,
3064,
29892,
322,
278,
1023,
848,
2066,
817,
13,
1678,
304,
367,
12420,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
29896,
584,
9657,
13,
4706,
319,
848,
8600,
408,
5759,
491,
1667,
29889,
2272,
13,
1678,
848,
29906,
584,
9657,
13,
4706,
319,
848,
8600,
408,
5759,
491,
1667,
29889,
2272,
13,
13,
1678,
390,
1759,
267,
13,
1678,
448,
23648,
13,
1678,
7670,
2392,
13,
4706,
960,
263,
11266,
15501,
4444,
4864,
297,
848,
29906,
541,
451,
297,
848,
29896,
29889,
910,
13,
4706,
18470,
393,
278,
11266,
15501,
6055,
16285,
526,
1556,
5517,
13,
4706,
1422,
29892,
577,
278,
11266,
15501,
2380,
474,
297,
848,
29896,
947,
451,
3928,
13,
4706,
304,
278,
1021,
11266,
15501,
2380,
297,
848,
29906,
29889,
512,
6124,
29892,
599,
916,
13,
4706,
3168,
2149,
278,
1353,
310,
6057,
304,
367,
13747,
363,
1269,
13,
4706,
11266,
15501,
4444,
29892,
607,
723,
367,
5537,
630,
297,
445,
1206,
29889,
13,
1678,
9995,
13,
1678,
363,
298,
29886,
29918,
26740,
297,
848,
29896,
3366,
735,
15362,
29918,
1272,
3108,
29901,
13,
4706,
565,
298,
29886,
29918,
26740,
451,
297,
848,
29906,
29889,
8149,
7295,
13,
9651,
396,
22521,
545,
13747,
11266,
3207,
6055,
16285,
13,
9651,
12020,
7670,
2392,
703,
24947,
15501,
6055,
526,
1422,
376,
718,
13,
462,
965,
376,
14811,
278,
1023,
15729,
1159,
13,
13,
4706,
4805,
29918,
3389,
29879,
353,
848,
29906,
3366,
735,
15362,
29918,
1272,
3108,
29961,
28887,
29918,
26740,
29962,
3366,
3389,
29879,
3108,
13,
4706,
848,
29896,
3366,
735,
15362,
29918,
1272,
3108,
29961,
28887,
29918,
26740,
29962,
3366,
3389,
29879,
16862,
21843,
29898,
17833,
29918,
3389,
29879,
29897,
13,
13,
13,
1753,
679,
29918,
18280,
29898,
1272,
29892,
1134,
3383,
1399,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
278,
3639,
3595,
491,
385,
10823,
13,
13,
1678,
402,
1691,
278,
7395,
470,
1283,
1220,
3639,
3595,
491,
385,
10823,
16370,
411,
13,
1678,
11266,
15501,
6055,
2380,
1399,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
9657,
13,
4706,
450,
5132,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
1134,
29918,
584,
851,
13,
4706,
26460,
304,
679,
278,
6694,
470,
17983,
3639,
29892,
697,
310,
525,
14968,
742,
13,
4706,
525,
14513,
29915,
13,
1678,
1399,
584,
938,
13,
4706,
402,
1691,
278,
3639,
310,
278,
10823,
16370,
411,
445,
11266,
15501,
13,
4706,
6055,
2380,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
1409,
29918,
4561,
13,
4706,
450,
1409,
310,
3639,
310,
278,
883,
313,
29940,
29892,
390,
29892,
315,
29897,
988,
405,
338,
278,
1353,
310,
13,
4706,
6057,
29892,
390,
338,
278,
1353,
310,
3064,
263,
4180,
471,
17005,
29892,
322,
315,
338,
278,
13,
4706,
1353,
310,
3639,
5759,
1269,
931,
4180,
471,
17005,
13,
4706,
313,
2696,
1220,
6736,
29871,
29896,
29936,
7395,
353,
29871,
29896,
467,
1152,
278,
7395,
4444,
29892,
405,
338,
278,
1353,
310,
13,
4706,
6057,
29892,
322,
390,
338,
278,
1353,
310,
23238,
322,
315,
353,
29871,
29896,
29889,
1152,
278,
1283,
1220,
13,
4706,
4444,
29892,
405,
338,
278,
1353,
310,
6057,
29892,
390,
338,
278,
1353,
310,
3064,
1283,
1220,
13,
4706,
17983,
471,
8560,
29892,
322,
315,
338,
278,
1353,
310,
23238,
1065,
1269,
13,
4706,
931,
4180,
471,
19030,
1283,
1220,
29889,
13,
1678,
9995,
13,
1678,
3639,
353,
5159,
13,
1678,
565,
1134,
29918,
1275,
376,
14513,
1115,
13,
4706,
396,
3617,
278,
1283,
1220,
17983,
12720,
3639,
639,
1065,
13,
4706,
363,
1065,
297,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
513,
29962,
3366,
3389,
29879,
3108,
29901,
13,
9651,
3639,
29889,
4397,
29898,
3389,
3366,
14513,
29918,
1022,
275,
356,
29918,
276,
2935,
20068,
13,
4706,
3639,
353,
7442,
29889,
1429,
29898,
18280,
29897,
13,
13,
1678,
25342,
1134,
29918,
1275,
376,
14968,
1115,
13,
4706,
396,
3617,
278,
3639,
639,
12720,
639,
1065,
13,
4706,
363,
1065,
297,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
513,
29962,
3366,
3389,
29879,
3108,
29901,
13,
9651,
3639,
29889,
4397,
29898,
3389,
3366,
14968,
29918,
1022,
275,
356,
29918,
276,
2935,
20068,
13,
4706,
3639,
353,
7442,
29889,
18837,
29918,
6229,
29879,
29898,
9302,
29889,
1429,
29898,
18280,
511,
9685,
29922,
29906,
29897,
13,
13,
1678,
736,
3639,
13,
13,
13,
1753,
679,
29918,
24947,
7529,
29898,
1272,
29892,
1399,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
278,
11266,
16744,
363,
11266,
15501,
6055,
2380,
1399,
13,
13,
1678,
848,
584,
9657,
13,
4706,
450,
5132,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
1399,
584,
938,
13,
4706,
402,
1691,
278,
3639,
310,
278,
10823,
16370,
411,
445,
11266,
15501,
13,
4706,
6055,
2380,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
9657,
13,
4706,
450,
8600,
310,
11266,
16744,
13,
1678,
9995,
13,
1678,
736,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
513,
29962,
3366,
14748,
29918,
7529,
3108,
13,
13,
13,
1753,
679,
29918,
12676,
29918,
18280,
29918,
2541,
29918,
303,
20405,
29918,
28887,
29918,
29894,
653,
292,
29898,
1272,
29892,
1134,
3383,
298,
29886,
29918,
978,
29892,
419,
833,
29892,
13,
462,
462,
9651,
1156,
29922,
29900,
1125,
13,
1678,
9995,
13,
1678,
20535,
403,
2099,
322,
3918,
1059,
310,
736,
363,
1269,
11266,
15501,
995,
29889,
13,
13,
1678,
402,
1691,
278,
2099,
3639,
363,
1269,
19262,
310,
263,
2323,
11266,
15501,
29892,
13,
1678,
411,
599,
916,
11266,
16744,
9886,
4868,
29889,
4001,
727,
526,
13,
1678,
1784,
1422,
5837,
445,
508,
3799,
313,
1552,
11266,
15501,
508,
13100,
13,
1678,
411,
599,
916,
9886,
4868,
29892,
541,
727,
526,
1784,
18240,
13,
1678,
310,
1438,
4868,
11266,
16744,
511,
278,
419,
833,
2980,
25785,
1549,
13,
1678,
278,
18240,
310,
4868,
11266,
16744,
29889,
13,
13,
1678,
11221,
11266,
16744,
263,
29892,
289,
29892,
322,
274,
29892,
1235,
29915,
29879,
1827,
591,
864,
304,
679,
599,
13,
1678,
11266,
15501,
6055,
16285,
988,
263,
722,
583,
29892,
322,
289,
322,
274,
526,
4868,
29889,
13,
1678,
565,
263,
29892,
289,
29892,
322,
274,
508,
1269,
367,
29871,
29896,
470,
29871,
29906,
29892,
769,
727,
526,
3023,
5837,
393,
263,
508,
13,
1678,
13100,
411,
289,
322,
274,
9886,
4868,
29901,
13,
13,
4706,
518,
13,
9651,
5135,
29874,
29922,
29896,
29892,
289,
29922,
29896,
29892,
274,
29922,
29896,
511,
313,
29874,
29922,
29906,
29892,
289,
29922,
29896,
29892,
274,
29922,
29896,
8243,
308,
419,
833,
353,
29871,
29900,
13,
9651,
5135,
29874,
29922,
29896,
29892,
289,
29922,
29906,
29892,
274,
29922,
29896,
511,
313,
29874,
29922,
29906,
29892,
289,
29922,
29906,
29892,
274,
29922,
29896,
8243,
308,
419,
833,
353,
29871,
29896,
13,
9651,
5135,
29874,
29922,
29896,
29892,
289,
29922,
29896,
29892,
274,
29922,
29906,
511,
313,
29874,
29922,
29906,
29892,
289,
29922,
29896,
29892,
274,
29922,
29906,
8243,
308,
419,
833,
353,
29871,
29906,
13,
9651,
5135,
29874,
29922,
29896,
29892,
289,
29922,
29906,
29892,
274,
29922,
29906,
511,
313,
29874,
29922,
29906,
29892,
289,
29922,
29906,
29892,
274,
29922,
29906,
876,
3986,
419,
833,
353,
29871,
29941,
13,
4706,
4514,
13,
13,
1678,
450,
419,
833,
2980,
18111,
964,
445,
1051,
310,
11266,
15501,
6055,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
9657,
13,
4706,
450,
5132,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
1134,
29918,
584,
851,
13,
4706,
8449,
1134,
310,
848,
304,
6492,
29892,
697,
310,
376,
14513,
29908,
470,
376,
14968,
29908,
13,
1678,
419,
833,
584,
938,
13,
4706,
5953,
837,
1475,
278,
1819,
310,
278,
4868,
11266,
16744,
29889,
11221,
393,
13,
4706,
871,
697,
11266,
15501,
1122,
13100,
29892,
727,
526,
1784,
1422,
6166,
13,
4706,
2534,
445,
11266,
15501,
24099,
411,
599,
4045,
9886,
4868,
13,
4706,
1951,
1269,
4868,
11266,
15501,
1122,
2125,
373,
1784,
1819,
29889,
910,
13,
4706,
2980,
25785,
1549,
599,
6166,
310,
11266,
15501,
6055,
16285,
13,
4706,
393,
505,
871,
697,
11266,
15501,
24099,
322,
599,
4045,
4868,
29889,
13,
1678,
9995,
13,
1678,
298,
29886,
29918,
510,
833,
353,
679,
29918,
29894,
653,
292,
29918,
14369,
29918,
24947,
3207,
29898,
1272,
29892,
298,
29886,
29918,
978,
9601,
510,
833,
29962,
13,
13,
1678,
2099,
29918,
18280,
353,
5159,
13,
1678,
380,
20405,
29918,
18280,
353,
5159,
13,
1678,
363,
298,
29886,
297,
298,
29886,
29918,
510,
833,
29901,
13,
4706,
2099,
29918,
2457,
353,
679,
29918,
18280,
29898,
1272,
29892,
1134,
3383,
298,
29886,
29897,
13,
13,
4706,
396,
960,
6161,
1218,
29892,
671,
278,
2099,
736,
975,
599,
23238,
363,
1269,
13,
4706,
396,
17983,
7292,
29889,
2193,
338,
29892,
565,
29871,
29896,
29900,
19745,
23238,
363,
1269,
17983,
13,
4706,
396,
278,
2125,
278,
6588,
736,
975,
599,
1438,
19745,
23238,
29889,
13,
4706,
396,
960,
7395,
3639,
29892,
445,
9685,
756,
263,
3309,
310,
29871,
29896,
577,
591,
10032,
372,
13,
4706,
2099,
29918,
2457,
353,
2099,
29918,
2457,
29889,
12676,
29898,
8990,
10457,
29896,
29897,
13,
13,
4706,
396,
20535,
403,
278,
6588,
736,
975,
599,
376,
1022,
275,
2631,
29908,
13,
4706,
396,
1596,
29898,
12676,
29918,
2457,
7503,
29892,
1156,
29901,
1822,
12181,
29897,
13,
4706,
2099,
29918,
2457,
353,
2099,
29918,
2457,
7503,
29892,
1156,
29901,
1822,
12676,
29898,
8990,
29922,
29896,
29897,
13,
13,
4706,
396,
20535,
403,
278,
6588,
736,
975,
599,
6057,
13,
4706,
380,
20405,
29918,
2457,
353,
7442,
29889,
4172,
29898,
12676,
29918,
2457,
29892,
9685,
29922,
29900,
29897,
847,
320,
13,
9651,
7442,
29889,
3676,
29898,
12676,
29918,
2457,
29889,
12181,
29961,
29900,
2314,
13,
4706,
2099,
29918,
2457,
353,
2099,
29918,
2457,
29889,
12676,
29898,
8990,
29922,
29900,
29897,
13,
13,
4706,
2099,
29918,
18280,
29889,
4397,
29898,
12676,
29918,
2457,
29897,
13,
4706,
380,
20405,
29918,
18280,
29889,
4397,
29898,
303,
20405,
29918,
2457,
29897,
13,
13,
1678,
396,
3617,
1269,
298,
29886,
995,
322,
2656,
599,
2582,
491,
298,
29886,
995,
13,
1678,
298,
29886,
29918,
5975,
353,
7442,
29889,
2378,
29898,
1272,
3366,
735,
15362,
3108,
3366,
14748,
3108,
3366,
16744,
3108,
29961,
28887,
29918,
978,
2314,
13,
1678,
16285,
353,
7442,
29889,
5085,
441,
29898,
28887,
29918,
5975,
29897,
13,
13,
1678,
2099,
29918,
18280,
353,
7442,
29889,
2378,
29898,
12676,
29918,
18280,
9601,
513,
1575,
29962,
13,
1678,
380,
20405,
29918,
18280,
353,
7442,
29889,
2378,
29898,
303,
20405,
29918,
18280,
9601,
513,
1575,
29962,
13,
1678,
298,
29886,
29918,
5975,
353,
298,
29886,
29918,
5975,
29961,
513,
1575,
29962,
13,
13,
1678,
736,
298,
29886,
29918,
5975,
29892,
2099,
29918,
18280,
29892,
380,
20405,
29918,
18280,
13,
13,
13,
1753,
679,
29918,
12676,
29918,
303,
20405,
29898,
1272,
29892,
1134,
3383,
1399,
29892,
10597,
29918,
957,
1125,
13,
1678,
9995,
13,
1678,
402,
1691,
278,
5335,
4196,
567,
29892,
2099,
29892,
322,
3918,
1059,
304,
367,
715,
15048,
363,
13,
1678,
263,
2183,
11266,
15501,
6055,
2380,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
9657,
13,
4706,
450,
5132,
848,
8600,
5759,
515,
2734,
1667,
29889,
2272,
13,
1678,
1134,
29918,
584,
851,
13,
4706,
8449,
1134,
310,
848,
304,
6492,
29892,
697,
310,
376,
14513,
29908,
470,
376,
14968,
29908,
13,
1678,
1399,
584,
938,
13,
4706,
450,
11266,
15501,
6055,
2380,
304,
6492,
13,
1678,
10597,
29918,
957,
584,
938,
13,
4706,
450,
1353,
310,
3517,
848,
3291,
304,
10597,
975,
29889,
3940,
393,
445,
13,
4706,
338,
334,
1333,
29930,
278,
1353,
310,
5335,
4196,
567,
304,
10597,
975,
29892,
541,
3265,
278,
1353,
13,
4706,
310,
848,
3291,
304,
10597,
975,
29889,
1152,
1342,
29892,
565,
366,
4078,
278,
736,
13,
4706,
1432,
29871,
29896,
29892,
29900,
29900,
29900,
5335,
4196,
567,
29892,
769,
4444,
445,
995,
304,
29871,
29896,
29945,
674,
10597,
13,
4706,
975,
278,
1833,
29871,
29896,
29945,
1303,
886,
29892,
470,
29871,
29896,
29945,
29892,
29900,
29900,
29900,
5335,
4196,
567,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
268,
29941,
29899,
23583,
310,
1051,
29898,
524,
511,
1051,
29898,
7411,
511,
1051,
29898,
7411,
29897,
13,
4706,
450,
5335,
4196,
567,
29892,
2099,
6010,
397,
293,
3639,
29892,
322,
3918,
4436,
310,
278,
13,
4706,
6010,
397,
293,
3639,
13,
1678,
9995,
13,
1678,
5335,
4196,
567,
353,
6213,
29871,
396,
1105,
278,
301,
1639,
1838,
29915,
29873,
505,
263,
6238,
11172,
5848,
13,
13,
1678,
396,
5953,
837,
457,
278,
5335,
4196,
567,
304,
6492,
472,
13,
1678,
565,
1134,
29918,
1275,
376,
14513,
1115,
13,
4706,
5335,
4196,
567,
353,
320,
13,
9651,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
513,
29962,
3366,
3389,
29879,
3108,
29961,
29900,
29962,
3366,
9346,
4196,
567,
29918,
271,
29918,
14513,
3108,
13,
13,
1678,
25342,
1134,
29918,
1275,
376,
14968,
1115,
13,
4706,
5335,
4196,
567,
29918,
546,
29918,
1022,
353,
320,
13,
9651,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
513,
29962,
3366,
3389,
29879,
3108,
29961,
29900,
29962,
3366,
14968,
29918,
1022,
275,
356,
29918,
24530,
3108,
13,
4706,
5335,
4196,
567,
353,
679,
29918,
29883,
398,
28524,
29918,
9346,
4196,
567,
29898,
9346,
4196,
567,
29918,
546,
29918,
1022,
29897,
13,
13,
1678,
396,
3617,
278,
2099,
975,
599,
23238,
639,
17983,
4331,
313,
1454,
7395,
13,
1678,
396,
3639,
29892,
445,
9685,
674,
505,
3309,
29871,
29896,
577,
591,
269,
802,
29872,
911,
372,
29897,
13,
1678,
3639,
353,
679,
29918,
18280,
29898,
1272,
29892,
1134,
3383,
1399,
29897,
13,
1678,
2099,
353,
3639,
29889,
12676,
29898,
8990,
10457,
29896,
29897,
13,
13,
1678,
396,
3617,
278,
3918,
29522,
310,
2099,
23238,
639,
17983,
13,
1678,
396,
4331,
975,
599,
6057,
13,
1678,
6057,
353,
3639,
29889,
12181,
29961,
29900,
29962,
13,
1678,
3659,
353,
7442,
29889,
4172,
29898,
12676,
29892,
9685,
29922,
29900,
29897,
847,
7442,
29889,
3676,
29898,
3389,
29879,
29897,
13,
13,
1678,
396,
3617,
278,
2099,
975,
599,
6057,
13,
1678,
2099,
353,
2099,
29889,
12676,
29898,
8990,
29922,
29900,
29897,
13,
13,
1678,
396,
4116,
6983,
310,
1833,
413,
3639,
565,
22903,
29892,
378,
1555,
345,
674,
12919,
871,
13,
1678,
396,
1369,
2243,
4821,
515,
278,
6763,
29892,
577,
591,
817,
304,
5700,
1283,
278,
2847,
13,
1678,
396,
4759,
1179,
607,
526,
28907,
13,
1678,
565,
10597,
29918,
957,
1405,
29871,
29896,
29901,
13,
4706,
2099,
353,
7442,
29889,
535,
1555,
345,
29898,
12676,
29892,
7442,
29889,
2873,
29898,
3844,
6983,
29918,
957,
29897,
847,
13,
462,
965,
10597,
29918,
957,
29892,
4464,
543,
3084,
1159,
14330,
3844,
6983,
29918,
957,
29901,
12676,
29889,
12181,
29961,
29900,
5262,
13,
4706,
3659,
353,
7442,
29889,
535,
1555,
345,
29898,
4172,
29892,
7442,
29889,
2873,
29898,
3844,
6983,
29918,
957,
29897,
847,
13,
462,
965,
10597,
29918,
957,
29892,
4464,
543,
3084,
1159,
14330,
3844,
6983,
29918,
957,
29901,
4172,
29889,
12181,
29961,
29900,
5262,
13,
13,
4706,
396,
7442,
29889,
535,
1555,
345,
871,
5771,
2745,
278,
1833,
1543,
310,
278,
26851,
13,
4706,
396,
3454,
701,
411,
278,
1833,
1543,
310,
278,
848,
29892,
577,
10597,
29918,
957,
3161,
13,
4706,
396,
674,
367,
5714,
13,
4706,
5335,
4196,
567,
353,
5335,
4196,
567,
7503,
29899,
3844,
6983,
29918,
957,
718,
29871,
29896,
29962,
13,
13,
1678,
736,
5335,
4196,
567,
29892,
2099,
29892,
3659,
13,
13,
13,
1753,
679,
29918,
29883,
398,
28524,
29918,
9346,
4196,
567,
29898,
9346,
4196,
567,
29918,
546,
29918,
1022,
275,
356,
1125,
13,
1678,
9995,
13,
1678,
6760,
1078,
385,
1409,
310,
13299,
28524,
5335,
4196,
567,
29889,
13,
13,
1678,
6760,
1078,
385,
1409,
310,
5335,
4196,
567,
29892,
988,
1269,
5335,
342,
1022,
338,
278,
13299,
28524,
13,
1678,
1353,
310,
5335,
4196,
567,
701,
2745,
393,
1298,
29889,
910,
338,
4312,
363,
6492,
1259,
278,
13,
1678,
6694,
848,
29892,
988,
29871,
278,
6694,
5335,
4196,
567,
526,
6087,
363,
1269,
12720,
29892,
13,
1678,
322,
591,
817,
304,
6492,
373,
278,
921,
29899,
8990,
278,
13299,
28524,
5335,
4196,
567,
29892,
451,
278,
13,
1678,
5335,
4196,
567,
639,
12720,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
5335,
4196,
567,
29918,
546,
29918,
1022,
275,
356,
584,
1051,
13,
4706,
319,
1051,
988,
1269,
1543,
297,
278,
1051,
20169,
278,
5253,
310,
5335,
4196,
567,
13,
4706,
363,
278,
6590,
12720,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
1409,
29918,
4561,
13,
4706,
530,
1409,
988,
1269,
1543,
338,
278,
13299,
28524,
1353,
310,
5335,
4196,
567,
701,
13,
4706,
2745,
393,
1298,
29889,
13,
1678,
9995,
13,
1678,
5335,
4196,
567,
29918,
546,
29918,
1022,
275,
356,
353,
7442,
29889,
2378,
29898,
9346,
4196,
567,
29918,
546,
29918,
1022,
275,
356,
29897,
13,
1678,
13299,
28524,
29918,
9346,
4196,
567,
353,
518,
9346,
4196,
567,
29918,
546,
29918,
1022,
275,
356,
7503,
29875,
1822,
2083,
580,
13,
462,
9651,
363,
474,
297,
3464,
29898,
9346,
4196,
567,
29918,
546,
29918,
1022,
275,
356,
29889,
12181,
29961,
29900,
2314,
29962,
13,
13,
1678,
736,
7442,
29889,
2378,
29898,
29883,
398,
28524,
29918,
9346,
4196,
567,
29897,
13,
13,
13,
13,
1753,
14405,
29918,
1272,
29918,
29467,
4314,
29898,
5325,
29892,
4078,
29922,
5574,
29892,
4078,
29918,
3972,
543,
19602,
10422,
543,
1272,
29908,
1125,
13,
1678,
9995,
13,
1678,
422,
26062,
848,
21503,
4314,
2183,
263,
1051,
310,
977,
264,
1280,
13,
13,
1678,
11221,
263,
1051,
310,
10898,
304,
848,
21503,
4314,
29892,
4145,
1475,
1269,
848,
8600,
13,
1678,
964,
263,
2323,
697,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
2066,
584,
1051,
310,
851,
13,
4706,
319,
1051,
310,
278,
10898,
304,
848,
8600,
2066,
304,
14405,
13,
1678,
4078,
584,
6120,
13,
4706,
26460,
470,
451,
304,
4078,
278,
848,
13,
1678,
4078,
29918,
3972,
584,
851,
29892,
13136,
13,
4706,
450,
3884,
6943,
278,
7160,
21503,
4314,
13,
1678,
10422,
584,
851,
29892,
13136,
13,
4706,
450,
1024,
310,
278,
934,
304,
4078,
607,
14422,
278,
12420,
848,
29892,
491,
2322,
13,
4706,
525,
1272,
29915,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
9657,
13,
4706,
450,
12420,
8600,
13,
1678,
9995,
13,
1678,
396,
4803,
937,
8600,
408,
2967,
8600,
13,
1678,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
7620,
29918,
3972,
29892,
2066,
29961,
29900,
11724,
376,
6050,
1159,
408,
297,
29918,
1445,
29901,
13,
4706,
848,
353,
5839,
280,
29889,
1359,
29898,
262,
29918,
1445,
29897,
13,
13,
1678,
396,
3462,
848,
515,
599,
916,
21503,
4314,
13,
1678,
363,
934,
297,
2066,
29961,
29896,
29901,
5387,
13,
4706,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
7620,
29918,
3972,
29892,
934,
511,
376,
6050,
1159,
408,
297,
29918,
1445,
29901,
13,
9651,
396,
7523,
297,
278,
716,
8600,
13,
9651,
297,
29918,
1272,
353,
5839,
280,
29889,
1359,
29898,
262,
29918,
1445,
29897,
13,
13,
9651,
396,
3462,
7639,
848,
304,
2734,
8600,
13,
9651,
363,
1820,
297,
297,
29918,
1272,
3366,
735,
15362,
29918,
1272,
3108,
29901,
13,
18884,
396,
5399,
565,
1820,
4864,
13,
18884,
565,
1820,
297,
848,
3366,
735,
15362,
29918,
1272,
3108,
29901,
13,
462,
1678,
396,
22871,
848,
565,
5923,
13,
462,
1678,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
1989,
29962,
3366,
3389,
29879,
3108,
320,
13,
462,
4706,
869,
21843,
29898,
262,
29918,
1272,
3366,
735,
15362,
29918,
1272,
3108,
29961,
1989,
29962,
3366,
3389,
29879,
20068,
13,
13,
18884,
1683,
29901,
13,
462,
1678,
396,
7670,
1838,
29915,
29873,
1863,
448,
788,
848,
304,
8600,
13,
462,
1678,
848,
3366,
735,
15362,
29918,
1272,
3108,
29961,
1989,
29962,
353,
320,
13,
462,
4706,
297,
29918,
1272,
3366,
735,
15362,
29918,
1272,
3108,
29961,
1989,
29962,
13,
13,
1678,
565,
4078,
29901,
13,
4706,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
7620,
29918,
3972,
29892,
285,
29908,
29912,
9507,
1836,
29886,
6321,
4968,
376,
29893,
29890,
1159,
408,
714,
29918,
1445,
29901,
13,
9651,
5839,
280,
29889,
15070,
29898,
1272,
29892,
714,
29918,
1445,
29897,
13,
13,
1678,
736,
848,
13,
2
] |
lib/ExtraFM.py | KanHatakeyama/anneal_project2 | 0 | 98890 | <reponame>KanHatakeyama/anneal_project2
from scipy.sparse import csr_matrix
from pyfm import pylibfm
import numpy as np
from numba import jit
from ScaleRegressor import ScaleRegressor
default_model = pylibfm.FM(task="regression", num_iter=30, initial_learning_rate=10**-3,
num_factors=10,
verbose=False
)
class ExtraFM:
def __init__(self, model=None):
if model is None:
model = default_model
self.model = model
def fit(self, X, y):
sparse_X = csr_matrix(X.astype("double"))
self.model.fit(sparse_X, y)
# self.qubo=calc_qubo(self.model.v,self.model.v[0].shape[0],self.model.v.shape[0])+np.diag(self.model.w)
# calc offset
self.b = self.model.predict(csr_matrix(
np.zeros(X[0].shape[0]).astype("double")))
# self.y_max=max(y)
self.y_max = 0
# self.y_max=max(y)
self.y_min = 0
def predict(self, X):
y = self.original_predict(X, reg_mode=False)
# print(X.shape,y.shape)
y = -np.log((1-y)/y)
# fill nan
nan_ids = np.where(y == np.inf)
y[nan_ids] = self.y_max
nan_ids = np.where(y == -np.inf)
y[nan_ids] = self.y_min
return y
def original_predict(self, X, reg_mode=True):
if reg_mode:
self.model.fm_fast.task = 0
else:
self.model.fm_fast.task = 1
sparse_X = csr_matrix(X.astype("double"))
return self.model.predict(sparse_X)
@jit
def calc_qubo(v, dim1, dim2):
qubo = np.zeros((dim1, dim1))
for k in range(dim2):
for i in range(dim1):
for j in range(i):
val = v[k][j]*v[k][i]
qubo[j, i] += val
return qubo
class FMRegressor(ScaleRegressor):
def fit(self, X, y):
X = csr_matrix(X).astype(np.double)
return super().fit(X, y)
def predict(self, X):
X = csr_matrix(X).astype(np.double)
return super().predict(X)
| [
1,
529,
276,
1112,
420,
29958,
29968,
273,
29950,
532,
1989,
3304,
29914,
11276,
284,
29918,
4836,
29906,
13,
3166,
4560,
2272,
29889,
29879,
5510,
1053,
5939,
29878,
29918,
5344,
13,
3166,
11451,
24826,
1053,
11451,
492,
1635,
29885,
13,
5215,
12655,
408,
7442,
13,
3166,
954,
2291,
1053,
432,
277,
13,
3166,
2522,
744,
4597,
1253,
272,
1053,
2522,
744,
4597,
1253,
272,
13,
13,
4381,
29918,
4299,
353,
11451,
492,
1635,
29885,
29889,
22192,
29898,
7662,
543,
276,
11476,
613,
954,
29918,
1524,
29922,
29941,
29900,
29892,
2847,
29918,
21891,
29918,
10492,
29922,
29896,
29900,
1068,
29899,
29941,
29892,
13,
462,
965,
954,
29918,
17028,
943,
29922,
29896,
29900,
29892,
13,
462,
965,
26952,
29922,
8824,
13,
462,
965,
1723,
13,
13,
13,
1990,
7338,
336,
22192,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1904,
29922,
8516,
1125,
13,
4706,
565,
1904,
338,
6213,
29901,
13,
9651,
1904,
353,
2322,
29918,
4299,
13,
4706,
1583,
29889,
4299,
353,
1904,
13,
13,
1678,
822,
6216,
29898,
1311,
29892,
1060,
29892,
343,
1125,
13,
4706,
29234,
29918,
29990,
353,
5939,
29878,
29918,
5344,
29898,
29990,
29889,
579,
668,
703,
8896,
5783,
13,
4706,
1583,
29889,
4299,
29889,
9202,
29898,
29879,
5510,
29918,
29990,
29892,
343,
29897,
13,
4706,
396,
1583,
29889,
339,
833,
29922,
28667,
29918,
339,
833,
29898,
1311,
29889,
4299,
29889,
29894,
29892,
1311,
29889,
4299,
29889,
29894,
29961,
29900,
1822,
12181,
29961,
29900,
1402,
1311,
29889,
4299,
29889,
29894,
29889,
12181,
29961,
29900,
2314,
29974,
9302,
29889,
6051,
351,
29898,
1311,
29889,
4299,
29889,
29893,
29897,
13,
13,
4706,
396,
22235,
9210,
13,
4706,
1583,
29889,
29890,
353,
1583,
29889,
4299,
29889,
27711,
29898,
2395,
29878,
29918,
5344,
29898,
13,
9651,
7442,
29889,
3298,
359,
29898,
29990,
29961,
29900,
1822,
12181,
29961,
29900,
14664,
579,
668,
703,
8896,
29908,
4961,
13,
13,
4706,
396,
1583,
29889,
29891,
29918,
3317,
29922,
3317,
29898,
29891,
29897,
13,
4706,
1583,
29889,
29891,
29918,
3317,
353,
29871,
29900,
13,
4706,
396,
1583,
29889,
29891,
29918,
3317,
29922,
3317,
29898,
29891,
29897,
13,
4706,
1583,
29889,
29891,
29918,
1195,
353,
29871,
29900,
13,
13,
1678,
822,
8500,
29898,
1311,
29892,
1060,
1125,
13,
4706,
343,
353,
1583,
29889,
13492,
29918,
27711,
29898,
29990,
29892,
1072,
29918,
8513,
29922,
8824,
29897,
13,
4706,
396,
1596,
29898,
29990,
29889,
12181,
29892,
29891,
29889,
12181,
29897,
13,
4706,
343,
353,
448,
9302,
29889,
1188,
3552,
29896,
29899,
29891,
6802,
29891,
29897,
13,
13,
4706,
396,
5445,
23432,
13,
4706,
23432,
29918,
4841,
353,
7442,
29889,
3062,
29898,
29891,
1275,
7442,
29889,
7192,
29897,
13,
4706,
343,
29961,
13707,
29918,
4841,
29962,
353,
1583,
29889,
29891,
29918,
3317,
13,
4706,
23432,
29918,
4841,
353,
7442,
29889,
3062,
29898,
29891,
1275,
448,
9302,
29889,
7192,
29897,
13,
4706,
343,
29961,
13707,
29918,
4841,
29962,
353,
1583,
29889,
29891,
29918,
1195,
13,
13,
4706,
736,
343,
13,
13,
1678,
822,
2441,
29918,
27711,
29898,
1311,
29892,
1060,
29892,
1072,
29918,
8513,
29922,
5574,
1125,
13,
4706,
565,
1072,
29918,
8513,
29901,
13,
9651,
1583,
29889,
4299,
29889,
24826,
29918,
11255,
29889,
7662,
353,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
4299,
29889,
24826,
29918,
11255,
29889,
7662,
353,
29871,
29896,
13,
4706,
29234,
29918,
29990,
353,
5939,
29878,
29918,
5344,
29898,
29990,
29889,
579,
668,
703,
8896,
5783,
13,
4706,
736,
1583,
29889,
4299,
29889,
27711,
29898,
29879,
5510,
29918,
29990,
29897,
13,
13,
13,
29992,
29926,
277,
13,
1753,
22235,
29918,
339,
833,
29898,
29894,
29892,
3964,
29896,
29892,
3964,
29906,
1125,
13,
1678,
439,
833,
353,
7442,
29889,
3298,
359,
3552,
6229,
29896,
29892,
3964,
29896,
876,
13,
13,
1678,
363,
413,
297,
3464,
29898,
6229,
29906,
1125,
13,
4706,
363,
474,
297,
3464,
29898,
6229,
29896,
1125,
13,
9651,
363,
432,
297,
3464,
29898,
29875,
1125,
13,
18884,
659,
353,
325,
29961,
29895,
3816,
29926,
14178,
29894,
29961,
29895,
3816,
29875,
29962,
13,
18884,
439,
833,
29961,
29926,
29892,
474,
29962,
4619,
659,
13,
1678,
736,
439,
833,
13,
13,
13,
1990,
20499,
4597,
1253,
272,
29898,
17185,
4597,
1253,
272,
1125,
13,
13,
1678,
822,
6216,
29898,
1311,
29892,
1060,
29892,
343,
1125,
13,
4706,
1060,
353,
5939,
29878,
29918,
5344,
29898,
29990,
467,
579,
668,
29898,
9302,
29889,
8896,
29897,
13,
4706,
736,
2428,
2141,
9202,
29898,
29990,
29892,
343,
29897,
13,
13,
1678,
822,
8500,
29898,
1311,
29892,
1060,
1125,
13,
4706,
1060,
353,
5939,
29878,
29918,
5344,
29898,
29990,
467,
579,
668,
29898,
9302,
29889,
8896,
29897,
13,
4706,
736,
2428,
2141,
27711,
29898,
29990,
29897,
13,
2
] |
test/swe2d/test_steady_state_basin_mms.py | jrper/thetis | 0 | 193326 | <reponame>jrper/thetis
"""
MMS test for 2d shallow water equations.
- setup functions define analytical expressions for fields and boundary
conditions. Expressions were derived with sympy.
- run function runs the MMS setup with a single mesh resolution, returning
L2 errors.
- run_convergence runs a scaling test, computes and asserts convergence rate.
"""
from thetis import *
import numpy
from scipy import stats
import pytest
def setup7(x, lx, ly, h0, f0, nu0, g):
"""
Non-trivial Coriolis, bath, elev, u and v, tangential velocity is zero at bnd to test flux BCs
"""
out = {}
out['bath_expr'] = h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + 4.0
out['cori_expr'] = f0*cos(pi*(x[0] + x[1])/lx)
out['elev_expr'] = cos(pi*(3.0*x[0] + 1.0*x[1])/lx)
out['uv_expr'] = as_vector(
[
sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*sin(pi*x[1]/ly),
0.5*sin(pi*x[0]/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx),
])
out['res_elev_expr'] = (0.3*h0*x[0]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) - 3.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*sin(pi*x[1]/ly) + 0.5*(0.2*h0*x[1]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) - 1.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*x[0]/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx) + 0.5*pi*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)*sin(pi*x[0]/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx - 2.0*pi*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)*sin(pi*x[1]/ly)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx
out['res_uv_expr'] = as_vector(
[
-0.5*f0*sin(pi*x[0]/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(x[0] + x[1])/lx) - 3.0*pi*g*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx + 0.5*(pi*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*cos(pi*x[1]/ly)/ly + 1.0*pi*sin(pi*x[1]/ly)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*x[0]/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx) - 2.0*pi*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*sin(pi*x[1]/ly)**2*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx,
f0*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*sin(pi*x[1]/ly)*cos(pi*(x[0] + x[1])/lx) - 1.0*pi*g*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx + (-1.5*pi*sin(pi*x[0]/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx + 0.5*pi*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*x[0]/lx)/lx)*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*sin(pi*x[1]/ly) + 0.25*pi*sin(pi*x[0]/lx)**2*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx,
])
out['bnd_funcs'] = {1: {'elev': None, 'flux_left': None},
2: {'flux_right': None},
3: {'elev': None, 'flux_lower': None},
4: {'un_upper': None},
}
return out
def setup8(x, lx, ly, h0, f0, nu0, g):
"""
Non-trivial Coriolis, bath, elev, u and v, tangential velocity is non-zero at bnd, must prescribe uv at boundary.
"""
out = {}
out['bath_expr'] = h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + 4.0
out['cori_expr'] = f0*cos(pi*(x[0] + x[1])/lx)
out['elev_expr'] = cos(pi*(3.0*x[0] + 1.0*x[1])/lx)
out['uv_expr'] = as_vector(
[
sin(pi*(-2.0*x[0] + 1.0*x[1])/lx),
0.5*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx),
])
out['res_elev_expr'] = (0.3*h0*x[0]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) - 3.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx) + 0.5*(0.2*h0*x[1]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) - 1.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx) + 0.5*pi*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx - 2.0*pi*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx
out['res_uv_expr'] = as_vector(
[
-0.5*f0*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(x[0] + x[1])/lx) - 3.0*pi*g*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx + 0.5*pi*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx - 2.0*pi*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx,
f0*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*cos(pi*(x[0] + x[1])/lx) - 1.0*pi*g*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx + 0.25*pi*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx - 1.5*pi*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx,
])
# NOTE uv condition alone does not work
out['bnd_funcs'] = {1: {'elev': None, 'uv': None},
2: {'elev': None, 'uv': None},
3: {'elev': None, 'uv': None},
4: {'elev': None, 'uv': None},
}
return out
def setup9(x, lx, ly, h0, f0, nu0, g):
"""
No Coriolis, non-trivial bath, viscosity, elev, u and v.
"""
out = {}
out['bath_expr'] = h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + 4.0
out['visc_expr'] = nu0*(1.0 + x[0]/lx)
out['elev_expr'] = cos(pi*(3.0*x[0] + 1.0*x[1])/lx)
out['uv_expr'] = as_vector(
[
sin(pi*(-2.0*x[0] + 1.0*x[1])/lx),
0.5*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx),
])
out['res_elev_expr'] = (0.3*h0*x[0]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) - 3.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx) + 0.5*(0.2*h0*x[1]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) - 1.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx) + 0.5*pi*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx - 2.0*pi*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx
out['res_uv_expr'] = as_vector(
[
-3.0*pi*g*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx - 4.0*pi*nu0*(1.0 + x[0]/lx)*(-0.3*h0*x[0]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) + 3.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/(lx*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)) + 0.5*pi*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx - 2.0*pi*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx - 1.5*pi**2*nu0*(1.0 + x[0]/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx**2 + 9.0*pi**2*nu0*(1.0 + x[0]/lx)*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx**2 + 4.0*pi*nu0*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx**2,
-1.0*pi*g*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx + 1.0*pi*nu0*(1.0 + x[0]/lx)*(-0.2*h0*x[1]/(lx*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)) + 1.0*pi*sin(pi*(3.0*x[0] + 1.0*x[1])/lx)/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/(lx*(h0*sqrt(0.3*x[0]**2 + 0.2*x[1]**2 + 0.1)/lx + cos(pi*(3.0*x[0] + 1.0*x[1])/lx) + 4.0)) + 0.25*pi*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx - 1.5*pi*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx + 5.5*pi**2*nu0*(1.0 + x[0]/lx)*sin(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx**2 - 2.0*pi**2*nu0*(1.0 + x[0]/lx)*sin(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx**2 + 1.5*pi*nu0*cos(pi*(-3.0*x[0] + 1.0*x[1])/lx)/lx**2 - 1.0*pi*nu0*cos(pi*(-2.0*x[0] + 1.0*x[1])/lx)/lx**2,
])
out['bnd_funcs'] = {1: {'uv': None},
2: {'uv': None},
3: {'uv': None},
4: {'uv': None},
}
out['options'] = {
'use_grad_div_viscosity_term': True,
'use_grad_depth_viscosity_term': True,
}
return out
def run(setup, refinement, order, do_export=True, options=None,
solver_parameters=None):
"""Run single test and return L2 error"""
print_output('--- running {:} refinement {:}'.format(setup.__name__, refinement))
# domain dimensions
lx = 15e3
ly = 10e3
area = lx*ly
f0 = 5e-3 # NOTE large value to make Coriolis terms larger
nu0 = 100.0
g = physical_constants['g_grav']
depth = 10.0
t_period = 5000.0 # period of signals
t_end = 1000.0 # 500.0 # 3*T_period
t_export = t_period/100.0 # export interval
# mesh
nx = 5*refinement
ny = 5*refinement
mesh2d = RectangleMesh(nx, ny, lx, ly)
dt = 4.0/refinement
if options is not None and options.get('timestepper_type') == 'CrankNicolson':
dt *= 100.
x = SpatialCoordinate(mesh2d)
sdict = setup(x, lx, ly, depth, f0, nu0, g)
# outputs
outputdir = 'outputs'
# bathymetry
p1_2d = FunctionSpace(mesh2d, 'CG', 1)
bathymetry_2d = Function(p1_2d, name='Bathymetry')
bathymetry_2d.project(sdict['bath_expr'])
if bathymetry_2d.dat.data.min() < 0.0:
print_output('bath {:} {:}'.format(bathymetry_2d.dat.data.min(), bathymetry_2d.dat.data.max()))
raise Exception('Negative bathymetry')
solver_obj = solver2d.FlowSolver2d(mesh2d, bathymetry_2d)
solver_obj.options.polynomial_degree = order
solver_obj.options.element_family = 'rt-dg'
solver_obj.options.horizontal_velocity_scale = Constant(1.0)
solver_obj.options.no_exports = not do_export
solver_obj.options.output_directory = outputdir
solver_obj.options.simulation_end_time = t_end
solver_obj.options.timestep = dt
solver_obj.options.simulation_export_time = t_export
if 'options' in sdict:
solver_obj.options.update(sdict['options'])
if options is not None:
solver_obj.options.update(options)
if hasattr(solver_obj.options.timestepper_options, 'use_automatic_timestep'):
solver_obj.options.timestepper_options.use_automatic_timestep = False
solver_obj.create_function_spaces()
# analytical solution in high-order space for computing L2 norms
h_2d_ho = FunctionSpace(solver_obj.mesh2d, 'DG', order+3)
u_2d_ho = VectorFunctionSpace(solver_obj.mesh2d, 'DG', order+4)
elev_ana_ho = Function(h_2d_ho, name='Analytical elevation')
elev_ana_ho.project(sdict['elev_expr'])
uv_ana_ho = Function(u_2d_ho, name='Analytical velocity')
uv_ana_ho.project(sdict['uv_expr'])
# functions for source terms
source_uv = Function(solver_obj.function_spaces.U_2d, name='momentum source')
source_uv.project(sdict['res_uv_expr'])
source_elev = Function(solver_obj.function_spaces.H_2d, name='continuity source')
source_elev.project(sdict['res_elev_expr'])
solver_obj.options.momentum_source_2d = source_uv
solver_obj.options.volume_source_2d = source_elev
if 'cori_expr' in sdict:
coriolis_func = Function(solver_obj.function_spaces.H_2d, name='coriolis')
coriolis_func.project(sdict['cori_expr'])
solver_obj.options.coriolis_frequency = coriolis_func
if 'visc_expr' in sdict:
viscosity_space = FunctionSpace(solver_obj.mesh2d, "CG", order)
viscosity_func = Function(viscosity_space, name='viscosity')
viscosity_func.project(sdict['visc_expr'])
solver_obj.options.horizontal_viscosity = viscosity_func
# functions for boundary conditions
# analytical elevation
elev_ana = Function(solver_obj.function_spaces.H_2d, name='Analytical elevation')
elev_ana.project(sdict['elev_expr'])
# analytical uv
uv_ana = Function(solver_obj.function_spaces.U_2d, name='Analytical velocity')
uv_ana.project(sdict['uv_expr'])
# normal velocity (scalar field, will be interpreted as un*normal vector)
# left/right bnds
un_ana_x = Function(solver_obj.function_spaces.H_2d, name='Analytical normal velocity x')
un_ana_x.project(uv_ana[0])
# lower/uppser bnds
un_ana_y = Function(solver_obj.function_spaces.H_2d, name='Analytical normal velocity y')
un_ana_y.project(uv_ana[1])
# flux through left/right bnds
flux_ana_x = Function(solver_obj.function_spaces.H_2d, name='Analytical x flux')
flux_ana_x.project(uv_ana[0]*(bathymetry_2d + elev_ana)*ly)
# flux through lower/upper bnds
flux_ana_y = Function(solver_obj.function_spaces.H_2d, name='Analytical x flux')
flux_ana_y.project(uv_ana[1]*(bathymetry_2d + elev_ana)*lx)
# construct bnd conditions from setup
bnd_funcs = sdict['bnd_funcs']
# correct values to replace None in bnd_funcs
# NOTE: scalar velocity (flux|un) sign def: positive out of domain
bnd_field_mapping = {'symm': None,
'elev': elev_ana,
'uv': uv_ana,
'un_left': -un_ana_x,
'un_right': un_ana_x,
'un_lower': -un_ana_y,
'un_upper': un_ana_y,
'flux_left': -flux_ana_x,
'flux_right': flux_ana_x,
'flux_lower': -flux_ana_y,
'flux_upper': flux_ana_y,
}
for bnd_id in bnd_funcs:
d = {} # values for this bnd e.g. {'elev': elev_ana, 'uv': uv_ana}
for bnd_field in bnd_funcs[bnd_id]:
field_name = bnd_field.split('_')[0]
d[field_name] = bnd_field_mapping[bnd_field]
# set to the correct bnd_id
solver_obj.bnd_functions['shallow_water'][bnd_id] = d
# # print a fancy description
# bnd_str = ''
# for k in d:
# if isinstance(d[k], ufl.algebra.Product):
# a, b = d[k].operands()
# name = '{:} * {:}'.format(a.value(), b.name())
# else:
# if d[k] is not None:
# name = d[k].name()
# else:
# name = str(d[k])
# bnd_str += '{:}: {:}, '.format(k, name)
# print_output('bnd {:}: {:}'.format(bnd_id, bnd_str))
solver_obj.assign_initial_conditions(elev=elev_ana, uv=uv_ana)
if solver_parameters is not None:
# HACK: need to change prefix of solver options in order to overwrite them
solver_obj.timestepper.name += '_'
solver_obj.timestepper.solver_parameters.update(solver_parameters)
solver_obj.timestepper.update_solver()
solver_obj.iterate()
elev_l2_err = errornorm(elev_ana_ho, solver_obj.fields.solution_2d.split()[1])/numpy.sqrt(area)
uv_l2_err = errornorm(uv_ana_ho, solver_obj.fields.solution_2d.split()[0])/numpy.sqrt(area)
print_output('elev L2 error {:.12f}'.format(elev_l2_err))
print_output('uv L2 error {:.12f}'.format(uv_l2_err))
return elev_l2_err, uv_l2_err
def run_convergence(setup, ref_list, order, do_export=False, save_plot=False,
options=None, solver_parameters=None):
"""Runs test for a list of refinements and computes error convergence rate"""
l2_err = []
for r in ref_list:
l2_err.append(run(setup, r, order, do_export=do_export,
options=options, solver_parameters=solver_parameters))
x_log = numpy.log10(numpy.array(ref_list, dtype=float)**-1)
y_log = numpy.log10(numpy.array(l2_err))
y_log_elev = y_log[:, 0]
y_log_uv = y_log[:, 1]
def check_convergence(x_log, y_log, expected_slope, field_str, save_plot):
slope_rtol = 0.2
slope, intercept, r_value, p_value, std_err = stats.linregress(x_log, y_log)
setup_name = setup.__name__
if save_plot:
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(5, 5))
# plot points
ax.plot(x_log, y_log, 'k.')
x_min = x_log.min()
x_max = x_log.max()
offset = 0.05*(x_max - x_min)
n = 50
xx = numpy.linspace(x_min - offset, x_max + offset, n)
yy = intercept + slope*xx
# plot line
ax.plot(xx, yy, linestyle='--', linewidth=0.5, color='k')
ax.text(xx[2*n/3], yy[2*n/3], '{:4.2f}'.format(slope),
verticalalignment='top',
horizontalalignment='left')
ax.set_xlabel('log10(dx)')
ax.set_ylabel('log10(L2 error)')
ax.set_title(field_str)
ref_str = 'ref-' + '-'.join([str(r) for r in ref_list])
order_str = 'o{:}'.format(order)
imgfile = '_'.join(['convergence', setup_name, field_str, ref_str, order_str])
imgfile += '.png'
img_dir = create_directory('plots')
imgfile = os.path.join(img_dir, imgfile)
print_output('saving figure {:}'.format(imgfile))
plt.savefig(imgfile, dpi=200, bbox_inches='tight')
if expected_slope is not None:
err_msg = '{:}: Wrong convergence rate {:.4f}, expected {:.4f}'.format(setup_name, slope, expected_slope)
assert abs(slope - expected_slope)/expected_slope < slope_rtol, err_msg
print_output('{:}: convergence rate {:.4f} PASSED'.format(setup_name, slope))
else:
print_output('{:}: {:} convergence rate {:.4f}'.format(setup_name, field_str, slope))
return slope
check_convergence(x_log, y_log_elev, order+1, 'elev', save_plot)
check_convergence(x_log, y_log_uv, order+1, 'uv', save_plot)
# NOTE nontrivial velocity implies slower convergence
# NOTE try time dependent solution: need to update source terms
# NOTE using Lax-Friedrichs stabilization in mom. advection term improves convergence of velocity
# ---------------------------
# standard tests for pytest
# ---------------------------
@pytest.fixture(params=[setup7, setup8, setup9],
ids=["Setup7", "Setup8", "Setup9"])
def setup(request):
return request.param
@pytest.fixture(params=[
{'element_family': 'dg-dg',
'timestepper_type': 'CrankNicolson'},
{'element_family': 'rt-dg',
'timestepper_type': 'CrankNicolson'},
{'element_family': 'dg-cg',
'timestepper_type': 'CrankNicolson'}],
ids=["dg-dg", "rt-dg", "dg-cg"]
)
def options(request):
return request.param
def test_steady_state_basin_convergence(setup, options):
sp = {'ksp_type': 'preonly', 'pc_type': 'lu', 'snes_monitor': None,
'mat_type': 'aij'}
run_convergence(setup, [1, 2, 4, 6], 1, options=options,
solver_parameters=sp, save_plot=False)
| [
1,
529,
276,
1112,
420,
29958,
29926,
29878,
546,
29914,
386,
300,
275,
13,
15945,
29908,
13,
29924,
4345,
1243,
363,
29871,
29906,
29881,
4091,
340,
4094,
10693,
29889,
13,
13,
29899,
6230,
3168,
4529,
16114,
936,
12241,
363,
4235,
322,
10452,
13,
29871,
5855,
29889,
14657,
1080,
892,
10723,
411,
5016,
2272,
29889,
13,
29899,
1065,
740,
6057,
278,
341,
4345,
6230,
411,
263,
2323,
27716,
10104,
29892,
7863,
13,
29871,
365,
29906,
4436,
29889,
13,
29899,
1065,
29918,
535,
369,
10238,
6057,
263,
21640,
1243,
29892,
2912,
267,
322,
408,
643,
1372,
17221,
6554,
29889,
13,
15945,
29908,
13,
3166,
278,
28898,
1053,
334,
13,
5215,
12655,
13,
3166,
4560,
2272,
1053,
22663,
13,
5215,
11451,
1688,
13,
13,
13,
1753,
6230,
29955,
29898,
29916,
29892,
301,
29916,
29892,
21261,
29892,
298,
29900,
29892,
285,
29900,
29892,
4948,
29900,
29892,
330,
1125,
13,
1678,
9995,
13,
1678,
10050,
29899,
29873,
9473,
2994,
29875,
18301,
29892,
27683,
29892,
11858,
29892,
318,
322,
325,
29892,
18806,
2556,
12885,
338,
5225,
472,
289,
299,
304,
1243,
19389,
17403,
29879,
13,
1678,
9995,
13,
1678,
714,
353,
6571,
13,
1678,
714,
1839,
29890,
493,
29918,
13338,
2033,
353,
298,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
29871,
29946,
29889,
29900,
13,
1678,
714,
1839,
2616,
29875,
29918,
13338,
2033,
353,
285,
29900,
29930,
3944,
29898,
1631,
16395,
29916,
29961,
29900,
29962,
718,
921,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
13,
1678,
714,
1839,
29872,
2608,
29918,
13338,
2033,
353,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
13,
1678,
714,
1839,
4090,
29918,
13338,
2033,
353,
408,
29918,
8111,
29898,
13,
4706,
518,
13,
9651,
4457,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
511,
13,
632,
29900,
29889,
29945,
29930,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
511,
13,
308,
2314,
13,
1678,
714,
1839,
690,
29918,
29872,
2608,
29918,
13338,
2033,
353,
313,
29900,
29889,
29941,
29930,
29882,
29900,
29930,
29916,
29961,
29900,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
448,
29871,
29941,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
29897,
718,
29871,
29900,
29889,
29945,
16395,
29900,
29889,
29906,
29930,
29882,
29900,
29930,
29916,
29961,
29896,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
448,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29900,
29889,
29945,
29930,
1631,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29906,
29889,
29900,
29930,
1631,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
13,
1678,
714,
1839,
690,
29918,
4090,
29918,
13338,
2033,
353,
408,
29918,
8111,
29898,
13,
4706,
518,
13,
9651,
448,
29900,
29889,
29945,
29930,
29888,
29900,
29930,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
16395,
29916,
29961,
29900,
29962,
718,
921,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
448,
29871,
29941,
29889,
29900,
29930,
1631,
29930,
29887,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
29871,
29900,
29889,
29945,
16395,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
6802,
368,
718,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
448,
29871,
29906,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
29897,
1068,
29906,
29930,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
29892,
13,
9651,
285,
29900,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
11877,
3944,
29898,
1631,
16395,
29916,
29961,
29900,
29962,
718,
921,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
448,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
29887,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
8521,
29896,
29889,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
29871,
29900,
29889,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
29916,
29961,
29896,
16261,
368,
29897,
718,
29871,
29900,
29889,
29906,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
29916,
29961,
29900,
16261,
29880,
29916,
29897,
1068,
29906,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
29892,
13,
308,
2314,
13,
1678,
714,
1839,
29890,
299,
29918,
7692,
2395,
2033,
353,
426,
29896,
29901,
11117,
29872,
2608,
2396,
6213,
29892,
525,
1579,
1314,
29918,
1563,
2396,
6213,
1118,
13,
462,
308,
29906,
29901,
11117,
1579,
1314,
29918,
1266,
2396,
6213,
1118,
13,
462,
308,
29941,
29901,
11117,
29872,
2608,
2396,
6213,
29892,
525,
1579,
1314,
29918,
13609,
2396,
6213,
1118,
13,
462,
308,
29946,
29901,
11117,
348,
29918,
21064,
2396,
6213,
1118,
13,
462,
4706,
500,
13,
1678,
736,
714,
13,
13,
13,
1753,
6230,
29947,
29898,
29916,
29892,
301,
29916,
29892,
21261,
29892,
298,
29900,
29892,
285,
29900,
29892,
4948,
29900,
29892,
330,
1125,
13,
1678,
9995,
13,
1678,
10050,
29899,
29873,
9473,
2994,
29875,
18301,
29892,
27683,
29892,
11858,
29892,
318,
322,
325,
29892,
18806,
2556,
12885,
338,
1661,
29899,
9171,
472,
289,
299,
29892,
1818,
2225,
29581,
318,
29894,
472,
10452,
29889,
13,
1678,
9995,
13,
1678,
714,
353,
6571,
13,
1678,
714,
1839,
29890,
493,
29918,
13338,
2033,
353,
298,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
29871,
29946,
29889,
29900,
13,
1678,
714,
1839,
2616,
29875,
29918,
13338,
2033,
353,
285,
29900,
29930,
3944,
29898,
1631,
16395,
29916,
29961,
29900,
29962,
718,
921,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
13,
1678,
714,
1839,
29872,
2608,
29918,
13338,
2033,
353,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
13,
1678,
714,
1839,
4090,
29918,
13338,
2033,
353,
408,
29918,
8111,
29898,
13,
4706,
518,
13,
9651,
4457,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
511,
13,
632,
29900,
29889,
29945,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
511,
13,
308,
2314,
13,
1678,
714,
1839,
690,
29918,
29872,
2608,
29918,
13338,
2033,
353,
313,
29900,
29889,
29941,
29930,
29882,
29900,
29930,
29916,
29961,
29900,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
448,
29871,
29941,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29900,
29889,
29945,
16395,
29900,
29889,
29906,
29930,
29882,
29900,
29930,
29916,
29961,
29896,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
448,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29900,
29889,
29945,
29930,
1631,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29906,
29889,
29900,
29930,
1631,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
13,
1678,
714,
1839,
690,
29918,
4090,
29918,
13338,
2033,
353,
408,
29918,
8111,
29898,
13,
4706,
518,
13,
9651,
448,
29900,
29889,
29945,
29930,
29888,
29900,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
16395,
29916,
29961,
29900,
29962,
718,
921,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
448,
29871,
29941,
29889,
29900,
29930,
1631,
29930,
29887,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
29871,
29900,
29889,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29906,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
29892,
13,
9651,
285,
29900,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
16395,
29916,
29961,
29900,
29962,
718,
921,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
448,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
29887,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
29871,
29900,
29889,
29906,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29896,
29889,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
29892,
13,
308,
2314,
13,
13,
1678,
396,
6058,
29923,
318,
29894,
4195,
7432,
947,
451,
664,
13,
1678,
714,
1839,
29890,
299,
29918,
7692,
2395,
2033,
353,
426,
29896,
29901,
11117,
29872,
2608,
2396,
6213,
29892,
525,
4090,
2396,
6213,
1118,
13,
462,
308,
29906,
29901,
11117,
29872,
2608,
2396,
6213,
29892,
525,
4090,
2396,
6213,
1118,
13,
462,
308,
29941,
29901,
11117,
29872,
2608,
2396,
6213,
29892,
525,
4090,
2396,
6213,
1118,
13,
462,
308,
29946,
29901,
11117,
29872,
2608,
2396,
6213,
29892,
525,
4090,
2396,
6213,
1118,
13,
462,
4706,
500,
13,
1678,
736,
714,
13,
13,
13,
1753,
6230,
29929,
29898,
29916,
29892,
301,
29916,
29892,
21261,
29892,
298,
29900,
29892,
285,
29900,
29892,
4948,
29900,
29892,
330,
1125,
13,
1678,
9995,
13,
1678,
1939,
2994,
29875,
18301,
29892,
1661,
29899,
29873,
9473,
27683,
29892,
1998,
3944,
537,
29892,
11858,
29892,
318,
322,
325,
29889,
13,
1678,
9995,
13,
1678,
714,
353,
6571,
13,
1678,
714,
1839,
29890,
493,
29918,
13338,
2033,
353,
298,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
29871,
29946,
29889,
29900,
13,
1678,
714,
1839,
1730,
29883,
29918,
13338,
2033,
353,
4948,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
29897,
13,
1678,
714,
1839,
29872,
2608,
29918,
13338,
2033,
353,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
13,
1678,
714,
1839,
4090,
29918,
13338,
2033,
353,
408,
29918,
8111,
29898,
13,
4706,
518,
13,
9651,
4457,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
511,
13,
632,
29900,
29889,
29945,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
511,
13,
308,
2314,
13,
1678,
714,
1839,
690,
29918,
29872,
2608,
29918,
13338,
2033,
353,
313,
29900,
29889,
29941,
29930,
29882,
29900,
29930,
29916,
29961,
29900,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
448,
29871,
29941,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29900,
29889,
29945,
16395,
29900,
29889,
29906,
29930,
29882,
29900,
29930,
29916,
29961,
29896,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
448,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29900,
29889,
29945,
29930,
1631,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29906,
29889,
29900,
29930,
1631,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
13,
1678,
714,
1839,
690,
29918,
4090,
29918,
13338,
2033,
353,
408,
29918,
8111,
29898,
13,
4706,
518,
13,
9651,
448,
29941,
29889,
29900,
29930,
1631,
29930,
29887,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29946,
29889,
29900,
29930,
1631,
29930,
3433,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
11877,
6278,
29900,
29889,
29941,
29930,
29882,
29900,
29930,
29916,
29961,
29900,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
718,
29871,
29941,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29898,
29880,
29916,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
876,
718,
29871,
29900,
29889,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29906,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29896,
29889,
29945,
29930,
1631,
1068,
29906,
29930,
3433,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
718,
29871,
29929,
29889,
29900,
29930,
1631,
1068,
29906,
29930,
3433,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
718,
29871,
29946,
29889,
29900,
29930,
1631,
29930,
3433,
29900,
29930,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
29892,
13,
9651,
448,
29896,
29889,
29900,
29930,
1631,
29930,
29887,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
3433,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
11877,
6278,
29900,
29889,
29906,
29930,
29882,
29900,
29930,
29916,
29961,
29896,
29962,
14571,
29880,
29916,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
876,
718,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
5223,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29898,
29880,
29916,
16395,
29882,
29900,
29930,
3676,
29898,
29900,
29889,
29941,
29930,
29916,
29961,
29900,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29906,
29930,
29916,
29961,
29896,
29962,
1068,
29906,
718,
29871,
29900,
29889,
29896,
6802,
29880,
29916,
718,
6776,
29898,
1631,
16395,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
29897,
718,
29871,
29946,
29889,
29900,
876,
718,
29871,
29900,
29889,
29906,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
448,
29871,
29896,
29889,
29945,
29930,
1631,
29930,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
11877,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
718,
29871,
29945,
29889,
29945,
29930,
1631,
1068,
29906,
29930,
3433,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
448,
29871,
29906,
29889,
29900,
29930,
1631,
1068,
29906,
29930,
3433,
29900,
16395,
29896,
29889,
29900,
718,
921,
29961,
29900,
16261,
29880,
29916,
11877,
5223,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
718,
29871,
29896,
29889,
29945,
29930,
1631,
29930,
3433,
29900,
29930,
3944,
29898,
1631,
29930,
6278,
29941,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
448,
29871,
29896,
29889,
29900,
29930,
1631,
29930,
3433,
29900,
29930,
3944,
29898,
1631,
29930,
6278,
29906,
29889,
29900,
29930,
29916,
29961,
29900,
29962,
718,
29871,
29896,
29889,
29900,
29930,
29916,
29961,
29896,
2314,
29914,
29880,
29916,
6802,
29880,
29916,
1068,
29906,
29892,
13,
308,
2314,
13,
13,
1678,
714,
1839,
29890,
299,
29918,
7692,
2395,
2033,
353,
426,
29896,
29901,
11117,
4090,
2396,
6213,
1118,
13,
462,
308,
29906,
29901,
11117,
4090,
2396,
6213,
1118,
13,
462,
308,
29941,
29901,
11117,
4090,
2396,
6213,
1118,
13,
462,
308,
29946,
29901,
11117,
4090,
2396,
6213,
1118,
13,
462,
4706,
500,
13,
1678,
714,
1839,
6768,
2033,
353,
426,
13,
4706,
525,
1509,
29918,
5105,
29918,
4563,
29918,
1730,
3944,
537,
29918,
8489,
2396,
5852,
29892,
13,
4706,
525,
1509,
29918,
5105,
29918,
19488,
29918,
1730,
3944,
537,
29918,
8489,
2396,
5852,
29892,
13,
1678,
500,
13,
13,
1678,
736,
714,
13,
13,
13,
1753,
1065,
29898,
14669,
29892,
2143,
262,
882,
29892,
1797,
29892,
437,
29918,
15843,
29922,
5574,
29892,
3987,
29922,
8516,
29892,
13,
4706,
899,
369,
29918,
16744,
29922,
8516,
1125,
13,
1678,
9995,
6558,
2323,
1243,
322,
736,
365,
29906,
1059,
15945,
29908,
13,
1678,
1596,
29918,
4905,
877,
5634,
2734,
426,
3854,
2143,
262,
882,
426,
3854,
4286,
4830,
29898,
14669,
17255,
978,
1649,
29892,
2143,
262,
882,
876,
13,
1678,
396,
5354,
13391,
13,
1678,
301,
29916,
353,
29871,
29896,
29945,
29872,
29941,
13,
1678,
21261,
353,
29871,
29896,
29900,
29872,
29941,
13,
1678,
4038,
353,
301,
29916,
29930,
368,
13,
1678,
285,
29900,
353,
29871,
29945,
29872,
29899,
29941,
29871,
396,
6058,
29923,
2919,
995,
304,
1207,
2994,
29875,
18301,
4958,
7200,
13,
1678,
4948,
29900,
353,
29871,
29896,
29900,
29900,
29889,
29900,
13,
1678,
330,
353,
9128,
29918,
3075,
1934,
1839,
29887,
29918,
3874,
29894,
2033,
13,
1678,
10809,
353,
29871,
29896,
29900,
29889,
29900,
13,
1678,
260,
29918,
19145,
353,
29871,
29945,
29900,
29900,
29900,
29889,
29900,
4706,
396,
3785,
310,
18470,
13,
1678,
260,
29918,
355,
353,
29871,
29896,
29900,
29900,
29900,
29889,
29900,
29871,
396,
29871,
29945,
29900,
29900,
29889,
29900,
29871,
396,
29871,
29941,
29930,
29911,
29918,
19145,
13,
1678,
260,
29918,
15843,
353,
260,
29918,
19145,
29914,
29896,
29900,
29900,
29889,
29900,
29871,
396,
5609,
7292,
13,
13,
1678,
396,
27716,
13,
1678,
302,
29916,
353,
29871,
29945,
29930,
999,
262,
882,
13,
1678,
7098,
353,
29871,
29945,
29930,
999,
262,
882,
13,
1678,
27716,
29906,
29881,
353,
22914,
2521,
29924,
12094,
29898,
23818,
29892,
7098,
29892,
301,
29916,
29892,
21261,
29897,
13,
1678,
11636,
353,
29871,
29946,
29889,
29900,
29914,
999,
262,
882,
13,
1678,
565,
3987,
338,
451,
6213,
322,
3987,
29889,
657,
877,
9346,
4196,
2496,
29918,
1853,
1495,
1275,
525,
29907,
10003,
29940,
5283,
1100,
2396,
13,
4706,
11636,
334,
29922,
29871,
29896,
29900,
29900,
29889,
13,
13,
1678,
921,
353,
1706,
15238,
7967,
16065,
29898,
4467,
29882,
29906,
29881,
29897,
13,
1678,
269,
8977,
353,
6230,
29898,
29916,
29892,
301,
29916,
29892,
21261,
29892,
10809,
29892,
285,
29900,
29892,
4948,
29900,
29892,
330,
29897,
13,
13,
1678,
396,
14391,
13,
1678,
1962,
3972,
353,
525,
4905,
29879,
29915,
13,
13,
1678,
396,
27683,
962,
27184,
13,
1678,
282,
29896,
29918,
29906,
29881,
353,
6680,
14936,
29898,
4467,
29882,
29906,
29881,
29892,
525,
11135,
742,
29871,
29896,
29897,
13,
1678,
27683,
962,
27184,
29918,
29906,
29881,
353,
6680,
29898,
29886,
29896,
29918,
29906,
29881,
29892,
1024,
2433,
29933,
493,
962,
27184,
1495,
13,
1678,
27683,
962,
27184,
29918,
29906,
29881,
29889,
4836,
29898,
4928,
919,
1839,
29890,
493,
29918,
13338,
11287,
13,
1678,
565,
27683,
962,
27184,
29918,
29906,
29881,
29889,
4130,
29889,
1272,
29889,
1195,
580,
529,
29871,
29900,
29889,
29900,
29901,
13,
4706,
1596,
29918,
4905,
877,
29890,
493,
426,
3854,
426,
3854,
4286,
4830,
29898,
29890,
493,
962,
27184,
29918,
29906,
29881,
29889,
4130,
29889,
1272,
29889,
1195,
3285,
27683,
962,
27184,
29918,
29906,
29881,
29889,
4130,
29889,
1272,
29889,
3317,
22130,
13,
4706,
12020,
8960,
877,
29940,
387,
1230,
27683,
962,
27184,
1495,
13,
13,
1678,
899,
369,
29918,
5415,
353,
899,
369,
29906,
29881,
29889,
17907,
13296,
369,
29906,
29881,
29898,
4467,
29882,
29906,
29881,
29892,
27683,
962,
27184,
29918,
29906,
29881,
29897,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
3733,
9222,
29918,
12163,
929,
353,
1797,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
5029,
29918,
11922,
353,
525,
2273,
29899,
20726,
29915,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
22672,
29918,
955,
25245,
29918,
7052,
353,
28601,
29898,
29896,
29889,
29900,
29897,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
1217,
29918,
26500,
353,
451,
437,
29918,
15843,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
4905,
29918,
12322,
353,
1962,
3972,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
3601,
2785,
29918,
355,
29918,
2230,
353,
260,
29918,
355,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
9346,
342,
1022,
353,
11636,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
3601,
2785,
29918,
15843,
29918,
2230,
353,
260,
29918,
15843,
13,
1678,
565,
525,
6768,
29915,
297,
269,
8977,
29901,
13,
4706,
899,
369,
29918,
5415,
29889,
6768,
29889,
5504,
29898,
4928,
919,
1839,
6768,
11287,
13,
1678,
565,
3987,
338,
451,
6213,
29901,
13,
4706,
899,
369,
29918,
5415,
29889,
6768,
29889,
5504,
29898,
6768,
29897,
13,
1678,
565,
756,
5552,
29898,
2929,
369,
29918,
5415,
29889,
6768,
29889,
9346,
4196,
2496,
29918,
6768,
29892,
525,
1509,
29918,
17405,
2454,
29918,
9346,
342,
1022,
29374,
13,
4706,
899,
369,
29918,
5415,
29889,
6768,
29889,
9346,
4196,
2496,
29918,
6768,
29889,
1509,
29918,
17405,
2454,
29918,
9346,
342,
1022,
353,
7700,
13,
13,
1678,
899,
369,
29918,
5415,
29889,
3258,
29918,
2220,
29918,
22854,
580,
13,
13,
1678,
396,
16114,
936,
1650,
297,
1880,
29899,
2098,
2913,
363,
20602,
365,
29906,
6056,
29879,
13,
1678,
298,
29918,
29906,
29881,
29918,
1251,
353,
6680,
14936,
29898,
2929,
369,
29918,
5415,
29889,
4467,
29882,
29906,
29881,
29892,
525,
29928,
29954,
742,
1797,
29974,
29941,
29897,
13,
1678,
318,
29918,
29906,
29881,
29918,
1251,
353,
16510,
6678,
14936,
29898,
2929,
369,
29918,
5415,
29889,
4467,
29882,
29906,
29881,
29892,
525,
29928,
29954,
742,
1797,
29974,
29946,
29897,
13,
1678,
11858,
29918,
1648,
29918,
1251,
353,
6680,
29898,
29882,
29918,
29906,
29881,
29918,
1251,
29892,
1024,
2433,
21067,
3637,
936,
11858,
362,
1495,
13,
1678,
11858,
29918,
1648,
29918,
1251,
29889,
4836,
29898,
4928,
919,
1839,
29872,
2608,
29918,
13338,
11287,
13,
1678,
318,
29894,
29918,
1648,
29918,
1251,
353,
6680,
29898,
29884,
29918,
29906,
29881,
29918,
1251,
29892,
1024,
2433,
21067,
3637,
936,
12885,
1495,
13,
1678,
318,
29894,
29918,
1648,
29918,
1251,
29889,
4836,
29898,
4928,
919,
1839,
4090,
29918,
13338,
11287,
13,
13,
1678,
396,
3168,
363,
2752,
4958,
13,
1678,
2752,
29918,
4090,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29965,
29918,
29906,
29881,
29892,
1024,
2433,
29885,
2932,
398,
2752,
1495,
13,
1678,
2752,
29918,
4090,
29889,
4836,
29898,
4928,
919,
1839,
690,
29918,
4090,
29918,
13338,
11287,
13,
1678,
2752,
29918,
29872,
2608,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
20621,
537,
2752,
1495,
13,
1678,
2752,
29918,
29872,
2608,
29889,
4836,
29898,
4928,
919,
1839,
690,
29918,
29872,
2608,
29918,
13338,
11287,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
29885,
2932,
398,
29918,
4993,
29918,
29906,
29881,
353,
2752,
29918,
4090,
13,
1678,
899,
369,
29918,
5415,
29889,
6768,
29889,
24623,
29918,
4993,
29918,
29906,
29881,
353,
2752,
29918,
29872,
2608,
13,
1678,
565,
525,
2616,
29875,
29918,
13338,
29915,
297,
269,
8977,
29901,
13,
4706,
1034,
29875,
18301,
29918,
9891,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
2616,
29875,
18301,
1495,
13,
4706,
1034,
29875,
18301,
29918,
9891,
29889,
4836,
29898,
4928,
919,
1839,
2616,
29875,
29918,
13338,
11287,
13,
4706,
899,
369,
29918,
5415,
29889,
6768,
29889,
2616,
29875,
18301,
29918,
10745,
23860,
353,
1034,
29875,
18301,
29918,
9891,
13,
1678,
565,
525,
1730,
29883,
29918,
13338,
29915,
297,
269,
8977,
29901,
13,
4706,
1998,
3944,
537,
29918,
3493,
353,
6680,
14936,
29898,
2929,
369,
29918,
5415,
29889,
4467,
29882,
29906,
29881,
29892,
376,
11135,
613,
1797,
29897,
13,
4706,
1998,
3944,
537,
29918,
9891,
353,
6680,
29898,
1730,
3944,
537,
29918,
3493,
29892,
1024,
2433,
1730,
3944,
537,
1495,
13,
4706,
1998,
3944,
537,
29918,
9891,
29889,
4836,
29898,
4928,
919,
1839,
1730,
29883,
29918,
13338,
11287,
13,
4706,
899,
369,
29918,
5415,
29889,
6768,
29889,
22672,
29918,
1730,
3944,
537,
353,
1998,
3944,
537,
29918,
9891,
13,
13,
1678,
396,
3168,
363,
10452,
5855,
13,
1678,
396,
16114,
936,
11858,
362,
13,
1678,
11858,
29918,
1648,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
21067,
3637,
936,
11858,
362,
1495,
13,
1678,
11858,
29918,
1648,
29889,
4836,
29898,
4928,
919,
1839,
29872,
2608,
29918,
13338,
11287,
13,
1678,
396,
16114,
936,
318,
29894,
13,
1678,
318,
29894,
29918,
1648,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29965,
29918,
29906,
29881,
29892,
1024,
2433,
21067,
3637,
936,
12885,
1495,
13,
1678,
318,
29894,
29918,
1648,
29889,
4836,
29898,
4928,
919,
1839,
4090,
29918,
13338,
11287,
13,
1678,
396,
4226,
12885,
313,
19529,
279,
1746,
29892,
674,
367,
21551,
408,
443,
29930,
8945,
4608,
29897,
13,
1678,
396,
2175,
29914,
1266,
289,
299,
29879,
13,
1678,
443,
29918,
1648,
29918,
29916,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
21067,
3637,
936,
4226,
12885,
921,
1495,
13,
1678,
443,
29918,
1648,
29918,
29916,
29889,
4836,
29898,
4090,
29918,
1648,
29961,
29900,
2314,
13,
1678,
396,
5224,
29914,
14889,
643,
289,
299,
29879,
13,
1678,
443,
29918,
1648,
29918,
29891,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
21067,
3637,
936,
4226,
12885,
343,
1495,
13,
1678,
443,
29918,
1648,
29918,
29891,
29889,
4836,
29898,
4090,
29918,
1648,
29961,
29896,
2314,
13,
1678,
396,
19389,
1549,
2175,
29914,
1266,
289,
299,
29879,
13,
1678,
19389,
29918,
1648,
29918,
29916,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
21067,
3637,
936,
921,
19389,
1495,
13,
1678,
19389,
29918,
1648,
29918,
29916,
29889,
4836,
29898,
4090,
29918,
1648,
29961,
29900,
14178,
29898,
29890,
493,
962,
27184,
29918,
29906,
29881,
718,
11858,
29918,
1648,
11877,
368,
29897,
13,
1678,
396,
19389,
1549,
5224,
29914,
21064,
289,
299,
29879,
13,
1678,
19389,
29918,
1648,
29918,
29891,
353,
6680,
29898,
2929,
369,
29918,
5415,
29889,
2220,
29918,
22854,
29889,
29950,
29918,
29906,
29881,
29892,
1024,
2433,
21067,
3637,
936,
921,
19389,
1495,
13,
1678,
19389,
29918,
1648,
29918,
29891,
29889,
4836,
29898,
4090,
29918,
1648,
29961,
29896,
14178,
29898,
29890,
493,
962,
27184,
29918,
29906,
29881,
718,
11858,
29918,
1648,
11877,
29880,
29916,
29897,
13,
13,
1678,
396,
3386,
289,
299,
5855,
515,
6230,
13,
1678,
289,
299,
29918,
7692,
2395,
353,
269,
8977,
1839,
29890,
299,
29918,
7692,
2395,
2033,
13,
1678,
396,
1959,
1819,
304,
5191,
6213,
297,
289,
299,
29918,
7692,
2395,
13,
1678,
396,
6058,
29923,
29901,
17336,
12885,
313,
1579,
1314,
29989,
348,
29897,
1804,
822,
29901,
6374,
714,
310,
5354,
13,
1678,
289,
299,
29918,
2671,
29918,
20698,
353,
11117,
11967,
29885,
2396,
6213,
29892,
13,
462,
308,
525,
29872,
2608,
2396,
11858,
29918,
1648,
29892,
13,
462,
308,
525,
4090,
2396,
318,
29894,
29918,
1648,
29892,
13,
462,
308,
525,
348,
29918,
1563,
2396,
448,
348,
29918,
1648,
29918,
29916,
29892,
13,
462,
308,
525,
348,
29918,
1266,
2396,
443,
29918,
1648,
29918,
29916,
29892,
13,
462,
308,
525,
348,
29918,
13609,
2396,
448,
348,
29918,
1648,
29918,
29891,
29892,
13,
462,
308,
525,
348,
29918,
21064,
2396,
443,
29918,
1648,
29918,
29891,
29892,
13,
462,
308,
525,
1579,
1314,
29918,
1563,
2396,
448,
1579,
1314,
29918,
1648,
29918,
29916,
29892,
13,
462,
308,
525,
1579,
1314,
29918,
1266,
2396,
19389,
29918,
1648,
29918,
29916,
29892,
13,
462,
308,
525,
1579,
1314,
29918,
13609,
2396,
448,
1579,
1314,
29918,
1648,
29918,
29891,
29892,
13,
462,
308,
525,
1579,
1314,
29918,
21064,
2396,
19389,
29918,
1648,
29918,
29891,
29892,
13,
462,
308,
500,
13,
1678,
363,
289,
299,
29918,
333,
297,
289,
299,
29918,
7692,
2395,
29901,
13,
4706,
270,
353,
6571,
29871,
396,
1819,
363,
445,
289,
299,
321,
29889,
29887,
29889,
11117,
29872,
2608,
2396,
11858,
29918,
1648,
29892,
525,
4090,
2396,
318,
29894,
29918,
1648,
29913,
13,
4706,
363,
289,
299,
29918,
2671,
297,
289,
299,
29918,
7692,
2395,
29961,
29890,
299,
29918,
333,
5387,
13,
9651,
1746,
29918,
978,
353,
289,
299,
29918,
2671,
29889,
5451,
877,
29918,
29861,
29900,
29962,
13,
9651,
270,
29961,
2671,
29918,
978,
29962,
353,
289,
299,
29918,
2671,
29918,
20698,
29961,
29890,
299,
29918,
2671,
29962,
13,
4706,
396,
731,
304,
278,
1959,
289,
299,
29918,
333,
13,
4706,
899,
369,
29918,
5415,
29889,
29890,
299,
29918,
12171,
1839,
845,
9536,
29918,
13405,
2033,
29961,
29890,
299,
29918,
333,
29962,
353,
270,
13,
4706,
396,
396,
1596,
263,
19231,
6139,
13,
4706,
396,
289,
299,
29918,
710,
353,
6629,
13,
4706,
396,
363,
413,
297,
270,
29901,
13,
4706,
396,
268,
565,
338,
8758,
29898,
29881,
29961,
29895,
1402,
318,
1579,
29889,
15742,
29889,
7566,
1125,
13,
4706,
396,
308,
263,
29892,
289,
353,
270,
29961,
29895,
1822,
3372,
4167,
580,
13,
4706,
396,
308,
1024,
353,
22372,
3854,
334,
426,
3854,
4286,
4830,
29898,
29874,
29889,
1767,
3285,
289,
29889,
978,
3101,
13,
4706,
396,
268,
1683,
29901,
13,
4706,
396,
308,
565,
270,
29961,
29895,
29962,
338,
451,
6213,
29901,
13,
4706,
396,
632,
1024,
353,
270,
29961,
29895,
1822,
978,
580,
13,
4706,
396,
308,
1683,
29901,
13,
4706,
396,
632,
1024,
353,
851,
29898,
29881,
29961,
29895,
2314,
13,
4706,
396,
268,
289,
299,
29918,
710,
4619,
22372,
3854,
29901,
12365,
1118,
15300,
4830,
29898,
29895,
29892,
1024,
29897,
13,
4706,
396,
1596,
29918,
4905,
877,
29890,
299,
426,
3854,
29901,
426,
3854,
4286,
4830,
29898,
29890,
299,
29918,
333,
29892,
289,
299,
29918,
710,
876,
13,
13,
1678,
899,
369,
29918,
5415,
29889,
16645,
29918,
11228,
29918,
1116,
2187,
29898,
29872,
2608,
29922,
29872,
2608,
29918,
1648,
29892,
318,
29894,
29922,
4090,
29918,
1648,
29897,
13,
1678,
565,
899,
369,
29918,
16744,
338,
451,
6213,
29901,
13,
4706,
396,
379,
11375,
29901,
817,
304,
1735,
10944,
310,
899,
369,
3987,
297,
1797,
304,
26556,
963,
13,
4706,
899,
369,
29918,
5415,
29889,
9346,
4196,
2496,
29889,
978,
4619,
22868,
29915,
13,
4706,
899,
369,
29918,
5415,
29889,
9346,
4196,
2496,
29889,
2929,
369,
29918,
16744,
29889,
5504,
29898,
2929,
369,
29918,
16744,
29897,
13,
4706,
899,
369,
29918,
5415,
29889,
9346,
4196,
2496,
29889,
5504,
29918,
2929,
369,
580,
13,
13,
1678,
899,
369,
29918,
5415,
29889,
1524,
403,
580,
13,
13,
1678,
11858,
29918,
29880,
29906,
29918,
3127,
353,
1059,
12324,
29898,
29872,
2608,
29918,
1648,
29918,
1251,
29892,
899,
369,
29918,
5415,
29889,
9621,
29889,
2929,
918,
29918,
29906,
29881,
29889,
5451,
580,
29961,
29896,
2314,
29914,
23749,
29889,
3676,
29898,
6203,
29897,
13,
1678,
318,
29894,
29918,
29880,
29906,
29918,
3127,
353,
1059,
12324,
29898,
4090,
29918,
1648,
29918,
1251,
29892,
899,
369,
29918,
5415,
29889,
9621,
29889,
2929,
918,
29918,
29906,
29881,
29889,
5451,
580,
29961,
29900,
2314,
29914,
23749,
29889,
3676,
29898,
6203,
29897,
13,
1678,
1596,
29918,
4905,
877,
29872,
2608,
365,
29906,
1059,
12365,
29889,
29896,
29906,
29888,
29913,
4286,
4830,
29898,
29872,
2608,
29918,
29880,
29906,
29918,
3127,
876,
13,
1678,
1596,
29918,
4905,
877,
4090,
365,
29906,
1059,
12365,
29889,
29896,
29906,
29888,
29913,
4286,
4830,
29898,
4090,
29918,
29880,
29906,
29918,
3127,
876,
13,
1678,
736,
11858,
29918,
29880,
29906,
29918,
3127,
29892,
318,
29894,
29918,
29880,
29906,
29918,
3127,
13,
13,
13,
1753,
1065,
29918,
535,
369,
10238,
29898,
14669,
29892,
2143,
29918,
1761,
29892,
1797,
29892,
437,
29918,
15843,
29922,
8824,
29892,
4078,
29918,
5317,
29922,
8824,
29892,
13,
462,
1678,
3987,
29922,
8516,
29892,
899,
369,
29918,
16744,
29922,
8516,
1125,
13,
1678,
9995,
6558,
29879,
1243,
363,
263,
1051,
310,
2143,
262,
4110,
322,
2912,
267,
1059,
17221,
6554,
15945,
29908,
13,
1678,
301,
29906,
29918,
3127,
353,
5159,
13,
1678,
363,
364,
297,
2143,
29918,
1761,
29901,
13,
4706,
301,
29906,
29918,
3127,
29889,
4397,
29898,
3389,
29898,
14669,
29892,
364,
29892,
1797,
29892,
437,
29918,
15843,
29922,
1867,
29918,
15843,
29892,
13,
462,
3986,
3987,
29922,
6768,
29892,
899,
369,
29918,
16744,
29922,
2929,
369,
29918,
16744,
876,
13,
1678,
921,
29918,
1188,
353,
12655,
29889,
1188,
29896,
29900,
29898,
23749,
29889,
2378,
29898,
999,
29918,
1761,
29892,
26688,
29922,
7411,
29897,
1068,
29899,
29896,
29897,
13,
1678,
343,
29918,
1188,
353,
12655,
29889,
1188,
29896,
29900,
29898,
23749,
29889,
2378,
29898,
29880,
29906,
29918,
3127,
876,
13,
1678,
343,
29918,
1188,
29918,
29872,
2608,
353,
343,
29918,
1188,
7503,
29892,
29871,
29900,
29962,
13,
1678,
343,
29918,
1188,
29918,
4090,
353,
343,
29918,
1188,
7503,
29892,
29871,
29896,
29962,
13,
13,
1678,
822,
1423,
29918,
535,
369,
10238,
29898,
29916,
29918,
1188,
29892,
343,
29918,
1188,
29892,
3806,
29918,
29879,
417,
412,
29892,
1746,
29918,
710,
29892,
4078,
29918,
5317,
1125,
13,
4706,
24968,
29918,
2273,
324,
353,
29871,
29900,
29889,
29906,
13,
4706,
24968,
29892,
23404,
29892,
364,
29918,
1767,
29892,
282,
29918,
1767,
29892,
3659,
29918,
3127,
353,
22663,
29889,
1915,
276,
3663,
29898,
29916,
29918,
1188,
29892,
343,
29918,
1188,
29897,
13,
4706,
6230,
29918,
978,
353,
6230,
17255,
978,
1649,
13,
4706,
565,
4078,
29918,
5317,
29901,
13,
9651,
1053,
22889,
29889,
2272,
5317,
408,
14770,
13,
9651,
2537,
29892,
4853,
353,
14770,
29889,
1491,
26762,
29898,
1003,
2311,
7607,
29945,
29892,
29871,
29945,
876,
13,
9651,
396,
6492,
3291,
13,
9651,
4853,
29889,
5317,
29898,
29916,
29918,
1188,
29892,
343,
29918,
1188,
29892,
525,
29895,
29889,
1495,
13,
9651,
921,
29918,
1195,
353,
921,
29918,
1188,
29889,
1195,
580,
13,
9651,
921,
29918,
3317,
353,
921,
29918,
1188,
29889,
3317,
580,
13,
9651,
9210,
353,
29871,
29900,
29889,
29900,
29945,
16395,
29916,
29918,
3317,
448,
921,
29918,
1195,
29897,
13,
9651,
302,
353,
29871,
29945,
29900,
13,
9651,
15473,
353,
12655,
29889,
1915,
3493,
29898,
29916,
29918,
1195,
448,
9210,
29892,
921,
29918,
3317,
718,
9210,
29892,
302,
29897,
13,
9651,
343,
29891,
353,
23404,
718,
24968,
29930,
4419,
13,
9651,
396,
6492,
1196,
13,
9651,
4853,
29889,
5317,
29898,
4419,
29892,
343,
29891,
29892,
6276,
342,
1508,
2433,
489,
742,
1196,
2103,
29922,
29900,
29889,
29945,
29892,
2927,
2433,
29895,
1495,
13,
9651,
4853,
29889,
726,
29898,
4419,
29961,
29906,
29930,
29876,
29914,
29941,
1402,
343,
29891,
29961,
29906,
29930,
29876,
29914,
29941,
1402,
22372,
29901,
29946,
29889,
29906,
29888,
29913,
4286,
4830,
29898,
29879,
417,
412,
511,
13,
462,
1678,
11408,
2520,
358,
2433,
3332,
742,
13,
462,
1678,
14698,
2520,
358,
2433,
1563,
1495,
13,
9651,
4853,
29889,
842,
29918,
29916,
1643,
877,
1188,
29896,
29900,
29898,
8235,
29897,
1495,
13,
9651,
4853,
29889,
842,
29918,
29891,
1643,
877,
1188,
29896,
29900,
29898,
29931,
29906,
1059,
29897,
1495,
13,
9651,
4853,
29889,
842,
29918,
3257,
29898,
2671,
29918,
710,
29897,
13,
9651,
2143,
29918,
710,
353,
525,
999,
29899,
29915,
718,
17411,
4286,
7122,
4197,
710,
29898,
29878,
29897,
363,
364,
297,
2143,
29918,
1761,
2314,
13,
9651,
1797,
29918,
710,
353,
525,
29877,
29912,
3854,
4286,
4830,
29898,
2098,
29897,
13,
9651,
10153,
1445,
353,
22868,
4286,
7122,
18959,
535,
369,
10238,
742,
6230,
29918,
978,
29892,
1746,
29918,
710,
29892,
2143,
29918,
710,
29892,
1797,
29918,
710,
2314,
13,
9651,
10153,
1445,
4619,
15300,
2732,
29915,
13,
9651,
10153,
29918,
3972,
353,
1653,
29918,
12322,
877,
26762,
1495,
13,
9651,
10153,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2492,
29918,
3972,
29892,
10153,
1445,
29897,
13,
9651,
1596,
29918,
4905,
877,
29879,
5555,
4377,
426,
3854,
4286,
4830,
29898,
2492,
1445,
876,
13,
9651,
14770,
29889,
7620,
1003,
29898,
2492,
1445,
29892,
270,
1631,
29922,
29906,
29900,
29900,
29892,
289,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
4706,
565,
3806,
29918,
29879,
417,
412,
338,
451,
6213,
29901,
13,
9651,
4589,
29918,
7645,
353,
22372,
3854,
29901,
399,
29373,
17221,
6554,
12365,
29889,
29946,
29888,
1118,
3806,
12365,
29889,
29946,
29888,
29913,
4286,
4830,
29898,
14669,
29918,
978,
29892,
24968,
29892,
3806,
29918,
29879,
417,
412,
29897,
13,
9651,
4974,
6425,
29898,
29879,
417,
412,
448,
3806,
29918,
29879,
417,
412,
6802,
9684,
29918,
29879,
417,
412,
529,
24968,
29918,
2273,
324,
29892,
4589,
29918,
7645,
13,
9651,
1596,
29918,
4905,
877,
29912,
3854,
29901,
17221,
6554,
12365,
29889,
29946,
29888,
29913,
349,
3289,
1660,
29928,
4286,
4830,
29898,
14669,
29918,
978,
29892,
24968,
876,
13,
4706,
1683,
29901,
13,
9651,
1596,
29918,
4905,
877,
29912,
3854,
29901,
426,
3854,
17221,
6554,
12365,
29889,
29946,
29888,
29913,
4286,
4830,
29898,
14669,
29918,
978,
29892,
1746,
29918,
710,
29892,
24968,
876,
13,
4706,
736,
24968,
13,
13,
1678,
1423,
29918,
535,
369,
10238,
29898,
29916,
29918,
1188,
29892,
343,
29918,
1188,
29918,
29872,
2608,
29892,
1797,
29974,
29896,
29892,
525,
29872,
2608,
742,
4078,
29918,
5317,
29897,
13,
1678,
1423,
29918,
535,
369,
10238,
29898,
29916,
29918,
1188,
29892,
343,
29918,
1188,
29918,
4090,
29892,
1797,
29974,
29896,
29892,
525,
4090,
742,
4078,
29918,
5317,
29897,
13,
13,
29937,
6058,
29923,
302,
609,
9473,
12885,
10469,
20312,
17221,
13,
29937,
6058,
29923,
1018,
931,
14278,
1650,
29901,
817,
304,
2767,
2752,
4958,
13,
29937,
6058,
29923,
773,
997,
29916,
29899,
29943,
1255,
4018,
29879,
16160,
2133,
297,
16823,
29889,
594,
345,
428,
1840,
4857,
1960,
17221,
310,
12885,
13,
13,
29937,
448,
2683,
28400,
13,
29937,
3918,
6987,
363,
11451,
1688,
13,
29937,
448,
2683,
28400,
13,
13,
13,
29992,
2272,
1688,
29889,
7241,
15546,
29898,
7529,
11759,
14669,
29955,
29892,
6230,
29947,
29892,
6230,
29929,
1402,
13,
18884,
18999,
29922,
3366,
26947,
29955,
613,
376,
26947,
29947,
613,
376,
26947,
29929,
20068,
13,
1753,
6230,
29898,
3827,
1125,
13,
1678,
736,
2009,
29889,
3207,
13,
13,
13,
29992,
2272,
1688,
29889,
7241,
15546,
29898,
7529,
11759,
13,
1678,
11117,
5029,
29918,
11922,
2396,
525,
20726,
29899,
20726,
742,
13,
268,
525,
9346,
4196,
2496,
29918,
1853,
2396,
525,
29907,
10003,
29940,
5283,
1100,
16675,
13,
1678,
11117,
5029,
29918,
11922,
2396,
525,
2273,
29899,
20726,
742,
13,
268,
525,
9346,
4196,
2496,
29918,
1853,
2396,
525,
29907,
10003,
29940,
5283,
1100,
16675,
13,
1678,
11117,
5029,
29918,
11922,
2396,
525,
20726,
29899,
29883,
29887,
742,
13,
268,
525,
9346,
4196,
2496,
29918,
1853,
2396,
525,
29907,
10003,
29940,
5283,
1100,
10827,
1402,
13,
1678,
18999,
29922,
3366,
20726,
29899,
20726,
613,
376,
2273,
29899,
20726,
613,
376,
20726,
29899,
29883,
29887,
3108,
13,
29897,
13,
1753,
3987,
29898,
3827,
1125,
13,
1678,
736,
2009,
29889,
3207,
13,
13,
13,
1753,
1243,
29918,
303,
1479,
29891,
29918,
3859,
29918,
6500,
262,
29918,
535,
369,
10238,
29898,
14669,
29892,
3987,
1125,
13,
1678,
805,
353,
11117,
29895,
1028,
29918,
1853,
2396,
525,
1457,
6194,
742,
525,
6739,
29918,
1853,
2396,
525,
6092,
742,
525,
29879,
4515,
29918,
3712,
2105,
2396,
6213,
29892,
13,
3986,
525,
2922,
29918,
1853,
2396,
525,
29874,
823,
10827,
13,
1678,
1065,
29918,
535,
369,
10238,
29898,
14669,
29892,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29953,
1402,
29871,
29896,
29892,
3987,
29922,
6768,
29892,
13,
462,
1678,
899,
369,
29918,
16744,
29922,
1028,
29892,
4078,
29918,
5317,
29922,
8824,
29897,
13,
2
] |
tests/py_tests/test_faint/test_color.py | lukas-ke/faint-graphics-editor | 10 | 190551 | <filename>tests/py_tests/test_faint/test_color.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
import os
from faint import Color
class TestColor(unittest.TestCase):
"""Tests the faint.Color class"""
def test_color(self):
# Default construction
self.assertEqual(Color(), (0,0,0,255))
self.assertNotEqual(Color(), (0,1,0,255))
# Comparison
self.assertEqual(Color(1,2,3), Color(1,2,3))
self.assertEqual(Color(1,2,3), Color(1,2,3,255))
# Indexing
self.assertEqual(Color(0,1,2,3)[0], 0)
self.assertEqual(Color(0,1,2,3)[1], 1)
self.assertEqual(Color(0,1,2,3)[2], 2)
self.assertEqual(Color(0,1,2,3)[3], 3)
# Slicing
self.assertEqual(Color(0,1,2,3)[0:0], ())
self.assertEqual(Color(0,1,2,3)[0:1], (0,))
self.assertEqual(Color(0,1,2,3)[0:2], (0,1))
self.assertEqual(Color(0,1,2,3)[:], (0,1,2,3))
self.assertEqual(Color(0,1,2,3)[:-1], (0,1,2))
# Attributes
self.assertEqual(Color(0,1,2,3).r, 0)
self.assertEqual(Color(0,1,2,3).g, 1)
self.assertEqual(Color(0,1,2,3).b, 2)
self.assertEqual(Color(0,1,2,3).a, 3)
| [
1,
529,
9507,
29958,
21150,
29914,
2272,
29918,
21150,
29914,
1688,
29918,
29888,
2365,
29914,
1688,
29918,
2780,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
30004,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
30004,
13,
5215,
443,
27958,
30004,
13,
5215,
2897,
30004,
13,
30004,
13,
3166,
24732,
1053,
9159,
30004,
13,
30004,
13,
1990,
4321,
3306,
29898,
348,
27958,
29889,
3057,
8259,
1125,
30004,
13,
1678,
9995,
24376,
278,
24732,
29889,
3306,
770,
15945,
19451,
13,
30004,
13,
1678,
822,
1243,
29918,
2780,
29898,
1311,
1125,
30004,
13,
4706,
396,
13109,
7632,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
3285,
313,
29900,
29892,
29900,
29892,
29900,
29892,
29906,
29945,
29945,
876,
30004,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
3306,
3285,
313,
29900,
29892,
29896,
29892,
29900,
29892,
29906,
29945,
29945,
876,
30004,
13,
30004,
13,
4706,
396,
422,
20941,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29896,
29892,
29906,
29892,
29941,
511,
9159,
29898,
29896,
29892,
29906,
29892,
29941,
876,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29896,
29892,
29906,
29892,
29941,
511,
9159,
29898,
29896,
29892,
29906,
29892,
29941,
29892,
29906,
29945,
29945,
876,
30004,
13,
30004,
13,
4706,
396,
11374,
292,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29900,
1402,
29871,
29900,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29896,
1402,
29871,
29896,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29906,
1402,
29871,
29906,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29941,
1402,
29871,
29941,
8443,
13,
30004,
13,
4706,
396,
317,
506,
292,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29900,
29901,
29900,
1402,
313,
876,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29900,
29901,
29896,
1402,
313,
29900,
29892,
876,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
9601,
29900,
29901,
29906,
1402,
313,
29900,
29892,
29896,
876,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
29897,
7503,
1402,
313,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
876,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
29897,
7503,
29899,
29896,
1402,
313,
29900,
29892,
29896,
29892,
29906,
876,
30004,
13,
30004,
13,
4706,
396,
6212,
5026,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
467,
29878,
29892,
29871,
29900,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
467,
29887,
29892,
29871,
29896,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
467,
29890,
29892,
29871,
29906,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3306,
29898,
29900,
29892,
29896,
29892,
29906,
29892,
29941,
467,
29874,
29892,
29871,
29941,
8443,
13,
2
] |
transtool/checks/missing_translations.py | MarcinOrlowski/prop-tool | 1 | 194480 | <reponame>MarcinOrlowski/prop-tool<gh_stars>1-10
"""
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 <NAME> <mail [@] <EMAIL>>
# https://github.com/MarcinOrlowski/trans-tool/
#
"""
from typing import Dict
from transtool.decorators.overrides import overrides
from transtool.report.group import ReportGroup
from .base.check import Check
# noinspection PyUnresolvedReferences
class MissingTranslations(Check):
"""
This check checks if given base key is also present in translation file.
"""
@overrides(Check)
# Do NOT "fix" the PropFile reference and do not import it, or you step on circular dependency!
def check(self, translation_file: 'PropFile', reference_file: 'PropFile' = None) -> ReportGroup:
self.need_valid_config()
self.need_both_files(translation_file, reference_file)
report = ReportGroup('Missing translations')
missing_keys: List[str] = [ref_key for ref_key in reference_file.keys if ref_key not in translation_file.keys]
# Commented out keys are also considered present in the translation
# unless we run in strict check mode.
if not self.config['strict']:
for comm_key in translation_file.commented_out_keys:
if comm_key in missing_keys:
del missing_keys[missing_keys.index(comm_key)]
for missing_key in missing_keys:
report.warn(None, 'Missing translation.', missing_key)
return report
@overrides(Check)
def get_default_config(self) -> Dict:
return {
'strict': False,
}
| [
1,
529,
276,
1112,
420,
29958,
29924,
5666,
262,
2816,
677,
2574,
29914,
7728,
29899,
10154,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
13,
29937,
1301,
29899,
10154,
13,
29937,
450,
13962,
2066,
1423,
261,
322,
16523,
292,
5780,
29889,
13,
29937,
13,
29937,
14187,
1266,
29871,
30211,
29906,
29900,
29906,
29896,
529,
5813,
29958,
529,
2549,
518,
29992,
29962,
529,
26862,
6227,
6778,
13,
29937,
2045,
597,
3292,
29889,
510,
29914,
29924,
5666,
262,
2816,
677,
2574,
29914,
3286,
29899,
10154,
29914,
13,
29937,
13,
15945,
29908,
13,
13,
3166,
19229,
1053,
360,
919,
13,
3166,
534,
16220,
1507,
29889,
19557,
4097,
29889,
957,
24040,
1053,
975,
24040,
13,
3166,
534,
16220,
1507,
29889,
12276,
29889,
2972,
1053,
13969,
4782,
13,
3166,
869,
3188,
29889,
3198,
1053,
5399,
13,
13,
13,
29937,
694,
1144,
27988,
10772,
2525,
9778,
1490,
1123,
10662,
13,
1990,
4750,
292,
4300,
29880,
800,
29898,
5596,
1125,
13,
1678,
9995,
13,
1678,
910,
1423,
12747,
565,
2183,
2967,
1820,
338,
884,
2198,
297,
13962,
934,
29889,
13,
1678,
9995,
13,
13,
1678,
732,
957,
24040,
29898,
5596,
29897,
13,
1678,
396,
1938,
6058,
376,
5878,
29908,
278,
18264,
2283,
3407,
322,
437,
451,
1053,
372,
29892,
470,
366,
4331,
373,
19308,
10609,
29991,
13,
1678,
822,
1423,
29898,
1311,
29892,
13962,
29918,
1445,
29901,
525,
20420,
2283,
742,
3407,
29918,
1445,
29901,
525,
20420,
2283,
29915,
353,
6213,
29897,
1599,
13969,
4782,
29901,
13,
4706,
1583,
29889,
26180,
29918,
3084,
29918,
2917,
580,
13,
4706,
1583,
29889,
26180,
29918,
20313,
29918,
5325,
29898,
3286,
18411,
29918,
1445,
29892,
3407,
29918,
1445,
29897,
13,
13,
4706,
3461,
353,
13969,
4782,
877,
18552,
292,
5578,
800,
1495,
13,
13,
4706,
4567,
29918,
8149,
29901,
2391,
29961,
710,
29962,
353,
518,
999,
29918,
1989,
363,
2143,
29918,
1989,
297,
3407,
29918,
1445,
29889,
8149,
565,
2143,
29918,
1989,
451,
297,
13962,
29918,
1445,
29889,
8149,
29962,
13,
13,
4706,
396,
461,
287,
714,
6611,
526,
884,
5545,
2198,
297,
278,
13962,
13,
4706,
396,
6521,
591,
1065,
297,
9406,
1423,
4464,
29889,
13,
4706,
565,
451,
1583,
29889,
2917,
1839,
710,
919,
2033,
29901,
13,
9651,
363,
844,
29918,
1989,
297,
13962,
29918,
1445,
29889,
9342,
287,
29918,
449,
29918,
8149,
29901,
13,
18884,
565,
844,
29918,
1989,
297,
4567,
29918,
8149,
29901,
13,
462,
1678,
628,
4567,
29918,
8149,
29961,
27259,
29918,
8149,
29889,
2248,
29898,
2055,
29918,
1989,
4638,
13,
13,
4706,
363,
4567,
29918,
1989,
297,
4567,
29918,
8149,
29901,
13,
9651,
3461,
29889,
25442,
29898,
8516,
29892,
525,
18552,
292,
13962,
29889,
742,
4567,
29918,
1989,
29897,
13,
13,
4706,
736,
3461,
13,
13,
1678,
732,
957,
24040,
29898,
5596,
29897,
13,
1678,
822,
679,
29918,
4381,
29918,
2917,
29898,
1311,
29897,
1599,
360,
919,
29901,
13,
4706,
736,
426,
13,
9651,
525,
710,
919,
2396,
7700,
29892,
13,
4706,
500,
13,
2
] |
coordinator/api/management/commands/fakedata.py | kids-first/kf-api-release-coordinator | 2 | 80688 | <gh_stars>1-10
from django.core.management.base import BaseCommand
from coordinator.api.factories.release import ReleaseFactory
class Command(BaseCommand):
help = "Pre-populate the database with fake data"
def handle(self, *args, **options):
ReleaseFactory.create_batch(100)
self.stdout.write(self.style.SUCCESS("Created releases"))
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
9557,
29889,
3221,
29889,
21895,
29889,
3188,
1053,
7399,
6255,
13,
3166,
6615,
1061,
29889,
2754,
29889,
17028,
3842,
29889,
14096,
1053,
23708,
5126,
13,
13,
13,
1990,
10516,
29898,
5160,
6255,
1125,
13,
1678,
1371,
353,
376,
6572,
29899,
7323,
5987,
278,
2566,
411,
25713,
848,
29908,
13,
13,
1678,
822,
4386,
29898,
1311,
29892,
334,
5085,
29892,
3579,
6768,
1125,
13,
4706,
23708,
5126,
29889,
3258,
29918,
16175,
29898,
29896,
29900,
29900,
29897,
13,
4706,
1583,
29889,
25393,
29889,
3539,
29898,
1311,
29889,
3293,
29889,
14605,
26925,
703,
20399,
27474,
5783,
13,
2
] |
desafiosCursoEmVideo/ex018.py | gomesGabriel/Pythonicos | 1 | 156246 | <filename>desafiosCursoEmVideo/ex018.py
import math
n1 = float(input('Digite um valor: '))
print('O seno: {:.5f}' .format(math.sin(math.radians(n1))))
print('O cosseno: {:.5f}' .format(math.cos(math.radians(n1))))
print('O tg: {:.5f}' .format(math.tan(math.radians(n1))))
| [
1,
529,
9507,
29958,
2783,
2142,
2363,
23902,
578,
6026,
15167,
29914,
735,
29900,
29896,
29947,
29889,
2272,
13,
5215,
5844,
13,
29876,
29896,
353,
5785,
29898,
2080,
877,
14991,
568,
1922,
16497,
29901,
525,
876,
13,
2158,
877,
29949,
6940,
29877,
29901,
12365,
29889,
29945,
29888,
10162,
869,
4830,
29898,
755,
29889,
5223,
29898,
755,
29889,
3665,
5834,
29898,
29876,
29896,
13697,
13,
2158,
877,
29949,
274,
2209,
8154,
29901,
12365,
29889,
29945,
29888,
10162,
869,
4830,
29898,
755,
29889,
3944,
29898,
755,
29889,
3665,
5834,
29898,
29876,
29896,
13697,
13,
2158,
877,
29949,
260,
29887,
29901,
12365,
29889,
29945,
29888,
10162,
869,
4830,
29898,
755,
29889,
13161,
29898,
755,
29889,
3665,
5834,
29898,
29876,
29896,
13697,
13,
2
] |
updates.py | knowledgetechnologyuhh/hipss | 0 | 16314 | import torch
import numpy as np
import torch.nn.functional as F
from torch.nn.utils.clip_grad import clip_grad_norm_
from mpi_utils.mpi_utils import sync_grads
def update_entropy(alpha, log_alpha, target_entropy, log_pi, alpha_optim, cfg):
if cfg.automatic_entropy_tuning:
alpha_loss = -(log_alpha * (log_pi + target_entropy).detach()).mean()
alpha_optim.zero_grad()
alpha_loss.backward()
alpha_optim.step()
alpha = log_alpha.exp()
alpha_tlogs = alpha.clone()
else:
alpha_loss = torch.tensor(0.)
alpha_tlogs = torch.tensor(alpha)
return alpha_loss, alpha_tlogs
def update_flat(actor_network, critic_network, critic_target_network, policy_optim, critic_optim, alpha, log_alpha,
target_entropy, alpha_optim, obs_norm, ag_norm, g_norm, obs_next_norm, actions, rewards, cfg):
inputs_norm = np.concatenate([obs_norm, ag_norm, g_norm], axis=1)
inputs_next_norm = np.concatenate([obs_next_norm, ag_norm, g_norm], axis=1)
inputs_norm_tensor = torch.tensor(inputs_norm, dtype=torch.float32)
inputs_next_norm_tensor = torch.tensor(inputs_next_norm, dtype=torch.float32)
actions_tensor = torch.tensor(actions, dtype=torch.float32)
r_tensor = torch.tensor(rewards, dtype=torch.float32).reshape(rewards.shape[0], 1)
if cfg.cuda:
inputs_norm_tensor = inputs_norm_tensor.cuda()
inputs_next_norm_tensor = inputs_next_norm_tensor.cuda()
actions_tensor = actions_tensor.cuda()
r_tensor = r_tensor.cuda()
with torch.no_grad():
actions_next, log_pi_next, _ = actor_network.sample(inputs_next_norm_tensor)
qf_next_target = critic_target_network(inputs_next_norm_tensor, actions_next)
min_qf_next_target = torch.min(qf_next_target, dim=0).values - alpha * log_pi_next
next_q_value = r_tensor + cfg.gamma * min_qf_next_target
# the q loss
qf = critic_network(inputs_norm_tensor, actions_tensor)
qf_loss = torch.stack([F.mse_loss(_qf, next_q_value) for _qf in qf]).mean()
# the actor loss
pi, log_pi, _ = actor_network.sample(inputs_norm_tensor)
qf_pi = critic_network(inputs_norm_tensor, pi)
min_qf_pi = torch.min(qf_pi, dim=0).values
policy_loss = ((alpha * log_pi) - min_qf_pi).mean()
# update actor network
policy_optim.zero_grad()
policy_loss.backward()
sync_grads(actor_network)
policy_optim.step()
# update the critic_network
critic_optim.zero_grad()
qf_loss.backward()
if cfg.clip_grad_norm:
clip_grad_norm_(critic_network.parameters(), cfg.max_norm)
sync_grads(critic_network)
critic_optim.step()
alpha_loss, alpha_tlogs = update_entropy(alpha, log_alpha, target_entropy, log_pi, alpha_optim, cfg)
train_metrics = dict(q_loss=qf_loss.item(),
next_q=next_q_value.mean().item(),
policy_loss=policy_loss.item(),
alpha_loss=alpha_loss.item(),
alpha_tlogs=alpha_tlogs.item())
for idx, (_qf, _qtarget) in enumerate(zip(qf, qf_next_target)):
train_metrics[f'q_{idx}'] = _qf.mean().item()
train_metrics[f'q_target_{idx}'] = _qtarget.mean().item()
return train_metrics
def update_language(actor_network, critic_network, critic_target_network, policy_optim, critic_optim, alpha, log_alpha,
target_entropy, alpha_optim, obs_norm, instruction, obs_next_norm, actions, rewards, cfg):
inputs_norm = obs_norm
inputs_next_norm = obs_next_norm
inputs_norm_tensor = torch.tensor(inputs_norm, dtype=torch.float32)
inputs_next_norm_tensor = torch.tensor(inputs_next_norm, dtype=torch.float32)
actions_tensor = torch.tensor(actions, dtype=torch.float32)
r_tensor = torch.tensor(rewards, dtype=torch.float32).reshape(rewards.shape[0], 1)
instruction_tensor = torch.tensor(instruction, dtype=torch.long)
if cfg.cuda:
inputs_norm_tensor = inputs_norm_tensor.cuda()
inputs_next_norm_tensor = inputs_next_norm_tensor.cuda()
actions_tensor = actions_tensor.cuda()
r_tensor = r_tensor.cuda()
instruction_tensor = instruction_tensor.cuda()
with torch.no_grad():
actions_next, log_pi_next, _ = actor_network.sample(inputs_next_norm_tensor, instruction_tensor)
qf_next_target = critic_target_network(inputs_next_norm_tensor, actions_next, instruction_tensor)
min_qf_next_target = torch.min(qf_next_target, dim=0).values - alpha * log_pi_next
next_q_value = r_tensor + cfg.gamma * min_qf_next_target
# the q loss
qf = critic_network(inputs_norm_tensor, actions_tensor, instruction_tensor)
qf_loss = torch.stack([F.mse_loss(_qf, next_q_value) for _qf in qf]).mean()
# the actor loss
pi, log_pi, _ = actor_network.sample(inputs_norm_tensor, instruction_tensor)
qf_pi = critic_network(inputs_norm_tensor, pi, instruction_tensor)
min_qf_pi = torch.min(qf_pi, dim=0).values
policy_loss = ((alpha * log_pi) - min_qf_pi).mean()
# update actor network
policy_optim.zero_grad()
policy_loss.backward()
sync_grads(actor_network)
policy_optim.step()
# update the critic_network
critic_optim.zero_grad()
qf_loss.backward()
if cfg.clip_grad_norm:
clip_grad_norm_(critic_network.parameters(), cfg.max_norm)
sync_grads(critic_network)
critic_optim.step()
alpha_loss, alpha_tlogs = update_entropy(alpha, log_alpha, target_entropy, log_pi, alpha_optim, cfg)
train_metrics = dict(q_loss=qf_loss.item(),
next_q=next_q_value.mean().item(),
policy_loss=policy_loss.item(),
alpha_loss=alpha_loss.item(),
alpha_tlogs=alpha_tlogs.item())
for idx, (_qf, _qtarget) in enumerate(zip(qf, qf_next_target)):
train_metrics[f'q_{idx}'] = _qf.mean().item()
train_metrics[f'q_target_{idx}'] = _qtarget.mean().item()
return train_metrics
| [
1,
1053,
4842,
305,
13,
5215,
12655,
408,
7442,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
3166,
4842,
305,
29889,
15755,
29889,
13239,
29889,
24049,
29918,
5105,
1053,
20102,
29918,
5105,
29918,
12324,
29918,
13,
3166,
286,
1631,
29918,
13239,
29889,
1526,
29875,
29918,
13239,
1053,
16523,
29918,
5105,
29879,
13,
13,
13,
1753,
2767,
29918,
296,
14441,
29898,
2312,
29892,
1480,
29918,
2312,
29892,
3646,
29918,
296,
14441,
29892,
1480,
29918,
1631,
29892,
15595,
29918,
20640,
29892,
274,
16434,
1125,
13,
1678,
565,
274,
16434,
29889,
17405,
2454,
29918,
296,
14441,
29918,
29873,
27964,
29901,
13,
4706,
15595,
29918,
6758,
353,
19691,
1188,
29918,
2312,
334,
313,
1188,
29918,
1631,
718,
3646,
29918,
296,
14441,
467,
4801,
496,
16655,
12676,
580,
13,
13,
4706,
15595,
29918,
20640,
29889,
9171,
29918,
5105,
580,
13,
4706,
15595,
29918,
6758,
29889,
1627,
1328,
580,
13,
4706,
15595,
29918,
20640,
29889,
10568,
580,
13,
13,
4706,
15595,
353,
1480,
29918,
2312,
29889,
4548,
580,
13,
4706,
15595,
29918,
29873,
20756,
353,
15595,
29889,
16513,
580,
13,
1678,
1683,
29901,
13,
4706,
15595,
29918,
6758,
353,
4842,
305,
29889,
20158,
29898,
29900,
1846,
13,
4706,
15595,
29918,
29873,
20756,
353,
4842,
305,
29889,
20158,
29898,
2312,
29897,
13,
13,
1678,
736,
15595,
29918,
6758,
29892,
15595,
29918,
29873,
20756,
13,
13,
13,
1753,
2767,
29918,
20620,
29898,
7168,
29918,
11618,
29892,
11164,
29918,
11618,
29892,
11164,
29918,
5182,
29918,
11618,
29892,
8898,
29918,
20640,
29892,
11164,
29918,
20640,
29892,
15595,
29892,
1480,
29918,
2312,
29892,
13,
18884,
3646,
29918,
296,
14441,
29892,
15595,
29918,
20640,
29892,
20881,
29918,
12324,
29892,
946,
29918,
12324,
29892,
330,
29918,
12324,
29892,
20881,
29918,
4622,
29918,
12324,
29892,
8820,
29892,
337,
2935,
29892,
274,
16434,
1125,
13,
1678,
10970,
29918,
12324,
353,
7442,
29889,
535,
29883,
2579,
403,
4197,
26290,
29918,
12324,
29892,
946,
29918,
12324,
29892,
330,
29918,
12324,
1402,
9685,
29922,
29896,
29897,
13,
1678,
10970,
29918,
4622,
29918,
12324,
353,
7442,
29889,
535,
29883,
2579,
403,
4197,
26290,
29918,
4622,
29918,
12324,
29892,
946,
29918,
12324,
29892,
330,
29918,
12324,
1402,
9685,
29922,
29896,
29897,
13,
13,
1678,
10970,
29918,
12324,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
2080,
29879,
29918,
12324,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
1678,
10970,
29918,
4622,
29918,
12324,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
2080,
29879,
29918,
4622,
29918,
12324,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
1678,
8820,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
7387,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
1678,
364,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
276,
2935,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
467,
690,
14443,
29898,
276,
2935,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
29897,
13,
13,
1678,
565,
274,
16434,
29889,
29883,
6191,
29901,
13,
4706,
10970,
29918,
12324,
29918,
20158,
353,
10970,
29918,
12324,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
10970,
29918,
4622,
29918,
12324,
29918,
20158,
353,
10970,
29918,
4622,
29918,
12324,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
8820,
29918,
20158,
353,
8820,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
364,
29918,
20158,
353,
364,
29918,
20158,
29889,
29883,
6191,
580,
13,
13,
1678,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
4706,
8820,
29918,
4622,
29892,
1480,
29918,
1631,
29918,
4622,
29892,
903,
353,
11339,
29918,
11618,
29889,
11249,
29898,
2080,
29879,
29918,
4622,
29918,
12324,
29918,
20158,
29897,
13,
4706,
3855,
29888,
29918,
4622,
29918,
5182,
353,
11164,
29918,
5182,
29918,
11618,
29898,
2080,
29879,
29918,
4622,
29918,
12324,
29918,
20158,
29892,
8820,
29918,
4622,
29897,
13,
4706,
1375,
29918,
29939,
29888,
29918,
4622,
29918,
5182,
353,
4842,
305,
29889,
1195,
29898,
29939,
29888,
29918,
4622,
29918,
5182,
29892,
3964,
29922,
29900,
467,
5975,
448,
15595,
334,
1480,
29918,
1631,
29918,
4622,
13,
4706,
2446,
29918,
29939,
29918,
1767,
353,
364,
29918,
20158,
718,
274,
16434,
29889,
4283,
334,
1375,
29918,
29939,
29888,
29918,
4622,
29918,
5182,
13,
13,
1678,
396,
278,
3855,
6410,
13,
1678,
3855,
29888,
353,
11164,
29918,
11618,
29898,
2080,
29879,
29918,
12324,
29918,
20158,
29892,
8820,
29918,
20158,
29897,
13,
1678,
3855,
29888,
29918,
6758,
353,
4842,
305,
29889,
1429,
4197,
29943,
29889,
29885,
344,
29918,
6758,
7373,
29939,
29888,
29892,
2446,
29918,
29939,
29918,
1767,
29897,
363,
903,
29939,
29888,
297,
3855,
29888,
14664,
12676,
580,
13,
1678,
396,
278,
11339,
6410,
13,
1678,
2930,
29892,
1480,
29918,
1631,
29892,
903,
353,
11339,
29918,
11618,
29889,
11249,
29898,
2080,
29879,
29918,
12324,
29918,
20158,
29897,
13,
1678,
3855,
29888,
29918,
1631,
353,
11164,
29918,
11618,
29898,
2080,
29879,
29918,
12324,
29918,
20158,
29892,
2930,
29897,
13,
1678,
1375,
29918,
29939,
29888,
29918,
1631,
353,
4842,
305,
29889,
1195,
29898,
29939,
29888,
29918,
1631,
29892,
3964,
29922,
29900,
467,
5975,
13,
1678,
8898,
29918,
6758,
353,
5135,
2312,
334,
1480,
29918,
1631,
29897,
448,
1375,
29918,
29939,
29888,
29918,
1631,
467,
12676,
580,
13,
13,
1678,
396,
2767,
11339,
3564,
13,
1678,
8898,
29918,
20640,
29889,
9171,
29918,
5105,
580,
13,
1678,
8898,
29918,
6758,
29889,
1627,
1328,
580,
13,
1678,
16523,
29918,
5105,
29879,
29898,
7168,
29918,
11618,
29897,
13,
1678,
8898,
29918,
20640,
29889,
10568,
580,
13,
13,
1678,
396,
2767,
278,
11164,
29918,
11618,
13,
1678,
11164,
29918,
20640,
29889,
9171,
29918,
5105,
580,
13,
1678,
3855,
29888,
29918,
6758,
29889,
1627,
1328,
580,
13,
1678,
565,
274,
16434,
29889,
24049,
29918,
5105,
29918,
12324,
29901,
13,
4706,
20102,
29918,
5105,
29918,
12324,
23538,
9695,
293,
29918,
11618,
29889,
16744,
3285,
274,
16434,
29889,
3317,
29918,
12324,
29897,
13,
1678,
16523,
29918,
5105,
29879,
29898,
9695,
293,
29918,
11618,
29897,
13,
1678,
11164,
29918,
20640,
29889,
10568,
580,
13,
13,
1678,
15595,
29918,
6758,
29892,
15595,
29918,
29873,
20756,
353,
2767,
29918,
296,
14441,
29898,
2312,
29892,
1480,
29918,
2312,
29892,
3646,
29918,
296,
14441,
29892,
1480,
29918,
1631,
29892,
15595,
29918,
20640,
29892,
274,
16434,
29897,
13,
13,
1678,
7945,
29918,
2527,
10817,
353,
9657,
29898,
29939,
29918,
6758,
29922,
29939,
29888,
29918,
6758,
29889,
667,
3285,
13,
462,
308,
2446,
29918,
29939,
29922,
4622,
29918,
29939,
29918,
1767,
29889,
12676,
2141,
667,
3285,
13,
462,
308,
8898,
29918,
6758,
29922,
22197,
29918,
6758,
29889,
667,
3285,
13,
462,
308,
15595,
29918,
6758,
29922,
2312,
29918,
6758,
29889,
667,
3285,
13,
462,
308,
15595,
29918,
29873,
20756,
29922,
2312,
29918,
29873,
20756,
29889,
667,
3101,
13,
1678,
363,
22645,
29892,
9423,
29939,
29888,
29892,
903,
29939,
5182,
29897,
297,
26985,
29898,
7554,
29898,
29939,
29888,
29892,
3855,
29888,
29918,
4622,
29918,
5182,
22164,
13,
4706,
7945,
29918,
2527,
10817,
29961,
29888,
29915,
29939,
648,
13140,
29913,
2033,
353,
903,
29939,
29888,
29889,
12676,
2141,
667,
580,
13,
4706,
7945,
29918,
2527,
10817,
29961,
29888,
29915,
29939,
29918,
5182,
648,
13140,
29913,
2033,
353,
903,
29939,
5182,
29889,
12676,
2141,
667,
580,
13,
1678,
736,
7945,
29918,
2527,
10817,
13,
13,
13,
1753,
2767,
29918,
11675,
29898,
7168,
29918,
11618,
29892,
11164,
29918,
11618,
29892,
11164,
29918,
5182,
29918,
11618,
29892,
8898,
29918,
20640,
29892,
11164,
29918,
20640,
29892,
15595,
29892,
1480,
29918,
2312,
29892,
13,
462,
1678,
3646,
29918,
296,
14441,
29892,
15595,
29918,
20640,
29892,
20881,
29918,
12324,
29892,
15278,
29892,
20881,
29918,
4622,
29918,
12324,
29892,
8820,
29892,
337,
2935,
29892,
274,
16434,
1125,
13,
13,
1678,
10970,
29918,
12324,
353,
20881,
29918,
12324,
13,
1678,
10970,
29918,
4622,
29918,
12324,
353,
20881,
29918,
4622,
29918,
12324,
13,
13,
1678,
10970,
29918,
12324,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
2080,
29879,
29918,
12324,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
1678,
10970,
29918,
4622,
29918,
12324,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
2080,
29879,
29918,
4622,
29918,
12324,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
1678,
8820,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
7387,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
1678,
364,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
276,
2935,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
467,
690,
14443,
29898,
276,
2935,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
29897,
13,
1678,
15278,
29918,
20158,
353,
4842,
305,
29889,
20158,
29898,
2611,
4080,
29892,
26688,
29922,
7345,
305,
29889,
5426,
29897,
13,
13,
1678,
565,
274,
16434,
29889,
29883,
6191,
29901,
13,
4706,
10970,
29918,
12324,
29918,
20158,
353,
10970,
29918,
12324,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
10970,
29918,
4622,
29918,
12324,
29918,
20158,
353,
10970,
29918,
4622,
29918,
12324,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
8820,
29918,
20158,
353,
8820,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
364,
29918,
20158,
353,
364,
29918,
20158,
29889,
29883,
6191,
580,
13,
4706,
15278,
29918,
20158,
353,
15278,
29918,
20158,
29889,
29883,
6191,
580,
13,
13,
1678,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
4706,
8820,
29918,
4622,
29892,
1480,
29918,
1631,
29918,
4622,
29892,
903,
353,
11339,
29918,
11618,
29889,
11249,
29898,
2080,
29879,
29918,
4622,
29918,
12324,
29918,
20158,
29892,
15278,
29918,
20158,
29897,
13,
4706,
3855,
29888,
29918,
4622,
29918,
5182,
353,
11164,
29918,
5182,
29918,
11618,
29898,
2080,
29879,
29918,
4622,
29918,
12324,
29918,
20158,
29892,
8820,
29918,
4622,
29892,
15278,
29918,
20158,
29897,
13,
4706,
1375,
29918,
29939,
29888,
29918,
4622,
29918,
5182,
353,
4842,
305,
29889,
1195,
29898,
29939,
29888,
29918,
4622,
29918,
5182,
29892,
3964,
29922,
29900,
467,
5975,
448,
15595,
334,
1480,
29918,
1631,
29918,
4622,
13,
4706,
2446,
29918,
29939,
29918,
1767,
353,
364,
29918,
20158,
718,
274,
16434,
29889,
4283,
334,
1375,
29918,
29939,
29888,
29918,
4622,
29918,
5182,
13,
13,
1678,
396,
278,
3855,
6410,
13,
1678,
3855,
29888,
353,
11164,
29918,
11618,
29898,
2080,
29879,
29918,
12324,
29918,
20158,
29892,
8820,
29918,
20158,
29892,
15278,
29918,
20158,
29897,
13,
1678,
3855,
29888,
29918,
6758,
353,
4842,
305,
29889,
1429,
4197,
29943,
29889,
29885,
344,
29918,
6758,
7373,
29939,
29888,
29892,
2446,
29918,
29939,
29918,
1767,
29897,
363,
903,
29939,
29888,
297,
3855,
29888,
14664,
12676,
580,
13,
13,
1678,
396,
278,
11339,
6410,
13,
1678,
2930,
29892,
1480,
29918,
1631,
29892,
903,
353,
11339,
29918,
11618,
29889,
11249,
29898,
2080,
29879,
29918,
12324,
29918,
20158,
29892,
15278,
29918,
20158,
29897,
13,
1678,
3855,
29888,
29918,
1631,
353,
11164,
29918,
11618,
29898,
2080,
29879,
29918,
12324,
29918,
20158,
29892,
2930,
29892,
15278,
29918,
20158,
29897,
13,
1678,
1375,
29918,
29939,
29888,
29918,
1631,
353,
4842,
305,
29889,
1195,
29898,
29939,
29888,
29918,
1631,
29892,
3964,
29922,
29900,
467,
5975,
13,
1678,
8898,
29918,
6758,
353,
5135,
2312,
334,
1480,
29918,
1631,
29897,
448,
1375,
29918,
29939,
29888,
29918,
1631,
467,
12676,
580,
13,
13,
1678,
396,
2767,
11339,
3564,
13,
1678,
8898,
29918,
20640,
29889,
9171,
29918,
5105,
580,
13,
1678,
8898,
29918,
6758,
29889,
1627,
1328,
580,
13,
1678,
16523,
29918,
5105,
29879,
29898,
7168,
29918,
11618,
29897,
13,
1678,
8898,
29918,
20640,
29889,
10568,
580,
13,
13,
1678,
396,
2767,
278,
11164,
29918,
11618,
13,
1678,
11164,
29918,
20640,
29889,
9171,
29918,
5105,
580,
13,
1678,
3855,
29888,
29918,
6758,
29889,
1627,
1328,
580,
13,
1678,
565,
274,
16434,
29889,
24049,
29918,
5105,
29918,
12324,
29901,
13,
4706,
20102,
29918,
5105,
29918,
12324,
23538,
9695,
293,
29918,
11618,
29889,
16744,
3285,
274,
16434,
29889,
3317,
29918,
12324,
29897,
13,
1678,
16523,
29918,
5105,
29879,
29898,
9695,
293,
29918,
11618,
29897,
13,
1678,
11164,
29918,
20640,
29889,
10568,
580,
13,
13,
1678,
15595,
29918,
6758,
29892,
15595,
29918,
29873,
20756,
353,
2767,
29918,
296,
14441,
29898,
2312,
29892,
1480,
29918,
2312,
29892,
3646,
29918,
296,
14441,
29892,
1480,
29918,
1631,
29892,
15595,
29918,
20640,
29892,
274,
16434,
29897,
13,
13,
1678,
7945,
29918,
2527,
10817,
353,
9657,
29898,
29939,
29918,
6758,
29922,
29939,
29888,
29918,
6758,
29889,
667,
3285,
13,
462,
308,
2446,
29918,
29939,
29922,
4622,
29918,
29939,
29918,
1767,
29889,
12676,
2141,
667,
3285,
13,
462,
308,
8898,
29918,
6758,
29922,
22197,
29918,
6758,
29889,
667,
3285,
13,
462,
308,
15595,
29918,
6758,
29922,
2312,
29918,
6758,
29889,
667,
3285,
13,
462,
308,
15595,
29918,
29873,
20756,
29922,
2312,
29918,
29873,
20756,
29889,
667,
3101,
13,
1678,
363,
22645,
29892,
9423,
29939,
29888,
29892,
903,
29939,
5182,
29897,
297,
26985,
29898,
7554,
29898,
29939,
29888,
29892,
3855,
29888,
29918,
4622,
29918,
5182,
22164,
13,
4706,
7945,
29918,
2527,
10817,
29961,
29888,
29915,
29939,
648,
13140,
29913,
2033,
353,
903,
29939,
29888,
29889,
12676,
2141,
667,
580,
13,
4706,
7945,
29918,
2527,
10817,
29961,
29888,
29915,
29939,
29918,
5182,
648,
13140,
29913,
2033,
353,
903,
29939,
5182,
29889,
12676,
2141,
667,
580,
13,
1678,
736,
7945,
29918,
2527,
10817,
13,
2
] |
search/urls.py | MubongwoNdasi/pms | 0 | 1607683 | from django.urls import path
from search import views
app_name = 'search'
urlpatterns = [
path('', views.DrugSearchListView.as_view(), name="list"),
path('pharmacist_list', views.PharmacistSearchListView.as_view(),
name="pharmacist_list"),
]
| [
1,
515,
9557,
29889,
26045,
1053,
2224,
13,
3166,
2740,
1053,
8386,
13,
13,
13,
932,
29918,
978,
353,
525,
4478,
29915,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
2224,
877,
742,
8386,
29889,
29928,
11124,
7974,
15660,
29889,
294,
29918,
1493,
3285,
1024,
543,
1761,
4968,
13,
1678,
2224,
877,
561,
2817,
562,
391,
29918,
1761,
742,
8386,
29889,
4819,
2817,
562,
391,
7974,
15660,
29889,
294,
29918,
1493,
3285,
13,
308,
1024,
543,
561,
2817,
562,
391,
29918,
1761,
4968,
13,
29962,
13,
2
] |
test.py | zhanghanduo/calc_new | 1 | 41595 | #!/usr/bin/env python3
import layers
import cv2
from os.path import join
import numpy as np
# import tensorflow as tf
import Augmentor
vw = 320
vh = 320
class Augment:
def __init__(self):
self.w = 2 * 640
self.h = 2 * 480
self.canvas = np.zeros((self.h, self.w, 3), dtype=np.uint8)
def update(self, _im):
# sc = .4
# h, w = (int(sc * _im.shape[0]), int(sc * _im.shape[1]))
vh = _im.shape[0]
vw = _im.shape[1]
# im = cv2.resize(_im, (w, h))
self.canvas[100:(100 + vh), :vw, :] = _im
cv2.putText(self.canvas, "Original", (0, 50), cv2.FONT_HERSHEY_COMPLEX, 1.0, (255, 255, 255))
cv2.putText(self.canvas, "Distorted", (0, 150 + vh), cv2.FONT_HERSHEY_COMPLEX, 1.0, (255, 255, 255))
self.canvas[(200 + vh):(200 + 2 * vh), :vw, :] = _im
cv2.imshow("Image Augment", self.canvas)
cv2.waitKey(0)
if __name__ == "__main__":
data_root = "/mnt/4102422c-af52-4b55-988f-df7544b35598/dataset/KITTI/KITTI_Odometry/"
seq = "14"
vo_fn = data_root + "dataset/poses/" + seq.zfill(2) + ".txt"
im_dir = data_root + "dataset/sequences/" + seq.zfill(2)
aux_dir = "/home/handuo/projects/paper/image_base/downloads"
i = 0
gui = Augment()
# with tf.Session() as sess:
ims = []
p = Augmentor.Pipeline(join(im_dir, "image_0/"), output_directory="../../../output", save_format="JPEG")
# print("Has %s samples." % (len(p.augmentor_images)))
p.zoom(probability=0.3, min_factor=0.9, max_factor=1.2)
p.skew(probability=0.75, magnitude=0.3)
# p.random_erasing(probability=0.5, rectangle_area=0.3)
p.multi_erasing(probability=0.5, max_x_axis=0.3, max_y_axis=0.15, max_num=4)
# p.rotate(probability=0.5, max_left_rotation=6, max_right_rotation=6)
p.sample(10)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
5215,
15359,
13,
5215,
13850,
29906,
13,
3166,
2897,
29889,
2084,
1053,
5988,
13,
5215,
12655,
408,
7442,
13,
29937,
1053,
26110,
408,
15886,
13,
5215,
22333,
358,
272,
13,
13,
29894,
29893,
353,
29871,
29941,
29906,
29900,
13,
29894,
29882,
353,
29871,
29941,
29906,
29900,
13,
13,
13,
1990,
22333,
358,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
29893,
353,
29871,
29906,
334,
29871,
29953,
29946,
29900,
13,
4706,
1583,
29889,
29882,
353,
29871,
29906,
334,
29871,
29946,
29947,
29900,
13,
4706,
1583,
29889,
15257,
353,
7442,
29889,
3298,
359,
3552,
1311,
29889,
29882,
29892,
1583,
29889,
29893,
29892,
29871,
29941,
511,
26688,
29922,
9302,
29889,
13470,
29947,
29897,
13,
13,
1678,
822,
2767,
29898,
1311,
29892,
903,
326,
1125,
13,
4706,
396,
885,
353,
869,
29946,
13,
4706,
396,
298,
29892,
281,
353,
313,
524,
29898,
1557,
334,
903,
326,
29889,
12181,
29961,
29900,
11724,
938,
29898,
1557,
334,
903,
326,
29889,
12181,
29961,
29896,
12622,
13,
4706,
325,
29882,
353,
903,
326,
29889,
12181,
29961,
29900,
29962,
13,
4706,
325,
29893,
353,
903,
326,
29889,
12181,
29961,
29896,
29962,
13,
4706,
396,
527,
353,
13850,
29906,
29889,
21476,
7373,
326,
29892,
313,
29893,
29892,
298,
876,
13,
4706,
1583,
29889,
15257,
29961,
29896,
29900,
29900,
5919,
29896,
29900,
29900,
718,
325,
29882,
511,
584,
29894,
29893,
29892,
584,
29962,
353,
903,
326,
13,
13,
4706,
13850,
29906,
29889,
649,
1626,
29898,
1311,
29889,
15257,
29892,
376,
26036,
613,
313,
29900,
29892,
29871,
29945,
29900,
511,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
21514,
1307,
29990,
29892,
29871,
29896,
29889,
29900,
29892,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
876,
13,
4706,
13850,
29906,
29889,
649,
1626,
29898,
1311,
29889,
15257,
29892,
376,
13398,
18054,
613,
313,
29900,
29892,
29871,
29896,
29945,
29900,
718,
325,
29882,
511,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
21514,
1307,
29990,
29892,
29871,
29896,
29889,
29900,
29892,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
876,
13,
13,
4706,
1583,
29889,
15257,
15625,
29906,
29900,
29900,
718,
325,
29882,
1125,
29898,
29906,
29900,
29900,
718,
29871,
29906,
334,
325,
29882,
511,
584,
29894,
29893,
29892,
584,
29962,
353,
903,
326,
13,
13,
4706,
13850,
29906,
29889,
326,
4294,
703,
2940,
22333,
358,
613,
1583,
29889,
15257,
29897,
13,
4706,
13850,
29906,
29889,
10685,
2558,
29898,
29900,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
848,
29918,
4632,
353,
5591,
29885,
593,
29914,
29946,
29896,
29900,
29906,
29946,
29906,
29906,
29883,
29899,
2142,
29945,
29906,
29899,
29946,
29890,
29945,
29945,
29899,
29929,
29947,
29947,
29888,
29899,
2176,
29955,
29945,
29946,
29946,
29890,
29941,
29945,
29945,
29929,
29947,
29914,
24713,
29914,
29968,
1806,
24301,
29914,
29968,
1806,
24301,
29918,
29949,
3129,
27184,
12975,
13,
1678,
19359,
353,
376,
29896,
29946,
29908,
13,
1678,
992,
29918,
9144,
353,
848,
29918,
4632,
718,
376,
24713,
29914,
10590,
12975,
718,
19359,
29889,
29920,
5589,
29898,
29906,
29897,
718,
11393,
3945,
29908,
13,
1678,
527,
29918,
3972,
353,
848,
29918,
4632,
718,
376,
24713,
29914,
6831,
2063,
12975,
718,
19359,
29889,
29920,
5589,
29898,
29906,
29897,
13,
13,
1678,
3479,
29918,
3972,
353,
5591,
5184,
29914,
3179,
25608,
29914,
16418,
29914,
19773,
29914,
3027,
29918,
3188,
29914,
10382,
29879,
29908,
13,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
1410,
29875,
353,
22333,
358,
580,
13,
13,
1678,
396,
411,
15886,
29889,
7317,
580,
408,
27937,
29901,
13,
1678,
527,
29879,
353,
5159,
13,
1678,
282,
353,
22333,
358,
272,
29889,
29925,
23828,
29898,
7122,
29898,
326,
29918,
3972,
29892,
376,
3027,
29918,
29900,
29914,
4968,
1962,
29918,
12322,
543,
21546,
6995,
4905,
613,
4078,
29918,
4830,
543,
29967,
4162,
29954,
1159,
13,
1678,
396,
1596,
703,
14510,
1273,
29879,
11916,
1213,
1273,
313,
2435,
29898,
29886,
29889,
2987,
358,
272,
29918,
8346,
4961,
13,
1678,
282,
29889,
2502,
290,
29898,
22795,
3097,
29922,
29900,
29889,
29941,
29892,
1375,
29918,
19790,
29922,
29900,
29889,
29929,
29892,
4236,
29918,
19790,
29922,
29896,
29889,
29906,
29897,
13,
1678,
282,
29889,
26050,
29893,
29898,
22795,
3097,
29922,
29900,
29889,
29955,
29945,
29892,
18497,
29922,
29900,
29889,
29941,
29897,
13,
1678,
396,
282,
29889,
8172,
29918,
261,
5832,
29898,
22795,
3097,
29922,
29900,
29889,
29945,
29892,
16701,
29918,
6203,
29922,
29900,
29889,
29941,
29897,
13,
1678,
282,
29889,
9910,
29918,
261,
5832,
29898,
22795,
3097,
29922,
29900,
29889,
29945,
29892,
4236,
29918,
29916,
29918,
8990,
29922,
29900,
29889,
29941,
29892,
4236,
29918,
29891,
29918,
8990,
29922,
29900,
29889,
29896,
29945,
29892,
4236,
29918,
1949,
29922,
29946,
29897,
13,
1678,
396,
282,
29889,
23361,
29898,
22795,
3097,
29922,
29900,
29889,
29945,
29892,
4236,
29918,
1563,
29918,
5450,
362,
29922,
29953,
29892,
4236,
29918,
1266,
29918,
5450,
362,
29922,
29953,
29897,
13,
1678,
282,
29889,
11249,
29898,
29896,
29900,
29897,
13,
13,
13,
2
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.