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
|
---|---|---|---|---|---|
bin/analysis/ipa/constraints/split.py | ncbray/pystream | 6 | 11699 | # Copyright 2011 <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 language.python import ast
from . base import Constraint
from .. calling import cpa
class Splitter(Constraint):
def __init__(self, src):
assert src.isNode(), src
self.src = src
self.dst = []
self.callbacks = []
def addSplitCallback(self, callback):
self.callbacks.append(callback)
if self.objects: callback()
def attach(self):
self.src.addNext(self)
def localName(self):
return 'split_temp'
def makeTarget(self, context):
lcl = context.local(ast.Local(self.localName()))
lcl.addPrev(self)
self.dst.append(lcl)
return lcl
def makeConsistent(self, context):
# Make constraint consistent
if self.src.values:
self.changed(context, self.src, self.src.values)
if self.src.critical.values:
self.criticalChanged(context, self.src, self.src.critical.values)
def criticalChanged(self, context, node, diff):
for dst in self.dst:
dst.critical.updateValues(context, dst, diff)
def doNotify(self):
for callback in self.callbacks:
callback()
def isSplit(self):
return True
class TypeSplitConstraint(Splitter):
def __init__(self, src):
Splitter.__init__(self, src)
self.objects = {}
self.megamorphic = False
def localName(self):
return 'type_split_temp'
def types(self):
return self.objects.keys()
def makeMegamorphic(self):
assert not self.megamorphic
self.megamorphic = True
self.objects.clear()
self.objects[cpa.anyType] = self.src
self.doNotify()
def changed(self, context, node, diff):
if self.megamorphic: return
changed = False
for obj in diff:
cpaType = obj.cpaType()
if cpaType not in self.objects:
if len(self.objects) >= 4:
self.makeMegamorphic()
break
else:
temp = self.makeTarget(context)
self.objects[cpaType] = temp
changed = True
else:
temp = self.objects[cpaType]
temp.updateSingleValue(obj)
else:
if changed: self.doNotify()
# TODO prevent over splitting? All objects with the same qualifier should be grouped?
class ExactSplitConstraint(Splitter):
def __init__(self, src):
Splitter.__init__(self, src)
self.objects = {}
def localName(self):
return 'exact_split_temp'
def changed(self, context, node, diff):
changed = False
for obj in diff:
if obj not in self.objects:
temp = self.makeTarget(context)
self.objects[obj] = temp
changed = True
else:
temp = self.objects[obj]
temp.updateSingleValue(obj)
if changed: self.doNotify()
| [
1,
396,
14187,
1266,
29871,
29906,
29900,
29896,
29896,
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,
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,
4086,
29889,
4691,
1053,
8717,
13,
3166,
869,
2967,
1053,
1281,
4151,
524,
13,
3166,
6317,
5432,
1053,
274,
3274,
13,
13,
1990,
26178,
357,
29898,
21529,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4765,
1125,
13,
12,
12,
9294,
4765,
29889,
275,
4247,
3285,
4765,
13,
12,
12,
1311,
29889,
4351,
353,
4765,
13,
12,
12,
1311,
29889,
22992,
353,
5159,
13,
12,
12,
1311,
29889,
14035,
29879,
353,
5159,
13,
13,
12,
1753,
788,
18772,
10717,
29898,
1311,
29892,
6939,
1125,
13,
12,
12,
1311,
29889,
14035,
29879,
29889,
4397,
29898,
14035,
29897,
13,
12,
12,
361,
1583,
29889,
12650,
29901,
6939,
580,
13,
13,
12,
1753,
10641,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
4351,
29889,
1202,
9190,
29898,
1311,
29897,
13,
13,
12,
1753,
1887,
1170,
29898,
1311,
1125,
13,
12,
12,
2457,
525,
5451,
29918,
7382,
29915,
13,
13,
12,
1753,
1207,
8667,
29898,
1311,
29892,
3030,
1125,
13,
12,
12,
29880,
695,
353,
3030,
29889,
2997,
29898,
579,
29889,
7717,
29898,
1311,
29889,
2997,
1170,
22130,
13,
12,
12,
29880,
695,
29889,
1202,
6572,
29894,
29898,
1311,
29897,
13,
12,
12,
1311,
29889,
22992,
29889,
4397,
29898,
29880,
695,
29897,
13,
12,
12,
2457,
301,
695,
13,
13,
12,
1753,
1207,
13696,
9696,
29898,
1311,
29892,
3030,
1125,
13,
12,
12,
29937,
8561,
7276,
13747,
13,
12,
12,
361,
1583,
29889,
4351,
29889,
5975,
29901,
13,
12,
12,
12,
1311,
29889,
15033,
29898,
4703,
29892,
1583,
29889,
4351,
29892,
1583,
29889,
4351,
29889,
5975,
29897,
13,
13,
12,
12,
361,
1583,
29889,
4351,
29889,
9695,
936,
29889,
5975,
29901,
13,
12,
12,
12,
1311,
29889,
9695,
936,
7590,
29898,
4703,
29892,
1583,
29889,
4351,
29892,
1583,
29889,
4351,
29889,
9695,
936,
29889,
5975,
29897,
13,
13,
12,
1753,
12187,
7590,
29898,
1311,
29892,
3030,
29892,
2943,
29892,
2923,
1125,
13,
12,
12,
1454,
29743,
297,
1583,
29889,
22992,
29901,
13,
12,
12,
12,
22992,
29889,
9695,
936,
29889,
5504,
9065,
29898,
4703,
29892,
29743,
29892,
2923,
29897,
13,
13,
12,
1753,
437,
3664,
1598,
29898,
1311,
1125,
13,
12,
12,
1454,
6939,
297,
1583,
29889,
14035,
29879,
29901,
13,
12,
12,
12,
14035,
580,
13,
13,
12,
1753,
338,
18772,
29898,
1311,
1125,
13,
12,
12,
2457,
5852,
13,
13,
1990,
5167,
18772,
21529,
29898,
18772,
357,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4765,
1125,
13,
12,
12,
18772,
357,
17255,
2344,
12035,
1311,
29892,
4765,
29897,
13,
12,
12,
1311,
29889,
12650,
353,
6571,
13,
12,
12,
1311,
29889,
29885,
387,
314,
5676,
293,
353,
7700,
13,
13,
12,
1753,
1887,
1170,
29898,
1311,
1125,
13,
12,
12,
2457,
525,
1853,
29918,
5451,
29918,
7382,
29915,
13,
13,
12,
1753,
4072,
29898,
1311,
1125,
13,
12,
12,
2457,
1583,
29889,
12650,
29889,
8149,
580,
13,
13,
12,
1753,
1207,
29924,
387,
314,
5676,
293,
29898,
1311,
1125,
13,
12,
12,
9294,
451,
1583,
29889,
29885,
387,
314,
5676,
293,
13,
12,
12,
1311,
29889,
29885,
387,
314,
5676,
293,
353,
5852,
13,
12,
12,
1311,
29889,
12650,
29889,
8551,
580,
13,
12,
12,
1311,
29889,
12650,
29961,
29883,
3274,
29889,
1384,
1542,
29962,
353,
1583,
29889,
4351,
13,
12,
12,
1311,
29889,
1867,
3664,
1598,
580,
13,
13,
12,
1753,
3939,
29898,
1311,
29892,
3030,
29892,
2943,
29892,
2923,
1125,
13,
12,
12,
361,
1583,
29889,
29885,
387,
314,
5676,
293,
29901,
736,
13,
13,
12,
12,
15033,
353,
7700,
13,
12,
12,
1454,
5446,
297,
2923,
29901,
13,
12,
12,
12,
29883,
3274,
1542,
353,
5446,
29889,
29883,
3274,
1542,
580,
13,
13,
12,
12,
12,
361,
274,
3274,
1542,
451,
297,
1583,
29889,
12650,
29901,
13,
12,
12,
12,
12,
361,
7431,
29898,
1311,
29889,
12650,
29897,
6736,
29871,
29946,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
5675,
29924,
387,
314,
5676,
293,
580,
13,
12,
12,
12,
12,
12,
8690,
13,
12,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
12,
7382,
353,
1583,
29889,
5675,
8667,
29898,
4703,
29897,
13,
12,
12,
12,
12,
12,
1311,
29889,
12650,
29961,
29883,
3274,
1542,
29962,
353,
5694,
13,
12,
12,
12,
12,
12,
15033,
353,
5852,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
7382,
353,
1583,
29889,
12650,
29961,
29883,
3274,
1542,
29962,
13,
13,
12,
12,
12,
7382,
29889,
5504,
15771,
1917,
29898,
5415,
29897,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
361,
3939,
29901,
1583,
29889,
1867,
3664,
1598,
580,
13,
13,
13,
13,
29937,
14402,
5557,
975,
24368,
29973,
29871,
2178,
3618,
411,
278,
1021,
4021,
3709,
881,
367,
27831,
29973,
13,
1990,
1222,
627,
18772,
21529,
29898,
18772,
357,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4765,
1125,
13,
12,
12,
18772,
357,
17255,
2344,
12035,
1311,
29892,
4765,
29897,
13,
12,
12,
1311,
29889,
12650,
353,
6571,
13,
13,
12,
1753,
1887,
1170,
29898,
1311,
1125,
13,
12,
12,
2457,
525,
735,
627,
29918,
5451,
29918,
7382,
29915,
13,
13,
12,
1753,
3939,
29898,
1311,
29892,
3030,
29892,
2943,
29892,
2923,
1125,
13,
12,
12,
15033,
353,
7700,
13,
12,
12,
1454,
5446,
297,
2923,
29901,
13,
12,
12,
12,
361,
5446,
451,
297,
1583,
29889,
12650,
29901,
13,
12,
12,
12,
12,
7382,
353,
1583,
29889,
5675,
8667,
29898,
4703,
29897,
13,
12,
12,
12,
12,
1311,
29889,
12650,
29961,
5415,
29962,
353,
5694,
13,
12,
12,
12,
12,
15033,
353,
5852,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
7382,
353,
1583,
29889,
12650,
29961,
5415,
29962,
13,
13,
12,
12,
12,
7382,
29889,
5504,
15771,
1917,
29898,
5415,
29897,
13,
13,
12,
12,
361,
3939,
29901,
1583,
29889,
1867,
3664,
1598,
580,
13,
2
] |
src/typhoonae/redis/tests/benchmark.py | ukris/typhoonae.redis | 0 | 1600121 | <reponame>ukris/typhoonae.redis
# -*- coding: utf-8 -*-
#
# Copyright 2010 <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.
"""Benchmarks for the Datastore Redis stub."""
from google.appengine.datastore import datastore_index
from google.appengine.ext import db
import cStringIO
import google.appengine.api.apiproxy_stub
import google.appengine.api.apiproxy_stub_map
import google.appengine.runtime.apiproxy_errors
import os
import random
import sys
import time
import typhoonae.redis.datastore_redis_stub
INDEX_DEFINITIONS = """
indexes:
- kind: FirstModel
properties:
- name: prop2
"""
class FirstModel(db.Model):
prop1 = db.IntegerProperty(indexed=False)
prop2 = db.StringProperty()
prop3 = db.StringListProperty(indexed=False)
prop4 = db.StringProperty(indexed=False)
prop5 = db.IntegerProperty(indexed=False)
def get_datastore_stub():
# Set required environment variables
os.environ['APPLICATION_ID'] = 'test'
os.environ['AUTH_DOMAIN'] = 'mydomain.local'
# Read index definitions.
index_yaml = cStringIO.StringIO(INDEX_DEFINITIONS)
try:
indexes = datastore_index.IndexDefinitionsToProtos(
'test',
datastore_index.ParseIndexDefinitions(index_yaml).indexes)
except TypeError:
indexes = []
index_yaml.close()
# Register API proxy stub.
google.appengine.api.apiproxy_stub_map.apiproxy = (
google.appengine.api.apiproxy_stub_map.APIProxyStubMap())
datastore = typhoonae.redis.datastore_redis_stub.DatastoreRedisStub(
'test', indexes)
try:
google.appengine.api.apiproxy_stub_map.apiproxy.RegisterStub(
'datastore_v3', datastore)
except google.appengine.runtime.apiproxy_errors.ApplicationError, e:
raise RuntimeError('These tests require a running Redis server '
'(%s)' % e)
return google.appengine.api.apiproxy_stub_map.apiproxy.GetStub(
'datastore_v3')
def add_random_entities(num, kind):
r = random.Random()
numbers = range(1000)
chars = [' ']+[chr(i) for i in range(65, 104)]
for n in range(num):
data = []
for i in range(2):
data.extend(r.sample(chars[:40], 40))
s = ''.join(data)
i = r.sample(numbers, 1).pop()
entity = kind(prop1=i, prop2=s, prop3=[s, s], prop4=s, prop5=i)
entity.put()
def main():
try:
rounds = int(sys.argv[1])
except IndexError:
rounds = 1
stub = get_datastore_stub()
num = 1000
for kind in (FirstModel,):
for round in range(rounds):
print "Round %i" % (round+1)
print "------" + "-" * len('%i' % (round+1))
sys.stdout.write(
"Adding %i entities of %s with random data... "
% (num, kind.__name__))
sys.stdout.flush()
start = time.time()
add_random_entities(num, kind)
end = time.time()
result = end-start
if result < 1.0:
print result * 1000.0, "ms"
else:
print result, "sec"
print "Performance:", num/result, "entities/sec"
qs = "SELECT __key__ FROM %s WHERE prop2 > :1 ORDER BY prop2" % kind.__name__
sys.stdout.write(qs + '... ')
query = db.GqlQuery(qs, 'foo')
start = time.time()
results = list(query.fetch(1000))
end = time.time()
result = end-start
if result < 1.0:
print result * 1000.0, "ms"
else:
print result, "sec"
print "Number of results: %i" % len(results)
qs = "SELECT * FROM %s WHERE prop2 > :1 ORDER BY prop2" % kind.__name__
sys.stdout.write(qs + '... ')
query = db.GqlQuery(qs, 'foo')
start = time.time()
results = list(query.fetch(1000))
end = time.time()
result = end-start
if result < 1.0:
print result * 1000.0, "ms"
else:
print result, "sec"
print "Number of results: %i" % len(results)
print
#stub.Clear()
if __name__ == "__main__":
main()
| [
1,
529,
276,
1112,
420,
29958,
2679,
3780,
29914,
1017,
561,
29877,
2681,
29872,
29889,
1127,
275,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29900,
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,
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,
20841,
16580,
29879,
363,
278,
13373,
579,
487,
4367,
275,
19281,
1213,
15945,
13,
13,
3166,
5386,
29889,
932,
10599,
29889,
4130,
579,
487,
1053,
1418,
579,
487,
29918,
2248,
13,
3166,
5386,
29889,
932,
10599,
29889,
1062,
1053,
4833,
13,
13,
5215,
274,
1231,
5971,
13,
5215,
5386,
29889,
932,
10599,
29889,
2754,
29889,
481,
666,
307,
3594,
29918,
303,
431,
13,
5215,
5386,
29889,
932,
10599,
29889,
2754,
29889,
481,
666,
307,
3594,
29918,
303,
431,
29918,
1958,
13,
5215,
5386,
29889,
932,
10599,
29889,
15634,
29889,
481,
666,
307,
3594,
29918,
12523,
13,
5215,
2897,
13,
5215,
4036,
13,
5215,
10876,
13,
5215,
931,
13,
5215,
7911,
561,
29877,
2681,
29872,
29889,
1127,
275,
29889,
4130,
579,
487,
29918,
1127,
275,
29918,
303,
431,
13,
13,
13,
27992,
29918,
24405,
1177,
22122,
29903,
353,
9995,
13,
2248,
267,
29901,
13,
13,
29899,
2924,
29901,
3824,
3195,
13,
29871,
4426,
29901,
13,
29871,
448,
1024,
29901,
3107,
29906,
13,
15945,
29908,
13,
13,
13,
1990,
3824,
3195,
29898,
2585,
29889,
3195,
1125,
13,
1678,
3107,
29896,
353,
4833,
29889,
7798,
4854,
29898,
2248,
287,
29922,
8824,
29897,
13,
1678,
3107,
29906,
353,
4833,
29889,
1231,
4854,
580,
13,
1678,
3107,
29941,
353,
4833,
29889,
1231,
1293,
4854,
29898,
2248,
287,
29922,
8824,
29897,
13,
1678,
3107,
29946,
353,
4833,
29889,
1231,
4854,
29898,
2248,
287,
29922,
8824,
29897,
13,
1678,
3107,
29945,
353,
4833,
29889,
7798,
4854,
29898,
2248,
287,
29922,
8824,
29897,
13,
13,
13,
1753,
679,
29918,
4130,
579,
487,
29918,
303,
431,
7295,
13,
1678,
396,
3789,
3734,
5177,
3651,
13,
1678,
2897,
29889,
21813,
1839,
3301,
7390,
28541,
29918,
1367,
2033,
353,
525,
1688,
29915,
13,
1678,
2897,
29889,
21813,
1839,
20656,
29950,
29918,
3970,
29032,
2033,
353,
525,
1357,
7247,
29889,
2997,
29915,
13,
13,
1678,
396,
7523,
2380,
15848,
29889,
13,
1678,
2380,
29918,
25162,
353,
274,
1231,
5971,
29889,
1231,
5971,
29898,
27992,
29918,
24405,
1177,
22122,
29903,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
18111,
353,
1418,
579,
487,
29918,
2248,
29889,
3220,
3206,
262,
2187,
1762,
1184,
29873,
359,
29898,
13,
9651,
525,
1688,
742,
13,
9651,
1418,
579,
487,
29918,
2248,
29889,
12914,
3220,
3206,
262,
2187,
29898,
2248,
29918,
25162,
467,
2248,
267,
29897,
13,
1678,
5174,
20948,
29901,
13,
4706,
18111,
353,
5159,
13,
13,
1678,
2380,
29918,
25162,
29889,
5358,
580,
13,
13,
1678,
396,
12577,
3450,
10166,
19281,
29889,
13,
1678,
5386,
29889,
932,
10599,
29889,
2754,
29889,
481,
666,
307,
3594,
29918,
303,
431,
29918,
1958,
29889,
481,
666,
307,
3594,
353,
313,
13,
4706,
5386,
29889,
932,
10599,
29889,
2754,
29889,
481,
666,
307,
3594,
29918,
303,
431,
29918,
1958,
29889,
8787,
14048,
855,
431,
3388,
3101,
13,
13,
1678,
1418,
579,
487,
353,
7911,
561,
29877,
2681,
29872,
29889,
1127,
275,
29889,
4130,
579,
487,
29918,
1127,
275,
29918,
303,
431,
29889,
16390,
579,
487,
9039,
275,
855,
431,
29898,
13,
4706,
525,
1688,
742,
18111,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
5386,
29889,
932,
10599,
29889,
2754,
29889,
481,
666,
307,
3594,
29918,
303,
431,
29918,
1958,
29889,
481,
666,
307,
3594,
29889,
15213,
855,
431,
29898,
13,
9651,
525,
4130,
579,
487,
29918,
29894,
29941,
742,
1418,
579,
487,
29897,
13,
1678,
5174,
5386,
29889,
932,
10599,
29889,
15634,
29889,
481,
666,
307,
3594,
29918,
12523,
29889,
4873,
2392,
29892,
321,
29901,
13,
4706,
12020,
24875,
2392,
877,
1349,
968,
6987,
1996,
263,
2734,
4367,
275,
1923,
525,
13,
462,
965,
525,
29414,
29879,
16029,
1273,
321,
29897,
13,
13,
1678,
736,
5386,
29889,
932,
10599,
29889,
2754,
29889,
481,
666,
307,
3594,
29918,
303,
431,
29918,
1958,
29889,
481,
666,
307,
3594,
29889,
2577,
855,
431,
29898,
13,
4706,
525,
4130,
579,
487,
29918,
29894,
29941,
1495,
13,
13,
13,
1753,
788,
29918,
8172,
29918,
296,
1907,
29898,
1949,
29892,
2924,
1125,
13,
1678,
364,
353,
4036,
29889,
17875,
580,
13,
1678,
3694,
353,
3464,
29898,
29896,
29900,
29900,
29900,
29897,
13,
1678,
22524,
353,
6024,
525,
10062,
29961,
22495,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29953,
29945,
29892,
29871,
29896,
29900,
29946,
4638,
13,
1678,
363,
302,
297,
3464,
29898,
1949,
1125,
13,
4706,
848,
353,
5159,
13,
4706,
363,
474,
297,
3464,
29898,
29906,
1125,
13,
9651,
848,
29889,
21843,
29898,
29878,
29889,
11249,
29898,
305,
1503,
7503,
29946,
29900,
1402,
29871,
29946,
29900,
876,
13,
4706,
269,
353,
525,
4286,
7122,
29898,
1272,
29897,
13,
4706,
474,
353,
364,
29889,
11249,
29898,
20326,
29892,
29871,
29896,
467,
7323,
580,
29871,
13,
13,
4706,
7855,
353,
2924,
29898,
7728,
29896,
29922,
29875,
29892,
3107,
29906,
29922,
29879,
29892,
3107,
29941,
11759,
29879,
29892,
269,
1402,
3107,
29946,
29922,
29879,
29892,
3107,
29945,
29922,
29875,
29897,
13,
4706,
7855,
29889,
649,
580,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
1018,
29901,
13,
4706,
364,
3885,
353,
938,
29898,
9675,
29889,
19218,
29961,
29896,
2314,
13,
1678,
5174,
11374,
2392,
29901,
13,
4706,
364,
3885,
353,
29871,
29896,
13,
1678,
19281,
353,
679,
29918,
4130,
579,
487,
29918,
303,
431,
580,
13,
1678,
954,
353,
29871,
29896,
29900,
29900,
29900,
13,
13,
1678,
363,
2924,
297,
313,
6730,
3195,
29892,
1125,
13,
4706,
363,
4513,
297,
3464,
29898,
29878,
3885,
1125,
13,
9651,
1596,
376,
29934,
618,
1273,
29875,
29908,
1273,
313,
14486,
29974,
29896,
29897,
13,
9651,
1596,
376,
807,
13869,
718,
11663,
29908,
334,
7431,
877,
29995,
29875,
29915,
1273,
313,
14486,
29974,
29896,
876,
13,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
13,
18884,
376,
2528,
292,
1273,
29875,
16212,
310,
1273,
29879,
411,
4036,
848,
856,
376,
13,
18884,
1273,
313,
1949,
29892,
2924,
17255,
978,
1649,
876,
13,
9651,
10876,
29889,
25393,
29889,
23126,
580,
13,
9651,
1369,
353,
931,
29889,
2230,
580,
13,
9651,
788,
29918,
8172,
29918,
296,
1907,
29898,
1949,
29892,
2924,
29897,
13,
9651,
1095,
353,
931,
29889,
2230,
580,
13,
9651,
1121,
353,
1095,
29899,
2962,
13,
9651,
565,
1121,
529,
29871,
29896,
29889,
29900,
29901,
13,
18884,
1596,
1121,
334,
29871,
29896,
29900,
29900,
29900,
29889,
29900,
29892,
376,
1516,
29908,
13,
9651,
1683,
29901,
13,
18884,
1596,
1121,
29892,
376,
3471,
29908,
13,
13,
9651,
1596,
376,
5894,
13390,
29901,
613,
954,
29914,
2914,
29892,
376,
296,
1907,
29914,
3471,
29908,
13,
13,
9651,
3855,
29879,
353,
376,
6404,
4770,
1989,
1649,
3895,
1273,
29879,
5754,
3107,
29906,
1405,
584,
29896,
15606,
6770,
3107,
29906,
29908,
1273,
2924,
17255,
978,
1649,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
29939,
29879,
718,
525,
856,
25710,
13,
9651,
2346,
353,
4833,
29889,
29954,
1519,
3010,
29898,
29939,
29879,
29892,
525,
5431,
1495,
13,
9651,
1369,
353,
931,
29889,
2230,
580,
13,
9651,
2582,
353,
1051,
29898,
1972,
29889,
9155,
29898,
29896,
29900,
29900,
29900,
876,
13,
9651,
1095,
353,
931,
29889,
2230,
580,
13,
9651,
1121,
353,
1095,
29899,
2962,
13,
9651,
565,
1121,
529,
29871,
29896,
29889,
29900,
29901,
13,
18884,
1596,
1121,
334,
29871,
29896,
29900,
29900,
29900,
29889,
29900,
29892,
376,
1516,
29908,
13,
9651,
1683,
29901,
13,
18884,
1596,
1121,
29892,
376,
3471,
29908,
13,
9651,
1596,
376,
4557,
310,
2582,
29901,
1273,
29875,
29908,
1273,
7431,
29898,
9902,
29897,
13,
9651,
3855,
29879,
353,
376,
6404,
334,
3895,
1273,
29879,
5754,
3107,
29906,
1405,
584,
29896,
15606,
6770,
3107,
29906,
29908,
1273,
2924,
17255,
978,
1649,
13,
9651,
10876,
29889,
25393,
29889,
3539,
29898,
29939,
29879,
718,
525,
856,
25710,
13,
9651,
2346,
353,
4833,
29889,
29954,
1519,
3010,
29898,
29939,
29879,
29892,
525,
5431,
1495,
13,
9651,
1369,
353,
931,
29889,
2230,
580,
13,
9651,
2582,
353,
1051,
29898,
1972,
29889,
9155,
29898,
29896,
29900,
29900,
29900,
876,
13,
9651,
1095,
353,
931,
29889,
2230,
580,
13,
9651,
1121,
353,
1095,
29899,
2962,
13,
9651,
565,
1121,
529,
29871,
29896,
29889,
29900,
29901,
13,
18884,
1596,
1121,
334,
29871,
29896,
29900,
29900,
29900,
29889,
29900,
29892,
376,
1516,
29908,
13,
9651,
1683,
29901,
13,
18884,
1596,
1121,
29892,
376,
3471,
29908,
13,
9651,
1596,
376,
4557,
310,
2582,
29901,
1273,
29875,
29908,
1273,
7431,
29898,
9902,
29897,
13,
13,
9651,
1596,
13,
13,
1678,
396,
303,
431,
29889,
18759,
580,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
URLSHORT/app.py | its-mr-monday/Url-Shortener | 0 | 148787 | <reponame>its-mr-monday/Url-Shortener<filename>URLSHORT/app.py
from flask import Flask, render_template, flash, redirect, url_for, session, logging, request
from flask_mysqldb import MySQL
from functools import wraps
from passlib.hash import sha256_crypt
from webforms import *
from lib import *
from config import *
from table_matrix import *
from queries import *
app = Flask(__name__)
app.config['MYSQL_HOST'] = db_host
app.config['MYSQL_USER'] = db_user
app.config['MYSQL_PASSWORD'] = db_pass
app.config['MYSQL_DB'] = db_database
app.config['MYSQL_CURSORCLASS'] = 'DictCursor'
mysql = MySQL(app)
#function for checking if the user is logged in
def is_logged_in(f):
@wraps(f)
def wrap(*args, **kwargs):
if 'logged_in' in session: #if logged in return logged in status
return f(*args, **kwargs)
else: #if not logged in and trying to access a webpage redirect to login
flash('Unauthorized, Please login','danger')
return redirect(url_for('login'))
return wrap
#INDEX ROUTE
@app.route('/')
def index():
return render_template('index.html', nav_page="home")
#Quick function that will check the users db if the email or username is already taken
def registration_validation(uname, uemail):
cur = mysql.connection.cursor()
results = cur.execute("SELECT * FROM users WHERE uname = %s OR uemail = %s", (uname, uemail))
cur.close()
if results >= 1:
return False
else:
return True
@app.route('/register', methods=['GET','POST'])
def register():
#form = RegisterForm(request.form)
if request.method == 'POST':
name = request.form['name']
username = request.form['username']
email = request.form['email']
password = request.form['password']
confirm = request.form['confirm']
print(password)
print(confirm)
v = validateRegistration(name, username, email, password, confirm)
if v == "Success":
passw = <PASSWORD>256_crypt.encrypt(password)
if registration_validation(username, email) is True:
#Create a cursor
cur = mysql.connection.cursor()
#Execute register query
cur.execute("INSERT INTO users(name, uname, uemail, upass) VALUES(%s, %s, %s, %s)",(name, username, email, passw))
mysql.connection.commit()
cur.close()
flash('You are now registered and can login','success')
print("redirecting")
return redirect(url_for('login'))
else:
return render_template('register.html', error="Error email or username already used")
else:
return render_template('register.html', error=v)
return render_template('register.html')
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
username = request.form['username']
password_candidate = request.form['password']
if SQL_SYNTAX_CHECK(username) is True:
cur = mysql.connection.cursor()
result = cur.execute("SELECT * FROM users WHERE uname = %s", [username])
if result > 0:
data = cur.fetchone()
password = data['<PASSWORD>']
if sha256_crypt.verify(password_candidate, password):
session['logged_in'] = True
session['username'] = username
flash('You are now logged in','success')
return redirect(url_for('dashboard'))
return render_template('login.html', error="Invalid login")
return render_template('login.html')
@app.route('/logout')
#@is_logged_in
def logout():
session.clear()
flash('You are now logged out','success')
return redirect(url_for('login'))
@app.route('/dashboard')
@is_logged_in
def dashboard():
return render_template('dashboard.html', nav_page="dashboard")
#Quick function that will check the users db if the email or username is already taken
def random_url_check(shortened):
cur = mysql.connection.cursor()
results = cur.execute("SELECT * FROM urltable WHERE url_shortened = \"shortened\";")
cur.close()
if results >= 1:
return False
else:
return True
@app.route('/create_link', methods=['GET', 'POST'])
@is_logged_in
def create_link():
form = CreateUrlForm(request.form)
if request.method == "POST":
url_main = request.form.get('url_main')
if SQL_SYNTAX_CHECK(url_main) is True and len(url_main) >5:
if validate_link(url_main) is True:
r_check = 0
short =""
while (r_check < 1):
shortened = generate_link()
if random_url_check(shortened) is True:
short = shortened
r_check +=1
cur = mysql.connection.cursor()
query = create_short_url_query(url_main, short, session.get('username'))
cur.execute(query)
mysql.connection.commit()
cur.close()
return redirect(url_for('new_link', short_link=short))
else:
return render_template('create_link.html',form=form,nav_page="my_urls",error="Error link provided is invalid")
else:
return render_template('create_link.html', form=form, nav_page="my_urls", error="Error invalid or blank link")
return render_template('create_link.html',form=form, nav_page="my_urls")
#Page that displays a link to the shorted url
@app.route('/new_link/<string:short_link>', methods=['GET'])
def new_link(short_link):
return render_template('new_link.html', link=short_link)
#Page that handles incoming shortened links
@app.route('/l/<link>')
def l(link):
if SQL_SYNTAX_CHECK(link) is True:
cur = mysql.connection.cursor()
query = url_query(link)
results = cur.execute(query)
if results > 0:
data = cur.fetchone()
main_url = data['url_long']
return redirect(main_url)
return redirect(url_for('l_notfound'))
#Page displayed if a shortened link is not found
@app.route('/l_notfound')
def l_notfound():
return render_template('l_notfound.html')
@app.route('/view_links')
@is_logged_in
def view_links():
cur = mysql.connection.cursor()
username = session.get('username')
results = cur.execute(f"SELECT * FROM urltable WHERE url_user = \"{username}\";")
if results > 0:
tdata = []
for x in range(0,results):
data = cur.fetchone()
tdata.append(data)
x+=1
matrix = build_links_matrix(results, tdata)
return render_template('view_links.html',table="true", header_len=len(matrix[0]), rows_len=len(matrix[1]), row_len=len(matrix[1][0]),
rows=matrix[1],header=matrix[0], nav_page="my_urls")
return render_template('view_links.html', nav_page="my_urls")
@app.route('/manage_account')
@is_logged_in
def manage_account():
username = session.get('username')
query = create_manage_info_query(username)
cur = mysql.connection.cursor()
results = cur.execute(query)
if results > 0:
data = cur.fetchone()
email = data['uemail']
return render_template('manage_account.html', email=email)
else:
return redirect(url_for('index', error="Uknown error occured user not found"))
@app.route('/change_pass', methods=['GET','POST'])
@is_logged_in
def change_pass():
form = ChangePassword(request.form)
if request.method == 'POST':
old_password = (form.old_password.data)
passwrd = (form.new_password.data)
new_password = <PASSWORD>256_crypt.hash(str(passwrd))
confirm = (form.confirm.data)
print(f"Passwrd:{passwrd}\nConf:{confirm}")
if passwrd == confirm:
print("validated")
cur = mysql.connection.cursor()
results = cur.execute(f"SELECT * FROM users WHERE uname = \"{session.get('username')}\";")
if results > 0:
data = cur.fetchone()
cur.close()
passw = data['upass']
#If old pass equals the one inputed change pass to new pass
if sha256_crypt.verify(old_password, passw):
print("Success Match")
cur = mysql.connection.cursor()
cur.execute(f"UPDATE users SET upass = \"{new_password}\" WHERE uname = \"{session.get('username')}\"")
mysql.connection.commit()
cur.close()
flash('Succesfuly changed password','success')
return redirect(url_for('logout'))
else:
return render_template('change_pass.html', error='Invalid Password')
#If username is not found in database logout
else:
return redirect(url_for('logout'))
else:
render_template('change_pass.html', form=form, error="Error Passwords do not Match")
return render_template('change_pass.html', form=form)
if __name__ == '__main__':
app.secret_key = secret_key
app.run(debug=True) | [
1,
529,
276,
1112,
420,
29958,
1169,
29899,
29885,
29878,
29899,
8315,
388,
29914,
5983,
29899,
21322,
759,
29966,
9507,
29958,
4219,
7068,
8476,
29914,
932,
29889,
2272,
13,
3166,
29784,
1053,
2379,
1278,
29892,
4050,
29918,
6886,
29892,
11013,
29892,
6684,
29892,
3142,
29918,
1454,
29892,
4867,
29892,
12183,
29892,
2009,
13,
3166,
29784,
29918,
19268,
430,
29890,
1053,
9254,
13,
3166,
2090,
312,
8789,
1053,
11463,
567,
13,
3166,
1209,
1982,
29889,
8568,
1053,
528,
29874,
29906,
29945,
29953,
29918,
29883,
4641,
13,
3166,
1856,
9514,
1053,
334,
13,
3166,
4303,
1053,
334,
13,
3166,
2295,
1053,
334,
13,
3166,
1591,
29918,
5344,
1053,
334,
13,
3166,
9365,
1053,
334,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
20832,
2033,
353,
4833,
29918,
3069,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
11889,
2033,
353,
4833,
29918,
1792,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
25711,
17013,
2033,
353,
4833,
29918,
3364,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
4051,
2033,
353,
4833,
29918,
9803,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
22484,
29903,
1955,
13875,
1799,
2033,
353,
525,
21533,
19890,
29915,
13,
13,
7938,
353,
9254,
29898,
932,
29897,
13,
13,
29937,
2220,
363,
8454,
565,
278,
1404,
338,
13817,
297,
13,
1753,
338,
29918,
1188,
3192,
29918,
262,
29898,
29888,
1125,
13,
1678,
732,
29893,
336,
567,
29898,
29888,
29897,
13,
1678,
822,
12244,
10456,
5085,
29892,
3579,
19290,
1125,
13,
4706,
565,
525,
1188,
3192,
29918,
262,
29915,
297,
4867,
29901,
29871,
396,
361,
13817,
297,
736,
13817,
297,
4660,
13,
9651,
736,
285,
10456,
5085,
29892,
3579,
19290,
29897,
13,
13,
4706,
1683,
29901,
259,
396,
361,
451,
13817,
297,
322,
1811,
304,
2130,
263,
24499,
6684,
304,
6464,
13,
9651,
11013,
877,
29965,
1056,
329,
2015,
1891,
29892,
3529,
6464,
3788,
29881,
4600,
1495,
13,
9651,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
1678,
736,
12244,
13,
13,
29937,
27992,
390,
12015,
29923,
13,
29992,
932,
29889,
13134,
11219,
1495,
13,
1753,
2380,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
742,
6283,
29918,
3488,
543,
5184,
1159,
13,
13,
29937,
2182,
860,
740,
393,
674,
1423,
278,
4160,
4833,
565,
278,
4876,
470,
8952,
338,
2307,
4586,
13,
1753,
22583,
29918,
18157,
29898,
348,
420,
29892,
318,
5269,
1125,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
2582,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
4160,
5754,
443,
420,
353,
1273,
29879,
6323,
318,
5269,
353,
1273,
29879,
613,
313,
348,
420,
29892,
318,
5269,
876,
13,
1678,
3151,
29889,
5358,
580,
13,
1678,
565,
2582,
6736,
29871,
29896,
29901,
13,
4706,
736,
7700,
13,
1678,
1683,
29901,
13,
4706,
736,
5852,
13,
13,
29992,
932,
29889,
13134,
11219,
9573,
742,
3519,
29922,
1839,
7194,
3788,
5438,
11287,
13,
1753,
6036,
7295,
13,
29937,
689,
353,
12577,
2500,
29898,
3827,
29889,
689,
29897,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
1024,
353,
2009,
29889,
689,
1839,
978,
2033,
13,
4706,
8952,
353,
2009,
29889,
689,
1839,
6786,
2033,
13,
4706,
4876,
353,
2009,
29889,
689,
1839,
5269,
2033,
13,
4706,
4800,
353,
2009,
29889,
689,
1839,
5630,
2033,
13,
4706,
9659,
353,
2009,
29889,
689,
1839,
26897,
2033,
13,
4706,
1596,
29898,
5630,
29897,
13,
4706,
1596,
29898,
26897,
29897,
13,
4706,
325,
353,
12725,
4597,
8306,
29898,
978,
29892,
8952,
29892,
4876,
29892,
4800,
29892,
9659,
29897,
13,
13,
4706,
565,
325,
1275,
376,
14191,
1115,
13,
9651,
1209,
29893,
353,
529,
25711,
17013,
29958,
29906,
29945,
29953,
29918,
29883,
4641,
29889,
3977,
4641,
29898,
5630,
29897,
13,
9651,
565,
22583,
29918,
18157,
29898,
6786,
29892,
4876,
29897,
338,
5852,
29901,
13,
462,
1678,
396,
4391,
263,
10677,
13,
18884,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
462,
1678,
396,
12296,
6036,
2346,
13,
18884,
3151,
29889,
7978,
703,
19460,
11646,
4160,
29898,
978,
29892,
443,
420,
29892,
318,
5269,
29892,
701,
465,
29897,
15673,
29414,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
19123,
29898,
978,
29892,
8952,
29892,
4876,
29892,
1209,
29893,
876,
13,
13,
18884,
5749,
29889,
9965,
29889,
15060,
580,
13,
13,
18884,
3151,
29889,
5358,
580,
13,
13,
18884,
11013,
877,
3492,
526,
1286,
15443,
322,
508,
6464,
3788,
8698,
1495,
13,
18884,
1596,
703,
17886,
292,
1159,
13,
18884,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
13,
9651,
1683,
29901,
29871,
13,
18884,
736,
4050,
29918,
6886,
877,
9573,
29889,
1420,
742,
1059,
543,
2392,
4876,
470,
8952,
2307,
1304,
1159,
13,
13,
4706,
1683,
29901,
13,
9651,
736,
4050,
29918,
6886,
877,
9573,
29889,
1420,
742,
1059,
29922,
29894,
29897,
13,
1678,
736,
4050,
29918,
6886,
877,
9573,
29889,
1420,
1495,
13,
13,
29992,
932,
29889,
13134,
11219,
7507,
742,
3519,
29922,
1839,
7194,
742,
525,
5438,
11287,
13,
1753,
6464,
7295,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
8952,
353,
2009,
29889,
689,
1839,
6786,
2033,
13,
4706,
4800,
29918,
29883,
5380,
403,
353,
2009,
29889,
689,
1839,
5630,
2033,
13,
13,
4706,
565,
3758,
29918,
14816,
29940,
6040,
29990,
29918,
3210,
16658,
29898,
6786,
29897,
338,
5852,
29901,
13,
9651,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
13,
9651,
1121,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
4160,
5754,
443,
420,
353,
1273,
29879,
613,
518,
6786,
2314,
13,
13,
9651,
565,
1121,
1405,
29871,
29900,
29901,
13,
18884,
848,
353,
3151,
29889,
9155,
650,
580,
13,
18884,
4800,
353,
848,
1839,
29966,
25711,
17013,
29958,
2033,
13,
13,
18884,
565,
528,
29874,
29906,
29945,
29953,
29918,
29883,
4641,
29889,
27902,
29898,
5630,
29918,
29883,
5380,
403,
29892,
4800,
1125,
13,
462,
1678,
4867,
1839,
1188,
3192,
29918,
262,
2033,
353,
5852,
13,
462,
1678,
4867,
1839,
6786,
2033,
353,
8952,
13,
13,
462,
1678,
11013,
877,
3492,
526,
1286,
13817,
297,
3788,
8698,
1495,
13,
462,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
14592,
3377,
8785,
13,
13,
4706,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
742,
1059,
543,
13919,
6464,
1159,
13,
13,
1678,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
1495,
13,
13,
29992,
932,
29889,
13134,
11219,
1188,
449,
1495,
13,
29937,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
1480,
449,
7295,
13,
1678,
4867,
29889,
8551,
580,
13,
1678,
11013,
877,
3492,
526,
1286,
13817,
714,
3788,
8698,
1495,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
13,
29992,
932,
29889,
13134,
11219,
14592,
3377,
1495,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
12569,
3377,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
14592,
3377,
29889,
1420,
742,
6283,
29918,
3488,
543,
14592,
3377,
1159,
13,
13,
29937,
2182,
860,
740,
393,
674,
1423,
278,
4160,
4833,
565,
278,
4876,
470,
8952,
338,
2307,
4586,
13,
1753,
4036,
29918,
2271,
29918,
3198,
29898,
12759,
6419,
1125,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
2582,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
5065,
1896,
519,
5754,
3142,
29918,
12759,
6419,
353,
13218,
12759,
6419,
29905,
1769,
1159,
13,
1678,
3151,
29889,
5358,
580,
13,
1678,
565,
2582,
6736,
29871,
29896,
29901,
13,
4706,
736,
7700,
13,
1678,
1683,
29901,
13,
4706,
736,
5852,
13,
13,
29992,
932,
29889,
13134,
11219,
3258,
29918,
2324,
742,
3519,
29922,
1839,
7194,
742,
525,
5438,
11287,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
1653,
29918,
2324,
7295,
13,
1678,
883,
353,
6204,
5983,
2500,
29898,
3827,
29889,
689,
29897,
13,
1678,
565,
2009,
29889,
5696,
1275,
376,
5438,
1115,
13,
4706,
3142,
29918,
3396,
353,
2009,
29889,
689,
29889,
657,
877,
2271,
29918,
3396,
1495,
13,
4706,
565,
3758,
29918,
14816,
29940,
6040,
29990,
29918,
3210,
16658,
29898,
2271,
29918,
3396,
29897,
338,
5852,
322,
7431,
29898,
2271,
29918,
3396,
29897,
1405,
29945,
29901,
13,
13,
9651,
565,
12725,
29918,
2324,
29898,
2271,
29918,
3396,
29897,
338,
5852,
29901,
13,
18884,
364,
29918,
3198,
353,
29871,
29900,
13,
18884,
3273,
353,
15945,
13,
18884,
1550,
313,
29878,
29918,
3198,
529,
29871,
29896,
1125,
13,
462,
1678,
3273,
6419,
353,
5706,
29918,
2324,
580,
13,
462,
1678,
565,
4036,
29918,
2271,
29918,
3198,
29898,
12759,
6419,
29897,
338,
5852,
29901,
13,
462,
4706,
3273,
353,
3273,
6419,
13,
462,
4706,
364,
29918,
3198,
4619,
29896,
13,
13,
18884,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
18884,
2346,
353,
1653,
29918,
12759,
29918,
2271,
29918,
1972,
29898,
2271,
29918,
3396,
29892,
3273,
29892,
4867,
29889,
657,
877,
6786,
8785,
13,
18884,
3151,
29889,
7978,
29898,
1972,
29897,
13,
18884,
5749,
29889,
9965,
29889,
15060,
580,
13,
18884,
3151,
29889,
5358,
580,
13,
13,
18884,
736,
6684,
29898,
2271,
29918,
1454,
877,
1482,
29918,
2324,
742,
3273,
29918,
2324,
29922,
12759,
876,
1678,
13,
13,
9651,
1683,
29901,
13,
18884,
736,
4050,
29918,
6886,
877,
3258,
29918,
2324,
29889,
1420,
742,
689,
29922,
689,
29892,
6654,
29918,
3488,
543,
1357,
29918,
26045,
613,
2704,
543,
2392,
1544,
4944,
338,
8340,
1159,
632,
13,
4706,
1683,
29901,
13,
9651,
736,
4050,
29918,
6886,
877,
3258,
29918,
2324,
29889,
1420,
742,
883,
29922,
689,
29892,
6283,
29918,
3488,
543,
1357,
29918,
26045,
613,
1059,
543,
2392,
8340,
470,
9654,
1544,
1159,
13,
1678,
736,
4050,
29918,
6886,
877,
3258,
29918,
2324,
29889,
1420,
742,
689,
29922,
689,
29892,
6283,
29918,
3488,
543,
1357,
29918,
26045,
1159,
13,
13,
29937,
5074,
393,
14423,
263,
1544,
304,
278,
3273,
287,
3142,
13,
29992,
932,
29889,
13134,
11219,
1482,
29918,
2324,
29914,
29966,
1807,
29901,
12759,
29918,
2324,
29958,
742,
3519,
29922,
1839,
7194,
11287,
13,
1753,
716,
29918,
2324,
29898,
12759,
29918,
2324,
1125,
13,
13,
1678,
736,
4050,
29918,
6886,
877,
1482,
29918,
2324,
29889,
1420,
742,
1544,
29922,
12759,
29918,
2324,
29897,
13,
13,
29937,
5074,
393,
17766,
23235,
3273,
6419,
2988,
13,
29992,
932,
29889,
13134,
11219,
29880,
29914,
29966,
2324,
29958,
1495,
13,
1753,
301,
29898,
2324,
1125,
13,
1678,
565,
3758,
29918,
14816,
29940,
6040,
29990,
29918,
3210,
16658,
29898,
2324,
29897,
338,
5852,
29901,
13,
4706,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
4706,
2346,
353,
3142,
29918,
1972,
29898,
2324,
29897,
13,
4706,
2582,
353,
3151,
29889,
7978,
29898,
1972,
29897,
13,
308,
13,
4706,
565,
2582,
1405,
29871,
29900,
29901,
13,
9651,
848,
353,
3151,
29889,
9155,
650,
580,
13,
9651,
1667,
29918,
2271,
353,
848,
1839,
2271,
29918,
5426,
2033,
13,
9651,
736,
6684,
29898,
3396,
29918,
2271,
29897,
13,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
29880,
29918,
1333,
11940,
8785,
13,
13,
29937,
5074,
8833,
565,
263,
3273,
6419,
1544,
338,
451,
1476,
13,
29992,
932,
29889,
13134,
11219,
29880,
29918,
1333,
11940,
1495,
13,
1753,
301,
29918,
1333,
11940,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
29880,
29918,
1333,
11940,
29889,
1420,
1495,
13,
13,
29992,
932,
29889,
13134,
11219,
1493,
29918,
4965,
1495,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
1776,
29918,
4965,
7295,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
8952,
353,
4867,
29889,
657,
877,
6786,
1495,
13,
1678,
2582,
353,
3151,
29889,
7978,
29898,
29888,
29908,
6404,
334,
3895,
5065,
1896,
519,
5754,
3142,
29918,
1792,
353,
13218,
29912,
6786,
1012,
1769,
1159,
13,
1678,
565,
2582,
1405,
29871,
29900,
29901,
13,
4706,
260,
1272,
353,
5159,
13,
4706,
363,
921,
297,
3464,
29898,
29900,
29892,
9902,
1125,
13,
9651,
848,
353,
3151,
29889,
9155,
650,
580,
13,
9651,
260,
1272,
29889,
4397,
29898,
1272,
29897,
13,
9651,
921,
23661,
29896,
13,
308,
13,
4706,
4636,
353,
2048,
29918,
4965,
29918,
5344,
29898,
9902,
29892,
260,
1272,
29897,
13,
13,
4706,
736,
4050,
29918,
6886,
877,
1493,
29918,
4965,
29889,
1420,
742,
2371,
543,
3009,
613,
4839,
29918,
2435,
29922,
2435,
29898,
5344,
29961,
29900,
11724,
4206,
29918,
2435,
29922,
2435,
29898,
5344,
29961,
29896,
11724,
1948,
29918,
2435,
29922,
2435,
29898,
5344,
29961,
29896,
3816,
29900,
11724,
29871,
13,
4706,
4206,
29922,
5344,
29961,
29896,
1402,
6672,
29922,
5344,
29961,
29900,
1402,
6283,
29918,
3488,
543,
1357,
29918,
26045,
1159,
13,
13,
1678,
736,
4050,
29918,
6886,
877,
1493,
29918,
4965,
29889,
1420,
742,
6283,
29918,
3488,
543,
1357,
29918,
26045,
1159,
13,
13,
29992,
932,
29889,
13134,
11219,
1171,
482,
29918,
10149,
1495,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
10933,
29918,
10149,
7295,
13,
1678,
8952,
353,
4867,
29889,
657,
877,
6786,
1495,
13,
1678,
2346,
353,
1653,
29918,
1171,
482,
29918,
3888,
29918,
1972,
29898,
6786,
29897,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
2582,
353,
3151,
29889,
7978,
29898,
1972,
29897,
13,
1678,
565,
2582,
1405,
29871,
29900,
29901,
13,
4706,
848,
353,
3151,
29889,
9155,
650,
580,
13,
4706,
4876,
353,
848,
1839,
29884,
5269,
2033,
13,
4706,
736,
4050,
29918,
6886,
877,
1171,
482,
29918,
10149,
29889,
1420,
742,
4876,
29922,
5269,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
2248,
742,
1059,
543,
29965,
5203,
1059,
2179,
2955,
1404,
451,
1476,
5783,
13,
13,
29992,
932,
29889,
13134,
11219,
3167,
29918,
3364,
742,
3519,
29922,
1839,
7194,
3788,
5438,
11287,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
1735,
29918,
3364,
7295,
13,
1678,
883,
353,
10726,
10048,
29898,
3827,
29889,
689,
29897,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
308,
13,
4706,
2030,
29918,
5630,
353,
313,
689,
29889,
1025,
29918,
5630,
29889,
1272,
29897,
13,
308,
13,
4706,
1209,
29893,
5499,
353,
313,
689,
29889,
1482,
29918,
5630,
29889,
1272,
29897,
13,
4706,
716,
29918,
5630,
353,
529,
25711,
17013,
29958,
29906,
29945,
29953,
29918,
29883,
4641,
29889,
8568,
29898,
710,
29898,
3364,
29893,
5499,
876,
13,
4706,
9659,
353,
313,
689,
29889,
26897,
29889,
1272,
29897,
13,
13,
4706,
1596,
29898,
29888,
29908,
7129,
29893,
5499,
26254,
3364,
29893,
5499,
1012,
29876,
16376,
26254,
26897,
27195,
13,
4706,
565,
1209,
29893,
5499,
1275,
9659,
29901,
13,
9651,
1596,
703,
3084,
630,
1159,
13,
9651,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
9651,
2582,
353,
3151,
29889,
7978,
29898,
29888,
29908,
6404,
334,
3895,
4160,
5754,
443,
420,
353,
13218,
29912,
7924,
29889,
657,
877,
6786,
1495,
1012,
1769,
1159,
13,
632,
13,
9651,
565,
2582,
1405,
29871,
29900,
29901,
13,
18884,
848,
353,
3151,
29889,
9155,
650,
580,
13,
18884,
3151,
29889,
5358,
580,
13,
18884,
1209,
29893,
353,
848,
1839,
786,
465,
2033,
13,
18884,
396,
3644,
2030,
1209,
15743,
278,
697,
1881,
287,
1735,
1209,
304,
716,
1209,
13,
18884,
565,
528,
29874,
29906,
29945,
29953,
29918,
29883,
4641,
29889,
27902,
29898,
1025,
29918,
5630,
29892,
1209,
29893,
1125,
13,
462,
1678,
1596,
703,
14191,
14514,
1159,
13,
462,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
462,
1678,
3151,
29889,
7978,
29898,
29888,
29908,
14474,
4160,
11368,
701,
465,
353,
13218,
29912,
1482,
29918,
5630,
1012,
29908,
5754,
443,
420,
353,
13218,
29912,
7924,
29889,
657,
877,
6786,
1495,
1012,
29908,
1159,
13,
462,
1678,
5749,
29889,
9965,
29889,
15060,
580,
13,
13,
462,
1678,
3151,
29889,
5358,
580,
13,
462,
1678,
11013,
877,
5091,
617,
267,
1319,
29891,
3939,
4800,
3788,
8698,
1495,
13,
462,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
1188,
449,
8785,
13,
18884,
1683,
29901,
13,
462,
1678,
736,
4050,
29918,
6886,
877,
3167,
29918,
3364,
29889,
1420,
742,
1059,
2433,
13919,
25280,
1495,
13,
9651,
396,
3644,
8952,
338,
451,
1476,
297,
2566,
1480,
449,
13,
9651,
1683,
29901,
13,
18884,
736,
6684,
29898,
2271,
29918,
1454,
877,
1188,
449,
8785,
13,
4706,
1683,
29901,
13,
9651,
4050,
29918,
6886,
877,
3167,
29918,
3364,
29889,
1420,
742,
883,
29922,
689,
29892,
1059,
543,
2392,
6978,
9303,
437,
451,
14514,
1159,
13,
13,
632,
13,
1678,
736,
4050,
29918,
6886,
877,
3167,
29918,
3364,
29889,
1420,
742,
883,
29922,
689,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
623,
29889,
19024,
29918,
1989,
353,
7035,
29918,
1989,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29897,
2
] |
MIDI Remote Scripts/Push2/mode_collector.py | aarkwright/ableton_devices | 0 | 105 | # uncompyle6 version 3.3.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
# Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\Push2\mode_collector.py
# Compiled at: 2018-11-30 15:48:11
from __future__ import absolute_import, print_function, unicode_literals
from ableton.v2.base import listenable_property, listens, EventObject
class ModeCollector(EventObject):
def __init__(self, main_modes=None, mix_modes=None, global_mix_modes=None, device_modes=None, *a, **k):
super(ModeCollector, self).__init__(*a, **k)
self._main_modes = main_modes
self._mix_modes = mix_modes
self._global_mix_modes = global_mix_modes
self._device_modes = device_modes
self._on_selected_main_mode_changed.subject = main_modes
self._on_selected_mix_mode_changed.subject = mix_modes
self._on_selected_global_mix_mode_changed.subject = global_mix_modes
self._on_selected_device_mode_changed.subject = device_modes
@listenable_property
def main_mode(self):
return self._main_modes.selected_mode
@listens(b'selected_mode')
def _on_selected_main_mode_changed(self, mode):
self.notify_main_mode()
@listenable_property
def mix_mode(self):
return self._mix_modes.selected_mode
@listens(b'selected_mode')
def _on_selected_mix_mode_changed(self, mode):
self.notify_mix_mode()
@listenable_property
def global_mix_mode(self):
return self._global_mix_modes.selected_mode
@listens(b'selected_mode')
def _on_selected_global_mix_mode_changed(self, mode):
self.notify_global_mix_mode()
@listenable_property
def device_mode(self):
return self._device_modes.selected_mode
@listens(b'selected_mode')
def _on_selected_device_mode_changed(self, mode):
self.notify_device_mode() | [
1,
396,
443,
2388,
1508,
29953,
1873,
29871,
29941,
29889,
29941,
29889,
29945,
13,
29937,
5132,
7023,
401,
29871,
29906,
29889,
29955,
313,
29953,
29906,
29906,
29896,
29896,
29897,
13,
29937,
897,
2388,
2356,
515,
29901,
5132,
29871,
29941,
29889,
29955,
29889,
29941,
313,
4381,
29892,
319,
558,
29871,
29906,
29946,
29871,
29906,
29900,
29896,
29929,
29892,
29871,
29896,
29945,
29901,
29906,
29929,
29901,
29945,
29896,
29897,
518,
4345,
29907,
325,
29889,
29896,
29929,
29896,
29945,
29871,
29953,
29946,
2586,
313,
5194,
29928,
29953,
29946,
4638,
13,
29937,
2812,
2580,
7176,
934,
1024,
29901,
274,
3583,
29967,
16468,
29905,
9258,
29905,
4905,
29905,
5080,
29918,
29953,
29946,
29918,
7959,
29905,
19729,
29905,
4691,
29899,
16718,
29905,
29924,
1367,
29902,
5240,
866,
14415,
29879,
29905,
27031,
29906,
29905,
8513,
29918,
15914,
272,
29889,
2272,
13,
29937,
3831,
2356,
472,
29901,
29871,
29906,
29900,
29896,
29947,
29899,
29896,
29896,
29899,
29941,
29900,
29871,
29896,
29945,
29901,
29946,
29947,
29901,
29896,
29896,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
1596,
29918,
2220,
29892,
29104,
29918,
20889,
1338,
13,
3166,
2221,
880,
29889,
29894,
29906,
29889,
3188,
1053,
11621,
519,
29918,
6799,
29892,
1051,
575,
29892,
6864,
2061,
13,
13,
1990,
21864,
28916,
272,
29898,
2624,
2061,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1667,
29918,
1545,
267,
29922,
8516,
29892,
6837,
29918,
1545,
267,
29922,
8516,
29892,
5534,
29918,
28084,
29918,
1545,
267,
29922,
8516,
29892,
4742,
29918,
1545,
267,
29922,
8516,
29892,
334,
29874,
29892,
3579,
29895,
1125,
13,
4706,
2428,
29898,
6818,
28916,
272,
29892,
1583,
467,
1649,
2344,
1649,
10456,
29874,
29892,
3579,
29895,
29897,
13,
4706,
1583,
3032,
3396,
29918,
1545,
267,
353,
1667,
29918,
1545,
267,
13,
4706,
1583,
3032,
28084,
29918,
1545,
267,
353,
6837,
29918,
1545,
267,
13,
4706,
1583,
3032,
10945,
29918,
28084,
29918,
1545,
267,
353,
5534,
29918,
28084,
29918,
1545,
267,
13,
4706,
1583,
3032,
10141,
29918,
1545,
267,
353,
4742,
29918,
1545,
267,
13,
4706,
1583,
3032,
265,
29918,
8391,
29918,
3396,
29918,
8513,
29918,
15033,
29889,
16009,
353,
1667,
29918,
1545,
267,
13,
4706,
1583,
3032,
265,
29918,
8391,
29918,
28084,
29918,
8513,
29918,
15033,
29889,
16009,
353,
6837,
29918,
1545,
267,
13,
4706,
1583,
3032,
265,
29918,
8391,
29918,
10945,
29918,
28084,
29918,
8513,
29918,
15033,
29889,
16009,
353,
5534,
29918,
28084,
29918,
1545,
267,
13,
4706,
1583,
3032,
265,
29918,
8391,
29918,
10141,
29918,
8513,
29918,
15033,
29889,
16009,
353,
4742,
29918,
1545,
267,
13,
13,
1678,
732,
1761,
12007,
29918,
6799,
13,
1678,
822,
1667,
29918,
8513,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
3396,
29918,
1545,
267,
29889,
8391,
29918,
8513,
13,
13,
1678,
732,
1761,
575,
29898,
29890,
29915,
8391,
29918,
8513,
1495,
13,
1678,
822,
903,
265,
29918,
8391,
29918,
3396,
29918,
8513,
29918,
15033,
29898,
1311,
29892,
4464,
1125,
13,
4706,
1583,
29889,
25140,
29918,
3396,
29918,
8513,
580,
13,
13,
1678,
732,
1761,
12007,
29918,
6799,
13,
1678,
822,
6837,
29918,
8513,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
28084,
29918,
1545,
267,
29889,
8391,
29918,
8513,
13,
13,
1678,
732,
1761,
575,
29898,
29890,
29915,
8391,
29918,
8513,
1495,
13,
1678,
822,
903,
265,
29918,
8391,
29918,
28084,
29918,
8513,
29918,
15033,
29898,
1311,
29892,
4464,
1125,
13,
4706,
1583,
29889,
25140,
29918,
28084,
29918,
8513,
580,
13,
13,
1678,
732,
1761,
12007,
29918,
6799,
13,
1678,
822,
5534,
29918,
28084,
29918,
8513,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
10945,
29918,
28084,
29918,
1545,
267,
29889,
8391,
29918,
8513,
13,
13,
1678,
732,
1761,
575,
29898,
29890,
29915,
8391,
29918,
8513,
1495,
13,
1678,
822,
903,
265,
29918,
8391,
29918,
10945,
29918,
28084,
29918,
8513,
29918,
15033,
29898,
1311,
29892,
4464,
1125,
13,
4706,
1583,
29889,
25140,
29918,
10945,
29918,
28084,
29918,
8513,
580,
13,
13,
1678,
732,
1761,
12007,
29918,
6799,
13,
1678,
822,
4742,
29918,
8513,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
10141,
29918,
1545,
267,
29889,
8391,
29918,
8513,
13,
13,
1678,
732,
1761,
575,
29898,
29890,
29915,
8391,
29918,
8513,
1495,
13,
1678,
822,
903,
265,
29918,
8391,
29918,
10141,
29918,
8513,
29918,
15033,
29898,
1311,
29892,
4464,
1125,
13,
4706,
1583,
29889,
25140,
29918,
10141,
29918,
8513,
580,
2
] |
Comportamentais/Strategy/main.py | DionVitor/design_pattern | 0 | 179792 | """Baseado no livro Python Fluente, <NAME>."""
from abc import ABC, abstractmethod
from collections import namedtuple
Customer = namedtuple('Customer', 'name fidelity')
a = namedtuple('int', 'name')
class LineItem:
def __init__(self, product, quantity, price):
self.__product = product
self.__quantity = quantity
self.__price = price
@property
def product(self):
return self.__product
@property
def quantity(self):
return self.__quantity
@property
def price(self):
return self.__price
def total(self):
return self.price * self.quantity
class Order:
def __init__(self, customer, cart, promotion=None):
self.__customer = customer
self.__cart = cart
self.__promotion = promotion
@property
def customer(self):
return self.__customer
@property
def cart(self):
return self.__cart
@property
def promotion(self):
return self.__promotion
def total(self):
if not hasattr(self, '__total'):
self.__total = sum(item.total() for item in self.cart)
return self.__total
def due(self):
if self.__promotion is None:
discount = 0
else:
discount = self.__promotion.discount(self)
return self.total() - discount
def __repr__(self):
return f'<Order by {self.customer.name}. Total: {self.total():.2f}, due: {self.due():.2f}>'
class Promotion(ABC): # Strategy: uma classe-base abstrata
@abstractmethod
def discount(self, order):
"""Devolver o desconto como um valor positivo em dólares"""
class FidelityPromo(Promotion): # Primeira estratégia concreta
"""5% de desconto para clientes com mil ou mais pontos no programa de fidelidade."""
def discount(self, order):
return order.total() * .05 if order.customer.fidelity >= 1000 else 0
class BulkItemPromo(Promotion): # Segunda estratégia concreta
"""10% de desconto para cada LineItem com 20 ou mais unidades"""
def discount(self, order):
discount = 0
for item in order.cart:
if item.quantity >= 20:
discount += item.total() * .1
return discount
class LargeOrderPromo(Promotion): # Terceira estratégia concreta
""""7% de desconto para pedidos com 10 ou mais itens diferentes"""
def discount(self, order):
distinct_items = {item.product for item in order.cart}
if len(distinct_items) >= 10:
return order.total() * .07
return 0
dion = Customer('<NAME>', 0)
fernanda = Customer('Fernanda', 1100)
cart = [LineItem('banana', 4, 0.5), LineItem('apple', 10, 1.5), LineItem('watermelon', 5, 5.0)]
print(Order(dion, cart, FidelityPromo()))
print(Order(fernanda, cart, FidelityPromo()))
banana_cart = [LineItem('banana', 30, 0.5), LineItem('apple', 10, 1.5)]
print(Order(dion, banana_cart, BulkItemPromo()))
print(Order(fernanda, banana_cart, BulkItemPromo()))
long_order = [LineItem(str(item_code), 1, 1.0) for item_code in range(10)]
print(Order(dion, long_order, LargeOrderPromo()))
print(Order(dion, cart, LargeOrderPromo()))
| [
1,
9995,
5160,
912,
694,
7294,
307,
5132,
2379,
29884,
2016,
29892,
529,
5813,
29958,
1213,
15945,
13,
3166,
25638,
1053,
16417,
29892,
9846,
5696,
13,
3166,
16250,
1053,
4257,
23583,
13,
13,
15122,
353,
4257,
23583,
877,
15122,
742,
525,
978,
285,
10652,
537,
1495,
13,
29874,
353,
4257,
23583,
877,
524,
742,
525,
978,
1495,
13,
13,
13,
1990,
7407,
2001,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3234,
29892,
14728,
29892,
8666,
1125,
13,
4706,
1583,
17255,
4704,
353,
3234,
13,
4706,
1583,
17255,
22640,
353,
14728,
13,
4706,
1583,
17255,
9175,
353,
8666,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3234,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
4704,
13,
13,
1678,
732,
6799,
13,
1678,
822,
14728,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
22640,
13,
13,
1678,
732,
6799,
13,
1678,
822,
8666,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
9175,
13,
13,
1678,
822,
3001,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
9175,
334,
1583,
29889,
22640,
13,
13,
13,
1990,
8170,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11962,
29892,
7774,
29892,
22360,
29922,
8516,
1125,
13,
4706,
1583,
17255,
15539,
353,
11962,
13,
4706,
1583,
17255,
13823,
353,
7774,
13,
4706,
1583,
17255,
14032,
8194,
353,
22360,
13,
13,
1678,
732,
6799,
13,
1678,
822,
11962,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
15539,
13,
13,
1678,
732,
6799,
13,
1678,
822,
7774,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
13823,
13,
13,
1678,
732,
6799,
13,
1678,
822,
22360,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
14032,
8194,
13,
13,
1678,
822,
3001,
29898,
1311,
1125,
13,
4706,
565,
451,
756,
5552,
29898,
1311,
29892,
525,
1649,
7827,
29374,
13,
9651,
1583,
17255,
7827,
353,
2533,
29898,
667,
29889,
7827,
580,
363,
2944,
297,
1583,
29889,
13823,
29897,
13,
4706,
736,
1583,
17255,
7827,
13,
13,
1678,
822,
2861,
29898,
1311,
1125,
13,
4706,
565,
1583,
17255,
14032,
8194,
338,
6213,
29901,
13,
9651,
2313,
792,
353,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
2313,
792,
353,
1583,
17255,
14032,
8194,
29889,
2218,
2798,
29898,
1311,
29897,
13,
4706,
736,
1583,
29889,
7827,
580,
448,
2313,
792,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
285,
29915,
29966,
7514,
491,
426,
1311,
29889,
15539,
29889,
978,
1836,
14990,
29901,
426,
1311,
29889,
7827,
7295,
29889,
29906,
29888,
1118,
2861,
29901,
426,
1311,
29889,
29123,
7295,
29889,
29906,
29888,
29913,
16299,
13,
13,
13,
1990,
9705,
8194,
29898,
19658,
1125,
29871,
396,
3767,
8963,
29901,
3672,
17792,
29899,
3188,
633,
710,
532,
13,
13,
1678,
732,
16595,
5696,
13,
1678,
822,
2313,
792,
29898,
1311,
29892,
1797,
1125,
13,
4706,
9995,
2772,
1555,
369,
288,
553,
535,
517,
1986,
1922,
16497,
13686,
4243,
953,
270,
29980,
4675,
267,
15945,
29908,
13,
13,
13,
1990,
383,
10652,
537,
18571,
29877,
29898,
18571,
8194,
1125,
29871,
396,
15512,
3055,
707,
3605,
2445,
423,
378,
1037,
941,
13,
1678,
9995,
29945,
29995,
316,
553,
535,
517,
1702,
3132,
267,
419,
2316,
2123,
3503,
13185,
359,
694,
16914,
316,
285,
10652,
5558,
1213,
15945,
13,
13,
1678,
822,
2313,
792,
29898,
1311,
29892,
1797,
1125,
13,
4706,
736,
1797,
29889,
7827,
580,
334,
869,
29900,
29945,
565,
1797,
29889,
15539,
29889,
29888,
10652,
537,
6736,
29871,
29896,
29900,
29900,
29900,
1683,
29871,
29900,
13,
13,
13,
1990,
8313,
29895,
2001,
18571,
29877,
29898,
18571,
8194,
1125,
29871,
396,
24153,
707,
3605,
2445,
423,
378,
1037,
941,
13,
1678,
9995,
29896,
29900,
29995,
316,
553,
535,
517,
1702,
9747,
7407,
2001,
419,
29871,
29906,
29900,
2123,
3503,
443,
7305,
15945,
29908,
13,
13,
1678,
822,
2313,
792,
29898,
1311,
29892,
1797,
1125,
13,
4706,
2313,
792,
353,
29871,
29900,
13,
4706,
363,
2944,
297,
1797,
29889,
13823,
29901,
13,
9651,
565,
2944,
29889,
22640,
6736,
29871,
29906,
29900,
29901,
13,
18884,
2313,
792,
4619,
2944,
29889,
7827,
580,
334,
869,
29896,
13,
4706,
736,
2313,
792,
13,
13,
13,
1990,
8218,
479,
7514,
18571,
29877,
29898,
18571,
8194,
1125,
29871,
396,
5061,
346,
3055,
707,
3605,
2445,
423,
378,
1037,
941,
13,
1678,
9995,
29908,
29955,
29995,
316,
553,
535,
517,
1702,
8939,
4396,
419,
29871,
29896,
29900,
2123,
3503,
372,
575,
20506,
15945,
29908,
13,
13,
1678,
822,
2313,
792,
29898,
1311,
29892,
1797,
1125,
13,
4706,
8359,
29918,
7076,
353,
426,
667,
29889,
4704,
363,
2944,
297,
1797,
29889,
13823,
29913,
13,
13,
4706,
565,
7431,
29898,
5721,
5562,
29918,
7076,
29897,
6736,
29871,
29896,
29900,
29901,
13,
9651,
736,
1797,
29889,
7827,
580,
334,
869,
29900,
29955,
13,
13,
4706,
736,
29871,
29900,
13,
13,
13,
29881,
291,
353,
21886,
877,
29966,
5813,
29958,
742,
29871,
29900,
29897,
13,
24023,
5863,
353,
21886,
877,
20899,
5863,
742,
29871,
29896,
29896,
29900,
29900,
29897,
13,
13,
13823,
353,
518,
3542,
2001,
877,
2571,
1648,
742,
29871,
29946,
29892,
29871,
29900,
29889,
29945,
511,
7407,
2001,
877,
11548,
742,
29871,
29896,
29900,
29892,
29871,
29896,
29889,
29945,
511,
7407,
2001,
877,
29893,
271,
837,
295,
265,
742,
29871,
29945,
29892,
29871,
29945,
29889,
29900,
4638,
13,
13,
2158,
29898,
7514,
29898,
29881,
291,
29892,
7774,
29892,
383,
10652,
537,
18571,
29877,
22130,
13,
2158,
29898,
7514,
29898,
24023,
5863,
29892,
7774,
29892,
383,
10652,
537,
18571,
29877,
22130,
13,
13,
2571,
1648,
29918,
13823,
353,
518,
3542,
2001,
877,
2571,
1648,
742,
29871,
29941,
29900,
29892,
29871,
29900,
29889,
29945,
511,
7407,
2001,
877,
11548,
742,
29871,
29896,
29900,
29892,
29871,
29896,
29889,
29945,
4638,
13,
13,
2158,
29898,
7514,
29898,
29881,
291,
29892,
9892,
1648,
29918,
13823,
29892,
8313,
29895,
2001,
18571,
29877,
22130,
13,
2158,
29898,
7514,
29898,
24023,
5863,
29892,
9892,
1648,
29918,
13823,
29892,
8313,
29895,
2001,
18571,
29877,
22130,
13,
13,
5426,
29918,
2098,
353,
518,
3542,
2001,
29898,
710,
29898,
667,
29918,
401,
511,
29871,
29896,
29892,
29871,
29896,
29889,
29900,
29897,
363,
2944,
29918,
401,
297,
3464,
29898,
29896,
29900,
4638,
13,
13,
2158,
29898,
7514,
29898,
29881,
291,
29892,
1472,
29918,
2098,
29892,
8218,
479,
7514,
18571,
29877,
22130,
13,
2158,
29898,
7514,
29898,
29881,
291,
29892,
7774,
29892,
8218,
479,
7514,
18571,
29877,
22130,
13,
2
] |
src/dataset.py | kjahan/evaluation | 0 | 150414 | <reponame>kjahan/evaluation
import os
from datetime import datetime
import pandas as pd
import tqdm
def load(filename, path, delim='\t'):
filename = os.path.join(path, filename)
dataframe = pd.read_csv(filename, sep=delim)
return dataframe
def parse_time(df):
date_parse = lambda x: pd.datetime.strptime(x, '%Y-%m-%d %H:%M:%S.%f')
df['datetime'] = df['datetime'].apply(date_parse)
return df
def parse_timestamp(df):
ts_parse = lambda x: datetime.utcfromtimestamp(int(x))
df['datetime'] = df['timestamp'].apply(ts_parse)
df = df.drop('timestamp', 1)
return df
def split(dataframe, split_time):
"""
dataframe: pandas dataframe with
"""
train_df = dataframe.loc[dataframe['datetime'] <= split_time]
test_df = dataframe.loc[dataframe['datetime'] > split_time]
return train_df, test_df
def generate_true_labels(test_df):
"""
test_df: a Pandas dataframe with two columns user_id and item_id
return: a dictionary from user_id to items that they have seen
"""
user_labels = {}
with tqdm.tqdm(total=test_df.shape[0]) as progress:
for index, row in test_df.iterrows():
user_id, item_id = row['user_id'], row['item_id']
try:
item_id = int(item_id)
user_labels[user_id].append(item_id)
except KeyError:
user_labels[user_id] = [item_id]
progress.update(1)
print("No of users in test fold: {}".format(len(user_labels.keys())))
return user_labels
| [
1,
529,
276,
1112,
420,
29958,
29895,
29926,
801,
273,
29914,
24219,
362,
13,
5215,
2897,
13,
3166,
12865,
1053,
12865,
13,
13,
5215,
11701,
408,
10518,
13,
5215,
260,
29939,
18933,
13,
13,
13,
1753,
2254,
29898,
9507,
29892,
2224,
29892,
628,
326,
2433,
29905,
29873,
29374,
13,
1678,
10422,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
10422,
29897,
13,
1678,
12205,
353,
10518,
29889,
949,
29918,
7638,
29898,
9507,
29892,
16345,
29922,
6144,
326,
29897,
13,
1678,
736,
12205,
13,
13,
13,
1753,
6088,
29918,
2230,
29898,
2176,
1125,
13,
1678,
2635,
29918,
5510,
353,
14013,
921,
29901,
10518,
29889,
12673,
29889,
710,
415,
603,
29898,
29916,
29892,
14210,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
29889,
29995,
29888,
1495,
13,
1678,
4489,
1839,
12673,
2033,
353,
4489,
1839,
12673,
13359,
7302,
29898,
1256,
29918,
5510,
29897,
13,
1678,
736,
4489,
13,
13,
13,
1753,
6088,
29918,
16394,
29898,
2176,
1125,
13,
1678,
18696,
29918,
5510,
353,
14013,
921,
29901,
12865,
29889,
329,
29883,
3166,
16394,
29898,
524,
29898,
29916,
876,
13,
1678,
4489,
1839,
12673,
2033,
353,
4489,
1839,
16394,
13359,
7302,
29898,
1372,
29918,
5510,
29897,
13,
1678,
4489,
353,
4489,
29889,
8865,
877,
16394,
742,
29871,
29896,
29897,
13,
1678,
736,
4489,
13,
13,
13,
1753,
6219,
29898,
1272,
2557,
29892,
6219,
29918,
2230,
1125,
13,
1678,
9995,
13,
1678,
12205,
29901,
11701,
12205,
411,
29871,
13,
1678,
9995,
13,
1678,
7945,
29918,
2176,
353,
12205,
29889,
2029,
29961,
1272,
2557,
1839,
12673,
2033,
5277,
6219,
29918,
2230,
29962,
13,
1678,
1243,
29918,
2176,
353,
12205,
29889,
2029,
29961,
1272,
2557,
1839,
12673,
2033,
1405,
6219,
29918,
2230,
29962,
13,
1678,
736,
7945,
29918,
2176,
29892,
1243,
29918,
2176,
13,
13,
13,
1753,
5706,
29918,
3009,
29918,
21134,
29898,
1688,
29918,
2176,
1125,
13,
1678,
9995,
13,
1678,
1243,
29918,
2176,
29901,
263,
349,
7086,
12205,
411,
1023,
4341,
1404,
29918,
333,
322,
2944,
29918,
333,
13,
1678,
736,
29901,
263,
8600,
515,
1404,
29918,
333,
304,
4452,
393,
896,
505,
3595,
13,
1678,
9995,
13,
1678,
1404,
29918,
21134,
353,
6571,
13,
1678,
411,
260,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
7827,
29922,
1688,
29918,
2176,
29889,
12181,
29961,
29900,
2314,
408,
6728,
29901,
13,
4706,
363,
2380,
29892,
1948,
297,
1243,
29918,
2176,
29889,
1524,
5727,
7295,
13,
9651,
1404,
29918,
333,
29892,
2944,
29918,
333,
353,
1948,
1839,
1792,
29918,
333,
7464,
1948,
1839,
667,
29918,
333,
2033,
13,
9651,
1018,
29901,
13,
18884,
2944,
29918,
333,
353,
938,
29898,
667,
29918,
333,
29897,
13,
18884,
1404,
29918,
21134,
29961,
1792,
29918,
333,
1822,
4397,
29898,
667,
29918,
333,
29897,
13,
9651,
5174,
7670,
2392,
29901,
13,
18884,
1404,
29918,
21134,
29961,
1792,
29918,
333,
29962,
353,
518,
667,
29918,
333,
29962,
13,
9651,
6728,
29889,
5504,
29898,
29896,
29897,
13,
4706,
1596,
703,
3782,
310,
4160,
297,
1243,
900,
29881,
29901,
6571,
1642,
4830,
29898,
2435,
29898,
1792,
29918,
21134,
29889,
8149,
580,
4961,
13,
1678,
736,
1404,
29918,
21134,
13,
2
] |
tests/cryolo_relion_it/test_mask_soft_edge_external_job.py | DiamondLightSource/python-relion | 5 | 80596 | import json
import os
import sys
from unittest import mock
import gemmi
from relion.cryolo_relion_it import mask_soft_edge_external_job
@mock.patch("relion.cryolo_relion_it.mask_soft_edge_external_job.subprocess")
def test_mask_soft_edge_main(mock_subprocess, tmpdir):
# Prepare things
os.chdir(tmpdir)
config_file = tmpdir.join("example_config.json")
with open(config_file, "w") as f:
json.dump({"model": {}}, f)
mic_job_dir = tmpdir.mkdir("CtfFind").mkdir("job001")
mic_dir = mic_job_dir.mkdir("Micrographs")
mic_file = mic_dir.join("micrograph_1.mrc")
mic_file.write("")
mic_star_file = mic_job_dir.join("example_mics.star")
mics_doc = gemmi.cif.Document()
block = mics_doc.add_new_block("micrographs")
loop = block.init_loop("_rln", ["MicrographName"])
loop.add_row([str(mic_file)])
mics_doc.write_file(str(mic_star_file))
ini_job_dir = tmpdir.mkdir("InitialModel").mkdir("job002")
ini_star_file = ini_job_dir.join("run_it300_data.star")
ini_doc = gemmi.cif.Document()
ini_block = ini_doc.add_new_block("data")
ini_loop = ini_block.init_loop("_rln", ["ClassNumber"])
ini_loop.add_row(["1"])
ini_loop_02 = ini_block.init_loop("_rln", ["MicrographName"])
ini_loop_02.add_row([str(mic_file)])
ini_doc.write_file(str(ini_star_file))
box_size = 96
angpix = 1
outer_radius = 32
job_dir = "External/job003"
tmpdir.mkdir("External").mkdir("job003")
# Run the job
orig_sys_argv = sys.argv[:]
sys.argv[1:] = [
"--out_dir",
job_dir,
"--box_size",
f"{box_size}",
"--angpix",
f"{angpix}",
"--outer_radius",
f"{outer_radius}",
]
mask_soft_edge_external_job.main()
call1 = mock.call(
[
"relion_mask_create",
"--denovo",
"true",
"--box_size",
f"{box_size}",
"--angpix",
f"{angpix}",
"--outer_radius",
f"{outer_radius}",
"--width_soft_edge",
"5",
],
check=True,
)
mock_subprocess.run.assert_has_calls([call1])
assert os.path.isfile(tmpdir / "External" / "job003" / "RELION_JOB_EXIT_SUCCESS")
# Restore state
sys.argv = orig_sys_argv
| [
1,
1053,
4390,
13,
5215,
2897,
13,
5215,
10876,
13,
3166,
443,
27958,
1053,
11187,
13,
13,
5215,
7055,
2460,
13,
13,
3166,
1104,
291,
29889,
29883,
719,
3543,
29918,
2674,
291,
29918,
277,
1053,
11105,
29918,
2695,
29918,
12864,
29918,
23176,
29918,
9057,
13,
13,
13,
29992,
17640,
29889,
5041,
703,
2674,
291,
29889,
29883,
719,
3543,
29918,
2674,
291,
29918,
277,
29889,
13168,
29918,
2695,
29918,
12864,
29918,
23176,
29918,
9057,
29889,
1491,
5014,
1159,
13,
1753,
1243,
29918,
13168,
29918,
2695,
29918,
12864,
29918,
3396,
29898,
17640,
29918,
1491,
5014,
29892,
13128,
3972,
1125,
13,
1678,
396,
349,
3445,
598,
2712,
13,
1678,
2897,
29889,
305,
3972,
29898,
7050,
3972,
29897,
13,
1678,
2295,
29918,
1445,
353,
13128,
3972,
29889,
7122,
703,
4773,
29918,
2917,
29889,
3126,
1159,
13,
1678,
411,
1722,
29898,
2917,
29918,
1445,
29892,
376,
29893,
1159,
408,
285,
29901,
13,
4706,
4390,
29889,
15070,
3319,
29908,
4299,
1115,
426,
11656,
285,
29897,
13,
13,
1678,
20710,
29918,
9057,
29918,
3972,
353,
13128,
3972,
29889,
11256,
3972,
703,
29907,
13264,
12542,
2564,
11256,
3972,
703,
9057,
29900,
29900,
29896,
1159,
13,
1678,
20710,
29918,
3972,
353,
20710,
29918,
9057,
29918,
3972,
29889,
11256,
3972,
703,
29924,
2357,
4262,
29879,
1159,
13,
1678,
20710,
29918,
1445,
353,
20710,
29918,
3972,
29889,
7122,
703,
29885,
2357,
4262,
29918,
29896,
29889,
29885,
2214,
1159,
13,
1678,
20710,
29918,
1445,
29889,
3539,
703,
1159,
13,
13,
1678,
20710,
29918,
8508,
29918,
1445,
353,
20710,
29918,
9057,
29918,
3972,
29889,
7122,
703,
4773,
29918,
29885,
1199,
29889,
8508,
1159,
13,
1678,
286,
1199,
29918,
1514,
353,
7055,
2460,
29889,
29883,
361,
29889,
6268,
580,
13,
1678,
2908,
353,
286,
1199,
29918,
1514,
29889,
1202,
29918,
1482,
29918,
1271,
703,
29885,
2357,
4262,
29879,
1159,
13,
1678,
2425,
353,
2908,
29889,
2344,
29918,
7888,
703,
29918,
2096,
29876,
613,
6796,
29924,
2357,
4262,
1170,
20068,
13,
1678,
2425,
29889,
1202,
29918,
798,
4197,
710,
29898,
13076,
29918,
1445,
29897,
2314,
13,
1678,
286,
1199,
29918,
1514,
29889,
3539,
29918,
1445,
29898,
710,
29898,
13076,
29918,
8508,
29918,
1445,
876,
13,
13,
1678,
297,
29875,
29918,
9057,
29918,
3972,
353,
13128,
3972,
29889,
11256,
3972,
703,
15514,
3195,
2564,
11256,
3972,
703,
9057,
29900,
29900,
29906,
1159,
13,
13,
1678,
297,
29875,
29918,
8508,
29918,
1445,
353,
297,
29875,
29918,
9057,
29918,
3972,
29889,
7122,
703,
3389,
29918,
277,
29941,
29900,
29900,
29918,
1272,
29889,
8508,
1159,
13,
1678,
297,
29875,
29918,
1514,
353,
7055,
2460,
29889,
29883,
361,
29889,
6268,
580,
13,
1678,
297,
29875,
29918,
1271,
353,
297,
29875,
29918,
1514,
29889,
1202,
29918,
1482,
29918,
1271,
703,
1272,
1159,
13,
1678,
297,
29875,
29918,
7888,
353,
297,
29875,
29918,
1271,
29889,
2344,
29918,
7888,
703,
29918,
2096,
29876,
613,
6796,
2385,
4557,
20068,
13,
1678,
297,
29875,
29918,
7888,
29889,
1202,
29918,
798,
29898,
3366,
29896,
20068,
13,
1678,
297,
29875,
29918,
7888,
29918,
29900,
29906,
353,
297,
29875,
29918,
1271,
29889,
2344,
29918,
7888,
703,
29918,
2096,
29876,
613,
6796,
29924,
2357,
4262,
1170,
20068,
13,
1678,
297,
29875,
29918,
7888,
29918,
29900,
29906,
29889,
1202,
29918,
798,
4197,
710,
29898,
13076,
29918,
1445,
29897,
2314,
13,
1678,
297,
29875,
29918,
1514,
29889,
3539,
29918,
1445,
29898,
710,
29898,
2172,
29918,
8508,
29918,
1445,
876,
13,
13,
1678,
3800,
29918,
2311,
353,
29871,
29929,
29953,
13,
1678,
2614,
29886,
861,
353,
29871,
29896,
13,
1678,
11420,
29918,
13471,
353,
29871,
29941,
29906,
13,
13,
1678,
4982,
29918,
3972,
353,
376,
25865,
29914,
9057,
29900,
29900,
29941,
29908,
13,
13,
1678,
13128,
3972,
29889,
11256,
3972,
703,
25865,
2564,
11256,
3972,
703,
9057,
29900,
29900,
29941,
1159,
13,
13,
1678,
396,
7525,
278,
4982,
13,
1678,
1677,
29918,
9675,
29918,
19218,
353,
10876,
29889,
19218,
7503,
29962,
13,
1678,
10876,
29889,
19218,
29961,
29896,
17531,
353,
518,
13,
4706,
376,
489,
449,
29918,
3972,
613,
13,
4706,
4982,
29918,
3972,
29892,
13,
4706,
376,
489,
1884,
29918,
2311,
613,
13,
4706,
285,
29908,
29912,
1884,
29918,
2311,
17671,
13,
4706,
376,
489,
574,
29886,
861,
613,
13,
4706,
285,
29908,
29912,
574,
29886,
861,
17671,
13,
4706,
376,
489,
5561,
29918,
13471,
613,
13,
4706,
285,
29908,
29912,
5561,
29918,
13471,
17671,
13,
1678,
4514,
13,
1678,
11105,
29918,
2695,
29918,
12864,
29918,
23176,
29918,
9057,
29889,
3396,
580,
13,
13,
1678,
1246,
29896,
353,
11187,
29889,
4804,
29898,
13,
4706,
518,
13,
9651,
376,
2674,
291,
29918,
13168,
29918,
3258,
613,
13,
9651,
376,
489,
1145,
6962,
613,
13,
9651,
376,
3009,
613,
13,
9651,
376,
489,
1884,
29918,
2311,
613,
13,
9651,
285,
29908,
29912,
1884,
29918,
2311,
17671,
13,
9651,
376,
489,
574,
29886,
861,
613,
13,
9651,
285,
29908,
29912,
574,
29886,
861,
17671,
13,
9651,
376,
489,
5561,
29918,
13471,
613,
13,
9651,
285,
29908,
29912,
5561,
29918,
13471,
17671,
13,
9651,
376,
489,
2103,
29918,
2695,
29918,
12864,
613,
13,
9651,
376,
29945,
613,
13,
4706,
21251,
13,
4706,
1423,
29922,
5574,
29892,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
1491,
5014,
29889,
3389,
29889,
9294,
29918,
5349,
29918,
29883,
4293,
4197,
4804,
29896,
2314,
13,
13,
1678,
4974,
2897,
29889,
2084,
29889,
275,
1445,
29898,
7050,
3972,
847,
376,
25865,
29908,
847,
376,
9057,
29900,
29900,
29941,
29908,
847,
376,
1525,
29931,
2725,
29918,
29967,
14824,
29918,
5746,
1806,
29918,
14605,
26925,
1159,
13,
13,
1678,
396,
11654,
487,
2106,
13,
1678,
10876,
29889,
19218,
353,
1677,
29918,
9675,
29918,
19218,
13,
2
] |
2018/Day15/setup.py | dh256/adventofcode | 0 | 172920 | <reponame>dh256/adventofcode<gh_stars>0
from setuptools import setup
setup(
name='day15',
author='<NAME>',
packages=['day15'],
description='Advent of Code 2018 Day 15 Solution'
) | [
1,
529,
276,
1112,
420,
29958,
12744,
29906,
29945,
29953,
29914,
328,
794,
974,
401,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
3250,
29896,
29945,
742,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
9741,
29922,
1839,
3250,
29896,
29945,
7464,
13,
1678,
6139,
2433,
3253,
794,
310,
5920,
29871,
29906,
29900,
29896,
29947,
8373,
29871,
29896,
29945,
24380,
29915,
13,
29897,
2
] |
models/py_utils/global_local.py | gezekun/End-to-end-Lane-Detection-with-Convolution-and-Transformer | 0 | 80340 | import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBNReLU(nn.Module):
def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1,
dilation=1, groups=1, bias=False):
super(ConvBNReLU, self).__init__()
self.conv = nn.Conv2d(
in_chan, out_chan, kernel_size=ks, stride=stride,
padding=padding, dilation=dilation,
groups=groups, bias=bias)
self.bn = nn.BatchNorm2d(out_chan)
self.relu = nn.ReLU(inplace=True)
def forward(self, x):
feat = self.conv(x)
feat = self.bn(feat)
feat = self.relu(feat)
return feat
class MHSA(nn.Module):
def __init__(self, n_dims, width=14, height=14, heads=4):
super(MHSA, self).__init__()
self.heads = heads
self.query = nn.Conv2d(n_dims, n_dims, kernel_size=1)
self.key = nn.Conv2d(n_dims, n_dims, kernel_size=1)
self.value = nn.Conv2d(n_dims, n_dims, kernel_size=1)
self.rel_h = nn.Parameter(torch.randn([1, heads, n_dims // heads, 1, height]), requires_grad=True)
self.rel_w = nn.Parameter(torch.randn([1, heads, n_dims // heads, width, 1]), requires_grad=True)
self.softmax = nn.Softmax(dim=-1)
def forward(self, x):
n_batch, C, width, height = x.size()
q = self.query(x).view(n_batch, self.heads, C // self.heads, -1)
k = self.key(x).view(n_batch, self.heads, C // self.heads, -1)
v = self.value(x).view(n_batch, self.heads, C // self.heads, -1)
content_content = torch.matmul(q.permute(0, 1, 3, 2), k)
content_position = (self.rel_h + self.rel_w).view(1, self.heads, C // self.heads, -1).permute(0, 1, 3, 2)
content_position = torch.matmul(content_position, q)
energy = content_content + content_position
attention = self.softmax(energy)
out = torch.matmul(v, attention.permute(0, 1, 3, 2))
out = out.view(n_batch, C, width, height)
return out
class MHSABNReLU(nn.Module):
def __init__(self, planes, stride, width=14, height=14, heads=4):
super(MHSABNReLU, self).__init__()
self.conv1 = nn.ModuleList()
self.conv1.append(MHSA(planes, width=width, height=height, heads=heads))
if stride == 2:
self.conv1.append(nn.AvgPool2d(2, 2))
self.conv1 = nn.Sequential(*self.conv1)
self.bn = nn.BatchNorm2d(planes)
def forward(self, x):
out = F.relu(self.bn(self.conv1(x)))
return out
class UpSample(nn.Module):
def __init__(self, n_chan, factor=2):
super(UpSample, self).__init__()
out_chan = n_chan * factor * factor
self.proj = nn.Conv2d(n_chan, out_chan, 1, 1, 0)
self.up = nn.PixelShuffle(factor)
self.init_weight()
def forward(self, x):
feat = self.proj(x)
feat = self.up(feat)
return feat
def init_weight(self):
nn.init.xavier_normal_(self.proj.weight, gain=1.)
class DetailBranch(nn.Module):
def __init__(self):
super(DetailBranch, self).__init__()
self.S1 = nn.Sequential(
ConvBNReLU(3, 64, 3, stride=2),
ConvBNReLU(64, 64, 3, stride=2), # stride = 1
)
# self.S1_MHSA = nn.Sequential(
# ConvBNReLU(3, 64, 3, stride=2),
# ConvBNReLU(64, 64, 3, stride=2),
# MHSABNReLU(64, stride=1, width=64, height=128, heads=4),
# )
# self.S2 = nn.Sequential(
# ConvBNReLU(64, 64, 3, stride=2),
# ConvBNReLU(64, 64, 3, stride=1),
# # MHSABNReLU(64, stride=1, width=32, height=64, heads=4),
# ConvBNReLU(64, 64, 3, stride=1), # stride = 2
# )
self.S2_MHSA = nn.Sequential(
ConvBNReLU(64, 64, 3, stride=2),
MHSABNReLU(64, stride=1, width=32, height=64, heads=4),
# MHSABNReLU(64, stride=1, width=32, height=64, heads=4),
ConvBNReLU(64, 64, 3, stride=1)
)
self.S3_MHSA = nn.Sequential(
ConvBNReLU(64, 128, 3, stride=2),
# ConvBNReLU(128, 128, 3, stride=1),
MHSABNReLU(128, stride=1, width=16, height=32, heads=4),
MHSABNReLU(128, stride=1, width=16, height=32, heads=4),
# ConvBNReLU(128, 128, 3, stride=1)
)
# self.S3 = nn.Sequential(
# ConvBNReLU(64, 128, 3, stride=2),
# ConvBNReLU(128, 128, 3, stride=1),
# ConvBNReLU(128, 128, 3, stride=1),
# )
def forward(self, x):
feat = self.S1(x)
feat = self.S2_MHSA(feat)
feat = self.S3_MHSA(feat)
return feat
class hsigmoid(nn.Module):
def forward(self, x):
out = F.relu6(x + 3, inplace=True) / 6
return out
class SeModule(nn.Module):
def __init__(self, in_size, reduction=4):
super(SeModule, self).__init__()
self.se = nn.Sequential(
nn.AdaptiveAvgPool2d(1),
nn.Conv2d(in_size, in_size // reduction, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(in_size // reduction),
nn.ReLU(inplace=True),
nn.Conv2d(in_size // reduction, in_size, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(in_size),
hsigmoid()
)
def forward(self, x):
return x * self.se(x)
class StemBlock(nn.Module):
def __init__(self):
super(StemBlock, self).__init__()
self.conv = ConvBNReLU(3, 16, 3, stride=2)
self.left = nn.Sequential(
ConvBNReLU(16, 8, 1, stride=1, padding=0),
ConvBNReLU(8, 16, 3, stride=2),
)
self.right = nn.MaxPool2d(
kernel_size=3, stride=2, padding=1, ceil_mode=False)
self.fuse = ConvBNReLU(32, 16, 3, stride=1)
def forward(self, x):
feat = self.conv(x)
feat_left = self.left(feat)
feat_right = self.right(feat)
feat = torch.cat([feat_left, feat_right], dim=1)
feat = self.fuse(feat)
return feat
class CEBlock(nn.Module):
def __init__(self):
super(CEBlock, self).__init__()
self.bn = nn.BatchNorm2d(128)
self.conv_gap = ConvBNReLU(128, 128, 1, stride=2, padding=0) # stride = 1
# TODO: in paper here is naive conv2d, no bn-relu
self.conv_last = ConvBNReLU(128, 128, 3, stride=2) # stride = 1
def forward(self, x):
feat = torch.mean(x, dim=(2, 3), keepdim=True)
feat = self.bn(feat)
feat = self.conv_gap(feat)
feat = feat + x
feat = self.conv_last(feat)
return feat
class FuseMBlayer1(nn.Module):
def __init__(self, in_chan, out_chan, exp_ratio=6):
super(FuseMBlayer1, self).__init__()
mid_chan = in_chan * exp_ratio
self.conv1 = ConvBNReLU(in_chan, in_chan, 3, stride=1)
self.se = SeModule(in_chan)
self.conv2 = nn.Sequential(
nn.Conv2d(
in_chan, mid_chan, kernel_size=3, stride=1,
padding=1, bias=False),
nn.BatchNorm2d(mid_chan),
)
self.conv3 = nn.Sequential(
nn.Conv2d(
mid_chan, out_chan, kernel_size=1, stride=1,
padding=0, bias=False),
nn.BatchNorm2d(out_chan),
)
self.conv3[1].last_bn = True
self.relu = nn.ReLU(inplace=True)
def forward(self, x):
# print('x =' + str(x.shape))
feat = self.conv1(x)
# print('conv1 =' + str(feat.shape))
#feat = self.se(feat)
feat = self.conv2(feat)
# print('conv2 =' + str(feat.shape))
feat = self.conv3(feat)
# print('conv3 =' + str(feat.shape))
feat = feat + x
feat = self.relu(feat)
return feat
class FuseMBlayer2(nn.Module):
def __init__(self, in_chan, out_chan, exp_ratio=6):
super(FuseMBlayer2, self).__init__()
mid_chan = in_chan * exp_ratio
self.conv1 = ConvBNReLU(in_chan, in_chan, 3, stride=1)
self.se = SeModule(in_chan)
self.conv2 = nn.Sequential(
nn.Conv2d(
in_chan, mid_chan, kernel_size=3, stride=2,
padding=1, bias=False),
nn.BatchNorm2d(mid_chan),
nn.ReLU(inplace=True),
)
self.conv3 = nn.Sequential(
nn.Conv2d(
mid_chan, out_chan, kernel_size=1, stride=1,
padding=0, bias=False),
nn.BatchNorm2d(out_chan),
)
self.conv3[1].last_bn = True
self.shortcut = nn.Sequential(
nn.Conv2d(
in_chan, in_chan, kernel_size=3, stride=2,
padding=1, groups=in_chan, bias=False),
nn.BatchNorm2d(in_chan),
nn.Conv2d(
in_chan, out_chan, kernel_size=1, stride=1,
padding=0, bias=False),
nn.BatchNorm2d(out_chan),
)
self.relu = nn.ReLU(inplace=True)
def forward(self, x):
feat = self.conv1(x)
#feat = self.se(feat)
feat = self.conv2(feat)
feat = self.conv3(feat)
shortcut = self.shortcut(x)
feat = feat + shortcut
feat = self.relu(feat)
return feat
class MBLayerS1(nn.Module):
def __init__(self, in_chan, out_chan, exp_ratio=6):
super(MBLayerS1, self).__init__()
mid_chan = in_chan * exp_ratio
self.conv1 = ConvBNReLU(in_chan, in_chan, 3, stride=1)
self.dwconv = nn.Sequential(
nn.Conv2d(
in_chan, mid_chan, kernel_size=3, stride=1,
padding=1, groups=in_chan, bias=False),
nn.BatchNorm2d(mid_chan),
nn.ReLU(inplace=True), # not shown in paper
)
self.se = SeModule(mid_chan)
self.conv2 = nn.Sequential(
nn.Conv2d(
mid_chan, out_chan, kernel_size=1, stride=1,
padding=0, bias=False),
nn.BatchNorm2d(out_chan),
)
self.conv2[1].last_bn = True
self.relu = nn.ReLU(inplace=True)
def forward(self, x):
feat = self.conv1(x)
feat = self.dwconv(feat)
# feat = self.se(feat)
feat = self.conv2(feat)
feat = feat + x
feat = self.relu(feat)
return feat
class MBLayerS2(nn.Module):
def __init__(self, in_chan, out_chan, exp_ratio=6):
super(MBLayerS2, self).__init__()
mid_chan = in_chan * exp_ratio
self.conv1 = ConvBNReLU(in_chan, in_chan, 3, stride=1)
self.dwconv1 = nn.Sequential(
nn.Conv2d(
in_chan, mid_chan, kernel_size=3, stride=2,
padding=1, groups=in_chan, bias=False),
nn.BatchNorm2d(mid_chan),
)
self.conv2 = nn.Sequential(
nn.Conv2d(
mid_chan, mid_chan, kernel_size=3, stride=1,
padding=1, bias=False),
nn.BatchNorm2d(mid_chan),
nn.ReLU(inplace=True),
)
self.se = SeModule(mid_chan)
self.conv3 = nn.Sequential(
nn.Conv2d(
mid_chan, out_chan, kernel_size=1, stride=1,
padding=0, bias=False),
nn.BatchNorm2d(out_chan),
)
self.conv3[1].last_bn = True
self.shortcut = nn.Sequential(
nn.Conv2d(
in_chan, in_chan, kernel_size=3, stride=2,
padding=1, groups=in_chan, bias=False),
nn.BatchNorm2d(in_chan),
nn.Conv2d(
in_chan, out_chan, kernel_size=1, stride=1,
padding=0, bias=False),
nn.BatchNorm2d(out_chan),
)
self.relu = nn.ReLU(inplace=True)
def forward(self, x):
feat = self.conv1(x)
feat = self.dwconv1(feat)
feat = self.conv2(feat)
# feat = self.se(feat)
feat = self.conv3(feat)
shortcut = self.shortcut(x)
feat = feat + shortcut
feat = self.relu(feat)
return feat
class SegmentBranch(nn.Module):
def __init__(self):
super(SegmentBranch, self).__init__()
self.S1S2 = StemBlock()
self.S3 = nn.Sequential(
FuseMBlayer2(16, 32),
FuseMBlayer1(32, 32),
)
self.S4 = nn.Sequential(
MBLayerS2(32, 64),
MBLayerS1(64, 64),
)
self.S5_4 = nn.Sequential(
MBLayerS2(64, 128),
MBLayerS1(128, 128),
MBLayerS1(128, 128),
MBLayerS1(128, 128),
)
self.S5_5 = CEBlock()
# self.up1 = nn.Upsample(scale_factor=4)
def forward(self, x):
feat2 = self.S1S2(x)
feat3 = self.S3(feat2)
feat4 = self.S4(feat3)
feat5_4 = self.S5_4(feat4)
feat5_5 = self.S5_5(feat5_4)
# feat5_5 = self.up1(feat5_5)
return feat5_5
class BGALayer(nn.Module):
def __init__(self):
super(BGALayer, self).__init__()
self.left1 = nn.Sequential(
nn.Conv2d(
128, 128, kernel_size=3, stride=1,
padding=1, groups=128, bias=False),
nn.BatchNorm2d(128),
nn.Conv2d(
128, 128, kernel_size=1, stride=1,
padding=0, bias=False),
)
self.left2 = nn.Sequential(
nn.Conv2d(
128, 128, kernel_size=3, stride=2,
padding=1, bias=False),
nn.BatchNorm2d(128),
nn.AvgPool2d(kernel_size=3, stride=2, padding=1, ceil_mode=False)
)
self.right1 = nn.Sequential(
nn.Conv2d(
128, 128, kernel_size=3, stride=1,
padding=1, bias=False),
nn.BatchNorm2d(128),
)
self.right2 = nn.Sequential(
nn.Conv2d(
128, 128, kernel_size=3, stride=1,
padding=1, groups=128, bias=False),
nn.BatchNorm2d(128),
nn.Conv2d(
128, 128, kernel_size=1, stride=1,
padding=0, bias=False),
)
self.up1 = nn.Upsample(scale_factor=4)
self.up2 = nn.Upsample(scale_factor=4)
##TODO: does this really has no relu?
self.conv = nn.Sequential(
nn.Conv2d(
128, 128, kernel_size=3, stride=1,
padding=1, bias=False),
nn.BatchNorm2d(128),
nn.ReLU(inplace=True), # not shown in paper
)
# self.conv1 = nn.Conv2d(256, 128, kernel_size=1)
def forward(self, x_d, x_s):
left1 = self.left1(x_d)
left2 = self.left2(x_d)
right1 = self.right1(x_s)
right2 = self.right2(x_s)
right1 = self.up1(right1)
left = left1 * torch.sigmoid(right1)
right = left2 * torch.sigmoid(right2)
right = self.up2(right)
out = self.conv(left + right)
# ---------SUM----------#
# print('out', out.size())
# out = self.conv(x_d + x_s)
# ---------Concate----------#
# out = torch.cat((x_d, x_s), dim=1)
# out = self.conv1(out)
# out = self.conv(out)
return out
class SegmentHead(nn.Module):
def __init__(self, in_chan, mid_chan, n_classes, up_factor=8, aux=True):
super(SegmentHead, self).__init__()
self.conv = ConvBNReLU(in_chan, mid_chan, 3, stride=1)
self.drop = nn.Dropout(0.1)
self.up_factor = up_factor
out_chan = n_classes * up_factor * up_factor
if aux:
self.conv_out = nn.Sequential(
ConvBNReLU(mid_chan, up_factor * up_factor, 3, stride=1),
nn.Conv2d(up_factor * up_factor, out_chan, 1, 1, 0),
nn.PixelShuffle(up_factor)
)
else:
self.conv_out = nn.Sequential(
nn.Conv2d(mid_chan, out_chan, 1, 1, 0),
nn.PixelShuffle(up_factor)
)
def forward(self, x):
feat = self.conv(x)
feat = self.drop(feat)
feat = self.conv_out(feat)
return feat
# if __name__ == "__main__":
# x = torch.randn(16, 3, 256, 512)
# detail = DetailBranch()
# feat = detail(x)
# print('detail', feat.size())
# detail torch.Size([16, 128, 16, 32])
# x = torch.randn(16, 3, 1024, 2048)
# stem = StemBlock()
# feat = stem(x)
# print('stem', feat.size())
#
# x = torch.randn(16, 128, 16, 32)
# ceb = CEBlock()
# feat = ceb(x)
# print(feat.size())
#
# x = torch.randn(16, 32, 16, 32)
# ge1 = FuseMBlayer1(32, 32)
# feat = ge1(x)
# print(feat.size())
#
# x = torch.randn(16, 16, 16, 32)
# ge2 = FuseMBlayer2(16, 32)
# feat = ge2(x)
# print(feat.size())
#
# left = torch.randn(16, 128, 16, 32)
# right = torch.randn(16, 128, 4, 8)
# bga = BGALayer()
# feat = bga(left, right)
# print('bga', feat.size())
# bga torch.Size([16, 128, 16, 32])
# x = torch.randn(16, 128, 64, 128)
# head = SegmentHead(128, 128, 19)
# logits = head(x)
# print(logits.size())
#
# x = torch.randn(16, 3, 256, 512)
# segment = SegmentBranch()
# feat = segment(x)[0]
# print('segment', feat.size())
# segment torch.Size([128, 4, 8])
# x = torch.randn(16, 3, 512, 1024)
# model = BiSeNetV2(n_classes=19)
# logits = model(x)[0]
# print(logits.size())
# model = BiSeNetV2(n_classes=2)
# for name, param in model.named_parameters():
# if len(param.size()) == 1:
# #print(name)
# print(name, ':', param.size())
| [
1,
1053,
4842,
305,
30004,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
30004,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
30004,
13,
30004,
13,
1990,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
413,
29879,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
11167,
13,
462,
270,
8634,
29922,
29896,
29892,
6471,
29922,
29896,
29892,
24003,
29922,
8824,
1125,
30004,
13,
4706,
2428,
29898,
1168,
29894,
29933,
29940,
1123,
29931,
29965,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
20580,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
9651,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
2039,
29892,
380,
2426,
29922,
303,
2426,
11167,
13,
9651,
7164,
29922,
12791,
29892,
270,
8634,
29922,
29881,
8634,
11167,
13,
9651,
6471,
29922,
13155,
29892,
24003,
29922,
29890,
3173,
8443,
13,
4706,
1583,
29889,
11197,
353,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
8443,
13,
4706,
1583,
29889,
2674,
29884,
353,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
11197,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
2674,
29884,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
341,
29950,
8132,
29898,
15755,
29889,
7355,
1125,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
302,
29918,
6229,
29879,
29892,
2920,
29922,
29896,
29946,
29892,
3171,
29922,
29896,
29946,
29892,
15883,
29922,
29946,
1125,
30004,
13,
4706,
2428,
29898,
29924,
29950,
8132,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
2813,
29879,
353,
15883,
30004,
13,
30004,
13,
4706,
1583,
29889,
1972,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29876,
29918,
6229,
29879,
29892,
302,
29918,
6229,
29879,
29892,
8466,
29918,
2311,
29922,
29896,
8443,
13,
4706,
1583,
29889,
1989,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29876,
29918,
6229,
29879,
29892,
302,
29918,
6229,
29879,
29892,
8466,
29918,
2311,
29922,
29896,
8443,
13,
4706,
1583,
29889,
1767,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29876,
29918,
6229,
29879,
29892,
302,
29918,
6229,
29879,
29892,
8466,
29918,
2311,
29922,
29896,
8443,
13,
30004,
13,
4706,
1583,
29889,
2674,
29918,
29882,
353,
302,
29876,
29889,
9329,
29898,
7345,
305,
29889,
9502,
29876,
4197,
29896,
29892,
15883,
29892,
302,
29918,
6229,
29879,
849,
15883,
29892,
29871,
29896,
29892,
3171,
11724,
6858,
29918,
5105,
29922,
5574,
8443,
13,
4706,
1583,
29889,
2674,
29918,
29893,
353,
302,
29876,
29889,
9329,
29898,
7345,
305,
29889,
9502,
29876,
4197,
29896,
29892,
15883,
29892,
302,
29918,
6229,
29879,
849,
15883,
29892,
2920,
29892,
29871,
29896,
11724,
6858,
29918,
5105,
29922,
5574,
8443,
13,
30004,
13,
4706,
1583,
29889,
2695,
3317,
353,
302,
29876,
29889,
6295,
615,
3317,
29898,
6229,
10457,
29896,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
302,
29918,
16175,
29892,
315,
29892,
2920,
29892,
3171,
353,
921,
29889,
2311,
26471,
13,
4706,
3855,
353,
1583,
29889,
1972,
29898,
29916,
467,
1493,
29898,
29876,
29918,
16175,
29892,
1583,
29889,
2813,
29879,
29892,
315,
849,
1583,
29889,
2813,
29879,
29892,
448,
29896,
8443,
13,
4706,
413,
353,
1583,
29889,
1989,
29898,
29916,
467,
1493,
29898,
29876,
29918,
16175,
29892,
1583,
29889,
2813,
29879,
29892,
315,
849,
1583,
29889,
2813,
29879,
29892,
448,
29896,
8443,
13,
4706,
325,
353,
1583,
29889,
1767,
29898,
29916,
467,
1493,
29898,
29876,
29918,
16175,
29892,
1583,
29889,
2813,
29879,
29892,
315,
849,
1583,
29889,
2813,
29879,
29892,
448,
29896,
8443,
13,
30004,
13,
4706,
2793,
29918,
3051,
353,
4842,
305,
29889,
2922,
16109,
29898,
29939,
29889,
17858,
1082,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
511,
413,
8443,
13,
30004,
13,
4706,
2793,
29918,
3283,
353,
313,
1311,
29889,
2674,
29918,
29882,
718,
1583,
29889,
2674,
29918,
29893,
467,
1493,
29898,
29896,
29892,
1583,
29889,
2813,
29879,
29892,
315,
849,
1583,
29889,
2813,
29879,
29892,
448,
29896,
467,
17858,
1082,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
8443,
13,
4706,
2793,
29918,
3283,
353,
4842,
305,
29889,
2922,
16109,
29898,
3051,
29918,
3283,
29892,
3855,
8443,
13,
30004,
13,
4706,
5864,
353,
2793,
29918,
3051,
718,
2793,
29918,
3283,
30004,
13,
4706,
8570,
353,
1583,
29889,
2695,
3317,
29898,
27548,
8443,
13,
30004,
13,
4706,
714,
353,
4842,
305,
29889,
2922,
16109,
29898,
29894,
29892,
8570,
29889,
17858,
1082,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
876,
30004,
13,
4706,
714,
353,
714,
29889,
1493,
29898,
29876,
29918,
16175,
29892,
315,
29892,
2920,
29892,
3171,
8443,
13,
30004,
13,
4706,
736,
714,
30004,
13,
30004,
13,
1990,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3814,
267,
29892,
380,
2426,
29892,
2920,
29922,
29896,
29946,
29892,
3171,
29922,
29896,
29946,
29892,
15883,
29922,
29946,
1125,
30004,
13,
4706,
2428,
29898,
29924,
14851,
2882,
29940,
1123,
29931,
29965,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
20580,
29896,
353,
302,
29876,
29889,
7355,
1293,
26471,
13,
4706,
1583,
29889,
20580,
29896,
29889,
4397,
29898,
29924,
29950,
8132,
29898,
9018,
267,
29892,
2920,
29922,
2103,
29892,
3171,
29922,
3545,
29892,
15883,
29922,
2813,
29879,
876,
30004,
13,
4706,
565,
380,
2426,
1275,
29871,
29906,
29901,
30004,
13,
9651,
1583,
29889,
20580,
29896,
29889,
4397,
29898,
15755,
29889,
12810,
29887,
11426,
29906,
29881,
29898,
29906,
29892,
29871,
29906,
876,
30004,
13,
4706,
1583,
29889,
20580,
29896,
353,
302,
29876,
29889,
16941,
2556,
10456,
1311,
29889,
20580,
29896,
8443,
13,
4706,
1583,
29889,
11197,
353,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
9018,
267,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
714,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29898,
1311,
29889,
20580,
29896,
29898,
29916,
4961,
30004,
13,
30004,
13,
4706,
736,
714,
30004,
13,
30004,
13,
1990,
5020,
17708,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
302,
29918,
5083,
29892,
7329,
29922,
29906,
1125,
30004,
13,
4706,
2428,
29898,
3373,
17708,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
714,
29918,
5083,
353,
302,
29918,
5083,
334,
7329,
334,
7329,
30004,
13,
4706,
1583,
29889,
20865,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29876,
29918,
5083,
29892,
714,
29918,
5083,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
8443,
13,
4706,
1583,
29889,
786,
353,
302,
29876,
29889,
29637,
2713,
21897,
29898,
19790,
8443,
13,
4706,
1583,
29889,
2344,
29918,
7915,
26471,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20865,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
786,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1678,
822,
2069,
29918,
7915,
29898,
1311,
1125,
30004,
13,
4706,
302,
29876,
29889,
2344,
29889,
29916,
18852,
29918,
8945,
23538,
1311,
29889,
20865,
29889,
7915,
29892,
11581,
29922,
29896,
1846,
30004,
13,
30004,
13,
1990,
5953,
737,
29933,
4014,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
2428,
29898,
16570,
29933,
4014,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
30004,
13,
4706,
1583,
29889,
29903,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29941,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
1678,
396,
380,
2426,
353,
29871,
29896,
30004,
13,
4706,
1723,
30004,
13,
4706,
396,
1583,
29889,
29903,
29896,
29918,
29924,
29950,
8132,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
4706,
396,
3986,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29941,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
4706,
396,
3986,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
4706,
396,
3986,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
380,
2426,
29922,
29896,
29892,
2920,
29922,
29953,
29946,
29892,
3171,
29922,
29896,
29906,
29947,
29892,
15883,
29922,
29946,
511,
30004,
13,
4706,
396,
418,
1723,
30004,
13,
4706,
396,
1583,
29889,
29903,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
4706,
396,
268,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
4706,
396,
268,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
511,
30004,
13,
4706,
396,
268,
396,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
380,
2426,
29922,
29896,
29892,
2920,
29922,
29941,
29906,
29892,
3171,
29922,
29953,
29946,
29892,
15883,
29922,
29946,
511,
30004,
13,
4706,
396,
268,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
511,
1678,
396,
380,
2426,
353,
29871,
29906,
30004,
13,
4706,
396,
1723,
30004,
13,
4706,
1583,
29889,
29903,
29906,
29918,
29924,
29950,
8132,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
9651,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
380,
2426,
29922,
29896,
29892,
2920,
29922,
29941,
29906,
29892,
3171,
29922,
29953,
29946,
29892,
15883,
29922,
29946,
511,
30004,
13,
9651,
396,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
380,
2426,
29922,
29896,
29892,
2920,
29922,
29941,
29906,
29892,
3171,
29922,
29953,
29946,
29892,
15883,
29922,
29946,
511,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
9651,
1723,
30004,
13,
4706,
1583,
29889,
29903,
29941,
29918,
29924,
29950,
8132,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
9651,
396,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
511,
30004,
13,
9651,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
380,
2426,
29922,
29896,
29892,
2920,
29922,
29896,
29953,
29892,
3171,
29922,
29941,
29906,
29892,
15883,
29922,
29946,
511,
30004,
13,
9651,
341,
14851,
2882,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
380,
2426,
29922,
29896,
29892,
2920,
29922,
29896,
29953,
29892,
3171,
29922,
29941,
29906,
29892,
15883,
29922,
29946,
511,
30004,
13,
9651,
396,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
4706,
1723,
30004,
13,
4706,
396,
1583,
29889,
29903,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
4706,
396,
268,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
4706,
396,
268,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
511,
30004,
13,
4706,
396,
268,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
511,
30004,
13,
4706,
396,
1723,
30004,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
29903,
29896,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
29903,
29906,
29918,
29924,
29950,
8132,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
29903,
29941,
29918,
29924,
29950,
8132,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
298,
18816,
29885,
3398,
29898,
15755,
29889,
7355,
1125,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
714,
353,
383,
29889,
2674,
29884,
29953,
29898,
29916,
718,
29871,
29941,
29892,
297,
6689,
29922,
5574,
29897,
847,
29871,
29953,
30004,
13,
4706,
736,
714,
30004,
13,
30004,
13,
1990,
922,
7355,
29898,
15755,
29889,
7355,
1125,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
2311,
29892,
20376,
29922,
29946,
1125,
30004,
13,
4706,
2428,
29898,
2008,
7355,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
344,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
29909,
1388,
415,
573,
12810,
29887,
11426,
29906,
29881,
29898,
29896,
511,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
262,
29918,
2311,
29892,
297,
29918,
2311,
849,
20376,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
262,
29918,
2311,
849,
20376,
511,
30004,
13,
9651,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
511,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
262,
29918,
2311,
849,
20376,
29892,
297,
29918,
2311,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
262,
29918,
2311,
511,
30004,
13,
9651,
298,
18816,
29885,
3398,
26471,
13,
4706,
1723,
30004,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
736,
921,
334,
1583,
29889,
344,
29898,
29916,
8443,
13,
30004,
13,
1990,
624,
331,
7445,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
2428,
29898,
855,
331,
7445,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
20580,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29941,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
8443,
13,
4706,
1583,
29889,
1563,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29953,
29892,
29871,
29947,
29892,
29871,
29896,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29900,
511,
30004,
13,
9651,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
1266,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
29898,
30004,
13,
9651,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29896,
29892,
2257,
309,
29918,
8513,
29922,
8824,
8443,
13,
4706,
1583,
29889,
29888,
1509,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29941,
29906,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29898,
29916,
8443,
13,
4706,
1238,
271,
29918,
1563,
353,
1583,
29889,
1563,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
29918,
1266,
353,
1583,
29889,
1266,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
4842,
305,
29889,
4117,
4197,
1725,
271,
29918,
1563,
29892,
1238,
271,
29918,
1266,
1402,
3964,
29922,
29896,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
29888,
1509,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
14645,
7445,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
2428,
29898,
4741,
7445,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
11197,
353,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
8443,
13,
4706,
1583,
29889,
20580,
29918,
29887,
481,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29900,
29897,
1678,
396,
380,
2426,
353,
29871,
29896,
30004,
13,
4706,
396,
14402,
29901,
297,
5650,
1244,
338,
1055,
573,
7602,
29906,
29881,
29892,
694,
289,
29876,
29899,
2674,
29884,
30004,
13,
4706,
1583,
29889,
20580,
29918,
4230,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29906,
29897,
1678,
396,
380,
2426,
353,
29871,
29896,
30004,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
4842,
305,
29889,
12676,
29898,
29916,
29892,
3964,
7607,
29906,
29892,
29871,
29941,
511,
3013,
6229,
29922,
5574,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
11197,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29918,
29887,
481,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1238,
271,
718,
921,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29918,
4230,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
383,
1509,
9486,
13148,
29896,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
1518,
29918,
3605,
601,
29922,
29953,
1125,
30004,
13,
4706,
2428,
29898,
29943,
1509,
9486,
13148,
29896,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
7145,
29918,
5083,
353,
297,
29918,
5083,
334,
1518,
29918,
3605,
601,
30004,
13,
4706,
1583,
29889,
20580,
29896,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
262,
29918,
5083,
29892,
297,
29918,
5083,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
4706,
1583,
29889,
344,
353,
922,
7355,
29898,
262,
29918,
5083,
8443,
13,
4706,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
6563,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
7145,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29941,
29961,
29896,
1822,
4230,
29918,
11197,
353,
5852,
30004,
13,
4706,
1583,
29889,
2674,
29884,
353,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
396,
1596,
877,
29916,
353,
29915,
718,
851,
29898,
29916,
29889,
12181,
876,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29896,
29898,
29916,
8443,
13,
4706,
396,
1596,
877,
20580,
29896,
353,
29915,
718,
851,
29898,
1725,
271,
29889,
12181,
876,
30004,
13,
4706,
396,
1725,
271,
353,
1583,
29889,
344,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29906,
29898,
1725,
271,
8443,
13,
4706,
396,
1596,
877,
20580,
29906,
353,
29915,
718,
851,
29898,
1725,
271,
29889,
12181,
876,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29941,
29898,
1725,
271,
8443,
13,
4706,
396,
1596,
877,
20580,
29941,
353,
29915,
718,
851,
29898,
1725,
271,
29889,
12181,
876,
30004,
13,
4706,
1238,
271,
353,
1238,
271,
718,
921,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
2674,
29884,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
383,
1509,
9486,
13148,
29906,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
1518,
29918,
3605,
601,
29922,
29953,
1125,
30004,
13,
4706,
2428,
29898,
29943,
1509,
9486,
13148,
29906,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
7145,
29918,
5083,
353,
297,
29918,
5083,
334,
1518,
29918,
3605,
601,
30004,
13,
4706,
1583,
29889,
20580,
29896,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
262,
29918,
5083,
29892,
297,
29918,
5083,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
4706,
1583,
29889,
344,
353,
922,
7355,
29898,
262,
29918,
5083,
8443,
13,
4706,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
11167,
13,
18884,
7164,
29922,
29896,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
6563,
29918,
5083,
511,
30004,
13,
9651,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
7145,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29941,
29961,
29896,
1822,
4230,
29918,
11197,
353,
5852,
30004,
13,
4706,
1583,
29889,
12759,
7582,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
297,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
11167,
13,
18884,
7164,
29922,
29896,
29892,
6471,
29922,
262,
29918,
5083,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
262,
29918,
5083,
511,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
2674,
29884,
353,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29896,
29898,
29916,
8443,
13,
4706,
396,
1725,
271,
353,
1583,
29889,
344,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29906,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29941,
29898,
1725,
271,
8443,
13,
4706,
21697,
353,
1583,
29889,
12759,
7582,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1238,
271,
718,
21697,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
2674,
29884,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
13232,
14420,
29903,
29896,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
1518,
29918,
3605,
601,
29922,
29953,
1125,
30004,
13,
4706,
2428,
29898,
9486,
14420,
29903,
29896,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
7145,
29918,
5083,
353,
297,
29918,
5083,
334,
1518,
29918,
3605,
601,
30004,
13,
4706,
1583,
29889,
20580,
29896,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
262,
29918,
5083,
29892,
297,
29918,
5083,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
4706,
1583,
29889,
28012,
20580,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
6471,
29922,
262,
29918,
5083,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
6563,
29918,
5083,
511,
30004,
13,
9651,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
511,
29871,
396,
451,
4318,
297,
5650,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
344,
353,
922,
7355,
29898,
6563,
29918,
5083,
8443,
13,
4706,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
7145,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29906,
29961,
29896,
1822,
4230,
29918,
11197,
353,
5852,
30004,
13,
4706,
1583,
29889,
2674,
29884,
353,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29896,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
28012,
20580,
29898,
1725,
271,
8443,
13,
4706,
396,
1238,
271,
353,
1583,
29889,
344,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29906,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1238,
271,
718,
921,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
2674,
29884,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
13232,
14420,
29903,
29906,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
1518,
29918,
3605,
601,
29922,
29953,
1125,
30004,
13,
4706,
2428,
29898,
9486,
14420,
29903,
29906,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
7145,
29918,
5083,
353,
297,
29918,
5083,
334,
1518,
29918,
3605,
601,
30004,
13,
4706,
1583,
29889,
20580,
29896,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
262,
29918,
5083,
29892,
297,
29918,
5083,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
4706,
1583,
29889,
28012,
20580,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
11167,
13,
18884,
7164,
29922,
29896,
29892,
6471,
29922,
262,
29918,
5083,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
6563,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
7145,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
6563,
29918,
5083,
511,
30004,
13,
9651,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
344,
353,
922,
7355,
29898,
6563,
29918,
5083,
8443,
13,
4706,
1583,
29889,
20580,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
7145,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
20580,
29941,
29961,
29896,
1822,
4230,
29918,
11197,
353,
5852,
30004,
13,
4706,
1583,
29889,
12759,
7582,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
297,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
11167,
13,
18884,
7164,
29922,
29896,
29892,
6471,
29922,
262,
29918,
5083,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
262,
29918,
5083,
511,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
18884,
297,
29918,
5083,
29892,
714,
29918,
5083,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
449,
29918,
5083,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
2674,
29884,
353,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29896,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
28012,
20580,
29896,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29906,
29898,
1725,
271,
8443,
13,
4706,
396,
1238,
271,
353,
1583,
29889,
344,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29941,
29898,
1725,
271,
8443,
13,
4706,
21697,
353,
1583,
29889,
12759,
7582,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1238,
271,
718,
21697,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
2674,
29884,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
1990,
6667,
358,
29933,
4014,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
2428,
29898,
17669,
358,
29933,
4014,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
29903,
29896,
29903,
29906,
353,
624,
331,
7445,
26471,
13,
4706,
1583,
29889,
29903,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
383,
1509,
9486,
13148,
29906,
29898,
29896,
29953,
29892,
29871,
29941,
29906,
511,
30004,
13,
9651,
383,
1509,
9486,
13148,
29896,
29898,
29941,
29906,
29892,
29871,
29941,
29906,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
29903,
29946,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
13232,
14420,
29903,
29906,
29898,
29941,
29906,
29892,
29871,
29953,
29946,
511,
30004,
13,
9651,
13232,
14420,
29903,
29896,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
29903,
29945,
29918,
29946,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
13232,
14420,
29903,
29906,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
511,
30004,
13,
9651,
13232,
14420,
29903,
29896,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
511,
30004,
13,
9651,
13232,
14420,
29903,
29896,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
511,
30004,
13,
9651,
13232,
14420,
29903,
29896,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
29903,
29945,
29918,
29945,
353,
14645,
7445,
26471,
13,
30004,
13,
4706,
396,
1583,
29889,
786,
29896,
353,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29946,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
29906,
353,
1583,
29889,
29903,
29896,
29903,
29906,
29898,
29916,
8443,
13,
4706,
1238,
271,
29941,
353,
1583,
29889,
29903,
29941,
29898,
1725,
271,
29906,
8443,
13,
4706,
1238,
271,
29946,
353,
1583,
29889,
29903,
29946,
29898,
1725,
271,
29941,
8443,
13,
4706,
1238,
271,
29945,
29918,
29946,
353,
1583,
29889,
29903,
29945,
29918,
29946,
29898,
1725,
271,
29946,
8443,
13,
4706,
1238,
271,
29945,
29918,
29945,
353,
1583,
29889,
29903,
29945,
29918,
29945,
29898,
1725,
271,
29945,
29918,
29946,
8443,
13,
4706,
396,
1238,
271,
29945,
29918,
29945,
353,
1583,
29889,
786,
29896,
29898,
1725,
271,
29945,
29918,
29945,
8443,
13,
4706,
736,
1238,
271,
29945,
29918,
29945,
30004,
13,
30004,
13,
1990,
350,
29954,
1964,
2747,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
2428,
29898,
29933,
29954,
1964,
2747,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
1563,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
6471,
29922,
29896,
29906,
29947,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
511,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
1563,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
11167,
13,
18884,
7164,
29922,
29896,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
511,
30004,
13,
9651,
302,
29876,
29889,
12810,
29887,
11426,
29906,
29881,
29898,
17460,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29896,
29892,
2257,
309,
29918,
8513,
29922,
8824,
8443,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
1266,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
1266,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
6471,
29922,
29896,
29906,
29947,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
511,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29896,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29900,
29892,
24003,
29922,
8824,
511,
30004,
13,
4706,
1723,
30004,
13,
4706,
1583,
29889,
786,
29896,
353,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29946,
8443,
13,
4706,
1583,
29889,
786,
29906,
353,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29946,
8443,
13,
4706,
444,
4986,
3970,
29901,
947,
445,
2289,
756,
694,
1104,
29884,
29973,
30004,
13,
4706,
1583,
29889,
20580,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
30004,
13,
462,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
11167,
13,
18884,
7164,
29922,
29896,
29892,
24003,
29922,
8824,
511,
30004,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
511,
30004,
13,
9651,
302,
29876,
29889,
1123,
29931,
29965,
29898,
262,
6689,
29922,
5574,
511,
29871,
396,
451,
4318,
297,
5650,
30004,
13,
4706,
1723,
30004,
13,
30004,
13,
4706,
396,
1583,
29889,
20580,
29896,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29896,
8443,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
29918,
29881,
29892,
921,
29918,
29879,
1125,
30004,
13,
30004,
13,
4706,
2175,
29896,
353,
1583,
29889,
1563,
29896,
29898,
29916,
29918,
29881,
8443,
13,
4706,
2175,
29906,
353,
1583,
29889,
1563,
29906,
29898,
29916,
29918,
29881,
8443,
13,
4706,
1492,
29896,
353,
1583,
29889,
1266,
29896,
29898,
29916,
29918,
29879,
8443,
13,
4706,
1492,
29906,
353,
1583,
29889,
1266,
29906,
29898,
29916,
29918,
29879,
8443,
13,
4706,
1492,
29896,
353,
1583,
29889,
786,
29896,
29898,
1266,
29896,
8443,
13,
30004,
13,
4706,
2175,
353,
2175,
29896,
334,
4842,
305,
29889,
18816,
29885,
3398,
29898,
1266,
29896,
8443,
13,
4706,
1492,
353,
2175,
29906,
334,
4842,
305,
29889,
18816,
29885,
3398,
29898,
1266,
29906,
8443,
13,
4706,
1492,
353,
1583,
29889,
786,
29906,
29898,
1266,
8443,
13,
4706,
714,
353,
1583,
29889,
20580,
29898,
1563,
718,
1492,
8443,
13,
30004,
13,
30004,
13,
4706,
396,
448,
1378,
25021,
28400,
29937,
30004,
13,
4706,
396,
1596,
877,
449,
742,
714,
29889,
2311,
3101,
30004,
13,
4706,
396,
714,
353,
1583,
29889,
20580,
29898,
29916,
29918,
29881,
718,
921,
29918,
29879,
8443,
13,
30004,
13,
4706,
396,
448,
1378,
1168,
29883,
403,
28400,
29937,
30004,
13,
4706,
396,
714,
353,
4842,
305,
29889,
4117,
3552,
29916,
29918,
29881,
29892,
921,
29918,
29879,
511,
3964,
29922,
29896,
8443,
13,
4706,
396,
714,
353,
1583,
29889,
20580,
29896,
29898,
449,
8443,
13,
4706,
396,
714,
353,
1583,
29889,
20580,
29898,
449,
8443,
13,
4706,
736,
714,
30004,
13,
30004,
13,
30004,
13,
1990,
6667,
358,
5494,
29898,
15755,
29889,
7355,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
297,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
302,
29918,
13203,
29892,
701,
29918,
19790,
29922,
29947,
29892,
3479,
29922,
5574,
1125,
30004,
13,
4706,
2428,
29898,
17669,
358,
5494,
29892,
1583,
467,
1649,
2344,
1649,
26471,
13,
4706,
1583,
29889,
20580,
353,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
262,
29918,
5083,
29892,
7145,
29918,
5083,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
8443,
13,
4706,
1583,
29889,
8865,
353,
302,
29876,
29889,
15063,
449,
29898,
29900,
29889,
29896,
8443,
13,
4706,
1583,
29889,
786,
29918,
19790,
353,
701,
29918,
19790,
30004,
13,
30004,
13,
4706,
714,
29918,
5083,
353,
302,
29918,
13203,
334,
701,
29918,
19790,
334,
701,
29918,
19790,
30004,
13,
4706,
565,
3479,
29901,
30004,
13,
9651,
1583,
29889,
20580,
29918,
449,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
18884,
1281,
29894,
29933,
29940,
1123,
29931,
29965,
29898,
6563,
29918,
5083,
29892,
701,
29918,
19790,
334,
701,
29918,
19790,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
511,
30004,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
786,
29918,
19790,
334,
701,
29918,
19790,
29892,
714,
29918,
5083,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
511,
30004,
13,
18884,
302,
29876,
29889,
29637,
2713,
21897,
29898,
786,
29918,
19790,
8443,
13,
9651,
1723,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
1583,
29889,
20580,
29918,
449,
353,
302,
29876,
29889,
16941,
2556,
29898,
30004,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
6563,
29918,
5083,
29892,
714,
29918,
5083,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
511,
30004,
13,
18884,
302,
29876,
29889,
29637,
2713,
21897,
29898,
786,
29918,
19790,
8443,
13,
9651,
1723,
30004,
13,
30004,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
30004,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29898,
29916,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
8865,
29898,
1725,
271,
8443,
13,
4706,
1238,
271,
353,
1583,
29889,
20580,
29918,
449,
29898,
1725,
271,
8443,
13,
4706,
736,
1238,
271,
30004,
13,
30004,
13,
29937,
565,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
30004,
13,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29941,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
8443,
13,
1678,
396,
9493,
353,
5953,
737,
29933,
4014,
26471,
13,
1678,
396,
1238,
271,
353,
9493,
29898,
29916,
8443,
13,
1678,
396,
1596,
877,
16432,
742,
1238,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
9493,
4842,
305,
29889,
3505,
4197,
29896,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
2314,
30004,
13,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29941,
29892,
29871,
29896,
29900,
29906,
29946,
29892,
29871,
29906,
29900,
29946,
29947,
8443,
13,
1678,
396,
20805,
353,
624,
331,
7445,
26471,
13,
1678,
396,
1238,
271,
353,
20805,
29898,
29916,
8443,
13,
1678,
396,
1596,
877,
303,
331,
742,
1238,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
8443,
13,
1678,
396,
274,
774,
353,
14645,
7445,
26471,
13,
1678,
396,
1238,
271,
353,
274,
774,
29898,
29916,
8443,
13,
1678,
396,
1596,
29898,
1725,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29941,
29906,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
8443,
13,
1678,
396,
1737,
29896,
353,
383,
1509,
9486,
13148,
29896,
29898,
29941,
29906,
29892,
29871,
29941,
29906,
8443,
13,
1678,
396,
1238,
271,
353,
1737,
29896,
29898,
29916,
8443,
13,
1678,
396,
1596,
29898,
1725,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29896,
29953,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
8443,
13,
1678,
396,
1737,
29906,
353,
383,
1509,
9486,
13148,
29906,
29898,
29896,
29953,
29892,
29871,
29941,
29906,
8443,
13,
1678,
396,
1238,
271,
353,
1737,
29906,
29898,
29916,
8443,
13,
1678,
396,
1596,
29898,
1725,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
30004,
13,
1678,
396,
2175,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
8443,
13,
1678,
396,
1492,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29946,
29892,
29871,
29947,
8443,
13,
1678,
396,
289,
3249,
353,
350,
29954,
1964,
2747,
26471,
13,
1678,
396,
1238,
271,
353,
289,
3249,
29898,
1563,
29892,
1492,
8443,
13,
1678,
396,
1596,
877,
29890,
3249,
742,
1238,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
289,
3249,
4842,
305,
29889,
3505,
4197,
29896,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
2314,
30004,
13,
30004,
13,
1678,
396,
29871,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
8443,
13,
1678,
396,
29871,
2343,
353,
6667,
358,
5494,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29929,
8443,
13,
1678,
396,
29871,
1480,
1169,
353,
2343,
29898,
29916,
8443,
13,
1678,
396,
29871,
1596,
29898,
1188,
1169,
29889,
2311,
3101,
30004,
13,
1678,
396,
30004,
13,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29941,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
8443,
13,
1678,
396,
10768,
353,
6667,
358,
29933,
4014,
26471,
13,
1678,
396,
1238,
271,
353,
10768,
29898,
29916,
9601,
29900,
29962,
30004,
13,
1678,
396,
1596,
877,
28192,
742,
1238,
271,
29889,
2311,
3101,
30004,
13,
1678,
396,
10768,
4842,
305,
29889,
3505,
4197,
29896,
29906,
29947,
29892,
29871,
29946,
29892,
29871,
29947,
2314,
30004,
13,
30004,
13,
1678,
396,
921,
353,
4842,
305,
29889,
9502,
29876,
29898,
29896,
29953,
29892,
29871,
29941,
29892,
29871,
29945,
29896,
29906,
29892,
29871,
29896,
29900,
29906,
29946,
8443,
13,
1678,
396,
1904,
353,
3457,
2008,
6779,
29963,
29906,
29898,
29876,
29918,
13203,
29922,
29896,
29929,
8443,
13,
1678,
396,
1480,
1169,
353,
1904,
29898,
29916,
9601,
29900,
29962,
30004,
13,
1678,
396,
1596,
29898,
1188,
1169,
29889,
2311,
3101,
30004,
13,
30004,
13,
1678,
396,
1904,
353,
3457,
2008,
6779,
29963,
29906,
29898,
29876,
29918,
13203,
29922,
29906,
8443,
13,
1678,
396,
363,
1024,
29892,
1828,
297,
1904,
29889,
17514,
29918,
16744,
7295,
30004,
13,
1678,
396,
268,
565,
7431,
29898,
3207,
29889,
2311,
3101,
1275,
29871,
29896,
29901,
30004,
13,
1678,
396,
308,
396,
2158,
29898,
978,
8443,
13,
1678,
396,
308,
1596,
29898,
978,
29892,
525,
29901,
742,
1828,
29889,
2311,
3101,
30004,
13,
30004,
13,
2
] |
crf.py | ottokart/sequence-labeler | 10 | 55534 | import theano
import numpy
# CRF implementation based on Lample et al.
# "Neural Architectures for Named Entity Recognition"
floatX=theano.config.floatX
def log_sum(x, axis=None):
x_max_value = x.max(axis=axis)
x_max_tensor = x.max(axis=axis, keepdims=True)
return x_max_value + theano.tensor.log(theano.tensor.exp(x - x_max_tensor).sum(axis=axis))
def forward(observation_weights, transition_weights, return_best_sequence=False):
def recurrence(observation_weights, previous_scores, transition_weights):
previous_scores = previous_scores.dimshuffle(0, 1, 'x')
observation_weights = observation_weights.dimshuffle(0, 'x', 1)
scores = previous_scores + observation_weights + transition_weights.dimshuffle('x', 0, 1)
if return_best_sequence:
best_scores = scores.max(axis=1)
best_states = scores.argmax(axis=1)
return best_scores, best_states
else:
return log_sum(scores, axis=1)
initial = observation_weights[0]
crf_states, _ = theano.scan(
fn=recurrence,
outputs_info=(initial, None) if return_best_sequence else initial,
sequences=[observation_weights[1:],],
non_sequences=transition_weights
)
if return_best_sequence:
sequence, _ = theano.scan(
fn=lambda beta_i, previous: beta_i[theano.tensor.arange(previous.shape[0]), previous],
outputs_info=theano.tensor.cast(theano.tensor.argmax(crf_states[0][-1], axis=1), 'int32'),
sequences=theano.tensor.cast(crf_states[1][::-1], 'int32')
)
sequence = theano.tensor.concatenate([sequence[::-1], [theano.tensor.argmax(crf_states[0][-1], axis=1)]])
return sequence, crf_states[0]
else:
return log_sum(crf_states[-1], axis=1)
def construct(name, input_tensor, n_labels, gold_labels, fn_create_parameter_matrix):
transition_weights = fn_create_parameter_matrix(name + "_crf_transition_weights", (n_labels + 2, n_labels + 2))
small = -1000.0
padding_start = theano.tensor.zeros((input_tensor.shape[0], 1, n_labels + 2)) + small
padding_start = theano.tensor.set_subtensor(padding_start[:,:,-2], 0.0)
padding_end = theano.tensor.zeros((input_tensor.shape[0], 1, n_labels + 2)) + small
padding_end = theano.tensor.set_subtensor(padding_end[:,:,-1], 0.0)
observation_weights = theano.tensor.concatenate([input_tensor, theano.tensor.zeros((input_tensor.shape[0], input_tensor.shape[1], 2)) + small], axis=2)
observation_weights = theano.tensor.concatenate([padding_start, observation_weights, padding_end], axis=1)
observation_weights = observation_weights.dimshuffle(1,0,2) # reordering the tensor (words, sentences, labels)
# Score from tags
real_paths_scores = input_tensor[theano.tensor.arange(input_tensor.shape[0])[:, numpy.newaxis], theano.tensor.arange(input_tensor.shape[1]), gold_labels].sum(axis=1)
# Score from transition_weights
padding_id_start = theano.tensor.zeros((gold_labels.shape[0], 1), dtype=numpy.int32) + n_labels
padding_id_end = theano.tensor.zeros((gold_labels.shape[0], 1), dtype=numpy.int32) + n_labels + 1
padded_gold_labels = theano.tensor.concatenate([padding_id_start, gold_labels, padding_id_end], axis=1)
real_paths_scores += transition_weights[
padded_gold_labels[theano.tensor.arange(gold_labels.shape[0])[:, numpy.newaxis], theano.tensor.arange(gold_labels.shape[1] + 1)],
padded_gold_labels[theano.tensor.arange(gold_labels.shape[0])[:, numpy.newaxis], theano.tensor.arange(gold_labels.shape[1] + 1) + 1]
].sum(axis=1)
all_paths_scores = forward(observation_weights, transition_weights)
best_sequence, scores = forward(observation_weights, transition_weights, return_best_sequence=True)
scores = scores.dimshuffle(1,0,2)[:,:-1,:-2]
best_sequence = best_sequence.dimshuffle(1,0)[:,1:-1]
return all_paths_scores, real_paths_scores, best_sequence, scores
| [
1,
1053,
278,
1562,
13,
5215,
12655,
13,
13,
29937,
15600,
29943,
5314,
2729,
373,
365,
981,
634,
394,
29889,
13,
29937,
376,
8139,
3631,
2595,
4496,
1973,
363,
405,
2795,
14945,
3599,
3811,
654,
29908,
13,
13,
7411,
29990,
29922,
1552,
1562,
29889,
2917,
29889,
7411,
29990,
13,
13,
1753,
1480,
29918,
2083,
29898,
29916,
29892,
9685,
29922,
8516,
1125,
13,
1678,
921,
29918,
3317,
29918,
1767,
353,
921,
29889,
3317,
29898,
8990,
29922,
8990,
29897,
13,
1678,
921,
29918,
3317,
29918,
20158,
353,
921,
29889,
3317,
29898,
8990,
29922,
8990,
29892,
3013,
6229,
29879,
29922,
5574,
29897,
13,
1678,
736,
921,
29918,
3317,
29918,
1767,
718,
278,
1562,
29889,
20158,
29889,
1188,
29898,
1552,
1562,
29889,
20158,
29889,
4548,
29898,
29916,
448,
921,
29918,
3317,
29918,
20158,
467,
2083,
29898,
8990,
29922,
8990,
876,
13,
13,
13,
1753,
6375,
29898,
26739,
362,
29918,
705,
5861,
29892,
9558,
29918,
705,
5861,
29892,
736,
29918,
13318,
29918,
16506,
29922,
8824,
1125,
13,
1678,
822,
1162,
26841,
29898,
26739,
362,
29918,
705,
5861,
29892,
3517,
29918,
1557,
2361,
29892,
9558,
29918,
705,
5861,
1125,
13,
4706,
3517,
29918,
1557,
2361,
353,
3517,
29918,
1557,
2361,
29889,
6229,
845,
21897,
29898,
29900,
29892,
29871,
29896,
29892,
525,
29916,
1495,
13,
4706,
15500,
29918,
705,
5861,
353,
15500,
29918,
705,
5861,
29889,
6229,
845,
21897,
29898,
29900,
29892,
525,
29916,
742,
29871,
29896,
29897,
13,
4706,
19435,
353,
3517,
29918,
1557,
2361,
718,
15500,
29918,
705,
5861,
718,
9558,
29918,
705,
5861,
29889,
6229,
845,
21897,
877,
29916,
742,
29871,
29900,
29892,
29871,
29896,
29897,
13,
4706,
565,
736,
29918,
13318,
29918,
16506,
29901,
13,
9651,
1900,
29918,
1557,
2361,
353,
19435,
29889,
3317,
29898,
8990,
29922,
29896,
29897,
13,
9651,
1900,
29918,
28631,
353,
19435,
29889,
1191,
3317,
29898,
8990,
29922,
29896,
29897,
13,
9651,
736,
1900,
29918,
1557,
2361,
29892,
1900,
29918,
28631,
13,
4706,
1683,
29901,
13,
9651,
736,
1480,
29918,
2083,
29898,
1557,
2361,
29892,
9685,
29922,
29896,
29897,
13,
13,
1678,
2847,
353,
15500,
29918,
705,
5861,
29961,
29900,
29962,
13,
1678,
2181,
29888,
29918,
28631,
29892,
903,
353,
278,
1562,
29889,
16192,
29898,
13,
4706,
7876,
29922,
3757,
26841,
29892,
13,
4706,
14391,
29918,
3888,
7607,
11228,
29892,
6213,
29897,
565,
736,
29918,
13318,
29918,
16506,
1683,
2847,
29892,
13,
4706,
15602,
11759,
26739,
362,
29918,
705,
5861,
29961,
29896,
29901,
1402,
1402,
13,
4706,
1661,
29918,
6831,
2063,
29922,
20543,
29918,
705,
5861,
13,
1678,
1723,
13,
13,
1678,
565,
736,
29918,
13318,
29918,
16506,
29901,
13,
4706,
5665,
29892,
903,
353,
278,
1562,
29889,
16192,
29898,
13,
9651,
7876,
29922,
2892,
21762,
29918,
29875,
29892,
3517,
29901,
21762,
29918,
29875,
29961,
1552,
1562,
29889,
20158,
29889,
279,
927,
29898,
24957,
29889,
12181,
29961,
29900,
11724,
3517,
1402,
13,
9651,
14391,
29918,
3888,
29922,
1552,
1562,
29889,
20158,
29889,
4384,
29898,
1552,
1562,
29889,
20158,
29889,
1191,
3317,
29898,
7283,
29888,
29918,
28631,
29961,
29900,
3816,
29899,
29896,
1402,
9685,
29922,
29896,
511,
525,
524,
29941,
29906,
5477,
13,
9651,
15602,
29922,
1552,
1562,
29889,
20158,
29889,
4384,
29898,
7283,
29888,
29918,
28631,
29961,
29896,
3816,
1057,
29899,
29896,
1402,
525,
524,
29941,
29906,
1495,
13,
4706,
1723,
13,
4706,
5665,
353,
278,
1562,
29889,
20158,
29889,
535,
29883,
2579,
403,
4197,
16506,
29961,
1057,
29899,
29896,
1402,
518,
1552,
1562,
29889,
20158,
29889,
1191,
3317,
29898,
7283,
29888,
29918,
28631,
29961,
29900,
3816,
29899,
29896,
1402,
9685,
29922,
29896,
4638,
2314,
13,
4706,
736,
5665,
29892,
2181,
29888,
29918,
28631,
29961,
29900,
29962,
13,
1678,
1683,
29901,
13,
4706,
736,
1480,
29918,
2083,
29898,
7283,
29888,
29918,
28631,
14352,
29896,
1402,
9685,
29922,
29896,
29897,
13,
13,
13,
1753,
3386,
29898,
978,
29892,
1881,
29918,
20158,
29892,
302,
29918,
21134,
29892,
7684,
29918,
21134,
29892,
7876,
29918,
3258,
29918,
15501,
29918,
5344,
1125,
13,
1678,
9558,
29918,
705,
5861,
353,
7876,
29918,
3258,
29918,
15501,
29918,
5344,
29898,
978,
718,
11119,
7283,
29888,
29918,
20543,
29918,
705,
5861,
613,
313,
29876,
29918,
21134,
718,
29871,
29906,
29892,
302,
29918,
21134,
718,
29871,
29906,
876,
13,
13,
1678,
2319,
353,
448,
29896,
29900,
29900,
29900,
29889,
29900,
13,
1678,
7164,
29918,
2962,
353,
278,
1562,
29889,
20158,
29889,
3298,
359,
3552,
2080,
29918,
20158,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
29892,
302,
29918,
21134,
718,
29871,
29906,
876,
718,
2319,
13,
1678,
7164,
29918,
2962,
353,
278,
1562,
29889,
20158,
29889,
842,
29918,
1491,
20158,
29898,
12791,
29918,
2962,
7503,
29892,
29901,
6653,
29906,
1402,
29871,
29900,
29889,
29900,
29897,
13,
1678,
7164,
29918,
355,
353,
278,
1562,
29889,
20158,
29889,
3298,
359,
3552,
2080,
29918,
20158,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
29892,
302,
29918,
21134,
718,
29871,
29906,
876,
718,
2319,
13,
1678,
7164,
29918,
355,
353,
278,
1562,
29889,
20158,
29889,
842,
29918,
1491,
20158,
29898,
12791,
29918,
355,
7503,
29892,
29901,
6653,
29896,
1402,
29871,
29900,
29889,
29900,
29897,
13,
1678,
15500,
29918,
705,
5861,
353,
278,
1562,
29889,
20158,
29889,
535,
29883,
2579,
403,
4197,
2080,
29918,
20158,
29892,
278,
1562,
29889,
20158,
29889,
3298,
359,
3552,
2080,
29918,
20158,
29889,
12181,
29961,
29900,
1402,
1881,
29918,
20158,
29889,
12181,
29961,
29896,
1402,
29871,
29906,
876,
718,
2319,
1402,
9685,
29922,
29906,
29897,
13,
1678,
15500,
29918,
705,
5861,
353,
278,
1562,
29889,
20158,
29889,
535,
29883,
2579,
403,
4197,
12791,
29918,
2962,
29892,
15500,
29918,
705,
5861,
29892,
7164,
29918,
355,
1402,
9685,
29922,
29896,
29897,
13,
1678,
15500,
29918,
705,
5861,
353,
15500,
29918,
705,
5861,
29889,
6229,
845,
21897,
29898,
29896,
29892,
29900,
29892,
29906,
29897,
396,
337,
2098,
292,
278,
12489,
313,
9303,
29892,
25260,
29892,
11073,
29897,
13,
13,
1678,
396,
2522,
487,
515,
8282,
13,
1678,
1855,
29918,
24772,
29918,
1557,
2361,
353,
1881,
29918,
20158,
29961,
1552,
1562,
29889,
20158,
29889,
279,
927,
29898,
2080,
29918,
20158,
29889,
12181,
29961,
29900,
2314,
7503,
29892,
12655,
29889,
1482,
8990,
1402,
278,
1562,
29889,
20158,
29889,
279,
927,
29898,
2080,
29918,
20158,
29889,
12181,
29961,
29896,
11724,
7684,
29918,
21134,
1822,
2083,
29898,
8990,
29922,
29896,
29897,
13,
13,
1678,
396,
2522,
487,
515,
9558,
29918,
705,
5861,
13,
1678,
7164,
29918,
333,
29918,
2962,
353,
278,
1562,
29889,
20158,
29889,
3298,
359,
3552,
29887,
1025,
29918,
21134,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
511,
26688,
29922,
23749,
29889,
524,
29941,
29906,
29897,
718,
302,
29918,
21134,
13,
1678,
7164,
29918,
333,
29918,
355,
353,
278,
1562,
29889,
20158,
29889,
3298,
359,
3552,
29887,
1025,
29918,
21134,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
511,
26688,
29922,
23749,
29889,
524,
29941,
29906,
29897,
718,
302,
29918,
21134,
718,
29871,
29896,
13,
1678,
282,
23959,
29918,
29887,
1025,
29918,
21134,
353,
278,
1562,
29889,
20158,
29889,
535,
29883,
2579,
403,
4197,
12791,
29918,
333,
29918,
2962,
29892,
7684,
29918,
21134,
29892,
7164,
29918,
333,
29918,
355,
1402,
9685,
29922,
29896,
29897,
13,
1678,
1855,
29918,
24772,
29918,
1557,
2361,
4619,
9558,
29918,
705,
5861,
29961,
13,
4706,
282,
23959,
29918,
29887,
1025,
29918,
21134,
29961,
1552,
1562,
29889,
20158,
29889,
279,
927,
29898,
29887,
1025,
29918,
21134,
29889,
12181,
29961,
29900,
2314,
7503,
29892,
12655,
29889,
1482,
8990,
1402,
278,
1562,
29889,
20158,
29889,
279,
927,
29898,
29887,
1025,
29918,
21134,
29889,
12181,
29961,
29896,
29962,
718,
29871,
29896,
29897,
1402,
13,
4706,
282,
23959,
29918,
29887,
1025,
29918,
21134,
29961,
1552,
1562,
29889,
20158,
29889,
279,
927,
29898,
29887,
1025,
29918,
21134,
29889,
12181,
29961,
29900,
2314,
7503,
29892,
12655,
29889,
1482,
8990,
1402,
278,
1562,
29889,
20158,
29889,
279,
927,
29898,
29887,
1025,
29918,
21134,
29889,
12181,
29961,
29896,
29962,
718,
29871,
29896,
29897,
718,
29871,
29896,
29962,
13,
268,
1822,
2083,
29898,
8990,
29922,
29896,
29897,
13,
13,
1678,
599,
29918,
24772,
29918,
1557,
2361,
353,
6375,
29898,
26739,
362,
29918,
705,
5861,
29892,
9558,
29918,
705,
5861,
29897,
13,
13,
1678,
1900,
29918,
16506,
29892,
19435,
353,
6375,
29898,
26739,
362,
29918,
705,
5861,
29892,
9558,
29918,
705,
5861,
29892,
736,
29918,
13318,
29918,
16506,
29922,
5574,
29897,
13,
13,
1678,
19435,
353,
19435,
29889,
6229,
845,
21897,
29898,
29896,
29892,
29900,
29892,
29906,
29897,
7503,
29892,
13018,
29896,
29892,
13018,
29906,
29962,
13,
1678,
1900,
29918,
16506,
353,
1900,
29918,
16506,
29889,
6229,
845,
21897,
29898,
29896,
29892,
29900,
29897,
7503,
29892,
29896,
13018,
29896,
29962,
13,
13,
1678,
736,
599,
29918,
24772,
29918,
1557,
2361,
29892,
1855,
29918,
24772,
29918,
1557,
2361,
29892,
1900,
29918,
16506,
29892,
19435,
13,
13,
2
] |
OpenCV/5.1.py | Nivedya-27/Autumn-of-Automation | 0 | 151915 | import cv2
import numpy as np
from imutils.video import FileVideoStream
import imutils
import time
vs = FileVideoStream('messi.webm').start()
while vs.more():
frame=vs.read()
if frame is None:
continue
output=frame.copy()
gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
gray=cv2.medianBlur(gray,5)
gray=cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,cv2.THRESH_BINARY,3,5)
kernel=np.ones((3,3),np.uint8)
gray=cv2.erode(gray,kernel,iterations=1)
gray=cv2.dilate(gray,kernel,iterations=1)
circles=cv2.HoughCircles(gray,cv2.HOUGH_GRADIENT,1,260,param1=30,param2=65,minRadius=0)
radii=[]
if circles is None:
continue
circles=np.uint16(np.around(circles))
for i in range(circles.shape[0]):
radii.append(circles[i][0][2])
R=max(radii)
X=None
Y=None
for i in range(circles.shape[0]):
if circles[i][0][2]==R:
X=circles[i][0][0]
Y=circles[i][0][1]
break
cv2.circle(output,(X,Y),R,(0,255,0),4)
cv2.imshow('result',output)
cv2.waitKey(1)
cv2.destroyAllWindows()
vs.stop() | [
1,
1053,
13850,
29906,
13,
5215,
12655,
408,
7442,
13,
3166,
527,
13239,
29889,
9641,
1053,
3497,
15167,
3835,
13,
5215,
527,
13239,
13,
5215,
931,
13,
4270,
353,
3497,
15167,
3835,
877,
12062,
29875,
29889,
2676,
29885,
2824,
2962,
580,
13,
8000,
7186,
29889,
5514,
7295,
13,
12,
2557,
29922,
4270,
29889,
949,
580,
13,
12,
361,
3515,
338,
6213,
29901,
13,
12,
12,
19878,
13,
12,
4905,
29922,
2557,
29889,
8552,
580,
13,
12,
21012,
29922,
11023,
29906,
29889,
11023,
29873,
3306,
29898,
2557,
29892,
11023,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
29897,
13,
12,
21012,
29922,
11023,
29906,
29889,
2168,
713,
10358,
332,
29898,
21012,
29892,
29945,
29897,
13,
12,
21012,
29922,
11023,
29906,
29889,
1114,
415,
573,
1349,
12268,
29898,
21012,
29892,
29906,
29945,
29945,
29892,
11023,
29906,
29889,
3035,
3301,
29911,
18474,
29918,
4690,
1525,
7068,
29918,
12739,
29965,
1799,
29902,
2190,
29918,
29907,
29892,
11023,
29906,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
29892,
29941,
29892,
29945,
29897,
13,
12,
17460,
29922,
9302,
29889,
2873,
3552,
29941,
29892,
29941,
511,
9302,
29889,
13470,
29947,
29897,
13,
12,
21012,
29922,
11023,
29906,
29889,
261,
356,
29898,
21012,
29892,
17460,
29892,
1524,
800,
29922,
29896,
29897,
13,
12,
21012,
29922,
11023,
29906,
29889,
29881,
309,
403,
29898,
21012,
29892,
17460,
29892,
1524,
800,
29922,
29896,
29897,
13,
12,
19052,
7799,
29922,
11023,
29906,
29889,
29950,
820,
29907,
381,
7799,
29898,
21012,
29892,
11023,
29906,
29889,
8187,
23338,
29950,
29918,
14345,
3035,
29902,
3919,
29892,
29896,
29892,
29906,
29953,
29900,
29892,
3207,
29896,
29922,
29941,
29900,
29892,
3207,
29906,
29922,
29953,
29945,
29892,
1195,
20494,
29922,
29900,
29897,
13,
12,
3665,
2236,
29922,
2636,
13,
12,
361,
22558,
338,
6213,
29901,
13,
12,
12,
19878,
13,
12,
19052,
7799,
29922,
9302,
29889,
13470,
29896,
29953,
29898,
9302,
29889,
11316,
29898,
19052,
7799,
876,
13,
12,
1454,
474,
297,
3464,
29898,
19052,
7799,
29889,
12181,
29961,
29900,
29962,
1125,
13,
12,
12,
3665,
2236,
29889,
4397,
29898,
19052,
7799,
29961,
29875,
3816,
29900,
3816,
29906,
2314,
13,
12,
29934,
29922,
3317,
29898,
3665,
2236,
29897,
13,
12,
29990,
29922,
8516,
13,
12,
29979,
29922,
8516,
13,
12,
1454,
474,
297,
3464,
29898,
19052,
7799,
29889,
12181,
29961,
29900,
29962,
1125,
13,
12,
12,
361,
22558,
29961,
29875,
3816,
29900,
3816,
29906,
29962,
1360,
29934,
29901,
13,
12,
12,
12,
29990,
29922,
19052,
7799,
29961,
29875,
3816,
29900,
3816,
29900,
29962,
13,
12,
12,
12,
29979,
29922,
19052,
7799,
29961,
29875,
3816,
29900,
3816,
29896,
29962,
13,
12,
12,
12,
8690,
13,
12,
11023,
29906,
29889,
16622,
29898,
4905,
22657,
29990,
29892,
29979,
511,
29934,
22657,
29900,
29892,
29906,
29945,
29945,
29892,
29900,
511,
29946,
29897,
13,
12,
11023,
29906,
29889,
326,
4294,
877,
2914,
742,
4905,
29897,
13,
12,
11023,
29906,
29889,
10685,
2558,
29898,
29896,
29897,
13,
11023,
29906,
29889,
20524,
3596,
7685,
580,
13,
4270,
29889,
9847,
580,
2
] |
wacky_rl/layers/__init__.py | maik97/wacky-rl | 0 | 102265 | <reponame>maik97/wacky-rl<filename>wacky_rl/layers/__init__.py
#from wacky_rl.layers.actor_layer import DiscreteActionLayer
#from wacky_rl.layers.actor_layer import ContinActionLayer
from wacky_rl.layers.contin_actor_layer import ContinActionLayer
from wacky_rl.layers.discrete_actor_layer import DiscreteActionLayer
from wacky_rl.layers.recurrent_encoder import RecurrentEncoder
| [
1,
529,
276,
1112,
420,
29958,
655,
638,
29929,
29955,
29914,
29893,
547,
29891,
29899,
2096,
29966,
9507,
29958,
29893,
547,
29891,
29918,
2096,
29914,
29277,
29914,
1649,
2344,
26914,
2272,
13,
29937,
3166,
281,
547,
29891,
29918,
2096,
29889,
29277,
29889,
7168,
29918,
13148,
1053,
3295,
9084,
4276,
14420,
13,
29937,
3166,
281,
547,
29891,
29918,
2096,
29889,
29277,
29889,
7168,
29918,
13148,
1053,
2866,
262,
4276,
14420,
13,
13,
3166,
281,
547,
29891,
29918,
2096,
29889,
29277,
29889,
1285,
262,
29918,
7168,
29918,
13148,
1053,
2866,
262,
4276,
14420,
13,
3166,
281,
547,
29891,
29918,
2096,
29889,
29277,
29889,
2218,
9084,
29918,
7168,
29918,
13148,
1053,
3295,
9084,
4276,
14420,
13,
3166,
281,
547,
29891,
29918,
2096,
29889,
29277,
29889,
3757,
1264,
29918,
3977,
6119,
1053,
3599,
1264,
8566,
6119,
13,
2
] |
awwards/urls.py | cossie14/slyawwards | 0 | 15978 |
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import include,url
from . import views
urlpatterns=[
url(r'api/user/user-id/(?P<pk>[0-9]+)/$',
views.UserDescription.as_view()),
url(r'api/project/project-id/(?P<pk>[0-9]+)/$',
views.ProjectDescription.as_view()),
url(r'^profile/',views.profile,name='profile'),
url('^$',views.index,name ='index'),
url(r'^search/', views.search_results, name='search_results'),
url(r'^user/',views.user,name ='user'),
url(r'^tinymce/', include('tinymce.urls')),
url(r'^api/profile/', views.UserList.as_view()),
url(r'^api/project/', views.ProjectList.as_view()),
url(r'^project/',views.new_project,name ='newproject'),
url(r'^ajax/newsletter/$', views.newsletter, name='newsletter')
]
if settings.DEBUG:
urlpatterns+= static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
| [
1,
1678,
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,
3160,
29892,
2271,
13,
3166,
869,
1053,
8386,
13,
13,
2271,
11037,
29879,
11759,
13,
1678,
3142,
29898,
29878,
29915,
2754,
29914,
1792,
29914,
1792,
29899,
333,
29914,
10780,
29925,
29966,
20571,
24566,
29900,
29899,
29929,
10062,
6802,
29938,
742,
13,
4706,
8386,
29889,
2659,
9868,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
2754,
29914,
4836,
29914,
4836,
29899,
333,
29914,
10780,
29925,
29966,
20571,
24566,
29900,
29899,
29929,
10062,
6802,
29938,
742,
13,
4706,
8386,
29889,
7653,
9868,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
10185,
29914,
742,
7406,
29889,
10185,
29892,
978,
2433,
10185,
5477,
13,
1678,
3142,
877,
29985,
29938,
742,
7406,
29889,
2248,
29892,
978,
353,
29915,
2248,
5477,
13,
1678,
3142,
29898,
29878,
29915,
29985,
4478,
29914,
742,
8386,
29889,
4478,
29918,
9902,
29892,
1024,
2433,
4478,
29918,
9902,
5477,
13,
1678,
3142,
29898,
29878,
29915,
29985,
1792,
29914,
742,
7406,
29889,
1792,
29892,
978,
353,
29915,
1792,
5477,
13,
1678,
3142,
29898,
29878,
29915,
29985,
29873,
262,
962,
346,
29914,
742,
3160,
877,
29873,
262,
962,
346,
29889,
26045,
1495,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
2754,
29914,
10185,
29914,
742,
8386,
29889,
2659,
1293,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
2754,
29914,
4836,
29914,
742,
8386,
29889,
7653,
1293,
29889,
294,
29918,
1493,
25739,
13,
13,
1678,
3142,
29898,
29878,
29915,
29985,
4836,
29914,
742,
7406,
29889,
1482,
29918,
4836,
29892,
978,
353,
29915,
1482,
4836,
5477,
13,
1678,
3142,
29898,
29878,
29915,
29985,
6538,
29914,
15753,
15670,
13346,
742,
8386,
29889,
15753,
15670,
29892,
1024,
2433,
15753,
15670,
1495,
13,
29962,
13,
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,
13,
268,
13,
2
] |
day8/test_day8.py | bwbeach/advent-of-code-2020 | 0 | 12621 | <filename>day8/test_day8.py
from day8.day8 import fix_code, parse_code, run
SAMPLE_CODE_LOOP = """nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
"""
SAMPLE_CODE_HALT = """nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
nop -4
acc +6
"""
def test_parse():
assert parse_code("nop +0\nacc +1\nacc -6") == [("nop", 0), ("acc", 1), ("acc", -6)]
def test_run_loop():
code = parse_code(SAMPLE_CODE_LOOP)
assert run(code) == ("loop", 5)
def test_run_halt():
code = parse_code(SAMPLE_CODE_HALT)
assert run(code) == ("halt", 8)
def test_fix_code():
assert fix_code(parse_code(SAMPLE_CODE_LOOP)) == parse_code(SAMPLE_CODE_HALT)
| [
1,
529,
9507,
29958,
3250,
29947,
29914,
1688,
29918,
3250,
29947,
29889,
2272,
13,
3166,
2462,
29947,
29889,
3250,
29947,
1053,
2329,
29918,
401,
29892,
6088,
29918,
401,
29892,
1065,
13,
13,
8132,
3580,
1307,
29918,
16524,
29918,
3927,
4590,
353,
9995,
29876,
459,
718,
29900,
13,
5753,
718,
29896,
13,
29926,
1526,
718,
29946,
13,
5753,
718,
29941,
13,
29926,
1526,
448,
29941,
13,
5753,
448,
29929,
29929,
13,
5753,
718,
29896,
13,
29926,
1526,
448,
29946,
13,
5753,
718,
29953,
13,
15945,
29908,
13,
13,
8132,
3580,
1307,
29918,
16524,
29918,
29950,
1964,
29911,
353,
9995,
29876,
459,
718,
29900,
13,
5753,
718,
29896,
13,
29926,
1526,
718,
29946,
13,
5753,
718,
29941,
13,
29926,
1526,
448,
29941,
13,
5753,
448,
29929,
29929,
13,
5753,
718,
29896,
13,
29876,
459,
448,
29946,
13,
5753,
718,
29953,
13,
15945,
29908,
13,
13,
13,
1753,
1243,
29918,
5510,
7295,
13,
1678,
4974,
6088,
29918,
401,
703,
29876,
459,
718,
29900,
29905,
29876,
5753,
718,
29896,
29905,
29876,
5753,
448,
29953,
1159,
1275,
518,
703,
29876,
459,
613,
29871,
29900,
511,
4852,
5753,
613,
29871,
29896,
511,
4852,
5753,
613,
448,
29953,
4638,
13,
13,
13,
1753,
1243,
29918,
3389,
29918,
7888,
7295,
13,
1678,
775,
353,
6088,
29918,
401,
29898,
8132,
3580,
1307,
29918,
16524,
29918,
3927,
4590,
29897,
13,
1678,
4974,
1065,
29898,
401,
29897,
1275,
4852,
7888,
613,
29871,
29945,
29897,
13,
13,
13,
1753,
1243,
29918,
3389,
29918,
10647,
7295,
13,
1678,
775,
353,
6088,
29918,
401,
29898,
8132,
3580,
1307,
29918,
16524,
29918,
29950,
1964,
29911,
29897,
13,
1678,
4974,
1065,
29898,
401,
29897,
1275,
4852,
10647,
613,
29871,
29947,
29897,
13,
13,
13,
1753,
1243,
29918,
5878,
29918,
401,
7295,
13,
1678,
4974,
2329,
29918,
401,
29898,
5510,
29918,
401,
29898,
8132,
3580,
1307,
29918,
16524,
29918,
3927,
4590,
876,
1275,
6088,
29918,
401,
29898,
8132,
3580,
1307,
29918,
16524,
29918,
29950,
1964,
29911,
29897,
13,
2
] |
metrics/metric_factory/sc2reader_factory.py | matthewj8489/Starcraft2Metrics | 4 | 179536 | <filename>metrics/metric_factory/sc2reader_factory.py
import sc2reader
from metrics.metric_containers import *
from metrics.util import convert_to_realtime_r
class Sc2ReaderFactory(object):
def __init__(self, file_path):
self._replay = sc2reader.load_replay(file_path)
def generateResourcesTracked(self, player_name):
res = []
for plyr in self._replay.players:
if plyr.name == player_name:
plyr_stats_events = list(filter(lambda evts: evts.name == 'PlayerStatsEvent', plyr.events))
for evt in plyr_stats_events:
res.append(ResourceCount(convert_to_realtime_r(self._replay, evt.second),
(evt.minerals_collection_rate + evt.vespene_collection_rate),
(evt.minerals_current + evt.vespene_current)))
break
return res
| [
1,
529,
9507,
29958,
2527,
10817,
29914,
16414,
29918,
14399,
29914,
1557,
29906,
16950,
29918,
14399,
29889,
2272,
13,
5215,
885,
29906,
16950,
30004,
13,
30004,
13,
3166,
21556,
29889,
16414,
29918,
1285,
475,
414,
1053,
334,
30004,
13,
3166,
21556,
29889,
4422,
1053,
3588,
29918,
517,
29918,
276,
1997,
603,
29918,
29878,
30004,
13,
30004,
13,
1990,
2522,
29906,
6982,
5126,
29898,
3318,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
934,
29918,
2084,
1125,
30004,
13,
4706,
1583,
3032,
276,
1456,
353,
885,
29906,
16950,
29889,
1359,
29918,
276,
1456,
29898,
1445,
29918,
2084,
8443,
13,
30004,
13,
1678,
822,
5706,
13770,
17936,
287,
29898,
1311,
29892,
4847,
29918,
978,
1125,
30004,
13,
4706,
620,
353,
5159,
30004,
13,
4706,
6756,
13,
4706,
363,
282,
368,
29878,
297,
1583,
3032,
276,
1456,
29889,
1456,
414,
29901,
30004,
13,
9651,
565,
282,
368,
29878,
29889,
978,
1275,
4847,
29918,
978,
29901,
30004,
13,
18884,
282,
368,
29878,
29918,
16202,
29918,
13604,
353,
1051,
29898,
4572,
29898,
2892,
3415,
1372,
29901,
3415,
1372,
29889,
978,
1275,
525,
9075,
25060,
2624,
742,
282,
368,
29878,
29889,
13604,
876,
30004,
13,
18884,
363,
3415,
29873,
297,
282,
368,
29878,
29918,
16202,
29918,
13604,
29901,
30004,
13,
462,
1678,
620,
29889,
4397,
29898,
6848,
3981,
29898,
13441,
29918,
517,
29918,
276,
1997,
603,
29918,
29878,
29898,
1311,
3032,
276,
1456,
29892,
3415,
29873,
29889,
7496,
511,
30004,
13,
462,
462,
632,
313,
5750,
29873,
29889,
1195,
261,
1338,
29918,
10855,
29918,
10492,
718,
3415,
29873,
29889,
1960,
29886,
1600,
29918,
10855,
29918,
10492,
511,
30004,
13,
462,
462,
632,
313,
5750,
29873,
29889,
1195,
261,
1338,
29918,
3784,
718,
3415,
29873,
29889,
1960,
29886,
1600,
29918,
3784,
4961,
30004,
13,
18884,
2867,
30004,
13,
30004,
13,
4706,
736,
620,
30004,
13,
2
] |
core/tests/test_models.py | UlmBlois/website | 0 | 44869 | from django.test import TestCase
# from django.db.utils import IntegrityError
from core.models import User
class CaseInsensitiveUserNameManagerTest(TestCase):
@classmethod
def setUpTestData(cls):
cls.user1 = User.objects.create_user(username="user1",
password="<PASSWORD>",
email="<EMAIL>")
def test_get_by_natural_key(self):
user = User.objects.get_by_natural_key('user1')
self.assertEqual(user.username, 'user1')
user = User.objects.get_by_natural_key('uSEr1')
self.assertEqual(user.username, 'user1')
def test_create_user_username(self):
with self.assertRaises(ValueError):
User.objects.create_user(username="user1",
password="<PASSWORD>",
email="<EMAIL>")
with self.assertRaises(ValueError):
User.objects.create_user(username="usER1",
password="<PASSWORD>",
email="<EMAIL>")
def test_create_user_email(self):
with self.assertRaises(ValueError):
User.objects.create_user(username="user2",
password="<PASSWORD>",
email="")
with self.assertRaises(ValueError):
User.objects.create_user(username="user2",
password="<PASSWORD>",
email="<EMAIL>")
| [
1,
515,
9557,
29889,
1688,
1053,
4321,
8259,
13,
29937,
515,
9557,
29889,
2585,
29889,
13239,
1053,
17100,
537,
2392,
13,
13,
3166,
7136,
29889,
9794,
1053,
4911,
13,
13,
13,
1990,
11733,
797,
23149,
3321,
28129,
3260,
3057,
29898,
3057,
8259,
1125,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
731,
3373,
3057,
1469,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
1792,
29896,
353,
4911,
29889,
12650,
29889,
3258,
29918,
1792,
29898,
6786,
543,
1792,
29896,
613,
13,
462,
462,
632,
4800,
543,
29966,
25711,
17013,
28341,
13,
462,
462,
632,
4876,
543,
29966,
26862,
6227,
29958,
1159,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
1609,
29918,
25047,
29918,
1989,
29898,
1311,
1125,
13,
4706,
1404,
353,
4911,
29889,
12650,
29889,
657,
29918,
1609,
29918,
25047,
29918,
1989,
877,
1792,
29896,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1792,
29889,
6786,
29892,
525,
1792,
29896,
1495,
13,
4706,
1404,
353,
4911,
29889,
12650,
29889,
657,
29918,
1609,
29918,
25047,
29918,
1989,
877,
29884,
1660,
29878,
29896,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1792,
29889,
6786,
29892,
525,
1792,
29896,
1495,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
1792,
29918,
6786,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
1125,
13,
9651,
4911,
29889,
12650,
29889,
3258,
29918,
1792,
29898,
6786,
543,
1792,
29896,
613,
13,
462,
462,
268,
4800,
543,
29966,
25711,
17013,
28341,
13,
462,
462,
268,
4876,
543,
29966,
26862,
6227,
29958,
1159,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
1125,
13,
9651,
4911,
29889,
12650,
29889,
3258,
29918,
1792,
29898,
6786,
543,
375,
1001,
29896,
613,
13,
462,
462,
268,
4800,
543,
29966,
25711,
17013,
28341,
13,
462,
462,
268,
4876,
543,
29966,
26862,
6227,
29958,
1159,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
1792,
29918,
5269,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
1125,
13,
9651,
4911,
29889,
12650,
29889,
3258,
29918,
1792,
29898,
6786,
543,
1792,
29906,
613,
13,
462,
462,
268,
4800,
543,
29966,
25711,
17013,
28341,
13,
462,
462,
268,
4876,
543,
1159,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
1125,
13,
9651,
4911,
29889,
12650,
29889,
3258,
29918,
1792,
29898,
6786,
543,
1792,
29906,
613,
13,
462,
462,
268,
4800,
543,
29966,
25711,
17013,
28341,
13,
462,
462,
268,
4876,
543,
29966,
26862,
6227,
29958,
1159,
13,
2
] |
src/lib/pythonds/graphs/priorityQueue.py | blockpy-edu/skulpt | 4 | 147013 | # <NAME>, <NAME>
# Introduction to Data Structures and Algorithms in Python
# Copyright 2005
#
import unittest
# this implementation of binary heap takes key value pairs,
# we will assume that the keys are all comparable
class PriorityQueue:
def __init__(self):
self.heapArray = [(0, 0)]
self.currentSize = 0
def buildHeap(self, alist):
self.currentSize = len(alist)
self.heapArray = [(0, 0)]
for i in alist:
self.heapArray.append(i)
i = len(alist) // 2
while (i > 0):
self.percDown(i)
i = i - 1
def percDown(self, i):
while (i * 2) <= self.currentSize:
mc = self.minChild(i)
if self.heapArray[i][0] > self.heapArray[mc][0]:
tmp = self.heapArray[i]
self.heapArray[i] = self.heapArray[mc]
self.heapArray[mc] = tmp
i = mc
def minChild(self, i):
if i * 2 > self.currentSize:
return -1
else:
if i * 2 + 1 > self.currentSize:
return i * 2
else:
if self.heapArray[i * 2][0] < self.heapArray[i * 2 + 1][0]:
return i * 2
else:
return i * 2 + 1
def percUp(self, i):
while i // 2 > 0:
if self.heapArray[i][0] < self.heapArray[i // 2][0]:
tmp = self.heapArray[i // 2]
self.heapArray[i // 2] = self.heapArray[i]
self.heapArray[i] = tmp
i = i // 2
def add(self, k):
self.heapArray.append(k)
self.currentSize = self.currentSize + 1
self.percUp(self.currentSize)
def delMin(self):
retval = self.heapArray[1][1]
self.heapArray[1] = self.heapArray[self.currentSize]
self.currentSize = self.currentSize - 1
self.heapArray.pop()
self.percDown(1)
return retval
def isEmpty(self):
if self.currentSize == 0:
return True
else:
return False
def decreaseKey(self, val, amt):
# this is a little wierd, but we need to find the heap thing to decrease by
# looking at its value
done = False
i = 1
myKey = 0
while not done and i <= self.currentSize:
if self.heapArray[i][1] == val:
done = True
myKey = i
else:
i = i + 1
if myKey > 0:
self.heapArray[myKey] = (amt, self.heapArray[myKey][1])
self.percUp(myKey)
def __contains__(self, vtx):
for pair in self.heapArray:
if pair[1] == vtx:
return True
return False
class TestBinHeap(unittest.TestCase):
def setUp(self):
self.theHeap = PriorityQueue()
self.theHeap.add((2, 'x'))
self.theHeap.add((3, 'y'))
self.theHeap.add((5, 'z'))
self.theHeap.add((6, 'a'))
self.theHeap.add((4, 'd'))
def testInsert(self):
assert self.theHeap.currentSize == 5
def testDelmin(self):
assert self.theHeap.delMin() == 'x'
assert self.theHeap.delMin() == 'y'
def testDecKey(self):
self.theHeap.decreaseKey('d', 1)
assert self.theHeap.delMin() == 'd'
if __name__ == '__main__':
unittest.main()
| [
1,
396,
529,
5813,
10202,
529,
5813,
29958,
13,
29937,
27576,
304,
3630,
28771,
1973,
322,
11545,
12404,
297,
5132,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29900,
29945,
13,
29937,
29871,
13,
5215,
443,
27958,
13,
13,
13,
29937,
445,
5314,
310,
7581,
16947,
4893,
1820,
995,
11000,
29892,
13,
29937,
591,
674,
5251,
393,
278,
6611,
526,
599,
5734,
519,
13,
13,
1990,
22096,
537,
10620,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
354,
481,
2588,
353,
17288,
29900,
29892,
29871,
29900,
4638,
13,
4706,
1583,
29889,
3784,
3505,
353,
29871,
29900,
13,
13,
1678,
822,
2048,
3868,
481,
29898,
1311,
29892,
394,
391,
1125,
13,
4706,
1583,
29889,
3784,
3505,
353,
7431,
29898,
284,
391,
29897,
13,
4706,
1583,
29889,
354,
481,
2588,
353,
17288,
29900,
29892,
29871,
29900,
4638,
13,
4706,
363,
474,
297,
394,
391,
29901,
13,
9651,
1583,
29889,
354,
481,
2588,
29889,
4397,
29898,
29875,
29897,
13,
4706,
474,
353,
7431,
29898,
284,
391,
29897,
849,
29871,
29906,
13,
4706,
1550,
313,
29875,
1405,
29871,
29900,
1125,
13,
9651,
1583,
29889,
546,
29883,
6767,
29898,
29875,
29897,
13,
9651,
474,
353,
474,
448,
29871,
29896,
13,
13,
1678,
822,
639,
29883,
6767,
29898,
1311,
29892,
474,
1125,
13,
4706,
1550,
313,
29875,
334,
29871,
29906,
29897,
5277,
1583,
29889,
3784,
3505,
29901,
13,
9651,
286,
29883,
353,
1583,
29889,
1195,
5938,
29898,
29875,
29897,
13,
9651,
565,
1583,
29889,
354,
481,
2588,
29961,
29875,
3816,
29900,
29962,
1405,
1583,
29889,
354,
481,
2588,
29961,
14047,
3816,
29900,
5387,
13,
18884,
13128,
353,
1583,
29889,
354,
481,
2588,
29961,
29875,
29962,
13,
18884,
1583,
29889,
354,
481,
2588,
29961,
29875,
29962,
353,
1583,
29889,
354,
481,
2588,
29961,
14047,
29962,
13,
18884,
1583,
29889,
354,
481,
2588,
29961,
14047,
29962,
353,
13128,
13,
9651,
474,
353,
286,
29883,
13,
13,
1678,
822,
1375,
5938,
29898,
1311,
29892,
474,
1125,
13,
4706,
565,
474,
334,
29871,
29906,
1405,
1583,
29889,
3784,
3505,
29901,
13,
9651,
736,
448,
29896,
13,
4706,
1683,
29901,
13,
9651,
565,
474,
334,
29871,
29906,
718,
29871,
29896,
1405,
1583,
29889,
3784,
3505,
29901,
13,
18884,
736,
474,
334,
29871,
29906,
13,
9651,
1683,
29901,
13,
18884,
565,
1583,
29889,
354,
481,
2588,
29961,
29875,
334,
29871,
29906,
3816,
29900,
29962,
529,
1583,
29889,
354,
481,
2588,
29961,
29875,
334,
29871,
29906,
718,
29871,
29896,
3816,
29900,
5387,
13,
462,
1678,
736,
474,
334,
29871,
29906,
13,
18884,
1683,
29901,
13,
462,
1678,
736,
474,
334,
29871,
29906,
718,
29871,
29896,
13,
13,
1678,
822,
639,
29883,
3373,
29898,
1311,
29892,
474,
1125,
13,
4706,
1550,
474,
849,
29871,
29906,
1405,
29871,
29900,
29901,
13,
9651,
565,
1583,
29889,
354,
481,
2588,
29961,
29875,
3816,
29900,
29962,
529,
1583,
29889,
354,
481,
2588,
29961,
29875,
849,
29871,
29906,
3816,
29900,
5387,
13,
18884,
13128,
353,
1583,
29889,
354,
481,
2588,
29961,
29875,
849,
29871,
29906,
29962,
13,
18884,
1583,
29889,
354,
481,
2588,
29961,
29875,
849,
29871,
29906,
29962,
353,
1583,
29889,
354,
481,
2588,
29961,
29875,
29962,
13,
18884,
1583,
29889,
354,
481,
2588,
29961,
29875,
29962,
353,
13128,
13,
9651,
474,
353,
474,
849,
29871,
29906,
13,
13,
1678,
822,
788,
29898,
1311,
29892,
413,
1125,
13,
4706,
1583,
29889,
354,
481,
2588,
29889,
4397,
29898,
29895,
29897,
13,
4706,
1583,
29889,
3784,
3505,
353,
1583,
29889,
3784,
3505,
718,
29871,
29896,
13,
4706,
1583,
29889,
546,
29883,
3373,
29898,
1311,
29889,
3784,
3505,
29897,
13,
13,
1678,
822,
628,
8140,
29898,
1311,
1125,
13,
4706,
3240,
791,
353,
1583,
29889,
354,
481,
2588,
29961,
29896,
3816,
29896,
29962,
13,
4706,
1583,
29889,
354,
481,
2588,
29961,
29896,
29962,
353,
1583,
29889,
354,
481,
2588,
29961,
1311,
29889,
3784,
3505,
29962,
13,
4706,
1583,
29889,
3784,
3505,
353,
1583,
29889,
3784,
3505,
448,
29871,
29896,
13,
4706,
1583,
29889,
354,
481,
2588,
29889,
7323,
580,
13,
4706,
1583,
29889,
546,
29883,
6767,
29898,
29896,
29897,
13,
4706,
736,
3240,
791,
13,
13,
1678,
822,
338,
8915,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
3784,
3505,
1275,
29871,
29900,
29901,
13,
9651,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
13,
1678,
822,
23806,
2558,
29898,
1311,
29892,
659,
29892,
626,
29873,
1125,
13,
4706,
396,
445,
338,
263,
2217,
281,
631,
29881,
29892,
541,
591,
817,
304,
1284,
278,
16947,
2655,
304,
23806,
491,
13,
4706,
396,
3063,
472,
967,
995,
13,
4706,
2309,
353,
7700,
13,
4706,
474,
353,
29871,
29896,
13,
4706,
590,
2558,
353,
29871,
29900,
13,
4706,
1550,
451,
2309,
322,
474,
5277,
1583,
29889,
3784,
3505,
29901,
13,
9651,
565,
1583,
29889,
354,
481,
2588,
29961,
29875,
3816,
29896,
29962,
1275,
659,
29901,
13,
18884,
2309,
353,
5852,
13,
18884,
590,
2558,
353,
474,
13,
9651,
1683,
29901,
13,
18884,
474,
353,
474,
718,
29871,
29896,
13,
4706,
565,
590,
2558,
1405,
29871,
29900,
29901,
13,
9651,
1583,
29889,
354,
481,
2588,
29961,
1357,
2558,
29962,
353,
313,
8035,
29892,
1583,
29889,
354,
481,
2588,
29961,
1357,
2558,
3816,
29896,
2314,
13,
9651,
1583,
29889,
546,
29883,
3373,
29898,
1357,
2558,
29897,
13,
13,
1678,
822,
4770,
11516,
12035,
1311,
29892,
325,
7508,
1125,
13,
4706,
363,
5101,
297,
1583,
29889,
354,
481,
2588,
29901,
13,
9651,
565,
5101,
29961,
29896,
29962,
1275,
325,
7508,
29901,
13,
18884,
736,
5852,
13,
4706,
736,
7700,
13,
13,
13,
1990,
4321,
29933,
262,
3868,
481,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1552,
3868,
481,
353,
22096,
537,
10620,
580,
13,
4706,
1583,
29889,
1552,
3868,
481,
29889,
1202,
3552,
29906,
29892,
525,
29916,
8785,
13,
4706,
1583,
29889,
1552,
3868,
481,
29889,
1202,
3552,
29941,
29892,
525,
29891,
8785,
13,
4706,
1583,
29889,
1552,
3868,
481,
29889,
1202,
3552,
29945,
29892,
525,
29920,
8785,
13,
4706,
1583,
29889,
1552,
3868,
481,
29889,
1202,
3552,
29953,
29892,
525,
29874,
8785,
13,
4706,
1583,
29889,
1552,
3868,
481,
29889,
1202,
3552,
29946,
29892,
525,
29881,
8785,
13,
13,
1678,
822,
1243,
17491,
29898,
1311,
1125,
13,
4706,
4974,
1583,
29889,
1552,
3868,
481,
29889,
3784,
3505,
1275,
29871,
29945,
13,
13,
1678,
822,
1243,
13157,
1195,
29898,
1311,
1125,
13,
4706,
4974,
1583,
29889,
1552,
3868,
481,
29889,
6144,
8140,
580,
1275,
525,
29916,
29915,
13,
4706,
4974,
1583,
29889,
1552,
3868,
481,
29889,
6144,
8140,
580,
1275,
525,
29891,
29915,
13,
13,
1678,
822,
1243,
6185,
2558,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1552,
3868,
481,
29889,
311,
1037,
559,
2558,
877,
29881,
742,
29871,
29896,
29897,
13,
4706,
4974,
1583,
29889,
1552,
3868,
481,
29889,
6144,
8140,
580,
1275,
525,
29881,
29915,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
backend/farming/graphql/types/natura2000.py | PwC-FaST/fast-webapp | 7 | 32156 | import graphene
import os
from promise import Promise
from datetime import datetime
from promise.dataloader import DataLoader
import requests
from core.graphql.types import CountryType
from core.models import Country
class Natura2000FeatureType(graphene.ObjectType):
id = graphene.String()
site_code = graphene.String()
site_name = graphene.String()
country = graphene.Field(CountryType)
released_at = graphene.DateTime()
wkt_type = graphene.String()
site_types = graphene.List(graphene.String)
class Natura2000IntersectionType(graphene.ObjectType):
id = graphene.String()
intersects = graphene.Boolean()
minimum_distance = graphene.Float()
intersection = graphene.Float()
natura2000_feature = graphene.Field(Natura2000FeatureType)
class Natura2000IntersectionLoader(DataLoader):
def batch_load_fn(self, lpis_parcel_ids):
url = os.getenv('FAST_API_PARCEL_NATURA2000_URL')
data = requests.post(url, params={'search': '10000'}, json=lpis_parcel_ids).json()
# Sort the results in the same order as the request
sorting = {lpis_parcel_id: index for index, lpis_parcel_id in enumerate(lpis_parcel_ids)}
data = sorted(data, key=lambda x: sorting[x['_id']])
results = []
for lpis_parcel_id, d in zip(lpis_parcel_ids, data):
result = []
for n in d['natura2000']:
if n is None:
continue
# Create a real Country vertex
country = Country.objects.filter(pk=n.get('country').upper()).get()
released_at = datetime.strptime(n.get('releaseDate'), '%Y-%m-%d')
# The feature that is intersecting
natura2000_feature = Natura2000FeatureType(id=n.get('_id'),
site_code=n.get('siteCode'),
site_name=n.get('siteName'),
wkt_type=n.get('wktType'),
country=country,
released_at=released_at,
site_types=n.get('siteTypes'))
# The intersection itself
intersection = Natura2000IntersectionType(id=lpis_parcel_id + '.' + n.get('_id'),
intersects=n.get('intersects'),
minimum_distance=n.get('minDistance'),
intersection=n.get('intersection'),
natura2000_feature=natura2000_feature)
result += [intersection]
results += [result]
return Promise.resolve(results)
natura2000_intersections_loader = Natura2000IntersectionLoader() | [
1,
1053,
3983,
1600,
13,
5215,
2897,
13,
3166,
11640,
1053,
21501,
13,
3166,
12865,
1053,
12865,
13,
3166,
11640,
29889,
29881,
2075,
29877,
1664,
1053,
3630,
10036,
13,
5215,
7274,
13,
3166,
7136,
29889,
4262,
1519,
29889,
8768,
1053,
15456,
1542,
13,
3166,
7136,
29889,
9794,
1053,
15456,
13,
13,
13,
1990,
405,
7969,
29906,
29900,
29900,
29900,
19132,
1542,
29898,
4262,
1600,
29889,
2061,
1542,
1125,
13,
1678,
1178,
353,
3983,
1600,
29889,
1231,
580,
13,
1678,
3268,
29918,
401,
353,
3983,
1600,
29889,
1231,
580,
13,
1678,
3268,
29918,
978,
353,
3983,
1600,
29889,
1231,
580,
13,
1678,
4234,
353,
3983,
1600,
29889,
3073,
29898,
20779,
1542,
29897,
13,
1678,
5492,
29918,
271,
353,
3983,
1600,
29889,
11384,
580,
13,
1678,
281,
1193,
29918,
1853,
353,
3983,
1600,
29889,
1231,
580,
13,
1678,
3268,
29918,
8768,
353,
3983,
1600,
29889,
1293,
29898,
4262,
1600,
29889,
1231,
29897,
13,
13,
13,
1990,
405,
7969,
29906,
29900,
29900,
29900,
4074,
2042,
1542,
29898,
4262,
1600,
29889,
2061,
1542,
1125,
13,
1678,
1178,
353,
3983,
1600,
29889,
1231,
580,
13,
1678,
25869,
29879,
353,
3983,
1600,
29889,
18146,
580,
13,
1678,
9212,
29918,
19244,
353,
3983,
1600,
29889,
11031,
580,
13,
1678,
17686,
353,
3983,
1600,
29889,
11031,
580,
13,
1678,
4033,
29874,
29906,
29900,
29900,
29900,
29918,
14394,
353,
3983,
1600,
29889,
3073,
29898,
29940,
7969,
29906,
29900,
29900,
29900,
19132,
1542,
29897,
13,
13,
13,
1990,
405,
7969,
29906,
29900,
29900,
29900,
4074,
2042,
10036,
29898,
1469,
10036,
1125,
13,
1678,
822,
9853,
29918,
1359,
29918,
9144,
29898,
1311,
29892,
301,
3334,
29918,
862,
2242,
29918,
4841,
1125,
13,
4706,
3142,
353,
2897,
29889,
657,
6272,
877,
4519,
1254,
29918,
8787,
29918,
16320,
4741,
29931,
29918,
29940,
1299,
4574,
29909,
29906,
29900,
29900,
29900,
29918,
4219,
1495,
13,
4706,
848,
353,
7274,
29889,
2490,
29898,
2271,
29892,
8636,
3790,
29915,
4478,
2396,
525,
29896,
29900,
29900,
29900,
29900,
16675,
4390,
29922,
29880,
3334,
29918,
862,
2242,
29918,
4841,
467,
3126,
580,
13,
13,
4706,
396,
20025,
278,
2582,
297,
278,
1021,
1797,
408,
278,
2009,
13,
4706,
16548,
353,
426,
29880,
3334,
29918,
862,
2242,
29918,
333,
29901,
2380,
363,
2380,
29892,
301,
3334,
29918,
862,
2242,
29918,
333,
297,
26985,
29898,
29880,
3334,
29918,
862,
2242,
29918,
4841,
2915,
13,
4706,
848,
353,
12705,
29898,
1272,
29892,
1820,
29922,
2892,
921,
29901,
16548,
29961,
29916,
1839,
29918,
333,
2033,
2314,
13,
13,
4706,
2582,
353,
5159,
13,
4706,
363,
301,
3334,
29918,
862,
2242,
29918,
333,
29892,
270,
297,
14319,
29898,
29880,
3334,
29918,
862,
2242,
29918,
4841,
29892,
848,
1125,
13,
13,
9651,
1121,
353,
5159,
13,
9651,
363,
302,
297,
270,
1839,
29876,
7969,
29906,
29900,
29900,
29900,
2033,
29901,
13,
13,
18884,
565,
302,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
13,
18884,
396,
6204,
263,
1855,
15456,
12688,
13,
18884,
4234,
353,
15456,
29889,
12650,
29889,
4572,
29898,
20571,
29922,
29876,
29889,
657,
877,
13509,
2824,
21064,
16655,
657,
580,
13,
13,
18884,
5492,
29918,
271,
353,
12865,
29889,
710,
415,
603,
29898,
29876,
29889,
657,
877,
14096,
2539,
5477,
14210,
29979,
19222,
29885,
19222,
29881,
1495,
13,
13,
18884,
396,
450,
4682,
393,
338,
25869,
292,
13,
18884,
4033,
29874,
29906,
29900,
29900,
29900,
29918,
14394,
353,
405,
7969,
29906,
29900,
29900,
29900,
19132,
1542,
29898,
333,
29922,
29876,
29889,
657,
877,
29918,
333,
5477,
13,
462,
462,
462,
965,
3268,
29918,
401,
29922,
29876,
29889,
657,
877,
2746,
3399,
5477,
13,
462,
462,
462,
965,
3268,
29918,
978,
29922,
29876,
29889,
657,
877,
2746,
1170,
5477,
13,
462,
462,
462,
965,
281,
1193,
29918,
1853,
29922,
29876,
29889,
657,
877,
29893,
1193,
1542,
5477,
13,
462,
462,
462,
965,
4234,
29922,
13509,
29892,
13,
462,
462,
462,
965,
5492,
29918,
271,
29922,
276,
4611,
29918,
271,
29892,
13,
462,
462,
462,
965,
3268,
29918,
8768,
29922,
29876,
29889,
657,
877,
2746,
10562,
8785,
13,
13,
18884,
396,
450,
17686,
3528,
13,
18884,
17686,
353,
405,
7969,
29906,
29900,
29900,
29900,
4074,
2042,
1542,
29898,
333,
29922,
29880,
3334,
29918,
862,
2242,
29918,
333,
718,
525,
6169,
718,
302,
29889,
657,
877,
29918,
333,
5477,
13,
462,
462,
462,
3986,
25869,
29879,
29922,
29876,
29889,
657,
877,
1639,
8803,
29879,
5477,
13,
462,
462,
462,
3986,
9212,
29918,
19244,
29922,
29876,
29889,
657,
877,
1195,
27469,
5477,
13,
462,
462,
462,
3986,
17686,
29922,
29876,
29889,
657,
877,
1639,
2042,
5477,
13,
462,
462,
462,
3986,
4033,
29874,
29906,
29900,
29900,
29900,
29918,
14394,
29922,
29876,
7969,
29906,
29900,
29900,
29900,
29918,
14394,
29897,
13,
13,
18884,
1121,
4619,
518,
1639,
2042,
29962,
13,
13,
9651,
2582,
4619,
518,
2914,
29962,
13,
13,
4706,
736,
21501,
29889,
17863,
29898,
9902,
29897,
13,
13,
13,
29876,
7969,
29906,
29900,
29900,
29900,
29918,
1639,
27117,
29918,
12657,
353,
405,
7969,
29906,
29900,
29900,
29900,
4074,
2042,
10036,
580,
2
] |
starsim/__init__.py | dbarochlopez/starsim | 0 | 95172 | # -*- coding: utf-8 -*-
__version__ = "3.0.1"
__all__ = ['starsim','spectra','nbspectra','SA']
from .starsim import StarSim | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
1649,
3259,
1649,
353,
376,
29941,
29889,
29900,
29889,
29896,
29908,
13,
13,
1649,
497,
1649,
353,
6024,
303,
1503,
326,
3788,
21494,
336,
3788,
29876,
5824,
1103,
336,
3788,
8132,
2033,
13,
13,
3166,
869,
303,
1503,
326,
1053,
7828,
8942,
2
] |
script.py | rohank63/SEC | 1 | 53998 | import infer_organism
import subprocess as sp
print(infer_organism.infer(
file_1="./first_mate.fastq",
min_match=2,factor=1,
transcript_fasta="transcripts.fasta.zip"
))
print(infer_organism.infer(
file_1="./SRR13496438.fastq.gz",
min_match=2,factor=1,
transcript_fasta="transcripts.fasta.zip"
))
'''
print(infer_read_orientation.infer(
file_1="./files/SRR13496438.fastq.gz",
fasta="transcripts.fasta.zip",
organism="oaries"
))
import subprocess as sp
file_1 = "./files/SRR13496438.fastq.gz"
quant_single = "kallisto quant -i transcripts.idx -o output" + \
" -l 100 -s 300 --single " + file_1
result = sp.run(quant_single, shell=True,capture_output=True, text=True)
print(result.stderr)
print(result.returncode)
'''
| [
1,
1053,
10115,
29918,
6388,
1608,
13,
13,
5215,
1014,
5014,
408,
805,
13,
13,
13,
13,
2158,
29898,
262,
571,
29918,
6388,
1608,
29889,
262,
571,
29898,
13,
12,
1445,
29918,
29896,
543,
6904,
4102,
29918,
25046,
29889,
11255,
29939,
613,
13,
12,
1195,
29918,
4352,
29922,
29906,
29892,
19790,
29922,
29896,
29892,
13,
12,
3286,
924,
29918,
29888,
5427,
543,
3286,
924,
29879,
29889,
29888,
5427,
29889,
7554,
29908,
13,
12,
876,
13,
13,
2158,
29898,
262,
571,
29918,
6388,
1608,
29889,
262,
571,
29898,
13,
12,
1445,
29918,
29896,
543,
6904,
14098,
29934,
29896,
29941,
29946,
29929,
29953,
29946,
29941,
29947,
29889,
11255,
29939,
29889,
18828,
613,
13,
12,
1195,
29918,
4352,
29922,
29906,
29892,
19790,
29922,
29896,
29892,
13,
12,
3286,
924,
29918,
29888,
5427,
543,
3286,
924,
29879,
29889,
29888,
5427,
29889,
7554,
29908,
13,
12,
876,
13,
13,
12008,
13,
2158,
29898,
262,
571,
29918,
949,
29918,
20659,
29889,
262,
571,
29898,
13,
12,
1445,
29918,
29896,
543,
6904,
5325,
29914,
14098,
29934,
29896,
29941,
29946,
29929,
29953,
29946,
29941,
29947,
29889,
11255,
29939,
29889,
18828,
613,
13,
12,
29888,
5427,
543,
3286,
924,
29879,
29889,
29888,
5427,
29889,
7554,
613,
13,
12,
6388,
1608,
543,
29877,
4314,
29908,
13,
12,
876,
13,
13,
13,
13,
5215,
1014,
5014,
408,
805,
13,
13,
1445,
29918,
29896,
353,
376,
6904,
5325,
29914,
14098,
29934,
29896,
29941,
29946,
29929,
29953,
29946,
29941,
29947,
29889,
11255,
29939,
29889,
18828,
29908,
13,
12150,
29918,
14369,
353,
376,
29895,
497,
5137,
4323,
448,
29875,
1301,
924,
29879,
29889,
13140,
448,
29877,
1962,
29908,
718,
320,
13,
4706,
376,
448,
29880,
29871,
29896,
29900,
29900,
448,
29879,
29871,
29941,
29900,
29900,
1192,
14369,
376,
718,
934,
29918,
29896,
13,
13,
2914,
353,
805,
29889,
3389,
29898,
12150,
29918,
14369,
29892,
6473,
29922,
5574,
29892,
17885,
545,
29918,
4905,
29922,
5574,
29892,
1426,
29922,
5574,
29897,
13,
13,
13,
2158,
29898,
2914,
29889,
303,
20405,
29897,
13,
2158,
29898,
2914,
29889,
2457,
401,
29897,
13,
12008,
13,
2
] |
userbot/core/vcbot/controls.py | Rewtio/Mikoo-Userbot | 4 | 16386 | <reponame>Rewtio/Mikoo-Userbot
# Mikoo - UserBot
# Copyright (c) 2022 Mikoo-Userbot
# Credits: @divarvian || https://github.com/divarvian
#
# This file is a part of < https://github.com/divarvian/Mikoo-Userbot/ >
# t.me/MikooUserbot & t.me/MikooUserbot
from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped
from pytgcalls.types.input_stream.quality import (
HighQualityAudio,
HighQualityVideo,
LowQualityVideo,
MediumQualityVideo,
)
from userbot import LOGS, call_py
from userbot.core.vcbot.queues import QUEUE, clear_queue, get_queue, pop_an_item
async def skip_item(chat_id: int, x: int):
if chat_id not in QUEUE:
return 0
chat_queue = get_queue(chat_id)
try:
songname = chat_queue[x][0]
chat_queue.pop(x)
return songname
except Exception as e:
LOGS.info(str(e))
return 0
async def skip_current_song(chat_id: int):
if chat_id not in QUEUE:
return 0
chat_queue = get_queue(chat_id)
if len(chat_queue) == 1:
await call_py.leave_group_call(chat_id)
clear_queue(chat_id)
return 1
songname = chat_queue[1][0]
url = chat_queue[1][1]
link = chat_queue[1][2]
type = chat_queue[1][3]
RESOLUSI = chat_queue[1][4]
if type == "Audio":
await call_py.change_stream(
chat_id,
AudioPiped(
url,
HighQualityAudio(),
),
)
elif type == "Video":
if RESOLUSI == 720:
hm = HighQualityVideo()
elif RESOLUSI == 480:
hm = MediumQualityVideo()
elif RESOLUSI == 360:
hm = LowQualityVideo()
await call_py.change_stream(
chat_id, AudioVideoPiped(url, HighQualityAudio(), hm)
)
pop_an_item(chat_id)
return [songname, link, type]
| [
1,
529,
276,
1112,
420,
29958,
29934,
809,
29873,
601,
29914,
29924,
638,
3634,
29899,
2659,
7451,
13,
29937,
13803,
3634,
448,
4911,
29933,
327,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29906,
13803,
3634,
29899,
2659,
7451,
13,
29937,
24596,
1169,
29901,
732,
4563,
279,
29894,
713,
3830,
2045,
597,
3292,
29889,
510,
29914,
4563,
279,
29894,
713,
13,
29937,
13,
29937,
910,
934,
338,
263,
760,
310,
529,
2045,
597,
3292,
29889,
510,
29914,
4563,
279,
29894,
713,
29914,
29924,
638,
3634,
29899,
2659,
7451,
29914,
1405,
13,
29937,
260,
29889,
1004,
29914,
29924,
638,
3634,
2659,
7451,
669,
260,
29889,
1004,
29914,
29924,
638,
3634,
2659,
7451,
13,
13,
13,
3166,
282,
3637,
27354,
4293,
29889,
8768,
29889,
2080,
29918,
5461,
1053,
21764,
29925,
666,
287,
29892,
21764,
15167,
29925,
666,
287,
13,
3166,
282,
3637,
27354,
4293,
29889,
8768,
29889,
2080,
29918,
5461,
29889,
29567,
1053,
313,
13,
1678,
5057,
24399,
537,
17111,
29892,
13,
1678,
5057,
24399,
537,
15167,
29892,
13,
1678,
17511,
24399,
537,
15167,
29892,
13,
1678,
3436,
1974,
24399,
537,
15167,
29892,
13,
29897,
13,
13,
3166,
1404,
7451,
1053,
11247,
10749,
29892,
1246,
29918,
2272,
13,
3166,
1404,
7451,
29889,
3221,
29889,
7071,
7451,
29889,
802,
1041,
1053,
660,
4462,
4462,
29892,
2821,
29918,
9990,
29892,
679,
29918,
9990,
29892,
1835,
29918,
273,
29918,
667,
13,
13,
13,
12674,
822,
14383,
29918,
667,
29898,
13496,
29918,
333,
29901,
938,
29892,
921,
29901,
938,
1125,
13,
1678,
565,
13563,
29918,
333,
451,
297,
660,
4462,
4462,
29901,
13,
4706,
736,
29871,
29900,
13,
1678,
13563,
29918,
9990,
353,
679,
29918,
9990,
29898,
13496,
29918,
333,
29897,
13,
1678,
1018,
29901,
13,
4706,
4823,
978,
353,
13563,
29918,
9990,
29961,
29916,
3816,
29900,
29962,
13,
4706,
13563,
29918,
9990,
29889,
7323,
29898,
29916,
29897,
13,
4706,
736,
4823,
978,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
11247,
10749,
29889,
3888,
29898,
710,
29898,
29872,
876,
13,
4706,
736,
29871,
29900,
13,
13,
13,
12674,
822,
14383,
29918,
3784,
29918,
21453,
29898,
13496,
29918,
333,
29901,
938,
1125,
13,
1678,
565,
13563,
29918,
333,
451,
297,
660,
4462,
4462,
29901,
13,
4706,
736,
29871,
29900,
13,
1678,
13563,
29918,
9990,
353,
679,
29918,
9990,
29898,
13496,
29918,
333,
29897,
13,
1678,
565,
7431,
29898,
13496,
29918,
9990,
29897,
1275,
29871,
29896,
29901,
13,
4706,
7272,
1246,
29918,
2272,
29889,
280,
1351,
29918,
2972,
29918,
4804,
29898,
13496,
29918,
333,
29897,
13,
4706,
2821,
29918,
9990,
29898,
13496,
29918,
333,
29897,
13,
4706,
736,
29871,
29896,
13,
1678,
4823,
978,
353,
13563,
29918,
9990,
29961,
29896,
3816,
29900,
29962,
13,
1678,
3142,
353,
13563,
29918,
9990,
29961,
29896,
3816,
29896,
29962,
13,
1678,
1544,
353,
13563,
29918,
9990,
29961,
29896,
3816,
29906,
29962,
13,
1678,
1134,
353,
13563,
29918,
9990,
29961,
29896,
3816,
29941,
29962,
13,
1678,
390,
2890,
5607,
3308,
29902,
353,
13563,
29918,
9990,
29961,
29896,
3816,
29946,
29962,
13,
1678,
565,
1134,
1275,
376,
17111,
1115,
13,
4706,
7272,
1246,
29918,
2272,
29889,
3167,
29918,
5461,
29898,
13,
9651,
13563,
29918,
333,
29892,
13,
9651,
21764,
29925,
666,
287,
29898,
13,
18884,
3142,
29892,
13,
18884,
5057,
24399,
537,
17111,
3285,
13,
9651,
10353,
13,
4706,
1723,
13,
1678,
25342,
1134,
1275,
376,
15167,
1115,
13,
4706,
565,
390,
2890,
5607,
3308,
29902,
1275,
29871,
29955,
29906,
29900,
29901,
13,
9651,
298,
29885,
353,
5057,
24399,
537,
15167,
580,
13,
4706,
25342,
390,
2890,
5607,
3308,
29902,
1275,
29871,
29946,
29947,
29900,
29901,
13,
9651,
298,
29885,
353,
3436,
1974,
24399,
537,
15167,
580,
13,
4706,
25342,
390,
2890,
5607,
3308,
29902,
1275,
29871,
29941,
29953,
29900,
29901,
13,
9651,
298,
29885,
353,
17511,
24399,
537,
15167,
580,
13,
4706,
7272,
1246,
29918,
2272,
29889,
3167,
29918,
5461,
29898,
13,
9651,
13563,
29918,
333,
29892,
21764,
15167,
29925,
666,
287,
29898,
2271,
29892,
5057,
24399,
537,
17111,
3285,
298,
29885,
29897,
13,
4706,
1723,
13,
1678,
1835,
29918,
273,
29918,
667,
29898,
13496,
29918,
333,
29897,
13,
1678,
736,
518,
21453,
978,
29892,
1544,
29892,
1134,
29962,
13,
2
] |
tools/run_tests/performance/loadtest_config.py | amidlash/grpc | 1 | 187665 | <filename>tools/run_tests/performance/loadtest_config.py
#!/usr/bin/env python3
# Copyright 2021 The gRPC Authors
#
# 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.
# Script to generate test configurations for the OSS benchmarks framework.
#
# This script filters test scenarios and generates uniquely named configurations
# for each test. Configurations are dumped in multipart YAML format.
import argparse
import copy
import datetime
import json
import os
import string
import sys
import uuid
from typing import Any, Dict, Iterable, List, Mapping, Optional
import yaml
import scenario_config
import scenario_config_exporter
def default_prefix() -> str:
"""Constructs and returns a default prefix for LoadTest names."""
return os.environ.get('USER', 'loadtest')
def now_string() -> str:
return datetime.datetime.now().strftime('%Y%m%d%H%M%S')
def validate_loadtest_name(name: str) -> None:
"""Validates that a LoadTest name is in the expected format."""
if len(name) > 63:
raise ValueError(
'LoadTest name must be less than 63 characters long: %s' % name)
if not all((s.isalnum() for s in name.split('-'))):
raise ValueError('Invalid elements in LoadTest name: %s' % name)
def loadtest_base_name(scenario_name: str, uniquifiers: Iterable[str]) -> str:
"""Constructs and returns the base name for a LoadTest resource."""
elements = scenario_name.split('_')
elements.extend(uniquifiers)
return '-'.join(elements)
def loadtest_name(prefix: str, scenario_name: str,
uniquifiers: Iterable[str]) -> str:
"""Constructs and returns a valid name for a LoadTest resource."""
base_name = loadtest_base_name(scenario_name, uniquifiers)
elements = []
if prefix:
elements.append(prefix)
elements.append(str(uuid.uuid5(uuid.NAMESPACE_DNS, base_name)))
name = '-'.join(elements)
validate_loadtest_name(name)
return name
def validate_annotations(annotations: Dict[str, str]) -> None:
"""Validates that annotations do not contain reserved names.
These names are automatically added by the config generator.
"""
names = set(('scenario', 'uniquifiers')).intersection(annotations)
if names:
raise ValueError('Annotations contain reserved names: %s' % names)
def gen_run_indices(runs_per_test: int) -> Iterable[str]:
"""Generates run indices for multiple runs, as formatted strings."""
if runs_per_test < 2:
yield ''
return
prefix_length = len('{:d}'.format(runs_per_test - 1))
prefix_fmt = '{{:{:d}d}}'.format(prefix_length)
for i in range(runs_per_test):
yield prefix_fmt.format(i)
def gen_loadtest_configs(base_config: yaml.YAMLObject,
scenarios: Iterable[Mapping[str, Any]],
loadtest_name_prefix: str,
uniquifiers: Iterable[str],
annotations: Mapping[str, str],
runs_per_test: int = 1) -> Iterable[yaml.YAMLObject]:
"""Generates LoadTest configurations as YAML objects."""
validate_annotations(annotations),
prefix = loadtest_name_prefix or default_prefix()
for scenario in scenarios:
for run_index in gen_run_indices(runs_per_test):
uniq = uniquifiers + [run_index] if run_index else uniquifiers
name = loadtest_name(prefix, scenario['name'], uniq)
scenario_str = json.dumps({'scenarios': scenario}, indent=' ')
config = copy.deepcopy(base_config)
metadata = config['metadata']
metadata['name'] = name
if 'labels' not in metadata:
metadata['labels'] = dict()
metadata['labels']['prefix'] = prefix
if 'annotations' not in metadata:
metadata['annotations'] = dict()
metadata['annotations'].update(annotations)
metadata['annotations'].update({
'scenario': scenario['name'],
'uniquifiers': uniq,
})
config['spec']['scenariosJSON'] = scenario_str
yield config
def parse_key_value_args(args: Optional[Iterable[str]]) -> Dict[str, str]:
"""Parses arguments in the form key=value into a dictionary."""
d = dict()
if args is None:
return d
for arg in args:
key, equals, value = arg.partition('=')
if equals != '=':
raise ValueError('Expected key=value: ' + value)
d[key] = value
return d
def configure_yaml() -> None:
"""Configures the YAML library to dump data in the expected format."""
def str_presenter(dumper, data):
if '\n' in data:
return dumper.represent_scalar('tag:yaml.org,2002:str',
data,
style='|')
return dumper.represent_scalar('tag:yaml.org,2002:str', data)
yaml.add_representer(str, str_presenter)
def main() -> None:
language_choices = sorted(scenario_config.LANGUAGES.keys())
argp = argparse.ArgumentParser(description='Generates load test configs.')
argp.add_argument('-l',
'--language',
choices=language_choices,
required=True,
help='Language to benchmark.')
argp.add_argument('-t',
'--template',
type=str,
required=True,
help='LoadTest configuration yaml file template.')
argp.add_argument('-s',
'--substitutions',
action='extend',
nargs='+',
default=[],
type=str,
help='Template substitutions, in the form key=value.')
argp.add_argument('-p',
'--prefix',
default='',
type=str,
help='Test name prefix.')
argp.add_argument('-u',
'--uniquifiers',
action='extend',
nargs='+',
default=[],
type=str,
help='One or more strings to make the test name unique.')
argp.add_argument(
'-d',
nargs='?',
const=True,
default=False,
type=bool,
help='Use creation date and time as an addditional uniquifier.')
argp.add_argument('-a',
'--annotations',
action='extend',
nargs='+',
default=[],
type=str,
help='Test annotations, in the form key=value.')
argp.add_argument('-r',
'--regex',
default='.*',
type=str,
help='Regex to select scenarios to run.')
argp.add_argument(
'--category',
choices=['all', 'inproc', 'scalable', 'smoketest', 'sweep'],
default='all',
help='Select a category of tests to run.')
argp.add_argument(
'--client_language',
choices=language_choices,
help='Select only scenarios with a specified client language.')
argp.add_argument(
'--server_language',
choices=language_choices,
help='Select only scenarios with a specified server language.')
argp.add_argument('--runs_per_test',
default=1,
type=int,
help='Number of copies to generate for each test.')
argp.add_argument('-o',
'--output',
type=str,
help='Output file name. Output to stdout if not set.')
args = argp.parse_args()
substitutions = parse_key_value_args(args.substitutions)
with open(args.template) as f:
base_config = yaml.safe_load(
string.Template(f.read()).substitute(substitutions))
scenario_filter = scenario_config_exporter.scenario_filter(
scenario_name_regex=args.regex,
category=args.category,
client_language=args.client_language,
server_language=args.server_language)
scenarios = scenario_config_exporter.gen_scenarios(args.language,
scenario_filter)
uniquifiers = args.uniquifiers
if args.d:
uniquifiers.append(now_string())
annotations = parse_key_value_args(args.annotations)
configs = gen_loadtest_configs(base_config,
scenarios,
loadtest_name_prefix=args.prefix,
uniquifiers=uniquifiers,
annotations=annotations,
runs_per_test=args.runs_per_test)
configure_yaml()
with open(args.output, 'w') if args.output else sys.stdout as f:
yaml.dump_all(configs, stream=f)
if __name__ == '__main__':
main()
| [
1,
529,
9507,
29958,
8504,
29914,
3389,
29918,
21150,
29914,
546,
13390,
29914,
1359,
1688,
29918,
2917,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29896,
450,
330,
29934,
9026,
13189,
943,
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,
29937,
14415,
304,
5706,
1243,
22920,
363,
278,
438,
1799,
23513,
29879,
6890,
29889,
13,
29937,
13,
29937,
910,
2471,
18094,
1243,
21846,
322,
16785,
20498,
873,
4257,
22920,
13,
29937,
363,
1269,
1243,
29889,
12782,
332,
800,
526,
16766,
287,
297,
6674,
442,
612,
23956,
3402,
29889,
13,
13,
5215,
1852,
5510,
13,
5215,
3509,
13,
5215,
12865,
13,
5215,
4390,
13,
5215,
2897,
13,
5215,
1347,
13,
5215,
10876,
13,
5215,
318,
5416,
13,
13,
3166,
19229,
1053,
3139,
29892,
360,
919,
29892,
20504,
519,
29892,
2391,
29892,
341,
20304,
29892,
28379,
13,
13,
5215,
343,
8807,
13,
13,
5215,
10483,
29918,
2917,
13,
5215,
10483,
29918,
2917,
29918,
735,
18505,
13,
13,
13,
1753,
2322,
29918,
13506,
580,
1599,
851,
29901,
13,
1678,
9995,
1168,
4984,
29879,
322,
3639,
263,
2322,
10944,
363,
16012,
3057,
2983,
1213,
15945,
13,
1678,
736,
2897,
29889,
21813,
29889,
657,
877,
11889,
742,
525,
1359,
1688,
1495,
13,
13,
13,
1753,
1286,
29918,
1807,
580,
1599,
851,
29901,
13,
1678,
736,
12865,
29889,
12673,
29889,
3707,
2141,
710,
615,
603,
877,
29995,
29979,
29995,
29885,
29995,
29881,
29995,
29950,
29995,
29924,
29995,
29903,
1495,
13,
13,
13,
1753,
12725,
29918,
1359,
1688,
29918,
978,
29898,
978,
29901,
851,
29897,
1599,
6213,
29901,
13,
1678,
9995,
7211,
1078,
393,
263,
16012,
3057,
1024,
338,
297,
278,
3806,
3402,
1213,
15945,
13,
1678,
565,
7431,
29898,
978,
29897,
1405,
29871,
29953,
29941,
29901,
13,
4706,
12020,
7865,
2392,
29898,
13,
9651,
525,
5896,
3057,
1024,
1818,
367,
3109,
1135,
29871,
29953,
29941,
4890,
1472,
29901,
1273,
29879,
29915,
1273,
1024,
29897,
13,
1678,
565,
451,
599,
3552,
29879,
29889,
275,
284,
1949,
580,
363,
269,
297,
1024,
29889,
5451,
877,
29899,
8785,
1125,
13,
4706,
12020,
7865,
2392,
877,
13919,
3161,
297,
16012,
3057,
1024,
29901,
1273,
29879,
29915,
1273,
1024,
29897,
13,
13,
13,
1753,
2254,
1688,
29918,
3188,
29918,
978,
29898,
1557,
24893,
29918,
978,
29901,
851,
29892,
20498,
14903,
29901,
20504,
519,
29961,
710,
2314,
1599,
851,
29901,
13,
1678,
9995,
1168,
4984,
29879,
322,
3639,
278,
2967,
1024,
363,
263,
16012,
3057,
6503,
1213,
15945,
13,
1678,
3161,
353,
10483,
29918,
978,
29889,
5451,
877,
29918,
1495,
13,
1678,
3161,
29889,
21843,
29898,
3909,
339,
14903,
29897,
13,
1678,
736,
17411,
4286,
7122,
29898,
17664,
29897,
13,
13,
13,
1753,
2254,
1688,
29918,
978,
29898,
13506,
29901,
851,
29892,
10483,
29918,
978,
29901,
851,
29892,
13,
462,
29871,
20498,
14903,
29901,
20504,
519,
29961,
710,
2314,
1599,
851,
29901,
13,
1678,
9995,
1168,
4984,
29879,
322,
3639,
263,
2854,
1024,
363,
263,
16012,
3057,
6503,
1213,
15945,
13,
1678,
2967,
29918,
978,
353,
2254,
1688,
29918,
3188,
29918,
978,
29898,
1557,
24893,
29918,
978,
29892,
20498,
14903,
29897,
13,
1678,
3161,
353,
5159,
13,
1678,
565,
10944,
29901,
13,
4706,
3161,
29889,
4397,
29898,
13506,
29897,
13,
1678,
3161,
29889,
4397,
29898,
710,
29898,
25118,
29889,
25118,
29945,
29898,
25118,
29889,
5813,
5550,
11538,
29918,
29928,
3059,
29892,
2967,
29918,
978,
4961,
13,
1678,
1024,
353,
17411,
4286,
7122,
29898,
17664,
29897,
13,
1678,
12725,
29918,
1359,
1688,
29918,
978,
29898,
978,
29897,
13,
1678,
736,
1024,
13,
13,
13,
1753,
12725,
29918,
6735,
800,
29898,
6735,
800,
29901,
360,
919,
29961,
710,
29892,
851,
2314,
1599,
6213,
29901,
13,
1678,
9995,
7211,
1078,
393,
25495,
437,
451,
1712,
21676,
2983,
29889,
13,
13,
1678,
4525,
2983,
526,
6336,
2715,
491,
278,
2295,
15299,
29889,
13,
1678,
9995,
13,
1678,
2983,
353,
731,
29898,
877,
1557,
24893,
742,
525,
3909,
339,
14903,
1495,
467,
1639,
2042,
29898,
6735,
800,
29897,
13,
1678,
565,
2983,
29901,
13,
4706,
12020,
7865,
2392,
877,
2744,
1333,
800,
1712,
21676,
2983,
29901,
1273,
29879,
29915,
1273,
2983,
29897,
13,
13,
13,
1753,
2531,
29918,
3389,
29918,
513,
1575,
29898,
3389,
29879,
29918,
546,
29918,
1688,
29901,
938,
29897,
1599,
20504,
519,
29961,
710,
5387,
13,
1678,
9995,
5631,
1078,
1065,
16285,
363,
2999,
6057,
29892,
408,
20917,
6031,
1213,
15945,
13,
1678,
565,
6057,
29918,
546,
29918,
1688,
529,
29871,
29906,
29901,
13,
4706,
7709,
6629,
13,
4706,
736,
13,
1678,
10944,
29918,
2848,
353,
7431,
877,
25641,
29881,
29913,
4286,
4830,
29898,
3389,
29879,
29918,
546,
29918,
1688,
448,
29871,
29896,
876,
13,
1678,
10944,
29918,
23479,
353,
525,
6224,
29901,
25641,
29881,
29913,
29881,
930,
4286,
4830,
29898,
13506,
29918,
2848,
29897,
13,
1678,
363,
474,
297,
3464,
29898,
3389,
29879,
29918,
546,
29918,
1688,
1125,
13,
4706,
7709,
10944,
29918,
23479,
29889,
4830,
29898,
29875,
29897,
13,
13,
13,
1753,
2531,
29918,
1359,
1688,
29918,
2917,
29879,
29898,
3188,
29918,
2917,
29901,
343,
8807,
29889,
29979,
23956,
2061,
29892,
13,
462,
308,
21846,
29901,
20504,
519,
29961,
15845,
29961,
710,
29892,
3139,
20526,
13,
462,
308,
2254,
1688,
29918,
978,
29918,
13506,
29901,
851,
29892,
13,
462,
308,
20498,
14903,
29901,
20504,
519,
29961,
710,
1402,
13,
462,
308,
25495,
29901,
341,
20304,
29961,
710,
29892,
851,
1402,
13,
462,
308,
6057,
29918,
546,
29918,
1688,
29901,
938,
353,
29871,
29896,
29897,
1599,
20504,
519,
29961,
25162,
29889,
29979,
23956,
2061,
5387,
13,
1678,
9995,
5631,
1078,
16012,
3057,
22920,
408,
612,
23956,
3618,
1213,
15945,
13,
1678,
12725,
29918,
6735,
800,
29898,
6735,
800,
511,
13,
1678,
10944,
353,
2254,
1688,
29918,
978,
29918,
13506,
470,
2322,
29918,
13506,
580,
13,
1678,
363,
10483,
297,
21846,
29901,
13,
4706,
363,
1065,
29918,
2248,
297,
2531,
29918,
3389,
29918,
513,
1575,
29898,
3389,
29879,
29918,
546,
29918,
1688,
1125,
13,
9651,
443,
29875,
29939,
353,
20498,
14903,
718,
518,
3389,
29918,
2248,
29962,
565,
1065,
29918,
2248,
1683,
20498,
14903,
13,
9651,
1024,
353,
2254,
1688,
29918,
978,
29898,
13506,
29892,
10483,
1839,
978,
7464,
443,
29875,
29939,
29897,
13,
9651,
10483,
29918,
710,
353,
4390,
29889,
29881,
17204,
3319,
29915,
1557,
264,
8596,
2396,
10483,
1118,
29536,
2433,
29871,
25710,
13,
13,
9651,
2295,
353,
3509,
29889,
24535,
8552,
29898,
3188,
29918,
2917,
29897,
13,
9651,
15562,
353,
2295,
1839,
19635,
2033,
13,
9651,
15562,
1839,
978,
2033,
353,
1024,
13,
9651,
565,
525,
21134,
29915,
451,
297,
15562,
29901,
13,
18884,
15562,
1839,
21134,
2033,
353,
9657,
580,
13,
9651,
15562,
1839,
21134,
16215,
13506,
2033,
353,
10944,
13,
9651,
565,
525,
6735,
800,
29915,
451,
297,
15562,
29901,
13,
18884,
15562,
1839,
6735,
800,
2033,
353,
9657,
580,
13,
9651,
15562,
1839,
6735,
800,
13359,
5504,
29898,
6735,
800,
29897,
13,
9651,
15562,
1839,
6735,
800,
13359,
5504,
3319,
13,
18884,
525,
1557,
24893,
2396,
10483,
1839,
978,
7464,
13,
18884,
525,
3909,
339,
14903,
2396,
443,
29875,
29939,
29892,
13,
9651,
5615,
13,
9651,
2295,
1839,
6550,
16215,
1557,
264,
8596,
7249,
2033,
353,
10483,
29918,
710,
13,
13,
9651,
7709,
2295,
13,
13,
13,
1753,
6088,
29918,
1989,
29918,
1767,
29918,
5085,
29898,
5085,
29901,
28379,
29961,
13463,
519,
29961,
710,
24960,
1599,
360,
919,
29961,
710,
29892,
851,
5387,
13,
1678,
9995,
29925,
1503,
267,
6273,
297,
278,
883,
1820,
29922,
1767,
964,
263,
8600,
1213,
15945,
13,
1678,
270,
353,
9657,
580,
13,
1678,
565,
6389,
338,
6213,
29901,
13,
4706,
736,
270,
13,
1678,
363,
1852,
297,
6389,
29901,
13,
4706,
1820,
29892,
15743,
29892,
995,
353,
1852,
29889,
16707,
877,
29922,
1495,
13,
4706,
565,
15743,
2804,
525,
29922,
2396,
13,
9651,
12020,
7865,
2392,
877,
1252,
6021,
1820,
29922,
1767,
29901,
525,
718,
995,
29897,
13,
4706,
270,
29961,
1989,
29962,
353,
995,
13,
1678,
736,
270,
13,
13,
13,
1753,
10822,
29918,
25162,
580,
1599,
6213,
29901,
13,
1678,
9995,
3991,
1973,
278,
612,
23956,
3489,
304,
16766,
848,
297,
278,
3806,
3402,
1213,
15945,
13,
13,
1678,
822,
851,
29918,
6338,
261,
29898,
29881,
398,
546,
29892,
848,
1125,
13,
4706,
565,
11297,
29876,
29915,
297,
848,
29901,
13,
9651,
736,
270,
398,
546,
29889,
276,
6338,
29918,
19529,
279,
877,
4039,
29901,
25162,
29889,
990,
29892,
29906,
29900,
29900,
29906,
29901,
710,
742,
13,
462,
462,
965,
848,
29892,
13,
462,
462,
965,
3114,
2433,
29989,
1495,
13,
4706,
736,
270,
398,
546,
29889,
276,
6338,
29918,
19529,
279,
877,
4039,
29901,
25162,
29889,
990,
29892,
29906,
29900,
29900,
29906,
29901,
710,
742,
848,
29897,
13,
13,
1678,
343,
8807,
29889,
1202,
29918,
276,
6338,
261,
29898,
710,
29892,
851,
29918,
6338,
261,
29897,
13,
13,
13,
1753,
1667,
580,
1599,
6213,
29901,
13,
1678,
4086,
29918,
1859,
1575,
353,
12705,
29898,
1557,
24893,
29918,
2917,
29889,
29931,
19453,
29965,
10461,
29903,
29889,
8149,
3101,
13,
1678,
1852,
29886,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
5631,
1078,
2254,
1243,
2295,
29879,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29880,
742,
13,
462,
418,
525,
489,
11675,
742,
13,
462,
418,
19995,
29922,
11675,
29918,
1859,
1575,
29892,
13,
462,
418,
3734,
29922,
5574,
29892,
13,
462,
418,
1371,
2433,
21233,
304,
23513,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29873,
742,
13,
462,
418,
525,
489,
6886,
742,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
3734,
29922,
5574,
29892,
13,
462,
418,
1371,
2433,
5896,
3057,
5285,
343,
8807,
934,
4472,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29879,
742,
13,
462,
418,
525,
489,
22492,
5008,
29879,
742,
13,
462,
418,
3158,
2433,
21843,
742,
13,
462,
418,
302,
5085,
2433,
29974,
742,
13,
462,
418,
2322,
11759,
1402,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
1371,
2433,
6733,
23697,
29879,
29892,
297,
278,
883,
1820,
29922,
1767,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29886,
742,
13,
462,
418,
525,
489,
13506,
742,
13,
462,
418,
2322,
2433,
742,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
1371,
2433,
3057,
1024,
10944,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29884,
742,
13,
462,
418,
525,
489,
3909,
339,
14903,
742,
13,
462,
418,
3158,
2433,
21843,
742,
13,
462,
418,
302,
5085,
2433,
29974,
742,
13,
462,
418,
2322,
11759,
1402,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
1371,
2433,
6716,
470,
901,
6031,
304,
1207,
278,
1243,
1024,
5412,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
29898,
13,
4706,
17411,
29881,
742,
13,
4706,
302,
5085,
2433,
29973,
742,
13,
4706,
1040,
29922,
5574,
29892,
13,
4706,
2322,
29922,
8824,
29892,
13,
4706,
1134,
29922,
11227,
29892,
13,
4706,
1371,
2433,
11403,
11265,
2635,
322,
931,
408,
385,
788,
29881,
3245,
20498,
3709,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29874,
742,
13,
462,
418,
525,
489,
6735,
800,
742,
13,
462,
418,
3158,
2433,
21843,
742,
13,
462,
418,
302,
5085,
2433,
29974,
742,
13,
462,
418,
2322,
11759,
1402,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
1371,
2433,
3057,
25495,
29892,
297,
278,
883,
1820,
29922,
1767,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29878,
742,
13,
462,
418,
525,
489,
13087,
742,
13,
462,
418,
2322,
2433,
5575,
742,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
1371,
2433,
4597,
735,
304,
1831,
21846,
304,
1065,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
29898,
13,
4706,
525,
489,
7320,
742,
13,
4706,
19995,
29922,
1839,
497,
742,
525,
262,
15439,
742,
525,
19529,
519,
742,
525,
3844,
554,
300,
342,
742,
525,
29879,
705,
1022,
7464,
13,
4706,
2322,
2433,
497,
742,
13,
4706,
1371,
2433,
3549,
263,
7663,
310,
6987,
304,
1065,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
29898,
13,
4706,
525,
489,
4645,
29918,
11675,
742,
13,
4706,
19995,
29922,
11675,
29918,
1859,
1575,
29892,
13,
4706,
1371,
2433,
3549,
871,
21846,
411,
263,
6790,
3132,
4086,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
29898,
13,
4706,
525,
489,
2974,
29918,
11675,
742,
13,
4706,
19995,
29922,
11675,
29918,
1859,
1575,
29892,
13,
4706,
1371,
2433,
3549,
871,
21846,
411,
263,
6790,
1923,
4086,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
489,
3389,
29879,
29918,
546,
29918,
1688,
742,
13,
462,
418,
2322,
29922,
29896,
29892,
13,
462,
418,
1134,
29922,
524,
29892,
13,
462,
418,
1371,
2433,
4557,
310,
14591,
304,
5706,
363,
1269,
1243,
29889,
1495,
13,
1678,
1852,
29886,
29889,
1202,
29918,
23516,
877,
29899,
29877,
742,
13,
462,
418,
525,
489,
4905,
742,
13,
462,
418,
1134,
29922,
710,
29892,
13,
462,
418,
1371,
2433,
6466,
934,
1024,
29889,
10604,
304,
27591,
565,
451,
731,
29889,
1495,
13,
1678,
6389,
353,
1852,
29886,
29889,
5510,
29918,
5085,
580,
13,
13,
1678,
23697,
29879,
353,
6088,
29918,
1989,
29918,
1767,
29918,
5085,
29898,
5085,
29889,
22492,
5008,
29879,
29897,
13,
13,
1678,
411,
1722,
29898,
5085,
29889,
6886,
29897,
408,
285,
29901,
13,
4706,
2967,
29918,
2917,
353,
343,
8807,
29889,
11177,
29918,
1359,
29898,
13,
9651,
1347,
29889,
6733,
29898,
29888,
29889,
949,
16655,
22492,
12356,
29898,
22492,
5008,
29879,
876,
13,
13,
1678,
10483,
29918,
4572,
353,
10483,
29918,
2917,
29918,
735,
18505,
29889,
1557,
24893,
29918,
4572,
29898,
13,
4706,
10483,
29918,
978,
29918,
13087,
29922,
5085,
29889,
13087,
29892,
13,
4706,
7663,
29922,
5085,
29889,
7320,
29892,
13,
4706,
3132,
29918,
11675,
29922,
5085,
29889,
4645,
29918,
11675,
29892,
13,
4706,
1923,
29918,
11675,
29922,
5085,
29889,
2974,
29918,
11675,
29897,
13,
13,
1678,
21846,
353,
10483,
29918,
2917,
29918,
735,
18505,
29889,
1885,
29918,
1557,
264,
8596,
29898,
5085,
29889,
11675,
29892,
13,
462,
462,
462,
539,
10483,
29918,
4572,
29897,
13,
13,
1678,
20498,
14903,
353,
6389,
29889,
3909,
339,
14903,
13,
1678,
565,
6389,
29889,
29881,
29901,
13,
4706,
20498,
14903,
29889,
4397,
29898,
3707,
29918,
1807,
3101,
13,
13,
1678,
25495,
353,
6088,
29918,
1989,
29918,
1767,
29918,
5085,
29898,
5085,
29889,
6735,
800,
29897,
13,
13,
1678,
2295,
29879,
353,
2531,
29918,
1359,
1688,
29918,
2917,
29879,
29898,
3188,
29918,
2917,
29892,
13,
462,
462,
259,
21846,
29892,
13,
462,
462,
259,
2254,
1688,
29918,
978,
29918,
13506,
29922,
5085,
29889,
13506,
29892,
13,
462,
462,
259,
20498,
14903,
29922,
3909,
339,
14903,
29892,
13,
462,
462,
259,
25495,
29922,
6735,
800,
29892,
13,
462,
462,
259,
6057,
29918,
546,
29918,
1688,
29922,
5085,
29889,
3389,
29879,
29918,
546,
29918,
1688,
29897,
13,
13,
1678,
10822,
29918,
25162,
580,
13,
13,
1678,
411,
1722,
29898,
5085,
29889,
4905,
29892,
525,
29893,
1495,
565,
6389,
29889,
4905,
1683,
10876,
29889,
25393,
408,
285,
29901,
13,
4706,
343,
8807,
29889,
15070,
29918,
497,
29898,
2917,
29879,
29892,
4840,
29922,
29888,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
solvers/shikaku.py | kevinychen/nikoli-puzzle-solver | 4 | 179778 | <gh_stars>1-10
from solvers.utils import *
class ShikakuSolver(AbstractSolver):
def __init__(self, pzprv3):
matched = match('pzprv3/shikaku/(\\d+)/(\\d+)/(.*)/', pzprv3)
self.height = int(matched.group(1))
self.width = int(matched.group(2))
self.grid = parse_table(matched.group(3))[:self.height]
def to_pzprv3(self, solved_grid):
verticals = [['0' if solved_grid[Point(row, col)] == solved_grid[Point(row, col + 1)] else '1'
for col in range(self.width - 1)] for row in range(self.height)]
horizontals = [['0' if solved_grid[Point(row, col)] == solved_grid[Point(row + 1, col)] else '1'
for col in range(self.width)] for row in range(self.height - 1)]
return f'pzprv3/shikaku/{self.height}/{self.width}/{table(self.grid)}/{table(verticals)}/{table(horizontals)}/'
def lattice(self):
return grilops.get_rectangle_lattice(self.height, self.width)
def symbol_set(self):
return grilops.make_number_range_symbol_set(0, self.height * self.width)
def configure(self, sg):
rc = RegionConstrainer(sg.lattice, sg.solver, rectangular=True)
for p in sg.lattice.points:
num = self.grid[p.y][p.x]
if num.isnumeric():
sg.solver.add(rc.parent_grid[p] == R)
sg.solver.add(rc.region_size_grid[p] == int(num))
sg.solver.add(sg.grid[p] == rc.region_id_grid[p])
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
899,
874,
29889,
13239,
1053,
334,
13,
13,
13,
1990,
1383,
638,
16774,
13296,
369,
29898,
9118,
13296,
369,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
282,
29920,
558,
29894,
29941,
1125,
13,
4706,
19228,
353,
1993,
877,
29886,
29920,
558,
29894,
29941,
29914,
845,
638,
16774,
29914,
1194,
29905,
29881,
29974,
6802,
1194,
29905,
29881,
29974,
6802,
28104,
6802,
742,
282,
29920,
558,
29894,
29941,
29897,
13,
4706,
1583,
29889,
3545,
353,
938,
29898,
4352,
287,
29889,
2972,
29898,
29896,
876,
13,
4706,
1583,
29889,
2103,
353,
938,
29898,
4352,
287,
29889,
2972,
29898,
29906,
876,
13,
4706,
1583,
29889,
7720,
353,
6088,
29918,
2371,
29898,
4352,
287,
29889,
2972,
29898,
29941,
876,
7503,
1311,
29889,
3545,
29962,
13,
13,
1678,
822,
304,
29918,
29886,
29920,
558,
29894,
29941,
29898,
1311,
29892,
7484,
29918,
7720,
1125,
13,
4706,
11408,
29879,
353,
518,
1839,
29900,
29915,
565,
7484,
29918,
7720,
29961,
5228,
29898,
798,
29892,
784,
4638,
1275,
7484,
29918,
7720,
29961,
5228,
29898,
798,
29892,
784,
718,
29871,
29896,
4638,
1683,
525,
29896,
29915,
13,
462,
418,
363,
784,
297,
3464,
29898,
1311,
29889,
2103,
448,
29871,
29896,
4638,
363,
1948,
297,
3464,
29898,
1311,
29889,
3545,
4638,
13,
4706,
4029,
6753,
1338,
353,
518,
1839,
29900,
29915,
565,
7484,
29918,
7720,
29961,
5228,
29898,
798,
29892,
784,
4638,
1275,
7484,
29918,
7720,
29961,
5228,
29898,
798,
718,
29871,
29896,
29892,
784,
4638,
1683,
525,
29896,
29915,
13,
462,
4706,
363,
784,
297,
3464,
29898,
1311,
29889,
2103,
4638,
363,
1948,
297,
3464,
29898,
1311,
29889,
3545,
448,
29871,
29896,
4638,
13,
4706,
736,
285,
29915,
29886,
29920,
558,
29894,
29941,
29914,
845,
638,
16774,
19248,
1311,
29889,
3545,
6822,
29912,
1311,
29889,
2103,
6822,
29912,
2371,
29898,
1311,
29889,
7720,
2915,
19248,
2371,
29898,
18575,
29879,
2915,
19248,
2371,
29898,
2015,
6753,
1338,
2915,
22208,
13,
13,
1678,
822,
24094,
29898,
1311,
1125,
13,
4706,
736,
867,
309,
3554,
29889,
657,
29918,
1621,
2521,
29918,
29880,
19704,
29898,
1311,
29889,
3545,
29892,
1583,
29889,
2103,
29897,
13,
13,
1678,
822,
5829,
29918,
842,
29898,
1311,
1125,
13,
4706,
736,
867,
309,
3554,
29889,
5675,
29918,
4537,
29918,
3881,
29918,
18098,
29918,
842,
29898,
29900,
29892,
1583,
29889,
3545,
334,
1583,
29889,
2103,
29897,
13,
13,
1678,
822,
10822,
29898,
1311,
29892,
269,
29887,
1125,
13,
4706,
364,
29883,
353,
11069,
14131,
4983,
29898,
5311,
29889,
29880,
19704,
29892,
269,
29887,
29889,
2929,
369,
29892,
7705,
6825,
29922,
5574,
29897,
13,
13,
4706,
363,
282,
297,
269,
29887,
29889,
29880,
19704,
29889,
9748,
29901,
13,
9651,
954,
353,
1583,
29889,
7720,
29961,
29886,
29889,
29891,
3816,
29886,
29889,
29916,
29962,
13,
9651,
565,
954,
29889,
275,
21574,
7295,
13,
18884,
269,
29887,
29889,
2929,
369,
29889,
1202,
29898,
2214,
29889,
3560,
29918,
7720,
29961,
29886,
29962,
1275,
390,
29897,
13,
18884,
269,
29887,
29889,
2929,
369,
29889,
1202,
29898,
2214,
29889,
12803,
29918,
2311,
29918,
7720,
29961,
29886,
29962,
1275,
938,
29898,
1949,
876,
13,
9651,
269,
29887,
29889,
2929,
369,
29889,
1202,
29898,
5311,
29889,
7720,
29961,
29886,
29962,
1275,
364,
29883,
29889,
12803,
29918,
333,
29918,
7720,
29961,
29886,
2314,
13,
2
] |
pypy/module/_hpy_universal/interp_descr.py | pymtl/pypy-pymtl3 | 1 | 77140 | <reponame>pymtl/pypy-pymtl3
"""
Implements HPy attribute descriptors, i.e members and getsets.
"""
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.unroll import unrolling_iterable
from pypy.interpreter.error import oefmt
from pypy.interpreter.baseobjspace import DescrMismatch
from pypy.interpreter.typedef import (
GetSetProperty, TypeDef, interp_attrproperty, interp2app)
from pypy.module._hpy_universal import llapi, handles
from pypy.module._hpy_universal.state import State
ADDRESS = lltype.Signed
def check_descr(space, w_obj, w_type):
if not space.isinstance_w(w_obj, w_type):
raise DescrMismatch()
# ======== HPyDef_Kind_Member ========
converter_data = [ # range checking
('SHORT', rffi.SHORT, True),
('INT', rffi.INT, True),
('LONG', rffi.LONG, False),
('USHORT', rffi.USHORT, True),
('UINT', rffi.UINT, True),
('ULONG', rffi.ULONG, False),
('BYTE', rffi.SIGNEDCHAR, True),
('UBYTE', rffi.UCHAR, True),
#('BOOL', rffi.UCHAR, convert_bool, False),
#('FLOAT', rffi.FLOAT, PyFloat_AsDouble, False),
#('DOUBLE', rffi.DOUBLE, PyFloat_AsDouble, False),
('LONGLONG', rffi.LONGLONG, False),
('ULONGLONG', rffi.ULONGLONG, False),
('HPYSSIZET', rffi.SSIZE_T, False),
]
Enum = llapi.cts.gettype('HPyMember_FieldType')
converters = unrolling_iterable([
(getattr(Enum, 'HPyMember_' + name), typ) for name, typ, _ in converter_data])
def member_get(w_descr, space, w_obj):
from .interp_type import W_HPyObject
assert isinstance(w_descr, W_HPyMemberDescriptor)
check_descr(space, w_obj, w_descr.w_type)
assert isinstance(w_obj, W_HPyObject)
addr = rffi.cast(ADDRESS, w_obj.hpy_data) + w_descr.offset
kind = w_descr.kind
for num, typ in converters:
if kind == num:
return space.newint(rffi.cast(rffi.CArrayPtr(typ), addr)[0])
if kind == Enum.HPyMember_FLOAT:
value = rffi.cast(rffi.CArrayPtr(rffi.FLOAT), addr)[0]
return space.newfloat(rffi.cast(rffi.DOUBLE, value))
elif kind == Enum.HPyMember_DOUBLE:
value = rffi.cast(rffi.CArrayPtr(rffi.DOUBLE), addr)[0]
return space.newfloat(value)
elif kind == Enum.HPyMember_BOOL:
value = rffi.cast(rffi.CArrayPtr(rffi.UCHAR), addr)[0]
value = rffi.cast(lltype.Signed, value)
return space.newbool(bool(value))
elif kind == Enum.HPyMember_CHAR:
value = rffi.cast(rffi.CCHARP, addr)[0]
return space.newtext(value)
elif kind == Enum.HPyMember_STRING:
cstr_p = rffi.cast(rffi.CCHARPP, addr)
if cstr_p[0]:
value = rffi.charp2str(cstr_p[0])
return space.newtext(value)
else:
return space.w_None
elif kind == Enum.HPyMember_STRING_INPLACE:
value = rffi.charp2str(rffi.cast(rffi.CCHARP, addr))
return space.newtext(value)
elif kind == Enum.HPyMember_NONE:
return space.w_None
else:
# missing: OBJECT, OBJECT_EX
raise oefmt(space.w_NotImplementedError, '...')
def member_set(w_descr, space, w_obj, w_value):
from .interp_type import W_HPyObject
assert isinstance(w_descr, W_HPyMemberDescriptor)
check_descr(space, w_obj, w_descr.w_type)
assert isinstance(w_obj, W_HPyObject)
addr = rffi.cast(ADDRESS, w_obj.hpy_data) + w_descr.offset
kind = w_descr.kind
for num, typ in converters:
if kind == num:
# XXX: this is wrong!
value = space.int_w(w_value)
ptr = rffi.cast(rffi.CArrayPtr(typ), addr)
ptr[0] = rffi.cast(typ, value)
return
if kind == Enum.HPyMember_FLOAT:
value = space.float_w(w_value)
ptr = rffi.cast(rffi.CArrayPtr(rffi.FLOAT), addr)
ptr[0] = rffi.cast(rffi.FLOAT, value)
return
elif kind == Enum.HPyMember_DOUBLE:
value = space.float_w(w_value)
ptr = rffi.cast(rffi.CArrayPtr(rffi.DOUBLE), addr)
ptr[0] = value
return
elif kind == Enum.HPyMember_BOOL:
if space.is_w(w_value, space.w_False):
value = False
elif space.is_w(w_value, space.w_True):
value = True
else:
raise oefmt(space.w_TypeError, "attribute value type must be bool")
ptr = rffi.cast(rffi.CArrayPtr(rffi.UCHAR), addr)
ptr[0] = rffi.cast(rffi.UCHAR, value)
return
elif kind == Enum.HPyMember_CHAR:
str_value = space.text_w(w_value)
if len(str_value) != 1:
raise oefmt(space.w_TypeError, "string of length 1 expected")
ptr = rffi.cast(rffi.CCHARP, addr)
ptr[0] = str_value[0]
elif kind in (Enum.HPyMember_STRING,
Enum.HPyMember_STRING_INPLACE,
Enum.HPyMember_NONE):
raise oefmt(space.w_TypeError, 'readonly attribute')
else:
raise oefmt(space.w_NotImplementedError, '...')
def member_del(w_descr, space, w_obj):
check_descr(space, w_obj, w_descr.w_type)
raise oefmt(space.w_TypeError,
"can't delete numeric/char attribute")
class W_HPyMemberDescriptor(GetSetProperty):
def __init__(self, w_type, kind, name, doc, offset, is_readonly):
self.kind = kind
self.name = name
self.w_type = w_type
self.offset = offset
self.is_readonly = is_readonly
if is_readonly:
setter = None
deleter = None
else:
setter = member_set
deleter = member_del
GetSetProperty.__init__(
self, member_get, setter, deleter, doc,
cls=None, use_closure=True, tag="hpy_member")
def readonly_attribute(self, space): # overwritten
raise oefmt(space.w_AttributeError,
"attribute '%s' of '%N' objects is not writable",
self.name, self.w_type)
W_HPyMemberDescriptor.typedef = TypeDef(
"hpy_member_descriptor",
__get__=interp2app(GetSetProperty.descr_property_get),
__set__=interp2app(GetSetProperty.descr_property_set),
__delete__=interp2app(GetSetProperty.descr_property_del),
__name__=interp_attrproperty('name', cls=GetSetProperty,
wrapfn="newtext_or_none"),
__objclass__=GetSetProperty(GetSetProperty.descr_get_objclass),
__doc__=interp_attrproperty('doc', cls=GetSetProperty,
wrapfn="newtext_or_none"),
)
assert not W_HPyMemberDescriptor.typedef.acceptable_as_base_class # no __new__
def add_member(space, w_type, hpymember):
name = rffi.constcharp2str(hpymember.c_name)
kind = rffi.cast(lltype.Signed, hpymember.c_type)
offset = rffi.cast(lltype.Signed, hpymember.c_offset)
readonly = rffi.cast(lltype.Signed, hpymember.c_readonly)
doc = rffi.constcharp2str(hpymember.c_doc) if hpymember.c_doc else None
w_descr = W_HPyMemberDescriptor(w_type, kind, name, doc, offset, readonly)
w_type.setdictvalue(space, name, w_descr)
# ======== HPyDef_Kind_GetSet ========
def getset_get(w_getset, space, w_self):
state = space.fromcache(State)
cfuncptr = w_getset.hpygetset.c_getter_impl
func = llapi.cts.cast('HPyFunc_getter', cfuncptr)
with handles.using(space, w_self) as h_self:
h_result = func(state.ctx, h_self, w_getset.hpygetset.c_closure)
return handles.consume(space, h_result)
def getset_set(w_getset, space, w_self, w_value):
state = space.fromcache(State)
cfuncptr = w_getset.hpygetset.c_setter_impl
func = llapi.cts.cast('HPyFunc_setter', cfuncptr)
with handles.using(space, w_self, w_value) as (h_self, h_value):
h_result = func(state.ctx, h_self, h_value, w_getset.hpygetset.c_closure)
# XXX: write a test to check that we do the correct thing if
# c_setter raises an exception
class W_HPyGetSetProperty(GetSetProperty):
def __init__(self, w_type, hpygetset):
self.hpygetset = hpygetset
self.w_type = w_type
#
name = rffi.constcharp2str(hpygetset.c_name)
doc = fset = fget = fdel = None
if hpygetset.c_doc:
doc = rffi.constcharp2str(hpygetset.c_doc)
if hpygetset.c_getter_impl:
fget = getset_get
if hpygetset.c_setter_impl:
fset = getset_set
# XXX: write a test to check that 'del' works
#fdel = ...
GetSetProperty.__init__(self, fget, fset, fdel, doc,
cls=None, use_closure=True,
tag="hpy_getset", name=name)
def readonly_attribute(self, space): # overwritten
raise NotImplementedError # XXX write a test
## raise oefmt(space.w_AttributeError,
## "attribute '%s' of '%N' objects is not writable",
## self.name, self.w_type)
def add_getset(space, w_type, hpygetset):
w_descr = W_HPyGetSetProperty(w_type, hpygetset)
w_type.setdictvalue(space, w_descr.name, w_descr)
#
# the following is needed to ensure that we annotate getset_*, else
# test_ztranslation fails
if hasattr(space, 'is_fake_objspace'):
w_descr.descr_property_get(space, space.w_None)
w_descr.descr_property_set(space, space.w_None, space.w_None)
| [
1,
529,
276,
1112,
420,
29958,
29886,
962,
15206,
29914,
29886,
1478,
29891,
29899,
29886,
962,
15206,
29941,
13,
15945,
29908,
13,
1888,
9711,
379,
19737,
5352,
29037,
943,
29892,
474,
29889,
29872,
5144,
322,
679,
7224,
29889,
13,
15945,
29908,
13,
3166,
364,
4691,
29889,
29878,
1017,
546,
29889,
645,
8768,
973,
1053,
364,
600,
29875,
29892,
11148,
1853,
13,
3166,
364,
4691,
29889,
29878,
1982,
29889,
348,
1245,
1053,
443,
22155,
29918,
1524,
519,
13,
3166,
282,
1478,
29891,
29889,
1639,
1457,
357,
29889,
2704,
1053,
288,
1389,
4378,
13,
3166,
282,
1478,
29891,
29889,
1639,
1457,
357,
29889,
3188,
5415,
3493,
1053,
2726,
7283,
29924,
1608,
905,
13,
3166,
282,
1478,
29891,
29889,
1639,
1457,
357,
29889,
1017,
9795,
1389,
1053,
313,
13,
1678,
3617,
2697,
4854,
29892,
5167,
3206,
29892,
1006,
29886,
29918,
5552,
6799,
29892,
1006,
29886,
29906,
932,
29897,
13,
3166,
282,
1478,
29891,
29889,
5453,
3032,
29882,
2272,
29918,
14540,
284,
1053,
301,
433,
1631,
29892,
17766,
13,
3166,
282,
1478,
29891,
29889,
5453,
3032,
29882,
2272,
29918,
14540,
284,
29889,
3859,
1053,
4306,
13,
13,
17744,
26785,
353,
11148,
1853,
29889,
10140,
287,
13,
13,
1753,
1423,
29918,
2783,
7283,
29898,
3493,
29892,
281,
29918,
5415,
29892,
281,
29918,
1853,
1125,
13,
1678,
565,
451,
2913,
29889,
275,
8758,
29918,
29893,
29898,
29893,
29918,
5415,
29892,
281,
29918,
1853,
1125,
13,
4706,
12020,
2726,
7283,
29924,
1608,
905,
580,
13,
13,
29937,
1275,
2751,
1360,
379,
19737,
3206,
29918,
11885,
29918,
13404,
1275,
2751,
1360,
13,
13,
535,
13549,
29918,
1272,
353,
518,
462,
268,
396,
3464,
8454,
13,
1678,
6702,
7068,
8476,
742,
29871,
364,
600,
29875,
29889,
7068,
8476,
29892,
462,
418,
5852,
511,
13,
1678,
6702,
10192,
742,
1678,
364,
600,
29875,
29889,
10192,
29892,
462,
539,
5852,
511,
13,
1678,
6702,
29931,
20614,
742,
259,
364,
600,
29875,
29889,
29931,
20614,
29892,
462,
539,
7700,
511,
13,
1678,
6702,
3308,
29950,
8476,
742,
364,
600,
29875,
29889,
3308,
29950,
8476,
29892,
632,
5852,
511,
13,
1678,
6702,
29965,
10192,
742,
259,
364,
600,
29875,
29889,
29965,
10192,
29892,
1669,
5852,
511,
13,
1678,
6702,
13309,
20614,
742,
29871,
364,
600,
29875,
29889,
13309,
20614,
29892,
795,
7700,
511,
13,
1678,
6702,
22716,
4330,
742,
259,
364,
600,
29875,
29889,
5425,
20728,
3352,
11282,
29892,
462,
5852,
511,
13,
1678,
6702,
7466,
29979,
4330,
742,
29871,
364,
600,
29875,
29889,
29965,
11282,
29892,
795,
5852,
511,
13,
1678,
396,
877,
28443,
742,
259,
364,
600,
29875,
29889,
29965,
11282,
29892,
29871,
3588,
29918,
11227,
29892,
462,
268,
7700,
511,
13,
1678,
396,
877,
29943,
3927,
1299,
742,
29871,
364,
600,
29875,
29889,
29943,
3927,
1299,
29892,
29871,
10772,
11031,
29918,
2887,
11843,
29892,
462,
7700,
511,
13,
1678,
396,
877,
3970,
7466,
1307,
742,
364,
600,
29875,
29889,
3970,
7466,
1307,
29892,
10772,
11031,
29918,
2887,
11843,
29892,
462,
7700,
511,
13,
1678,
6702,
29931,
1164,
7239,
20614,
742,
29871,
364,
600,
29875,
29889,
29931,
1164,
7239,
20614,
29892,
9651,
7700,
511,
13,
1678,
6702,
13309,
1164,
7239,
20614,
742,
364,
600,
29875,
29889,
13309,
1164,
7239,
20614,
29892,
259,
7700,
511,
13,
1678,
6702,
3954,
29979,
1799,
26664,
2544,
742,
364,
600,
29875,
29889,
1799,
29902,
10721,
29918,
29911,
29892,
1669,
7700,
511,
13,
1678,
4514,
13,
16854,
353,
301,
433,
1631,
29889,
312,
29879,
29889,
657,
1853,
877,
3954,
29891,
13404,
29918,
3073,
1542,
1495,
13,
535,
369,
2153,
353,
443,
22155,
29918,
1524,
519,
4197,
13,
1678,
313,
657,
5552,
29898,
16854,
29892,
525,
3954,
29891,
13404,
29918,
29915,
718,
1024,
511,
2393,
29897,
363,
1024,
29892,
2393,
29892,
903,
297,
29105,
29918,
1272,
2314,
13,
13,
1753,
4509,
29918,
657,
29898,
29893,
29918,
2783,
7283,
29892,
2913,
29892,
281,
29918,
5415,
1125,
13,
1678,
515,
869,
1639,
29886,
29918,
1853,
1053,
399,
29918,
3954,
29891,
2061,
13,
1678,
4974,
338,
8758,
29898,
29893,
29918,
2783,
7283,
29892,
399,
29918,
3954,
29891,
13404,
19124,
29897,
13,
1678,
1423,
29918,
2783,
7283,
29898,
3493,
29892,
281,
29918,
5415,
29892,
281,
29918,
2783,
7283,
29889,
29893,
29918,
1853,
29897,
13,
1678,
4974,
338,
8758,
29898,
29893,
29918,
5415,
29892,
399,
29918,
3954,
29891,
2061,
29897,
13,
1678,
28915,
353,
364,
600,
29875,
29889,
4384,
29898,
17744,
26785,
29892,
281,
29918,
5415,
29889,
29882,
2272,
29918,
1272,
29897,
718,
281,
29918,
2783,
7283,
29889,
10289,
13,
1678,
2924,
353,
281,
29918,
2783,
7283,
29889,
14380,
13,
1678,
363,
954,
29892,
2393,
297,
5486,
2153,
29901,
13,
4706,
565,
2924,
1275,
954,
29901,
13,
9651,
736,
2913,
29889,
1482,
524,
29898,
29878,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
22449,
511,
28915,
9601,
29900,
2314,
13,
1678,
565,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
29943,
3927,
1299,
29901,
13,
4706,
995,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
29878,
600,
29875,
29889,
29943,
3927,
1299,
511,
28915,
9601,
29900,
29962,
13,
4706,
736,
2913,
29889,
1482,
7411,
29898,
29878,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
3970,
7466,
1307,
29892,
995,
876,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
3970,
7466,
1307,
29901,
13,
4706,
995,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
29878,
600,
29875,
29889,
3970,
7466,
1307,
511,
28915,
9601,
29900,
29962,
13,
4706,
736,
2913,
29889,
1482,
7411,
29898,
1767,
29897,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
28443,
29901,
13,
4706,
995,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
29878,
600,
29875,
29889,
29965,
11282,
511,
28915,
9601,
29900,
29962,
13,
4706,
995,
353,
364,
600,
29875,
29889,
4384,
29898,
645,
1853,
29889,
10140,
287,
29892,
995,
29897,
13,
4706,
736,
2913,
29889,
1482,
11227,
29898,
11227,
29898,
1767,
876,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
11282,
29901,
13,
4706,
995,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
11282,
29925,
29892,
28915,
9601,
29900,
29962,
13,
4706,
736,
2913,
29889,
1482,
726,
29898,
1767,
29897,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
20785,
29901,
13,
4706,
274,
710,
29918,
29886,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
11282,
18009,
29892,
28915,
29897,
13,
4706,
565,
274,
710,
29918,
29886,
29961,
29900,
5387,
13,
9651,
995,
353,
364,
600,
29875,
29889,
3090,
29886,
29906,
710,
29898,
29883,
710,
29918,
29886,
29961,
29900,
2314,
13,
9651,
736,
2913,
29889,
1482,
726,
29898,
1767,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
2913,
29889,
29893,
29918,
8516,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
20785,
29918,
1177,
7390,
11538,
29901,
13,
4706,
995,
353,
364,
600,
29875,
29889,
3090,
29886,
29906,
710,
29898,
29878,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
11282,
29925,
29892,
28915,
876,
13,
4706,
736,
2913,
29889,
1482,
726,
29898,
1767,
29897,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
29940,
12413,
29901,
13,
4706,
736,
2913,
29889,
29893,
29918,
8516,
13,
1678,
1683,
29901,
13,
4706,
396,
4567,
29901,
438,
29933,
17637,
29892,
438,
29933,
17637,
29918,
5746,
13,
4706,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
3664,
1888,
2037,
287,
2392,
29892,
525,
856,
1495,
13,
13,
13,
1753,
4509,
29918,
842,
29898,
29893,
29918,
2783,
7283,
29892,
2913,
29892,
281,
29918,
5415,
29892,
281,
29918,
1767,
1125,
13,
1678,
515,
869,
1639,
29886,
29918,
1853,
1053,
399,
29918,
3954,
29891,
2061,
13,
1678,
4974,
338,
8758,
29898,
29893,
29918,
2783,
7283,
29892,
399,
29918,
3954,
29891,
13404,
19124,
29897,
13,
1678,
1423,
29918,
2783,
7283,
29898,
3493,
29892,
281,
29918,
5415,
29892,
281,
29918,
2783,
7283,
29889,
29893,
29918,
1853,
29897,
13,
1678,
4974,
338,
8758,
29898,
29893,
29918,
5415,
29892,
399,
29918,
3954,
29891,
2061,
29897,
13,
1678,
28915,
353,
364,
600,
29875,
29889,
4384,
29898,
17744,
26785,
29892,
281,
29918,
5415,
29889,
29882,
2272,
29918,
1272,
29897,
718,
281,
29918,
2783,
7283,
29889,
10289,
13,
1678,
2924,
353,
281,
29918,
2783,
7283,
29889,
14380,
13,
1678,
363,
954,
29892,
2393,
297,
5486,
2153,
29901,
13,
4706,
565,
2924,
1275,
954,
29901,
13,
9651,
396,
22615,
29901,
445,
338,
2743,
29991,
13,
9651,
995,
353,
2913,
29889,
524,
29918,
29893,
29898,
29893,
29918,
1767,
29897,
13,
9651,
23246,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
22449,
511,
28915,
29897,
13,
9651,
23246,
29961,
29900,
29962,
353,
364,
600,
29875,
29889,
4384,
29898,
22449,
29892,
995,
29897,
13,
9651,
736,
13,
1678,
565,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
29943,
3927,
1299,
29901,
13,
4706,
995,
353,
2913,
29889,
7411,
29918,
29893,
29898,
29893,
29918,
1767,
29897,
13,
4706,
23246,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
29878,
600,
29875,
29889,
29943,
3927,
1299,
511,
28915,
29897,
13,
4706,
23246,
29961,
29900,
29962,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29943,
3927,
1299,
29892,
995,
29897,
13,
4706,
736,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
3970,
7466,
1307,
29901,
13,
4706,
995,
353,
2913,
29889,
7411,
29918,
29893,
29898,
29893,
29918,
1767,
29897,
13,
4706,
23246,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
29878,
600,
29875,
29889,
3970,
7466,
1307,
511,
28915,
29897,
13,
4706,
23246,
29961,
29900,
29962,
353,
995,
13,
4706,
736,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
28443,
29901,
13,
4706,
565,
2913,
29889,
275,
29918,
29893,
29898,
29893,
29918,
1767,
29892,
2913,
29889,
29893,
29918,
8824,
1125,
13,
9651,
995,
353,
7700,
13,
4706,
25342,
2913,
29889,
275,
29918,
29893,
29898,
29893,
29918,
1767,
29892,
2913,
29889,
29893,
29918,
5574,
1125,
13,
9651,
995,
353,
5852,
13,
4706,
1683,
29901,
13,
9651,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
1542,
2392,
29892,
376,
12715,
995,
1134,
1818,
367,
6120,
1159,
13,
4706,
23246,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
2588,
12058,
29898,
29878,
600,
29875,
29889,
29965,
11282,
511,
28915,
29897,
13,
4706,
23246,
29961,
29900,
29962,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29965,
11282,
29892,
995,
29897,
13,
4706,
736,
13,
1678,
25342,
2924,
1275,
1174,
398,
29889,
3954,
29891,
13404,
29918,
11282,
29901,
13,
4706,
851,
29918,
1767,
353,
2913,
29889,
726,
29918,
29893,
29898,
29893,
29918,
1767,
29897,
13,
4706,
565,
7431,
29898,
710,
29918,
1767,
29897,
2804,
29871,
29896,
29901,
13,
9651,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
1542,
2392,
29892,
376,
1807,
310,
3309,
29871,
29896,
3806,
1159,
13,
4706,
23246,
353,
364,
600,
29875,
29889,
4384,
29898,
29878,
600,
29875,
29889,
29907,
11282,
29925,
29892,
28915,
29897,
13,
4706,
23246,
29961,
29900,
29962,
353,
851,
29918,
1767,
29961,
29900,
29962,
13,
1678,
25342,
2924,
297,
313,
16854,
29889,
3954,
29891,
13404,
29918,
20785,
29892,
13,
462,
29871,
1174,
398,
29889,
3954,
29891,
13404,
29918,
20785,
29918,
1177,
7390,
11538,
29892,
13,
462,
29871,
1174,
398,
29889,
3954,
29891,
13404,
29918,
29940,
12413,
1125,
13,
4706,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
1542,
2392,
29892,
525,
949,
6194,
5352,
1495,
13,
1678,
1683,
29901,
13,
4706,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
3664,
1888,
2037,
287,
2392,
29892,
525,
856,
1495,
13,
13,
1753,
4509,
29918,
6144,
29898,
29893,
29918,
2783,
7283,
29892,
2913,
29892,
281,
29918,
5415,
1125,
13,
1678,
1423,
29918,
2783,
7283,
29898,
3493,
29892,
281,
29918,
5415,
29892,
281,
29918,
2783,
7283,
29889,
29893,
29918,
1853,
29897,
13,
1678,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
1542,
2392,
29892,
13,
18884,
376,
3068,
29915,
29873,
5217,
16985,
29914,
3090,
5352,
1159,
13,
13,
13,
1990,
399,
29918,
3954,
29891,
13404,
19124,
29898,
2577,
2697,
4854,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
281,
29918,
1853,
29892,
2924,
29892,
1024,
29892,
1574,
29892,
9210,
29892,
338,
29918,
949,
6194,
1125,
13,
4706,
1583,
29889,
14380,
353,
2924,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
29889,
29893,
29918,
1853,
353,
281,
29918,
1853,
13,
4706,
1583,
29889,
10289,
353,
9210,
13,
4706,
1583,
29889,
275,
29918,
949,
6194,
353,
338,
29918,
949,
6194,
13,
4706,
565,
338,
29918,
949,
6194,
29901,
13,
9651,
731,
357,
353,
6213,
13,
9651,
316,
280,
357,
353,
6213,
13,
4706,
1683,
29901,
13,
9651,
731,
357,
353,
4509,
29918,
842,
13,
9651,
316,
280,
357,
353,
4509,
29918,
6144,
13,
4706,
3617,
2697,
4854,
17255,
2344,
12035,
13,
9651,
1583,
29892,
4509,
29918,
657,
29892,
731,
357,
29892,
316,
280,
357,
29892,
1574,
29892,
13,
9651,
1067,
29879,
29922,
8516,
29892,
671,
29918,
25071,
29922,
5574,
29892,
4055,
543,
29882,
2272,
29918,
14242,
1159,
13,
13,
1678,
822,
20623,
29918,
12715,
29898,
1311,
29892,
2913,
1125,
259,
396,
975,
17625,
13,
4706,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
6708,
2392,
29892,
13,
9651,
376,
12715,
14210,
29879,
29915,
310,
14210,
29940,
29915,
3618,
338,
451,
2044,
519,
613,
13,
9651,
1583,
29889,
978,
29892,
1583,
29889,
29893,
29918,
1853,
29897,
13,
13,
13,
29956,
29918,
3954,
29891,
13404,
19124,
29889,
1017,
9795,
1389,
353,
5167,
3206,
29898,
13,
1678,
376,
29882,
2272,
29918,
14242,
29918,
2783,
11709,
613,
13,
1678,
4770,
657,
1649,
29922,
1639,
29886,
29906,
932,
29898,
2577,
2697,
4854,
29889,
2783,
7283,
29918,
6799,
29918,
657,
511,
13,
1678,
4770,
842,
1649,
29922,
1639,
29886,
29906,
932,
29898,
2577,
2697,
4854,
29889,
2783,
7283,
29918,
6799,
29918,
842,
511,
13,
1678,
4770,
8143,
1649,
29922,
1639,
29886,
29906,
932,
29898,
2577,
2697,
4854,
29889,
2783,
7283,
29918,
6799,
29918,
6144,
511,
13,
1678,
4770,
978,
1649,
29922,
1639,
29886,
29918,
5552,
6799,
877,
978,
742,
1067,
29879,
29922,
2577,
2697,
4854,
29892,
13,
4706,
12244,
9144,
543,
1482,
726,
29918,
272,
29918,
9290,
4968,
13,
1678,
4770,
5415,
1990,
1649,
29922,
2577,
2697,
4854,
29898,
2577,
2697,
4854,
29889,
2783,
7283,
29918,
657,
29918,
5415,
1990,
511,
13,
1678,
4770,
1514,
1649,
29922,
1639,
29886,
29918,
5552,
6799,
877,
1514,
742,
1067,
29879,
29922,
2577,
2697,
4854,
29892,
13,
4706,
12244,
9144,
543,
1482,
726,
29918,
272,
29918,
9290,
4968,
13,
1678,
1723,
13,
9294,
451,
399,
29918,
3954,
29891,
13404,
19124,
29889,
1017,
9795,
1389,
29889,
16044,
519,
29918,
294,
29918,
3188,
29918,
1990,
29871,
396,
694,
4770,
1482,
1649,
13,
13,
1753,
788,
29918,
14242,
29898,
3493,
29892,
281,
29918,
1853,
29892,
298,
29886,
962,
1096,
1125,
13,
1678,
1024,
353,
364,
600,
29875,
29889,
3075,
3090,
29886,
29906,
710,
29898,
28887,
962,
1096,
29889,
29883,
29918,
978,
29897,
13,
1678,
2924,
353,
364,
600,
29875,
29889,
4384,
29898,
645,
1853,
29889,
10140,
287,
29892,
298,
29886,
962,
1096,
29889,
29883,
29918,
1853,
29897,
13,
1678,
9210,
353,
364,
600,
29875,
29889,
4384,
29898,
645,
1853,
29889,
10140,
287,
29892,
298,
29886,
962,
1096,
29889,
29883,
29918,
10289,
29897,
13,
1678,
20623,
353,
364,
600,
29875,
29889,
4384,
29898,
645,
1853,
29889,
10140,
287,
29892,
298,
29886,
962,
1096,
29889,
29883,
29918,
949,
6194,
29897,
13,
1678,
1574,
353,
364,
600,
29875,
29889,
3075,
3090,
29886,
29906,
710,
29898,
28887,
962,
1096,
29889,
29883,
29918,
1514,
29897,
565,
298,
29886,
962,
1096,
29889,
29883,
29918,
1514,
1683,
6213,
13,
1678,
281,
29918,
2783,
7283,
353,
399,
29918,
3954,
29891,
13404,
19124,
29898,
29893,
29918,
1853,
29892,
2924,
29892,
1024,
29892,
1574,
29892,
9210,
29892,
20623,
29897,
13,
1678,
281,
29918,
1853,
29889,
842,
8977,
1767,
29898,
3493,
29892,
1024,
29892,
281,
29918,
2783,
7283,
29897,
13,
13,
13,
29937,
1275,
2751,
1360,
379,
19737,
3206,
29918,
11885,
29918,
2577,
2697,
1275,
2751,
1360,
13,
13,
1753,
679,
842,
29918,
657,
29898,
29893,
29918,
657,
842,
29892,
2913,
29892,
281,
29918,
1311,
1125,
13,
1678,
2106,
353,
2913,
29889,
3166,
8173,
29898,
2792,
29897,
13,
1678,
274,
9891,
7414,
353,
281,
29918,
657,
842,
29889,
29882,
2272,
657,
842,
29889,
29883,
29918,
657,
357,
29918,
13699,
13,
1678,
3653,
353,
301,
433,
1631,
29889,
312,
29879,
29889,
4384,
877,
3954,
29891,
14400,
29918,
657,
357,
742,
274,
9891,
7414,
29897,
13,
1678,
411,
17766,
29889,
4746,
29898,
3493,
29892,
281,
29918,
1311,
29897,
408,
298,
29918,
1311,
29901,
13,
4706,
298,
29918,
2914,
353,
3653,
29898,
3859,
29889,
13073,
29892,
298,
29918,
1311,
29892,
281,
29918,
657,
842,
29889,
29882,
2272,
657,
842,
29889,
29883,
29918,
25071,
29897,
13,
1678,
736,
17766,
29889,
3200,
2017,
29898,
3493,
29892,
298,
29918,
2914,
29897,
13,
268,
13,
1753,
679,
842,
29918,
842,
29898,
29893,
29918,
657,
842,
29892,
2913,
29892,
281,
29918,
1311,
29892,
281,
29918,
1767,
1125,
13,
1678,
2106,
353,
2913,
29889,
3166,
8173,
29898,
2792,
29897,
13,
1678,
274,
9891,
7414,
353,
281,
29918,
657,
842,
29889,
29882,
2272,
657,
842,
29889,
29883,
29918,
842,
357,
29918,
13699,
13,
1678,
3653,
353,
301,
433,
1631,
29889,
312,
29879,
29889,
4384,
877,
3954,
29891,
14400,
29918,
842,
357,
742,
274,
9891,
7414,
29897,
13,
1678,
411,
17766,
29889,
4746,
29898,
3493,
29892,
281,
29918,
1311,
29892,
281,
29918,
1767,
29897,
408,
313,
29882,
29918,
1311,
29892,
298,
29918,
1767,
1125,
13,
4706,
298,
29918,
2914,
353,
3653,
29898,
3859,
29889,
13073,
29892,
298,
29918,
1311,
29892,
298,
29918,
1767,
29892,
281,
29918,
657,
842,
29889,
29882,
2272,
657,
842,
29889,
29883,
29918,
25071,
29897,
13,
4706,
396,
22615,
29901,
2436,
263,
1243,
304,
1423,
393,
591,
437,
278,
1959,
2655,
565,
13,
4706,
396,
274,
29918,
842,
357,
1153,
4637,
385,
3682,
13,
13,
13,
1990,
399,
29918,
3954,
29891,
2577,
2697,
4854,
29898,
2577,
2697,
4854,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
281,
29918,
1853,
29892,
298,
2272,
657,
842,
1125,
13,
4706,
1583,
29889,
29882,
2272,
657,
842,
353,
298,
2272,
657,
842,
13,
4706,
1583,
29889,
29893,
29918,
1853,
353,
281,
29918,
1853,
13,
4706,
396,
13,
4706,
1024,
353,
364,
600,
29875,
29889,
3075,
3090,
29886,
29906,
710,
29898,
29882,
2272,
657,
842,
29889,
29883,
29918,
978,
29897,
13,
4706,
1574,
353,
285,
842,
353,
285,
657,
353,
285,
6144,
353,
6213,
13,
4706,
565,
298,
2272,
657,
842,
29889,
29883,
29918,
1514,
29901,
13,
9651,
1574,
353,
364,
600,
29875,
29889,
3075,
3090,
29886,
29906,
710,
29898,
29882,
2272,
657,
842,
29889,
29883,
29918,
1514,
29897,
13,
4706,
565,
298,
2272,
657,
842,
29889,
29883,
29918,
657,
357,
29918,
13699,
29901,
13,
9651,
285,
657,
353,
679,
842,
29918,
657,
13,
4706,
565,
298,
2272,
657,
842,
29889,
29883,
29918,
842,
357,
29918,
13699,
29901,
13,
9651,
285,
842,
353,
679,
842,
29918,
842,
13,
9651,
396,
22615,
29901,
2436,
263,
1243,
304,
1423,
393,
525,
6144,
29915,
1736,
13,
9651,
396,
29888,
6144,
353,
2023,
13,
4706,
3617,
2697,
4854,
17255,
2344,
12035,
1311,
29892,
285,
657,
29892,
285,
842,
29892,
285,
6144,
29892,
1574,
29892,
13,
462,
18884,
1067,
29879,
29922,
8516,
29892,
671,
29918,
25071,
29922,
5574,
29892,
13,
462,
18884,
4055,
543,
29882,
2272,
29918,
657,
842,
613,
1024,
29922,
978,
29897,
13,
13,
1678,
822,
20623,
29918,
12715,
29898,
1311,
29892,
2913,
1125,
259,
396,
975,
17625,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
396,
22615,
2436,
263,
1243,
13,
4706,
444,
12020,
288,
1389,
4378,
29898,
3493,
29889,
29893,
29918,
6708,
2392,
29892,
13,
4706,
444,
268,
376,
12715,
14210,
29879,
29915,
310,
14210,
29940,
29915,
3618,
338,
451,
2044,
519,
613,
13,
4706,
444,
268,
1583,
29889,
978,
29892,
1583,
29889,
29893,
29918,
1853,
29897,
13,
13,
13,
13,
1753,
788,
29918,
657,
842,
29898,
3493,
29892,
281,
29918,
1853,
29892,
298,
2272,
657,
842,
1125,
13,
1678,
281,
29918,
2783,
7283,
353,
399,
29918,
3954,
29891,
2577,
2697,
4854,
29898,
29893,
29918,
1853,
29892,
298,
2272,
657,
842,
29897,
13,
1678,
281,
29918,
1853,
29889,
842,
8977,
1767,
29898,
3493,
29892,
281,
29918,
2783,
7283,
29889,
978,
29892,
281,
29918,
2783,
7283,
29897,
13,
1678,
396,
13,
1678,
396,
278,
1494,
338,
4312,
304,
9801,
393,
591,
9732,
403,
679,
842,
29918,
15966,
1683,
13,
1678,
396,
1243,
29918,
29920,
3286,
18411,
8465,
13,
1678,
565,
756,
5552,
29898,
3493,
29892,
525,
275,
29918,
29888,
1296,
29918,
5415,
3493,
29374,
13,
4706,
281,
29918,
2783,
7283,
29889,
2783,
7283,
29918,
6799,
29918,
657,
29898,
3493,
29892,
2913,
29889,
29893,
29918,
8516,
29897,
13,
4706,
281,
29918,
2783,
7283,
29889,
2783,
7283,
29918,
6799,
29918,
842,
29898,
3493,
29892,
2913,
29889,
29893,
29918,
8516,
29892,
2913,
29889,
29893,
29918,
8516,
29897,
13,
2
] |
lib/surface/pubsub/subscriptions/update.py | kylewuolle/google-cloud-sdk | 0 | 198196 | # -*- coding: utf-8 -*- #
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Cloud Pub/Sub subscriptions update command."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.pubsub import subscriptions
from googlecloudsdk.api_lib.util import exceptions
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.pubsub import flags
from googlecloudsdk.command_lib.pubsub import resource_args
from googlecloudsdk.command_lib.pubsub import util
from googlecloudsdk.command_lib.util.args import labels_util
from googlecloudsdk.core import log
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA)
class UpdateAlpha(base.UpdateCommand):
"""Updates an existing Cloud Pub/Sub subscription."""
@classmethod
def Args(cls, parser):
resource_args.AddSubscriptionResourceArg(parser, 'to update.')
flags.AddSubscriptionSettingsFlags(parser, cls.ReleaseTrack(),
is_update=True)
labels_util.AddUpdateLabelsFlags(parser)
@exceptions.CatchHTTPErrorRaiseHTTPException()
def Run(self, args):
"""This is what gets called when the user runs this command.
Args:
args: an argparse namespace. All the arguments that were provided to this
command invocation.
Returns:
A serialized object (dict) describing the results of the operation. This
description fits the Resource described in the ResourceRegistry under
'pubsub.projects.subscriptions'.
Raises:
An HttpException if there was a problem calling the
API subscriptions.Patch command.
"""
client = subscriptions.SubscriptionsClient()
subscription_ref = args.CONCEPTS.subscription.Parse()
labels_update = labels_util.ProcessUpdateArgsLazy(
args, client.messages.Subscription.LabelsValue,
orig_labels_thunk=lambda: client.Get(subscription_ref).labels)
no_expiration = False
expiration_period = getattr(args, 'expiration_period', None)
if expiration_period:
if expiration_period == subscriptions.NEVER_EXPIRATION_PERIOD_VALUE:
no_expiration = True
expiration_period = None
try:
result = client.Patch(
subscription_ref,
ack_deadline=args.ack_deadline,
push_config=util.ParsePushConfig(args.push_endpoint),
retain_acked_messages=args.retain_acked_messages,
labels=labels_update.GetOrNone(),
message_retention_duration=args.message_retention_duration,
no_expiration=no_expiration,
expiration_period=expiration_period)
except subscriptions.NoFieldsSpecifiedError:
if not any(args.IsSpecified(arg) for arg in ('clear_labels',
'update_labels',
'remove_labels')):
raise
log.status.Print('No update to perform.')
result = None
else:
log.UpdatedResource(subscription_ref.RelativeName(), kind='subscription')
return result
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
396,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29953,
5087,
9266,
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,
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,
13,
15945,
29908,
20442,
8042,
29914,
4035,
21696,
1980,
2767,
1899,
1213,
15945,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
5386,
9274,
15348,
29889,
2754,
29918,
1982,
29889,
5467,
1491,
1053,
21696,
1980,
13,
3166,
5386,
9274,
15348,
29889,
2754,
29918,
1982,
29889,
4422,
1053,
15283,
13,
3166,
5386,
9274,
15348,
29889,
1052,
492,
2300,
1053,
2967,
13,
3166,
5386,
9274,
15348,
29889,
6519,
29918,
1982,
29889,
5467,
1491,
1053,
13449,
13,
3166,
5386,
9274,
15348,
29889,
6519,
29918,
1982,
29889,
5467,
1491,
1053,
6503,
29918,
5085,
13,
3166,
5386,
9274,
15348,
29889,
6519,
29918,
1982,
29889,
5467,
1491,
1053,
3667,
13,
3166,
5386,
9274,
15348,
29889,
6519,
29918,
1982,
29889,
4422,
29889,
5085,
1053,
11073,
29918,
4422,
13,
3166,
5386,
9274,
15348,
29889,
3221,
1053,
1480,
13,
13,
13,
29992,
3188,
29889,
19729,
5323,
4684,
29898,
3188,
29889,
19729,
17936,
29889,
1964,
29925,
15715,
29892,
2967,
29889,
19729,
17936,
29889,
29933,
2544,
29909,
29897,
13,
1990,
10318,
28630,
29898,
3188,
29889,
6422,
6255,
1125,
13,
29871,
9995,
3373,
15190,
385,
5923,
14293,
8042,
29914,
4035,
25691,
1213,
15945,
13,
13,
29871,
732,
1990,
5696,
13,
29871,
822,
826,
3174,
29898,
25932,
29892,
13812,
1125,
13,
1678,
6503,
29918,
5085,
29889,
2528,
4035,
22371,
6848,
8559,
29898,
16680,
29892,
525,
517,
2767,
29889,
1495,
13,
1678,
13449,
29889,
2528,
4035,
22371,
9585,
15675,
29898,
16680,
29892,
1067,
29879,
29889,
19729,
17936,
3285,
13,
462,
462,
539,
338,
29918,
5504,
29922,
5574,
29897,
13,
13,
1678,
11073,
29918,
4422,
29889,
2528,
6422,
4775,
29879,
15675,
29898,
16680,
29897,
13,
13,
29871,
732,
11739,
29879,
29889,
29907,
905,
10493,
2392,
29934,
29874,
895,
10493,
2451,
580,
13,
29871,
822,
7525,
29898,
1311,
29892,
6389,
1125,
13,
1678,
9995,
4013,
338,
825,
4947,
2000,
746,
278,
1404,
6057,
445,
1899,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
6389,
29901,
385,
1852,
5510,
7397,
29889,
2178,
278,
6273,
393,
892,
4944,
304,
445,
13,
4706,
1899,
2437,
10610,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
319,
7797,
1891,
1203,
313,
8977,
29897,
20766,
278,
2582,
310,
278,
5858,
29889,
910,
13,
418,
6139,
23994,
278,
18981,
5439,
297,
278,
18981,
22579,
1090,
13,
418,
525,
5467,
1491,
29889,
16418,
29889,
1491,
7588,
1980,
4286,
13,
13,
1678,
390,
1759,
267,
29901,
13,
418,
530,
9056,
2451,
565,
727,
471,
263,
1108,
5432,
278,
13,
418,
3450,
21696,
1980,
29889,
29925,
905,
1899,
29889,
13,
1678,
9995,
13,
1678,
3132,
353,
21696,
1980,
29889,
4035,
7588,
1980,
4032,
580,
13,
1678,
25691,
29918,
999,
353,
6389,
29889,
6007,
4741,
7982,
29903,
29889,
1491,
22371,
29889,
12914,
580,
13,
13,
1678,
11073,
29918,
5504,
353,
11073,
29918,
4422,
29889,
7032,
6422,
7883,
29931,
24683,
29898,
13,
4706,
6389,
29892,
3132,
29889,
19158,
29889,
4035,
22371,
29889,
4775,
29879,
1917,
29892,
13,
4706,
1677,
29918,
21134,
29918,
386,
2960,
29922,
2892,
29901,
3132,
29889,
2577,
29898,
1491,
22371,
29918,
999,
467,
21134,
29897,
13,
13,
1678,
694,
29918,
4548,
12232,
353,
7700,
13,
1678,
1518,
12232,
29918,
19145,
353,
679,
5552,
29898,
5085,
29892,
525,
4548,
12232,
29918,
19145,
742,
6213,
29897,
13,
1678,
565,
1518,
12232,
29918,
19145,
29901,
13,
418,
565,
1518,
12232,
29918,
19145,
1275,
21696,
1980,
29889,
8186,
5348,
29918,
5746,
2227,
29934,
8098,
29918,
13171,
5971,
29928,
29918,
19143,
29901,
13,
4706,
694,
29918,
4548,
12232,
353,
5852,
13,
4706,
1518,
12232,
29918,
19145,
353,
6213,
13,
13,
1678,
1018,
29901,
13,
418,
1121,
353,
3132,
29889,
29925,
905,
29898,
13,
3986,
25691,
29918,
999,
29892,
13,
3986,
263,
384,
29918,
311,
328,
1220,
29922,
5085,
29889,
547,
29918,
311,
328,
1220,
29892,
13,
3986,
5503,
29918,
2917,
29922,
4422,
29889,
12914,
27031,
3991,
29898,
5085,
29889,
5910,
29918,
29734,
511,
13,
3986,
11551,
29918,
547,
287,
29918,
19158,
29922,
5085,
29889,
2267,
475,
29918,
547,
287,
29918,
19158,
29892,
13,
3986,
11073,
29922,
21134,
29918,
5504,
29889,
2577,
2816,
8516,
3285,
13,
3986,
2643,
29918,
2267,
2509,
29918,
19708,
29922,
5085,
29889,
4906,
29918,
2267,
2509,
29918,
19708,
29892,
13,
3986,
694,
29918,
4548,
12232,
29922,
1217,
29918,
4548,
12232,
29892,
13,
3986,
1518,
12232,
29918,
19145,
29922,
4548,
12232,
29918,
19145,
29897,
13,
1678,
5174,
21696,
1980,
29889,
3782,
14256,
10299,
2164,
2392,
29901,
13,
418,
565,
451,
738,
29898,
5085,
29889,
3624,
10299,
2164,
29898,
1191,
29897,
363,
1852,
297,
6702,
8551,
29918,
21134,
742,
13,
462,
462,
462,
259,
525,
5504,
29918,
21134,
742,
13,
462,
462,
462,
259,
525,
5992,
29918,
21134,
8785,
29901,
13,
4706,
12020,
13,
418,
1480,
29889,
4882,
29889,
11816,
877,
3782,
2767,
304,
2189,
29889,
1495,
13,
418,
1121,
353,
6213,
13,
1678,
1683,
29901,
13,
418,
1480,
29889,
29248,
6848,
29898,
1491,
22371,
29918,
999,
29889,
18278,
1170,
3285,
2924,
2433,
1491,
22371,
1495,
13,
1678,
736,
1121,
13,
2
] |
polecat/db/sql/expression/values.py | furious-luke/polecat | 4 | 5146 | <reponame>furious-luke/polecat
from functools import partial
from polecat.db.query import query as query_module
from psycopg2.sql import SQL, Placeholder
from .expression import Expression
class Values(Expression):
def __init__(self, values, relation=None):
self.values = values
self.relation = relation
self.keyword = 'VALUES'
def to_sql(self):
if isinstance(self.values, query_module.Values):
get_values_sql = partial(
self.get_values_sql_from_values, self.values
)
else:
get_values_sql = partial(
self.get_values_sql_from_dict, self.values
)
return self.get_values_sql(get_values_sql)
def get_values_sql(self, get_values_sql):
values_sql, values_args = get_values_sql()
joined_sql = SQL(', ').join(
SQL('({})').format(
SQL(', ').join(row_sql)
)
for row_sql in values_sql
)
return SQL('%s {}' % self.keyword).format(joined_sql), values_args
def get_values_sql_from_values(self, values):
column_values_sql = []
column_values = ()
for row in values.iter_rows():
row_values_sql = []
for column_name, column_value in row:
value_sql, value = self.value_to_sql(column_value, column_name)
row_values_sql.append(value_sql)
column_values += value
column_values_sql.append(row_values_sql)
return column_values_sql, column_values
def get_values_sql_from_dict(self, values_dict):
column_values_sql = []
column_values = ()
for column_name, column_value in values_dict.items():
value_sql, value = self.value_to_sql(column_value, column_name)
column_values_sql.append(value_sql)
column_values += value
return (column_values_sql,), column_values
def value_to_sql(self, value, column_name=None):
if isinstance(value, Expression):
sql, args = value.to_sql()
return SQL('{}').format(sql), args
else:
if self.relation and column_name:
column = self.relation.get_column(column_name)
value = column.to_db_value(value)
return Placeholder(), (value,)
def iter_column_names(self):
if isinstance(self.values, dict):
return self.values.keys()
else:
return self.values.iter_column_names()
| [
1,
529,
276,
1112,
420,
29958,
22613,
2738,
29899,
6092,
446,
29914,
15831,
4117,
13,
3166,
2090,
312,
8789,
1053,
7687,
13,
13,
3166,
22775,
4117,
29889,
2585,
29889,
1972,
1053,
2346,
408,
2346,
29918,
5453,
13,
3166,
6529,
29891,
9708,
29887,
29906,
29889,
2850,
1053,
3758,
29892,
15484,
7694,
13,
13,
3166,
869,
17471,
1053,
21444,
13,
13,
13,
1990,
2630,
1041,
29898,
10960,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1819,
29892,
8220,
29922,
8516,
1125,
13,
4706,
1583,
29889,
5975,
353,
1819,
13,
4706,
1583,
29889,
23445,
353,
8220,
13,
4706,
1583,
29889,
26766,
353,
525,
8932,
12996,
29915,
13,
13,
1678,
822,
304,
29918,
2850,
29898,
1311,
1125,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
5975,
29892,
2346,
29918,
5453,
29889,
9065,
1125,
13,
9651,
679,
29918,
5975,
29918,
2850,
353,
7687,
29898,
13,
18884,
1583,
29889,
657,
29918,
5975,
29918,
2850,
29918,
3166,
29918,
5975,
29892,
1583,
29889,
5975,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
679,
29918,
5975,
29918,
2850,
353,
7687,
29898,
13,
18884,
1583,
29889,
657,
29918,
5975,
29918,
2850,
29918,
3166,
29918,
8977,
29892,
1583,
29889,
5975,
13,
9651,
1723,
13,
4706,
736,
1583,
29889,
657,
29918,
5975,
29918,
2850,
29898,
657,
29918,
5975,
29918,
2850,
29897,
13,
13,
1678,
822,
679,
29918,
5975,
29918,
2850,
29898,
1311,
29892,
679,
29918,
5975,
29918,
2850,
1125,
13,
4706,
1819,
29918,
2850,
29892,
1819,
29918,
5085,
353,
679,
29918,
5975,
29918,
2850,
580,
13,
4706,
8772,
29918,
2850,
353,
3758,
29317,
525,
467,
7122,
29898,
13,
9651,
3758,
877,
3319,
1800,
2824,
4830,
29898,
13,
18884,
3758,
29317,
525,
467,
7122,
29898,
798,
29918,
2850,
29897,
13,
9651,
1723,
13,
9651,
363,
1948,
29918,
2850,
297,
1819,
29918,
2850,
13,
4706,
1723,
13,
4706,
736,
3758,
877,
29995,
29879,
6571,
29915,
1273,
1583,
29889,
26766,
467,
4830,
29898,
2212,
1312,
29918,
2850,
511,
1819,
29918,
5085,
13,
13,
1678,
822,
679,
29918,
5975,
29918,
2850,
29918,
3166,
29918,
5975,
29898,
1311,
29892,
1819,
1125,
13,
4706,
1897,
29918,
5975,
29918,
2850,
353,
5159,
13,
4706,
1897,
29918,
5975,
353,
3861,
13,
4706,
363,
1948,
297,
1819,
29889,
1524,
29918,
5727,
7295,
13,
9651,
1948,
29918,
5975,
29918,
2850,
353,
5159,
13,
9651,
363,
1897,
29918,
978,
29892,
1897,
29918,
1767,
297,
1948,
29901,
13,
18884,
995,
29918,
2850,
29892,
995,
353,
1583,
29889,
1767,
29918,
517,
29918,
2850,
29898,
4914,
29918,
1767,
29892,
1897,
29918,
978,
29897,
13,
18884,
1948,
29918,
5975,
29918,
2850,
29889,
4397,
29898,
1767,
29918,
2850,
29897,
13,
18884,
1897,
29918,
5975,
4619,
995,
13,
9651,
1897,
29918,
5975,
29918,
2850,
29889,
4397,
29898,
798,
29918,
5975,
29918,
2850,
29897,
13,
4706,
736,
1897,
29918,
5975,
29918,
2850,
29892,
1897,
29918,
5975,
13,
13,
1678,
822,
679,
29918,
5975,
29918,
2850,
29918,
3166,
29918,
8977,
29898,
1311,
29892,
1819,
29918,
8977,
1125,
13,
4706,
1897,
29918,
5975,
29918,
2850,
353,
5159,
13,
4706,
1897,
29918,
5975,
353,
3861,
13,
4706,
363,
1897,
29918,
978,
29892,
1897,
29918,
1767,
297,
1819,
29918,
8977,
29889,
7076,
7295,
13,
9651,
995,
29918,
2850,
29892,
995,
353,
1583,
29889,
1767,
29918,
517,
29918,
2850,
29898,
4914,
29918,
1767,
29892,
1897,
29918,
978,
29897,
13,
9651,
1897,
29918,
5975,
29918,
2850,
29889,
4397,
29898,
1767,
29918,
2850,
29897,
13,
9651,
1897,
29918,
5975,
4619,
995,
13,
4706,
736,
313,
4914,
29918,
5975,
29918,
2850,
29892,
511,
1897,
29918,
5975,
13,
13,
1678,
822,
995,
29918,
517,
29918,
2850,
29898,
1311,
29892,
995,
29892,
1897,
29918,
978,
29922,
8516,
1125,
13,
4706,
565,
338,
8758,
29898,
1767,
29892,
21444,
1125,
13,
9651,
4576,
29892,
6389,
353,
995,
29889,
517,
29918,
2850,
580,
13,
9651,
736,
3758,
877,
8875,
2824,
4830,
29898,
2850,
511,
6389,
13,
4706,
1683,
29901,
13,
9651,
565,
1583,
29889,
23445,
322,
1897,
29918,
978,
29901,
13,
18884,
1897,
353,
1583,
29889,
23445,
29889,
657,
29918,
4914,
29898,
4914,
29918,
978,
29897,
13,
18884,
995,
353,
1897,
29889,
517,
29918,
2585,
29918,
1767,
29898,
1767,
29897,
13,
9651,
736,
15484,
7694,
3285,
313,
1767,
29892,
29897,
13,
13,
1678,
822,
4256,
29918,
4914,
29918,
7039,
29898,
1311,
1125,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
5975,
29892,
9657,
1125,
13,
9651,
736,
1583,
29889,
5975,
29889,
8149,
580,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
29889,
5975,
29889,
1524,
29918,
4914,
29918,
7039,
580,
13,
2
] |
_test_request.py | arshadkazmi42/crul | 6 | 32028 | <filename>_test_request.py
import unittest
from unittest.mock import Mock, patch
from request import Request
RESPONSE = {
"status": "success",
"message": "Processed"
}
class Response:
def __init__(self):
self.text = RESPONSE['message']
def json(self):
return RESPONSE
mock_response = Response()
class TestRequest(unittest.TestCase):
def test_init(self):
request = Request()
self.assertNotEqual(request.headers, None, f'Should not be None')
self.assertNotEqual(request.timeout, None, f'Should not be None')
@patch('request.requests.head')
def test_head(self, mock_head):
URL = 'https://example.com/working'
mock_head.return_value.status_code = 200
request = Request()
self.assertEqual(request.head(URL).status_code, 200, f'Should return 200 status code')
@patch('request.requests.head')
def test_status_code_400(self, mock_head):
URL = 'https://example.com/not_found'
mock_head.return_value.status_code = 400
request = Request()
self.assertEqual(request.get_status_code(URL), 400, f'Should return 400 status code')
@patch('request.requests.get')
def test_get(self, mock_get):
URL = 'https://example.com/working'
mock_get.return_value = mock_response
request = Request()
response = request.get(URL)
response = response.json()
self.assertEqual(response['status'], RESPONSE['status'], f'Should return success status')
self.assertEqual(response['message'], RESPONSE['message'], f'Should return Processed message')
@patch('request.requests.get')
def test_get_text_response(self, mock_post):
URL = 'https://example.com/working'
mock_post.return_value = mock_response
request = Request()
response = request.get_text_response(URL)
self.assertEqual(response, RESPONSE['message'], f'Should {RESPONSE["message"]} message')
@patch('request.requests.get')
def test_get_json_response(self, mock_post):
URL = 'https://example.com/working'
mock_post.return_value = mock_response
request = Request()
response = request.get_json_response(URL)
self.assertEqual(response['status'], RESPONSE['status'], f'Should return success status')
self.assertEqual(response['message'], RESPONSE['message'], f'Should return Processed message')
if __name__ == '__main__':
unittest.main() | [
1,
529,
9507,
29958,
29918,
1688,
29918,
3827,
29889,
2272,
13,
5215,
443,
27958,
13,
3166,
443,
27958,
29889,
17640,
1053,
26297,
29892,
13261,
13,
13,
3166,
2009,
1053,
10729,
13,
13,
13,
1525,
5550,
1164,
1660,
353,
426,
13,
1678,
376,
4882,
1115,
376,
8698,
613,
13,
1678,
376,
4906,
1115,
376,
7032,
287,
29908,
13,
29913,
13,
13,
1990,
13291,
29901,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
726,
353,
390,
2890,
29925,
1164,
1660,
1839,
4906,
2033,
13,
13,
1678,
822,
4390,
29898,
1311,
1125,
13,
4706,
736,
390,
2890,
29925,
1164,
1660,
13,
13,
13,
17640,
29918,
5327,
353,
13291,
580,
13,
13,
13,
1990,
4321,
3089,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
1243,
29918,
2344,
29898,
1311,
1125,
13,
13,
4706,
2009,
353,
10729,
580,
13,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
3827,
29889,
13662,
29892,
6213,
29892,
285,
29915,
26857,
451,
367,
6213,
1495,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
3827,
29889,
15619,
29892,
6213,
29892,
285,
29915,
26857,
451,
367,
6213,
1495,
13,
13,
1678,
732,
5041,
877,
3827,
29889,
24830,
29889,
2813,
1495,
13,
1678,
822,
1243,
29918,
2813,
29898,
1311,
29892,
11187,
29918,
2813,
1125,
13,
13,
4706,
3988,
353,
525,
991,
597,
4773,
29889,
510,
29914,
22899,
29915,
13,
13,
4706,
11187,
29918,
2813,
29889,
2457,
29918,
1767,
29889,
4882,
29918,
401,
353,
29871,
29906,
29900,
29900,
13,
13,
4706,
2009,
353,
10729,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3827,
29889,
2813,
29898,
4219,
467,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29892,
285,
29915,
26857,
736,
29871,
29906,
29900,
29900,
4660,
775,
1495,
13,
13,
1678,
732,
5041,
877,
3827,
29889,
24830,
29889,
2813,
1495,
13,
1678,
822,
1243,
29918,
4882,
29918,
401,
29918,
29946,
29900,
29900,
29898,
1311,
29892,
11187,
29918,
2813,
1125,
13,
13,
4706,
3988,
353,
525,
991,
597,
4773,
29889,
510,
29914,
1333,
29918,
11940,
29915,
13,
13,
4706,
11187,
29918,
2813,
29889,
2457,
29918,
1767,
29889,
4882,
29918,
401,
353,
29871,
29946,
29900,
29900,
13,
13,
4706,
2009,
353,
10729,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3827,
29889,
657,
29918,
4882,
29918,
401,
29898,
4219,
511,
29871,
29946,
29900,
29900,
29892,
285,
29915,
26857,
736,
29871,
29946,
29900,
29900,
4660,
775,
1495,
13,
13,
1678,
732,
5041,
877,
3827,
29889,
24830,
29889,
657,
1495,
13,
1678,
822,
1243,
29918,
657,
29898,
1311,
29892,
11187,
29918,
657,
1125,
13,
13,
4706,
3988,
353,
525,
991,
597,
4773,
29889,
510,
29914,
22899,
29915,
13,
308,
13,
4706,
11187,
29918,
657,
29889,
2457,
29918,
1767,
353,
11187,
29918,
5327,
13,
13,
4706,
2009,
353,
10729,
580,
13,
4706,
2933,
353,
2009,
29889,
657,
29898,
4219,
29897,
13,
4706,
2933,
353,
2933,
29889,
3126,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
1839,
4882,
7464,
390,
2890,
29925,
1164,
1660,
1839,
4882,
7464,
285,
29915,
26857,
736,
2551,
4660,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
1839,
4906,
7464,
390,
2890,
29925,
1164,
1660,
1839,
4906,
7464,
285,
29915,
26857,
736,
10554,
287,
2643,
1495,
13,
13,
1678,
732,
5041,
877,
3827,
29889,
24830,
29889,
657,
1495,
13,
1678,
822,
1243,
29918,
657,
29918,
726,
29918,
5327,
29898,
1311,
29892,
11187,
29918,
2490,
1125,
13,
13,
4706,
3988,
353,
525,
991,
597,
4773,
29889,
510,
29914,
22899,
29915,
13,
13,
4706,
11187,
29918,
2490,
29889,
2457,
29918,
1767,
353,
11187,
29918,
5327,
13,
13,
4706,
2009,
353,
10729,
580,
13,
4706,
2933,
353,
2009,
29889,
657,
29918,
726,
29918,
5327,
29898,
4219,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29892,
390,
2890,
29925,
1164,
1660,
1839,
4906,
7464,
285,
29915,
26857,
426,
1525,
5550,
1164,
1660,
3366,
4906,
3108,
29913,
2643,
1495,
13,
13,
1678,
732,
5041,
877,
3827,
29889,
24830,
29889,
657,
1495,
13,
1678,
822,
1243,
29918,
657,
29918,
3126,
29918,
5327,
29898,
1311,
29892,
11187,
29918,
2490,
1125,
13,
13,
4706,
3988,
353,
525,
991,
597,
4773,
29889,
510,
29914,
22899,
29915,
13,
13,
4706,
11187,
29918,
2490,
29889,
2457,
29918,
1767,
353,
11187,
29918,
5327,
13,
13,
4706,
2009,
353,
10729,
580,
13,
4706,
2933,
353,
2009,
29889,
657,
29918,
3126,
29918,
5327,
29898,
4219,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
1839,
4882,
7464,
390,
2890,
29925,
1164,
1660,
1839,
4882,
7464,
285,
29915,
26857,
736,
2551,
4660,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
1839,
4906,
7464,
390,
2890,
29925,
1164,
1660,
1839,
4906,
7464,
285,
29915,
26857,
736,
10554,
287,
2643,
1495,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
2
] |
src/Knn-Tensor.py | python-itb/knn-from-scratch | 0 | 7923 | <reponame>python-itb/knn-from-scratch
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 13 18:52:28 2018
@author: amajidsinar
"""
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-white')
iris = datasets.load_iris()
dataset = iris.data
# only take 0th and 1th column for X
data_known = iris.data[:,:2]
# y
label_known = iris.target
# the hard part
# so matplotlib does not readily support labeling based on class
# but we know that one of the feature of plt is that a plt call would give those set of number
# the same color
category = np.unique(label_known)
for i in category:
plt.scatter(data_known[label_known==i][:,0],data_known[label_known==i][:,1],label=i)
# Unknown class of a data
data_unknown = np.array([[5.7,3.3],[5.6,3.4],[6.4,3],[8.2,2.2]])
plt.scatter(data_unknown[:,0],data_unknown[:,1], label='?')
plt.legend()
#-------------
# Euclidean Distance
diff = data_known - data_unknown.reshape(data_unknown.shape[0],1,data_unknown.shape[1])
distance = (diff**2).sum(2)
#return sorted index of distance
dist_index = np.argsort(distance)
label = label_known[dist_index]
#for k in [1,2,3,4,5,6,7,8,9,10]:
#keep the rank
k = 10
label = label[:,:k]
label_predict = []
for i in range(data_unknown.shape[0]):
values,counts = np.unique(label[i], return_counts=True)
ind = np.argmax(counts)
label_predict.append(values[ind])
| [
1,
529,
276,
1112,
420,
29958,
4691,
29899,
277,
29890,
29914,
3959,
29876,
29899,
3166,
29899,
10526,
905,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
20399,
373,
323,
434,
26319,
29871,
29896,
29941,
29871,
29896,
29947,
29901,
29945,
29906,
29901,
29906,
29947,
29871,
29906,
29900,
29896,
29947,
13,
13,
29992,
8921,
29901,
626,
1175,
4841,
18220,
13,
15945,
29908,
13,
13,
3166,
2071,
19668,
1053,
20035,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
12655,
408,
7442,
13,
572,
29873,
29889,
3293,
29889,
1509,
877,
344,
370,
1398,
29899,
10921,
1495,
13,
13,
381,
275,
353,
20035,
29889,
1359,
29918,
381,
275,
580,
13,
13,
24713,
353,
3805,
275,
29889,
1272,
13,
29937,
871,
2125,
29871,
29900,
386,
322,
29871,
29896,
386,
1897,
363,
1060,
13,
1272,
29918,
5203,
353,
3805,
275,
29889,
1272,
7503,
29892,
29901,
29906,
29962,
13,
29937,
343,
13,
1643,
29918,
5203,
353,
3805,
275,
29889,
5182,
13,
13,
29937,
278,
2898,
760,
13,
29937,
577,
22889,
947,
451,
28520,
2304,
3858,
292,
2729,
373,
770,
13,
29937,
541,
591,
1073,
393,
697,
310,
278,
4682,
310,
14770,
338,
393,
263,
14770,
1246,
723,
2367,
1906,
731,
310,
1353,
13,
29937,
278,
1021,
2927,
13,
7320,
353,
7442,
29889,
13092,
29898,
1643,
29918,
5203,
29897,
13,
1454,
474,
297,
7663,
29901,
13,
1678,
14770,
29889,
1557,
2620,
29898,
1272,
29918,
5203,
29961,
1643,
29918,
5203,
1360,
29875,
3816,
29901,
29892,
29900,
1402,
1272,
29918,
5203,
29961,
1643,
29918,
5203,
1360,
29875,
3816,
29901,
29892,
29896,
1402,
1643,
29922,
29875,
29897,
13,
13,
29937,
853,
5203,
770,
310,
263,
848,
13,
1272,
29918,
26690,
353,
7442,
29889,
2378,
4197,
29961,
29945,
29889,
29955,
29892,
29941,
29889,
29941,
16272,
29945,
29889,
29953,
29892,
29941,
29889,
29946,
16272,
29953,
29889,
29946,
29892,
29941,
16272,
29947,
29889,
29906,
29892,
29906,
29889,
29906,
24960,
13,
572,
29873,
29889,
1557,
2620,
29898,
1272,
29918,
26690,
7503,
29892,
29900,
1402,
1272,
29918,
26690,
7503,
29892,
29896,
1402,
3858,
2433,
29973,
1495,
13,
572,
29873,
29889,
26172,
580,
13,
29937,
9072,
29899,
13,
29937,
382,
27511,
6652,
749,
13,
12765,
353,
848,
29918,
5203,
448,
848,
29918,
26690,
29889,
690,
14443,
29898,
1272,
29918,
26690,
29889,
12181,
29961,
29900,
1402,
29896,
29892,
1272,
29918,
26690,
29889,
12181,
29961,
29896,
2314,
13,
19244,
353,
313,
12765,
1068,
29906,
467,
2083,
29898,
29906,
29897,
13,
13,
29937,
2457,
12705,
2380,
310,
5418,
13,
5721,
29918,
2248,
353,
7442,
29889,
5085,
441,
29898,
19244,
29897,
13,
1643,
353,
3858,
29918,
5203,
29961,
5721,
29918,
2248,
29962,
13,
13,
29937,
1454,
413,
297,
518,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
29892,
29953,
29892,
29955,
29892,
29947,
29892,
29929,
29892,
29896,
29900,
5387,
13,
29937,
17462,
278,
7115,
13,
29895,
353,
29871,
29896,
29900,
13,
1643,
353,
3858,
7503,
29892,
29901,
29895,
29962,
13,
13,
1643,
29918,
27711,
353,
5159,
13,
1454,
474,
297,
3464,
29898,
1272,
29918,
26690,
29889,
12181,
29961,
29900,
29962,
1125,
13,
1678,
1819,
29892,
2798,
29879,
353,
29871,
7442,
29889,
13092,
29898,
1643,
29961,
29875,
1402,
736,
29918,
2798,
29879,
29922,
5574,
29897,
13,
1678,
1399,
353,
7442,
29889,
1191,
3317,
29898,
2798,
29879,
29897,
13,
1678,
3858,
29918,
27711,
29889,
4397,
29898,
5975,
29961,
513,
2314,
13,
268,
13,
268,
13,
13,
13,
13,
13,
13,
13,
268,
13,
268,
13,
13,
13,
13,
13,
2
] |
backend/api/paginations.py | vindem22/work-hour-registration | 0 | 65634 | from rest_framework.pagination import (
PageNumberPagination,
CursorPagination,
LimitOffsetPagination,
)
from rest_framework.response import Response
class Pagination(object):
@classmethod
def number_of_pages(cls, num_of_instances, instances_per_page=12):
num_of_pages = (
(num_of_instances // instances_per_page)
if num_of_instances % instances_per_page == 0
else (num_of_instances // instances_per_page) + 1
)
return num_of_pages
class CustomDefaultPagination(PageNumberPagination, Pagination):
page_size = 12
page_size_query_param = 'page_size'
def get_paginated_response(self, data, *args, **kwargs):
num_of_instances = self.page.paginator.count
self.page_size = self.get_page_size(self.request)
return Response(
{
'data': {
'next': self.get_next_link(),
'previous': self.get_previous_link(),
'page': self.number_of_pages(
self.page.paginator.count, self.page_size
),
'per_page': self.page_size,
'current_page': self.page.number,
'total': num_of_instances,
'data': data,
}
}
) | [
1,
515,
1791,
29918,
4468,
29889,
13573,
3381,
1053,
313,
13,
1678,
9305,
4557,
29925,
351,
3381,
29892,
13,
1678,
315,
5966,
29925,
351,
3381,
29892,
13,
1678,
9628,
277,
10302,
29925,
351,
3381,
29892,
13,
29897,
13,
3166,
1791,
29918,
4468,
29889,
5327,
1053,
13291,
13,
13,
1990,
349,
351,
3381,
29898,
3318,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1353,
29918,
974,
29918,
12292,
29898,
25932,
29892,
954,
29918,
974,
29918,
2611,
2925,
29892,
8871,
29918,
546,
29918,
3488,
29922,
29896,
29906,
1125,
13,
4706,
954,
29918,
974,
29918,
12292,
353,
313,
13,
9651,
313,
1949,
29918,
974,
29918,
2611,
2925,
849,
8871,
29918,
546,
29918,
3488,
29897,
13,
9651,
565,
954,
29918,
974,
29918,
2611,
2925,
1273,
8871,
29918,
546,
29918,
3488,
1275,
29871,
29900,
13,
9651,
1683,
313,
1949,
29918,
974,
29918,
2611,
2925,
849,
8871,
29918,
546,
29918,
3488,
29897,
718,
29871,
29896,
13,
4706,
1723,
13,
4706,
736,
954,
29918,
974,
29918,
12292,
13,
13,
1990,
8701,
4592,
29925,
351,
3381,
29898,
5074,
4557,
29925,
351,
3381,
29892,
349,
351,
3381,
1125,
13,
1678,
1813,
29918,
2311,
353,
29871,
29896,
29906,
13,
1678,
1813,
29918,
2311,
29918,
1972,
29918,
3207,
353,
525,
3488,
29918,
2311,
29915,
13,
13,
1678,
822,
679,
29918,
13573,
262,
630,
29918,
5327,
29898,
1311,
29892,
848,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
954,
29918,
974,
29918,
2611,
2925,
353,
1583,
29889,
3488,
29889,
13573,
262,
1061,
29889,
2798,
13,
4706,
1583,
29889,
3488,
29918,
2311,
353,
1583,
29889,
657,
29918,
3488,
29918,
2311,
29898,
1311,
29889,
3827,
29897,
13,
4706,
736,
13291,
29898,
13,
9651,
426,
13,
18884,
525,
1272,
2396,
426,
13,
462,
1678,
525,
4622,
2396,
1583,
29889,
657,
29918,
4622,
29918,
2324,
3285,
13,
462,
1678,
525,
24957,
2396,
1583,
29889,
657,
29918,
24957,
29918,
2324,
3285,
13,
462,
1678,
525,
3488,
2396,
1583,
29889,
4537,
29918,
974,
29918,
12292,
29898,
13,
462,
4706,
1583,
29889,
3488,
29889,
13573,
262,
1061,
29889,
2798,
29892,
1583,
29889,
3488,
29918,
2311,
13,
462,
1678,
10353,
13,
462,
1678,
525,
546,
29918,
3488,
2396,
1583,
29889,
3488,
29918,
2311,
29892,
13,
462,
1678,
525,
3784,
29918,
3488,
2396,
1583,
29889,
3488,
29889,
4537,
29892,
13,
462,
1678,
525,
7827,
2396,
954,
29918,
974,
29918,
2611,
2925,
29892,
13,
462,
1678,
525,
1272,
2396,
848,
29892,
13,
18884,
500,
13,
9651,
500,
13,
4706,
1723,
4706,
2
] |
Exercicios/lei_estadual/lei.py | Arthurnevs/E3 | 0 | 163097 | <filename>Exercicios/lei_estadual/lei.py
'''
UFCG
PROGRAMAÇÃO 1
<NAME> DE BRITO - 119210204
Lei Estadual
'''
idade = int(input("Idade? "))
if(idade < 12):
print('criança (meia entrada)')
elif(idade >= 65):
print('idoso (meia entrada)')
else:
estudante = input('Estudante? ')
if(estudante == 's'):
rp = input('Rede Pública? ')
if(rp == 's'):
print('estudante da rede pública (isento)')
else:
print('estudante (meia entrada)')
else:
print('adulto (inteira)')
| [
1,
529,
9507,
29958,
1252,
6269,
19382,
29914,
16301,
29918,
342,
328,
950,
29914,
16301,
29889,
2272,
13,
12008,
13,
29965,
8610,
29954,
13,
8618,
29954,
4717,
1529,
30219,
30179,
29949,
29871,
29896,
13,
29966,
5813,
29958,
5012,
25185,
1806,
29949,
448,
29871,
29896,
29896,
29929,
29906,
29896,
29900,
29906,
29900,
29946,
29871,
13,
3226,
29875,
22111,
950,
13,
12008,
13,
5558,
353,
938,
29898,
2080,
703,
1204,
1943,
29973,
376,
876,
13,
13,
361,
29898,
5558,
529,
29871,
29896,
29906,
1125,
13,
12,
2158,
877,
699,
25356,
313,
1004,
423,
9953,
1114,
29897,
1495,
13,
23681,
29898,
5558,
6736,
29871,
29953,
29945,
1125,
13,
12,
2158,
877,
4396,
29877,
313,
1004,
423,
9953,
1114,
29897,
1495,
13,
2870,
29901,
13,
12,
342,
566,
1647,
353,
1881,
877,
12787,
566,
1647,
29973,
25710,
13,
12,
361,
29898,
342,
566,
1647,
1275,
525,
29879,
29374,
13,
12,
12,
19080,
353,
1881,
877,
29934,
2742,
349,
11632,
29973,
25710,
13,
12,
12,
361,
29898,
19080,
1275,
525,
29879,
29374,
13,
12,
12,
12,
2158,
877,
342,
566,
1647,
1146,
337,
311,
282,
11632,
313,
275,
9239,
29897,
1495,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
2158,
877,
342,
566,
1647,
313,
1004,
423,
9953,
1114,
29897,
1495,
13,
12,
2870,
29901,
13,
12,
12,
2158,
877,
328,
499,
29877,
313,
6693,
3055,
29897,
1495,
13,
2
] |
gget/compile.py | lauraluebbert/gget | 3 | 127165 | import os
import subprocess
import sys
import platform
import logging
# Add and format time stamp in logging messages
logging.basicConfig(
format="%(asctime)s %(levelname)s %(message)s",
level=logging.INFO,
datefmt="%c",
)
# Mute numexpr threads info
logging.getLogger("numexpr").setLevel(logging.WARNING)
# Constants
from .constants import MUSCLE_GITHUB_LINK
# Get absolute package path
PACKAGE_PATH = os.path.abspath(os.path.dirname(__file__))
# Path to muscle binary (only exists after 'compile_muscle' was executed)
MUSCLE_PATH = os.path.join(
PACKAGE_PATH, f"bins/compiled/muscle/src/{platform.system()}/muscle"
)
def compile_muscle():
"""
Compiles MUSCLE from source.
Currently only supports Linux and Darwin.
"""
if platform.system() != "Linux" and platform.system() != "Darwin":
raise OSError(
f"Muscle compiler currently only supports Linux and Darwin, not {platform.system()}.\n"
)
logging.info("Compiling MUSCLE binary from source... ")
# Record current working directory
cwd = os.getcwd()
# Change path to package path
os.chdir(PACKAGE_PATH)
# Create folders 'bins/compiled/' inside gget package
os.makedirs("bins/compiled/", exist_ok=True)
# Change path to PACKAGE_PATH/bins/compiled/
os.chdir("bins/compiled/")
# Clone MUSCLE repo into PACKAGE_PATH/bins/compiled/
command1 = "git clone " + MUSCLE_GITHUB_LINK + " -q"
with subprocess.Popen(command1, shell=True, stderr=subprocess.PIPE) as process_1:
stderr_1 = process_1.stderr.read().decode("utf-8")
# Log the standard error if it is not empty
if stderr_1:
sys.stderr.write(stderr_1)
# Exit system if the subprocess returned with an error
if process_1.wait() != 0:
sys.exit(f"'{command1}' command returned with error {process_1.wait()}.")
# Change path to PACKAGE_PATH/bins/compiled/muscle/src/
os.chdir("muscle/src/")
# Run make command
if platform.system() == "Linux":
logging.warning(
"Compiling MUSCLE requires that g++, make, sed and git are installed."
)
if platform.system() == "Darwin":
logging.warning(
"Compiling MUSCLE requires that gcc v11, make, sed and git are installed."
)
logging.warning(
"Please run 'brew install gcc' to install gcc v11 if the compile fails."
)
command2 = "make -s"
with subprocess.Popen(command2, shell=True, stderr=subprocess.PIPE) as process_2:
stderr_2 = process_2.stderr.read().decode("utf-8")
# Log the standard error if it is not empty
if stderr_2:
sys.stderr.write(stderr_2)
# Exit system if the subprocess returned with an error
if process_2.wait() != 0:
sys.exit(f"'{command2}' command returned with error {process_2.wait()}.")
logging.info("MUSCLE compiled.")
# Change path back to cwd
os.chdir(cwd)
| [
1,
1053,
2897,
13,
5215,
1014,
5014,
13,
5215,
10876,
13,
5215,
7481,
13,
5215,
12183,
13,
13,
29937,
3462,
322,
3402,
931,
25214,
297,
12183,
7191,
13,
21027,
29889,
16121,
3991,
29898,
13,
1678,
3402,
543,
29995,
29898,
294,
312,
603,
29897,
29879,
1273,
29898,
5563,
978,
29897,
29879,
1273,
29898,
4906,
29897,
29879,
613,
13,
1678,
3233,
29922,
21027,
29889,
11690,
29892,
13,
1678,
2635,
23479,
543,
29995,
29883,
613,
13,
29897,
13,
29937,
341,
1082,
954,
13338,
9717,
5235,
13,
21027,
29889,
657,
16363,
703,
1949,
13338,
2564,
842,
10108,
29898,
21027,
29889,
29956,
25614,
29897,
13,
13,
29937,
5798,
1934,
13,
3166,
869,
3075,
1934,
1053,
341,
3308,
29907,
1307,
29918,
29954,
13054,
7466,
29918,
23714,
29968,
13,
13,
29937,
3617,
8380,
3577,
2224,
13,
29925,
11375,
10461,
29918,
10145,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
13,
29937,
10802,
304,
2301,
2841,
7581,
313,
6194,
4864,
1156,
525,
12198,
29918,
8366,
2841,
29915,
471,
8283,
29897,
13,
29924,
3308,
29907,
1307,
29918,
10145,
353,
2897,
29889,
2084,
29889,
7122,
29898,
13,
1678,
349,
11375,
10461,
29918,
10145,
29892,
285,
29908,
29890,
1144,
29914,
2388,
2356,
29914,
8366,
2841,
29914,
4351,
19248,
12120,
29889,
5205,
580,
6822,
8366,
2841,
29908,
13,
29897,
13,
13,
13,
1753,
6633,
29918,
8366,
2841,
7295,
13,
1678,
9995,
13,
1678,
3831,
5475,
341,
3308,
29907,
1307,
515,
2752,
29889,
13,
1678,
15447,
871,
11286,
8074,
322,
7335,
5080,
29889,
13,
1678,
9995,
13,
13,
1678,
565,
7481,
29889,
5205,
580,
2804,
376,
24085,
29908,
322,
7481,
29889,
5205,
580,
2804,
376,
29928,
279,
5080,
1115,
13,
4706,
12020,
438,
29173,
29898,
13,
9651,
285,
29908,
14958,
2841,
6516,
5279,
871,
11286,
8074,
322,
7335,
5080,
29892,
451,
426,
12120,
29889,
5205,
580,
1836,
29905,
29876,
29908,
13,
4706,
1723,
13,
13,
1678,
12183,
29889,
3888,
703,
6843,
6504,
341,
3308,
29907,
1307,
7581,
515,
2752,
856,
16521,
13,
13,
1678,
396,
14164,
1857,
1985,
3884,
13,
1678,
274,
9970,
353,
2897,
29889,
657,
29883,
9970,
580,
13,
13,
1678,
396,
10726,
2224,
304,
3577,
2224,
13,
1678,
2897,
29889,
305,
3972,
29898,
29925,
11375,
10461,
29918,
10145,
29897,
13,
1678,
396,
6204,
16495,
525,
29890,
1144,
29914,
2388,
2356,
22208,
2768,
330,
657,
3577,
13,
1678,
2897,
29889,
29885,
12535,
12935,
703,
29890,
1144,
29914,
2388,
2356,
29914,
613,
1863,
29918,
554,
29922,
5574,
29897,
13,
1678,
396,
10726,
2224,
304,
349,
11375,
10461,
29918,
10145,
29914,
29890,
1144,
29914,
2388,
2356,
29914,
13,
1678,
2897,
29889,
305,
3972,
703,
29890,
1144,
29914,
2388,
2356,
29914,
1159,
13,
13,
1678,
396,
2233,
650,
341,
3308,
29907,
1307,
13761,
964,
349,
11375,
10461,
29918,
10145,
29914,
29890,
1144,
29914,
2388,
2356,
29914,
13,
1678,
1899,
29896,
353,
376,
5559,
17432,
376,
718,
341,
3308,
29907,
1307,
29918,
29954,
13054,
7466,
29918,
23714,
29968,
718,
376,
448,
29939,
29908,
13,
13,
1678,
411,
1014,
5014,
29889,
29925,
3150,
29898,
6519,
29896,
29892,
6473,
29922,
5574,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29897,
408,
1889,
29918,
29896,
29901,
13,
4706,
380,
20405,
29918,
29896,
353,
1889,
29918,
29896,
29889,
303,
20405,
29889,
949,
2141,
13808,
703,
9420,
29899,
29947,
1159,
13,
4706,
396,
4522,
278,
3918,
1059,
565,
372,
338,
451,
4069,
13,
4706,
565,
380,
20405,
29918,
29896,
29901,
13,
9651,
10876,
29889,
303,
20405,
29889,
3539,
29898,
303,
20405,
29918,
29896,
29897,
13,
1678,
396,
25954,
1788,
565,
278,
1014,
5014,
4133,
411,
385,
1059,
13,
1678,
565,
1889,
29918,
29896,
29889,
10685,
580,
2804,
29871,
29900,
29901,
13,
4706,
10876,
29889,
13322,
29898,
29888,
29908,
29915,
29912,
6519,
29896,
10162,
1899,
4133,
411,
1059,
426,
5014,
29918,
29896,
29889,
10685,
580,
1836,
1159,
13,
13,
1678,
396,
10726,
2224,
304,
349,
11375,
10461,
29918,
10145,
29914,
29890,
1144,
29914,
2388,
2356,
29914,
8366,
2841,
29914,
4351,
29914,
13,
1678,
2897,
29889,
305,
3972,
703,
8366,
2841,
29914,
4351,
29914,
1159,
13,
13,
1678,
396,
7525,
1207,
1899,
13,
1678,
565,
7481,
29889,
5205,
580,
1275,
376,
24085,
1115,
13,
4706,
12183,
29889,
27392,
29898,
13,
9651,
376,
6843,
6504,
341,
3308,
29907,
1307,
6858,
393,
330,
10024,
1207,
29892,
7048,
322,
6315,
526,
5130,
1213,
13,
4706,
1723,
13,
1678,
565,
7481,
29889,
5205,
580,
1275,
376,
29928,
279,
5080,
1115,
13,
4706,
12183,
29889,
27392,
29898,
13,
9651,
376,
6843,
6504,
341,
3308,
29907,
1307,
6858,
393,
20243,
325,
29896,
29896,
29892,
1207,
29892,
7048,
322,
6315,
526,
5130,
1213,
13,
4706,
1723,
13,
4706,
12183,
29889,
27392,
29898,
13,
9651,
376,
12148,
1065,
525,
1030,
29893,
2601,
20243,
29915,
304,
2601,
20243,
325,
29896,
29896,
565,
278,
6633,
8465,
1213,
13,
4706,
1723,
13,
13,
1678,
1899,
29906,
353,
376,
5675,
448,
29879,
29908,
13,
13,
1678,
411,
1014,
5014,
29889,
29925,
3150,
29898,
6519,
29906,
29892,
6473,
29922,
5574,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29897,
408,
1889,
29918,
29906,
29901,
13,
4706,
380,
20405,
29918,
29906,
353,
1889,
29918,
29906,
29889,
303,
20405,
29889,
949,
2141,
13808,
703,
9420,
29899,
29947,
1159,
13,
4706,
396,
4522,
278,
3918,
1059,
565,
372,
338,
451,
4069,
13,
4706,
565,
380,
20405,
29918,
29906,
29901,
13,
9651,
10876,
29889,
303,
20405,
29889,
3539,
29898,
303,
20405,
29918,
29906,
29897,
13,
1678,
396,
25954,
1788,
565,
278,
1014,
5014,
4133,
411,
385,
1059,
13,
1678,
565,
1889,
29918,
29906,
29889,
10685,
580,
2804,
29871,
29900,
29901,
13,
4706,
10876,
29889,
13322,
29898,
29888,
29908,
29915,
29912,
6519,
29906,
10162,
1899,
4133,
411,
1059,
426,
5014,
29918,
29906,
29889,
10685,
580,
1836,
1159,
13,
13,
1678,
12183,
29889,
3888,
703,
29924,
3308,
29907,
1307,
13126,
23157,
13,
13,
1678,
396,
10726,
2224,
1250,
304,
274,
9970,
13,
1678,
2897,
29889,
305,
3972,
29898,
29883,
9970,
29897,
13,
2
] |
p020.py | drcsturm/project-euler | 0 | 108789 |
# n! means n × (n − 1) × ... × 3 × 2 × 1
# For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,
# and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
# Find the sum of the digits in the number 100!
import math
total = 0
for i in str(math.factorial(100)):
total += int(i)
print(total) | [
1,
29871,
13,
29937,
302,
29991,
2794,
302,
13105,
313,
29876,
13935,
29871,
29896,
29897,
13105,
2023,
13105,
29871,
29941,
13105,
29871,
29906,
13105,
29871,
29896,
13,
13,
29937,
1152,
1342,
29892,
29871,
29896,
29900,
29991,
353,
29871,
29896,
29900,
13105,
29871,
29929,
13105,
2023,
13105,
29871,
29941,
13105,
29871,
29906,
13105,
29871,
29896,
353,
29871,
29941,
29953,
29906,
29947,
29947,
29900,
29900,
29892,
13,
29937,
322,
278,
2533,
310,
278,
13340,
297,
278,
1353,
29871,
29896,
29900,
29991,
338,
29871,
29941,
718,
29871,
29953,
718,
29871,
29906,
718,
29871,
29947,
718,
29871,
29947,
718,
29871,
29900,
718,
29871,
29900,
353,
29871,
29906,
29955,
29889,
13,
13,
29937,
10987,
278,
2533,
310,
278,
13340,
297,
278,
1353,
29871,
29896,
29900,
29900,
29991,
13,
13,
5215,
5844,
13,
7827,
353,
29871,
29900,
13,
1454,
474,
297,
851,
29898,
755,
29889,
19790,
616,
29898,
29896,
29900,
29900,
22164,
13,
1678,
3001,
4619,
938,
29898,
29875,
29897,
13,
2158,
29898,
7827,
29897,
2
] |
get_floor.py | deemozyc/zycs_WiFi_location | 2 | 71199 | <reponame>deemozyc/zycs_WiFi_location
# coding:utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from knn_main import *
from sklearn.svm import SVC
if sys.getdefaultencoding() != 'utf-8':
reload(sys)
sys.setdefaultencoding('utf-8')
def run_knn_floor(trn_coord_file, tst_coord_file, trn_rss_file, tst_rss_file):
#与run_knn_test类似 返回楼层测试正确率
trn_coord = get_csv(trn_coord_file)
trn_coord = coord_zip(trn_coord)
tst_coord = get_csv(tst_coord_file)
tst_coord = coord_zip(tst_coord)
trn_rss = get_csv(trn_rss_file)
trn_rss = rss_zip(trn_rss)
tst_rss = get_csv(tst_rss_file)
tst_rss = rss_zip(tst_rss)
trn_rss = deal_rss(trn_rss)
tst_rss = deal_rss(tst_rss)
ans_sum = 0
cal_coord = []
err = []
for i in range(len(tst_rss)):
nn_list = dis_sort(tst_rss[i], trn_rss)
ans = get_knn(nn_list, trn_coord)
floor = round(ans[2])
#print floor, trn_coord[i][2]
if(abs(floor - tst_coord[i][2])<1e-6):
ans_sum = ans_sum + 1
#else:
#print ans[2],floor, tst_coord[i][2]
return 1.0*ans_sum/len(tst_rss)
def cal_class(coords):
#返回楼层
ans = []
for coord in coords:
ans.append(coord[2])
return ans
return
def run_svm_floor(trn_coord_file, tst_coord_file, trn_rss_file, tst_rss_file):
#与run_knn_test类似 返回楼层测试正确率
trn_coord = get_csv(trn_coord_file)
trn_coord = coord_zip(trn_coord)
tst_coord = get_csv(tst_coord_file)
tst_coord = coord_zip(tst_coord)
trn_rss = get_csv(trn_rss_file)
trn_rss = rss_zip(trn_rss)
tst_rss = get_csv(tst_rss_file)
tst_rss = rss_zip(tst_rss)
trn_rss = deal_rss(trn_rss)
tst_rss = deal_rss(tst_rss)
X = trn_rss
Y = cal_class(trn_coord)
#clf = SVC(probability = True, gamma = 'auto')
clf = SVC(gamma = 'auto', kernel = "poly", C = 2)
clf.fit(X, Y)
ac_test = 0
for i in range(len(tst_rss)):
floor = clf.predict([tst_rss[i]])
if(abs(floor[0] - tst_coord[i][2]) < 1e-6):
ac_test = ac_test + 1
#else:
#print floor[0], tst_coord[i][2]
return 1.0*ac_test/len(tst_rss)
if __name__ == "__main__":
ans = []
month = []
for i in range(1, 26): #月份
for j in range(1, 6): #测试集
if(i < 10):
pre = "db/0" + str(i) + "/"
else:
pre = "db/" + str(i) + "/"
#temp = run_knn_floor(pre + "trn01crd.csv", pre + "tst0" + str(j) + "crd.csv", pre + "trn01rss.csv", pre + "tst0" + str(j) + "rss.csv")
temp = run_svm_floor(pre + "trn01crd.csv", pre + "tst0" + str(j) + "crd.csv", pre + "trn01rss.csv", pre + "tst0" + str(j) + "rss.csv")
print temp
ans.append(temp)
if(j == 1):
month.append(temp)
else:
month[-1] = month[-1] + temp
month[-1] = month[-1]/5
print "month:", month
print "total_avg = ", sum(ans)/len(ans)
| [
1,
529,
276,
1112,
420,
29958,
311,
15810,
1537,
29883,
29914,
1537,
2395,
29918,
29956,
29875,
18800,
29918,
5479,
13,
29937,
14137,
29901,
9420,
29899,
29947,
13,
5215,
10876,
13,
28120,
29898,
9675,
29897,
13,
9675,
29889,
842,
4381,
22331,
877,
9420,
29947,
1495,
13,
13,
3166,
889,
29876,
29918,
3396,
1053,
334,
13,
3166,
2071,
19668,
29889,
4501,
29885,
1053,
317,
8257,
13,
361,
10876,
29889,
657,
4381,
22331,
580,
2804,
525,
9420,
29899,
29947,
2396,
13,
1678,
19763,
29898,
9675,
29897,
13,
1678,
10876,
29889,
842,
4381,
22331,
877,
9420,
29899,
29947,
1495,
13,
13,
1753,
1065,
29918,
3959,
29876,
29918,
14939,
29898,
509,
29876,
29918,
1111,
536,
29918,
1445,
29892,
260,
303,
29918,
1111,
536,
29918,
1445,
29892,
534,
29876,
29918,
29878,
893,
29918,
1445,
29892,
260,
303,
29918,
29878,
893,
29918,
1445,
1125,
13,
12,
29937,
31267,
3389,
29918,
3959,
29876,
29918,
1688,
30832,
231,
191,
191,
29871,
31086,
30742,
233,
168,
191,
232,
180,
133,
31851,
31787,
30724,
31835,
234,
145,
138,
13,
12,
509,
29876,
29918,
1111,
536,
353,
679,
29918,
7638,
29898,
509,
29876,
29918,
1111,
536,
29918,
1445,
29897,
13,
12,
509,
29876,
29918,
1111,
536,
353,
29311,
29918,
7554,
29898,
509,
29876,
29918,
1111,
536,
29897,
13,
13,
12,
29873,
303,
29918,
1111,
536,
353,
679,
29918,
7638,
29898,
29873,
303,
29918,
1111,
536,
29918,
1445,
29897,
13,
12,
29873,
303,
29918,
1111,
536,
353,
29871,
29311,
29918,
7554,
29898,
29873,
303,
29918,
1111,
536,
29897,
13,
12,
13,
12,
509,
29876,
29918,
29878,
893,
353,
679,
29918,
7638,
29898,
509,
29876,
29918,
29878,
893,
29918,
1445,
29897,
13,
12,
509,
29876,
29918,
29878,
893,
353,
364,
893,
29918,
7554,
29898,
509,
29876,
29918,
29878,
893,
29897,
13,
13,
12,
29873,
303,
29918,
29878,
893,
353,
679,
29918,
7638,
29898,
29873,
303,
29918,
29878,
893,
29918,
1445,
29897,
13,
12,
29873,
303,
29918,
29878,
893,
353,
364,
893,
29918,
7554,
29898,
29873,
303,
29918,
29878,
893,
29897,
13,
12,
13,
12,
509,
29876,
29918,
29878,
893,
353,
5376,
29918,
29878,
893,
29898,
509,
29876,
29918,
29878,
893,
29897,
13,
12,
29873,
303,
29918,
29878,
893,
353,
5376,
29918,
29878,
893,
29898,
29873,
303,
29918,
29878,
893,
29897,
13,
12,
13,
12,
550,
29918,
2083,
353,
29871,
29900,
13,
12,
1052,
29918,
1111,
536,
353,
5159,
13,
12,
3127,
353,
5159,
13,
12,
1454,
474,
297,
3464,
29898,
2435,
29898,
29873,
303,
29918,
29878,
893,
22164,
13,
12,
12,
13,
12,
12,
15755,
29918,
1761,
353,
766,
29918,
6605,
29898,
29873,
303,
29918,
29878,
893,
29961,
29875,
1402,
534,
29876,
29918,
29878,
893,
29897,
13,
12,
12,
550,
353,
679,
29918,
3959,
29876,
29898,
15755,
29918,
1761,
29892,
534,
29876,
29918,
1111,
536,
29897,
13,
12,
12,
14939,
353,
4513,
29898,
550,
29961,
29906,
2314,
13,
12,
12,
29937,
2158,
11904,
29892,
534,
29876,
29918,
1111,
536,
29961,
29875,
3816,
29906,
29962,
13,
12,
12,
361,
29898,
6897,
29898,
14939,
448,
260,
303,
29918,
1111,
536,
29961,
29875,
3816,
29906,
2314,
29966,
29896,
29872,
29899,
29953,
1125,
13,
12,
12,
12,
550,
29918,
2083,
353,
6063,
29918,
2083,
718,
29871,
29896,
13,
12,
12,
29937,
2870,
29901,
13,
12,
12,
12,
29937,
2158,
6063,
29961,
29906,
1402,
14939,
29892,
260,
303,
29918,
1111,
536,
29961,
29875,
3816,
29906,
29962,
13,
12,
2457,
29871,
29896,
29889,
29900,
29930,
550,
29918,
2083,
29914,
2435,
29898,
29873,
303,
29918,
29878,
893,
29897,
13,
12,
13,
1753,
1208,
29918,
1990,
29898,
1111,
4339,
1125,
13,
12,
29937,
31086,
30742,
233,
168,
191,
232,
180,
133,
29871,
13,
12,
550,
353,
5159,
13,
12,
1454,
29311,
297,
1302,
4339,
29901,
13,
12,
12,
550,
29889,
4397,
29898,
1111,
536,
29961,
29906,
2314,
13,
12,
2457,
6063,
13,
12,
13,
12,
13,
12,
2457,
13,
12,
13,
1753,
1065,
29918,
4501,
29885,
29918,
14939,
29898,
509,
29876,
29918,
1111,
536,
29918,
1445,
29892,
260,
303,
29918,
1111,
536,
29918,
1445,
29892,
534,
29876,
29918,
29878,
893,
29918,
1445,
29892,
260,
303,
29918,
29878,
893,
29918,
1445,
1125,
13,
12,
29937,
31267,
3389,
29918,
3959,
29876,
29918,
1688,
30832,
231,
191,
191,
29871,
31086,
30742,
233,
168,
191,
232,
180,
133,
31851,
31787,
30724,
31835,
234,
145,
138,
13,
12,
509,
29876,
29918,
1111,
536,
353,
679,
29918,
7638,
29898,
509,
29876,
29918,
1111,
536,
29918,
1445,
29897,
13,
12,
509,
29876,
29918,
1111,
536,
353,
29311,
29918,
7554,
29898,
509,
29876,
29918,
1111,
536,
29897,
13,
13,
12,
29873,
303,
29918,
1111,
536,
353,
679,
29918,
7638,
29898,
29873,
303,
29918,
1111,
536,
29918,
1445,
29897,
13,
12,
29873,
303,
29918,
1111,
536,
353,
29871,
29311,
29918,
7554,
29898,
29873,
303,
29918,
1111,
536,
29897,
13,
12,
13,
12,
509,
29876,
29918,
29878,
893,
353,
679,
29918,
7638,
29898,
509,
29876,
29918,
29878,
893,
29918,
1445,
29897,
13,
12,
509,
29876,
29918,
29878,
893,
353,
364,
893,
29918,
7554,
29898,
509,
29876,
29918,
29878,
893,
29897,
13,
13,
12,
29873,
303,
29918,
29878,
893,
353,
679,
29918,
7638,
29898,
29873,
303,
29918,
29878,
893,
29918,
1445,
29897,
13,
12,
29873,
303,
29918,
29878,
893,
353,
364,
893,
29918,
7554,
29898,
29873,
303,
29918,
29878,
893,
29897,
13,
12,
13,
12,
509,
29876,
29918,
29878,
893,
353,
5376,
29918,
29878,
893,
29898,
509,
29876,
29918,
29878,
893,
29897,
13,
12,
29873,
303,
29918,
29878,
893,
353,
5376,
29918,
29878,
893,
29898,
29873,
303,
29918,
29878,
893,
29897,
13,
13,
12,
13,
12,
29990,
353,
534,
29876,
29918,
29878,
893,
13,
12,
29979,
353,
1208,
29918,
1990,
29898,
509,
29876,
29918,
1111,
536,
29897,
13,
13,
12,
29937,
695,
29888,
353,
317,
8257,
29898,
22795,
3097,
353,
5852,
29892,
330,
2735,
353,
525,
6921,
1495,
13,
12,
695,
29888,
353,
317,
8257,
29898,
4283,
353,
525,
6921,
742,
8466,
353,
376,
22678,
613,
315,
353,
29871,
29906,
29897,
13,
12,
695,
29888,
29889,
9202,
29898,
29990,
29892,
612,
29897,
13,
12,
13,
12,
562,
29918,
1688,
353,
29871,
29900,
13,
12,
1454,
474,
297,
3464,
29898,
2435,
29898,
29873,
303,
29918,
29878,
893,
22164,
13,
12,
12,
14939,
353,
1067,
29888,
29889,
27711,
4197,
29873,
303,
29918,
29878,
893,
29961,
29875,
24960,
13,
13,
12,
12,
361,
29898,
6897,
29898,
14939,
29961,
29900,
29962,
448,
260,
303,
29918,
1111,
536,
29961,
29875,
3816,
29906,
2314,
529,
29871,
29896,
29872,
29899,
29953,
1125,
13,
12,
12,
12,
562,
29918,
1688,
353,
1274,
29918,
1688,
718,
29871,
29896,
13,
12,
12,
29937,
2870,
29901,
13,
12,
12,
12,
29937,
2158,
11904,
29961,
29900,
1402,
260,
303,
29918,
1111,
536,
29961,
29875,
3816,
29906,
29962,
13,
13,
12,
2457,
29871,
29896,
29889,
29900,
29930,
562,
29918,
1688,
29914,
2435,
29898,
29873,
303,
29918,
29878,
893,
29897,
13,
12,
13,
12,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
12,
550,
353,
5159,
13,
12,
10874,
353,
5159,
13,
12,
1454,
474,
297,
3464,
29898,
29896,
29892,
29871,
29906,
29953,
1125,
396,
30534,
231,
190,
192,
13,
12,
12,
1454,
432,
297,
3464,
29898,
29896,
29892,
29871,
29953,
1125,
396,
31851,
31787,
30893,
13,
12,
12,
12,
361,
29898,
29875,
529,
29871,
29896,
29900,
1125,
13,
12,
12,
12,
12,
1457,
353,
376,
2585,
29914,
29900,
29908,
718,
851,
29898,
29875,
29897,
718,
5591,
29908,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1457,
353,
376,
2585,
12975,
718,
851,
29898,
29875,
29897,
718,
5591,
29908,
13,
12,
12,
12,
13,
12,
12,
12,
29937,
7382,
353,
1065,
29918,
3959,
29876,
29918,
14939,
29898,
1457,
718,
376,
509,
29876,
29900,
29896,
29883,
5499,
29889,
7638,
613,
758,
718,
376,
29873,
303,
29900,
29908,
718,
851,
29898,
29926,
29897,
718,
376,
29883,
5499,
29889,
7638,
613,
758,
718,
376,
509,
29876,
29900,
29896,
29878,
893,
29889,
7638,
613,
758,
718,
376,
29873,
303,
29900,
29908,
718,
851,
29898,
29926,
29897,
718,
376,
29878,
893,
29889,
7638,
1159,
13,
12,
12,
12,
7382,
353,
1065,
29918,
4501,
29885,
29918,
14939,
29898,
1457,
718,
376,
509,
29876,
29900,
29896,
29883,
5499,
29889,
7638,
613,
758,
718,
376,
29873,
303,
29900,
29908,
718,
851,
29898,
29926,
29897,
718,
376,
29883,
5499,
29889,
7638,
613,
758,
718,
376,
509,
29876,
29900,
29896,
29878,
893,
29889,
7638,
613,
758,
718,
376,
29873,
303,
29900,
29908,
718,
851,
29898,
29926,
29897,
718,
376,
29878,
893,
29889,
7638,
1159,
13,
12,
12,
12,
2158,
5694,
13,
12,
12,
12,
550,
29889,
4397,
29898,
7382,
29897,
13,
12,
12,
12,
361,
29898,
29926,
1275,
29871,
29896,
1125,
13,
12,
12,
12,
12,
10874,
29889,
4397,
29898,
7382,
29897,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
10874,
14352,
29896,
29962,
353,
4098,
14352,
29896,
29962,
718,
5694,
13,
12,
12,
10874,
14352,
29896,
29962,
353,
4098,
14352,
29896,
16261,
29945,
13,
12,
2158,
376,
10874,
29901,
613,
4098,
13,
12,
13,
12,
2158,
376,
7827,
29918,
485,
29887,
353,
9162,
2533,
29898,
550,
6802,
2435,
29898,
550,
29897,
13,
12,
13,
2
] |
setup.py | simonthor/zfit-physics | 7 | 174412 | <filename>setup.py
#!/usr/bin/env python
"""The setup script."""
import os
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "requirements.txt"), encoding="utf-8") as requirements_file:
requirements = requirements_file.read().splitlines()
with open(os.path.join(here, "requirements_dev.txt"), encoding="utf-8") as requirements_dev_file:
dev_requirements = requirements_dev_file.read().splitlines()
with open(os.path.join(here, "README.rst"), encoding="utf-8") as readme_file:
readme = readme_file.read()
setup(
install_requires=requirements,
long_description=readme,
include_package_data=True,
packages=find_packages(include=["zfit_physics", "zfit_physics.models", "zfit_physics.unstable"]),
test_suite="tests",
extras_require={"dev": dev_requirements},
use_scm_version=True,
zip_safe=False,
)
| [
1,
529,
9507,
29958,
14669,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
15945,
29908,
1576,
6230,
2471,
1213,
15945,
13,
5215,
2897,
13,
13,
3166,
731,
21245,
8789,
1053,
1284,
29918,
8318,
29892,
6230,
13,
13,
4150,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
13,
13,
2541,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
4150,
29892,
376,
12277,
1860,
29889,
3945,
4968,
8025,
543,
9420,
29899,
29947,
1159,
408,
11780,
29918,
1445,
29901,
13,
1678,
11780,
353,
11780,
29918,
1445,
29889,
949,
2141,
5451,
9012,
580,
13,
13,
2541,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
4150,
29892,
376,
12277,
1860,
29918,
3359,
29889,
3945,
4968,
8025,
543,
9420,
29899,
29947,
1159,
408,
11780,
29918,
3359,
29918,
1445,
29901,
13,
1678,
2906,
29918,
12277,
1860,
353,
11780,
29918,
3359,
29918,
1445,
29889,
949,
2141,
5451,
9012,
580,
13,
13,
2541,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
4150,
29892,
376,
16310,
2303,
29889,
29878,
303,
4968,
8025,
543,
9420,
29899,
29947,
1159,
408,
1303,
1004,
29918,
1445,
29901,
13,
1678,
1303,
1004,
353,
1303,
1004,
29918,
1445,
29889,
949,
580,
13,
13,
14669,
29898,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
12277,
1860,
29892,
13,
1678,
1472,
29918,
8216,
29922,
949,
1004,
29892,
13,
1678,
3160,
29918,
5113,
29918,
1272,
29922,
5574,
29892,
13,
1678,
9741,
29922,
2886,
29918,
8318,
29898,
2856,
29922,
3366,
29920,
9202,
29918,
25105,
613,
376,
29920,
9202,
29918,
25105,
29889,
9794,
613,
376,
29920,
9202,
29918,
25105,
29889,
6465,
519,
3108,
511,
13,
1678,
1243,
29918,
13495,
543,
21150,
613,
13,
1678,
429,
10678,
29918,
12277,
3790,
29908,
3359,
1115,
2906,
29918,
12277,
1860,
1118,
13,
1678,
671,
29918,
1557,
29885,
29918,
3259,
29922,
5574,
29892,
13,
1678,
14319,
29918,
11177,
29922,
8824,
29892,
13,
29897,
13,
2
] |
src/fingerflow/matcher/VerifyNet/verify_net_model.py | jakubarendac/fingerflow | 0 | 85052 | <filename>src/fingerflow/matcher/VerifyNet/verify_net_model.py
import tensorflow as tf
from . import constants, utils
def get_verify_net_model(precision, verify_net_path=None):
embedding_network = get_embeddings_model(precision)
input_1 = tf.keras.Input(utils.get_input_shape(precision))
input_2 = tf.keras.Input(utils.get_input_shape(precision))
tower_1 = embedding_network(input_1)
tower_2 = embedding_network(input_2)
merge_layer = tf.keras.layers.Lambda(utils.euclidean_distance)([tower_1, tower_2])
normal_layer = tf.keras.layers.BatchNormalization()(merge_layer)
output_layer = tf.keras.layers.Dense(1, activation="sigmoid")(normal_layer)
siamese_network = tf.keras.Model(inputs=[input_1, input_2], outputs=output_layer)
siamese_network.compile(
loss=utils.verify_net_loss(constants.MARGIN),
optimizer=tf.keras.optimizers.Adam(0.001),
metrics=["accuracy"])
if verify_net_path:
siamese_network.load_weights(verify_net_path)
print(f'Verify net weights loaded from {verify_net_path}')
return siamese_network
def get_embeddings_model(precision):
inputs = tf.keras.Input(shape=(utils.get_input_shape(precision)))
x = tf.keras.layers.Conv2D(32, 3, 2, activation="relu",
kernel_regularizer=tf.keras.regularizers.l2(l2=0.001))(inputs)
x = tf.keras.layers.Dropout(0.2)(x)
x = tf.keras.layers.Conv2D(32, 3, 2, activation="relu",
kernel_regularizer=tf.keras.regularizers.l2(l2=0.001))(x)
x = tf.keras.layers.Dropout(0.2)(x)
x = tf.keras.layers.Flatten()(x)
outputs = tf.keras.layers.Dense(16, activation="relu")(x)
embedding_network = tf.keras.Model(inputs, outputs)
embedding_network.summary()
return embedding_network
| [
1,
529,
9507,
29958,
4351,
29914,
29888,
5621,
1731,
29914,
4352,
261,
29914,
6565,
1598,
6779,
29914,
27902,
29918,
1212,
29918,
4299,
29889,
2272,
13,
5215,
26110,
408,
15886,
13,
13,
3166,
869,
1053,
17727,
29892,
3667,
29879,
13,
13,
13,
1753,
679,
29918,
27902,
29918,
1212,
29918,
4299,
29898,
17990,
2459,
29892,
11539,
29918,
1212,
29918,
2084,
29922,
8516,
1125,
13,
1678,
23655,
29918,
11618,
353,
679,
29918,
17987,
29881,
886,
29918,
4299,
29898,
17990,
2459,
29897,
13,
13,
1678,
1881,
29918,
29896,
353,
15886,
29889,
3946,
294,
29889,
4290,
29898,
13239,
29889,
657,
29918,
2080,
29918,
12181,
29898,
17990,
2459,
876,
13,
1678,
1881,
29918,
29906,
353,
15886,
29889,
3946,
294,
29889,
4290,
29898,
13239,
29889,
657,
29918,
2080,
29918,
12181,
29898,
17990,
2459,
876,
13,
13,
1678,
19372,
29918,
29896,
353,
23655,
29918,
11618,
29898,
2080,
29918,
29896,
29897,
13,
1678,
19372,
29918,
29906,
353,
23655,
29918,
11618,
29898,
2080,
29918,
29906,
29897,
13,
13,
1678,
10366,
29918,
13148,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
9099,
29898,
13239,
29889,
29872,
27511,
29918,
19244,
29897,
4197,
29873,
1680,
29918,
29896,
29892,
19372,
29918,
29906,
2314,
13,
13,
1678,
4226,
29918,
13148,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
23145,
19077,
2133,
580,
29898,
14634,
29918,
13148,
29897,
13,
13,
1678,
1962,
29918,
13148,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
29928,
1947,
29898,
29896,
29892,
26229,
543,
18816,
29885,
3398,
1159,
29898,
8945,
29918,
13148,
29897,
13,
13,
1678,
1354,
314,
968,
29918,
11618,
353,
15886,
29889,
3946,
294,
29889,
3195,
29898,
2080,
29879,
11759,
2080,
29918,
29896,
29892,
1881,
29918,
29906,
1402,
14391,
29922,
4905,
29918,
13148,
29897,
13,
13,
1678,
1354,
314,
968,
29918,
11618,
29889,
12198,
29898,
13,
4706,
6410,
29922,
13239,
29889,
27902,
29918,
1212,
29918,
6758,
29898,
3075,
1934,
29889,
1529,
29934,
29954,
1177,
511,
13,
4706,
5994,
3950,
29922,
13264,
29889,
3946,
294,
29889,
20640,
19427,
29889,
3253,
314,
29898,
29900,
29889,
29900,
29900,
29896,
511,
13,
4706,
21556,
29922,
3366,
562,
2764,
4135,
20068,
13,
13,
1678,
565,
11539,
29918,
1212,
29918,
2084,
29901,
13,
4706,
1354,
314,
968,
29918,
11618,
29889,
1359,
29918,
705,
5861,
29898,
27902,
29918,
1212,
29918,
2084,
29897,
13,
13,
4706,
1596,
29898,
29888,
29915,
6565,
1598,
7787,
18177,
7500,
515,
426,
27902,
29918,
1212,
29918,
2084,
29913,
1495,
13,
13,
1678,
736,
1354,
314,
968,
29918,
11618,
13,
13,
13,
1753,
679,
29918,
17987,
29881,
886,
29918,
4299,
29898,
17990,
2459,
1125,
13,
1678,
10970,
353,
15886,
29889,
3946,
294,
29889,
4290,
29898,
12181,
7607,
13239,
29889,
657,
29918,
2080,
29918,
12181,
29898,
17990,
2459,
4961,
13,
13,
1678,
921,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
1168,
29894,
29906,
29928,
29898,
29941,
29906,
29892,
29871,
29941,
29892,
29871,
29906,
29892,
26229,
543,
2674,
29884,
613,
13,
462,
1669,
8466,
29918,
15227,
3950,
29922,
13264,
29889,
3946,
294,
29889,
15227,
19427,
29889,
29880,
29906,
29898,
29880,
29906,
29922,
29900,
29889,
29900,
29900,
29896,
876,
29898,
2080,
29879,
29897,
13,
1678,
921,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
15063,
449,
29898,
29900,
29889,
29906,
5033,
29916,
29897,
13,
13,
1678,
921,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
1168,
29894,
29906,
29928,
29898,
29941,
29906,
29892,
29871,
29941,
29892,
29871,
29906,
29892,
26229,
543,
2674,
29884,
613,
13,
462,
1669,
8466,
29918,
15227,
3950,
29922,
13264,
29889,
3946,
294,
29889,
15227,
19427,
29889,
29880,
29906,
29898,
29880,
29906,
29922,
29900,
29889,
29900,
29900,
29896,
876,
29898,
29916,
29897,
13,
1678,
921,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
15063,
449,
29898,
29900,
29889,
29906,
5033,
29916,
29897,
13,
13,
1678,
921,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
29943,
5066,
841,
580,
29898,
29916,
29897,
13,
13,
1678,
14391,
353,
15886,
29889,
3946,
294,
29889,
29277,
29889,
29928,
1947,
29898,
29896,
29953,
29892,
26229,
543,
2674,
29884,
1159,
29898,
29916,
29897,
13,
13,
1678,
23655,
29918,
11618,
353,
15886,
29889,
3946,
294,
29889,
3195,
29898,
2080,
29879,
29892,
14391,
29897,
13,
13,
1678,
23655,
29918,
11618,
29889,
7727,
580,
13,
13,
1678,
736,
23655,
29918,
11618,
13,
2
] |
notes/code/linkedin/one_request_http_server.py | skrilladeville/msds692 | 87 | 100202 | <filename>notes/code/linkedin/one_request_http_server.py
import BaseHTTPServer
import urlparse
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
p = self.path.split('?')
if len(p) > 1:
params = urlparse.parse_qs(p[1], True, True)
print params
# Send an OK response with no headers back
# Typically, our goal is just to get the information in the parameters
# The authenticating server is not typically looking for information from us
self.send_response(200)
self.end_headers()
return
url = 'http://localhost:8000?user=parrt&foo=bar'
server_address = ('localhost', 8000)
httpd = BaseHTTPServer.HTTPServer(server_address, MyHandler)
print url
# Block until we get a single request to url
httpd.handle_request() # handle just one request
| [
1,
529,
9507,
29958,
16953,
29914,
401,
29914,
2324,
287,
262,
29914,
650,
29918,
3827,
29918,
1124,
29918,
2974,
29889,
2272,
13,
5215,
7399,
10493,
6004,
13,
5215,
3142,
5510,
13,
13,
1990,
1619,
4598,
29898,
5160,
10493,
6004,
29889,
5160,
10493,
3089,
4598,
1125,
13,
1678,
822,
437,
29918,
7194,
29898,
1311,
1125,
13,
4706,
282,
353,
1583,
29889,
2084,
29889,
5451,
877,
29973,
1495,
13,
4706,
565,
7431,
29898,
29886,
29897,
1405,
29871,
29896,
29901,
13,
9651,
8636,
353,
3142,
5510,
29889,
5510,
29918,
29939,
29879,
29898,
29886,
29961,
29896,
1402,
5852,
29892,
5852,
29897,
13,
9651,
1596,
8636,
13,
4706,
396,
15076,
385,
9280,
2933,
411,
694,
9066,
1250,
13,
4706,
396,
14213,
1711,
29892,
1749,
7306,
338,
925,
304,
679,
278,
2472,
297,
278,
4128,
13,
4706,
396,
450,
15585,
1218,
1923,
338,
451,
12234,
3063,
363,
2472,
515,
502,
13,
4706,
1583,
29889,
6717,
29918,
5327,
29898,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
355,
29918,
13662,
580,
13,
4706,
736,
13,
13,
2271,
353,
525,
1124,
597,
7640,
29901,
29947,
29900,
29900,
29900,
29973,
1792,
29922,
862,
2273,
29987,
5431,
29922,
1646,
29915,
13,
2974,
29918,
7328,
353,
6702,
7640,
742,
29871,
29947,
29900,
29900,
29900,
29897,
13,
1124,
29881,
353,
7399,
10493,
6004,
29889,
10493,
6004,
29898,
2974,
29918,
7328,
29892,
1619,
4598,
29897,
13,
2158,
3142,
13,
29937,
15658,
2745,
591,
679,
263,
2323,
2009,
304,
3142,
13,
1124,
29881,
29889,
8411,
29918,
3827,
580,
396,
4386,
925,
697,
2009,
13,
2
] |
_estudoPython_solid/clima-cotacao-dolar/venv/Lib/site-packages/pyowm/weatherapi25/parsers/forecastparser.py | carlos-freitas-gitHub/Python_Analise_De_Dados | 1 | 90368 | """
Module containing a concrete implementation for JSONParser abstract class,
returning Forecast objects
"""
import json
import time
from pyowm.weatherapi25 import location
from pyowm.weatherapi25 import weather
from pyowm.weatherapi25 import forecast
from pyowm.abstractions import jsonparser
from pyowm.exceptions import parse_response_error, api_response_error
class ForecastParser(jsonparser.JSONParser):
"""
Concrete *JSONParser* implementation building a *Forecast* instance out
of raw JSON data coming from OWM Weather API responses.
"""
def __init__(self):
pass
def parse_JSON(self, JSON_string):
"""
Parses a *Forecast* instance out of raw JSON data. Only certain
properties of the data are used: if these properties are not found or
cannot be parsed, an error is issued.
:param JSON_string: a raw JSON string
:type JSON_string: str
:returns: a *Forecast* instance or ``None`` if no data is available
:raises: *ParseResponseError* if it is impossible to find or parse the
data needed to build the result, *APIResponseError* if the JSON
string embeds an HTTP status error
"""
if JSON_string is None:
raise parse_response_error.ParseResponseError('JSON data is None')
d = json.loads(JSON_string)
# Check if server returned errors: this check overcomes the lack of use
# of HTTP error status codes by the OWM API 2.5. This mechanism is
# supposed to be deprecated as soon as the API fully adopts HTTP for
# conveying errors to the clients
if 'message' in d and 'cod' in d:
if d['cod'] == "404":
print("OWM API: data not found - response payload: " + json.dumps(d), d['cod'])
return None
elif d['cod'] != "200":
raise api_response_error.APIResponseError("OWM API: error - response payload: " + json.dumps(d), d['cod'])
try:
place = location.location_from_dictionary(d)
except KeyError:
raise parse_response_error.ParseResponseError(''.join([__name__,
': impossible to read location info from JSON data']))
# Handle the case when no results are found
if 'count' in d and d['count'] == "0":
weathers = []
elif 'cnt' in d and d['cnt'] == 0:
weathers = []
else:
if 'list' in d:
try:
weathers = [weather.weather_from_dictionary(item) \
for item in d['list']]
except KeyError:
raise parse_response_error.ParseResponseError(
''.join([__name__, ': impossible to read weather ' \
'info from JSON data'])
)
else:
raise parse_response_error.ParseResponseError(
''.join([__name__, ': impossible to read weather ' \
'list from JSON data'])
)
current_time = int(round(time.time()))
return forecast.Forecast(None, current_time, place, weathers)
def __repr__(self):
return "<%s.%s>" % (__name__, self.__class__.__name__)
| [
1,
9995,
13,
7355,
6943,
263,
18387,
5314,
363,
4663,
11726,
9846,
770,
29892,
13,
2457,
292,
28297,
4384,
3618,
13,
15945,
29908,
13,
13,
5215,
4390,
13,
5215,
931,
13,
3166,
11451,
340,
29885,
29889,
705,
1624,
2754,
29906,
29945,
1053,
4423,
13,
3166,
11451,
340,
29885,
29889,
705,
1624,
2754,
29906,
29945,
1053,
14826,
13,
3166,
11451,
340,
29885,
29889,
705,
1624,
2754,
29906,
29945,
1053,
29821,
579,
13,
3166,
11451,
340,
29885,
29889,
370,
4151,
1953,
1053,
4390,
16680,
13,
3166,
11451,
340,
29885,
29889,
11739,
29879,
1053,
6088,
29918,
5327,
29918,
2704,
29892,
7882,
29918,
5327,
29918,
2704,
13,
13,
13,
1990,
28297,
4384,
11726,
29898,
3126,
16680,
29889,
7249,
11726,
1125,
13,
1678,
9995,
13,
1678,
1281,
9084,
334,
7249,
11726,
29930,
5314,
5214,
263,
334,
29943,
487,
4384,
29930,
2777,
714,
13,
1678,
310,
10650,
4663,
848,
6421,
515,
438,
26735,
1334,
1624,
3450,
20890,
29889,
13,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
6088,
29918,
7249,
29898,
1311,
29892,
4663,
29918,
1807,
1125,
13,
4706,
9995,
13,
4706,
1459,
29879,
267,
263,
334,
29943,
487,
4384,
29930,
2777,
714,
310,
10650,
4663,
848,
29889,
9333,
3058,
13,
4706,
4426,
310,
278,
848,
526,
1304,
29901,
565,
1438,
4426,
526,
451,
1476,
470,
13,
4706,
2609,
367,
21213,
29892,
385,
1059,
338,
16610,
29889,
13,
13,
4706,
584,
3207,
4663,
29918,
1807,
29901,
263,
10650,
4663,
1347,
13,
4706,
584,
1853,
4663,
29918,
1807,
29901,
851,
13,
4706,
584,
18280,
29901,
263,
334,
29943,
487,
4384,
29930,
2777,
470,
4954,
8516,
16159,
565,
694,
848,
338,
3625,
13,
4706,
584,
336,
4637,
29901,
334,
12914,
5103,
2392,
29930,
565,
372,
338,
9301,
304,
1284,
470,
6088,
278,
13,
9651,
848,
4312,
304,
2048,
278,
1121,
29892,
334,
8787,
5103,
2392,
29930,
565,
278,
4663,
13,
9651,
1347,
8297,
29879,
385,
7331,
4660,
1059,
13,
13,
4706,
9995,
13,
4706,
565,
4663,
29918,
1807,
338,
6213,
29901,
13,
9651,
12020,
6088,
29918,
5327,
29918,
2704,
29889,
12914,
5103,
2392,
877,
7249,
848,
338,
6213,
1495,
13,
4706,
270,
353,
4390,
29889,
18132,
29898,
7249,
29918,
1807,
29897,
13,
4706,
396,
5399,
565,
1923,
4133,
4436,
29901,
445,
1423,
975,
26807,
278,
10225,
310,
671,
13,
4706,
396,
310,
7331,
1059,
4660,
11561,
491,
278,
438,
26735,
3450,
29871,
29906,
29889,
29945,
29889,
910,
13336,
338,
13,
4706,
396,
7424,
304,
367,
18164,
408,
4720,
408,
278,
3450,
8072,
9332,
29879,
7331,
363,
13,
4706,
396,
378,
345,
5414,
4436,
304,
278,
13154,
13,
4706,
565,
525,
4906,
29915,
297,
270,
322,
525,
19284,
29915,
297,
270,
29901,
13,
9651,
565,
270,
1839,
19284,
2033,
1275,
376,
29946,
29900,
29946,
1115,
13,
18884,
1596,
703,
9806,
29924,
3450,
29901,
848,
451,
1476,
448,
2933,
20092,
29901,
376,
718,
4390,
29889,
29881,
17204,
29898,
29881,
511,
270,
1839,
19284,
11287,
13,
18884,
736,
6213,
13,
9651,
25342,
270,
1839,
19284,
2033,
2804,
376,
29906,
29900,
29900,
1115,
13,
18884,
12020,
7882,
29918,
5327,
29918,
2704,
29889,
8787,
5103,
2392,
703,
9806,
29924,
3450,
29901,
1059,
448,
2933,
20092,
29901,
376,
718,
4390,
29889,
29881,
17204,
29898,
29881,
511,
270,
1839,
19284,
11287,
13,
4706,
1018,
29901,
13,
9651,
2058,
353,
4423,
29889,
5479,
29918,
3166,
29918,
27126,
29898,
29881,
29897,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
12020,
6088,
29918,
5327,
29918,
2704,
29889,
12914,
5103,
2392,
877,
4286,
7122,
4197,
1649,
978,
1649,
29892,
13,
462,
418,
525,
29901,
9301,
304,
1303,
4423,
5235,
515,
4663,
848,
25901,
13,
4706,
396,
29273,
278,
1206,
746,
694,
2582,
526,
1476,
13,
4706,
565,
525,
2798,
29915,
297,
270,
322,
270,
1839,
2798,
2033,
1275,
376,
29900,
1115,
13,
9651,
591,
19467,
353,
5159,
13,
4706,
25342,
525,
20047,
29915,
297,
270,
322,
270,
1839,
20047,
2033,
1275,
29871,
29900,
29901,
13,
9651,
591,
19467,
353,
5159,
13,
4706,
1683,
29901,
13,
9651,
565,
525,
1761,
29915,
297,
270,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
591,
19467,
353,
518,
705,
1624,
29889,
705,
1624,
29918,
3166,
29918,
27126,
29898,
667,
29897,
320,
13,
462,
18884,
363,
2944,
297,
270,
1839,
1761,
2033,
29962,
13,
18884,
5174,
7670,
2392,
29901,
13,
462,
1678,
12020,
6088,
29918,
5327,
29918,
2704,
29889,
12914,
5103,
2392,
29898,
13,
462,
3986,
525,
4286,
7122,
4197,
1649,
978,
1649,
29892,
525,
29901,
9301,
304,
1303,
14826,
525,
320,
13,
462,
462,
259,
525,
3888,
515,
4663,
848,
11287,
13,
462,
462,
29871,
1723,
13,
9651,
1683,
29901,
13,
18884,
12020,
6088,
29918,
5327,
29918,
2704,
29889,
12914,
5103,
2392,
29898,
13,
462,
3986,
525,
4286,
7122,
4197,
1649,
978,
1649,
29892,
525,
29901,
9301,
304,
1303,
14826,
525,
320,
13,
462,
462,
259,
525,
1761,
515,
4663,
848,
11287,
13,
462,
3986,
1723,
13,
4706,
1857,
29918,
2230,
353,
938,
29898,
14486,
29898,
2230,
29889,
2230,
22130,
13,
4706,
736,
29821,
579,
29889,
29943,
487,
4384,
29898,
8516,
29892,
1857,
29918,
2230,
29892,
2058,
29892,
591,
19467,
29897,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
9872,
29995,
29879,
29889,
29995,
29879,
11903,
1273,
313,
1649,
978,
1649,
29892,
1583,
17255,
1990,
1649,
17255,
978,
1649,
29897,
13,
2
] |
genedescriptions/trimming.py | alliance-genome/agr_genedescriptions | 2 | 160139 | import logging
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from typing import List, Set, Union, Tuple, Any
from ontobio import Ontology
from ontobio.assocmodel import AssociationSet
from genedescriptions.commons import CommonAncestor, TrimmingResult
from genedescriptions.ontology_tools import get_all_common_ancestors, set_ic_ontology_struct, set_ic_annot_freq
from genedescriptions.optimization import find_set_covering
logger = logging.getLogger(__name__)
class TrimmingAlgorithm(metaclass=ABCMeta):
def __init__(self, ontology: Ontology, annotations: AssociationSet = None, nodeids_blacklist: List[str] = None,
slim_terms_ic_bonus_perc: int = 0, slim_set: set = None):
self.ontology = ontology
self.annotations = annotations
self.nodeids_blacklist = nodeids_blacklist
self.slim_terms_ic_bonus_perc = slim_terms_ic_bonus_perc
self.slim_set = slim_set
@abstractmethod
def trim(self, node_ids: List[Any], max_num_nodes: int = 5, min_distance_from_root: int = 0) -> TrimmingResult:
"""
Trim the provided list of nodes
Args:
min_distance_from_root (int): minimum distance from root for terms to be included into the final result
node_ids: the list of node ids
max_num_nodes: max number of nodes in the final list after trimming
Returns:
TrimmingResult: the result of the trimming operation
"""
pass
def get_trimming_result_from_set_covering(self, initial_node_ids: List[str],
set_covering_res: List[Tuple[str, Set[str]]]) -> TrimmingResult:
covered_terms = set([e for best_term_id, covered_terms in set_covering_res for e in covered_terms])
final_terms = [best_term_id for best_term_id, covered_terms in set_covering_res]
multicover_nodes = {self.ontology.label(term_id, id_if_null=True) for term_id, covered_nodes
in set_covering_res if len(covered_nodes) > 1}
return TrimmingResult(final_terms=final_terms, partial_coverage=covered_terms != set(initial_node_ids),
covered_nodes=covered_terms, trimming_applied=final_terms != initial_node_ids,
multicovering_nodes=multicover_nodes)
class TrimmingAlgorithmIC(TrimmingAlgorithm):
def get_candidate_ic_value(self, candidate: CommonAncestor, node_ids: List[str], min_distance_from_root: int = 3,
slim_terms_ic_bonus_perc: int = 0, slim_set: set = None):
"""
Calculate the information content value of a candidate node
Args:
min_distance_from_root (int): minimum distance from root for IC computation. If terms is within the limit,
its IC will be zero
candidate (CommonAncestor): the candidate node
node_ids (List[str]): the original set of nodes to be trimmed
slim_terms_ic_bonus_perc (int): boost the IC value for terms that appear in the slim set by the provided
percentage
slim_set (set): set of terms that belong to the slim for the provided ontology
Returns:
float: the information content value of the candidate node
"""
candidate_node = self.ontology.node(candidate.node_id)
if candidate.node_id not in node_ids and candidate_node["depth"] < min_distance_from_root:
return 0
elif slim_set and candidate.node_id in slim_set:
return candidate_node["IC"] * (1 + slim_terms_ic_bonus_perc)
else:
if "IC" in candidate_node:
return candidate_node["IC"]
else:
logger.warning(f"Annotation to a possibly obsolete node that doesn't have an IC value: "
f"{candidate.node_id}")
return 0
def trim(self, node_ids: List[str], max_num_nodes: int = 3, min_distance_from_root: int = 0) -> TrimmingResult:
"""trim the list of terms by selecting the best combination of terms from the initial list or their common
ancestors based on information content
Args:
min_distance_from_root (int): minimum distance from root for nodes to be included into the final result
node_ids (List[str]): the list of nodes to merge by common ancestor
max_num_nodes (int): maximum number of nodes to be included in the trimmed set. This also represents the
minimum number of terms above which the merge operation is performed
Returns:
Set[str]: the set of trimmed terms, together with the set of original terms that each of them covers
"""
common_ancestors = get_all_common_ancestors(node_ids=node_ids, ontology=self.ontology,
nodeids_blacklist=self.nodeids_blacklist)
values = [self.get_candidate_ic_value(candidate=candidate, node_ids=node_ids,
min_distance_from_root=min_distance_from_root,
slim_terms_ic_bonus_perc=self.slim_terms_ic_bonus_perc,
slim_set=self.slim_set) for candidate in common_ancestors]
if self.slim_set and any([node.node_id in self.slim_set for node in common_ancestors]):
logger.debug("some candidates are present in the slim set")
# remove ancestors with zero IC
common_ancestors = [common_ancestor for common_ancestor, value in zip(common_ancestors, values) if value > 0]
values = [value for value in values if value > 0]
best_terms = find_set_covering(subsets=common_ancestors, ontology=self.ontology, max_num_subsets=max_num_nodes,
value=values)
return self.get_trimming_result_from_set_covering(initial_node_ids=node_ids, set_covering_res=best_terms)
class TrimmingAlgorithmLCA(TrimmingAlgorithm):
def trim(self, node_ids: List[str], max_num_nodes: int = 3, min_distance_from_root: int = 0):
candidates_dict = {candidate.node_id: (candidate.node_label, candidate.covered_starting_nodes) for candidate in
get_all_common_ancestors(node_ids=node_ids, ontology=self.ontology,
min_distance_from_root=min_distance_from_root,
nodeids_blacklist=self.nodeids_blacklist)}
cands_ids_to_process = set(candidates_dict.keys())
selected_cands_ids = []
node_to_cands_map = defaultdict(list)
for cand in cands_ids_to_process:
for node in candidates_dict[cand][1]:
node_to_cands_map[node].append(cand)
while len(cands_ids_to_process) > 0:
cand_id = cands_ids_to_process.pop()
comparable_cands = [(cid, cval[1]) for cid, cval in candidates_dict.items() if cid != cand_id and all(
[child_id in cval[1] for child_id in candidates_dict[cand_id][1]])]
if len(comparable_cands) > 0:
max_len = max(map(lambda x: len(x[1]), comparable_cands))
best_cands = [candidate for candidate in comparable_cands if len(candidate[1]) == max_len]
if len(best_cands) > 1:
weighted_best_cands = sorted([(self.ontology.node(cand[0])["depth"], cand) for cand in best_cands],
key=lambda x: x[0], reverse=True)
max_weight = max(map(lambda x: x[0], weighted_best_cands))
best_cands = [wcand[1] for wcand in weighted_best_cands if wcand[0] == max_weight]
else:
max_weight = self.ontology.node(best_cands[0][0])["depth"]
if len(candidates_dict[cand_id][1]) > len(best_cands[0][1]) or \
(len(candidates_dict[cand_id][1]) > len(best_cands[0][1]) and
self.ontology.node(cand_id)["depth"] > max_weight):
best_cands = [(cand_id, candidates_dict[cand_id][1])]
for best_cand in best_cands:
selected_cands_ids.append(best_cand[0])
cands_ids_to_process = {cand_id for cand_id in cands_ids_to_process if best_cand[0] not in
self.ontology.ancestors(cand_id, reflexive=True)}
else:
selected_cands_ids.append(cand_id)
if len(selected_cands_ids) <= max_num_nodes:
multicover_nodes = {self.ontology.label(term_id, id_if_null=True) for term_id, candidate_info
in candidates_dict.items() if len(candidate_info[1]) > 1}
return TrimmingResult(final_terms=selected_cands_ids, trimming_applied=True, partial_coverage=False,
covered_nodes=set([covered_node for node_id in selected_cands_ids for covered_node in
candidates_dict[node_id][1]]),
multicovering_nodes=multicover_nodes)
else:
best_terms = find_set_covering(
[CommonAncestor(node_id, self.ontology.label(node_id, id_if_null=True), candidates_dict[node_id][1])
for node_id in selected_cands_ids], ontology=self.ontology, max_num_subsets=max_num_nodes)
return self.get_trimming_result_from_set_covering(initial_node_ids=node_ids, set_covering_res=best_terms)
class TrimmingAlgorithmNaive(TrimmingAlgorithm):
def trim(self, node_ids: List[str], max_num_nodes: int = 3, min_distance_from_root: int = 0):
logger.debug("applying trimming through naive algorithm")
final_terms_set = {}
ancestor_paths = defaultdict(list)
term_paths = defaultdict(set)
# step 1: get all path for each term and populate data structures
for node_id in node_ids:
node_root = None
node_ont = self.ontology.node(node_id)
if "meta" in node_ont and "basicPropertyValues" in node_ont["meta"]:
for basic_prop_val in node_ont["meta"]["basicPropertyValues"]:
if basic_prop_val["pred"] == "OIO:hasOBONamespace":
node_root = basic_prop_val["val"]
paths = self.get_all_paths_to_root(node_id=node_id, ontology=self.ontology,
min_distance_from_root=min_distance_from_root, relations=None,
nodeids_blacklist=self.nodeids_blacklist, root_node=node_root)
for path in paths:
term_paths[node_id].add(path)
ancestor_paths[path[-1]].append(path)
# step 2: merge terms and keep common ancestors
for node_id in sorted(node_ids):
term_paths_copy = sorted(term_paths[node_id].copy(), key=lambda x: len(x))
while len(term_paths_copy) > 0:
curr_path = list(term_paths_copy.pop())
selected_highest_ancestor = curr_path.pop()
related_paths = ancestor_paths[selected_highest_ancestor]
if not related_paths:
break
covered_nodes_set = set([related_path[0] for related_path in related_paths])
del ancestor_paths[selected_highest_ancestor]
if curr_path:
if all(map(lambda x: x[0] == curr_path[0], related_paths)):
selected_highest_ancestor = curr_path[0]
else:
i = -1
while len(curr_path) > 1:
i -= 1
curr_highest_ancestor = curr_path.pop()
if not all(map(lambda x: len(x) >= - i, related_paths)):
break
if all(map(lambda x: x[i] == curr_highest_ancestor, related_paths)):
selected_highest_ancestor = curr_highest_ancestor
if selected_highest_ancestor in ancestor_paths:
del ancestor_paths[selected_highest_ancestor]
for path in related_paths:
term_paths[path[0]].discard(path)
final_terms_set[selected_highest_ancestor] = covered_nodes_set
for path in related_paths:
term_paths[path[0]].discard(path)
if len(term_paths[node_id]) > 0:
term_paths_copy = term_paths[node_id].copy()
else:
break
if len(list(final_terms_set.keys())) <= max_num_nodes:
multicover_nodes = {self.ontology.label(term_id, id_if_null=True) for term_id, covered_terms
in final_terms_set.items() if len(covered_terms) > 1}
return TrimmingResult(final_terms=list(final_terms_set.keys()), trimming_applied=True,
partial_coverage=False,
covered_nodes=set([covered_node for covered_set in final_terms_set.values() for
covered_node in covered_set]),
multicovering_nodes=multicover_nodes)
else:
best_terms = find_set_covering(
[CommonAncestor(k, self.ontology.label(k, id_if_null=True), v) for k, v in final_terms_set.items()],
max_num_subsets=max_num_nodes)
return self.get_trimming_result_from_set_covering(initial_node_ids=node_ids, set_covering_res=best_terms)
@staticmethod
def get_all_paths_to_root(node_id: str, ontology: Ontology, min_distance_from_root: int = 0,
relations: List[str] = None, nodeids_blacklist: List[str] = None,
previous_path: Union[None, List[str]] = None, root_node=None) -> Set[Tuple[str]]:
"""get all possible paths connecting a go term to its root terms
Args:
node_id (str): a valid GO id for the starting term
ontology (Ontology): the go ontology
min_distance_from_root (int): return only terms at a specified minimum distance from root terms
relations (List[str]): the list of relations to be used
nodeids_blacklist (List[str]): a list of node ids to exclude from the paths
previous_path (Union[None, List[str]]): the path to get to the current node
Returns:
Set[Tuple[str]]: the set of paths connecting the specified term to its root terms, each of which contains a
sequence of terms ids
"""
if previous_path is None:
previous_path = []
new_path = previous_path[:]
if not nodeids_blacklist or node_id not in nodeids_blacklist:
new_path.append(node_id)
parents = [parent for parent in ontology.parents(node=node_id, relations=relations) if
ontology.node(parent)["depth"] >= min_distance_from_root]
parents_same_root = []
if root_node:
for parent in parents:
parent_node = ontology.node(parent)
parent_root = None
if "meta" in parent_node and "basicPropertyValues" in parent_node["meta"]:
for basic_prop_val in parent_node["meta"]["basicPropertyValues"]:
if basic_prop_val["pred"] == "OIO:hasOBONamespace":
parent_root = basic_prop_val["val"]
if parent_root and parent_root == root_node:
parents_same_root.append(parent)
parents = parents_same_root
if len(parents) > 0:
# go up the tree, following a depth first visit
paths_to_return = set()
for parent in parents:
for path in TrimmingAlgorithmNaive.get_all_paths_to_root(node_id=parent, ontology=ontology,
previous_path=new_path,
min_distance_from_root=min_distance_from_root,
relations=relations,
nodeids_blacklist=nodeids_blacklist,
root_node=root_node):
paths_to_return.add(path)
return paths_to_return
if len(new_path) == 0:
return {(node_id,)}
else:
return {tuple(new_path)}
CONF_TO_TRIMMING_CLASS = {
"lca": TrimmingAlgorithmLCA,
"ic": TrimmingAlgorithmIC,
"naive": TrimmingAlgorithmNaive,
"icGO": TrimmingAlgorithmIC}
| [
1,
1053,
12183,
13,
3166,
25638,
1053,
16417,
19346,
29892,
9846,
5696,
13,
3166,
16250,
1053,
2322,
8977,
13,
3166,
19229,
1053,
2391,
29892,
3789,
29892,
7761,
29892,
12603,
552,
29892,
3139,
13,
13,
3166,
11480,
24840,
1053,
18265,
3002,
13,
3166,
11480,
24840,
29889,
21011,
4299,
1053,
7993,
2697,
13,
13,
3166,
2531,
11696,
699,
1980,
29889,
22382,
1053,
13103,
2744,
29883,
342,
272,
29892,
1605,
25217,
3591,
13,
3166,
2531,
11696,
699,
1980,
29889,
609,
3002,
29918,
8504,
1053,
679,
29918,
497,
29918,
9435,
29918,
4564,
342,
943,
29892,
731,
29918,
293,
29918,
609,
3002,
29918,
4984,
29892,
731,
29918,
293,
29918,
6735,
29918,
29888,
7971,
13,
3166,
2531,
11696,
699,
1980,
29889,
20640,
2133,
1053,
1284,
29918,
842,
29918,
11911,
292,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
1990,
1605,
25217,
22461,
4540,
29898,
2527,
562,
605,
29922,
19658,
19346,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4625,
3002,
29901,
18265,
3002,
29892,
25495,
29901,
7993,
2697,
353,
6213,
29892,
2943,
4841,
29918,
8517,
1761,
29901,
2391,
29961,
710,
29962,
353,
6213,
29892,
13,
462,
2243,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
29901,
938,
353,
29871,
29900,
29892,
2243,
326,
29918,
842,
29901,
731,
353,
6213,
1125,
13,
4706,
1583,
29889,
609,
3002,
353,
4625,
3002,
13,
4706,
1583,
29889,
6735,
800,
353,
25495,
13,
4706,
1583,
29889,
3177,
4841,
29918,
8517,
1761,
353,
2943,
4841,
29918,
8517,
1761,
13,
4706,
1583,
29889,
2536,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
353,
2243,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
13,
4706,
1583,
29889,
2536,
326,
29918,
842,
353,
2243,
326,
29918,
842,
13,
13,
1678,
732,
16595,
5696,
13,
1678,
822,
17151,
29898,
1311,
29892,
2943,
29918,
4841,
29901,
2391,
29961,
10773,
1402,
4236,
29918,
1949,
29918,
18010,
29901,
938,
353,
29871,
29945,
29892,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
938,
353,
29871,
29900,
29897,
1599,
1605,
25217,
3591,
29901,
13,
4706,
9995,
13,
4706,
1605,
326,
278,
4944,
1051,
310,
7573,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
313,
524,
1125,
9212,
5418,
515,
3876,
363,
4958,
304,
367,
5134,
964,
278,
2186,
1121,
13,
9651,
2943,
29918,
4841,
29901,
278,
1051,
310,
2943,
18999,
13,
9651,
4236,
29918,
1949,
29918,
18010,
29901,
4236,
1353,
310,
7573,
297,
278,
2186,
1051,
1156,
17151,
4056,
13,
13,
4706,
16969,
29901,
13,
9651,
1605,
25217,
3591,
29901,
278,
1121,
310,
278,
17151,
4056,
5858,
13,
4706,
9995,
13,
4706,
1209,
13,
13,
1678,
822,
679,
29918,
15450,
4056,
29918,
2914,
29918,
3166,
29918,
842,
29918,
11911,
292,
29898,
1311,
29892,
2847,
29918,
3177,
29918,
4841,
29901,
2391,
29961,
710,
1402,
13,
462,
462,
795,
731,
29918,
11911,
292,
29918,
690,
29901,
2391,
29961,
23215,
552,
29961,
710,
29892,
3789,
29961,
710,
5262,
2314,
1599,
1605,
25217,
3591,
29901,
13,
4706,
10664,
29918,
357,
1516,
353,
731,
4197,
29872,
363,
1900,
29918,
8489,
29918,
333,
29892,
10664,
29918,
357,
1516,
297,
731,
29918,
11911,
292,
29918,
690,
363,
321,
297,
10664,
29918,
357,
1516,
2314,
13,
4706,
2186,
29918,
357,
1516,
353,
518,
13318,
29918,
8489,
29918,
333,
363,
1900,
29918,
8489,
29918,
333,
29892,
10664,
29918,
357,
1516,
297,
731,
29918,
11911,
292,
29918,
690,
29962,
13,
4706,
1773,
293,
957,
29918,
18010,
353,
426,
1311,
29889,
609,
3002,
29889,
1643,
29898,
8489,
29918,
333,
29892,
1178,
29918,
361,
29918,
4304,
29922,
5574,
29897,
363,
1840,
29918,
333,
29892,
10664,
29918,
18010,
13,
462,
9651,
297,
731,
29918,
11911,
292,
29918,
690,
565,
7431,
29898,
11911,
287,
29918,
18010,
29897,
1405,
29871,
29896,
29913,
13,
4706,
736,
1605,
25217,
3591,
29898,
8394,
29918,
357,
1516,
29922,
8394,
29918,
357,
1516,
29892,
7687,
29918,
11911,
482,
29922,
11911,
287,
29918,
357,
1516,
2804,
731,
29898,
11228,
29918,
3177,
29918,
4841,
511,
13,
462,
795,
10664,
29918,
18010,
29922,
11911,
287,
29918,
357,
1516,
29892,
17151,
4056,
29918,
932,
2957,
29922,
8394,
29918,
357,
1516,
2804,
2847,
29918,
3177,
29918,
4841,
29892,
13,
462,
795,
1773,
293,
957,
292,
29918,
18010,
29922,
4713,
293,
957,
29918,
18010,
29897,
13,
13,
13,
1990,
1605,
25217,
22461,
4540,
2965,
29898,
2308,
25217,
22461,
4540,
1125,
13,
13,
1678,
822,
679,
29918,
29883,
5380,
403,
29918,
293,
29918,
1767,
29898,
1311,
29892,
14020,
29901,
13103,
2744,
29883,
342,
272,
29892,
2943,
29918,
4841,
29901,
2391,
29961,
710,
1402,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
938,
353,
29871,
29941,
29892,
13,
462,
1669,
2243,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
29901,
938,
353,
29871,
29900,
29892,
2243,
326,
29918,
842,
29901,
731,
353,
6213,
1125,
13,
4706,
9995,
13,
4706,
20535,
403,
278,
2472,
2793,
995,
310,
263,
14020,
2943,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
313,
524,
1125,
9212,
5418,
515,
3876,
363,
18340,
16287,
29889,
960,
4958,
338,
2629,
278,
4046,
29892,
13,
18884,
967,
18340,
674,
367,
5225,
13,
9651,
14020,
313,
18877,
2744,
29883,
342,
272,
1125,
278,
14020,
2943,
13,
9651,
2943,
29918,
4841,
313,
1293,
29961,
710,
29962,
1125,
278,
2441,
731,
310,
7573,
304,
367,
17151,
2168,
13,
9651,
2243,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
313,
524,
1125,
14505,
278,
18340,
995,
363,
4958,
393,
2615,
297,
278,
2243,
326,
731,
491,
278,
4944,
13,
462,
462,
9651,
19649,
13,
9651,
2243,
326,
29918,
842,
313,
842,
1125,
731,
310,
4958,
393,
6852,
304,
278,
2243,
326,
363,
278,
4944,
4625,
3002,
13,
13,
4706,
16969,
29901,
13,
9651,
5785,
29901,
278,
2472,
2793,
995,
310,
278,
14020,
2943,
13,
4706,
9995,
13,
4706,
14020,
29918,
3177,
353,
1583,
29889,
609,
3002,
29889,
3177,
29898,
29883,
5380,
403,
29889,
3177,
29918,
333,
29897,
13,
4706,
565,
14020,
29889,
3177,
29918,
333,
451,
297,
2943,
29918,
4841,
322,
14020,
29918,
3177,
3366,
19488,
3108,
529,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
13,
9651,
736,
29871,
29900,
13,
4706,
25342,
2243,
326,
29918,
842,
322,
14020,
29889,
3177,
29918,
333,
297,
2243,
326,
29918,
842,
29901,
13,
9651,
736,
14020,
29918,
3177,
3366,
2965,
3108,
334,
313,
29896,
718,
2243,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
376,
2965,
29908,
297,
14020,
29918,
3177,
29901,
13,
18884,
736,
14020,
29918,
3177,
3366,
2965,
3108,
13,
9651,
1683,
29901,
13,
18884,
17927,
29889,
27392,
29898,
29888,
29908,
21978,
304,
263,
10075,
704,
2170,
371,
2943,
393,
1838,
29915,
29873,
505,
385,
18340,
995,
29901,
376,
13,
462,
1669,
285,
29908,
29912,
29883,
5380,
403,
29889,
3177,
29918,
333,
27195,
13,
18884,
736,
29871,
29900,
13,
13,
1678,
822,
17151,
29898,
1311,
29892,
2943,
29918,
4841,
29901,
2391,
29961,
710,
1402,
4236,
29918,
1949,
29918,
18010,
29901,
938,
353,
29871,
29941,
29892,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
938,
353,
29871,
29900,
29897,
1599,
1605,
25217,
3591,
29901,
13,
4706,
9995,
15450,
278,
1051,
310,
4958,
491,
18851,
278,
1900,
10296,
310,
4958,
515,
278,
2847,
1051,
470,
1009,
3619,
13,
4706,
19525,
943,
2729,
373,
2472,
2793,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
313,
524,
1125,
9212,
5418,
515,
3876,
363,
7573,
304,
367,
5134,
964,
278,
2186,
1121,
13,
9651,
2943,
29918,
4841,
313,
1293,
29961,
710,
29962,
1125,
278,
1051,
310,
7573,
304,
10366,
491,
3619,
19525,
272,
13,
9651,
4236,
29918,
1949,
29918,
18010,
313,
524,
1125,
7472,
1353,
310,
7573,
304,
367,
5134,
297,
278,
17151,
2168,
731,
29889,
910,
884,
11524,
278,
13,
462,
462,
9212,
1353,
310,
4958,
2038,
607,
278,
10366,
5858,
338,
8560,
13,
4706,
16969,
29901,
13,
9651,
3789,
29961,
710,
5387,
278,
731,
310,
17151,
2168,
4958,
29892,
4208,
411,
278,
731,
310,
2441,
4958,
393,
1269,
310,
963,
18469,
13,
4706,
9995,
13,
4706,
3619,
29918,
4564,
342,
943,
353,
679,
29918,
497,
29918,
9435,
29918,
4564,
342,
943,
29898,
3177,
29918,
4841,
29922,
3177,
29918,
4841,
29892,
4625,
3002,
29922,
1311,
29889,
609,
3002,
29892,
13,
462,
462,
462,
1678,
2943,
4841,
29918,
8517,
1761,
29922,
1311,
29889,
3177,
4841,
29918,
8517,
1761,
29897,
13,
4706,
1819,
353,
518,
1311,
29889,
657,
29918,
29883,
5380,
403,
29918,
293,
29918,
1767,
29898,
29883,
5380,
403,
29922,
29883,
5380,
403,
29892,
2943,
29918,
4841,
29922,
3177,
29918,
4841,
29892,
13,
462,
462,
795,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29922,
1195,
29918,
19244,
29918,
3166,
29918,
4632,
29892,
13,
462,
462,
795,
2243,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
29922,
1311,
29889,
2536,
326,
29918,
357,
1516,
29918,
293,
29918,
6718,
375,
29918,
546,
29883,
29892,
13,
462,
462,
795,
2243,
326,
29918,
842,
29922,
1311,
29889,
2536,
326,
29918,
842,
29897,
363,
14020,
297,
3619,
29918,
4564,
342,
943,
29962,
13,
4706,
565,
1583,
29889,
2536,
326,
29918,
842,
322,
738,
4197,
3177,
29889,
3177,
29918,
333,
297,
1583,
29889,
2536,
326,
29918,
842,
363,
2943,
297,
3619,
29918,
4564,
342,
943,
29962,
1125,
13,
9651,
17927,
29889,
8382,
703,
5372,
21669,
526,
2198,
297,
278,
2243,
326,
731,
1159,
13,
4706,
396,
3349,
19525,
943,
411,
5225,
18340,
13,
4706,
3619,
29918,
4564,
342,
943,
353,
518,
9435,
29918,
4564,
342,
272,
363,
3619,
29918,
4564,
342,
272,
29892,
995,
297,
14319,
29898,
9435,
29918,
4564,
342,
943,
29892,
1819,
29897,
565,
995,
1405,
29871,
29900,
29962,
13,
4706,
1819,
353,
518,
1767,
363,
995,
297,
1819,
565,
995,
1405,
29871,
29900,
29962,
13,
4706,
1900,
29918,
357,
1516,
353,
1284,
29918,
842,
29918,
11911,
292,
29898,
6484,
29879,
29922,
9435,
29918,
4564,
342,
943,
29892,
4625,
3002,
29922,
1311,
29889,
609,
3002,
29892,
4236,
29918,
1949,
29918,
6484,
29879,
29922,
3317,
29918,
1949,
29918,
18010,
29892,
13,
462,
462,
539,
995,
29922,
5975,
29897,
13,
4706,
736,
1583,
29889,
657,
29918,
15450,
4056,
29918,
2914,
29918,
3166,
29918,
842,
29918,
11911,
292,
29898,
11228,
29918,
3177,
29918,
4841,
29922,
3177,
29918,
4841,
29892,
731,
29918,
11911,
292,
29918,
690,
29922,
13318,
29918,
357,
1516,
29897,
13,
13,
13,
1990,
1605,
25217,
22461,
4540,
29931,
5454,
29898,
2308,
25217,
22461,
4540,
1125,
13,
13,
1678,
822,
17151,
29898,
1311,
29892,
2943,
29918,
4841,
29901,
2391,
29961,
710,
1402,
4236,
29918,
1949,
29918,
18010,
29901,
938,
353,
29871,
29941,
29892,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
938,
353,
29871,
29900,
1125,
13,
4706,
21669,
29918,
8977,
353,
426,
29883,
5380,
403,
29889,
3177,
29918,
333,
29901,
313,
29883,
5380,
403,
29889,
3177,
29918,
1643,
29892,
14020,
29889,
11911,
287,
29918,
2962,
292,
29918,
18010,
29897,
363,
14020,
297,
13,
462,
965,
679,
29918,
497,
29918,
9435,
29918,
4564,
342,
943,
29898,
3177,
29918,
4841,
29922,
3177,
29918,
4841,
29892,
4625,
3002,
29922,
1311,
29889,
609,
3002,
29892,
13,
462,
462,
462,
1678,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29922,
1195,
29918,
19244,
29918,
3166,
29918,
4632,
29892,
13,
462,
462,
462,
1678,
2943,
4841,
29918,
8517,
1761,
29922,
1311,
29889,
3177,
4841,
29918,
8517,
1761,
2915,
13,
4706,
274,
4167,
29918,
4841,
29918,
517,
29918,
5014,
353,
731,
29898,
29883,
5380,
1078,
29918,
8977,
29889,
8149,
3101,
13,
4706,
4629,
29918,
29883,
4167,
29918,
4841,
353,
5159,
13,
4706,
2943,
29918,
517,
29918,
29883,
4167,
29918,
1958,
353,
2322,
8977,
29898,
1761,
29897,
13,
4706,
363,
23794,
297,
274,
4167,
29918,
4841,
29918,
517,
29918,
5014,
29901,
13,
9651,
363,
2943,
297,
21669,
29918,
8977,
29961,
29883,
392,
3816,
29896,
5387,
13,
18884,
2943,
29918,
517,
29918,
29883,
4167,
29918,
1958,
29961,
3177,
1822,
4397,
29898,
29883,
392,
29897,
13,
4706,
1550,
7431,
29898,
29883,
4167,
29918,
4841,
29918,
517,
29918,
5014,
29897,
1405,
29871,
29900,
29901,
13,
9651,
23794,
29918,
333,
353,
274,
4167,
29918,
4841,
29918,
517,
29918,
5014,
29889,
7323,
580,
13,
9651,
5734,
519,
29918,
29883,
4167,
353,
17288,
25232,
29892,
274,
791,
29961,
29896,
2314,
363,
274,
333,
29892,
274,
791,
297,
21669,
29918,
8977,
29889,
7076,
580,
565,
274,
333,
2804,
23794,
29918,
333,
322,
599,
29898,
13,
18884,
518,
5145,
29918,
333,
297,
274,
791,
29961,
29896,
29962,
363,
2278,
29918,
333,
297,
21669,
29918,
8977,
29961,
29883,
392,
29918,
333,
3816,
29896,
24960,
29962,
13,
9651,
565,
7431,
29898,
510,
862,
519,
29918,
29883,
4167,
29897,
1405,
29871,
29900,
29901,
13,
18884,
4236,
29918,
2435,
353,
4236,
29898,
1958,
29898,
2892,
921,
29901,
7431,
29898,
29916,
29961,
29896,
11724,
5734,
519,
29918,
29883,
4167,
876,
13,
18884,
1900,
29918,
29883,
4167,
353,
518,
29883,
5380,
403,
363,
14020,
297,
5734,
519,
29918,
29883,
4167,
565,
7431,
29898,
29883,
5380,
403,
29961,
29896,
2314,
1275,
4236,
29918,
2435,
29962,
13,
18884,
565,
7431,
29898,
13318,
29918,
29883,
4167,
29897,
1405,
29871,
29896,
29901,
13,
462,
1678,
7688,
287,
29918,
13318,
29918,
29883,
4167,
353,
12705,
4197,
29898,
1311,
29889,
609,
3002,
29889,
3177,
29898,
29883,
392,
29961,
29900,
2314,
3366,
19488,
12436,
23794,
29897,
363,
23794,
297,
1900,
29918,
29883,
4167,
1402,
13,
462,
462,
462,
1820,
29922,
2892,
921,
29901,
921,
29961,
29900,
1402,
11837,
29922,
5574,
29897,
13,
462,
1678,
4236,
29918,
7915,
353,
4236,
29898,
1958,
29898,
2892,
921,
29901,
921,
29961,
29900,
1402,
7688,
287,
29918,
13318,
29918,
29883,
4167,
876,
13,
462,
1678,
1900,
29918,
29883,
4167,
353,
518,
29893,
29883,
392,
29961,
29896,
29962,
363,
28678,
392,
297,
7688,
287,
29918,
13318,
29918,
29883,
4167,
565,
28678,
392,
29961,
29900,
29962,
1275,
4236,
29918,
7915,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
4236,
29918,
7915,
353,
1583,
29889,
609,
3002,
29889,
3177,
29898,
13318,
29918,
29883,
4167,
29961,
29900,
3816,
29900,
2314,
3366,
19488,
3108,
13,
18884,
565,
7431,
29898,
29883,
5380,
1078,
29918,
8977,
29961,
29883,
392,
29918,
333,
3816,
29896,
2314,
1405,
7431,
29898,
13318,
29918,
29883,
4167,
29961,
29900,
3816,
29896,
2314,
470,
320,
13,
462,
1678,
313,
2435,
29898,
29883,
5380,
1078,
29918,
8977,
29961,
29883,
392,
29918,
333,
3816,
29896,
2314,
1405,
7431,
29898,
13318,
29918,
29883,
4167,
29961,
29900,
3816,
29896,
2314,
322,
13,
462,
268,
1583,
29889,
609,
3002,
29889,
3177,
29898,
29883,
392,
29918,
333,
29897,
3366,
19488,
3108,
1405,
4236,
29918,
7915,
1125,
13,
462,
1678,
1900,
29918,
29883,
4167,
353,
17288,
29883,
392,
29918,
333,
29892,
21669,
29918,
8977,
29961,
29883,
392,
29918,
333,
3816,
29896,
2314,
29962,
13,
18884,
363,
1900,
29918,
29883,
392,
297,
1900,
29918,
29883,
4167,
29901,
13,
462,
1678,
4629,
29918,
29883,
4167,
29918,
4841,
29889,
4397,
29898,
13318,
29918,
29883,
392,
29961,
29900,
2314,
13,
462,
1678,
274,
4167,
29918,
4841,
29918,
517,
29918,
5014,
353,
426,
29883,
392,
29918,
333,
363,
23794,
29918,
333,
297,
274,
4167,
29918,
4841,
29918,
517,
29918,
5014,
565,
1900,
29918,
29883,
392,
29961,
29900,
29962,
451,
297,
13,
462,
462,
9651,
1583,
29889,
609,
3002,
29889,
4564,
342,
943,
29898,
29883,
392,
29918,
333,
29892,
2143,
2506,
573,
29922,
5574,
2915,
13,
9651,
1683,
29901,
13,
18884,
4629,
29918,
29883,
4167,
29918,
4841,
29889,
4397,
29898,
29883,
392,
29918,
333,
29897,
13,
4706,
565,
7431,
29898,
8391,
29918,
29883,
4167,
29918,
4841,
29897,
5277,
4236,
29918,
1949,
29918,
18010,
29901,
13,
9651,
1773,
293,
957,
29918,
18010,
353,
426,
1311,
29889,
609,
3002,
29889,
1643,
29898,
8489,
29918,
333,
29892,
1178,
29918,
361,
29918,
4304,
29922,
5574,
29897,
363,
1840,
29918,
333,
29892,
14020,
29918,
3888,
13,
462,
18884,
297,
21669,
29918,
8977,
29889,
7076,
580,
565,
7431,
29898,
29883,
5380,
403,
29918,
3888,
29961,
29896,
2314,
1405,
29871,
29896,
29913,
13,
9651,
736,
1605,
25217,
3591,
29898,
8394,
29918,
357,
1516,
29922,
8391,
29918,
29883,
4167,
29918,
4841,
29892,
17151,
4056,
29918,
932,
2957,
29922,
5574,
29892,
7687,
29918,
11911,
482,
29922,
8824,
29892,
13,
462,
462,
29871,
10664,
29918,
18010,
29922,
842,
4197,
11911,
287,
29918,
3177,
363,
2943,
29918,
333,
297,
4629,
29918,
29883,
4167,
29918,
4841,
363,
10664,
29918,
3177,
297,
13,
462,
462,
462,
268,
21669,
29918,
8977,
29961,
3177,
29918,
333,
3816,
29896,
5262,
511,
13,
462,
462,
29871,
1773,
293,
957,
292,
29918,
18010,
29922,
4713,
293,
957,
29918,
18010,
29897,
13,
4706,
1683,
29901,
13,
9651,
1900,
29918,
357,
1516,
353,
1284,
29918,
842,
29918,
11911,
292,
29898,
13,
18884,
518,
18877,
2744,
29883,
342,
272,
29898,
3177,
29918,
333,
29892,
1583,
29889,
609,
3002,
29889,
1643,
29898,
3177,
29918,
333,
29892,
1178,
29918,
361,
29918,
4304,
29922,
5574,
511,
21669,
29918,
8977,
29961,
3177,
29918,
333,
3816,
29896,
2314,
13,
462,
363,
2943,
29918,
333,
297,
4629,
29918,
29883,
4167,
29918,
4841,
1402,
4625,
3002,
29922,
1311,
29889,
609,
3002,
29892,
4236,
29918,
1949,
29918,
6484,
29879,
29922,
3317,
29918,
1949,
29918,
18010,
29897,
13,
9651,
736,
1583,
29889,
657,
29918,
15450,
4056,
29918,
2914,
29918,
3166,
29918,
842,
29918,
11911,
292,
29898,
11228,
29918,
3177,
29918,
4841,
29922,
3177,
29918,
4841,
29892,
731,
29918,
11911,
292,
29918,
690,
29922,
13318,
29918,
357,
1516,
29897,
13,
13,
13,
1990,
1605,
25217,
22461,
4540,
13695,
573,
29898,
2308,
25217,
22461,
4540,
1125,
13,
13,
1678,
822,
17151,
29898,
1311,
29892,
2943,
29918,
4841,
29901,
2391,
29961,
710,
1402,
4236,
29918,
1949,
29918,
18010,
29901,
938,
353,
29871,
29941,
29892,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
938,
353,
29871,
29900,
1125,
13,
4706,
17927,
29889,
8382,
703,
932,
5890,
17151,
4056,
1549,
1055,
573,
5687,
1159,
13,
4706,
2186,
29918,
357,
1516,
29918,
842,
353,
6571,
13,
4706,
19525,
272,
29918,
24772,
353,
2322,
8977,
29898,
1761,
29897,
13,
4706,
1840,
29918,
24772,
353,
2322,
8977,
29898,
842,
29897,
13,
4706,
396,
4331,
29871,
29896,
29901,
679,
599,
2224,
363,
1269,
1840,
322,
19450,
848,
12286,
13,
4706,
363,
2943,
29918,
333,
297,
2943,
29918,
4841,
29901,
13,
9651,
2943,
29918,
4632,
353,
6213,
13,
9651,
2943,
29918,
609,
353,
1583,
29889,
609,
3002,
29889,
3177,
29898,
3177,
29918,
333,
29897,
13,
9651,
565,
376,
7299,
29908,
297,
2943,
29918,
609,
322,
376,
16121,
4854,
9065,
29908,
297,
2943,
29918,
609,
3366,
7299,
3108,
29901,
13,
18884,
363,
6996,
29918,
7728,
29918,
791,
297,
2943,
29918,
609,
3366,
7299,
3108,
3366,
16121,
4854,
9065,
3108,
29901,
13,
462,
1678,
565,
6996,
29918,
7728,
29918,
791,
3366,
11965,
3108,
1275,
376,
29949,
5971,
29901,
5349,
14824,
1164,
1280,
3535,
1115,
13,
462,
4706,
2943,
29918,
4632,
353,
6996,
29918,
7728,
29918,
791,
3366,
791,
3108,
13,
9651,
10898,
353,
1583,
29889,
657,
29918,
497,
29918,
24772,
29918,
517,
29918,
4632,
29898,
3177,
29918,
333,
29922,
3177,
29918,
333,
29892,
4625,
3002,
29922,
1311,
29889,
609,
3002,
29892,
13,
462,
462,
1669,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29922,
1195,
29918,
19244,
29918,
3166,
29918,
4632,
29892,
5302,
29922,
8516,
29892,
13,
462,
462,
1669,
2943,
4841,
29918,
8517,
1761,
29922,
1311,
29889,
3177,
4841,
29918,
8517,
1761,
29892,
3876,
29918,
3177,
29922,
3177,
29918,
4632,
29897,
13,
9651,
363,
2224,
297,
10898,
29901,
13,
18884,
1840,
29918,
24772,
29961,
3177,
29918,
333,
1822,
1202,
29898,
2084,
29897,
13,
18884,
19525,
272,
29918,
24772,
29961,
2084,
14352,
29896,
29962,
1822,
4397,
29898,
2084,
29897,
13,
4706,
396,
4331,
29871,
29906,
29901,
10366,
4958,
322,
3013,
3619,
19525,
943,
13,
4706,
363,
2943,
29918,
333,
297,
12705,
29898,
3177,
29918,
4841,
1125,
13,
9651,
1840,
29918,
24772,
29918,
8552,
353,
12705,
29898,
8489,
29918,
24772,
29961,
3177,
29918,
333,
1822,
8552,
3285,
1820,
29922,
2892,
921,
29901,
7431,
29898,
29916,
876,
13,
9651,
1550,
7431,
29898,
8489,
29918,
24772,
29918,
8552,
29897,
1405,
29871,
29900,
29901,
13,
18884,
16256,
29918,
2084,
353,
1051,
29898,
8489,
29918,
24772,
29918,
8552,
29889,
7323,
3101,
13,
18884,
4629,
29918,
9812,
342,
29918,
4564,
342,
272,
353,
16256,
29918,
2084,
29889,
7323,
580,
13,
18884,
4475,
29918,
24772,
353,
19525,
272,
29918,
24772,
29961,
8391,
29918,
9812,
342,
29918,
4564,
342,
272,
29962,
13,
18884,
565,
451,
4475,
29918,
24772,
29901,
13,
462,
1678,
2867,
13,
18884,
10664,
29918,
18010,
29918,
842,
353,
731,
4197,
12817,
29918,
2084,
29961,
29900,
29962,
363,
4475,
29918,
2084,
297,
4475,
29918,
24772,
2314,
13,
18884,
628,
19525,
272,
29918,
24772,
29961,
8391,
29918,
9812,
342,
29918,
4564,
342,
272,
29962,
13,
18884,
565,
16256,
29918,
2084,
29901,
13,
462,
1678,
565,
599,
29898,
1958,
29898,
2892,
921,
29901,
921,
29961,
29900,
29962,
1275,
16256,
29918,
2084,
29961,
29900,
1402,
4475,
29918,
24772,
22164,
13,
462,
4706,
4629,
29918,
9812,
342,
29918,
4564,
342,
272,
353,
16256,
29918,
2084,
29961,
29900,
29962,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
474,
353,
448,
29896,
13,
462,
4706,
1550,
7431,
29898,
21962,
29918,
2084,
29897,
1405,
29871,
29896,
29901,
13,
462,
9651,
474,
22361,
29871,
29896,
13,
462,
9651,
16256,
29918,
9812,
342,
29918,
4564,
342,
272,
353,
16256,
29918,
2084,
29889,
7323,
580,
13,
462,
9651,
565,
451,
599,
29898,
1958,
29898,
2892,
921,
29901,
7431,
29898,
29916,
29897,
6736,
448,
474,
29892,
4475,
29918,
24772,
22164,
13,
462,
18884,
2867,
13,
462,
9651,
565,
599,
29898,
1958,
29898,
2892,
921,
29901,
921,
29961,
29875,
29962,
1275,
16256,
29918,
9812,
342,
29918,
4564,
342,
272,
29892,
4475,
29918,
24772,
22164,
13,
462,
18884,
4629,
29918,
9812,
342,
29918,
4564,
342,
272,
353,
16256,
29918,
9812,
342,
29918,
4564,
342,
272,
13,
462,
18884,
565,
4629,
29918,
9812,
342,
29918,
4564,
342,
272,
297,
19525,
272,
29918,
24772,
29901,
13,
462,
462,
1678,
628,
19525,
272,
29918,
24772,
29961,
8391,
29918,
9812,
342,
29918,
4564,
342,
272,
29962,
13,
462,
18884,
363,
2224,
297,
4475,
29918,
24772,
29901,
13,
462,
462,
1678,
1840,
29918,
24772,
29961,
2084,
29961,
29900,
29962,
1822,
2218,
7543,
29898,
2084,
29897,
13,
18884,
2186,
29918,
357,
1516,
29918,
842,
29961,
8391,
29918,
9812,
342,
29918,
4564,
342,
272,
29962,
353,
10664,
29918,
18010,
29918,
842,
13,
18884,
363,
2224,
297,
4475,
29918,
24772,
29901,
13,
462,
1678,
1840,
29918,
24772,
29961,
2084,
29961,
29900,
29962,
1822,
2218,
7543,
29898,
2084,
29897,
13,
18884,
565,
7431,
29898,
8489,
29918,
24772,
29961,
3177,
29918,
333,
2314,
1405,
29871,
29900,
29901,
13,
462,
1678,
1840,
29918,
24772,
29918,
8552,
353,
1840,
29918,
24772,
29961,
3177,
29918,
333,
1822,
8552,
580,
13,
18884,
1683,
29901,
13,
462,
1678,
2867,
13,
4706,
565,
7431,
29898,
1761,
29898,
8394,
29918,
357,
1516,
29918,
842,
29889,
8149,
22130,
5277,
4236,
29918,
1949,
29918,
18010,
29901,
13,
9651,
1773,
293,
957,
29918,
18010,
353,
426,
1311,
29889,
609,
3002,
29889,
1643,
29898,
8489,
29918,
333,
29892,
1178,
29918,
361,
29918,
4304,
29922,
5574,
29897,
363,
1840,
29918,
333,
29892,
10664,
29918,
357,
1516,
13,
462,
18884,
297,
2186,
29918,
357,
1516,
29918,
842,
29889,
7076,
580,
565,
7431,
29898,
11911,
287,
29918,
357,
1516,
29897,
1405,
29871,
29896,
29913,
13,
9651,
736,
1605,
25217,
3591,
29898,
8394,
29918,
357,
1516,
29922,
1761,
29898,
8394,
29918,
357,
1516,
29918,
842,
29889,
8149,
25739,
17151,
4056,
29918,
932,
2957,
29922,
5574,
29892,
13,
462,
462,
29871,
7687,
29918,
11911,
482,
29922,
8824,
29892,
13,
462,
462,
29871,
10664,
29918,
18010,
29922,
842,
4197,
11911,
287,
29918,
3177,
363,
10664,
29918,
842,
297,
2186,
29918,
357,
1516,
29918,
842,
29889,
5975,
580,
363,
13,
462,
462,
462,
268,
10664,
29918,
3177,
297,
10664,
29918,
842,
11724,
13,
462,
462,
29871,
1773,
293,
957,
292,
29918,
18010,
29922,
4713,
293,
957,
29918,
18010,
29897,
13,
4706,
1683,
29901,
13,
9651,
1900,
29918,
357,
1516,
353,
1284,
29918,
842,
29918,
11911,
292,
29898,
13,
18884,
518,
18877,
2744,
29883,
342,
272,
29898,
29895,
29892,
1583,
29889,
609,
3002,
29889,
1643,
29898,
29895,
29892,
1178,
29918,
361,
29918,
4304,
29922,
5574,
511,
325,
29897,
363,
413,
29892,
325,
297,
2186,
29918,
357,
1516,
29918,
842,
29889,
7076,
580,
1402,
13,
18884,
4236,
29918,
1949,
29918,
6484,
29879,
29922,
3317,
29918,
1949,
29918,
18010,
29897,
13,
9651,
736,
1583,
29889,
657,
29918,
15450,
4056,
29918,
2914,
29918,
3166,
29918,
842,
29918,
11911,
292,
29898,
11228,
29918,
3177,
29918,
4841,
29922,
3177,
29918,
4841,
29892,
731,
29918,
11911,
292,
29918,
690,
29922,
13318,
29918,
357,
1516,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
497,
29918,
24772,
29918,
517,
29918,
4632,
29898,
3177,
29918,
333,
29901,
851,
29892,
4625,
3002,
29901,
18265,
3002,
29892,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29901,
938,
353,
29871,
29900,
29892,
13,
462,
795,
5302,
29901,
2391,
29961,
710,
29962,
353,
6213,
29892,
2943,
4841,
29918,
8517,
1761,
29901,
2391,
29961,
710,
29962,
353,
6213,
29892,
13,
462,
795,
3517,
29918,
2084,
29901,
7761,
29961,
8516,
29892,
2391,
29961,
710,
5262,
353,
6213,
29892,
3876,
29918,
3177,
29922,
8516,
29897,
1599,
3789,
29961,
23215,
552,
29961,
710,
5262,
29901,
13,
4706,
9995,
657,
599,
1950,
10898,
16791,
263,
748,
1840,
304,
967,
3876,
4958,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
2943,
29918,
333,
313,
710,
1125,
263,
2854,
21947,
1178,
363,
278,
6257,
1840,
13,
9651,
4625,
3002,
313,
29949,
593,
3002,
1125,
278,
748,
4625,
3002,
13,
9651,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
313,
524,
1125,
736,
871,
4958,
472,
263,
6790,
9212,
5418,
515,
3876,
4958,
13,
9651,
5302,
313,
1293,
29961,
710,
29962,
1125,
278,
1051,
310,
5302,
304,
367,
1304,
13,
9651,
2943,
4841,
29918,
8517,
1761,
313,
1293,
29961,
710,
29962,
1125,
263,
1051,
310,
2943,
18999,
304,
19060,
515,
278,
10898,
13,
9651,
3517,
29918,
2084,
313,
19986,
29961,
8516,
29892,
2391,
29961,
710,
5262,
1125,
278,
2224,
304,
679,
304,
278,
1857,
2943,
13,
4706,
16969,
29901,
13,
9651,
3789,
29961,
23215,
552,
29961,
710,
5262,
29901,
278,
731,
310,
10898,
16791,
278,
6790,
1840,
304,
967,
3876,
4958,
29892,
1269,
310,
607,
3743,
263,
13,
9651,
5665,
310,
4958,
18999,
13,
4706,
9995,
13,
4706,
565,
3517,
29918,
2084,
338,
6213,
29901,
13,
9651,
3517,
29918,
2084,
353,
5159,
13,
4706,
716,
29918,
2084,
353,
3517,
29918,
2084,
7503,
29962,
13,
4706,
565,
451,
2943,
4841,
29918,
8517,
1761,
470,
2943,
29918,
333,
451,
297,
2943,
4841,
29918,
8517,
1761,
29901,
13,
9651,
716,
29918,
2084,
29889,
4397,
29898,
3177,
29918,
333,
29897,
13,
4706,
11825,
353,
518,
3560,
363,
3847,
297,
4625,
3002,
29889,
862,
1237,
29898,
3177,
29922,
3177,
29918,
333,
29892,
5302,
29922,
2674,
800,
29897,
565,
13,
462,
259,
4625,
3002,
29889,
3177,
29898,
3560,
29897,
3366,
19488,
3108,
6736,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29962,
13,
4706,
11825,
29918,
17642,
29918,
4632,
353,
5159,
13,
4706,
565,
3876,
29918,
3177,
29901,
13,
9651,
363,
3847,
297,
11825,
29901,
13,
18884,
3847,
29918,
3177,
353,
4625,
3002,
29889,
3177,
29898,
3560,
29897,
13,
18884,
3847,
29918,
4632,
353,
6213,
13,
18884,
565,
376,
7299,
29908,
297,
3847,
29918,
3177,
322,
376,
16121,
4854,
9065,
29908,
297,
3847,
29918,
3177,
3366,
7299,
3108,
29901,
13,
462,
1678,
363,
6996,
29918,
7728,
29918,
791,
297,
3847,
29918,
3177,
3366,
7299,
3108,
3366,
16121,
4854,
9065,
3108,
29901,
13,
462,
4706,
565,
6996,
29918,
7728,
29918,
791,
3366,
11965,
3108,
1275,
376,
29949,
5971,
29901,
5349,
14824,
1164,
1280,
3535,
1115,
13,
462,
9651,
3847,
29918,
4632,
353,
6996,
29918,
7728,
29918,
791,
3366,
791,
3108,
13,
18884,
565,
3847,
29918,
4632,
322,
3847,
29918,
4632,
1275,
3876,
29918,
3177,
29901,
13,
462,
1678,
11825,
29918,
17642,
29918,
4632,
29889,
4397,
29898,
3560,
29897,
13,
9651,
11825,
353,
11825,
29918,
17642,
29918,
4632,
13,
13,
4706,
565,
7431,
29898,
862,
1237,
29897,
1405,
29871,
29900,
29901,
13,
9651,
396,
748,
701,
278,
5447,
29892,
1494,
263,
10809,
937,
6493,
13,
9651,
10898,
29918,
517,
29918,
2457,
353,
731,
580,
13,
9651,
363,
3847,
297,
11825,
29901,
13,
18884,
363,
2224,
297,
1605,
25217,
22461,
4540,
13695,
573,
29889,
657,
29918,
497,
29918,
24772,
29918,
517,
29918,
4632,
29898,
3177,
29918,
333,
29922,
3560,
29892,
4625,
3002,
29922,
609,
3002,
29892,
13,
462,
462,
462,
462,
308,
3517,
29918,
2084,
29922,
1482,
29918,
2084,
29892,
13,
462,
462,
462,
462,
308,
1375,
29918,
19244,
29918,
3166,
29918,
4632,
29922,
1195,
29918,
19244,
29918,
3166,
29918,
4632,
29892,
13,
462,
462,
462,
462,
308,
5302,
29922,
2674,
800,
29892,
13,
462,
462,
462,
462,
308,
2943,
4841,
29918,
8517,
1761,
29922,
3177,
4841,
29918,
8517,
1761,
29892,
13,
462,
462,
462,
462,
308,
3876,
29918,
3177,
29922,
4632,
29918,
3177,
1125,
13,
462,
1678,
10898,
29918,
517,
29918,
2457,
29889,
1202,
29898,
2084,
29897,
13,
9651,
736,
10898,
29918,
517,
29918,
2457,
13,
4706,
565,
7431,
29898,
1482,
29918,
2084,
29897,
1275,
29871,
29900,
29901,
13,
9651,
736,
426,
29898,
3177,
29918,
333,
29892,
2915,
13,
4706,
1683,
29901,
13,
9651,
736,
426,
23583,
29898,
1482,
29918,
2084,
2915,
13,
13,
13,
6007,
29943,
29918,
4986,
29918,
29911,
3960,
7428,
4214,
29918,
13875,
1799,
353,
426,
13,
1678,
376,
29880,
1113,
1115,
1605,
25217,
22461,
4540,
29931,
5454,
29892,
13,
1678,
376,
293,
1115,
1605,
25217,
22461,
4540,
2965,
29892,
13,
1678,
376,
1056,
573,
1115,
1605,
25217,
22461,
4540,
13695,
573,
29892,
13,
1678,
376,
293,
17080,
1115,
1605,
25217,
22461,
4540,
2965,
29913,
13,
2
] |
zinnia/tests/test_feeds.py | julienc91/django-blog-zinnia | 10 | 1608931 | <filename>zinnia/tests/test_feeds.py
# coding=utf-8
"""Test cases for Zinnia's feeds"""
from urllib.parse import urljoin
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import timezone
from django.utils.encoding import smart_text
from django.utils.feedgenerator import Atom1Feed
from django.utils.feedgenerator import DefaultFeed
from django.utils.translation import activate
from django.utils.translation import deactivate
import django_comments as comments
from tagging.models import Tag
from zinnia.feeds import AuthorEntries
from zinnia.feeds import CategoryEntries
from zinnia.feeds import EntryComments
from zinnia.feeds import EntryDiscussions
from zinnia.feeds import EntryFeed
from zinnia.feeds import EntryPingbacks
from zinnia.feeds import EntryTrackbacks
from zinnia.feeds import LastDiscussions
from zinnia.feeds import LastEntries
from zinnia.feeds import SearchEntries
from zinnia.feeds import TagEntries
from zinnia.feeds import ZinniaFeed
from zinnia.flags import PINGBACK, TRACKBACK
from zinnia.managers import HIDDEN
from zinnia.managers import PUBLISHED
from zinnia.models.author import Author
from zinnia.models.category import Category
from zinnia.models.entry import Entry
from zinnia.signals import disconnect_discussion_signals
from zinnia.signals import disconnect_entry_signals
from zinnia.tests.utils import datetime
from zinnia.tests.utils import skip_if_custom_user
from zinnia.tests.utils import url_equal
@skip_if_custom_user
@override_settings(
ROOT_URLCONF='zinnia.tests.implementations.urls.default'
)
class FeedsTestCase(TestCase):
"""Test cases for the Feed classes provided"""
def setUp(self):
disconnect_entry_signals()
disconnect_discussion_signals()
activate('en')
self.site = Site.objects.get_current()
self.author = Author.objects.create(username='admin',
first_name='Root',
last_name='Bloody',
email='<EMAIL>')
self.category = Category.objects.create(title='Tests', slug='tests')
self.entry_ct_id = ContentType.objects.get_for_model(Entry).pk
def tearDown(self):
deactivate()
def create_published_entry(self):
params = {'title': 'My test entry',
'content': 'My test content with image '
'<img src="/image.jpg" />',
'slug': 'my-test-entry',
'tags': 'tests',
'publication_date': datetime(2010, 1, 1, 12),
'status': PUBLISHED}
entry = Entry.objects.create(**params)
entry.sites.add(self.site)
entry.categories.add(self.category)
entry.authors.add(self.author)
return entry
def create_discussions(self, entry):
comment = comments.get_model().objects.create(
comment='My Comment',
user=self.author,
user_name='admin',
content_object=entry,
site=self.site,
submit_date=timezone.now())
pingback = comments.get_model().objects.create(
comment='My Pingback',
user=self.author,
content_object=entry,
site=self.site,
submit_date=timezone.now())
pingback.flags.create(user=self.author, flag=PINGBACK)
trackback = comments.get_model().objects.create(
comment='My Trackback',
user=self.author,
content_object=entry,
site=self.site,
submit_date=timezone.now())
trackback.flags.create(user=self.author, flag=TRACKBACK)
return [comment, pingback, trackback]
def test_entry_feed(self):
entry = self.create_published_entry()
feed = EntryFeed()
self.assertEqual(feed.item_pubdate(entry), entry.publication_date)
self.assertEqual(feed.item_updateddate(entry), entry.last_update)
self.assertEqual(feed.item_categories(entry), [self.category.title])
self.assertEqual(feed.item_author_name(entry),
self.author.__str__())
self.assertEqual(feed.item_author_email(entry), self.author.email)
self.assertEqual(
feed.item_author_link(entry),
'http://example.com/authors/%s/' % self.author.username)
# Test a NoReverseMatch for item_author_link
self.author.username = '[]'
self.author.save()
feed.item_author_name(entry)
self.assertEqual(feed.item_author_link(entry), 'http://example.com')
def test_entry_feed_enclosure(self):
entry = self.create_published_entry()
feed = EntryFeed()
self.assertEqual(
feed.item_enclosure_url(entry), 'http://example.com/image.jpg')
self.assertEqual(feed.item_enclosure_length(entry), '100000')
self.assertEqual(feed.item_enclosure_mime_type(entry), 'image/jpeg')
entry.content = 'My test content with image <img src="image.jpg" />'
entry.save()
self.assertEqual(
feed.item_enclosure_url(entry), 'http://example.com/image.jpg')
self.assertEqual(feed.item_enclosure_length(entry), '100000')
self.assertEqual(feed.item_enclosure_mime_type(entry), 'image/jpeg')
entry.content = 'My test content with image ' \
'<img src="http://test.com/image.jpg" />'
entry.save()
self.assertEqual(
feed.item_enclosure_url(entry), 'http://test.com/image.jpg')
self.assertEqual(feed.item_enclosure_length(entry), '100000')
self.assertEqual(feed.item_enclosure_mime_type(entry), 'image/jpeg')
path = default_storage.save('enclosure.png', ContentFile('Content'))
entry.image = path
entry.save()
self.assertEqual(feed.item_enclosure_url(entry),
urljoin('http://example.com', entry.image.url))
self.assertEqual(feed.item_enclosure_length(entry), '7')
self.assertEqual(feed.item_enclosure_mime_type(entry), 'image/png')
default_storage.delete(path)
entry.image = 'invalid_image_without_extension'
entry.save()
self.assertEqual(feed.item_enclosure_url(entry),
urljoin('http://example.com', entry.image.url))
self.assertEqual(feed.item_enclosure_length(entry), '100000')
self.assertEqual(feed.item_enclosure_mime_type(entry), 'image/jpeg')
def test_entry_feed_enclosure_replace_https_in_rss(self):
entry = self.create_published_entry()
feed = EntryFeed()
entry.content = 'My test content with image in https ' \
'<img src="https://test.com/image.jpg" />'
entry.save()
self.assertEqual(
feed.item_enclosure_url(entry), 'http://test.com/image.jpg')
feed.protocol = 'https'
entry.content = 'My test content with image <img src="image.jpg" />'
entry.save()
self.assertEqual(
feed.item_enclosure_url(entry), 'http://example.com/image.jpg')
path = default_storage.save('enclosure.png', ContentFile('Content'))
entry.image = path
entry.save()
self.assertEqual(feed.item_enclosure_url(entry),
urljoin('http://example.com', entry.image.url))
original_feed_format = LastEntries.feed_format
LastEntries.feed_format = 'atom'
feed = LastEntries()
feed.protocol = 'https'
self.assertEqual(feed.item_enclosure_url(entry),
urljoin('https://example.com', entry.image.url))
LastEntries.feed_format = original_feed_format
default_storage.delete(path)
def test_entry_feed_enclosure_without_image(self):
entry = self.create_published_entry()
feed = EntryFeed()
entry.content = 'My test content without image '
entry.save()
self.assertEqual(
feed.item_enclosure_url(entry), None)
def test_entry_feed_enclosure_issue_134(self):
entry = self.create_published_entry()
feed = EntryFeed()
entry.content = 'My test content with image <img xsrc="image.jpg" />'
entry.save()
self.assertEqual(
feed.item_enclosure_url(entry), None)
def test_last_entries(self):
self.create_published_entry()
feed = LastEntries()
self.assertEqual(feed.link(), '/')
self.assertEqual(len(feed.items()), 1)
self.assertEqual(feed.get_title(None), 'Last entries')
self.assertEqual(
feed.description(),
'The last entries on the site example.com')
def test_category_entries(self):
self.create_published_entry()
feed = CategoryEntries()
self.assertEqual(feed.get_object('request', '/tests/'), self.category)
self.assertEqual(len(feed.items(self.category)), 1)
self.assertEqual(feed.link(self.category), '/categories/tests/')
self.assertEqual(
feed.get_title(self.category),
'Entries for the category %s' % self.category.title)
self.assertEqual(
feed.description(self.category),
'The last entries categorized under %s' % self.category.title)
self.category.description = 'Category description'
self.assertEqual(feed.description(self.category),
'Category description')
def test_category_title_non_ascii(self):
self.create_published_entry()
self.category.title = smart_text('Catégorie')
self.category.save()
feed = CategoryEntries()
self.assertEqual(feed.get_title(self.category),
'Entries for the category %s' % self.category.title)
self.assertEqual(
feed.description(self.category),
'The last entries categorized under %s' % self.category.title)
def test_author_entries(self):
self.create_published_entry()
feed = AuthorEntries()
self.assertEqual(feed.get_object('request', 'admin'), self.author)
self.assertEqual(len(feed.items(self.author)), 1)
self.assertEqual(feed.link(self.author), '/authors/admin/')
self.assertEqual(feed.get_title(self.author),
'Entries for the author %s' %
self.author.__str__())
self.assertEqual(feed.description(self.author),
'The last entries by %s' %
self.author.__str__())
def test_author_title_non_ascii(self):
self.author.first_name = smart_text('Léon')
self.author.last_name = 'Bloom'
self.author.save()
self.create_published_entry()
feed = AuthorEntries()
self.assertEqual(feed.get_title(self.author),
smart_text('Entries for the author %s' %
self.author.__str__()))
self.assertEqual(feed.description(self.author),
smart_text('The last entries by %s' %
self.author.__str__()))
def test_tag_entries(self):
self.create_published_entry()
feed = TagEntries()
tag = Tag(name='tests')
self.assertEqual(feed.get_object('request', 'tests').name, 'tests')
self.assertEqual(len(feed.items('tests')), 1)
self.assertEqual(feed.link(tag), '/tags/tests/')
self.assertEqual(feed.get_title(tag),
'Entries for the tag %s' % tag.name)
self.assertEqual(feed.description(tag),
'The last entries tagged with %s' % tag.name)
def test_tag_title_non_ascii(self):
entry = self.create_published_entry()
tag_unicode = smart_text('accentué')
entry.tags = tag_unicode
entry.save()
feed = TagEntries()
tag = Tag(name=tag_unicode)
self.assertEqual(feed.get_title(tag),
'Entries for the tag %s' % tag_unicode)
self.assertEqual(feed.description(tag),
'The last entries tagged with %s' % tag_unicode)
def test_search_entries(self):
class FakeRequest:
def __init__(self, val):
self.GET = {'pattern': val}
self.create_published_entry()
feed = SearchEntries()
self.assertRaises(ObjectDoesNotExist,
feed.get_object, FakeRequest('te'))
self.assertEqual(feed.get_object(FakeRequest('test')), 'test')
self.assertEqual(len(feed.items('test')), 1)
self.assertEqual(feed.link('test'), '/search/?pattern=test')
self.assertEqual(feed.get_title('test'),
"Search results for '%s'" % 'test')
self.assertEqual(
feed.description('test'),
"The last entries containing the pattern '%s'" % 'test')
def test_last_discussions(self):
entry = self.create_published_entry()
self.create_discussions(entry)
feed = LastDiscussions()
self.assertEqual(feed.link(), '/')
self.assertEqual(len(feed.items()), 3)
self.assertEqual(feed.get_title(None), 'Last discussions')
self.assertEqual(
feed.description(),
'The last discussions on the site example.com')
def test_entry_discussions(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryDiscussions()
self.assertEqual(feed.get_object(
'request', 2010, 1, 1, entry.slug), entry)
self.assertEqual(feed.link(entry), '/2010/01/01/my-test-entry/')
self.assertEqual(len(feed.items(entry)), 3)
self.assertEqual(feed.item_pubdate(comments[0]),
comments[0].submit_date)
self.assertEqual(feed.item_link(comments[0]),
'/comments/cr/%i/%i/#c%i' %
(self.entry_ct_id, entry.pk, comments[0].pk))
self.assertEqual(feed.item_author_name(comments[0]),
self.author.get_full_name())
self.assertEqual(feed.item_author_email(comments[0]),
'<EMAIL>')
self.assertEqual(feed.item_author_link(comments[0]), '')
self.assertEqual(feed.get_title(entry),
'Discussions on %s' % entry.title)
self.assertEqual(
feed.description(entry),
'The last discussions on the entry %s' % entry.title)
def test_feed_for_hidden_entry_issue_277(self):
entry = self.create_published_entry()
entry.status = HIDDEN
entry.save()
feed = EntryDiscussions()
self.assertEqual(feed.get_object(
'request', 2010, 1, 1, entry.slug), entry)
@override_settings(USE_TZ=False)
def test_feed_discussions_no_timezone_issue_277(self):
entry = self.create_published_entry()
entry.publication_date = datetime(2014, 1, 1, 23)
entry.save()
feed = EntryDiscussions()
self.assertEqual(feed.get_object(
'request', 2014, 1, 1, entry.slug), entry)
@override_settings(USE_TZ=True, TIME_ZONE='Europe/Paris')
def test_feed_discussions_with_timezone_issue_277(self):
entry = self.create_published_entry()
entry.publication_date = datetime(2014, 1, 1, 23)
entry.save()
feed = EntryDiscussions()
self.assertEqual(feed.get_object(
'request', 2014, 1, 2, entry.slug), entry)
def test_entry_comments(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryComments()
self.assertEqual(list(feed.items(entry)), [comments[0]])
self.assertEqual(feed.item_link(comments[0]),
'/comments/cr/%i/%i/#comment-%i-by-admin' %
(self.entry_ct_id, entry.pk, comments[0].pk))
self.assertEqual(feed.get_title(entry),
'Comments on %s' % entry.title)
self.assertEqual(
feed.description(entry),
'The last comments on the entry %s' % entry.title)
self.assertTrue(url_equal(
feed.item_enclosure_url(comments[0]),
'http://www.gravatar.com/avatar/e64c7d89f26b'
'd1972efa854d13d7dd61?s=80&r=g'))
self.assertEqual(feed.item_enclosure_length(entry), '100000')
self.assertEqual(feed.item_enclosure_mime_type(entry), 'image/jpeg')
def test_entry_pingbacks(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryPingbacks()
self.assertEqual(list(feed.items(entry)), [comments[1]])
self.assertEqual(feed.item_link(comments[1]),
'/comments/cr/%i/%i/#pingback-%i' %
(self.entry_ct_id, entry.pk, comments[1].pk))
self.assertEqual(feed.get_title(entry),
'Pingbacks on %s' % entry.title)
self.assertEqual(
feed.description(entry),
'The last pingbacks on the entry %s' % entry.title)
def test_entry_trackbacks(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryTrackbacks()
self.assertEqual(list(feed.items(entry)), [comments[2]])
self.assertEqual(feed.item_link(comments[2]),
'/comments/cr/%i/%i/#trackback-%i' %
(self.entry_ct_id, entry.pk, comments[2].pk))
self.assertEqual(feed.get_title(entry),
'Trackbacks on %s' % entry.title)
self.assertEqual(
feed.description(entry),
'The last trackbacks on the entry %s' % entry.title)
def test_entry_feed_no_authors(self):
entry = self.create_published_entry()
entry.authors.clear()
feed = EntryFeed()
self.assertEqual(feed.item_author_name(entry), None)
def test_entry_feed_rss_or_atom(self):
original_feed_format = LastEntries.feed_format
LastEntries.feed_format = ''
feed = LastEntries()
self.assertEqual(feed.feed_type, DefaultFeed)
LastEntries.feed_format = 'atom'
feed = LastEntries()
self.assertEqual(feed.feed_type, Atom1Feed)
self.assertEqual(feed.subtitle, feed.description)
LastEntries.feed_format = original_feed_format
def test_title_with_sitename_implementation(self):
feed = ZinniaFeed()
self.assertRaises(NotImplementedError, feed.title)
feed = LastEntries()
self.assertEqual(feed.title(), 'example.com - Last entries')
def test_discussion_feed_with_same_slugs(self):
"""
https://github.com/Fantomas42/django-blog-zinnia/issues/104
OK, Here I will reproduce the original case: getting a discussion
type feed, with a same slug.
The correction of this case, will need some changes in the
get_object method.
"""
entry = self.create_published_entry()
feed = EntryDiscussions()
self.assertEqual(feed.get_object(
'request', 2010, 1, 1, entry.slug), entry)
params = {'title': 'My test entry, part II',
'content': 'My content ',
'slug': 'my-test-entry',
'tags': 'tests',
'publication_date': datetime(2010, 2, 1, 12),
'status': PUBLISHED}
entry_same_slug = Entry.objects.create(**params)
entry_same_slug.sites.add(self.site)
entry_same_slug.authors.add(self.author)
self.assertEqual(feed.get_object(
'request', 2010, 2, 1, entry_same_slug.slug), entry_same_slug)
| [
1,
529,
9507,
29958,
29920,
2559,
423,
29914,
21150,
29914,
1688,
29918,
1725,
5779,
29889,
2272,
13,
29937,
14137,
29922,
9420,
29899,
29947,
13,
15945,
29908,
3057,
4251,
363,
796,
2559,
423,
29915,
29879,
1238,
5779,
15945,
29908,
13,
3166,
3142,
1982,
29889,
5510,
1053,
3142,
7122,
13,
13,
3166,
9557,
29889,
21570,
29889,
3051,
8768,
29889,
9794,
1053,
10576,
1542,
13,
3166,
9557,
29889,
21570,
29889,
16315,
29889,
9794,
1053,
10781,
13,
3166,
9557,
29889,
3221,
29889,
11739,
29879,
1053,
4669,
25125,
3664,
1252,
391,
13,
3166,
9557,
29889,
3221,
29889,
5325,
29889,
3188,
1053,
10576,
2283,
13,
3166,
9557,
29889,
3221,
29889,
5325,
29889,
12925,
1053,
2322,
29918,
12925,
13,
3166,
9557,
29889,
1688,
1053,
4321,
8259,
13,
3166,
9557,
29889,
1688,
29889,
13239,
1053,
5712,
29918,
11027,
13,
3166,
9557,
29889,
13239,
1053,
29431,
13,
3166,
9557,
29889,
13239,
29889,
22331,
1053,
15040,
29918,
726,
13,
3166,
9557,
29889,
13239,
29889,
18798,
27959,
1053,
2180,
290,
29896,
29737,
13,
3166,
9557,
29889,
13239,
29889,
18798,
27959,
1053,
13109,
29737,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
5039,
403,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
316,
11236,
403,
13,
13,
5215,
9557,
29918,
21032,
408,
6589,
13,
13,
3166,
4055,
3460,
29889,
9794,
1053,
10522,
13,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
13361,
5292,
2722,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
17943,
5292,
2722,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
28236,
1523,
1860,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
28236,
4205,
13571,
1080,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
28236,
29737,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
28236,
29925,
292,
1627,
29879,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
28236,
17936,
1627,
29879,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
9208,
4205,
13571,
1080,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
9208,
5292,
2722,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
11856,
5292,
2722,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
10522,
5292,
2722,
13,
3166,
503,
2559,
423,
29889,
1725,
5779,
1053,
796,
2559,
423,
29737,
13,
3166,
503,
2559,
423,
29889,
15764,
1053,
349,
4214,
29933,
11375,
29892,
10014,
11375,
29933,
11375,
13,
3166,
503,
2559,
423,
29889,
1171,
18150,
1053,
379,
1367,
29928,
1430,
13,
3166,
503,
2559,
423,
29889,
1171,
18150,
1053,
349,
7466,
29931,
3235,
29950,
3352,
13,
3166,
503,
2559,
423,
29889,
9794,
29889,
8921,
1053,
13361,
13,
3166,
503,
2559,
423,
29889,
9794,
29889,
7320,
1053,
17943,
13,
3166,
503,
2559,
423,
29889,
9794,
29889,
8269,
1053,
28236,
13,
3166,
503,
2559,
423,
29889,
4530,
1338,
1053,
766,
6915,
29918,
26404,
29918,
4530,
1338,
13,
3166,
503,
2559,
423,
29889,
4530,
1338,
1053,
766,
6915,
29918,
8269,
29918,
4530,
1338,
13,
3166,
503,
2559,
423,
29889,
21150,
29889,
13239,
1053,
12865,
13,
3166,
503,
2559,
423,
29889,
21150,
29889,
13239,
1053,
14383,
29918,
361,
29918,
6341,
29918,
1792,
13,
3166,
503,
2559,
423,
29889,
21150,
29889,
13239,
1053,
3142,
29918,
11745,
13,
13,
13,
29992,
11014,
29918,
361,
29918,
6341,
29918,
1792,
13,
29992,
15752,
29918,
11027,
29898,
13,
1678,
16641,
2891,
29918,
4219,
6007,
29943,
2433,
29920,
2559,
423,
29889,
21150,
29889,
326,
2037,
800,
29889,
26045,
29889,
4381,
29915,
13,
29897,
13,
1990,
5169,
5779,
3057,
8259,
29898,
3057,
8259,
1125,
13,
1678,
9995,
3057,
4251,
363,
278,
5169,
287,
4413,
4944,
15945,
29908,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
766,
6915,
29918,
8269,
29918,
4530,
1338,
580,
13,
4706,
766,
6915,
29918,
26404,
29918,
4530,
1338,
580,
13,
4706,
5039,
403,
877,
264,
1495,
13,
4706,
1583,
29889,
2746,
353,
10781,
29889,
12650,
29889,
657,
29918,
3784,
580,
13,
4706,
1583,
29889,
8921,
353,
13361,
29889,
12650,
29889,
3258,
29898,
6786,
2433,
6406,
742,
13,
462,
462,
9651,
937,
29918,
978,
2433,
10303,
742,
13,
462,
462,
9651,
1833,
29918,
978,
2433,
29933,
417,
1486,
742,
13,
462,
462,
9651,
4876,
2433,
29966,
26862,
6227,
29958,
1495,
13,
4706,
1583,
29889,
7320,
353,
17943,
29889,
12650,
29889,
3258,
29898,
3257,
2433,
24376,
742,
2243,
688,
2433,
21150,
1495,
13,
4706,
1583,
29889,
8269,
29918,
312,
29918,
333,
353,
10576,
1542,
29889,
12650,
29889,
657,
29918,
1454,
29918,
4299,
29898,
9634,
467,
20571,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
316,
11236,
403,
580,
13,
13,
1678,
822,
1653,
29918,
5467,
3726,
29918,
8269,
29898,
1311,
1125,
13,
4706,
8636,
353,
11117,
3257,
2396,
525,
3421,
1243,
6251,
742,
13,
462,
29871,
525,
3051,
2396,
525,
3421,
1243,
2793,
411,
1967,
525,
13,
462,
29871,
12801,
2492,
4765,
13802,
3027,
29889,
6173,
29908,
2900,
742,
13,
462,
29871,
525,
29517,
2396,
525,
1357,
29899,
1688,
29899,
8269,
742,
13,
462,
29871,
525,
11338,
2396,
525,
21150,
742,
13,
462,
29871,
525,
3597,
362,
29918,
1256,
2396,
12865,
29898,
29906,
29900,
29896,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29906,
511,
13,
462,
29871,
525,
4882,
2396,
349,
7466,
29931,
3235,
29950,
3352,
29913,
13,
4706,
6251,
353,
28236,
29889,
12650,
29889,
3258,
29898,
1068,
7529,
29897,
13,
4706,
6251,
29889,
16315,
29889,
1202,
29898,
1311,
29889,
2746,
29897,
13,
4706,
6251,
29889,
20683,
29889,
1202,
29898,
1311,
29889,
7320,
29897,
13,
4706,
6251,
29889,
5150,
943,
29889,
1202,
29898,
1311,
29889,
8921,
29897,
13,
4706,
736,
6251,
13,
13,
1678,
822,
1653,
29918,
2218,
13571,
1080,
29898,
1311,
29892,
6251,
1125,
13,
4706,
3440,
353,
6589,
29889,
657,
29918,
4299,
2141,
12650,
29889,
3258,
29898,
13,
9651,
3440,
2433,
3421,
461,
742,
13,
9651,
1404,
29922,
1311,
29889,
8921,
29892,
13,
9651,
1404,
29918,
978,
2433,
6406,
742,
13,
9651,
2793,
29918,
3318,
29922,
8269,
29892,
13,
9651,
3268,
29922,
1311,
29889,
2746,
29892,
13,
9651,
9752,
29918,
1256,
29922,
2230,
8028,
29889,
3707,
3101,
13,
4706,
24543,
1627,
353,
6589,
29889,
657,
29918,
4299,
2141,
12650,
29889,
3258,
29898,
13,
9651,
3440,
2433,
3421,
349,
292,
1627,
742,
13,
9651,
1404,
29922,
1311,
29889,
8921,
29892,
13,
9651,
2793,
29918,
3318,
29922,
8269,
29892,
13,
9651,
3268,
29922,
1311,
29889,
2746,
29892,
13,
9651,
9752,
29918,
1256,
29922,
2230,
8028,
29889,
3707,
3101,
13,
4706,
24543,
1627,
29889,
15764,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
8921,
29892,
7353,
29922,
29925,
4214,
29933,
11375,
29897,
13,
4706,
5702,
1627,
353,
6589,
29889,
657,
29918,
4299,
2141,
12650,
29889,
3258,
29898,
13,
9651,
3440,
2433,
3421,
17026,
1627,
742,
13,
9651,
1404,
29922,
1311,
29889,
8921,
29892,
13,
9651,
2793,
29918,
3318,
29922,
8269,
29892,
13,
9651,
3268,
29922,
1311,
29889,
2746,
29892,
13,
9651,
9752,
29918,
1256,
29922,
2230,
8028,
29889,
3707,
3101,
13,
4706,
5702,
1627,
29889,
15764,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
8921,
29892,
7353,
29922,
5659,
11375,
29933,
11375,
29897,
13,
4706,
736,
518,
9342,
29892,
24543,
1627,
29892,
5702,
1627,
29962,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
28236,
29737,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
5467,
1256,
29898,
8269,
511,
6251,
29889,
3597,
362,
29918,
1256,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
21402,
1256,
29898,
8269,
511,
6251,
29889,
4230,
29918,
5504,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
20683,
29898,
8269,
511,
518,
1311,
29889,
7320,
29889,
3257,
2314,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
978,
29898,
8269,
511,
13,
462,
308,
1583,
29889,
8921,
17255,
710,
1649,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
5269,
29898,
8269,
511,
1583,
29889,
8921,
29889,
5269,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
8921,
29918,
2324,
29898,
8269,
511,
13,
9651,
525,
1124,
597,
4773,
29889,
510,
29914,
5150,
943,
22584,
29879,
22208,
1273,
1583,
29889,
8921,
29889,
6786,
29897,
13,
4706,
396,
4321,
263,
1939,
1123,
3901,
9652,
363,
2944,
29918,
8921,
29918,
2324,
13,
4706,
1583,
29889,
8921,
29889,
6786,
353,
525,
2636,
29915,
13,
4706,
1583,
29889,
8921,
29889,
7620,
580,
13,
4706,
8343,
29889,
667,
29918,
8921,
29918,
978,
29898,
8269,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
2324,
29898,
8269,
511,
525,
1124,
597,
4773,
29889,
510,
1495,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29918,
264,
25071,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
28236,
29737,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
525,
1124,
597,
4773,
29889,
510,
29914,
3027,
29889,
6173,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2848,
29898,
8269,
511,
525,
29896,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
29885,
603,
29918,
1853,
29898,
8269,
511,
525,
3027,
29914,
26568,
1495,
13,
4706,
6251,
29889,
3051,
353,
525,
3421,
1243,
2793,
411,
1967,
529,
2492,
4765,
543,
3027,
29889,
6173,
29908,
2900,
29915,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
525,
1124,
597,
4773,
29889,
510,
29914,
3027,
29889,
6173,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2848,
29898,
8269,
511,
525,
29896,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
29885,
603,
29918,
1853,
29898,
8269,
511,
525,
3027,
29914,
26568,
1495,
13,
4706,
6251,
29889,
3051,
353,
525,
3421,
1243,
2793,
411,
1967,
525,
320,
13,
462,
4706,
12801,
2492,
4765,
543,
1124,
597,
1688,
29889,
510,
29914,
3027,
29889,
6173,
29908,
2900,
29915,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
525,
1124,
597,
1688,
29889,
510,
29914,
3027,
29889,
6173,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2848,
29898,
8269,
511,
525,
29896,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
29885,
603,
29918,
1853,
29898,
8269,
511,
525,
3027,
29914,
26568,
1495,
13,
4706,
2224,
353,
2322,
29918,
12925,
29889,
7620,
877,
264,
25071,
29889,
2732,
742,
10576,
2283,
877,
3916,
8785,
13,
4706,
6251,
29889,
3027,
353,
2224,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
13,
462,
308,
3142,
7122,
877,
1124,
597,
4773,
29889,
510,
742,
6251,
29889,
3027,
29889,
2271,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2848,
29898,
8269,
511,
525,
29955,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
29885,
603,
29918,
1853,
29898,
8269,
511,
525,
3027,
29914,
2732,
1495,
13,
4706,
2322,
29918,
12925,
29889,
8143,
29898,
2084,
29897,
13,
4706,
6251,
29889,
3027,
353,
525,
20965,
29918,
3027,
29918,
14037,
29918,
17588,
29915,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
13,
462,
308,
3142,
7122,
877,
1124,
597,
4773,
29889,
510,
742,
6251,
29889,
3027,
29889,
2271,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2848,
29898,
8269,
511,
525,
29896,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
29885,
603,
29918,
1853,
29898,
8269,
511,
525,
3027,
29914,
26568,
1495,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29918,
264,
25071,
29918,
6506,
29918,
991,
29918,
262,
29918,
29878,
893,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
28236,
29737,
580,
13,
4706,
6251,
29889,
3051,
353,
525,
3421,
1243,
2793,
411,
1967,
297,
2045,
525,
320,
13,
462,
4706,
12801,
2492,
4765,
543,
991,
597,
1688,
29889,
510,
29914,
3027,
29889,
6173,
29908,
2900,
29915,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
525,
1124,
597,
1688,
29889,
510,
29914,
3027,
29889,
6173,
1495,
13,
4706,
8343,
29889,
20464,
353,
525,
991,
29915,
13,
4706,
6251,
29889,
3051,
353,
525,
3421,
1243,
2793,
411,
1967,
529,
2492,
4765,
543,
3027,
29889,
6173,
29908,
2900,
29915,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
525,
1124,
597,
4773,
29889,
510,
29914,
3027,
29889,
6173,
1495,
13,
4706,
2224,
353,
2322,
29918,
12925,
29889,
7620,
877,
264,
25071,
29889,
2732,
742,
10576,
2283,
877,
3916,
8785,
13,
4706,
6251,
29889,
3027,
353,
2224,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
13,
462,
308,
3142,
7122,
877,
1124,
597,
4773,
29889,
510,
742,
6251,
29889,
3027,
29889,
2271,
876,
13,
4706,
2441,
29918,
18798,
29918,
4830,
353,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
13,
4706,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
353,
525,
8678,
29915,
13,
4706,
8343,
353,
9208,
5292,
2722,
580,
13,
4706,
8343,
29889,
20464,
353,
525,
991,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
13,
462,
308,
3142,
7122,
877,
991,
597,
4773,
29889,
510,
742,
6251,
29889,
3027,
29889,
2271,
876,
13,
4706,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
353,
2441,
29918,
18798,
29918,
4830,
13,
4706,
2322,
29918,
12925,
29889,
8143,
29898,
2084,
29897,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29918,
264,
25071,
29918,
14037,
29918,
3027,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
28236,
29737,
580,
13,
4706,
6251,
29889,
3051,
353,
525,
3421,
1243,
2793,
1728,
1967,
525,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29918,
264,
25071,
29918,
15118,
29918,
29896,
29941,
29946,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
28236,
29737,
580,
13,
4706,
6251,
29889,
3051,
353,
525,
3421,
1243,
2793,
411,
1967,
529,
2492,
921,
4351,
543,
3027,
29889,
6173,
29908,
2900,
29915,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
8269,
511,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
4230,
29918,
26586,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
9208,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
3285,
8207,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
25739,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
8516,
511,
525,
8897,
9976,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
3285,
13,
9651,
525,
1576,
1833,
9976,
373,
278,
3268,
1342,
29889,
510,
1495,
13,
13,
1678,
822,
1243,
29918,
7320,
29918,
26586,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
17943,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
877,
3827,
742,
8207,
21150,
29914,
5477,
1583,
29889,
7320,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
29898,
1311,
29889,
7320,
8243,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
29898,
1311,
29889,
7320,
511,
8207,
20683,
29914,
21150,
29914,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
657,
29918,
3257,
29898,
1311,
29889,
7320,
511,
13,
9651,
525,
5292,
2722,
363,
278,
7663,
1273,
29879,
29915,
1273,
1583,
29889,
7320,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
29898,
1311,
29889,
7320,
511,
13,
9651,
525,
1576,
1833,
9976,
11608,
1891,
1090,
1273,
29879,
29915,
1273,
1583,
29889,
7320,
29889,
3257,
29897,
13,
4706,
1583,
29889,
7320,
29889,
8216,
353,
525,
10900,
6139,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
8216,
29898,
1311,
29889,
7320,
511,
13,
462,
308,
525,
10900,
6139,
1495,
13,
13,
1678,
822,
1243,
29918,
7320,
29918,
3257,
29918,
5464,
29918,
294,
18869,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
1583,
29889,
7320,
29889,
3257,
353,
15040,
29918,
726,
877,
9694,
2445,
7661,
1495,
13,
4706,
1583,
29889,
7320,
29889,
7620,
580,
13,
4706,
8343,
353,
17943,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
1311,
29889,
7320,
511,
13,
462,
308,
525,
5292,
2722,
363,
278,
7663,
1273,
29879,
29915,
1273,
1583,
29889,
7320,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
29898,
1311,
29889,
7320,
511,
13,
9651,
525,
1576,
1833,
9976,
11608,
1891,
1090,
1273,
29879,
29915,
1273,
1583,
29889,
7320,
29889,
3257,
29897,
13,
13,
1678,
822,
1243,
29918,
8921,
29918,
26586,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
13361,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
877,
3827,
742,
525,
6406,
5477,
1583,
29889,
8921,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
29898,
1311,
29889,
8921,
8243,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
29898,
1311,
29889,
8921,
511,
8207,
5150,
943,
29914,
6406,
29914,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
1311,
29889,
8921,
511,
13,
462,
308,
525,
5292,
2722,
363,
278,
4148,
1273,
29879,
29915,
1273,
13,
462,
308,
1583,
29889,
8921,
17255,
710,
1649,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
8216,
29898,
1311,
29889,
8921,
511,
13,
462,
308,
525,
1576,
1833,
9976,
491,
1273,
29879,
29915,
1273,
13,
462,
308,
1583,
29889,
8921,
17255,
710,
1649,
3101,
13,
13,
1678,
822,
1243,
29918,
8921,
29918,
3257,
29918,
5464,
29918,
294,
18869,
29898,
1311,
1125,
13,
4706,
1583,
29889,
8921,
29889,
4102,
29918,
978,
353,
15040,
29918,
726,
877,
29931,
25403,
1495,
13,
4706,
1583,
29889,
8921,
29889,
4230,
29918,
978,
353,
525,
29933,
417,
290,
29915,
13,
4706,
1583,
29889,
8921,
29889,
7620,
580,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
13361,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
1311,
29889,
8921,
511,
13,
462,
308,
15040,
29918,
726,
877,
5292,
2722,
363,
278,
4148,
1273,
29879,
29915,
1273,
13,
462,
462,
1678,
1583,
29889,
8921,
17255,
710,
1649,
22130,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
8216,
29898,
1311,
29889,
8921,
511,
13,
462,
308,
15040,
29918,
726,
877,
1576,
1833,
9976,
491,
1273,
29879,
29915,
1273,
13,
462,
462,
1678,
1583,
29889,
8921,
17255,
710,
1649,
22130,
13,
13,
1678,
822,
1243,
29918,
4039,
29918,
26586,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
10522,
5292,
2722,
580,
13,
4706,
4055,
353,
10522,
29898,
978,
2433,
21150,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
877,
3827,
742,
525,
21150,
2824,
978,
29892,
525,
21150,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
877,
21150,
1495,
511,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
29898,
4039,
511,
8207,
11338,
29914,
21150,
29914,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
4039,
511,
13,
462,
308,
525,
5292,
2722,
363,
278,
4055,
1273,
29879,
29915,
1273,
4055,
29889,
978,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
8216,
29898,
4039,
511,
13,
462,
308,
525,
1576,
1833,
9976,
4055,
3192,
411,
1273,
29879,
29915,
1273,
4055,
29889,
978,
29897,
13,
13,
1678,
822,
1243,
29918,
4039,
29918,
3257,
29918,
5464,
29918,
294,
18869,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
4055,
29918,
2523,
356,
353,
15040,
29918,
726,
877,
562,
1760,
27478,
1495,
13,
4706,
6251,
29889,
11338,
353,
4055,
29918,
2523,
356,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
8343,
353,
10522,
5292,
2722,
580,
13,
4706,
4055,
353,
10522,
29898,
978,
29922,
4039,
29918,
2523,
356,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
4039,
511,
13,
462,
308,
525,
5292,
2722,
363,
278,
4055,
1273,
29879,
29915,
1273,
4055,
29918,
2523,
356,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
8216,
29898,
4039,
511,
13,
462,
308,
525,
1576,
1833,
9976,
4055,
3192,
411,
1273,
29879,
29915,
1273,
4055,
29918,
2523,
356,
29897,
13,
13,
1678,
822,
1243,
29918,
4478,
29918,
26586,
29898,
1311,
1125,
13,
4706,
770,
383,
1296,
3089,
29901,
13,
9651,
822,
4770,
2344,
12035,
1311,
29892,
659,
1125,
13,
18884,
1583,
29889,
7194,
353,
11117,
11037,
2396,
659,
29913,
13,
4706,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
8343,
353,
11856,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
2061,
25125,
3664,
1252,
391,
29892,
13,
462,
3986,
8343,
29889,
657,
29918,
3318,
29892,
383,
1296,
3089,
877,
371,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
29943,
1296,
3089,
877,
1688,
1495,
511,
525,
1688,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
877,
1688,
1495,
511,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
877,
1688,
5477,
8207,
4478,
13401,
11037,
29922,
1688,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
877,
1688,
5477,
13,
462,
308,
376,
7974,
2582,
363,
14210,
29879,
11838,
1273,
525,
1688,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
877,
1688,
5477,
13,
9651,
376,
1576,
1833,
9976,
6943,
278,
4766,
14210,
29879,
11838,
1273,
525,
1688,
1495,
13,
13,
1678,
822,
1243,
29918,
4230,
29918,
2218,
13571,
1080,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
1583,
29889,
3258,
29918,
2218,
13571,
1080,
29898,
8269,
29897,
13,
4706,
8343,
353,
9208,
4205,
13571,
1080,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
3285,
8207,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
25739,
29871,
29941,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
8516,
511,
525,
8897,
5353,
1080,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
3285,
13,
9651,
525,
1576,
1833,
5353,
1080,
373,
278,
3268,
1342,
29889,
510,
1495,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
2218,
13571,
1080,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6589,
353,
1583,
29889,
3258,
29918,
2218,
13571,
1080,
29898,
8269,
29897,
13,
4706,
8343,
353,
28236,
4205,
13571,
1080,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
13,
9651,
525,
3827,
742,
29871,
29906,
29900,
29896,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
6251,
29889,
29517,
511,
6251,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
2324,
29898,
8269,
511,
8207,
29906,
29900,
29896,
29900,
29914,
29900,
29896,
29914,
29900,
29896,
29914,
1357,
29899,
1688,
29899,
8269,
29914,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
18798,
29889,
7076,
29898,
8269,
8243,
29871,
29941,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
5467,
1256,
29898,
21032,
29961,
29900,
11724,
13,
462,
308,
6589,
29961,
29900,
1822,
7892,
29918,
1256,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
2324,
29898,
21032,
29961,
29900,
11724,
13,
462,
308,
8207,
21032,
29914,
7283,
22584,
29875,
22584,
29875,
8484,
29883,
29995,
29875,
29915,
1273,
13,
462,
308,
313,
1311,
29889,
8269,
29918,
312,
29918,
333,
29892,
6251,
29889,
20571,
29892,
6589,
29961,
29900,
1822,
20571,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
978,
29898,
21032,
29961,
29900,
11724,
13,
462,
308,
1583,
29889,
8921,
29889,
657,
29918,
8159,
29918,
978,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
5269,
29898,
21032,
29961,
29900,
11724,
13,
462,
308,
12801,
26862,
6227,
29958,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
2324,
29898,
21032,
29961,
29900,
11724,
27255,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
8269,
511,
13,
462,
308,
525,
4205,
13571,
1080,
373,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
29898,
8269,
511,
13,
9651,
525,
1576,
1833,
5353,
1080,
373,
278,
6251,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
13,
1678,
822,
1243,
29918,
18798,
29918,
1454,
29918,
10892,
29918,
8269,
29918,
15118,
29918,
29906,
29955,
29955,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6251,
29889,
4882,
353,
379,
1367,
29928,
1430,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
8343,
353,
28236,
4205,
13571,
1080,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
13,
9651,
525,
3827,
742,
29871,
29906,
29900,
29896,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
6251,
29889,
29517,
511,
6251,
29897,
13,
13,
1678,
732,
15752,
29918,
11027,
29898,
17171,
29918,
29911,
29999,
29922,
8824,
29897,
13,
1678,
822,
1243,
29918,
18798,
29918,
2218,
13571,
1080,
29918,
1217,
29918,
2230,
8028,
29918,
15118,
29918,
29906,
29955,
29955,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6251,
29889,
3597,
362,
29918,
1256,
353,
12865,
29898,
29906,
29900,
29896,
29946,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29906,
29941,
29897,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
8343,
353,
28236,
4205,
13571,
1080,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
13,
9651,
525,
3827,
742,
29871,
29906,
29900,
29896,
29946,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
6251,
29889,
29517,
511,
6251,
29897,
13,
13,
1678,
732,
15752,
29918,
11027,
29898,
17171,
29918,
29911,
29999,
29922,
5574,
29892,
323,
8890,
29918,
29999,
12413,
2433,
15654,
29914,
2177,
275,
1495,
13,
1678,
822,
1243,
29918,
18798,
29918,
2218,
13571,
1080,
29918,
2541,
29918,
2230,
8028,
29918,
15118,
29918,
29906,
29955,
29955,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6251,
29889,
3597,
362,
29918,
1256,
353,
12865,
29898,
29906,
29900,
29896,
29946,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29906,
29941,
29897,
13,
4706,
6251,
29889,
7620,
580,
13,
4706,
8343,
353,
28236,
4205,
13571,
1080,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
13,
9651,
525,
3827,
742,
29871,
29906,
29900,
29896,
29946,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
6251,
29889,
29517,
511,
6251,
29897,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
21032,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6589,
353,
1583,
29889,
3258,
29918,
2218,
13571,
1080,
29898,
8269,
29897,
13,
4706,
8343,
353,
28236,
1523,
1860,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1761,
29898,
18798,
29889,
7076,
29898,
8269,
8243,
518,
21032,
29961,
29900,
24960,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
2324,
29898,
21032,
29961,
29900,
11724,
13,
462,
308,
8207,
21032,
29914,
7283,
22584,
29875,
22584,
29875,
8484,
9342,
19222,
29875,
29899,
1609,
29899,
6406,
29915,
1273,
13,
462,
308,
313,
1311,
29889,
8269,
29918,
312,
29918,
333,
29892,
6251,
29889,
20571,
29892,
6589,
29961,
29900,
1822,
20571,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
8269,
511,
13,
462,
308,
525,
1523,
1860,
373,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
29898,
8269,
511,
13,
9651,
525,
1576,
1833,
6589,
373,
278,
6251,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2271,
29918,
11745,
29898,
13,
9651,
8343,
29889,
667,
29918,
264,
25071,
29918,
2271,
29898,
21032,
29961,
29900,
11724,
13,
9651,
525,
1124,
597,
1636,
29889,
3874,
9046,
279,
29889,
510,
29914,
485,
14873,
29914,
29872,
29953,
29946,
29883,
29955,
29881,
29947,
29929,
29888,
29906,
29953,
29890,
29915,
13,
9651,
525,
29881,
29896,
29929,
29955,
29906,
1389,
29874,
29947,
29945,
29946,
29881,
29896,
29941,
29881,
29955,
1289,
29953,
29896,
29973,
29879,
29922,
29947,
29900,
29987,
1160,
29936,
29878,
29922,
29887,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
2848,
29898,
8269,
511,
525,
29896,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
264,
25071,
29918,
29885,
603,
29918,
1853,
29898,
8269,
511,
525,
3027,
29914,
26568,
1495,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
15702,
1627,
29879,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6589,
353,
1583,
29889,
3258,
29918,
2218,
13571,
1080,
29898,
8269,
29897,
13,
4706,
8343,
353,
28236,
29925,
292,
1627,
29879,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1761,
29898,
18798,
29889,
7076,
29898,
8269,
8243,
518,
21032,
29961,
29896,
24960,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
2324,
29898,
21032,
29961,
29896,
11724,
13,
462,
308,
8207,
21032,
29914,
7283,
22584,
29875,
22584,
29875,
8484,
15702,
1627,
19222,
29875,
29915,
1273,
13,
462,
308,
313,
1311,
29889,
8269,
29918,
312,
29918,
333,
29892,
6251,
29889,
20571,
29892,
6589,
29961,
29896,
1822,
20571,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
8269,
511,
13,
462,
308,
525,
29925,
292,
1627,
29879,
373,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
29898,
8269,
511,
13,
9651,
525,
1576,
1833,
24543,
1627,
29879,
373,
278,
6251,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
11294,
1627,
29879,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6589,
353,
1583,
29889,
3258,
29918,
2218,
13571,
1080,
29898,
8269,
29897,
13,
4706,
8343,
353,
28236,
17936,
1627,
29879,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1761,
29898,
18798,
29889,
7076,
29898,
8269,
8243,
518,
21032,
29961,
29906,
24960,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
2324,
29898,
21032,
29961,
29906,
11724,
13,
462,
308,
8207,
21032,
29914,
7283,
22584,
29875,
22584,
29875,
8484,
11294,
1627,
19222,
29875,
29915,
1273,
13,
462,
308,
313,
1311,
29889,
8269,
29918,
312,
29918,
333,
29892,
6251,
29889,
20571,
29892,
6589,
29961,
29906,
1822,
20571,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3257,
29898,
8269,
511,
13,
462,
308,
525,
17936,
1627,
29879,
373,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
8343,
29889,
8216,
29898,
8269,
511,
13,
9651,
525,
1576,
1833,
5702,
1627,
29879,
373,
278,
6251,
1273,
29879,
29915,
1273,
6251,
29889,
3257,
29897,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29918,
1217,
29918,
5150,
943,
29898,
1311,
1125,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
4706,
6251,
29889,
5150,
943,
29889,
8551,
580,
13,
4706,
8343,
353,
28236,
29737,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
667,
29918,
8921,
29918,
978,
29898,
8269,
511,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
8269,
29918,
18798,
29918,
29878,
893,
29918,
272,
29918,
8678,
29898,
1311,
1125,
13,
4706,
2441,
29918,
18798,
29918,
4830,
353,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
13,
4706,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
353,
6629,
13,
4706,
8343,
353,
9208,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
18798,
29918,
1853,
29892,
13109,
29737,
29897,
13,
4706,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
353,
525,
8678,
29915,
13,
4706,
8343,
353,
9208,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
18798,
29918,
1853,
29892,
2180,
290,
29896,
29737,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
1491,
3257,
29892,
8343,
29889,
8216,
29897,
13,
4706,
9208,
5292,
2722,
29889,
18798,
29918,
4830,
353,
2441,
29918,
18798,
29918,
4830,
13,
13,
1678,
822,
1243,
29918,
3257,
29918,
2541,
29918,
29879,
3537,
420,
29918,
21382,
29898,
1311,
1125,
13,
4706,
8343,
353,
796,
2559,
423,
29737,
580,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
3664,
1888,
2037,
287,
2392,
29892,
8343,
29889,
3257,
29897,
13,
4706,
8343,
353,
9208,
5292,
2722,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
3257,
3285,
525,
4773,
29889,
510,
448,
9208,
9976,
1495,
13,
13,
1678,
822,
1243,
29918,
26404,
29918,
18798,
29918,
2541,
29918,
17642,
29918,
2536,
16926,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
2045,
597,
3292,
29889,
510,
29914,
29943,
15762,
294,
29946,
29906,
29914,
14095,
29899,
7312,
29899,
29920,
2559,
423,
29914,
12175,
29914,
29896,
29900,
29946,
13,
13,
4706,
9280,
29892,
2266,
306,
674,
18532,
278,
2441,
1206,
29901,
2805,
263,
10679,
13,
4706,
1134,
8343,
29892,
411,
263,
1021,
2243,
688,
29889,
13,
13,
4706,
450,
26385,
310,
445,
1206,
29892,
674,
817,
777,
3620,
297,
278,
13,
4706,
679,
29918,
3318,
1158,
29889,
13,
4706,
9995,
13,
4706,
6251,
353,
1583,
29889,
3258,
29918,
5467,
3726,
29918,
8269,
580,
13,
13,
4706,
8343,
353,
28236,
4205,
13571,
1080,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
13,
9651,
525,
3827,
742,
29871,
29906,
29900,
29896,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
6251,
29889,
29517,
511,
6251,
29897,
13,
13,
4706,
8636,
353,
11117,
3257,
2396,
525,
3421,
1243,
6251,
29892,
760,
1944,
742,
13,
462,
29871,
525,
3051,
2396,
525,
3421,
2793,
13420,
13,
462,
29871,
525,
29517,
2396,
525,
1357,
29899,
1688,
29899,
8269,
742,
13,
462,
29871,
525,
11338,
2396,
525,
21150,
742,
13,
462,
29871,
525,
3597,
362,
29918,
1256,
2396,
12865,
29898,
29906,
29900,
29896,
29900,
29892,
29871,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29906,
511,
13,
462,
29871,
525,
4882,
2396,
349,
7466,
29931,
3235,
29950,
3352,
29913,
13,
4706,
6251,
29918,
17642,
29918,
29517,
353,
28236,
29889,
12650,
29889,
3258,
29898,
1068,
7529,
29897,
13,
4706,
6251,
29918,
17642,
29918,
29517,
29889,
16315,
29889,
1202,
29898,
1311,
29889,
2746,
29897,
13,
4706,
6251,
29918,
17642,
29918,
29517,
29889,
5150,
943,
29889,
1202,
29898,
1311,
29889,
8921,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
18798,
29889,
657,
29918,
3318,
29898,
13,
9651,
525,
3827,
742,
29871,
29906,
29900,
29896,
29900,
29892,
29871,
29906,
29892,
29871,
29896,
29892,
6251,
29918,
17642,
29918,
29517,
29889,
29517,
511,
6251,
29918,
17642,
29918,
29517,
29897,
13,
2
] |
PROCESSOR/MachineLearning.py | leelim81/Pair-Trading-Reinforcement-Learning | 186 | 1614246 | import random
import numpy as np
from MAIN.Basics import Processor, Space
from operator import itemgetter
class StateSpace(Processor, Space):
def __init__(self, agent):
self.agent = agent
super().__init__(agent.config['StateSpaceState'])
def process(self):
self.agent.data['NETWORK_STATE'] = self._get_network_input()
self.agent.data['ENGINE_STATE' ] = self._get_engine_input()
def _get_network_input(self):
method = self.agent.config['StateSpaceNetworkSampleType']
state = self.get_random_sample(method)
return state
def _get_engine_input(self):
method = self.agent.config['StateSpaceEngineSampleConversion']
state = self.agent.data['NETWORK_STATE']
state = self.convert(state, method)
return state
class ActionSpace(Processor, Space):
def __init__(self, agent):
self.agent = agent
super().__init__(agent.config['ActionSpaceAction'])
def process(self):
self.agent.data['NETWORK_ACTION'] = self._get_network_input()
self.agent.data['ENGINE_ACTION' ] = self._get_engine_input()
def _get_network_input(self):
method = self.agent.config['ActionSpaceNetworkSampleType']
if method == 'exploration':
self.agent.exploration.process()
action = self.agent.data['EXPLORATION_ACTION']
else:
action = self.get_random_sample(method)
return action
def _get_engine_input(self):
method = self.agent.config['ActionSpaceEngineSampleConversion']
index = self.agent.data['EXPLORATION_ACTION']
action = self.convert(index, method)
return action
class RewardEngine(Processor):
def __init__(self, agent, engine):
self.engine = engine
self.agent = agent
def process(self):
reward, record = self._get_reward()
self.agent.data['ENGINE_REWARD'] = reward
self.agent.data['ENGINE_RECORD'] = record
def _get_reward(self):
state = self.agent.data['ENGINE_STATE']
action = self.agent.data['ENGINE_ACTION']
self.engine.process(**state, **action)
return self.engine.reward, self.engine.record
class Exploration(Processor):
def __init__(self, agent):
self.agent = agent
self.method = agent.config['ExplorationMethod']
self.counter = agent.counters[agent.config['ExplorationCounter']]
self.func = self.get_func(self.method)
if self.method == 'boltzmann':
self.target_attr = getattr(self.agent, self.agent.config['ExplorationBoltzmannProbAttribute'])
def process(self):
self.agent.data['EXPLORATION_ACTION'] = self.func()
def get_func(self, method):
method = '_' + method
return getattr(self, method)
def _random(self):
n_action = self.agent.action_space.n_combination
action_idx = random.randrange(n_action)
return action_idx
def _greedy(self):
self.agent.feed_dict[self.agent.input_layer] = [self.agent.data['NETWORK_STATE']]
q_value = self.agent.session.run(self.agent.output_layer, feed_dict=self.agent.feed_dict)
q_value = q_value.reshape(-1,)
action_idx = np.argmax(q_value)
return action_idx
def _e_greedy(self):
e = self.counter.value
action_idx = self._random() if random.random() < e else self._greedy()
self.counter.step()
return action_idx
def _boltzmann(self):
self.agent.data['BOLTZMANN_TEMP'] = self.counter.value
self.agent.feed_dict[self.agent.input_layer] = [self.agent.data['NETWORK_STATE']]
self.agent.feed_dict[self.agent.temp ] = [self.agent.data['BOLTZMANN_TEMP']]
prob = self.agent.session.run(self.target_attr, feed_dict=self.agent.feed_dict)
action_idx = np.random.choice(self.agent.action_space.n_combination, p=prob)
self.counter.step()
return action_idx
class ExperienceBuffer(Processor):
def __init__(self, agent):
buffer_size = int(agent.config['ExperienceBufferBufferSize'])
self.agent = agent
self.buffer = []
self.buffer_size = buffer_size
def process(self, method):
if method == 'add':
self._add_sample(self.agent.data['SAMPLE'])
elif method == 'get':
self.agent.data['EXPERIENCE_BUFFER_SAMPLE'] = self._get_sample()
else:
raise ValueError("Error: method name should be add/get.")
def _add_sample(self, sample):
sample_length = len(sample)
buffer_length = len(self.buffer)
is_single_sample = True if sample_length == 1 else False
if is_single_sample is True:
total_length = buffer_length
elif is_single_sample is False:
total_length = buffer_length + sample_length
else:
raise ValueError("Error: Boolean value required for input is_single_sample.")
if total_length > buffer_length:
idx_start = total_length - buffer_length
self.buffer = self.buffer[idx_start:]
self.buffer.extend(sample)
else:
self.buffer.extend(sample)
def _get_sample(self):
size = int(self.agent.config['ExperienceBufferSamplingSize'])
sample = itemgetter(*np.random.randint(len(self.buffer), size=size))(self.buffer)
return sample
class Recorder(Processor):
def __init__(self, agent):
self.data_field = agent.config['RecorderDataField']
self.record_freq = agent.config['RecorderRecordFreq']
self.agent = agent
if self.data_field is not None:
self.record = {key: [] for key in self.data_field}
def process(self):
if self.data_field is not None:
if (self.agent.epoch_counter.n_step % self.record_freq) == 0:
for key in self.record.keys():
self.record[key].append(self.agent.data[key])
| [
1,
1053,
4036,
30004,
13,
5215,
12655,
408,
7442,
30004,
13,
3166,
14861,
1177,
29889,
9496,
1199,
1053,
10554,
272,
29892,
14121,
30004,
13,
3166,
5455,
1053,
2944,
657,
357,
30004,
13,
30004,
13,
30004,
13,
1990,
4306,
14936,
29898,
18689,
29892,
14121,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10823,
1125,
30004,
13,
4706,
1583,
29889,
14748,
353,
10823,
30004,
13,
4706,
2428,
2141,
1649,
2344,
12035,
14748,
29889,
2917,
1839,
2792,
14936,
2792,
2033,
8443,
13,
30004,
13,
1678,
822,
1889,
29898,
1311,
1125,
30004,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
6006,
11686,
29968,
29918,
19713,
2033,
353,
1583,
3032,
657,
29918,
11618,
29918,
2080,
26471,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
1430,
29954,
8895,
29918,
19713,
29915,
4514,
353,
1583,
3032,
657,
29918,
10599,
29918,
2080,
26471,
13,
30004,
13,
1678,
822,
903,
657,
29918,
11618,
29918,
2080,
29898,
1311,
1125,
30004,
13,
4706,
1158,
353,
1583,
29889,
14748,
29889,
2917,
1839,
2792,
14936,
13724,
17708,
1542,
2033,
30004,
13,
4706,
2106,
29871,
353,
1583,
29889,
657,
29918,
8172,
29918,
11249,
29898,
5696,
8443,
13,
4706,
736,
2106,
30004,
13,
30004,
13,
1678,
822,
903,
657,
29918,
10599,
29918,
2080,
29898,
1311,
1125,
30004,
13,
4706,
1158,
353,
1583,
29889,
14748,
29889,
2917,
1839,
2792,
14936,
12412,
17708,
1168,
3259,
2033,
30004,
13,
4706,
2106,
29871,
353,
1583,
29889,
14748,
29889,
1272,
1839,
6006,
11686,
29968,
29918,
19713,
2033,
30004,
13,
4706,
2106,
29871,
353,
1583,
29889,
13441,
29898,
3859,
29892,
1158,
8443,
13,
4706,
736,
2106,
30004,
13,
30004,
13,
30004,
13,
1990,
9123,
14936,
29898,
18689,
29892,
14121,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10823,
1125,
30004,
13,
4706,
1583,
29889,
14748,
353,
10823,
30004,
13,
4706,
2428,
2141,
1649,
2344,
12035,
14748,
29889,
2917,
1839,
4276,
14936,
4276,
2033,
8443,
13,
30004,
13,
1678,
822,
1889,
29898,
1311,
1125,
30004,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
6006,
11686,
29968,
29918,
24705,
2033,
353,
1583,
3032,
657,
29918,
11618,
29918,
2080,
26471,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
1430,
29954,
8895,
29918,
24705,
29915,
4514,
353,
1583,
3032,
657,
29918,
10599,
29918,
2080,
26471,
13,
30004,
13,
1678,
822,
903,
657,
29918,
11618,
29918,
2080,
29898,
1311,
1125,
30004,
13,
4706,
1158,
353,
1583,
29889,
14748,
29889,
2917,
1839,
4276,
14936,
13724,
17708,
1542,
2033,
30004,
13,
4706,
565,
1158,
1275,
525,
24516,
12418,
2396,
30004,
13,
9651,
1583,
29889,
14748,
29889,
24516,
12418,
29889,
5014,
26471,
13,
9651,
3158,
353,
1583,
29889,
14748,
29889,
1272,
1839,
5746,
7390,
1955,
8098,
29918,
24705,
2033,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
3158,
353,
1583,
29889,
657,
29918,
8172,
29918,
11249,
29898,
5696,
8443,
13,
4706,
736,
3158,
30004,
13,
30004,
13,
1678,
822,
903,
657,
29918,
10599,
29918,
2080,
29898,
1311,
1125,
30004,
13,
4706,
1158,
353,
1583,
29889,
14748,
29889,
2917,
1839,
4276,
14936,
12412,
17708,
1168,
3259,
2033,
30004,
13,
4706,
2380,
29871,
353,
1583,
29889,
14748,
29889,
1272,
1839,
5746,
7390,
1955,
8098,
29918,
24705,
2033,
30004,
13,
4706,
3158,
353,
1583,
29889,
13441,
29898,
2248,
29892,
1158,
8443,
13,
4706,
736,
3158,
30004,
13,
30004,
13,
30004,
13,
1990,
390,
809,
538,
12412,
29898,
18689,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10823,
29892,
6012,
1125,
30004,
13,
30004,
13,
4706,
1583,
29889,
10599,
353,
6012,
30004,
13,
4706,
1583,
29889,
14748,
29871,
353,
10823,
30004,
13,
30004,
13,
1678,
822,
1889,
29898,
1311,
1125,
30004,
13,
4706,
20751,
29892,
2407,
353,
1583,
3032,
657,
29918,
276,
1328,
26471,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
1430,
29954,
8895,
29918,
1525,
29956,
17011,
2033,
353,
20751,
30004,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
1430,
29954,
8895,
29918,
1525,
29907,
25593,
2033,
353,
2407,
30004,
13,
30004,
13,
1678,
822,
903,
657,
29918,
276,
1328,
29898,
1311,
1125,
30004,
13,
4706,
2106,
29871,
353,
1583,
29889,
14748,
29889,
1272,
1839,
1430,
29954,
8895,
29918,
19713,
2033,
30004,
13,
4706,
3158,
353,
1583,
29889,
14748,
29889,
1272,
1839,
1430,
29954,
8895,
29918,
24705,
2033,
30004,
13,
4706,
1583,
29889,
10599,
29889,
5014,
29898,
1068,
3859,
29892,
3579,
2467,
8443,
13,
4706,
736,
1583,
29889,
10599,
29889,
276,
1328,
29892,
1583,
29889,
10599,
29889,
11651,
30004,
13,
30004,
13,
30004,
13,
1990,
1222,
572,
12418,
29898,
18689,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10823,
1125,
30004,
13,
4706,
1583,
29889,
14748,
259,
353,
10823,
30004,
13,
4706,
1583,
29889,
5696,
29871,
353,
10823,
29889,
2917,
1839,
1252,
572,
12418,
4062,
2033,
30004,
13,
4706,
1583,
29889,
11808,
353,
10823,
29889,
29883,
1309,
2153,
29961,
14748,
29889,
2917,
1839,
1252,
572,
12418,
17779,
2033,
29962,
30004,
13,
4706,
1583,
29889,
9891,
1678,
353,
1583,
29889,
657,
29918,
9891,
29898,
1311,
29889,
5696,
8443,
13,
4706,
565,
1583,
29889,
5696,
1275,
525,
2095,
17559,
4403,
2396,
30004,
13,
9651,
1583,
29889,
5182,
29918,
5552,
353,
679,
5552,
29898,
1311,
29889,
14748,
29892,
1583,
29889,
14748,
29889,
2917,
1839,
1252,
572,
12418,
29933,
14339,
29920,
4403,
1184,
29890,
6708,
2033,
8443,
13,
30004,
13,
1678,
822,
1889,
29898,
1311,
1125,
30004,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
5746,
7390,
1955,
8098,
29918,
24705,
2033,
353,
1583,
29889,
9891,
26471,
13,
30004,
13,
1678,
822,
679,
29918,
9891,
29898,
1311,
29892,
1158,
1125,
30004,
13,
4706,
1158,
353,
22868,
29915,
718,
1158,
30004,
13,
4706,
736,
679,
5552,
29898,
1311,
29892,
1158,
8443,
13,
30004,
13,
1678,
822,
903,
8172,
29898,
1311,
1125,
30004,
13,
4706,
302,
29918,
2467,
353,
1583,
29889,
14748,
29889,
2467,
29918,
3493,
29889,
29876,
29918,
510,
2109,
362,
30004,
13,
4706,
3158,
29918,
13140,
353,
4036,
29889,
9502,
3881,
29898,
29876,
29918,
2467,
8443,
13,
4706,
736,
3158,
29918,
13140,
30004,
13,
30004,
13,
1678,
822,
903,
7979,
7584,
29898,
1311,
1125,
30004,
13,
4706,
1583,
29889,
14748,
29889,
18798,
29918,
8977,
29961,
1311,
29889,
14748,
29889,
2080,
29918,
13148,
29962,
353,
518,
1311,
29889,
14748,
29889,
1272,
1839,
6006,
11686,
29968,
29918,
19713,
2033,
29962,
30004,
13,
4706,
3855,
29918,
1767,
353,
1583,
29889,
14748,
29889,
7924,
29889,
3389,
29898,
1311,
29889,
14748,
29889,
4905,
29918,
13148,
29892,
8343,
29918,
8977,
29922,
1311,
29889,
14748,
29889,
18798,
29918,
8977,
8443,
13,
4706,
3855,
29918,
1767,
353,
3855,
29918,
1767,
29889,
690,
14443,
6278,
29896,
29892,
8443,
13,
4706,
3158,
29918,
13140,
353,
7442,
29889,
1191,
3317,
29898,
29939,
29918,
1767,
8443,
13,
4706,
736,
3158,
29918,
13140,
30004,
13,
30004,
13,
1678,
822,
903,
29872,
29918,
7979,
7584,
29898,
1311,
1125,
30004,
13,
4706,
321,
353,
1583,
29889,
11808,
29889,
1767,
30004,
13,
4706,
3158,
29918,
13140,
353,
1583,
3032,
8172,
580,
565,
4036,
29889,
8172,
580,
529,
321,
1683,
1583,
3032,
7979,
7584,
26471,
13,
4706,
1583,
29889,
11808,
29889,
10568,
26471,
13,
4706,
736,
3158,
29918,
13140,
30004,
13,
30004,
13,
1678,
822,
903,
2095,
17559,
4403,
29898,
1311,
1125,
30004,
13,
4706,
1583,
29889,
14748,
29889,
1272,
1839,
29933,
5607,
29911,
29999,
1529,
10262,
29918,
4330,
3580,
2033,
353,
1583,
29889,
11808,
29889,
1767,
30004,
13,
4706,
1583,
29889,
14748,
29889,
18798,
29918,
8977,
29961,
1311,
29889,
14748,
29889,
2080,
29918,
13148,
29962,
353,
518,
1311,
29889,
14748,
29889,
1272,
1839,
6006,
11686,
29968,
29918,
19713,
2033,
29962,
30004,
13,
4706,
1583,
29889,
14748,
29889,
18798,
29918,
8977,
29961,
1311,
29889,
14748,
29889,
7382,
539,
4514,
353,
518,
1311,
29889,
14748,
29889,
1272,
1839,
29933,
5607,
29911,
29999,
1529,
10262,
29918,
4330,
3580,
2033,
29962,
30004,
13,
4706,
2070,
353,
1583,
29889,
14748,
29889,
7924,
29889,
3389,
29898,
1311,
29889,
5182,
29918,
5552,
29892,
8343,
29918,
8977,
29922,
1311,
29889,
14748,
29889,
18798,
29918,
8977,
8443,
13,
4706,
3158,
29918,
13140,
353,
7442,
29889,
8172,
29889,
16957,
29898,
1311,
29889,
14748,
29889,
2467,
29918,
3493,
29889,
29876,
29918,
510,
2109,
362,
29892,
282,
29922,
22795,
8443,
13,
4706,
1583,
29889,
11808,
29889,
10568,
26471,
13,
4706,
736,
3158,
29918,
13140,
30004,
13,
30004,
13,
30004,
13,
1990,
28224,
5597,
7701,
29898,
18689,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10823,
1125,
30004,
13,
4706,
6835,
29918,
2311,
29871,
353,
938,
29898,
14748,
29889,
2917,
1839,
1252,
546,
5597,
7701,
7701,
3505,
2033,
8443,
13,
4706,
1583,
29889,
14748,
259,
353,
10823,
30004,
13,
4706,
1583,
29889,
9040,
29871,
353,
5159,
30004,
13,
4706,
1583,
29889,
9040,
29918,
2311,
353,
6835,
29918,
2311,
30004,
13,
30004,
13,
1678,
822,
1889,
29898,
1311,
29892,
1158,
1125,
30004,
13,
4706,
565,
1158,
1275,
525,
1202,
2396,
30004,
13,
9651,
1583,
3032,
1202,
29918,
11249,
29898,
1311,
29889,
14748,
29889,
1272,
1839,
8132,
3580,
1307,
2033,
8443,
13,
4706,
25342,
1158,
1275,
525,
657,
2396,
30004,
13,
9651,
1583,
29889,
14748,
29889,
1272,
1839,
5746,
13171,
29902,
1430,
4741,
29918,
7838,
28483,
29918,
8132,
3580,
1307,
2033,
353,
1583,
3032,
657,
29918,
11249,
26471,
13,
4706,
1683,
29901,
30004,
13,
9651,
12020,
7865,
2392,
703,
2392,
29901,
1158,
1024,
881,
367,
788,
29914,
657,
23157,
30004,
13,
30004,
13,
1678,
822,
903,
1202,
29918,
11249,
29898,
1311,
29892,
4559,
1125,
30004,
13,
4706,
4559,
29918,
2848,
353,
7431,
29898,
11249,
8443,
13,
4706,
6835,
29918,
2848,
353,
7431,
29898,
1311,
29889,
9040,
8443,
13,
4706,
338,
29918,
14369,
29918,
11249,
353,
5852,
565,
4559,
29918,
2848,
1275,
29871,
29896,
1683,
7700,
30004,
13,
4706,
565,
338,
29918,
14369,
29918,
11249,
338,
5852,
29901,
30004,
13,
9651,
3001,
29918,
2848,
353,
6835,
29918,
2848,
30004,
13,
4706,
25342,
338,
29918,
14369,
29918,
11249,
338,
7700,
29901,
30004,
13,
9651,
3001,
29918,
2848,
353,
6835,
29918,
2848,
718,
4559,
29918,
2848,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
12020,
7865,
2392,
703,
2392,
29901,
11185,
995,
3734,
363,
1881,
338,
29918,
14369,
29918,
11249,
23157,
30004,
13,
30004,
13,
4706,
565,
3001,
29918,
2848,
1405,
6835,
29918,
2848,
29901,
30004,
13,
9651,
22645,
29918,
2962,
353,
3001,
29918,
2848,
448,
6835,
29918,
2848,
30004,
13,
9651,
1583,
29889,
9040,
353,
1583,
29889,
9040,
29961,
13140,
29918,
2962,
17531,
30004,
13,
9651,
1583,
29889,
9040,
29889,
21843,
29898,
11249,
8443,
13,
4706,
1683,
29901,
30004,
13,
9651,
1583,
29889,
9040,
29889,
21843,
29898,
11249,
8443,
13,
30004,
13,
1678,
822,
903,
657,
29918,
11249,
29898,
1311,
1125,
30004,
13,
4706,
2159,
259,
353,
938,
29898,
1311,
29889,
14748,
29889,
2917,
1839,
1252,
546,
5597,
7701,
22966,
10335,
3505,
2033,
8443,
13,
4706,
4559,
353,
2944,
657,
357,
10456,
9302,
29889,
8172,
29889,
9502,
524,
29898,
2435,
29898,
1311,
29889,
9040,
511,
2159,
29922,
2311,
876,
29898,
1311,
29889,
9040,
8443,
13,
4706,
736,
4559,
30004,
13,
30004,
13,
30004,
13,
1990,
3599,
2098,
29898,
18689,
1125,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10823,
1125,
30004,
13,
4706,
1583,
29889,
1272,
29918,
2671,
29871,
353,
10823,
29889,
2917,
1839,
4789,
2098,
1469,
3073,
2033,
30004,
13,
4706,
1583,
29889,
11651,
29918,
29888,
7971,
353,
10823,
29889,
2917,
1839,
4789,
2098,
9182,
29943,
7971,
2033,
30004,
13,
4706,
1583,
29889,
14748,
353,
10823,
30004,
13,
4706,
565,
1583,
29889,
1272,
29918,
2671,
338,
451,
6213,
29901,
30004,
13,
9651,
1583,
29889,
11651,
353,
426,
1989,
29901,
5159,
363,
1820,
297,
1583,
29889,
1272,
29918,
2671,
8117,
13,
30004,
13,
1678,
822,
1889,
29898,
1311,
1125,
30004,
13,
4706,
565,
1583,
29889,
1272,
29918,
2671,
338,
451,
6213,
29901,
30004,
13,
9651,
565,
313,
1311,
29889,
14748,
29889,
1022,
2878,
29918,
11808,
29889,
29876,
29918,
10568,
1273,
1583,
29889,
11651,
29918,
29888,
7971,
29897,
1275,
29871,
29900,
29901,
30004,
13,
18884,
363,
1820,
297,
1583,
29889,
11651,
29889,
8149,
7295,
30004,
13,
462,
1678,
1583,
29889,
11651,
29961,
1989,
1822,
4397,
29898,
1311,
29889,
14748,
29889,
1272,
29961,
1989,
2314,
30004,
13,
2
] |
get_vocab.py | Amir-Mehrpanah/hgraph2graph | 182 | 13037 | <gh_stars>100-1000
import sys
import argparse
from hgraph import *
from rdkit import Chem
from multiprocessing import Pool
def process(data):
vocab = set()
for line in data:
s = line.strip("\r\n ")
hmol = MolGraph(s)
for node,attr in hmol.mol_tree.nodes(data=True):
smiles = attr['smiles']
vocab.add( attr['label'] )
for i,s in attr['inter_label']:
vocab.add( (smiles, s) )
return vocab
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--ncpu', type=int, default=1)
args = parser.parse_args()
data = [mol for line in sys.stdin for mol in line.split()[:2]]
data = list(set(data))
batch_size = len(data) // args.ncpu + 1
batches = [data[i : i + batch_size] for i in range(0, len(data), batch_size)]
pool = Pool(args.ncpu)
vocab_list = pool.map(process, batches)
vocab = [(x,y) for vocab in vocab_list for x,y in vocab]
vocab = list(set(vocab))
for x,y in sorted(vocab):
print(x, y)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
5215,
10876,
13,
5215,
1852,
5510,
29871,
13,
3166,
298,
4262,
1053,
334,
13,
3166,
364,
29881,
7354,
1053,
12677,
13,
3166,
6674,
307,
985,
292,
1053,
28625,
13,
13,
1753,
1889,
29898,
1272,
1125,
13,
1678,
7931,
370,
353,
731,
580,
13,
1678,
363,
1196,
297,
848,
29901,
13,
4706,
269,
353,
1196,
29889,
17010,
14182,
29878,
29905,
29876,
16521,
13,
4706,
298,
29885,
324,
353,
10750,
9527,
29898,
29879,
29897,
13,
4706,
363,
2943,
29892,
5552,
297,
298,
29885,
324,
29889,
29885,
324,
29918,
8336,
29889,
18010,
29898,
1272,
29922,
5574,
1125,
13,
9651,
1560,
5475,
353,
12421,
1839,
3844,
5475,
2033,
13,
9651,
7931,
370,
29889,
1202,
29898,
12421,
1839,
1643,
2033,
1723,
13,
9651,
363,
474,
29892,
29879,
297,
12421,
1839,
1639,
29918,
1643,
2033,
29901,
13,
18884,
7931,
370,
29889,
1202,
29898,
313,
3844,
5475,
29892,
269,
29897,
1723,
13,
1678,
736,
7931,
370,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
17608,
3746,
742,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29897,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
1678,
848,
353,
518,
29885,
324,
363,
1196,
297,
10876,
29889,
4172,
262,
363,
6062,
297,
1196,
29889,
5451,
580,
7503,
29906,
5262,
13,
1678,
848,
353,
1051,
29898,
842,
29898,
1272,
876,
13,
13,
1678,
9853,
29918,
2311,
353,
7431,
29898,
1272,
29897,
849,
6389,
29889,
17608,
3746,
718,
29871,
29896,
13,
1678,
9853,
267,
353,
518,
1272,
29961,
29875,
584,
474,
718,
9853,
29918,
2311,
29962,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
1272,
511,
9853,
29918,
2311,
4638,
13,
13,
1678,
11565,
353,
28625,
29898,
5085,
29889,
17608,
3746,
29897,
13,
1678,
7931,
370,
29918,
1761,
353,
11565,
29889,
1958,
29898,
5014,
29892,
9853,
267,
29897,
13,
1678,
7931,
370,
353,
17288,
29916,
29892,
29891,
29897,
363,
7931,
370,
297,
7931,
370,
29918,
1761,
363,
921,
29892,
29891,
297,
7931,
370,
29962,
13,
1678,
7931,
370,
353,
1051,
29898,
842,
29898,
29894,
542,
370,
876,
13,
13,
1678,
363,
921,
29892,
29891,
297,
12705,
29898,
29894,
542,
370,
1125,
13,
4706,
1596,
29898,
29916,
29892,
343,
29897,
13,
2
] |
src/thornfield/caches/cache_compression_decorator.py | drorvinkler/thornfield | 2 | 3610 | from typing import Callable, AnyStr, Optional
from zlib import compress as default_compress, decompress as default_decompress
from .cache import Cache
from ..constants import NOT_FOUND
class CacheCompressionDecorator(Cache):
def __init__(
self,
cache: Cache,
compress: Optional[Callable[[str], AnyStr]] = ...,
decompress: Optional[Callable[[AnyStr], str]] = ...,
) -> None:
super().__init__()
self._cache = cache
if compress is None:
self._compress = self._noop
elif compress is ...:
self._compress = self._default_compress
else:
self._compress = compress
if decompress is None:
self._decompress = self._noop
elif decompress is ...:
self._decompress = self._default_decompress
else:
self._decompress = decompress
def get(self, key):
value = self._cache.get(key)
return value if value is NOT_FOUND else self._decompress(value)
def set(self, key, value, expiration: int) -> None:
self._cache.set(key, self._compress(value), expiration)
@staticmethod
def _noop(x):
return x
@staticmethod
def _default_compress(obj: str) -> bytes:
return default_compress(obj.encode("UTF-8"))
@staticmethod
def _default_decompress(data: bytes) -> str:
return default_decompress(data).decode("UTF-8")
| [
1,
515,
19229,
1053,
8251,
519,
29892,
3139,
5015,
29892,
28379,
13,
3166,
503,
1982,
1053,
27122,
408,
2322,
29918,
510,
2139,
29892,
17753,
2139,
408,
2322,
29918,
311,
510,
2139,
13,
13,
3166,
869,
8173,
1053,
28540,
13,
3166,
6317,
3075,
1934,
1053,
6058,
29918,
5800,
18783,
13,
13,
13,
1990,
28540,
1523,
2590,
6185,
272,
1061,
29898,
10408,
1125,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
7090,
29901,
28540,
29892,
13,
4706,
27122,
29901,
28379,
29961,
5594,
519,
8999,
710,
1402,
3139,
5015,
5262,
353,
2023,
29892,
13,
4706,
17753,
2139,
29901,
28379,
29961,
5594,
519,
8999,
10773,
5015,
1402,
851,
5262,
353,
2023,
29892,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
3032,
8173,
353,
7090,
13,
4706,
565,
27122,
338,
6213,
29901,
13,
9651,
1583,
3032,
510,
2139,
353,
1583,
3032,
1217,
459,
13,
4706,
25342,
27122,
338,
2023,
29901,
13,
9651,
1583,
3032,
510,
2139,
353,
1583,
3032,
4381,
29918,
510,
2139,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
510,
2139,
353,
27122,
13,
13,
4706,
565,
17753,
2139,
338,
6213,
29901,
13,
9651,
1583,
3032,
311,
510,
2139,
353,
1583,
3032,
1217,
459,
13,
4706,
25342,
17753,
2139,
338,
2023,
29901,
13,
9651,
1583,
3032,
311,
510,
2139,
353,
1583,
3032,
4381,
29918,
311,
510,
2139,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
311,
510,
2139,
353,
17753,
2139,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
1820,
1125,
13,
4706,
995,
353,
1583,
3032,
8173,
29889,
657,
29898,
1989,
29897,
13,
4706,
736,
995,
565,
995,
338,
6058,
29918,
5800,
18783,
1683,
1583,
3032,
311,
510,
2139,
29898,
1767,
29897,
13,
13,
1678,
822,
731,
29898,
1311,
29892,
1820,
29892,
995,
29892,
1518,
12232,
29901,
938,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
8173,
29889,
842,
29898,
1989,
29892,
1583,
3032,
510,
2139,
29898,
1767,
511,
1518,
12232,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
1217,
459,
29898,
29916,
1125,
13,
4706,
736,
921,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
4381,
29918,
510,
2139,
29898,
5415,
29901,
851,
29897,
1599,
6262,
29901,
13,
4706,
736,
2322,
29918,
510,
2139,
29898,
5415,
29889,
12508,
703,
10496,
29899,
29947,
5783,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
903,
4381,
29918,
311,
510,
2139,
29898,
1272,
29901,
6262,
29897,
1599,
851,
29901,
13,
4706,
736,
2322,
29918,
311,
510,
2139,
29898,
1272,
467,
13808,
703,
10496,
29899,
29947,
1159,
13,
2
] |
tests/test_UniformFlow.py | RandalJBarnes/Ginebig | 0 | 167200 | <gh_stars>0
import unittest
import cmath
import numpy
from ginebig.analytic_element import AnalyticElement
from ginebig.uniform_flow import UniformFlow
class TestUniformFlow(unittest.TestCase):
"""Test the UniformFlow class."""
# --------------------------------------------------------------------------
def test_construction(self):
"""Test constructor."""
uf = UniformFlow(1, cmath.pi/4)
self.assertIsInstance(uf, AnalyticElement)
self.assertIsInstance(uf, UniformFlow)
self.assertAlmostEqual(uf.Qo, 1)
self.assertAlmostEqual(uf.alpha, cmath.pi/4)
# --------------------------------------------------------------------------
def test_complex_potential(self):
"""Test complex potential."""
uf = UniformFlow(2, cmath.pi/6)
z = complex(cmath.sqrt(3), 1)
Omega_true = complex(-4, 0)
Omega = UniformFlow.complex_potential(uf, z)
self.assertAlmostEqual(Omega, Omega_true)
z = complex(1, -1)
Omega_true = complex(-0.732050807568878, 2.73205080756888)
Omega = UniformFlow.complex_potential(uf, z)
self.assertAlmostEqual(Omega, Omega_true)
# --------------------------------------------------------------------------
def test_complex_discharge(self):
"""Test complex discharge."""
uf = UniformFlow(2, cmath.pi/6)
z = complex(cmath.sqrt(3), 1)
W_true = complex(cmath.sqrt(3), -1)
W = UniformFlow.complex_discharge(uf, z)
self.assertAlmostEqual(W, W_true)
z = complex(1, -1)
W_true = complex(cmath.sqrt(3), -1)
W = UniformFlow.complex_discharge(uf, z)
self.assertAlmostEqual(W, W_true)
# --------------------------------------------------------------------------
def test_abstraction(self):
"""Test abstraction."""
uf = UniformFlow(2, cmath.pi/6)
ab = UniformFlow.abstraction(uf)
self.assertAlmostEqual(ab, float(0))
# --------------------------------------------------------------------------
def test_divergence_discharge(self):
"""Test divergence discharge."""
uf = UniformFlow(2, cmath.pi/6)
z = complex(10, 20)
div = UniformFlow.divergence_discharge(uf, z)
self.assertAlmostEqual(div, float(0))
# --------------------------------------------------------------------------
def test_solve(self):
"""Test solve."""
# TODO: Add a test.
pass
if __name__ == '__main__':
unittest.main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
443,
27958,
13,
5215,
274,
755,
13,
5215,
12655,
13,
13,
3166,
330,
457,
3752,
29889,
7054,
3637,
293,
29918,
5029,
1053,
11597,
3637,
293,
2642,
13,
3166,
330,
457,
3752,
29889,
29590,
29918,
1731,
1053,
853,
5560,
17907,
13,
13,
13,
1990,
4321,
2525,
5560,
17907,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
3057,
278,
853,
5560,
17907,
770,
1213,
15945,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
1678,
822,
1243,
29918,
3075,
4080,
29898,
1311,
1125,
13,
4706,
9995,
3057,
5823,
1213,
15945,
13,
13,
4706,
318,
29888,
353,
853,
5560,
17907,
29898,
29896,
29892,
274,
755,
29889,
1631,
29914,
29946,
29897,
13,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
1137,
29892,
11597,
3637,
293,
2642,
29897,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
1137,
29892,
853,
5560,
17907,
29897,
13,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
1137,
29889,
29984,
29877,
29892,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
1137,
29889,
2312,
29892,
274,
755,
29889,
1631,
29914,
29946,
29897,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
1678,
822,
1243,
29918,
19676,
29918,
17765,
2556,
29898,
1311,
1125,
13,
4706,
9995,
3057,
4280,
7037,
1213,
15945,
13,
13,
4706,
318,
29888,
353,
853,
5560,
17907,
29898,
29906,
29892,
274,
755,
29889,
1631,
29914,
29953,
29897,
13,
13,
4706,
503,
353,
4280,
29898,
29883,
755,
29889,
3676,
29898,
29941,
511,
29871,
29896,
29897,
13,
4706,
13352,
2442,
29918,
3009,
353,
4280,
6278,
29946,
29892,
29871,
29900,
29897,
13,
4706,
13352,
2442,
353,
853,
5560,
17907,
29889,
19676,
29918,
17765,
2556,
29898,
1137,
29892,
503,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
5981,
29892,
13352,
2442,
29918,
3009,
29897,
13,
13,
4706,
503,
353,
4280,
29898,
29896,
29892,
448,
29896,
29897,
13,
4706,
13352,
2442,
29918,
3009,
353,
4280,
6278,
29900,
29889,
29955,
29941,
29906,
29900,
29945,
29900,
29947,
29900,
29955,
29945,
29953,
29947,
29947,
29955,
29947,
29892,
29871,
29906,
29889,
29955,
29941,
29906,
29900,
29945,
29900,
29947,
29900,
29955,
29945,
29953,
29947,
29947,
29947,
29897,
13,
4706,
13352,
2442,
353,
853,
5560,
17907,
29889,
19676,
29918,
17765,
2556,
29898,
1137,
29892,
503,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
5981,
29892,
13352,
2442,
29918,
3009,
29897,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
1678,
822,
1243,
29918,
19676,
29918,
29881,
783,
279,
479,
29898,
1311,
1125,
13,
4706,
9995,
3057,
4280,
766,
23367,
1213,
15945,
13,
13,
4706,
318,
29888,
353,
853,
5560,
17907,
29898,
29906,
29892,
274,
755,
29889,
1631,
29914,
29953,
29897,
13,
13,
4706,
503,
353,
4280,
29898,
29883,
755,
29889,
3676,
29898,
29941,
511,
29871,
29896,
29897,
13,
4706,
399,
29918,
3009,
353,
4280,
29898,
29883,
755,
29889,
3676,
29898,
29941,
511,
448,
29896,
29897,
13,
4706,
399,
353,
853,
5560,
17907,
29889,
19676,
29918,
29881,
783,
279,
479,
29898,
1137,
29892,
503,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
29956,
29892,
399,
29918,
3009,
29897,
13,
13,
4706,
503,
353,
4280,
29898,
29896,
29892,
448,
29896,
29897,
13,
4706,
399,
29918,
3009,
353,
4280,
29898,
29883,
755,
29889,
3676,
29898,
29941,
511,
448,
29896,
29897,
13,
4706,
399,
353,
853,
5560,
17907,
29889,
19676,
29918,
29881,
783,
279,
479,
29898,
1137,
29892,
503,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
29956,
29892,
399,
29918,
3009,
29897,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
1678,
822,
1243,
29918,
370,
4151,
428,
29898,
1311,
1125,
13,
4706,
9995,
3057,
27086,
428,
1213,
15945,
13,
13,
4706,
318,
29888,
353,
853,
5560,
17907,
29898,
29906,
29892,
274,
755,
29889,
1631,
29914,
29953,
29897,
13,
13,
4706,
633,
353,
853,
5560,
17907,
29889,
370,
4151,
428,
29898,
1137,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
370,
29892,
5785,
29898,
29900,
876,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
1678,
822,
1243,
29918,
29881,
2147,
10238,
29918,
29881,
783,
279,
479,
29898,
1311,
1125,
13,
4706,
9995,
3057,
17089,
10238,
766,
23367,
1213,
15945,
13,
13,
4706,
318,
29888,
353,
853,
5560,
17907,
29898,
29906,
29892,
274,
755,
29889,
1631,
29914,
29953,
29897,
13,
13,
4706,
503,
353,
4280,
29898,
29896,
29900,
29892,
29871,
29906,
29900,
29897,
13,
4706,
1933,
353,
853,
5560,
17907,
29889,
29881,
2147,
10238,
29918,
29881,
783,
279,
479,
29898,
1137,
29892,
503,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
4563,
29892,
5785,
29898,
29900,
876,
13,
13,
1678,
396,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
1678,
822,
1243,
29918,
2929,
345,
29898,
1311,
1125,
13,
4706,
9995,
3057,
4505,
1213,
15945,
13,
13,
4706,
396,
14402,
29901,
3462,
263,
1243,
29889,
13,
4706,
1209,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
krake/krake/controller/scheduler/scheduler.py | rak-n-rok/Krake | 1 | 189903 | <filename>krake/krake/controller/scheduler/scheduler.py<gh_stars>1-10
import asyncio
from datetime import timedelta
import logging
import random
from typing import NamedTuple
from functools import total_ordering
from aiohttp import ClientError
from krake import utils
from krake.data.openstack import (
Project,
MagnumClusterState,
MagnumClusterBinding,
ProjectState,
)
from krake.client.openstack import OpenStackApi
from krake.client.core import CoreApi
from krake.client.kubernetes import KubernetesApi
from krake.data.core import ReasonCode, resource_ref, Reason
from krake.data.kubernetes import (
ApplicationState,
Cluster,
ClusterBinding,
ClusterState,
)
from .constraints import match_cluster_constraints, match_project_constraints
from .metrics import MetricError, fetch_query, MetricsProviderError
from .. import Controller, ControllerError, Reflector, WorkQueue
logger = logging.getLogger(__name__)
class NoClusterFound(ControllerError):
"""Raised in case when there is not enough resources for spawning an application
on any of the deployments.
"""
code = ReasonCode.NO_SUITABLE_RESOURCE
class NoProjectFound(ControllerError):
code = ReasonCode.NO_SUITABLE_RESOURCE
@total_ordering
class RankMixin(object):
"""Mixin class for ranking objects based on their ``score`` attribute.
This mixin class is used by the :func:`order_by_score` decorator.
"""
def __lt__(self, o):
if not hasattr(o, "score"):
return NotImplemented
return self.score < o.score
def __eq__(self, o):
if not hasattr(o, "score"):
return NotImplemented
return self.score == o.score
def orderable_by_score(cls):
"""Decorator for making a class orderable based on the ``score`` attribute.
We cannot use :func:`functools.total_ordering` in
:class:`typing.NamedTuple` because tuple already implements rich
comparison operators preventing the decorator from generating the
comparators. Furthermore, mixins are also not respected by
:class:`typing.NamedTuple`.
Hence, this decorator injects :class:`RankMixin` as an additional base
class into the passed class.
Args:
cls (type): Class that should get :class:`RankMixin` as base class.
Returns:
type: Class with injected :class:`RankMixin` base class
"""
if RankMixin not in cls.__mro__:
cls.__bases__ = (RankMixin,) + cls.__bases__
return cls
@orderable_by_score
class ClusterScore(NamedTuple):
"""Named tuple for ordering Kubernetes clusters based on a score"""
score: float
cluster: Cluster
@orderable_by_score
class ProjectScore(NamedTuple):
"""Named tuple for ordering OpenStack projects based on a score"""
score: float
project: Project
class Stickiness(NamedTuple):
"""Additional metric added clusters."""
weight: float
value: float
class Scheduler(Controller):
"""The scheduler is a controller that receives all pending and updated
applications and selects the "best" backend for each one of them based
on metrics of the backends and application specifications.
Args:
worker_count (int, optional): the amount of worker function that
should be run as background tasks.
reschedule_after (float, optional): number of seconds after which a resource
should be rescheduled.
ssl_context (ssl.SSLContext, optional): SSL context that should be
used to communicate with the API server.
debounce (float, optional): number of seconds the scheduler should wait
before it reacts to a state change.
loop (asyncio.AbstractEventLoop, optional): Event loop that should be
used.
"""
def __init__(
self,
api_endpoint,
worker_count=10,
reschedule_after=60,
stickiness=0.1,
ssl_context=None,
debounce=0,
loop=None,
):
super().__init__(
api_endpoint, loop=loop, ssl_context=ssl_context, debounce=debounce
)
self.magnum_queue = WorkQueue(loop=self.loop, debounce=debounce)
self.kubernetes_api = None
self.openstack_api = None
self.core_api = None
self.kubernetes_reflector = None
self.openstack_reflector = None
self.worker_count = worker_count
self.reschedule_after = reschedule_after
self.stickiness = stickiness
async def prepare(self, client):
assert client is not None
self.client = client
self.kubernetes_api = KubernetesApi(self.client)
self.openstack_api = OpenStackApi(self.client)
self.core_api = CoreApi(self.client)
for i in range(self.worker_count):
self.register_task(
self.handle_kubernetes_applications, name=f"kubernetes_worker_{i}"
)
for i in range(self.worker_count):
self.register_task(self.handle_magnum_clusters, name=f"magnum_worker_{i}")
self.kubernetes_reflector = Reflector(
listing=self.kubernetes_api.list_all_applications,
watching=self.kubernetes_api.watch_all_applications,
on_list=self.received_kubernetes_app,
on_add=self.received_kubernetes_app,
on_update=self.received_kubernetes_app,
on_delete=self.received_kubernetes_app,
resource_plural="Kubernetes Applications",
)
self.openstack_reflector = Reflector(
listing=self.openstack_api.list_all_magnum_clusters,
watching=self.openstack_api.watch_all_magnum_clusters,
on_list=self.received_magnum_cluster,
on_add=self.received_magnum_cluster,
on_update=self.received_magnum_cluster,
on_delete=self.received_magnum_cluster,
resource_plural="Magnum Clusters",
)
self.register_task(self.kubernetes_reflector, name="Kubernetes reflector")
self.register_task(self.openstack_reflector, name="OpenStack reflector")
async def cleanup(self):
self.kubernetes_reflector = None
self.openstack_reflector = None
self.kubernetes_api = None
self.core_api = None
async def received_kubernetes_app(self, app):
"""Handler for Kubernetes application reflector.
Args:
app (krake.data.kubernetes.Application): Application received from the API
"""
if app.metadata.deleted:
# TODO: If an application is deleted, the scheduling of other
# applications should potentially be revised.
logger.debug("Cancel rescheduling of deleted %r", app)
await self.queue.cancel(app.metadata.uid)
# The application is already scheduled and no change has been made to the specs
# since then. Nevertheless, we should perform a periodic rescheduling to handle
# changes in the cluster metric values.
elif (
app.status.kube_controller_triggered
and app.metadata.modified <= app.status.kube_controller_triggered
):
await self.reschedule_kubernetes_application(app)
elif app.status.state == ApplicationState.FAILED:
logger.debug("Reject failed %r", app)
else:
logger.debug("Accept %r", app)
await self.queue.put(app.metadata.uid, app)
async def received_magnum_cluster(self, cluster):
"""Handler for Kubernetes application reflector.
Args:
cluster (krake.data.openstack.MagnumCluster): MagnumCLuster received from
the API.
"""
# For now, we do not reschedule Magnum clusters. Hence, not enqueuing
# for rescheduling and not "scheduled" timestamp.
if cluster.metadata.deleted:
logger.debug("Ignore deleted %r", cluster)
elif cluster.status.project is None:
logger.debug("Accept unbound %r", cluster)
await self.magnum_queue.put(cluster.metadata.uid, cluster)
else:
logger.debug("Ignore bound %r", cluster)
async def handle_kubernetes_applications(self, run_once=False):
"""Infinite loop which fetches and hands over the Kubernetes Application
resources to the right coroutine. The specific exceptions and error handling
have to be added here.
This function is meant to be run as background task. Lock the handling of a
resource with the :attr:`lock` attribute.
Args:
run_once (bool, optional): if True, the function only handles one resource,
then stops. Otherwise, continue to handle each new resource on the
queue indefinitely.
"""
while True:
key, app = await self.queue.get()
try:
# TODO: API for supporting different application types
logger.debug("Handling %r", app)
await self.kubernetes_application_received(app)
except ControllerError as error:
app.status.reason = Reason(code=error.code, message=error.message)
app.status.state = ApplicationState.FAILED
await self.kubernetes_api.update_application_status(
namespace=app.metadata.namespace, name=app.metadata.name, body=app
)
finally:
await self.queue.done(key)
if run_once:
break # TODO: should we keep this? Only useful for tests
async def handle_magnum_clusters(self, run_once=False):
"""Infinite loop which fetches and hands over the MagnumCluster resources to the
right coroutine. The specific exceptions and error handling have to be added
here.
This function is meant to be run as background task. Lock the handling of a
resource with the :attr:`lock` attribute.
Args:
run_once (bool, optional): if True, the function only handles one resource,
then stops. Otherwise, continue to handle each new resource on the
queue indefinitely.
"""
while True:
key, cluster = await self.magnum_queue.get()
try:
# TODO: API for supporting different application types
logger.debug("Handling %r", cluster)
await self.schedule_magnum_cluster(cluster)
except ControllerError as error:
cluster.status.reason = Reason(code=error.code, message=error.message)
cluster.status.state = MagnumClusterState.FAILED
await self.openstack_api.update_magnum_cluster_status(
namespace=cluster.metadata.namespace,
name=cluster.metadata.name,
body=cluster,
)
finally:
await self.magnum_queue.done(key)
if run_once:
break
async def kubernetes_application_received(self, app):
"""Process a Kubernetes Application: schedule the Application on a Kubernetes
cluster and initiate its rescheduling.
Args:
app (krake.data.kubernetes.Application): the Application to process.
"""
# TODO: Evaluate spawning a new cluster
await self.schedule_kubernetes_application(app)
await self.reschedule_kubernetes_application(app)
async def schedule_kubernetes_application(self, app):
"""Choose a suitable Kubernetes cluster for the given Application and bound them
together.
Args:
app (krake.data.kubernetes.Application): the Application that needs to be
scheduled to a Cluster.
"""
logger.info("Schedule %r", app)
if app.status.scheduled_to and not app.spec.constraints.migration:
logger.debug(
"Not migrating %r, since migration of the application is disabled.", app
)
return
clusters = await self.kubernetes_api.list_all_clusters()
cluster = await self.select_kubernetes_cluster(app, clusters.items)
scheduled_to = resource_ref(cluster)
# Check if the scheduling decision changed
if app.status.scheduled_to == scheduled_to:
logger.debug("No change for %r", app)
# The timestamp is updated anyway because the KubernetesController is
# waiting for the Scheduler to take a decision before handling the update on
# an Application. By updating this, the KubernetesController can start
# working on the current Application.
# However, if no update has been performed on the Application, then the
# modified timestamp is lower. As we are in the case of no change in the
# scheduling decision, there is no need to have the KubernetesController
# processing the Application. Updating the timestamp would simply trigger
# a processing of the Application by the KubernetesController, which would
# not make the controller perform any action.
if app.metadata.modified > app.status.kube_controller_triggered:
app.status.kube_controller_triggered = utils.now()
await self.kubernetes_api.update_application_status(
namespace=app.metadata.namespace, name=app.metadata.name, body=app
)
return
if app.status.scheduled_to:
logger.info(
"Migrate %r from %s to %s", app, app.status.scheduled_to, scheduled_to
)
else:
logger.info("Scheduled %r to %r", app, cluster)
await self.kubernetes_api.update_application_binding(
namespace=app.metadata.namespace,
name=app.metadata.name,
body=ClusterBinding(cluster=scheduled_to),
)
async def schedule_magnum_cluster(self, cluster):
"""Choose a suitable OpenStack Project for the given MagnumCluster and bound
them together.
Args:
cluster (krake.data.openstack.MagnumCluster): the MagnumCluster that needs
to be scheduled to a Project.
"""
assert cluster.status.project is None, "Magnum cluster is already bound"
logger.info("Schedule %r", cluster)
projects = await self.openstack_api.list_all_projects()
project = await self.select_openstack_project(cluster, projects.items)
if project is None:
logger.info("No matching OpenStack project found for %r", cluster)
raise NoProjectFound("No matching OpenStack project found")
# TODO: Instead of copying labels and metrics, refactor the scheduler
# to support transitive labels and metrics.
cluster.metadata.labels = {**project.metadata.labels, **cluster.metadata.labels}
# If a metric with the same name is already specified in the Magnum
# cluster spec, this takes precedence.
metric_names = set(metric.name for metric in cluster.spec.metrics)
for metric in project.spec.metrics:
if metric.name not in metric_names:
cluster.spec.metrics.append(metric)
await self.openstack_api.update_magnum_cluster(
namespace=cluster.metadata.namespace,
name=cluster.metadata.name,
body=cluster,
)
# TODO: How to support and compare different cluster templates?
logger.info("Scheduled %r to %r", cluster, project)
await self.openstack_api.update_magnum_cluster_binding(
namespace=cluster.metadata.namespace,
name=cluster.metadata.name,
body=MagnumClusterBinding(
project=resource_ref(project), template=project.spec.template
),
)
async def reschedule_kubernetes_application(self, app):
"""Ensure that the given Application will go through the scheduling process
after a certain interval. This allows an Application to be rescheduled to a
more suitable Cluster if a better one is found.
Args:
app (krake.data.kubernetes.Application): the Application to reschedule.
"""
if not app.spec.constraints.migration:
logger.debug(
"Not rescheduling %r, since migration of the application is disabled.",
app,
)
return
# Put the application into the work queue with a certain delay. This
# ensures the rescheduling of the application. Only put it if there is
# not already another version of the resource in the queue. This check
# is needed to ensure that we do not overwrite state changes with the
# current one which might be outdated.
if app.metadata.uid not in self.queue.dirty:
logger.debug("Reschedule %r in %s secs", app, self.reschedule_after)
await self.queue.put(app.metadata.uid, app, delay=self.reschedule_after)
@staticmethod
def select_maximum(ranked):
"""From a list of ClusterRank, get the one with the best rank. If several
ClusterRank have the same rank, one of them is chosen randomly.
Args:
ranked (List[ClusterRank]): the best rank will be taken from this list.
Returns:
ClusterRank: an element of the given list with the maximum rank.
"""
# Find all maxima
best = max(ranked)
maximum = [rank for rank in ranked if rank == best]
# Select randomly between best projects
return random.choice(maximum)
async def select_kubernetes_cluster(self, app, clusters):
"""Select suitable kubernetes cluster for application binding.
Args:
app (krake.data.kubernetes.Application): Application object for binding
clusters (list[krake.data.kubernetes.Cluster]): Clusters between which
the "best" one should be chosen.
Returns:
Cluster: Cluster suitable for application binding
"""
# Reject clusters marked as deleted
clusters = (cluster for cluster in clusters if cluster.metadata.deleted is None)
matching = [
cluster for cluster in clusters if match_cluster_constraints(app, cluster)
]
if not matching:
logger.info("No matching Kubernetes cluster for %r found", app)
raise NoClusterFound("No matching Kubernetes cluster found")
# If the application already has been scheduled it might be that it
# was very recently. In fact, since the controller reacts to all updates
# of the application, it might very well be that the previous scheduling
# took place very recently. For example, the kubernetes controller updates
# the app in reaction to the scheduler's scheduling, in which case
# the scheduler will try and select the best cluster yet again.
# Therefore we have to make sure the previous scheduling was not too recent.
# If it was, we want to stay at the current cluster - if it is still matching.
# The above reasoning is also true in the case when the user has performed an
# update of the application's cluster label constraints. Also in this case, the
# update should not cause a migration if 'app was `recently scheduled`'
# and 'current cluster is still matching'. If the app was recently scheduled
# but the update caused the current cluster to no longer be matching, we
# will reschedule, since `current` will become None below.
# If 'app was NOT `recently scheduled`' and 'current cluster is still matching',
# we might reschedule, e.g., due to changing metrics.
if app.status.scheduled_to:
# get current cluster as first cluster in matching to which app is scheduled
current = next(
(c for c in matching if resource_ref(c) == app.status.scheduled_to),
None,
)
# if current cluster is still matching
if current:
# We check how long ago the previous scheduling took place.
# If it is less than reschedule_after seconds ago, we do not
# reschedule. We use reschedule_after for this comparison,
# since it indicates how often it is desired that an application
# should be rescheduled when a more appropriate cluster exists.
time_since_scheduled_to_current = utils.now() - app.status.scheduled
app_recently_scheduled = time_since_scheduled_to_current < timedelta(
seconds=self.reschedule_after
)
if app_recently_scheduled:
return current
# Partition list if matching clusters into a list if clusters with
# metrics and without metrics. Clusters with metrics are preferred
# over clusters without metrics.
with_metrics = [cluster for cluster in matching if cluster.spec.metrics]
# Only use clusters without metrics when there are no clusters with
# metrics.
scores = []
if with_metrics:
# Compute the score of all clusters based on their metric
scores = await self.rank_kubernetes_clusters(app, with_metrics)
if not scores:
# If no score of cluster with metrics could be computed (e.g. due to
# unreachable metrics providers), compute the score of the matching clusters
# that do not have metrics.
scores = [
self.calculate_kubernetes_cluster_score((), cluster, app)
for cluster in matching
]
return self.select_maximum(scores).cluster
async def select_openstack_project(self, cluster, projects):
"""Select "best" OpenStack project for the Magnum cluster.
Args:
cluster (krake.data.openstack.MagnumCluster): Cluster that should
be bound to a project
projects (list[krake.data.openstack.Project]): Projects between the
"best" one is chosen.
Returns:
krake.data.openstack.Project, None: Best project matching the
constraints of the Magnum cluster. None if no project can be found.
"""
# Reject projects marked as deleted
projects = (project for project in projects if project.metadata.deleted is None)
matching = [
project
for project in projects
if match_project_constraints(cluster, project)
]
if not matching:
logger.info("No matching OpenStack project found for %r", cluster)
raise NoProjectFound("No matching OpenStack project found")
# Filter projects with metrics which are preferred over projects
# without metrics.
with_metrics = [project for project in matching if project.spec.metrics]
# Only use projects without metrics when there are no projects with
# metrics.
if not with_metrics:
scores = [
self.calculate_openstack_project_scores((), project)
for project in matching
]
else:
# Compute the score of all projects based on their metric
scores = await self.rank_openstack_projects(cluster, with_metrics)
if not scores:
logger.info("Unable to compute the score of any Kubernetes cluster")
raise NoProjectFound("No OpenStack project available")
return self.select_maximum(scores).project
async def rank_kubernetes_clusters(self, app, clusters):
"""Compute the score of the kubernetes clusters based on metrics values and
weights.
Args:
app (krake.data.kubernetes.Application): Application object for binding
clusters (list[Cluster]): List of clusters for which the score has to be
computed.
Returns:
list[ClusterScore]: list of all cluster's score
"""
return [
self.calculate_kubernetes_cluster_score(metrics, cluster, app)
for cluster in clusters
async for metrics in self.fetch_metrics(cluster, cluster.spec.metrics)
]
async def rank_openstack_projects(self, cluster, projects):
"""Compute the score of the OpenStack projects based on metric values and
weights.
Args:
cluster (krake.data.openstack.MagnumCluster): Cluster that is scheduled
projects (list[Project]): List of projects for which the score has to be
computed.
Returns:
list[ProjectScore]: list of all cluster's score
"""
return [
self.calculate_openstack_project_scores(metrics, project)
for project in projects
async for metrics in self.fetch_metrics(project, project.spec.metrics)
]
@staticmethod
def metrics_reason_from_err(error):
"""Convert an error as exception into an instance of :class:`Reason`. Also
generates an appropriate message if necessary.
Args:
error (Exception): error that occurred which has to be converted into a
reason.
Returns:
Reason: reason generated from the provided error.
"""
message = None
if isinstance(error, MetricsProviderError):
reason_code = ReasonCode.UNREACHABLE_METRICS_PROVIDER
elif isinstance(error, MetricError):
reason_code = ReasonCode.INVALID_METRIC
elif isinstance(error, ClientError):
resource_name = error.request_info.url.path.split("/")[-1]
if "metricsprovider" in error.request_info.url.path:
reason_code = ReasonCode.UNKNOWN_METRICS_PROVIDER
message = (
f"The metrics provider {resource_name!r} was not found in the Krake"
f" database."
)
else:
reason_code = ReasonCode.UNKNOWN_METRIC
message = (
f"The metric {resource_name!r} was not found in the Krake database."
)
else:
raise error
final_message = message if message else str(error)
return Reason(code=reason_code, message=final_message)
async def update_resource_status(self, resource, metrics, reasons):
"""Update the status of the provided resource with the new list of reasons for
metrics which failed.
Args:
resource (krake.data.serializable.ApiObject): the resource to updated.
metrics (list[krake.data.core.MetricRef]): the list of metrics for which the
scheduler attempted to fetch the current value.
reasons (list[Reason]): the list of reasons for the metrics failing which
were found. For each metric in the :attr:`metrics` argument, there
should be one element in this argument: the reason for the metric
failing, or None if it did not fail.
"""
assert len(metrics) == len(reasons)
if resource.kind == "Cluster":
resource.status.state = ClusterState.FAILING_METRICS
update_status_client = self.kubernetes_api.update_cluster_status
elif resource.kind == "Project":
resource.status.state = ProjectState.FAILING_METRICS
update_status_client = self.openstack_api.update_project_status
else:
raise ValueError(f"Unsupported kind: {resource.kind}.")
# Add to resource only if a failure occurred.
resource.status.metrics_reasons = {}
for i, reason in enumerate(reasons):
if reason:
resource.status.metrics_reasons[metrics[i].name] = reason
await update_status_client(
namespace=resource.metadata.namespace,
name=resource.metadata.name,
body=resource,
)
async def fetch_metrics(self, resource, metrics):
"""Async generator for fetching metrics by the given list of metric
references.
If a :class:`MetricError` or `ClientError` occurs, the generator stops
which means resources where an error during metric fetching occurs can
be skipped by:
.. code:: python
scores = [
self.calculate_foo_score()
for foo in foos
async for metrics in self.fetch_metrics(foo, foo.spec.metrics)
]
Args:
resource (krake.data.serializable.ApiObject): API resource to which
the metrics belong.
metrics (list[krake.data.core.MetricRef]): References to metrics
that should be fetched.
Yields:
list[krake.controller.scheduler.metrics.QueryResult]: List of fetched
metrics with their value and weight.
"""
assert metrics, "Got empty list of metric references"
errors = []
reasons = []
fetching = []
for metric_spec in metrics:
try:
metric = await self.core_api.read_global_metric(name=metric_spec.name)
metrics_provider = await self.core_api.read_global_metrics_provider(
name=metric.spec.provider.name
)
fetching.append(
fetch_query(
self.client.session,
metric,
metrics_provider,
metric_spec.weight,
)
)
reasons.append(None) # Add an empty placeholder when no error occurred.
except ClientError as err:
reasons.append(self.metrics_reason_from_err(err))
errors.append(err)
fetched = await asyncio.gather(*fetching, return_exceptions=True)
# Convert the errors which occurred when fetching the value of the remaining
# metrics into Reason instances.
# For this, the next occurrence of "None" inside the "reasons" list is used.
# Each one of this occurrence corresponds to a task for fetching the metric. So
# if for example the 3rd element in "fetched" is an error, the 3rd "None" in
# "reasons" must be replaced.
none_reason_iter = (i for i, reason in enumerate(reasons) if reason is None)
for result in fetched:
# Get the index of the next "None" inside "reasons".
index_of_none = next(none_reason_iter)
if isinstance(result, Exception):
reasons[index_of_none] = self.metrics_reason_from_err(result)
errors.append(result)
stopped = False
try:
next(none_reason_iter)
except StopIteration:
stopped = True
assert stopped
if any(reasons):
# If there is any issue with a metric, skip stop the generator.
await self.update_resource_status(resource, metrics, reasons)
for error in errors:
if error:
logger.error(error)
return
for metric, weight, value in fetched:
logger.debug(
"Received metric %r with value %r for %r", metric, value, resource
)
yield fetched
def calculate_kubernetes_cluster_score(self, metrics, cluster, app):
"""Calculate weighted sum of metrics values.
Args:
metrics (list[.metrics.QueryResult]): List of metric query results
cluster (Cluster): cluster for which the score has to be computed.
app (krake.data.kubernetes.Application): Application object that
should be scheduled.
Returns:
ClusterScore: score of the passed cluster based on metrics and application.
"""
sticky = self.calculate_kubernetes_cluster_stickiness(cluster, app)
if not metrics:
return ClusterScore(score=sticky.weight * sticky.value, cluster=cluster)
norm = sum(metric.weight for metric in metrics) + sticky.weight
score = (
sum(metric.value * metric.weight for metric in metrics)
+ (sticky.value * sticky.weight)
) / norm
return ClusterScore(score=score, cluster=cluster)
def calculate_kubernetes_cluster_stickiness(self, cluster, app):
"""Return extra metric for clusters to make the application "stick" to
it by increasing its score.
If the application is already scheduled to the passed cluster, a
stickiness of ``1.0`` with a configurable weight is returned.
Otherwise, a stickiness of ``0`` is returned.
Args:
cluster (Cluster): cluster for which the score has to be computed.
app (krake.data.kubernetes.Application): Application object that
should be scheduled.
Returns:
Stickiness: Value and its weight that should be added to the
cluster score.
"""
if resource_ref(cluster) != app.status.scheduled_to:
return Stickiness(weight=0, value=0)
return Stickiness(weight=self.stickiness, value=1.0)
def calculate_openstack_project_scores(self, metrics, project):
"""Calculate score of OpenStack project based on the given metrics.
Args:
metrics (list[krake.controller.scheduler.metrics.QueryResult]): List of
metric query results.
project (krake.data.openstack.Project): Project for which the score has to
be computed.
Returns:
ProjectScore: Score of the passed project based on metrics and Magnum
cluster.
"""
# Score for a OpenStack project without any metrics
if not metrics:
return ProjectScore(score=0, project=project)
norm = sum(metric.weight for metric in metrics)
score = sum(metric.value * metric.weight for metric in metrics) / norm
return ProjectScore(score=score, project=project)
| [
1,
529,
9507,
29958,
29895,
336,
446,
29914,
29895,
336,
446,
29914,
8299,
29914,
816,
14952,
29914,
816,
14952,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
408,
948,
3934,
13,
3166,
12865,
1053,
5335,
287,
2554,
13,
5215,
12183,
13,
5215,
4036,
13,
3166,
19229,
1053,
405,
2795,
23215,
552,
13,
13,
3166,
2090,
312,
8789,
1053,
3001,
29918,
2098,
292,
13,
3166,
263,
601,
1124,
1053,
12477,
2392,
13,
13,
3166,
18858,
446,
1053,
3667,
29879,
13,
3166,
18858,
446,
29889,
1272,
29889,
3150,
1429,
1053,
313,
13,
1678,
8010,
29892,
13,
1678,
3561,
1949,
6821,
5402,
2792,
29892,
13,
1678,
3561,
1949,
6821,
5402,
9270,
29892,
13,
1678,
8010,
2792,
29892,
13,
29897,
13,
3166,
18858,
446,
29889,
4645,
29889,
3150,
1429,
1053,
4673,
7264,
11713,
13,
3166,
18858,
446,
29889,
4645,
29889,
3221,
1053,
10239,
11713,
13,
3166,
18858,
446,
29889,
4645,
29889,
29895,
17547,
1053,
476,
17547,
11713,
13,
3166,
18858,
446,
29889,
1272,
29889,
3221,
1053,
830,
1658,
3399,
29892,
6503,
29918,
999,
29892,
830,
1658,
13,
3166,
18858,
446,
29889,
1272,
29889,
29895,
17547,
1053,
313,
13,
1678,
8427,
2792,
29892,
13,
1678,
2233,
5402,
29892,
13,
1678,
2233,
5402,
9270,
29892,
13,
1678,
2233,
5402,
2792,
29892,
13,
29897,
13,
13,
3166,
869,
13646,
29879,
1053,
1993,
29918,
19594,
29918,
13646,
29879,
29892,
1993,
29918,
4836,
29918,
13646,
29879,
13,
3166,
869,
2527,
10817,
1053,
4737,
2200,
2392,
29892,
6699,
29918,
1972,
29892,
4737,
10817,
6980,
2392,
13,
3166,
6317,
1053,
15830,
29892,
15830,
2392,
29892,
9897,
781,
272,
29892,
5244,
10620,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
1990,
1939,
6821,
5402,
9692,
29898,
2956,
2392,
1125,
13,
1678,
9995,
29934,
1759,
287,
297,
1206,
746,
727,
338,
451,
3307,
7788,
363,
805,
1450,
1076,
385,
2280,
13,
1678,
373,
738,
310,
278,
7246,
1860,
29889,
13,
1678,
9995,
13,
13,
1678,
775,
353,
830,
1658,
3399,
29889,
6632,
29918,
14605,
1806,
6181,
29918,
1525,
27839,
4741,
13,
13,
13,
1990,
1939,
7653,
9692,
29898,
2956,
2392,
1125,
13,
1678,
775,
353,
830,
1658,
3399,
29889,
6632,
29918,
14605,
1806,
6181,
29918,
1525,
27839,
4741,
13,
13,
13,
29992,
7827,
29918,
2098,
292,
13,
1990,
22125,
29924,
861,
262,
29898,
3318,
1125,
13,
1678,
9995,
29924,
861,
262,
770,
363,
24034,
3618,
2729,
373,
1009,
4954,
13628,
16159,
5352,
29889,
13,
13,
1678,
910,
6837,
262,
770,
338,
1304,
491,
278,
584,
9891,
18078,
2098,
29918,
1609,
29918,
13628,
29952,
10200,
1061,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
1896,
12035,
1311,
29892,
288,
1125,
13,
4706,
565,
451,
756,
5552,
29898,
29877,
29892,
376,
13628,
29908,
1125,
13,
9651,
736,
2216,
1888,
2037,
287,
13,
4706,
736,
1583,
29889,
13628,
529,
288,
29889,
13628,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
288,
1125,
13,
4706,
565,
451,
756,
5552,
29898,
29877,
29892,
376,
13628,
29908,
1125,
13,
9651,
736,
2216,
1888,
2037,
287,
13,
4706,
736,
1583,
29889,
13628,
1275,
288,
29889,
13628,
13,
13,
13,
1753,
1797,
519,
29918,
1609,
29918,
13628,
29898,
25932,
1125,
13,
1678,
9995,
6185,
272,
1061,
363,
3907,
263,
770,
1797,
519,
2729,
373,
278,
4954,
13628,
16159,
5352,
29889,
13,
13,
1678,
1334,
2609,
671,
584,
9891,
18078,
7692,
312,
8789,
29889,
7827,
29918,
2098,
292,
29952,
297,
13,
1678,
584,
1990,
18078,
1017,
15702,
29889,
22175,
23215,
552,
29952,
1363,
18761,
2307,
10703,
8261,
13,
1678,
10230,
12768,
5557,
292,
278,
10200,
1061,
515,
14655,
278,
13,
1678,
5734,
4097,
29889,
16478,
29892,
6837,
1144,
526,
884,
451,
3390,
287,
491,
13,
1678,
584,
1990,
18078,
1017,
15702,
29889,
22175,
23215,
552,
1412,
13,
13,
1678,
10133,
29892,
445,
10200,
1061,
11658,
29879,
584,
1990,
18078,
29934,
804,
29924,
861,
262,
29952,
408,
385,
5684,
2967,
13,
1678,
770,
964,
278,
4502,
770,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
1067,
29879,
313,
1853,
1125,
4134,
393,
881,
679,
584,
1990,
18078,
29934,
804,
29924,
861,
262,
29952,
408,
2967,
770,
29889,
13,
13,
1678,
16969,
29901,
13,
4706,
1134,
29901,
4134,
411,
11658,
287,
584,
1990,
18078,
29934,
804,
29924,
861,
262,
29952,
2967,
770,
13,
13,
1678,
9995,
13,
1678,
565,
22125,
29924,
861,
262,
451,
297,
1067,
29879,
17255,
29885,
307,
1649,
29901,
13,
4706,
1067,
29879,
17255,
29890,
2129,
1649,
353,
313,
29934,
804,
29924,
861,
262,
29892,
29897,
718,
1067,
29879,
17255,
29890,
2129,
1649,
13,
1678,
736,
1067,
29879,
13,
13,
13,
29992,
2098,
519,
29918,
1609,
29918,
13628,
13,
1990,
2233,
5402,
20097,
29898,
22175,
23215,
552,
1125,
13,
1678,
9995,
22175,
18761,
363,
20520,
476,
17547,
24554,
2729,
373,
263,
8158,
15945,
29908,
13,
13,
1678,
8158,
29901,
5785,
13,
1678,
9867,
29901,
2233,
5402,
13,
13,
13,
29992,
2098,
519,
29918,
1609,
29918,
13628,
13,
1990,
8010,
20097,
29898,
22175,
23215,
552,
1125,
13,
1678,
9995,
22175,
18761,
363,
20520,
4673,
7264,
9279,
2729,
373,
263,
8158,
15945,
29908,
13,
13,
1678,
8158,
29901,
5785,
13,
1678,
2060,
29901,
8010,
13,
13,
13,
1990,
624,
860,
3335,
29898,
22175,
23215,
552,
1125,
13,
1678,
9995,
2528,
3245,
12714,
2715,
24554,
1213,
15945,
13,
13,
1678,
7688,
29901,
5785,
13,
1678,
995,
29901,
5785,
13,
13,
13,
1990,
1102,
14952,
29898,
2956,
1125,
13,
1678,
9995,
1576,
1364,
14952,
338,
263,
4701,
393,
20586,
599,
28235,
322,
4784,
13,
1678,
8324,
322,
27778,
278,
376,
13318,
29908,
14998,
363,
1269,
697,
310,
963,
2729,
13,
1678,
373,
21556,
310,
278,
1250,
1975,
322,
2280,
2702,
800,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
15645,
29918,
2798,
313,
524,
29892,
13136,
1125,
278,
5253,
310,
15645,
740,
393,
13,
9651,
881,
367,
1065,
408,
3239,
9595,
29889,
13,
4706,
620,
305,
11272,
29918,
7045,
313,
7411,
29892,
13136,
1125,
1353,
310,
6923,
1156,
607,
263,
6503,
13,
9651,
881,
367,
620,
305,
14989,
29889,
13,
4706,
24250,
29918,
4703,
313,
16265,
29889,
18641,
2677,
29892,
13136,
1125,
17122,
3030,
393,
881,
367,
13,
9651,
1304,
304,
23120,
411,
278,
3450,
1923,
29889,
13,
4706,
2553,
21543,
313,
7411,
29892,
13136,
1125,
1353,
310,
6923,
278,
1364,
14952,
881,
4480,
13,
9651,
1434,
372,
7657,
29879,
304,
263,
2106,
1735,
29889,
13,
4706,
2425,
313,
294,
948,
3934,
29889,
9118,
2624,
18405,
29892,
13136,
1125,
6864,
2425,
393,
881,
367,
13,
9651,
1304,
29889,
13,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
7882,
29918,
29734,
29892,
13,
4706,
15645,
29918,
2798,
29922,
29896,
29900,
29892,
13,
4706,
620,
305,
11272,
29918,
7045,
29922,
29953,
29900,
29892,
13,
4706,
12070,
3335,
29922,
29900,
29889,
29896,
29892,
13,
4706,
24250,
29918,
4703,
29922,
8516,
29892,
13,
4706,
2553,
21543,
29922,
29900,
29892,
13,
4706,
2425,
29922,
8516,
29892,
13,
268,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
13,
9651,
7882,
29918,
29734,
29892,
2425,
29922,
7888,
29892,
24250,
29918,
4703,
29922,
16265,
29918,
4703,
29892,
2553,
21543,
29922,
16529,
21543,
13,
4706,
1723,
13,
4706,
1583,
29889,
11082,
1949,
29918,
9990,
353,
5244,
10620,
29898,
7888,
29922,
1311,
29889,
7888,
29892,
2553,
21543,
29922,
16529,
21543,
29897,
13,
4706,
1583,
29889,
29895,
17547,
29918,
2754,
353,
6213,
13,
4706,
1583,
29889,
3150,
1429,
29918,
2754,
353,
6213,
13,
4706,
1583,
29889,
3221,
29918,
2754,
353,
6213,
13,
4706,
1583,
29889,
29895,
17547,
29918,
13191,
272,
353,
6213,
13,
4706,
1583,
29889,
3150,
1429,
29918,
13191,
272,
353,
6213,
13,
4706,
1583,
29889,
24602,
29918,
2798,
353,
15645,
29918,
2798,
13,
4706,
1583,
29889,
690,
305,
11272,
29918,
7045,
353,
620,
305,
11272,
29918,
7045,
13,
4706,
1583,
29889,
303,
860,
3335,
353,
12070,
3335,
13,
13,
1678,
7465,
822,
19012,
29898,
1311,
29892,
3132,
1125,
13,
4706,
4974,
3132,
338,
451,
6213,
13,
4706,
1583,
29889,
4645,
353,
3132,
13,
4706,
1583,
29889,
29895,
17547,
29918,
2754,
353,
476,
17547,
11713,
29898,
1311,
29889,
4645,
29897,
13,
4706,
1583,
29889,
3150,
1429,
29918,
2754,
353,
4673,
7264,
11713,
29898,
1311,
29889,
4645,
29897,
13,
4706,
1583,
29889,
3221,
29918,
2754,
353,
10239,
11713,
29898,
1311,
29889,
4645,
29897,
13,
13,
4706,
363,
474,
297,
3464,
29898,
1311,
29889,
24602,
29918,
2798,
1125,
13,
9651,
1583,
29889,
9573,
29918,
7662,
29898,
13,
18884,
1583,
29889,
8411,
29918,
29895,
17547,
29918,
932,
5795,
29892,
1024,
29922,
29888,
29908,
29895,
17547,
29918,
24602,
648,
29875,
5038,
13,
9651,
1723,
13,
13,
4706,
363,
474,
297,
3464,
29898,
1311,
29889,
24602,
29918,
2798,
1125,
13,
9651,
1583,
29889,
9573,
29918,
7662,
29898,
1311,
29889,
8411,
29918,
11082,
1949,
29918,
695,
504,
414,
29892,
1024,
29922,
29888,
29908,
11082,
1949,
29918,
24602,
648,
29875,
27195,
13,
13,
4706,
1583,
29889,
29895,
17547,
29918,
13191,
272,
353,
9897,
781,
272,
29898,
13,
9651,
18028,
29922,
1311,
29889,
29895,
17547,
29918,
2754,
29889,
1761,
29918,
497,
29918,
932,
5795,
29892,
13,
9651,
21217,
29922,
1311,
29889,
29895,
17547,
29918,
2754,
29889,
12344,
29918,
497,
29918,
932,
5795,
29892,
13,
9651,
373,
29918,
1761,
29922,
1311,
29889,
13556,
2347,
29918,
29895,
17547,
29918,
932,
29892,
13,
9651,
373,
29918,
1202,
29922,
1311,
29889,
13556,
2347,
29918,
29895,
17547,
29918,
932,
29892,
13,
9651,
373,
29918,
5504,
29922,
1311,
29889,
13556,
2347,
29918,
29895,
17547,
29918,
932,
29892,
13,
9651,
373,
29918,
8143,
29922,
1311,
29889,
13556,
2347,
29918,
29895,
17547,
29918,
932,
29892,
13,
9651,
6503,
29918,
572,
3631,
543,
29968,
17547,
2401,
5795,
613,
13,
4706,
1723,
13,
4706,
1583,
29889,
3150,
1429,
29918,
13191,
272,
353,
9897,
781,
272,
29898,
13,
9651,
18028,
29922,
1311,
29889,
3150,
1429,
29918,
2754,
29889,
1761,
29918,
497,
29918,
11082,
1949,
29918,
695,
504,
414,
29892,
13,
9651,
21217,
29922,
1311,
29889,
3150,
1429,
29918,
2754,
29889,
12344,
29918,
497,
29918,
11082,
1949,
29918,
695,
504,
414,
29892,
13,
9651,
373,
29918,
1761,
29922,
1311,
29889,
13556,
2347,
29918,
11082,
1949,
29918,
19594,
29892,
13,
9651,
373,
29918,
1202,
29922,
1311,
29889,
13556,
2347,
29918,
11082,
1949,
29918,
19594,
29892,
13,
9651,
373,
29918,
5504,
29922,
1311,
29889,
13556,
2347,
29918,
11082,
1949,
29918,
19594,
29892,
13,
9651,
373,
29918,
8143,
29922,
1311,
29889,
13556,
2347,
29918,
11082,
1949,
29918,
19594,
29892,
13,
9651,
6503,
29918,
572,
3631,
543,
19095,
1949,
2233,
504,
414,
613,
13,
4706,
1723,
13,
4706,
1583,
29889,
9573,
29918,
7662,
29898,
1311,
29889,
29895,
17547,
29918,
13191,
272,
29892,
1024,
543,
29968,
17547,
9432,
272,
1159,
13,
4706,
1583,
29889,
9573,
29918,
7662,
29898,
1311,
29889,
3150,
1429,
29918,
13191,
272,
29892,
1024,
543,
6585,
7264,
9432,
272,
1159,
13,
13,
1678,
7465,
822,
5941,
786,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29895,
17547,
29918,
13191,
272,
353,
6213,
13,
4706,
1583,
29889,
3150,
1429,
29918,
13191,
272,
353,
6213,
13,
4706,
1583,
29889,
29895,
17547,
29918,
2754,
353,
6213,
13,
4706,
1583,
29889,
3221,
29918,
2754,
353,
6213,
13,
13,
1678,
7465,
822,
4520,
29918,
29895,
17547,
29918,
932,
29898,
1311,
29892,
623,
1125,
13,
4706,
9995,
4598,
363,
476,
17547,
2280,
9432,
272,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
8427,
4520,
515,
278,
3450,
13,
13,
4706,
9995,
13,
4706,
565,
623,
29889,
19635,
29889,
311,
22742,
29901,
13,
9651,
396,
14402,
29901,
960,
385,
2280,
338,
11132,
29892,
278,
28598,
19478,
310,
916,
13,
9651,
396,
259,
8324,
881,
19998,
367,
337,
11292,
29889,
13,
9651,
17927,
29889,
8382,
703,
19420,
620,
26902,
19478,
310,
11132,
1273,
29878,
613,
623,
29897,
13,
9651,
7272,
1583,
29889,
9990,
29889,
20713,
29898,
932,
29889,
19635,
29889,
5416,
29897,
13,
13,
4706,
396,
450,
2280,
338,
2307,
21467,
322,
694,
1735,
756,
1063,
1754,
304,
278,
1580,
29879,
13,
4706,
396,
1951,
769,
29889,
25678,
29892,
591,
881,
2189,
263,
29591,
620,
26902,
19478,
304,
4386,
13,
4706,
396,
3620,
297,
278,
9867,
12714,
1819,
29889,
13,
4706,
25342,
313,
13,
9651,
623,
29889,
4882,
29889,
29895,
4003,
29918,
8299,
29918,
21001,
287,
13,
9651,
322,
623,
29889,
19635,
29889,
1545,
2164,
5277,
623,
29889,
4882,
29889,
29895,
4003,
29918,
8299,
29918,
21001,
287,
13,
308,
1125,
13,
9651,
7272,
1583,
29889,
690,
305,
11272,
29918,
29895,
17547,
29918,
6214,
29898,
932,
29897,
13,
13,
4706,
25342,
623,
29889,
4882,
29889,
3859,
1275,
8427,
2792,
29889,
4519,
29902,
20566,
29901,
13,
9651,
17927,
29889,
8382,
703,
1123,
622,
5229,
1273,
29878,
613,
623,
29897,
13,
4706,
1683,
29901,
13,
9651,
17927,
29889,
8382,
703,
23965,
1273,
29878,
613,
623,
29897,
13,
9651,
7272,
1583,
29889,
9990,
29889,
649,
29898,
932,
29889,
19635,
29889,
5416,
29892,
623,
29897,
13,
13,
1678,
7465,
822,
4520,
29918,
11082,
1949,
29918,
19594,
29898,
1311,
29892,
9867,
1125,
13,
4706,
9995,
4598,
363,
476,
17547,
2280,
9432,
272,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
9867,
313,
29895,
336,
446,
29889,
1272,
29889,
3150,
1429,
29889,
19095,
1949,
6821,
5402,
1125,
3561,
1949,
6154,
5402,
4520,
515,
13,
18884,
278,
3450,
29889,
13,
13,
4706,
9995,
13,
4706,
396,
1152,
1286,
29892,
591,
437,
451,
620,
305,
11272,
3561,
1949,
24554,
29889,
10133,
29892,
451,
427,
802,
26420,
13,
4706,
396,
363,
620,
26902,
19478,
322,
451,
376,
816,
14989,
29908,
14334,
29889,
13,
4706,
565,
9867,
29889,
19635,
29889,
311,
22742,
29901,
13,
9651,
17927,
29889,
8382,
703,
23805,
11132,
1273,
29878,
613,
9867,
29897,
13,
4706,
25342,
9867,
29889,
4882,
29889,
4836,
338,
6213,
29901,
13,
9651,
17927,
29889,
8382,
703,
23965,
443,
9917,
1273,
29878,
613,
9867,
29897,
13,
9651,
7272,
1583,
29889,
11082,
1949,
29918,
9990,
29889,
649,
29898,
19594,
29889,
19635,
29889,
5416,
29892,
9867,
29897,
13,
4706,
1683,
29901,
13,
9651,
17927,
29889,
8382,
703,
23805,
3216,
1273,
29878,
613,
9867,
29897,
13,
13,
1678,
7465,
822,
4386,
29918,
29895,
17547,
29918,
932,
5795,
29898,
1311,
29892,
1065,
29918,
10646,
29922,
8824,
1125,
13,
4706,
9995,
797,
18925,
2425,
607,
6699,
267,
322,
6567,
975,
278,
476,
17547,
8427,
13,
4706,
7788,
304,
278,
1492,
1034,
449,
457,
29889,
450,
2702,
15283,
322,
1059,
11415,
13,
4706,
505,
304,
367,
2715,
1244,
29889,
13,
13,
4706,
910,
740,
338,
6839,
304,
367,
1065,
408,
3239,
3414,
29889,
18199,
278,
11415,
310,
263,
13,
4706,
6503,
411,
278,
584,
5552,
18078,
908,
29952,
5352,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1065,
29918,
10646,
313,
11227,
29892,
13136,
1125,
565,
5852,
29892,
278,
740,
871,
17766,
697,
6503,
29892,
13,
18884,
769,
17726,
29889,
13466,
29892,
6773,
304,
4386,
1269,
716,
6503,
373,
278,
13,
18884,
9521,
297,
1753,
18639,
29889,
13,
13,
4706,
9995,
13,
4706,
1550,
5852,
29901,
13,
9651,
1820,
29892,
623,
353,
7272,
1583,
29889,
9990,
29889,
657,
580,
13,
9651,
1018,
29901,
13,
18884,
396,
14402,
29901,
3450,
363,
20382,
1422,
2280,
4072,
13,
18884,
17927,
29889,
8382,
703,
3481,
1847,
1273,
29878,
613,
623,
29897,
13,
18884,
7272,
1583,
29889,
29895,
17547,
29918,
6214,
29918,
13556,
2347,
29898,
932,
29897,
13,
9651,
5174,
15830,
2392,
408,
1059,
29901,
13,
18884,
623,
29889,
4882,
29889,
23147,
353,
830,
1658,
29898,
401,
29922,
2704,
29889,
401,
29892,
2643,
29922,
2704,
29889,
4906,
29897,
13,
18884,
623,
29889,
4882,
29889,
3859,
353,
8427,
2792,
29889,
4519,
29902,
20566,
13,
13,
18884,
7272,
1583,
29889,
29895,
17547,
29918,
2754,
29889,
5504,
29918,
6214,
29918,
4882,
29898,
13,
462,
1678,
7397,
29922,
932,
29889,
19635,
29889,
22377,
29892,
1024,
29922,
932,
29889,
19635,
29889,
978,
29892,
3573,
29922,
932,
13,
18884,
1723,
13,
9651,
7146,
29901,
13,
18884,
7272,
1583,
29889,
9990,
29889,
15091,
29898,
1989,
29897,
13,
9651,
565,
1065,
29918,
10646,
29901,
13,
18884,
2867,
29871,
396,
14402,
29901,
881,
591,
3013,
445,
29973,
9333,
5407,
363,
6987,
13,
13,
1678,
7465,
822,
4386,
29918,
11082,
1949,
29918,
695,
504,
414,
29898,
1311,
29892,
1065,
29918,
10646,
29922,
8824,
1125,
13,
4706,
9995,
797,
18925,
2425,
607,
6699,
267,
322,
6567,
975,
278,
3561,
1949,
6821,
5402,
7788,
304,
278,
13,
4706,
1492,
1034,
449,
457,
29889,
450,
2702,
15283,
322,
1059,
11415,
505,
304,
367,
2715,
13,
4706,
1244,
29889,
13,
13,
4706,
910,
740,
338,
6839,
304,
367,
1065,
408,
3239,
3414,
29889,
18199,
278,
11415,
310,
263,
13,
4706,
6503,
411,
278,
584,
5552,
18078,
908,
29952,
5352,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1065,
29918,
10646,
313,
11227,
29892,
13136,
1125,
565,
5852,
29892,
278,
740,
871,
17766,
697,
6503,
29892,
13,
18884,
769,
17726,
29889,
13466,
29892,
6773,
304,
4386,
1269,
716,
6503,
373,
278,
13,
18884,
9521,
297,
1753,
18639,
29889,
13,
13,
4706,
9995,
13,
4706,
1550,
5852,
29901,
13,
9651,
1820,
29892,
9867,
353,
7272,
1583,
29889,
11082,
1949,
29918,
9990,
29889,
657,
580,
13,
9651,
1018,
29901,
13,
18884,
396,
14402,
29901,
3450,
363,
20382,
1422,
2280,
4072,
13,
18884,
17927,
29889,
8382,
703,
3481,
1847,
1273,
29878,
613,
9867,
29897,
13,
18884,
7272,
1583,
29889,
816,
11272,
29918,
11082,
1949,
29918,
19594,
29898,
19594,
29897,
13,
9651,
5174,
15830,
2392,
408,
1059,
29901,
13,
18884,
9867,
29889,
4882,
29889,
23147,
353,
830,
1658,
29898,
401,
29922,
2704,
29889,
401,
29892,
2643,
29922,
2704,
29889,
4906,
29897,
13,
18884,
9867,
29889,
4882,
29889,
3859,
353,
3561,
1949,
6821,
5402,
2792,
29889,
4519,
29902,
20566,
13,
13,
18884,
7272,
1583,
29889,
3150,
1429,
29918,
2754,
29889,
5504,
29918,
11082,
1949,
29918,
19594,
29918,
4882,
29898,
13,
462,
1678,
7397,
29922,
19594,
29889,
19635,
29889,
22377,
29892,
13,
462,
1678,
1024,
29922,
19594,
29889,
19635,
29889,
978,
29892,
13,
462,
1678,
3573,
29922,
19594,
29892,
13,
18884,
1723,
13,
9651,
7146,
29901,
13,
18884,
7272,
1583,
29889,
11082,
1949,
29918,
9990,
29889,
15091,
29898,
1989,
29897,
13,
13,
9651,
565,
1065,
29918,
10646,
29901,
13,
18884,
2867,
13,
13,
1678,
7465,
822,
413,
17547,
29918,
6214,
29918,
13556,
2347,
29898,
1311,
29892,
623,
1125,
13,
4706,
9995,
7032,
263,
476,
17547,
8427,
29901,
20410,
278,
8427,
373,
263,
476,
17547,
13,
4706,
9867,
322,
14511,
403,
967,
620,
26902,
19478,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
278,
8427,
304,
1889,
29889,
13,
13,
4706,
9995,
13,
4706,
396,
14402,
29901,
382,
4387,
403,
805,
1450,
1076,
263,
716,
9867,
13,
4706,
7272,
1583,
29889,
816,
11272,
29918,
29895,
17547,
29918,
6214,
29898,
932,
29897,
13,
4706,
7272,
1583,
29889,
690,
305,
11272,
29918,
29895,
17547,
29918,
6214,
29898,
932,
29897,
13,
13,
1678,
7465,
822,
20410,
29918,
29895,
17547,
29918,
6214,
29898,
1311,
29892,
623,
1125,
13,
4706,
9995,
15954,
852,
263,
13907,
476,
17547,
9867,
363,
278,
2183,
8427,
322,
3216,
963,
13,
4706,
4208,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
278,
8427,
393,
4225,
304,
367,
13,
18884,
21467,
304,
263,
2233,
5402,
29889,
13,
13,
4706,
9995,
13,
4706,
17927,
29889,
3888,
703,
4504,
11272,
1273,
29878,
613,
623,
29897,
13,
13,
4706,
565,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
322,
451,
623,
29889,
6550,
29889,
13646,
29879,
29889,
29885,
16783,
29901,
13,
9651,
17927,
29889,
8382,
29898,
13,
18884,
376,
3664,
9725,
1218,
1273,
29878,
29892,
1951,
20332,
310,
278,
2280,
338,
12708,
19602,
623,
13,
9651,
1723,
13,
9651,
736,
13,
13,
4706,
24554,
353,
7272,
1583,
29889,
29895,
17547,
29918,
2754,
29889,
1761,
29918,
497,
29918,
695,
504,
414,
580,
13,
4706,
9867,
353,
7272,
1583,
29889,
2622,
29918,
29895,
17547,
29918,
19594,
29898,
932,
29892,
24554,
29889,
7076,
29897,
13,
13,
4706,
21467,
29918,
517,
353,
6503,
29918,
999,
29898,
19594,
29897,
13,
13,
4706,
396,
5399,
565,
278,
28598,
19478,
10608,
3939,
13,
4706,
565,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
1275,
21467,
29918,
517,
29901,
13,
9651,
17927,
29889,
8382,
703,
3782,
1735,
363,
1273,
29878,
613,
623,
29897,
13,
13,
9651,
396,
450,
14334,
338,
4784,
8763,
1363,
278,
476,
17547,
2956,
338,
13,
9651,
396,
10534,
363,
278,
1102,
14952,
304,
2125,
263,
10608,
1434,
11415,
278,
2767,
373,
13,
9651,
396,
385,
8427,
29889,
2648,
13271,
445,
29892,
278,
476,
17547,
2956,
508,
1369,
13,
9651,
396,
1985,
373,
278,
1857,
8427,
29889,
13,
9651,
396,
2398,
29892,
565,
694,
2767,
756,
1063,
8560,
373,
278,
8427,
29892,
769,
278,
13,
9651,
396,
9120,
14334,
338,
5224,
29889,
1094,
591,
526,
297,
278,
1206,
310,
694,
1735,
297,
278,
13,
9651,
396,
28598,
19478,
10608,
29892,
727,
338,
694,
817,
304,
505,
278,
476,
17547,
2956,
13,
9651,
396,
9068,
278,
8427,
29889,
5020,
26747,
278,
14334,
723,
3763,
7135,
13,
9651,
396,
263,
9068,
310,
278,
8427,
491,
278,
476,
17547,
2956,
29892,
607,
723,
13,
9651,
396,
451,
1207,
278,
4701,
2189,
738,
3158,
29889,
13,
9651,
565,
623,
29889,
19635,
29889,
1545,
2164,
1405,
623,
29889,
4882,
29889,
29895,
4003,
29918,
8299,
29918,
21001,
287,
29901,
13,
18884,
623,
29889,
4882,
29889,
29895,
4003,
29918,
8299,
29918,
21001,
287,
353,
3667,
29879,
29889,
3707,
580,
13,
18884,
7272,
1583,
29889,
29895,
17547,
29918,
2754,
29889,
5504,
29918,
6214,
29918,
4882,
29898,
13,
462,
1678,
7397,
29922,
932,
29889,
19635,
29889,
22377,
29892,
1024,
29922,
932,
29889,
19635,
29889,
978,
29892,
3573,
29922,
932,
13,
18884,
1723,
13,
9651,
736,
13,
13,
4706,
565,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
29901,
13,
9651,
17927,
29889,
3888,
29898,
13,
18884,
376,
29924,
4481,
403,
1273,
29878,
515,
1273,
29879,
304,
1273,
29879,
613,
623,
29892,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
29892,
21467,
29918,
517,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
17927,
29889,
3888,
703,
4504,
14989,
1273,
29878,
304,
1273,
29878,
613,
623,
29892,
9867,
29897,
13,
4706,
7272,
1583,
29889,
29895,
17547,
29918,
2754,
29889,
5504,
29918,
6214,
29918,
19672,
29898,
13,
9651,
7397,
29922,
932,
29889,
19635,
29889,
22377,
29892,
13,
9651,
1024,
29922,
932,
29889,
19635,
29889,
978,
29892,
13,
9651,
3573,
29922,
6821,
5402,
9270,
29898,
19594,
29922,
816,
14989,
29918,
517,
511,
13,
4706,
1723,
13,
13,
1678,
7465,
822,
20410,
29918,
11082,
1949,
29918,
19594,
29898,
1311,
29892,
9867,
1125,
13,
4706,
9995,
15954,
852,
263,
13907,
4673,
7264,
8010,
363,
278,
2183,
3561,
1949,
6821,
5402,
322,
3216,
13,
4706,
963,
4208,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
9867,
313,
29895,
336,
446,
29889,
1272,
29889,
3150,
1429,
29889,
19095,
1949,
6821,
5402,
1125,
278,
3561,
1949,
6821,
5402,
393,
4225,
13,
18884,
304,
367,
21467,
304,
263,
8010,
29889,
13,
4706,
9995,
13,
4706,
4974,
9867,
29889,
4882,
29889,
4836,
338,
6213,
29892,
376,
19095,
1949,
9867,
338,
2307,
3216,
29908,
13,
13,
4706,
17927,
29889,
3888,
703,
4504,
11272,
1273,
29878,
613,
9867,
29897,
13,
13,
4706,
9279,
353,
7272,
1583,
29889,
3150,
1429,
29918,
2754,
29889,
1761,
29918,
497,
29918,
16418,
580,
13,
4706,
2060,
353,
7272,
1583,
29889,
2622,
29918,
3150,
1429,
29918,
4836,
29898,
19594,
29892,
9279,
29889,
7076,
29897,
13,
13,
4706,
565,
2060,
338,
6213,
29901,
13,
9651,
17927,
29889,
3888,
703,
3782,
9686,
4673,
7264,
2060,
1476,
363,
1273,
29878,
613,
9867,
29897,
13,
9651,
12020,
1939,
7653,
9692,
703,
3782,
9686,
4673,
7264,
2060,
1476,
1159,
13,
13,
4706,
396,
14402,
29901,
8669,
310,
17596,
11073,
322,
21556,
29892,
28559,
278,
1364,
14952,
13,
4706,
396,
259,
304,
2304,
1301,
3321,
11073,
322,
21556,
29889,
13,
4706,
9867,
29889,
19635,
29889,
21134,
353,
426,
1068,
4836,
29889,
19635,
29889,
21134,
29892,
3579,
19594,
29889,
19635,
29889,
21134,
29913,
13,
13,
4706,
396,
960,
263,
12714,
411,
278,
1021,
1024,
338,
2307,
6790,
297,
278,
3561,
1949,
13,
4706,
396,
9867,
1580,
29892,
445,
4893,
9399,
663,
29889,
13,
4706,
12714,
29918,
7039,
353,
731,
29898,
16414,
29889,
978,
363,
12714,
297,
9867,
29889,
6550,
29889,
2527,
10817,
29897,
13,
4706,
363,
12714,
297,
2060,
29889,
6550,
29889,
2527,
10817,
29901,
13,
9651,
565,
12714,
29889,
978,
451,
297,
12714,
29918,
7039,
29901,
13,
18884,
9867,
29889,
6550,
29889,
2527,
10817,
29889,
4397,
29898,
16414,
29897,
13,
13,
4706,
7272,
1583,
29889,
3150,
1429,
29918,
2754,
29889,
5504,
29918,
11082,
1949,
29918,
19594,
29898,
13,
9651,
7397,
29922,
19594,
29889,
19635,
29889,
22377,
29892,
13,
9651,
1024,
29922,
19594,
29889,
19635,
29889,
978,
29892,
13,
9651,
3573,
29922,
19594,
29892,
13,
4706,
1723,
13,
13,
4706,
396,
14402,
29901,
1128,
304,
2304,
322,
7252,
1422,
9867,
17475,
29973,
13,
4706,
17927,
29889,
3888,
703,
4504,
14989,
1273,
29878,
304,
1273,
29878,
613,
9867,
29892,
2060,
29897,
13,
4706,
7272,
1583,
29889,
3150,
1429,
29918,
2754,
29889,
5504,
29918,
11082,
1949,
29918,
19594,
29918,
19672,
29898,
13,
9651,
7397,
29922,
19594,
29889,
19635,
29889,
22377,
29892,
13,
9651,
1024,
29922,
19594,
29889,
19635,
29889,
978,
29892,
13,
9651,
3573,
29922,
19095,
1949,
6821,
5402,
9270,
29898,
13,
18884,
2060,
29922,
10314,
29918,
999,
29898,
4836,
511,
4472,
29922,
4836,
29889,
6550,
29889,
6886,
13,
9651,
10353,
13,
4706,
1723,
13,
13,
1678,
7465,
822,
620,
305,
11272,
29918,
29895,
17547,
29918,
6214,
29898,
1311,
29892,
623,
1125,
13,
4706,
9995,
29923,
1983,
545,
393,
278,
2183,
8427,
674,
748,
1549,
278,
28598,
19478,
1889,
13,
4706,
1156,
263,
3058,
7292,
29889,
910,
6511,
385,
8427,
304,
367,
620,
305,
14989,
304,
263,
13,
4706,
901,
13907,
2233,
5402,
565,
263,
2253,
697,
338,
1476,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
278,
8427,
304,
620,
305,
11272,
29889,
13,
13,
4706,
9995,
13,
4706,
565,
451,
623,
29889,
6550,
29889,
13646,
29879,
29889,
29885,
16783,
29901,
13,
9651,
17927,
29889,
8382,
29898,
13,
18884,
376,
3664,
620,
26902,
19478,
1273,
29878,
29892,
1951,
20332,
310,
278,
2280,
338,
12708,
19602,
13,
18884,
623,
29892,
13,
9651,
1723,
13,
9651,
736,
13,
13,
4706,
396,
12065,
278,
2280,
964,
278,
664,
9521,
411,
263,
3058,
9055,
29889,
910,
13,
4706,
396,
5662,
1973,
278,
620,
26902,
19478,
310,
278,
2280,
29889,
9333,
1925,
372,
565,
727,
338,
13,
4706,
396,
451,
2307,
1790,
1873,
310,
278,
6503,
297,
278,
9521,
29889,
910,
1423,
13,
4706,
396,
338,
4312,
304,
9801,
393,
591,
437,
451,
26556,
2106,
3620,
411,
278,
13,
4706,
396,
1857,
697,
607,
1795,
367,
714,
9715,
29889,
13,
4706,
565,
623,
29889,
19635,
29889,
5416,
451,
297,
1583,
29889,
9990,
29889,
3972,
1017,
29901,
13,
9651,
17927,
29889,
8382,
703,
1666,
305,
11272,
1273,
29878,
297,
1273,
29879,
409,
2395,
613,
623,
29892,
1583,
29889,
690,
305,
11272,
29918,
7045,
29897,
13,
9651,
7272,
1583,
29889,
9990,
29889,
649,
29898,
932,
29889,
19635,
29889,
5416,
29892,
623,
29892,
9055,
29922,
1311,
29889,
690,
305,
11272,
29918,
7045,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1831,
29918,
27525,
398,
29898,
10003,
287,
1125,
13,
4706,
9995,
4591,
263,
1051,
310,
2233,
5402,
29934,
804,
29892,
679,
278,
697,
411,
278,
1900,
7115,
29889,
960,
3196,
13,
4706,
2233,
5402,
29934,
804,
505,
278,
1021,
7115,
29892,
697,
310,
963,
338,
10434,
20459,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
26642,
313,
1293,
29961,
6821,
5402,
29934,
804,
29962,
1125,
278,
1900,
7115,
674,
367,
4586,
515,
445,
1051,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
2233,
5402,
29934,
804,
29901,
385,
1543,
310,
278,
2183,
1051,
411,
278,
7472,
7115,
29889,
13,
13,
4706,
9995,
13,
4706,
396,
10987,
599,
5256,
29874,
13,
4706,
1900,
353,
4236,
29898,
10003,
287,
29897,
13,
4706,
7472,
353,
518,
10003,
363,
7115,
297,
26642,
565,
7115,
1275,
1900,
29962,
13,
13,
4706,
396,
7605,
20459,
1546,
1900,
9279,
13,
4706,
736,
4036,
29889,
16957,
29898,
27525,
398,
29897,
13,
13,
1678,
7465,
822,
1831,
29918,
29895,
17547,
29918,
19594,
29898,
1311,
29892,
623,
29892,
24554,
1125,
13,
4706,
9995,
3549,
13907,
413,
17547,
9867,
363,
2280,
9956,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
8427,
1203,
363,
9956,
13,
9651,
24554,
313,
1761,
29961,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
6821,
5402,
29962,
1125,
2233,
504,
414,
1546,
607,
13,
18884,
278,
376,
13318,
29908,
697,
881,
367,
10434,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
2233,
5402,
29901,
2233,
5402,
13907,
363,
2280,
9956,
13,
13,
4706,
9995,
13,
4706,
396,
830,
622,
24554,
10902,
408,
11132,
13,
4706,
24554,
353,
313,
19594,
363,
9867,
297,
24554,
565,
9867,
29889,
19635,
29889,
311,
22742,
338,
6213,
29897,
13,
4706,
9686,
353,
518,
13,
9651,
9867,
363,
9867,
297,
24554,
565,
1993,
29918,
19594,
29918,
13646,
29879,
29898,
932,
29892,
9867,
29897,
13,
4706,
4514,
13,
13,
4706,
565,
451,
9686,
29901,
13,
9651,
17927,
29889,
3888,
703,
3782,
9686,
476,
17547,
9867,
363,
1273,
29878,
1476,
613,
623,
29897,
13,
9651,
12020,
1939,
6821,
5402,
9692,
703,
3782,
9686,
476,
17547,
9867,
1476,
1159,
13,
13,
4706,
396,
960,
278,
2280,
2307,
756,
1063,
21467,
372,
1795,
367,
393,
372,
13,
4706,
396,
471,
1407,
10325,
29889,
512,
2114,
29892,
1951,
278,
4701,
7657,
29879,
304,
599,
11217,
13,
4706,
396,
310,
278,
2280,
29892,
372,
1795,
1407,
1532,
367,
393,
278,
3517,
28598,
19478,
13,
4706,
396,
3614,
2058,
1407,
10325,
29889,
1152,
1342,
29892,
278,
413,
17547,
4701,
11217,
13,
4706,
396,
278,
623,
297,
19848,
304,
278,
1364,
14952,
29915,
29879,
28598,
19478,
29892,
297,
607,
1206,
13,
4706,
396,
278,
1364,
14952,
674,
1018,
322,
1831,
278,
1900,
9867,
3447,
1449,
29889,
13,
4706,
396,
7857,
591,
505,
304,
1207,
1854,
278,
3517,
28598,
19478,
471,
451,
2086,
7786,
29889,
13,
4706,
396,
960,
372,
471,
29892,
591,
864,
304,
7952,
472,
278,
1857,
9867,
448,
565,
372,
338,
1603,
9686,
29889,
13,
4706,
396,
450,
2038,
24481,
338,
884,
1565,
297,
278,
1206,
746,
278,
1404,
756,
8560,
385,
13,
4706,
396,
2767,
310,
278,
2280,
29915,
29879,
9867,
3858,
11938,
29889,
3115,
297,
445,
1206,
29892,
278,
13,
4706,
396,
2767,
881,
451,
4556,
263,
20332,
565,
525,
932,
471,
421,
276,
1760,
368,
21467,
20497,
13,
4706,
396,
322,
525,
3784,
9867,
338,
1603,
9686,
4286,
960,
278,
623,
471,
10325,
21467,
13,
4706,
396,
541,
278,
2767,
8581,
278,
1857,
9867,
304,
694,
5520,
367,
9686,
29892,
591,
13,
4706,
396,
674,
620,
305,
11272,
29892,
1951,
421,
3784,
29952,
674,
4953,
6213,
2400,
29889,
13,
4706,
396,
960,
525,
932,
471,
6058,
421,
276,
1760,
368,
21467,
20497,
322,
525,
3784,
9867,
338,
1603,
9686,
742,
13,
4706,
396,
591,
1795,
620,
305,
11272,
29892,
321,
29889,
29887,
1696,
2861,
304,
6480,
21556,
29889,
13,
4706,
565,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
29901,
13,
9651,
396,
679,
1857,
9867,
408,
937,
9867,
297,
9686,
304,
607,
623,
338,
21467,
13,
9651,
1857,
353,
2446,
29898,
13,
18884,
313,
29883,
363,
274,
297,
9686,
565,
6503,
29918,
999,
29898,
29883,
29897,
1275,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
511,
13,
18884,
6213,
29892,
13,
9651,
1723,
13,
9651,
396,
565,
1857,
9867,
338,
1603,
9686,
13,
9651,
565,
1857,
29901,
13,
18884,
396,
1334,
1423,
920,
1472,
8020,
278,
3517,
28598,
19478,
3614,
2058,
29889,
13,
18884,
396,
960,
372,
338,
3109,
1135,
620,
305,
11272,
29918,
7045,
6923,
8020,
29892,
591,
437,
451,
13,
18884,
396,
620,
305,
11272,
29889,
1334,
671,
620,
305,
11272,
29918,
7045,
363,
445,
10230,
29892,
13,
18884,
396,
1951,
372,
14088,
920,
4049,
372,
338,
7429,
393,
385,
2280,
13,
18884,
396,
881,
367,
620,
305,
14989,
746,
263,
901,
8210,
9867,
4864,
29889,
13,
18884,
931,
29918,
16076,
29918,
816,
14989,
29918,
517,
29918,
3784,
353,
3667,
29879,
29889,
3707,
580,
448,
623,
29889,
4882,
29889,
816,
14989,
13,
18884,
623,
29918,
276,
1760,
368,
29918,
816,
14989,
353,
931,
29918,
16076,
29918,
816,
14989,
29918,
517,
29918,
3784,
529,
5335,
287,
2554,
29898,
13,
462,
1678,
6923,
29922,
1311,
29889,
690,
305,
11272,
29918,
7045,
13,
18884,
1723,
13,
18884,
565,
623,
29918,
276,
1760,
368,
29918,
816,
14989,
29901,
13,
462,
1678,
736,
1857,
13,
13,
4706,
396,
3455,
654,
1051,
565,
9686,
24554,
964,
263,
1051,
565,
24554,
411,
13,
4706,
396,
21556,
322,
1728,
21556,
29889,
2233,
504,
414,
411,
21556,
526,
16389,
13,
4706,
396,
975,
24554,
1728,
21556,
29889,
13,
4706,
411,
29918,
2527,
10817,
353,
518,
19594,
363,
9867,
297,
9686,
565,
9867,
29889,
6550,
29889,
2527,
10817,
29962,
13,
13,
4706,
396,
9333,
671,
24554,
1728,
21556,
746,
727,
526,
694,
24554,
411,
13,
4706,
396,
21556,
29889,
13,
4706,
19435,
353,
5159,
13,
4706,
565,
411,
29918,
2527,
10817,
29901,
13,
9651,
396,
11796,
29872,
278,
8158,
310,
599,
24554,
2729,
373,
1009,
12714,
13,
9651,
19435,
353,
7272,
1583,
29889,
10003,
29918,
29895,
17547,
29918,
695,
504,
414,
29898,
932,
29892,
411,
29918,
2527,
10817,
29897,
13,
13,
4706,
565,
451,
19435,
29901,
13,
9651,
396,
960,
694,
8158,
310,
9867,
411,
21556,
1033,
367,
15712,
313,
29872,
29889,
29887,
29889,
2861,
304,
13,
9651,
396,
443,
276,
496,
519,
21556,
1326,
11376,
511,
10272,
278,
8158,
310,
278,
9686,
24554,
13,
9651,
396,
393,
437,
451,
505,
21556,
29889,
13,
9651,
19435,
353,
518,
13,
18884,
1583,
29889,
15807,
403,
29918,
29895,
17547,
29918,
19594,
29918,
13628,
29898,
3285,
9867,
29892,
623,
29897,
13,
18884,
363,
9867,
297,
9686,
13,
9651,
4514,
13,
13,
4706,
736,
1583,
29889,
2622,
29918,
27525,
398,
29898,
1557,
2361,
467,
19594,
13,
13,
1678,
7465,
822,
1831,
29918,
3150,
1429,
29918,
4836,
29898,
1311,
29892,
9867,
29892,
9279,
1125,
13,
4706,
9995,
3549,
376,
13318,
29908,
4673,
7264,
2060,
363,
278,
3561,
1949,
9867,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
9867,
313,
29895,
336,
446,
29889,
1272,
29889,
3150,
1429,
29889,
19095,
1949,
6821,
5402,
1125,
2233,
5402,
393,
881,
13,
18884,
367,
3216,
304,
263,
2060,
13,
9651,
9279,
313,
1761,
29961,
29895,
336,
446,
29889,
1272,
29889,
3150,
1429,
29889,
7653,
29962,
1125,
8010,
29879,
1546,
278,
13,
18884,
376,
13318,
29908,
697,
338,
10434,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
18858,
446,
29889,
1272,
29889,
3150,
1429,
29889,
7653,
29892,
6213,
29901,
6407,
2060,
9686,
278,
13,
9651,
11938,
310,
278,
3561,
1949,
9867,
29889,
6213,
565,
694,
2060,
508,
367,
1476,
29889,
13,
13,
4706,
9995,
13,
4706,
396,
830,
622,
9279,
10902,
408,
11132,
13,
4706,
9279,
353,
313,
4836,
363,
2060,
297,
9279,
565,
2060,
29889,
19635,
29889,
311,
22742,
338,
6213,
29897,
13,
4706,
9686,
353,
518,
13,
9651,
2060,
13,
9651,
363,
2060,
297,
9279,
13,
9651,
565,
1993,
29918,
4836,
29918,
13646,
29879,
29898,
19594,
29892,
2060,
29897,
13,
4706,
4514,
13,
13,
4706,
565,
451,
9686,
29901,
13,
9651,
17927,
29889,
3888,
703,
3782,
9686,
4673,
7264,
2060,
1476,
363,
1273,
29878,
613,
9867,
29897,
13,
9651,
12020,
1939,
7653,
9692,
703,
3782,
9686,
4673,
7264,
2060,
1476,
1159,
13,
13,
4706,
396,
19916,
9279,
411,
21556,
607,
526,
16389,
975,
9279,
13,
4706,
396,
1728,
21556,
29889,
13,
4706,
411,
29918,
2527,
10817,
353,
518,
4836,
363,
2060,
297,
9686,
565,
2060,
29889,
6550,
29889,
2527,
10817,
29962,
13,
13,
4706,
396,
9333,
671,
9279,
1728,
21556,
746,
727,
526,
694,
9279,
411,
13,
4706,
396,
21556,
29889,
13,
4706,
565,
451,
411,
29918,
2527,
10817,
29901,
13,
9651,
19435,
353,
518,
13,
18884,
1583,
29889,
15807,
403,
29918,
3150,
1429,
29918,
4836,
29918,
1557,
2361,
29898,
3285,
2060,
29897,
13,
18884,
363,
2060,
297,
9686,
13,
9651,
4514,
13,
4706,
1683,
29901,
13,
9651,
396,
11796,
29872,
278,
8158,
310,
599,
9279,
2729,
373,
1009,
12714,
13,
9651,
19435,
353,
7272,
1583,
29889,
10003,
29918,
3150,
1429,
29918,
16418,
29898,
19594,
29892,
411,
29918,
2527,
10817,
29897,
13,
13,
4706,
565,
451,
19435,
29901,
13,
9651,
17927,
29889,
3888,
703,
2525,
519,
304,
10272,
278,
8158,
310,
738,
476,
17547,
9867,
1159,
13,
9651,
12020,
1939,
7653,
9692,
703,
3782,
4673,
7264,
2060,
3625,
1159,
13,
13,
4706,
736,
1583,
29889,
2622,
29918,
27525,
398,
29898,
1557,
2361,
467,
4836,
13,
13,
1678,
7465,
822,
7115,
29918,
29895,
17547,
29918,
695,
504,
414,
29898,
1311,
29892,
623,
29892,
24554,
1125,
13,
4706,
9995,
20606,
29872,
278,
8158,
310,
278,
413,
17547,
24554,
2729,
373,
21556,
1819,
322,
13,
4706,
18177,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
8427,
1203,
363,
9956,
13,
9651,
24554,
313,
1761,
29961,
6821,
5402,
29962,
1125,
2391,
310,
24554,
363,
607,
278,
8158,
756,
304,
367,
13,
18884,
15712,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
1051,
29961,
6821,
5402,
20097,
5387,
1051,
310,
599,
9867,
29915,
29879,
8158,
13,
13,
4706,
9995,
13,
4706,
736,
518,
13,
9651,
1583,
29889,
15807,
403,
29918,
29895,
17547,
29918,
19594,
29918,
13628,
29898,
2527,
10817,
29892,
9867,
29892,
623,
29897,
13,
9651,
363,
9867,
297,
24554,
13,
9651,
7465,
363,
21556,
297,
1583,
29889,
9155,
29918,
2527,
10817,
29898,
19594,
29892,
9867,
29889,
6550,
29889,
2527,
10817,
29897,
13,
4706,
4514,
13,
13,
1678,
7465,
822,
7115,
29918,
3150,
1429,
29918,
16418,
29898,
1311,
29892,
9867,
29892,
9279,
1125,
13,
4706,
9995,
20606,
29872,
278,
8158,
310,
278,
4673,
7264,
9279,
2729,
373,
12714,
1819,
322,
13,
4706,
18177,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
9867,
313,
29895,
336,
446,
29889,
1272,
29889,
3150,
1429,
29889,
19095,
1949,
6821,
5402,
1125,
2233,
5402,
393,
338,
21467,
13,
9651,
9279,
313,
1761,
29961,
7653,
29962,
1125,
2391,
310,
9279,
363,
607,
278,
8158,
756,
304,
367,
13,
18884,
15712,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
1051,
29961,
7653,
20097,
5387,
1051,
310,
599,
9867,
29915,
29879,
8158,
13,
4706,
9995,
13,
4706,
736,
518,
13,
9651,
1583,
29889,
15807,
403,
29918,
3150,
1429,
29918,
4836,
29918,
1557,
2361,
29898,
2527,
10817,
29892,
2060,
29897,
13,
9651,
363,
2060,
297,
9279,
13,
9651,
7465,
363,
21556,
297,
1583,
29889,
9155,
29918,
2527,
10817,
29898,
4836,
29892,
2060,
29889,
6550,
29889,
2527,
10817,
29897,
13,
4706,
4514,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
21556,
29918,
23147,
29918,
3166,
29918,
3127,
29898,
2704,
1125,
13,
4706,
9995,
18455,
385,
1059,
408,
3682,
964,
385,
2777,
310,
584,
1990,
18078,
1123,
1658,
1412,
3115,
13,
4706,
16785,
385,
8210,
2643,
565,
5181,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
1059,
313,
2451,
1125,
1059,
393,
10761,
607,
756,
304,
367,
11543,
964,
263,
13,
18884,
2769,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
830,
1658,
29901,
2769,
5759,
515,
278,
4944,
1059,
29889,
13,
13,
4706,
9995,
13,
4706,
2643,
353,
6213,
13,
4706,
565,
338,
8758,
29898,
2704,
29892,
4737,
10817,
6980,
2392,
1125,
13,
9651,
2769,
29918,
401,
353,
830,
1658,
3399,
29889,
3904,
1525,
2477,
29950,
6181,
29918,
2303,
5659,
2965,
29903,
29918,
8618,
13044,
1001,
13,
4706,
25342,
338,
8758,
29898,
2704,
29892,
4737,
2200,
2392,
1125,
13,
9651,
2769,
29918,
401,
353,
830,
1658,
3399,
29889,
1177,
26707,
29918,
2303,
5659,
2965,
13,
4706,
25342,
338,
8758,
29898,
2704,
29892,
12477,
2392,
1125,
13,
9651,
6503,
29918,
978,
353,
1059,
29889,
3827,
29918,
3888,
29889,
2271,
29889,
2084,
29889,
5451,
11974,
1159,
14352,
29896,
29962,
13,
9651,
565,
376,
2527,
10817,
18121,
29908,
297,
1059,
29889,
3827,
29918,
3888,
29889,
2271,
29889,
2084,
29901,
13,
18884,
2769,
29918,
401,
353,
830,
1658,
3399,
29889,
3904,
29968,
6632,
16048,
29918,
2303,
5659,
2965,
29903,
29918,
8618,
13044,
1001,
13,
18884,
2643,
353,
313,
13,
462,
1678,
285,
29908,
1576,
21556,
13113,
426,
10314,
29918,
978,
29991,
29878,
29913,
471,
451,
1476,
297,
278,
19387,
446,
29908,
13,
462,
1678,
285,
29908,
2566,
1213,
13,
18884,
1723,
13,
9651,
1683,
29901,
13,
18884,
2769,
29918,
401,
353,
830,
1658,
3399,
29889,
3904,
29968,
6632,
16048,
29918,
2303,
5659,
2965,
13,
18884,
2643,
353,
313,
13,
462,
1678,
285,
29908,
1576,
12714,
426,
10314,
29918,
978,
29991,
29878,
29913,
471,
451,
1476,
297,
278,
19387,
446,
2566,
1213,
13,
18884,
1723,
13,
4706,
1683,
29901,
13,
9651,
12020,
1059,
13,
13,
4706,
2186,
29918,
4906,
353,
2643,
565,
2643,
1683,
851,
29898,
2704,
29897,
13,
4706,
736,
830,
1658,
29898,
401,
29922,
23147,
29918,
401,
29892,
2643,
29922,
8394,
29918,
4906,
29897,
13,
13,
1678,
7465,
822,
2767,
29918,
10314,
29918,
4882,
29898,
1311,
29892,
6503,
29892,
21556,
29892,
9590,
1125,
13,
4706,
9995,
6422,
278,
4660,
310,
278,
4944,
6503,
411,
278,
716,
1051,
310,
9590,
363,
13,
4706,
21556,
607,
5229,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
6503,
313,
29895,
336,
446,
29889,
1272,
29889,
15550,
13902,
29889,
11713,
2061,
1125,
278,
6503,
304,
4784,
29889,
13,
9651,
21556,
313,
1761,
29961,
29895,
336,
446,
29889,
1272,
29889,
3221,
29889,
10095,
2200,
5620,
29962,
1125,
278,
1051,
310,
21556,
363,
607,
278,
13,
18884,
1364,
14952,
16388,
304,
6699,
278,
1857,
995,
29889,
13,
9651,
9590,
313,
1761,
29961,
1123,
1658,
29962,
1125,
278,
1051,
310,
9590,
363,
278,
21556,
17581,
607,
13,
18884,
892,
1476,
29889,
1152,
1269,
12714,
297,
278,
584,
5552,
18078,
2527,
10817,
29952,
2980,
29892,
727,
13,
18884,
881,
367,
697,
1543,
297,
445,
2980,
29901,
278,
2769,
363,
278,
12714,
13,
18884,
17581,
29892,
470,
6213,
565,
372,
1258,
451,
4418,
29889,
13,
13,
4706,
9995,
13,
4706,
4974,
7431,
29898,
2527,
10817,
29897,
1275,
7431,
29898,
276,
7040,
29897,
13,
13,
4706,
565,
6503,
29889,
14380,
1275,
376,
6821,
5402,
1115,
13,
9651,
6503,
29889,
4882,
29889,
3859,
353,
2233,
5402,
2792,
29889,
4519,
6227,
4214,
29918,
2303,
5659,
2965,
29903,
13,
9651,
2767,
29918,
4882,
29918,
4645,
353,
1583,
29889,
29895,
17547,
29918,
2754,
29889,
5504,
29918,
19594,
29918,
4882,
13,
4706,
25342,
6503,
29889,
14380,
1275,
376,
7653,
1115,
13,
9651,
6503,
29889,
4882,
29889,
3859,
353,
8010,
2792,
29889,
4519,
6227,
4214,
29918,
2303,
5659,
2965,
29903,
13,
9651,
2767,
29918,
4882,
29918,
4645,
353,
1583,
29889,
3150,
1429,
29918,
2754,
29889,
5504,
29918,
4836,
29918,
4882,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
29898,
29888,
29908,
25807,
29884,
3016,
287,
2924,
29901,
426,
10314,
29889,
14380,
1836,
1159,
13,
13,
4706,
396,
3462,
304,
6503,
871,
565,
263,
10672,
10761,
29889,
13,
4706,
6503,
29889,
4882,
29889,
2527,
10817,
29918,
276,
7040,
353,
6571,
13,
4706,
363,
474,
29892,
2769,
297,
26985,
29898,
276,
7040,
1125,
13,
9651,
565,
2769,
29901,
13,
18884,
6503,
29889,
4882,
29889,
2527,
10817,
29918,
276,
7040,
29961,
2527,
10817,
29961,
29875,
1822,
978,
29962,
353,
2769,
13,
13,
4706,
7272,
2767,
29918,
4882,
29918,
4645,
29898,
13,
9651,
7397,
29922,
10314,
29889,
19635,
29889,
22377,
29892,
13,
9651,
1024,
29922,
10314,
29889,
19635,
29889,
978,
29892,
13,
9651,
3573,
29922,
10314,
29892,
13,
4706,
1723,
13,
13,
1678,
7465,
822,
6699,
29918,
2527,
10817,
29898,
1311,
29892,
6503,
29892,
21556,
1125,
13,
4706,
9995,
8123,
15299,
363,
6699,
292,
21556,
491,
278,
2183,
1051,
310,
12714,
13,
4706,
9282,
29889,
13,
13,
4706,
960,
263,
584,
1990,
18078,
10095,
2200,
2392,
29952,
470,
421,
4032,
2392,
29952,
10008,
29892,
278,
15299,
17726,
13,
4706,
607,
2794,
7788,
988,
385,
1059,
2645,
12714,
6699,
292,
10008,
508,
13,
4706,
367,
14993,
2986,
491,
29901,
13,
13,
4706,
6317,
775,
1057,
3017,
13,
13,
9651,
19435,
353,
518,
13,
18884,
1583,
29889,
15807,
403,
29918,
5431,
29918,
13628,
580,
13,
18884,
363,
7953,
297,
1701,
359,
13,
18884,
7465,
363,
21556,
297,
1583,
29889,
9155,
29918,
2527,
10817,
29898,
5431,
29892,
7953,
29889,
6550,
29889,
2527,
10817,
29897,
13,
9651,
4514,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
6503,
313,
29895,
336,
446,
29889,
1272,
29889,
15550,
13902,
29889,
11713,
2061,
1125,
3450,
6503,
304,
607,
13,
18884,
278,
21556,
6852,
29889,
13,
9651,
21556,
313,
1761,
29961,
29895,
336,
446,
29889,
1272,
29889,
3221,
29889,
10095,
2200,
5620,
29962,
1125,
28318,
304,
21556,
13,
18884,
393,
881,
367,
6699,
287,
29889,
13,
13,
4706,
612,
969,
29879,
29901,
13,
9651,
1051,
29961,
29895,
336,
446,
29889,
8299,
29889,
816,
14952,
29889,
2527,
10817,
29889,
3010,
3591,
5387,
2391,
310,
6699,
287,
13,
18884,
21556,
411,
1009,
995,
322,
7688,
29889,
13,
13,
4706,
9995,
13,
4706,
4974,
21556,
29892,
376,
29954,
327,
4069,
1051,
310,
12714,
9282,
29908,
13,
13,
4706,
4436,
353,
5159,
13,
4706,
9590,
353,
5159,
13,
4706,
6699,
292,
353,
5159,
13,
4706,
363,
12714,
29918,
6550,
297,
21556,
29901,
13,
9651,
1018,
29901,
13,
18884,
12714,
353,
7272,
1583,
29889,
3221,
29918,
2754,
29889,
949,
29918,
10945,
29918,
16414,
29898,
978,
29922,
16414,
29918,
6550,
29889,
978,
29897,
13,
18884,
21556,
29918,
18121,
353,
7272,
1583,
29889,
3221,
29918,
2754,
29889,
949,
29918,
10945,
29918,
2527,
10817,
29918,
18121,
29898,
13,
462,
1678,
1024,
29922,
16414,
29889,
6550,
29889,
18121,
29889,
978,
13,
18884,
1723,
13,
18884,
6699,
292,
29889,
4397,
29898,
13,
462,
1678,
6699,
29918,
1972,
29898,
13,
462,
4706,
1583,
29889,
4645,
29889,
7924,
29892,
13,
462,
4706,
12714,
29892,
13,
462,
4706,
21556,
29918,
18121,
29892,
13,
462,
4706,
12714,
29918,
6550,
29889,
7915,
29892,
13,
462,
1678,
1723,
13,
18884,
1723,
13,
18884,
9590,
29889,
4397,
29898,
8516,
29897,
29871,
396,
3462,
385,
4069,
12983,
746,
694,
1059,
10761,
29889,
13,
9651,
5174,
12477,
2392,
408,
4589,
29901,
13,
18884,
9590,
29889,
4397,
29898,
1311,
29889,
2527,
10817,
29918,
23147,
29918,
3166,
29918,
3127,
29898,
3127,
876,
13,
18884,
4436,
29889,
4397,
29898,
3127,
29897,
13,
13,
4706,
6699,
287,
353,
7272,
408,
948,
3934,
29889,
29887,
1624,
10456,
9155,
292,
29892,
736,
29918,
11739,
29879,
29922,
5574,
29897,
13,
13,
4706,
396,
14806,
278,
4436,
607,
10761,
746,
6699,
292,
278,
995,
310,
278,
9886,
13,
4706,
396,
21556,
964,
830,
1658,
8871,
29889,
13,
4706,
396,
1152,
445,
29892,
278,
2446,
27170,
310,
376,
8516,
29908,
2768,
278,
376,
276,
7040,
29908,
1051,
338,
1304,
29889,
13,
4706,
396,
7806,
697,
310,
445,
27170,
16161,
304,
263,
3414,
363,
6699,
292,
278,
12714,
29889,
1105,
13,
4706,
396,
565,
363,
1342,
278,
29871,
29941,
5499,
1543,
297,
376,
9155,
287,
29908,
338,
385,
1059,
29892,
278,
29871,
29941,
5499,
376,
8516,
29908,
297,
13,
4706,
396,
376,
276,
7040,
29908,
1818,
367,
8611,
29889,
13,
4706,
5642,
29918,
23147,
29918,
1524,
353,
313,
29875,
363,
474,
29892,
2769,
297,
26985,
29898,
276,
7040,
29897,
565,
2769,
338,
6213,
29897,
13,
4706,
363,
1121,
297,
6699,
287,
29901,
13,
9651,
396,
3617,
278,
2380,
310,
278,
2446,
376,
8516,
29908,
2768,
376,
276,
7040,
1642,
13,
9651,
2380,
29918,
974,
29918,
9290,
353,
2446,
29898,
9290,
29918,
23147,
29918,
1524,
29897,
13,
9651,
565,
338,
8758,
29898,
2914,
29892,
8960,
1125,
13,
18884,
9590,
29961,
2248,
29918,
974,
29918,
9290,
29962,
353,
1583,
29889,
2527,
10817,
29918,
23147,
29918,
3166,
29918,
3127,
29898,
2914,
29897,
13,
18884,
4436,
29889,
4397,
29898,
2914,
29897,
13,
13,
4706,
11084,
353,
7700,
13,
4706,
1018,
29901,
13,
9651,
2446,
29898,
9290,
29918,
23147,
29918,
1524,
29897,
13,
4706,
5174,
22303,
13463,
362,
29901,
13,
9651,
11084,
353,
5852,
13,
4706,
4974,
11084,
13,
13,
4706,
565,
738,
29898,
276,
7040,
1125,
13,
9651,
396,
960,
727,
338,
738,
2228,
411,
263,
12714,
29892,
14383,
5040,
278,
15299,
29889,
13,
9651,
7272,
1583,
29889,
5504,
29918,
10314,
29918,
4882,
29898,
10314,
29892,
21556,
29892,
9590,
29897,
13,
9651,
363,
1059,
297,
4436,
29901,
13,
18884,
565,
1059,
29901,
13,
462,
1678,
17927,
29889,
2704,
29898,
2704,
29897,
13,
9651,
736,
13,
13,
4706,
363,
12714,
29892,
7688,
29892,
995,
297,
6699,
287,
29901,
13,
9651,
17927,
29889,
8382,
29898,
13,
18884,
376,
29816,
12714,
1273,
29878,
411,
995,
1273,
29878,
363,
1273,
29878,
613,
12714,
29892,
995,
29892,
6503,
13,
9651,
1723,
13,
13,
4706,
7709,
6699,
287,
13,
13,
1678,
822,
8147,
29918,
29895,
17547,
29918,
19594,
29918,
13628,
29898,
1311,
29892,
21556,
29892,
9867,
29892,
623,
1125,
13,
4706,
9995,
27065,
403,
7688,
287,
2533,
310,
21556,
1819,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
21556,
313,
1761,
29961,
29889,
2527,
10817,
29889,
3010,
3591,
29962,
1125,
2391,
310,
12714,
2346,
2582,
13,
9651,
9867,
313,
6821,
5402,
1125,
9867,
363,
607,
278,
8158,
756,
304,
367,
15712,
29889,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
8427,
1203,
393,
13,
18884,
881,
367,
21467,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
2233,
5402,
20097,
29901,
8158,
310,
278,
4502,
9867,
2729,
373,
21556,
322,
2280,
29889,
13,
13,
4706,
9995,
13,
4706,
12070,
29891,
353,
1583,
29889,
15807,
403,
29918,
29895,
17547,
29918,
19594,
29918,
303,
860,
3335,
29898,
19594,
29892,
623,
29897,
13,
13,
4706,
565,
451,
21556,
29901,
13,
9651,
736,
2233,
5402,
20097,
29898,
13628,
29922,
303,
18219,
29889,
7915,
334,
12070,
29891,
29889,
1767,
29892,
9867,
29922,
19594,
29897,
13,
13,
4706,
6056,
353,
2533,
29898,
16414,
29889,
7915,
363,
12714,
297,
21556,
29897,
718,
12070,
29891,
29889,
7915,
13,
4706,
8158,
353,
313,
13,
9651,
2533,
29898,
16414,
29889,
1767,
334,
12714,
29889,
7915,
363,
12714,
297,
21556,
29897,
13,
9651,
718,
313,
303,
18219,
29889,
1767,
334,
12070,
29891,
29889,
7915,
29897,
13,
4706,
1723,
847,
6056,
13,
13,
4706,
736,
2233,
5402,
20097,
29898,
13628,
29922,
13628,
29892,
9867,
29922,
19594,
29897,
13,
13,
1678,
822,
8147,
29918,
29895,
17547,
29918,
19594,
29918,
303,
860,
3335,
29898,
1311,
29892,
9867,
29892,
623,
1125,
13,
4706,
9995,
11609,
4805,
12714,
363,
24554,
304,
1207,
278,
2280,
376,
303,
860,
29908,
304,
13,
4706,
372,
491,
10231,
967,
8158,
29889,
13,
13,
4706,
960,
278,
2280,
338,
2307,
21467,
304,
278,
4502,
9867,
29892,
263,
13,
4706,
12070,
3335,
310,
4954,
29896,
29889,
29900,
16159,
411,
263,
17127,
519,
7688,
338,
4133,
29889,
13,
4706,
13466,
29892,
263,
12070,
3335,
310,
4954,
29900,
16159,
338,
4133,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
9867,
313,
6821,
5402,
1125,
9867,
363,
607,
278,
8158,
756,
304,
367,
15712,
29889,
13,
9651,
623,
313,
29895,
336,
446,
29889,
1272,
29889,
29895,
17547,
29889,
4873,
1125,
8427,
1203,
393,
13,
18884,
881,
367,
21467,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
624,
860,
3335,
29901,
7865,
322,
967,
7688,
393,
881,
367,
2715,
304,
278,
13,
9651,
9867,
8158,
29889,
13,
13,
4706,
9995,
13,
4706,
565,
6503,
29918,
999,
29898,
19594,
29897,
2804,
623,
29889,
4882,
29889,
816,
14989,
29918,
517,
29901,
13,
9651,
736,
624,
860,
3335,
29898,
7915,
29922,
29900,
29892,
995,
29922,
29900,
29897,
13,
13,
4706,
736,
624,
860,
3335,
29898,
7915,
29922,
1311,
29889,
303,
860,
3335,
29892,
995,
29922,
29896,
29889,
29900,
29897,
13,
13,
1678,
822,
8147,
29918,
3150,
1429,
29918,
4836,
29918,
1557,
2361,
29898,
1311,
29892,
21556,
29892,
2060,
1125,
13,
4706,
9995,
27065,
403,
8158,
310,
4673,
7264,
2060,
2729,
373,
278,
2183,
21556,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
21556,
313,
1761,
29961,
29895,
336,
446,
29889,
8299,
29889,
816,
14952,
29889,
2527,
10817,
29889,
3010,
3591,
29962,
1125,
2391,
310,
13,
18884,
12714,
2346,
2582,
29889,
13,
9651,
2060,
313,
29895,
336,
446,
29889,
1272,
29889,
3150,
1429,
29889,
7653,
1125,
8010,
363,
607,
278,
8158,
756,
304,
13,
18884,
367,
15712,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
8010,
20097,
29901,
2522,
487,
310,
278,
4502,
2060,
2729,
373,
21556,
322,
3561,
1949,
13,
18884,
9867,
29889,
13,
13,
4706,
9995,
13,
4706,
396,
2522,
487,
363,
263,
4673,
7264,
2060,
1728,
738,
21556,
13,
4706,
565,
451,
21556,
29901,
13,
9651,
736,
8010,
20097,
29898,
13628,
29922,
29900,
29892,
2060,
29922,
4836,
29897,
13,
13,
4706,
6056,
353,
2533,
29898,
16414,
29889,
7915,
363,
12714,
297,
21556,
29897,
13,
4706,
8158,
353,
2533,
29898,
16414,
29889,
1767,
334,
12714,
29889,
7915,
363,
12714,
297,
21556,
29897,
847,
6056,
13,
13,
4706,
736,
8010,
20097,
29898,
13628,
29922,
13628,
29892,
2060,
29922,
4836,
29897,
13,
2
] |
Python/Python Automation/Python Automation/File Locker/password_manager.py | Yuo86653/File-Locker-made-with-python | 0 | 198831 | <reponame>Yuo86653/File-Locker-made-with-python<filename>Python/Python Automation/Python Automation/File Locker/password_manager.py
import sqlite3
from hashlib import sha256
ADMIN_PASSWORD = "<PASSWORD>"
connect = input("What is your password?\n")
while connect != ADMIN_PASSWORD:
connect = input("What is your password?\n")
if connect == "q":
break
conn = sqlite3.connect('pass_manager.db')
def create_password(pass_key, service, admin_pass):
return sha256(admin_pass.encode('utf-8') + service.lower().encode('utf-8') + pass_key.encode('utf-8')).hexdigest()[:15]
def get_hex_key(admin_pass, service):
return sha256(admin_pass.encode('utf-8') + service.lower().encode('utf-8')).hexdigest()
def get_password(admin_pass, service):
secret_key = get_hex_key(admin_pass, service)
cursor = conn.execute("SELECT * from KEYS WHERE PASS_KEY=" + '"' + secret_key + '"')
file_string = ""
for row in cursor:
file_string = row[0]
return create_password(file_string, service, admin_pass)
def add_password(service, admin_pass):
secret_key = get_hex_key(admin_pass, service)
command = 'INSERT INTO KEYS (PASS_KEY) VALUES (%s);' %('"' + secret_key +'"')
conn.execute(command)
conn.commit()
return create_password(secret_key, service, admin_pass)
if connect == ADMIN_PASSWORD:
try:
conn.execute('''CREATE TABLE KEYS
(PASS_KEY TEXT PRIMARY KEY NOT NULL);''')
print("Your safe has been created!\nWhat would you like to store in it today?")
except:
print("You have a safe, what would you like to do today?")
while True:
print("\n"+ "*"*15)
print("Commands:")
print("q = quit program")
print("gp = get password")
print("sp = store password")
print("*"*15)
input_ = input(":")
if input_ == "q":
break
if input_ == "sp":
service = input("What is the name of the service?\n")
print("\n" + service.capitalize() + " password created:\n" + add_password(service, ADMIN_PASSWORD))
if input_ == "gp":
service = input("What is the name of the service?\n")
print("\n" + service.capitalize() + " password:\n"+get_password(ADMIN_PASSWORD, service))
| [
1,
529,
276,
1112,
420,
29958,
29979,
25608,
29947,
29953,
29953,
29945,
29941,
29914,
2283,
29899,
29931,
8658,
29899,
26350,
29899,
2541,
29899,
4691,
29966,
9507,
29958,
11980,
29914,
11980,
15854,
362,
29914,
11980,
15854,
362,
29914,
2283,
365,
8658,
29914,
5630,
29918,
12847,
29889,
2272,
13,
13,
5215,
21120,
29941,
13,
3166,
6608,
1982,
1053,
528,
29874,
29906,
29945,
29953,
13,
13,
13,
3035,
16173,
29918,
25711,
17013,
353,
9872,
25711,
17013,
11903,
13,
13,
6915,
353,
1881,
703,
5618,
338,
596,
4800,
29973,
29905,
29876,
1159,
13,
13,
8000,
4511,
2804,
11033,
16173,
29918,
25711,
17013,
29901,
13,
1678,
4511,
353,
1881,
703,
5618,
338,
596,
4800,
29973,
29905,
29876,
1159,
13,
1678,
565,
4511,
1275,
376,
29939,
1115,
13,
4706,
2867,
13,
13,
13082,
353,
21120,
29941,
29889,
6915,
877,
3364,
29918,
12847,
29889,
2585,
1495,
13,
13,
1753,
1653,
29918,
5630,
29898,
3364,
29918,
1989,
29892,
2669,
29892,
4113,
29918,
3364,
1125,
13,
1678,
736,
528,
29874,
29906,
29945,
29953,
29898,
6406,
29918,
3364,
29889,
12508,
877,
9420,
29899,
29947,
1495,
718,
2669,
29889,
13609,
2141,
12508,
877,
9420,
29899,
29947,
1495,
718,
1209,
29918,
1989,
29889,
12508,
877,
9420,
29899,
29947,
1495,
467,
20970,
7501,
342,
580,
7503,
29896,
29945,
29962,
13,
13,
1753,
679,
29918,
20970,
29918,
1989,
29898,
6406,
29918,
3364,
29892,
2669,
1125,
13,
1678,
736,
528,
29874,
29906,
29945,
29953,
29898,
6406,
29918,
3364,
29889,
12508,
877,
9420,
29899,
29947,
1495,
718,
2669,
29889,
13609,
2141,
12508,
877,
9420,
29899,
29947,
1495,
467,
20970,
7501,
342,
580,
13,
13,
1753,
679,
29918,
5630,
29898,
6406,
29918,
3364,
29892,
2669,
1125,
13,
1678,
7035,
29918,
1989,
353,
679,
29918,
20970,
29918,
1989,
29898,
6406,
29918,
3364,
29892,
2669,
29897,
13,
1678,
10677,
353,
11009,
29889,
7978,
703,
6404,
334,
515,
14636,
29903,
5754,
17687,
1799,
29918,
10818,
543,
718,
18793,
29915,
718,
7035,
29918,
1989,
718,
18793,
1495,
13,
13,
1678,
934,
29918,
1807,
353,
5124,
13,
1678,
363,
1948,
297,
10677,
29901,
13,
4706,
934,
29918,
1807,
353,
1948,
29961,
29900,
29962,
13,
1678,
736,
1653,
29918,
5630,
29898,
1445,
29918,
1807,
29892,
2669,
29892,
4113,
29918,
3364,
29897,
13,
13,
1753,
788,
29918,
5630,
29898,
5509,
29892,
4113,
29918,
3364,
1125,
13,
1678,
7035,
29918,
1989,
353,
679,
29918,
20970,
29918,
1989,
29898,
6406,
29918,
3364,
29892,
2669,
29897,
13,
13,
1678,
1899,
353,
525,
19460,
11646,
14636,
29903,
313,
25711,
29918,
10818,
29897,
15673,
313,
29995,
29879,
416,
29915,
1273,
877,
29908,
29915,
718,
7035,
29918,
1989,
718,
11838,
1495,
308,
13,
1678,
11009,
29889,
7978,
29898,
6519,
29897,
13,
1678,
11009,
29889,
15060,
580,
13,
1678,
736,
1653,
29918,
5630,
29898,
19024,
29918,
1989,
29892,
2669,
29892,
4113,
29918,
3364,
29897,
13,
13,
361,
4511,
1275,
11033,
16173,
29918,
25711,
17013,
29901,
13,
1678,
1018,
29901,
13,
4706,
11009,
29889,
7978,
877,
4907,
27045,
10911,
14636,
29903,
13,
9651,
313,
25711,
29918,
10818,
323,
12194,
29778,
14636,
6058,
4265,
416,
4907,
1495,
13,
4706,
1596,
703,
10858,
9109,
756,
1063,
2825,
9903,
29876,
5618,
723,
366,
763,
304,
3787,
297,
372,
9826,
29973,
1159,
13,
1678,
5174,
29901,
13,
4706,
1596,
703,
3492,
505,
263,
9109,
29892,
825,
723,
366,
763,
304,
437,
9826,
29973,
1159,
13,
268,
13,
268,
13,
1678,
1550,
5852,
29901,
13,
4706,
1596,
14182,
29876,
17969,
376,
20605,
29930,
29896,
29945,
29897,
13,
4706,
1596,
703,
5261,
4167,
29901,
1159,
13,
4706,
1596,
703,
29939,
353,
23283,
1824,
1159,
13,
4706,
1596,
703,
29887,
29886,
353,
679,
4800,
1159,
13,
4706,
1596,
703,
1028,
353,
3787,
4800,
1159,
13,
4706,
1596,
703,
20605,
29930,
29896,
29945,
29897,
13,
4706,
1881,
29918,
353,
1881,
703,
29901,
1159,
13,
13,
4706,
565,
1881,
29918,
1275,
376,
29939,
1115,
13,
9651,
2867,
13,
4706,
565,
1881,
29918,
1275,
376,
1028,
1115,
13,
9651,
2669,
353,
1881,
703,
5618,
338,
278,
1024,
310,
278,
2669,
29973,
29905,
29876,
1159,
13,
9651,
1596,
14182,
29876,
29908,
718,
2669,
29889,
5030,
2410,
675,
580,
718,
376,
4800,
2825,
3583,
29876,
29908,
718,
788,
29918,
5630,
29898,
5509,
29892,
11033,
16173,
29918,
25711,
17013,
876,
13,
4706,
565,
1881,
29918,
1275,
376,
29887,
29886,
1115,
13,
9651,
2669,
353,
1881,
703,
5618,
338,
278,
1024,
310,
278,
2669,
29973,
29905,
29876,
1159,
13,
9651,
1596,
14182,
29876,
29908,
718,
2669,
29889,
5030,
2410,
675,
580,
718,
376,
4800,
3583,
29876,
17969,
657,
29918,
5630,
29898,
3035,
16173,
29918,
25711,
17013,
29892,
2669,
876,
13,
13,
13,
13,
2
] |
blox/modules/url.py | pollett/blox | 0 | 1602348 | <gh_stars>0
from blox.modules.module import module
from blox.exceptions import *
import urllib2,base64,logging
logger = logging.getLogger( 'blox.url' )
class url(module):
def input(self, params):
logger.debug('getting data from url: %s'%params['url'])
request = urllib2.Request( params['url'] )
if 'proxyname' in params:
proxy = urllib2.ProxyHandler({'http': params['proxyname'] })
opener = urllib2.build_opener( proxy )
urllib2.install_opener( opener )
if 'username' in params and 'password' in params:
base64auth = base64.encodestring('%s:%s' % ( params['username'], params['password'] )).replace('\n','')
request.add_header("Authorization", "Basic %s" % base64auth)
try:
result = urllib2.urlopen( request )
except urllib2.URLError:
raise ParseException( 'URL Error' )
return result.read().strip()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
6668,
29916,
29889,
7576,
29889,
5453,
1053,
3883,
13,
3166,
6668,
29916,
29889,
11739,
29879,
1053,
334,
13,
5215,
3142,
1982,
29906,
29892,
3188,
29953,
29946,
29892,
21027,
13,
21707,
353,
12183,
29889,
657,
16363,
29898,
525,
14073,
29916,
29889,
2271,
29915,
1723,
13,
13,
1990,
3142,
29898,
5453,
1125,
13,
29871,
822,
1881,
29898,
1311,
29892,
8636,
1125,
13,
1678,
17927,
29889,
8382,
877,
29264,
848,
515,
3142,
29901,
1273,
29879,
29915,
29995,
7529,
1839,
2271,
11287,
13,
1678,
2009,
353,
3142,
1982,
29906,
29889,
3089,
29898,
8636,
1839,
2271,
2033,
1723,
13,
13,
1678,
565,
525,
771,
29916,
948,
420,
29915,
297,
8636,
29901,
13,
418,
10166,
353,
3142,
1982,
29906,
29889,
14048,
4598,
3319,
29915,
1124,
2396,
8636,
1839,
771,
29916,
948,
420,
2033,
5615,
13,
418,
1015,
759,
353,
3142,
1982,
29906,
29889,
4282,
29918,
459,
759,
29898,
10166,
1723,
13,
418,
3142,
1982,
29906,
29889,
6252,
29918,
459,
759,
29898,
1015,
759,
1723,
13,
13,
1678,
565,
525,
6786,
29915,
297,
8636,
322,
525,
5630,
29915,
297,
8636,
29901,
13,
418,
2967,
29953,
29946,
5150,
353,
2967,
29953,
29946,
29889,
3977,
397,
342,
5393,
877,
29995,
29879,
16664,
29879,
29915,
1273,
313,
8636,
1839,
6786,
7464,
8636,
1839,
5630,
2033,
1723,
467,
6506,
28909,
29876,
3788,
1495,
13,
418,
2009,
29889,
1202,
29918,
6672,
703,
25471,
613,
376,
16616,
1273,
29879,
29908,
1273,
2967,
29953,
29946,
5150,
29897,
13,
1678,
1018,
29901,
13,
418,
1121,
353,
3142,
1982,
29906,
29889,
332,
417,
2238,
29898,
2009,
1723,
13,
1678,
5174,
3142,
1982,
29906,
29889,
4574,
1307,
24616,
29901,
13,
418,
12020,
20969,
2451,
29898,
525,
4219,
4829,
29915,
1723,
13,
1678,
736,
1121,
29889,
949,
2141,
17010,
580,
13,
2
] |
cellpy/utils/batch_tools/batch_analyzers.py | lithium-ion/cellpy | 1 | 102431 | import logging
import pandas as pd
from cellpy.utils.batch_tools.batch_core import BaseAnalyzer
from cellpy.utils.ocv_rlx import select_ocv_points
from cellpy.exceptions import UnderDefined
class ICAAnalyzer(BaseAnalyzer):
def __init__(self):
super().__init__()
class EISAnalyzer(BaseAnalyzer):
def __init__(self):
super().__init__()
class OCVRelaxationAnalyzer(BaseAnalyzer):
"""Analyze open curcuit relaxation curves.
This analyzer is still under development.
(Partly) implented so far: select_ocv_points -> farms.
To get the DataFrames from the farms, you can use
>>> ocv_point_frames = OCVRelaxationAnalyzer.last
Attributes (for select_ocv_points):
selection_method: criteria for selecting points
martin: select first and last, and then last/2, last/2/2 etc.
until you have reached the wanted number of points.
fixed_time: select first, and then
defaults to "martin"
number_of_points: number of points you want.
defaults to 5
interval: interval between each point (in use only for methods
where interval makes sense). If it is a list, then
number_of_points will be calculated as len(interval) + 1 (and
override the set number_of_points).
defaults to 10
relative_voltage: set to True if you would like the voltage to be
relative to the voltage before starting the ocv rlx step.
Defaults to False. Remark that for the initial rxl step (when
you just have put your cell on the tester) does not have any
prior voltage. The relative voltage will then be versus the
first measurement point.
defaults to False
report_times: also report the ocv rlx total time if True (defaults
to False)
direction ("up", "down" or "both"): select "up" if you would like
to process only the ocv rlx steps where the voltage is relaxing
upwards and vize versa. Defaults to "both
To-do:
- include better engine-dumper methodology and dump
stuff to both memory and file(s)
(should add this to BaseAnalyser)
- recieve settings and parameters
- option (dumper) for plotting?
- automatic fitting of OCV rlx data?
"""
def __init__(self):
super().__init__()
self.engines = []
self.dumpers = []
self.current_engine = None
self._assign_engine(self.ocv_points_engine)
# self._assign_dumper(self.screen_dumper)
# prms for select_ocv_points
self.selection_method = "martin"
self.number_of_points = 5
self.interval = 10
self.relative_voltage = False
self.report_times = False
self.direction = None
def _assign_engine(self, engine):
self.engines.append(engine)
def _assign_dumper(self, dumper):
self.dumpers.append(dumper)
def screen_dumper(self, **kwargs):
for farm in self.farms:
print(farm)
@property
def last(self):
return self.farms[-1]
def run_engine(self, engine):
logging.debug(f"start engine::{engine.__name__}]")
self.current_engine = engine
self.farms, self.barn = engine(experiments=self.experiments, farms=self.farms)
logging.debug("::engine ended")
def run_dumper(self, dumper):
logging.debug(f"start dumper::{dumper.__name__}]")
dumper(
experiments=self.experiments,
farms=self.farms,
barn=self.barn,
engine=self.current_engine,
)
logging.debug("::dumper ended")
def do(self):
if not self.experiments:
raise UnderDefined("cannot run until " "you have assigned an experiment")
for engine in self.engines:
self.empty_the_farms()
logging.debug(f"running - {str(engine)}")
self.run_engine(engine)
for dumper in self.dumpers:
logging.debug(f"exporting - {str(dumper)}")
self.run_dumper(dumper)
def ocv_points_engine(self, **kwargs):
experiments = kwargs["experiments"]
farms = kwargs["farms"]
barn = None
for experiment, farm in zip(experiments, farms):
for cell_label in experiment.cell_data_frames:
logging.info(f"Analyzing {cell_label}")
if experiment.all_in_memory:
logging.debug("CellpyData picked from memory")
cell = experiment.cell_data_frames[cell_label]
if cell.empty:
logging.warning("Oh-no! Empty CellpyData-object")
else:
logging.debug("CellpyData loaded from Cellpy-file")
cell = experiment.data[cell_label]
if cell.empty:
logging.warning("Oh-no! Empty CellpyData-object")
df = select_ocv_points(
cell,
selection_method=self.selection_method,
number_of_points=self.number_of_points,
interval=self.interval,
relative_voltage=self.relative_voltage,
report_times=self.report_times,
direction=self.direction,
)
farm.append(df)
return farms, barn
def do2(self):
for experiment, farm in zip(self.experiments, self.farms):
for cell_label in experiment.cell_data_frames:
logging.info(f"Analyzing {cell_label}")
if experiment.all_in_memory:
logging.debug("CellpyData picked from memory")
cell = experiment.cell_data_frames[cell_label]
if cell.empty:
logging.warning("Oh-no! Empty CellpyData-object")
else:
logging.debug("CellpyData loaded from Cellpy-file")
cell = experiment.data[cell_label]
if cell.empty:
logging.warning("Oh-no! Empty CellpyData-object")
df = select_ocv_points(
cell,
selection_method=self.selection_method,
number_of_points=self.number_of_points,
interval=self.interval,
relative_voltage=self.relative_voltage,
report_times=self.report_times,
direction=self.direction,
)
farm.append(df)
return self.farms
| [
1,
1053,
12183,
13,
13,
5215,
11701,
408,
10518,
13,
13,
3166,
3038,
2272,
29889,
13239,
29889,
16175,
29918,
8504,
29889,
16175,
29918,
3221,
1053,
7399,
2744,
14997,
3298,
13,
3166,
3038,
2272,
29889,
13239,
29889,
542,
29894,
29918,
2096,
29916,
1053,
1831,
29918,
542,
29894,
29918,
9748,
13,
3166,
3038,
2272,
29889,
11739,
29879,
1053,
7634,
3206,
1312,
13,
13,
13,
1990,
306,
5454,
2744,
14997,
3298,
29898,
5160,
2744,
14997,
3298,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
13,
13,
1990,
382,
3235,
2744,
14997,
3298,
29898,
5160,
2744,
14997,
3298,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
13,
13,
1990,
438,
15633,
9662,
1165,
362,
2744,
14997,
3298,
29898,
5160,
2744,
14997,
3298,
1125,
13,
1678,
9995,
2744,
14997,
911,
1722,
3151,
29883,
3121,
26681,
362,
19684,
29889,
13,
13,
1678,
910,
16455,
3298,
338,
1603,
1090,
5849,
29889,
13,
1678,
313,
7439,
368,
29897,
13374,
14927,
577,
2215,
29901,
1831,
29918,
542,
29894,
29918,
9748,
1599,
2215,
1516,
29889,
13,
1678,
1763,
679,
278,
3630,
14438,
1280,
515,
278,
2215,
1516,
29892,
366,
508,
671,
13,
1678,
8653,
288,
11023,
29918,
3149,
29918,
19935,
353,
438,
15633,
9662,
1165,
362,
2744,
14997,
3298,
29889,
4230,
13,
13,
1678,
6212,
5026,
313,
1454,
1831,
29918,
542,
29894,
29918,
9748,
1125,
13,
4706,
9262,
29918,
5696,
29901,
16614,
363,
18851,
3291,
13,
9651,
14436,
262,
29901,
1831,
937,
322,
1833,
29892,
322,
769,
1833,
29914,
29906,
29892,
1833,
29914,
29906,
29914,
29906,
2992,
29889,
13,
18884,
2745,
366,
505,
7450,
278,
5131,
1353,
310,
3291,
29889,
13,
9651,
4343,
29918,
2230,
29901,
1831,
937,
29892,
322,
769,
13,
9651,
21274,
304,
376,
28402,
262,
29908,
13,
4706,
1353,
29918,
974,
29918,
9748,
29901,
1353,
310,
3291,
366,
864,
29889,
13,
9651,
21274,
304,
29871,
29945,
13,
4706,
7292,
29901,
7292,
1546,
1269,
1298,
313,
262,
671,
871,
363,
3519,
13,
9651,
988,
7292,
3732,
4060,
467,
960,
372,
338,
263,
1051,
29892,
769,
13,
9651,
1353,
29918,
974,
29918,
9748,
674,
367,
12833,
408,
7431,
29898,
19207,
29897,
718,
29871,
29896,
313,
392,
13,
9651,
5712,
278,
731,
1353,
29918,
974,
29918,
9748,
467,
13,
9651,
21274,
304,
29871,
29896,
29900,
13,
4706,
6198,
29918,
1555,
29873,
482,
29901,
731,
304,
5852,
565,
366,
723,
763,
278,
11749,
304,
367,
13,
9651,
6198,
304,
278,
11749,
1434,
6257,
278,
288,
11023,
364,
29880,
29916,
4331,
29889,
13,
9651,
13109,
29879,
304,
7700,
29889,
5240,
935,
393,
363,
278,
2847,
364,
15524,
4331,
313,
8256,
13,
9651,
366,
925,
505,
1925,
596,
3038,
373,
278,
1243,
261,
29897,
947,
451,
505,
738,
13,
9651,
7536,
11749,
29889,
450,
6198,
11749,
674,
769,
367,
23797,
278,
13,
9651,
937,
20039,
1298,
29889,
13,
9651,
21274,
304,
7700,
13,
4706,
3461,
29918,
3706,
29901,
884,
3461,
278,
288,
11023,
364,
29880,
29916,
3001,
931,
565,
5852,
313,
4381,
29879,
13,
9651,
304,
7700,
29897,
13,
4706,
5305,
4852,
786,
613,
376,
3204,
29908,
470,
376,
20313,
29908,
1125,
1831,
376,
786,
29908,
565,
366,
723,
763,
13,
9651,
304,
1889,
871,
278,
288,
11023,
364,
29880,
29916,
6576,
988,
278,
11749,
338,
26681,
292,
13,
9651,
701,
2935,
322,
325,
675,
1224,
29874,
29889,
13109,
29879,
304,
376,
20313,
13,
13,
1678,
1763,
29899,
1867,
29901,
13,
4706,
448,
3160,
2253,
6012,
29899,
29881,
398,
546,
1158,
3002,
322,
16766,
13,
9651,
6433,
304,
1716,
3370,
322,
934,
29898,
29879,
29897,
13,
9651,
313,
9344,
788,
445,
304,
7399,
2744,
14997,
643,
29897,
13,
4706,
448,
1162,
2418,
6055,
322,
4128,
13,
4706,
448,
2984,
313,
29881,
398,
546,
29897,
363,
6492,
1259,
29973,
13,
4706,
448,
18428,
28221,
310,
438,
15633,
364,
29880,
29916,
848,
29973,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
996,
1475,
353,
5159,
13,
4706,
1583,
29889,
15070,
414,
353,
5159,
13,
4706,
1583,
29889,
3784,
29918,
10599,
353,
6213,
13,
4706,
1583,
3032,
16645,
29918,
10599,
29898,
1311,
29889,
542,
29894,
29918,
9748,
29918,
10599,
29897,
13,
4706,
396,
1583,
3032,
16645,
29918,
29881,
398,
546,
29898,
1311,
29889,
10525,
29918,
29881,
398,
546,
29897,
13,
4706,
396,
544,
1516,
363,
1831,
29918,
542,
29894,
29918,
9748,
13,
4706,
1583,
29889,
21731,
29918,
5696,
353,
376,
28402,
262,
29908,
13,
4706,
1583,
29889,
4537,
29918,
974,
29918,
9748,
353,
29871,
29945,
13,
4706,
1583,
29889,
19207,
353,
29871,
29896,
29900,
13,
4706,
1583,
29889,
22925,
29918,
1555,
29873,
482,
353,
7700,
13,
4706,
1583,
29889,
12276,
29918,
3706,
353,
7700,
13,
4706,
1583,
29889,
20845,
353,
6213,
13,
13,
1678,
822,
903,
16645,
29918,
10599,
29898,
1311,
29892,
6012,
1125,
13,
4706,
1583,
29889,
996,
1475,
29889,
4397,
29898,
10599,
29897,
13,
13,
1678,
822,
903,
16645,
29918,
29881,
398,
546,
29898,
1311,
29892,
270,
398,
546,
1125,
13,
4706,
1583,
29889,
15070,
414,
29889,
4397,
29898,
29881,
398,
546,
29897,
13,
13,
1678,
822,
4315,
29918,
29881,
398,
546,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
363,
17888,
297,
1583,
29889,
15641,
1516,
29901,
13,
9651,
1596,
29898,
29888,
2817,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1833,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
15641,
1516,
14352,
29896,
29962,
13,
13,
1678,
822,
1065,
29918,
10599,
29898,
1311,
29892,
6012,
1125,
13,
4706,
12183,
29889,
8382,
29898,
29888,
29908,
2962,
6012,
1057,
29912,
10599,
17255,
978,
1649,
6525,
1159,
13,
13,
4706,
1583,
29889,
3784,
29918,
10599,
353,
6012,
13,
13,
4706,
1583,
29889,
15641,
1516,
29892,
1583,
29889,
1646,
29876,
353,
6012,
29898,
735,
546,
7862,
29922,
1311,
29889,
735,
546,
7862,
29892,
2215,
1516,
29922,
1311,
29889,
15641,
1516,
29897,
13,
4706,
12183,
29889,
8382,
703,
1057,
10599,
9698,
1159,
13,
13,
1678,
822,
1065,
29918,
29881,
398,
546,
29898,
1311,
29892,
270,
398,
546,
1125,
13,
4706,
12183,
29889,
8382,
29898,
29888,
29908,
2962,
270,
398,
546,
1057,
29912,
29881,
398,
546,
17255,
978,
1649,
6525,
1159,
13,
4706,
270,
398,
546,
29898,
13,
9651,
15729,
29922,
1311,
29889,
735,
546,
7862,
29892,
13,
9651,
2215,
1516,
29922,
1311,
29889,
15641,
1516,
29892,
13,
9651,
2594,
29876,
29922,
1311,
29889,
1646,
29876,
29892,
13,
9651,
6012,
29922,
1311,
29889,
3784,
29918,
10599,
29892,
13,
4706,
1723,
13,
4706,
12183,
29889,
8382,
703,
1057,
29881,
398,
546,
9698,
1159,
13,
13,
1678,
822,
437,
29898,
1311,
1125,
13,
4706,
565,
451,
1583,
29889,
735,
546,
7862,
29901,
13,
9651,
12020,
7634,
3206,
1312,
703,
29883,
6735,
1065,
2745,
376,
376,
6293,
505,
9859,
385,
7639,
1159,
13,
13,
4706,
363,
6012,
297,
1583,
29889,
996,
1475,
29901,
13,
9651,
1583,
29889,
6310,
29918,
1552,
29918,
15641,
1516,
580,
13,
9651,
12183,
29889,
8382,
29898,
29888,
29908,
21094,
448,
426,
710,
29898,
10599,
2915,
1159,
13,
9651,
1583,
29889,
3389,
29918,
10599,
29898,
10599,
29897,
13,
13,
9651,
363,
270,
398,
546,
297,
1583,
29889,
15070,
414,
29901,
13,
18884,
12183,
29889,
8382,
29898,
29888,
29908,
15843,
292,
448,
426,
710,
29898,
29881,
398,
546,
2915,
1159,
13,
18884,
1583,
29889,
3389,
29918,
29881,
398,
546,
29898,
29881,
398,
546,
29897,
13,
13,
1678,
822,
288,
11023,
29918,
9748,
29918,
10599,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
15729,
353,
9049,
5085,
3366,
735,
546,
7862,
3108,
13,
4706,
2215,
1516,
353,
9049,
5085,
3366,
15641,
1516,
3108,
13,
4706,
2594,
29876,
353,
6213,
13,
4706,
363,
7639,
29892,
17888,
297,
14319,
29898,
735,
546,
7862,
29892,
2215,
1516,
1125,
13,
9651,
363,
3038,
29918,
1643,
297,
7639,
29889,
3729,
29918,
1272,
29918,
19935,
29901,
13,
18884,
12183,
29889,
3888,
29898,
29888,
29908,
21067,
12339,
292,
426,
3729,
29918,
1643,
27195,
13,
18884,
565,
7639,
29889,
497,
29918,
262,
29918,
14834,
29901,
13,
462,
1678,
12183,
29889,
8382,
703,
4617,
2272,
1469,
18691,
515,
3370,
1159,
13,
462,
1678,
3038,
353,
7639,
29889,
3729,
29918,
1272,
29918,
19935,
29961,
3729,
29918,
1643,
29962,
13,
462,
1678,
565,
3038,
29889,
6310,
29901,
13,
462,
4706,
12183,
29889,
27392,
703,
9048,
29899,
1217,
29991,
2812,
2349,
19413,
2272,
1469,
29899,
3318,
1159,
13,
18884,
1683,
29901,
13,
462,
1678,
12183,
29889,
8382,
703,
4617,
2272,
1469,
7500,
515,
19413,
2272,
29899,
1445,
1159,
13,
462,
1678,
3038,
353,
7639,
29889,
1272,
29961,
3729,
29918,
1643,
29962,
13,
462,
1678,
565,
3038,
29889,
6310,
29901,
13,
462,
4706,
12183,
29889,
27392,
703,
9048,
29899,
1217,
29991,
2812,
2349,
19413,
2272,
1469,
29899,
3318,
1159,
13,
13,
18884,
4489,
353,
1831,
29918,
542,
29894,
29918,
9748,
29898,
13,
462,
1678,
3038,
29892,
13,
462,
1678,
9262,
29918,
5696,
29922,
1311,
29889,
21731,
29918,
5696,
29892,
13,
462,
1678,
1353,
29918,
974,
29918,
9748,
29922,
1311,
29889,
4537,
29918,
974,
29918,
9748,
29892,
13,
462,
1678,
7292,
29922,
1311,
29889,
19207,
29892,
13,
462,
1678,
6198,
29918,
1555,
29873,
482,
29922,
1311,
29889,
22925,
29918,
1555,
29873,
482,
29892,
13,
462,
1678,
3461,
29918,
3706,
29922,
1311,
29889,
12276,
29918,
3706,
29892,
13,
462,
1678,
5305,
29922,
1311,
29889,
20845,
29892,
13,
18884,
1723,
13,
18884,
17888,
29889,
4397,
29898,
2176,
29897,
13,
13,
4706,
736,
2215,
1516,
29892,
2594,
29876,
13,
13,
1678,
822,
437,
29906,
29898,
1311,
1125,
13,
4706,
363,
7639,
29892,
17888,
297,
14319,
29898,
1311,
29889,
735,
546,
7862,
29892,
1583,
29889,
15641,
1516,
1125,
13,
9651,
363,
3038,
29918,
1643,
297,
7639,
29889,
3729,
29918,
1272,
29918,
19935,
29901,
13,
18884,
12183,
29889,
3888,
29898,
29888,
29908,
21067,
12339,
292,
426,
3729,
29918,
1643,
27195,
13,
18884,
565,
7639,
29889,
497,
29918,
262,
29918,
14834,
29901,
13,
462,
1678,
12183,
29889,
8382,
703,
4617,
2272,
1469,
18691,
515,
3370,
1159,
13,
462,
1678,
3038,
353,
7639,
29889,
3729,
29918,
1272,
29918,
19935,
29961,
3729,
29918,
1643,
29962,
13,
462,
1678,
565,
3038,
29889,
6310,
29901,
13,
462,
4706,
12183,
29889,
27392,
703,
9048,
29899,
1217,
29991,
2812,
2349,
19413,
2272,
1469,
29899,
3318,
1159,
13,
18884,
1683,
29901,
13,
462,
1678,
12183,
29889,
8382,
703,
4617,
2272,
1469,
7500,
515,
19413,
2272,
29899,
1445,
1159,
13,
462,
1678,
3038,
353,
7639,
29889,
1272,
29961,
3729,
29918,
1643,
29962,
13,
462,
1678,
565,
3038,
29889,
6310,
29901,
13,
462,
4706,
12183,
29889,
27392,
703,
9048,
29899,
1217,
29991,
2812,
2349,
19413,
2272,
1469,
29899,
3318,
1159,
13,
13,
18884,
4489,
353,
1831,
29918,
542,
29894,
29918,
9748,
29898,
13,
462,
1678,
3038,
29892,
13,
462,
1678,
9262,
29918,
5696,
29922,
1311,
29889,
21731,
29918,
5696,
29892,
13,
462,
1678,
1353,
29918,
974,
29918,
9748,
29922,
1311,
29889,
4537,
29918,
974,
29918,
9748,
29892,
13,
462,
1678,
7292,
29922,
1311,
29889,
19207,
29892,
13,
462,
1678,
6198,
29918,
1555,
29873,
482,
29922,
1311,
29889,
22925,
29918,
1555,
29873,
482,
29892,
13,
462,
1678,
3461,
29918,
3706,
29922,
1311,
29889,
12276,
29918,
3706,
29892,
13,
462,
1678,
5305,
29922,
1311,
29889,
20845,
29892,
13,
18884,
1723,
13,
18884,
17888,
29889,
4397,
29898,
2176,
29897,
13,
4706,
736,
1583,
29889,
15641,
1516,
13,
2
] |
video_clipping.py | corberan/video_clipper | 27 | 68912 | <gh_stars>10-100
import os
from collections import OrderedDict
from glob import glob
import imageio
import click
def get_formatted_time(seconds):
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
if h > 0:
return '%02d:%02d:%02d' % (h, m, s)
elif m > 0:
return '%02d:%02d' % (m, s)
else:
return '00:%02d' % s
def get_duration_str(start_frame_num, end_frame_num, frame_rate):
return '{} - {}'.format(get_formatted_time(start_frame_num/frame_rate), get_formatted_time(end_frame_num/frame_rate))
def clip(video_file_path, face_classes_path, split_blank_duration):
items = os.listdir(face_classes_path)
if len(items) == 0:
print('no items in path')
return
class_names = OrderedDict()
for item in items:
label_folder_path = os.path.join(face_classes_path, item)
if os.path.isdir(label_folder_path):
label_and_name = item.split('-', 1)
if len(label_and_name) == 2:
face_label = int(label_and_name[0])
class_names[face_label] = label_and_name[1]
print('please select:')
class_names_list = list(set(class_names.values()))
for i, name in enumerate(class_names_list):
print('{}: {}'.format(i, name))
user_input = input('> ')
selected_name = class_names_list[int(user_input)]
print('you select {}'.format(selected_name))
frame_nums = set()
for label, name in class_names.items():
if name == selected_name:
label_folder_path = os.path.join(face_classes_path, '{}-{}'.format(label, name))
for f in glob(os.path.join(label_folder_path, '???*.jpg')):
if os.path.isfile(f):
image_filename = os.path.basename(f)
pos = image_filename.find('_')
if pos > 0:
frame_num = image_filename[:pos]
frame_nums.add(int(frame_num))
frames_count = len(frame_nums)
if frames_count == 0:
print('no images found')
return
else:
frame_nums_list = list(frame_nums)
frame_nums_list.sort()
reader = imageio.get_reader(video_file_path)
meta_data = reader.get_meta_data()
video_fps = meta_data['fps']
blank_frames_count = video_fps * split_blank_duration
result = []
section = [frame_nums_list[0]]
for i in range(1, frames_count):
frame_num = frame_nums_list[i]
if frame_num - section[-1] < blank_frames_count:
section.append(frame_num)
else:
result.append(get_duration_str(section[0], section[-1], video_fps))
section = [frame_num]
if len(result) == 0:
result.append(get_duration_str(section[0], section[-1], video_fps))
print(result)
@click.command()
@click.argument('video_file_path')
@click.argument('face_classes_path')
@click.argument('split_blank_duration', type=float)
def main(video_file_path, face_classes_path, split_blank_duration):
if not os.path.isfile(video_file_path):
print('\"%s\" not found' % video_file_path)
return
if not os.path.isdir(face_classes_path):
print('\"%s\" not exists' % face_classes_path)
return
clip(video_file_path, face_classes_path, split_blank_duration)
if __name__ == '__main__':
main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
5215,
2897,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
3166,
13149,
1053,
13149,
13,
5215,
1967,
601,
13,
5215,
2828,
13,
13,
13,
1753,
679,
29918,
689,
19667,
29918,
2230,
29898,
23128,
1125,
13,
1678,
286,
29892,
269,
353,
1933,
1545,
29898,
23128,
29892,
29871,
29953,
29900,
29897,
13,
1678,
298,
29892,
286,
353,
1933,
1545,
29898,
29885,
29892,
29871,
29953,
29900,
29897,
13,
1678,
565,
298,
1405,
29871,
29900,
29901,
13,
4706,
736,
14210,
29900,
29906,
29881,
16664,
29900,
29906,
29881,
16664,
29900,
29906,
29881,
29915,
1273,
313,
29882,
29892,
286,
29892,
269,
29897,
13,
1678,
25342,
286,
1405,
29871,
29900,
29901,
13,
4706,
736,
14210,
29900,
29906,
29881,
16664,
29900,
29906,
29881,
29915,
1273,
313,
29885,
29892,
269,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
525,
29900,
29900,
16664,
29900,
29906,
29881,
29915,
1273,
269,
13,
13,
13,
1753,
679,
29918,
19708,
29918,
710,
29898,
2962,
29918,
2557,
29918,
1949,
29892,
1095,
29918,
2557,
29918,
1949,
29892,
3515,
29918,
10492,
1125,
13,
1678,
736,
525,
8875,
448,
6571,
4286,
4830,
29898,
657,
29918,
689,
19667,
29918,
2230,
29898,
2962,
29918,
2557,
29918,
1949,
29914,
2557,
29918,
10492,
511,
679,
29918,
689,
19667,
29918,
2230,
29898,
355,
29918,
2557,
29918,
1949,
29914,
2557,
29918,
10492,
876,
13,
13,
13,
1753,
20102,
29898,
9641,
29918,
1445,
29918,
2084,
29892,
3700,
29918,
13203,
29918,
2084,
29892,
6219,
29918,
19465,
29918,
19708,
1125,
13,
1678,
4452,
353,
2897,
29889,
1761,
3972,
29898,
2161,
29918,
13203,
29918,
2084,
29897,
13,
1678,
565,
7431,
29898,
7076,
29897,
1275,
29871,
29900,
29901,
13,
4706,
1596,
877,
1217,
4452,
297,
2224,
1495,
13,
4706,
736,
13,
13,
1678,
770,
29918,
7039,
353,
8170,
287,
21533,
580,
13,
1678,
363,
2944,
297,
4452,
29901,
13,
4706,
3858,
29918,
12083,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2161,
29918,
13203,
29918,
2084,
29892,
2944,
29897,
13,
4706,
565,
2897,
29889,
2084,
29889,
275,
3972,
29898,
1643,
29918,
12083,
29918,
2084,
1125,
13,
9651,
3858,
29918,
392,
29918,
978,
353,
2944,
29889,
5451,
877,
29899,
742,
29871,
29896,
29897,
13,
9651,
565,
7431,
29898,
1643,
29918,
392,
29918,
978,
29897,
1275,
29871,
29906,
29901,
13,
18884,
3700,
29918,
1643,
353,
938,
29898,
1643,
29918,
392,
29918,
978,
29961,
29900,
2314,
13,
18884,
770,
29918,
7039,
29961,
2161,
29918,
1643,
29962,
353,
3858,
29918,
392,
29918,
978,
29961,
29896,
29962,
13,
13,
1678,
1596,
877,
552,
559,
1831,
29901,
1495,
13,
1678,
770,
29918,
7039,
29918,
1761,
353,
1051,
29898,
842,
29898,
1990,
29918,
7039,
29889,
5975,
22130,
13,
1678,
363,
474,
29892,
1024,
297,
26985,
29898,
1990,
29918,
7039,
29918,
1761,
1125,
13,
4706,
1596,
877,
29912,
6177,
6571,
4286,
4830,
29898,
29875,
29892,
1024,
876,
13,
13,
1678,
1404,
29918,
2080,
353,
1881,
877,
29958,
25710,
13,
1678,
4629,
29918,
978,
353,
770,
29918,
7039,
29918,
1761,
29961,
524,
29898,
1792,
29918,
2080,
4638,
13,
1678,
1596,
877,
6293,
1831,
6571,
4286,
4830,
29898,
8391,
29918,
978,
876,
13,
13,
1678,
3515,
29918,
1949,
29879,
353,
731,
580,
13,
1678,
363,
3858,
29892,
1024,
297,
770,
29918,
7039,
29889,
7076,
7295,
13,
4706,
565,
1024,
1275,
4629,
29918,
978,
29901,
13,
9651,
3858,
29918,
12083,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2161,
29918,
13203,
29918,
2084,
29892,
22372,
7402,
8875,
4286,
4830,
29898,
1643,
29892,
1024,
876,
13,
9651,
363,
285,
297,
13149,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1643,
29918,
12083,
29918,
2084,
29892,
525,
28772,
10521,
6173,
8785,
29901,
13,
18884,
565,
2897,
29889,
2084,
29889,
275,
1445,
29898,
29888,
1125,
13,
462,
1678,
1967,
29918,
9507,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
29888,
29897,
13,
462,
1678,
926,
353,
1967,
29918,
9507,
29889,
2886,
877,
29918,
1495,
13,
462,
1678,
565,
926,
1405,
29871,
29900,
29901,
13,
462,
4706,
3515,
29918,
1949,
353,
1967,
29918,
9507,
7503,
1066,
29962,
13,
462,
4706,
3515,
29918,
1949,
29879,
29889,
1202,
29898,
524,
29898,
2557,
29918,
1949,
876,
13,
13,
1678,
16608,
29918,
2798,
353,
7431,
29898,
2557,
29918,
1949,
29879,
29897,
13,
1678,
565,
16608,
29918,
2798,
1275,
29871,
29900,
29901,
13,
4706,
1596,
877,
1217,
4558,
1476,
1495,
13,
4706,
736,
13,
1678,
1683,
29901,
13,
4706,
3515,
29918,
1949,
29879,
29918,
1761,
353,
1051,
29898,
2557,
29918,
1949,
29879,
29897,
13,
4706,
3515,
29918,
1949,
29879,
29918,
1761,
29889,
6605,
580,
13,
13,
4706,
9591,
353,
1967,
601,
29889,
657,
29918,
16950,
29898,
9641,
29918,
1445,
29918,
2084,
29897,
13,
4706,
12700,
29918,
1272,
353,
9591,
29889,
657,
29918,
7299,
29918,
1272,
580,
13,
4706,
4863,
29918,
29888,
567,
353,
12700,
29918,
1272,
1839,
29888,
567,
2033,
13,
13,
4706,
9654,
29918,
19935,
29918,
2798,
353,
4863,
29918,
29888,
567,
334,
6219,
29918,
19465,
29918,
19708,
13,
13,
4706,
1121,
353,
5159,
13,
4706,
4004,
353,
518,
2557,
29918,
1949,
29879,
29918,
1761,
29961,
29900,
5262,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
16608,
29918,
2798,
1125,
13,
9651,
3515,
29918,
1949,
353,
3515,
29918,
1949,
29879,
29918,
1761,
29961,
29875,
29962,
13,
9651,
565,
3515,
29918,
1949,
448,
4004,
14352,
29896,
29962,
529,
9654,
29918,
19935,
29918,
2798,
29901,
13,
18884,
4004,
29889,
4397,
29898,
2557,
29918,
1949,
29897,
13,
9651,
1683,
29901,
13,
18884,
1121,
29889,
4397,
29898,
657,
29918,
19708,
29918,
710,
29898,
2042,
29961,
29900,
1402,
4004,
14352,
29896,
1402,
4863,
29918,
29888,
567,
876,
13,
18884,
4004,
353,
518,
2557,
29918,
1949,
29962,
13,
13,
4706,
565,
7431,
29898,
2914,
29897,
1275,
29871,
29900,
29901,
13,
9651,
1121,
29889,
4397,
29898,
657,
29918,
19708,
29918,
710,
29898,
2042,
29961,
29900,
1402,
4004,
14352,
29896,
1402,
4863,
29918,
29888,
567,
876,
13,
13,
4706,
1596,
29898,
2914,
29897,
13,
13,
13,
29992,
3808,
29889,
6519,
580,
13,
29992,
3808,
29889,
23516,
877,
9641,
29918,
1445,
29918,
2084,
1495,
13,
29992,
3808,
29889,
23516,
877,
2161,
29918,
13203,
29918,
2084,
1495,
13,
29992,
3808,
29889,
23516,
877,
5451,
29918,
19465,
29918,
19708,
742,
1134,
29922,
7411,
29897,
13,
1753,
1667,
29898,
9641,
29918,
1445,
29918,
2084,
29892,
3700,
29918,
13203,
29918,
2084,
29892,
6219,
29918,
19465,
29918,
19708,
1125,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
1445,
29898,
9641,
29918,
1445,
29918,
2084,
1125,
13,
4706,
1596,
877,
5931,
29995,
29879,
5931,
451,
1476,
29915,
1273,
4863,
29918,
1445,
29918,
2084,
29897,
13,
4706,
736,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
2161,
29918,
13203,
29918,
2084,
1125,
13,
4706,
1596,
877,
5931,
29995,
29879,
5931,
451,
4864,
29915,
1273,
3700,
29918,
13203,
29918,
2084,
29897,
13,
4706,
736,
13,
13,
1678,
20102,
29898,
9641,
29918,
1445,
29918,
2084,
29892,
3700,
29918,
13203,
29918,
2084,
29892,
6219,
29918,
19465,
29918,
19708,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
gg/game.py | willieLjohnson/pygg | 0 | 49118 | from dataclasses import dataclass
import pygame
import pymunk
import pymunk.pygame_util
from . import style
from . import display
from . import structures
@dataclass(unsafe_hash=True)
class Game:
__metaclass__ = structures.IterableObject
name = ""
entities = {}
style = style.GGSTYLE()
space: pymunk.Space
_draw_options: pymunk.pygame_util.DrawOptions
screen: display.Screen
def __init__(self, name, width = 800, height = 600):
self.name = name
self.screen = display.Screen(width, height)
pygame.init()
pygame.display.set_caption(name)
self.space = pymunk.Space()
self._draw_options = pymunk.pygame_util.DrawOptions(self.screen.canvas)
self.clock = pygame.time.Clock()
self.particle_effects = {}
def run(self):
self.running = 1
while self.running == 1:
self._handle_quit()
self.screen.clear(self.style.BLACK)
hello = self.style.FONT.render("hi", False, style.GGSTYLE.GREEN)
self.entities.draw(self.screen)
self.screen.blit(hello, (self.screen.width / 2 - hello.get_rect().w / 2, self.scree.height / 2 - hello.get_rect().h / 2))
pygame.display.update()
self.clock.tick(60)
pygame.quit()
def _handle_quit(self):
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.running = 0
def _update_space(self):
self.space.step(1/60)
def addobject(self, object):
self.entities.addobject(object)
def addtospace(self, body):
self.space.add(body) | [
1,
515,
848,
13203,
1053,
848,
1990,
13,
5215,
22028,
13,
5215,
282,
962,
2960,
13,
5215,
282,
962,
2960,
29889,
2272,
11802,
29918,
4422,
13,
13,
13,
3166,
869,
1053,
3114,
13,
3166,
869,
1053,
2479,
13,
3166,
869,
1053,
12286,
13,
13,
29992,
1272,
1990,
29898,
348,
11177,
29918,
8568,
29922,
5574,
29897,
13,
1990,
8448,
29901,
13,
1678,
4770,
2527,
562,
605,
1649,
353,
12286,
29889,
13463,
519,
2061,
13,
268,
13,
1678,
1024,
353,
5124,
13,
1678,
16212,
353,
6571,
13,
1678,
3114,
353,
3114,
29889,
26788,
1254,
29979,
1307,
580,
13,
1678,
2913,
29901,
282,
962,
2960,
29889,
14936,
13,
1678,
903,
4012,
29918,
6768,
29901,
282,
962,
2960,
29889,
2272,
11802,
29918,
4422,
29889,
8537,
5856,
13,
1678,
4315,
29901,
2479,
29889,
11357,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
2920,
353,
29871,
29947,
29900,
29900,
29892,
3171,
353,
29871,
29953,
29900,
29900,
1125,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
29889,
10525,
353,
2479,
29889,
11357,
29898,
2103,
29892,
3171,
29897,
13,
308,
13,
4706,
22028,
29889,
2344,
580,
13,
4706,
22028,
29889,
4990,
29889,
842,
29918,
6671,
29898,
978,
29897,
13,
4706,
1583,
29889,
3493,
353,
282,
962,
2960,
29889,
14936,
580,
13,
4706,
1583,
3032,
4012,
29918,
6768,
353,
282,
962,
2960,
29889,
2272,
11802,
29918,
4422,
29889,
8537,
5856,
29898,
1311,
29889,
10525,
29889,
15257,
29897,
13,
4706,
1583,
29889,
13058,
353,
22028,
29889,
2230,
29889,
29907,
908,
580,
13,
308,
13,
4706,
1583,
29889,
1595,
2512,
29918,
15987,
29879,
353,
6571,
13,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
1583,
29889,
21094,
353,
29871,
29896,
13,
4706,
1550,
1583,
29889,
21094,
1275,
29871,
29896,
29901,
13,
9651,
1583,
3032,
8411,
29918,
28358,
580,
13,
9651,
1583,
29889,
10525,
29889,
8551,
29898,
1311,
29889,
3293,
29889,
13367,
11375,
29897,
13,
9651,
22172,
353,
1583,
29889,
3293,
29889,
29943,
1164,
29911,
29889,
9482,
703,
2918,
613,
7700,
29892,
3114,
29889,
26788,
1254,
29979,
1307,
29889,
29954,
1525,
1430,
29897,
13,
9651,
1583,
29889,
296,
1907,
29889,
4012,
29898,
1311,
29889,
10525,
29897,
13,
9651,
1583,
29889,
10525,
29889,
2204,
277,
29898,
12199,
29892,
313,
1311,
29889,
10525,
29889,
2103,
847,
29871,
29906,
448,
22172,
29889,
657,
29918,
1621,
2141,
29893,
847,
29871,
29906,
29892,
1583,
29889,
1557,
929,
29889,
3545,
847,
29871,
29906,
448,
22172,
29889,
657,
29918,
1621,
2141,
29882,
847,
29871,
29906,
876,
13,
9651,
22028,
29889,
4990,
29889,
5504,
580,
13,
9651,
1583,
29889,
13058,
29889,
24667,
29898,
29953,
29900,
29897,
13,
13,
4706,
22028,
29889,
28358,
580,
13,
308,
13,
462,
268,
13,
1678,
822,
903,
8411,
29918,
28358,
29898,
1311,
1125,
13,
4706,
363,
1741,
297,
22028,
29889,
3696,
29889,
657,
7295,
13,
9651,
565,
1741,
29889,
1853,
1275,
22028,
29889,
13356,
1806,
29901,
13,
18884,
1583,
29889,
21094,
353,
29871,
29900,
13,
268,
13,
1678,
822,
903,
5504,
29918,
3493,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3493,
29889,
10568,
29898,
29896,
29914,
29953,
29900,
29897,
13,
462,
13,
268,
13,
1678,
822,
788,
3318,
29898,
1311,
29892,
1203,
1125,
13,
4706,
1583,
29889,
296,
1907,
29889,
1202,
3318,
29898,
3318,
29897,
13,
13,
1678,
822,
788,
29873,
359,
3535,
29898,
1311,
29892,
3573,
1125,
13,
4706,
1583,
29889,
3493,
29889,
1202,
29898,
2587,
29897,
2
] |
config.py | Flowdeeps/flatearth | 1 | 178406 | #!/usr/bin/env python
import configparser
def getconfig ( input ):
config = configparser.ConfigParser()
config.sections()
config.read( input )
config.sections()
config_dict={}
for section in config:
for var in config[ section ]:
config_dict[ var ] = config[ section ][ var ]
if ( config_dict[ "output_string" ] != None ):
config_dict[ "output_string" ] = "<!-- " + config_dict[ "output_string" ] + " -->"
return config_dict
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
5215,
2295,
16680,
13,
13,
1753,
679,
2917,
313,
1881,
29871,
1125,
13,
13,
1678,
2295,
353,
2295,
16680,
29889,
3991,
11726,
580,
13,
1678,
2295,
29889,
27117,
580,
13,
1678,
2295,
29889,
949,
29898,
1881,
1723,
13,
1678,
2295,
29889,
27117,
580,
13,
1678,
2295,
29918,
8977,
3790,
29913,
13,
13,
1678,
363,
4004,
297,
2295,
29901,
13,
4706,
363,
722,
297,
2295,
29961,
4004,
4514,
29901,
13,
9651,
2295,
29918,
8977,
29961,
722,
4514,
353,
2295,
29961,
4004,
29871,
3816,
722,
4514,
13,
13,
1678,
565,
313,
2295,
29918,
8977,
29961,
376,
4905,
29918,
1807,
29908,
4514,
2804,
6213,
29871,
1125,
13,
4706,
2295,
29918,
8977,
29961,
376,
4905,
29918,
1807,
29908,
4514,
353,
9872,
6172,
376,
718,
2295,
29918,
8977,
29961,
376,
4905,
29918,
1807,
29908,
4514,
718,
376,
6660,
29908,
13,
13,
1678,
736,
2295,
29918,
8977,
13,
2
] |
Teacher_ListUpdate.py | RMednis/TimeTableDump | 0 | 56009 | <reponame>RMednis/TimeTableDump
###################################
# #
# MedsNET Internal Data Scraper #
# #
###################################
# This script will parse the Data from timetables.xml on the asctimetables server and
# insert it into the TimeTableDump web applet.
import urllib.request, urllib.error
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup
########################
# Variables #
########################
# Changeable #
url = 'http://ovt.lv/stundas/stundu_saraksts/timetable.xml' # The URL point to the xml file on the asctimetables server
teachers = 'index.html' # The location of the TimeTableDump html file that needs to be updated
# Do not change these variables #
website = urllib.request.urlopen(url) # Opens the website
data = website.read() # Pulls the raw data from the opened site/xml
root = ET.fromstring(data) # Puts the in the xml element tree
########################
# Code #
########################
with open(teachers) as inf: # Opens the teacher html file
txt = inf.read() # Reads the data from the file
soup = BeautifulSoup(txt, "html.parser") # Parses the data and drops it into BeutifulSoup
firstoption = soup.find("option", {"value": "0"}) # Gets the first option item, which should be kept
for option in soup.find_all('option'): # Goes over each currently existing option
if option is firstoption: # Checks to see if the currently selected option is the 1st one
continue # Skips it, since it has to be kept and doesn't change
else: # If the currently selected option is any other option
option.extract() # Removes it
# Scraping the teacher timetables
for teacher in root.iter('teacher'): # Goes over each teacher listed under the teacher tag
name = teacher.get('name') # Pulls the teacher name from the xml
timetable = teacher.get('id').replace("*", "") # Gets the teacher timetable id and removes the * character
#print('<option value="' + timetable + '">' + name + '</option>')
# Web Applet Editing
opcija = soup.new_tag("option", value=timetable) # Creates the option tag with the correct image id
opcija.append(name) # Adds the teacher name in between the tags
for option in soup.find_all('option'): # Gets the previous option obejct/tag
option.insert_after(opcija) # Adds the current option tag after it
for option in soup.find_all('option'): # Cycles over all the option tags in the file
option.insert_after("\n") # Adds a newline after each to improve readability
# Scraping the class timetables
#for kurss in root.iter("class"):
# name = kurss.get('name')
# timetable = kurss.get('id').replace("*", "")
#
# print('<option value="' + timetable + '">' + name + '</option>')
#
with open(teachers, "w") as file: # Opens the teacher html file
file.write(str(soup)) # Writes all the changes we made in beutifullsoup
| [
1,
529,
276,
1112,
420,
29958,
29934,
19302,
6994,
29914,
2481,
3562,
29928,
3427,
13,
13383,
13383,
2277,
29937,
13,
29937,
462,
462,
396,
13,
29937,
29871,
3436,
29879,
6006,
512,
1890,
3630,
2522,
336,
546,
29871,
396,
13,
29937,
462,
462,
396,
13,
13383,
13383,
2277,
29937,
13,
13,
29937,
910,
2471,
674,
6088,
278,
3630,
515,
5335,
300,
1849,
29889,
3134,
373,
278,
408,
312,
17528,
1849,
1923,
322,
13,
29937,
4635,
372,
964,
278,
5974,
3562,
29928,
3427,
1856,
623,
1026,
29889,
13,
13,
5215,
3142,
1982,
29889,
3827,
29892,
3142,
1982,
29889,
2704,
13,
5215,
4903,
29889,
300,
929,
29889,
2642,
9643,
408,
382,
29911,
13,
3166,
24512,
29946,
1053,
25685,
29903,
1132,
13,
13,
13383,
7346,
13,
29937,
418,
9586,
1849,
539,
396,
13,
13383,
7346,
13,
29937,
10726,
519,
396,
13,
2271,
353,
525,
1124,
597,
586,
29873,
29889,
28463,
29914,
303,
870,
294,
29914,
303,
870,
29884,
29918,
29879,
279,
557,
303,
29879,
29914,
9346,
300,
519,
29889,
3134,
29915,
396,
450,
3988,
1298,
304,
278,
4903,
934,
373,
278,
408,
312,
17528,
1849,
1923,
13,
371,
496,
414,
353,
525,
2248,
29889,
1420,
29915,
396,
450,
4423,
310,
278,
5974,
3562,
29928,
3427,
3472,
934,
393,
4225,
304,
367,
4784,
13,
13,
13,
29937,
1938,
451,
1735,
1438,
3651,
396,
13,
22942,
353,
3142,
1982,
29889,
3827,
29889,
332,
417,
2238,
29898,
2271,
29897,
396,
6461,
575,
278,
4700,
13,
1272,
353,
4700,
29889,
949,
580,
396,
349,
913,
29879,
278,
10650,
848,
515,
278,
6496,
3268,
29914,
3134,
13,
4632,
353,
382,
29911,
29889,
3166,
1807,
29898,
1272,
29897,
396,
349,
8842,
278,
297,
278,
4903,
1543,
5447,
13,
13,
13383,
7346,
13,
29937,
4706,
5920,
3986,
396,
13,
13383,
7346,
13,
2541,
1722,
29898,
371,
496,
414,
29897,
408,
3041,
29901,
396,
6461,
575,
278,
15703,
3472,
934,
13,
1678,
13872,
353,
3041,
29889,
949,
580,
396,
7523,
29879,
278,
848,
515,
278,
934,
13,
1678,
22300,
353,
25685,
29903,
1132,
29898,
3945,
29892,
376,
1420,
29889,
16680,
1159,
396,
1459,
29879,
267,
278,
848,
322,
4441,
567,
372,
964,
1522,
329,
6845,
29903,
1132,
13,
13,
4102,
3385,
353,
22300,
29889,
2886,
703,
3385,
613,
8853,
1767,
1115,
376,
29900,
29908,
1800,
396,
402,
1691,
278,
937,
2984,
2944,
29892,
607,
881,
367,
8126,
13,
13,
1454,
2984,
297,
22300,
29889,
2886,
29918,
497,
877,
3385,
29374,
396,
2921,
267,
975,
1269,
5279,
5923,
2984,
13,
1678,
565,
2984,
338,
937,
3385,
29901,
396,
5399,
29879,
304,
1074,
565,
278,
5279,
4629,
2984,
338,
278,
29871,
29896,
303,
697,
13,
4706,
6773,
396,
28551,
567,
372,
29892,
1951,
372,
756,
304,
367,
8126,
322,
1838,
29915,
29873,
1735,
13,
1678,
1683,
29901,
396,
960,
278,
5279,
4629,
2984,
338,
738,
916,
2984,
13,
539,
2984,
29889,
21111,
580,
396,
5240,
586,
267,
372,
13,
13,
29937,
2522,
2390,
292,
278,
15703,
5335,
300,
1849,
13,
1454,
15703,
297,
3876,
29889,
1524,
877,
371,
11665,
29374,
396,
2921,
267,
975,
1269,
15703,
9904,
1090,
278,
15703,
4055,
13,
1678,
1024,
353,
15703,
29889,
657,
877,
978,
1495,
396,
349,
913,
29879,
278,
15703,
1024,
515,
278,
4903,
13,
1678,
5335,
300,
519,
353,
15703,
29889,
657,
877,
333,
2824,
6506,
703,
29930,
613,
20569,
396,
402,
1691,
278,
15703,
5335,
300,
519,
1178,
322,
25388,
278,
334,
2931,
13,
1678,
396,
2158,
877,
29966,
3385,
995,
543,
29915,
718,
5335,
300,
519,
718,
525,
1013,
29915,
718,
1024,
718,
525,
829,
3385,
29958,
1495,
13,
13,
1678,
396,
2563,
2401,
1026,
7641,
292,
13,
1678,
1015,
26575,
353,
22300,
29889,
1482,
29918,
4039,
703,
3385,
613,
995,
29922,
9346,
300,
519,
29897,
396,
6760,
1078,
278,
2984,
4055,
411,
278,
1959,
1967,
1178,
13,
1678,
1015,
26575,
29889,
4397,
29898,
978,
29897,
396,
3462,
29879,
278,
15703,
1024,
297,
1546,
278,
8282,
13,
13,
1678,
363,
2984,
297,
22300,
29889,
2886,
29918,
497,
877,
3385,
29374,
396,
402,
1691,
278,
3517,
2984,
704,
10337,
312,
29914,
4039,
13,
4706,
2984,
29889,
7851,
29918,
7045,
29898,
459,
26575,
29897,
396,
3462,
29879,
278,
1857,
2984,
4055,
1156,
372,
13,
13,
13,
13,
1454,
2984,
297,
22300,
29889,
2886,
29918,
497,
877,
3385,
29374,
396,
8045,
7799,
975,
599,
278,
2984,
8282,
297,
278,
934,
13,
1678,
2984,
29889,
7851,
29918,
7045,
14182,
29876,
1159,
396,
3462,
29879,
263,
25899,
1156,
1269,
304,
11157,
1303,
3097,
13,
13,
13,
13,
29937,
2522,
2390,
292,
278,
770,
5335,
300,
1849,
13,
29937,
1454,
12802,
893,
297,
3876,
29889,
1524,
703,
1990,
29908,
1125,
13,
29937,
1678,
1024,
353,
12802,
893,
29889,
657,
877,
978,
1495,
13,
29937,
1678,
5335,
300,
519,
353,
12802,
893,
29889,
657,
877,
333,
2824,
6506,
703,
29930,
613,
20569,
13,
29937,
13,
29937,
1678,
1596,
877,
29966,
3385,
995,
543,
29915,
718,
5335,
300,
519,
718,
525,
1013,
29915,
718,
1024,
718,
525,
829,
3385,
29958,
1495,
13,
29937,
13,
13,
2541,
1722,
29898,
371,
496,
414,
29892,
376,
29893,
1159,
408,
934,
29901,
396,
6461,
575,
278,
15703,
3472,
934,
13,
1678,
934,
29889,
3539,
29898,
710,
29898,
29879,
1132,
876,
396,
16849,
267,
599,
278,
3620,
591,
1754,
297,
367,
329,
361,
913,
29879,
1132,
13,
2
] |
filters_json.py | sazlin/reTOracle | 0 | 177202 | <reponame>sazlin/reTOracle<filename>filters_json.py
import json
filter_list = {"c/cpp": {'search_terms':
{'hashtags': ['#cprogramming', '#clanguage'],
'users': [],
'keywords': ['cplusplus', 'C++']},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': ['cpp -investment']}},
"python": {'search_terms':
{'hashtags': ['#Python', '#Django', '#pyconau', '#numpy', '#Flask'],
'users': ['@gvanrossum', '@ThePSF', '@SciPyTip', '@brandon_rhodes', '@dstuft', '@raymondh', '@PloneCMS'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': ['monty', 'snake']}},
"java": {'search_terms':
{'hashtags': ['#Java', '#javadeveloper', '#javafx', '#java8', '#JavaEE'],
'users': ['@java', '@java4iot', '@awsforjava', '@4java'],
'keywords': ['java -coffee']},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': ['coffee']}},
"javascript": {'search_terms':
{'hashtags': ['#Javascript', '#BackboneJS', '#NodeJS', '#JQuery'],
'users': ['@JavaScriptDaily', '@oss_js', '@badass_js', '@jasminebdd', '@nodejs'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': ['java ']}},
"ruby": {'search_terms':
{'hashtags': ['#Ruby', '#RubyOnRails', '#rubyconfbr', '#rails'],
'users': ['@RubyInside', '@rubyrogues', '@rails'],
'keywords': ['ruby -jewelry', 'ruby -ring', 'ruby -gift']},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': []}},
"php": {'search_terms':
{'hashtags': ['#PHP'],
'users': ['@php_net', '@awsforphp', '@phpc', '@phpizer'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': []}},
"csharp": {'search_terms':
{'hashtags': ['#CSharp'],
'users': ['@csharp_projects', '@CHharpStack', '@CsharpCorner', '@oss_csharp'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': []}},
"objectivec": {'search_terms':
{'hashtags': ['#objectivec'],
'users': ['@objective', '@ObjectiveCDaily', '@idObjectiveC', '@ObjConSO'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': []}},
"swift": {'search_terms':
{'hashtags': ['#swiftlang'],
'users': ['@SwiftLang'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': ['Taylor ']}},
"visual_basic": {'search_terms':
{'hashtags': ['#VBA', '#VB', '#VB.NET'],
'users': ['@visualbasic_net'],
'keywords': []},
'blacklist':
{'hashtags': [],
'users': [],
'keywords': []}}}
| [
1,
529,
276,
1112,
420,
29958,
29879,
834,
1915,
29914,
276,
4986,
10792,
29966,
9507,
29958,
26705,
29918,
3126,
29889,
2272,
13,
5215,
4390,
13,
13,
4572,
29918,
1761,
353,
8853,
29883,
29914,
8223,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
462,
539,
11117,
5349,
400,
810,
2396,
6024,
29937,
29883,
28426,
742,
16321,
695,
3000,
7464,
13,
462,
4706,
525,
7193,
2396,
19997,
13,
462,
4706,
525,
1989,
9303,
2396,
6024,
29883,
11242,
11242,
742,
525,
29907,
1817,
2033,
1118,
13,
462,
268,
525,
8517,
1761,
2396,
13,
462,
539,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
4706,
525,
7193,
2396,
19997,
13,
462,
4706,
525,
1989,
9303,
2396,
6024,
8223,
448,
262,
10147,
358,
2033,
11656,
13,
29908,
4691,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
11980,
742,
16321,
29928,
5364,
742,
16321,
2272,
535,
585,
742,
16321,
23749,
742,
16321,
8754,
1278,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
29887,
3703,
2124,
398,
742,
18803,
1576,
7024,
29943,
742,
18803,
29903,
455,
19737,
29911,
666,
742,
18803,
1182,
9214,
29918,
19046,
2631,
742,
18803,
22992,
29884,
615,
742,
18803,
764,
8315,
29882,
742,
18803,
3247,
650,
29907,
4345,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
965,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
6024,
14132,
29891,
742,
525,
29879,
21040,
2033,
11656,
13,
29908,
1645,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
8404,
742,
16321,
1645,
6734,
742,
16321,
1645,
11093,
742,
16321,
1645,
29947,
742,
16321,
8404,
17896,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
1645,
742,
18803,
1645,
29946,
24414,
742,
18803,
10467,
1454,
1645,
742,
18803,
29946,
1645,
7464,
13,
462,
525,
1989,
9303,
2396,
6024,
1645,
448,
1111,
600,
3905,
2033,
1118,
13,
308,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
6024,
1111,
600,
3905,
2033,
11656,
13,
29908,
7729,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
29967,
2516,
742,
16321,
5841,
15933,
8700,
742,
16321,
4247,
8700,
742,
16321,
29967,
3010,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
16963,
29928,
8683,
742,
18803,
2209,
29918,
1315,
742,
18803,
12313,
465,
29918,
1315,
742,
18803,
29926,
11625,
457,
29890,
1289,
742,
18803,
3177,
1315,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
4706,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
6024,
1645,
525,
29962,
11656,
13,
29908,
9754,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
29934,
4471,
742,
16321,
29934,
4471,
2951,
29934,
2234,
742,
16321,
9754,
5527,
1182,
742,
16321,
9912,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
29934,
4471,
797,
2975,
742,
18803,
9754,
9102,
1041,
742,
18803,
9912,
7464,
13,
462,
525,
1989,
9303,
2396,
6024,
9754,
448,
29926,
809,
295,
719,
742,
525,
9754,
448,
5393,
742,
525,
9754,
448,
29887,
2027,
2033,
1118,
13,
4706,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
5159,
11656,
13,
29908,
1961,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
17130,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
1961,
29918,
1212,
742,
18803,
10467,
1454,
1961,
742,
18803,
1961,
29883,
742,
18803,
1961,
3950,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
965,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
5159,
11656,
13,
29908,
29883,
22064,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
29907,
2713,
6834,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
29883,
22064,
29918,
16418,
742,
18803,
3210,
29882,
6834,
7264,
742,
18803,
29907,
22064,
12521,
1089,
742,
18803,
2209,
29918,
29883,
22064,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
965,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
5159,
11656,
13,
29908,
3318,
573,
29883,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
3318,
573,
29883,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
3318,
573,
742,
18803,
2061,
573,
6530,
8683,
742,
18803,
333,
2061,
573,
29907,
742,
18803,
9930,
1168,
6156,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
965,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
5159,
11656,
13,
29908,
26792,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
26792,
3893,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
10840,
2027,
29931,
574,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
965,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
6024,
29911,
11017,
525,
29962,
11656,
13,
29908,
20119,
29918,
16121,
1115,
11117,
4478,
29918,
357,
1516,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
6024,
29937,
29963,
5688,
742,
16321,
24281,
742,
16321,
24281,
29889,
6006,
7464,
13,
462,
525,
7193,
2396,
6024,
29992,
20119,
16121,
29918,
1212,
7464,
13,
462,
525,
1989,
9303,
2396,
5159,
1118,
13,
965,
525,
8517,
1761,
2396,
13,
18884,
11117,
5349,
400,
810,
2396,
19997,
13,
462,
525,
7193,
2396,
19997,
13,
462,
525,
1989,
9303,
2396,
5159,
12499,
13,
2
] |
tests/validators/test_genomic_duplication.py | cancervariants/varlex | 0 | 178216 | <reponame>cancervariants/varlex<filename>tests/validators/test_genomic_duplication.py
"""Module for testing Genomic Duplication Validator."""
import unittest
from variation.validators import GenomicDuplication
from variation.classifiers import GenomicDuplicationClassifier
from .validator_base import ValidatorBase
class TestGenomicDuplicationValidator(ValidatorBase, unittest.TestCase):
"""A class to test the Genomic Duplication Validator."""
def validator_instance(self):
"""Return genomic duplication instance."""
return GenomicDuplication(*self.params)
def classifier_instance(self):
"""Return the genomic duplication classifier instance."""
return GenomicDuplicationClassifier()
def fixture_name(self):
"""Return the fixture name for genomic duplication."""
return "genomic_duplication"
| [
1,
529,
276,
1112,
420,
29958,
3068,
2265,
5927,
1934,
29914,
1707,
2506,
29966,
9507,
29958,
21150,
29914,
3084,
4097,
29914,
1688,
29918,
1885,
25426,
29918,
20908,
1414,
29889,
2272,
13,
15945,
29908,
7355,
363,
6724,
5739,
25426,
18733,
1414,
15758,
1061,
1213,
15945,
13,
5215,
443,
27958,
13,
13,
3166,
19262,
29889,
3084,
4097,
1053,
5739,
25426,
29928,
786,
1414,
13,
3166,
19262,
29889,
1990,
14903,
1053,
5739,
25426,
29928,
786,
1414,
2385,
3709,
13,
3166,
869,
3084,
1061,
29918,
3188,
1053,
15758,
1061,
5160,
13,
13,
13,
1990,
4321,
15462,
25426,
29928,
786,
1414,
24204,
29898,
24204,
5160,
29892,
443,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
29909,
770,
304,
1243,
278,
5739,
25426,
18733,
1414,
15758,
1061,
1213,
15945,
13,
13,
1678,
822,
2854,
1061,
29918,
8758,
29898,
1311,
1125,
13,
4706,
9995,
11609,
20853,
293,
5141,
1414,
2777,
1213,
15945,
13,
4706,
736,
5739,
25426,
29928,
786,
1414,
10456,
1311,
29889,
7529,
29897,
13,
13,
1678,
822,
770,
3709,
29918,
8758,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
20853,
293,
5141,
1414,
770,
3709,
2777,
1213,
15945,
13,
4706,
736,
5739,
25426,
29928,
786,
1414,
2385,
3709,
580,
13,
13,
1678,
822,
5713,
15546,
29918,
978,
29898,
1311,
1125,
13,
4706,
9995,
11609,
278,
5713,
15546,
1024,
363,
20853,
293,
5141,
1414,
1213,
15945,
13,
4706,
736,
376,
1885,
25426,
29918,
20908,
1414,
29908,
13,
2
] |
ci-tests/tests/__main__.py | fossabot/hoard | 0 | 99873 | <filename>ci-tests/tests/__main__.py<gh_stars>0
import hashlib
import os
import subprocess
import sys
from pathlib import Path
from testers.cleanup import LogCleanupTester
from testers.correct_errors import CorrectErrorsTester
from testers.hoard_diff import DiffCommandTester
from testers.hoard_edit import EditCommandTester
from testers.hoard_list import ListHoardsTester
from testers.hoard_status import StatusCommandTester
from testers.hoard_tester import HoardFile, Environment
from testers.ignore_filter import IgnoreFilterTester
from testers.last_paths import LastPathsTester
from testers.no_config_dir import MissingConfigDirTester
from testers.operations import OperationCheckerTester
from testers.yaml_support import YAMLSupportTester
for var in ["CI", "GITHUB_ACTIONS"]:
val = os.environ.get(var)
if val is None or val != "true":
raise RuntimeError("These tests must be run on GitHub Actions!")
def print_logs():
print("\n### Logs:")
data_dir = LastPathsTester.data_dir_path()
for dirpath, _, filenames in os.walk(data_dir):
for file in filenames:
if file.endswith(".log"):
path = str(Path(dirpath).joinpath(file))
print(f"\n##########\n\t{path}")
sys.stdout.flush()
subprocess.run(["cat", path])
sys.stdout.flush()
print("\n##########")
def print_checksums():
print("\n### Checksums:")
for env in list(Environment):
for file in list(HoardFile):
if file is not HoardFile.AnonDir and file is not HoardFile.NamedDir1 and file is not HoardFile.NamedDir2:
path = Path.home().joinpath(f"{env.value}_{file.value}")
if path.exists():
with open(path, "rb") as file:
print(f"{path}: {hashlib.md5(file.read()).hexdigest()}")
TEST_MAPPING = {
"cleanup": ("cleanup", LogCleanupTester),
"diff_command": ("diff command", DiffCommandTester),
"edit_command": ("edit command", EditCommandTester),
"errors": ("expected errors", CorrectErrorsTester),
"ignore": ("ignore filter", IgnoreFilterTester),
"last_paths": ("last paths", LastPathsTester),
"list_hoards": ("list command", ListHoardsTester),
"missing_config": ("missing config dir", MissingConfigDirTester),
"operation": ("operation", OperationCheckerTester),
"status_command": ("status command", StatusCommandTester),
"yaml": ("YAML compat", YAMLSupportTester),
}
if __name__ == "__main__":
if len(sys.argv) == 1:
raise RuntimeError("One argument - the test - is required")
successful = []
try:
test_arg = sys.argv[1]
desc = None
if test_arg == "all":
print("Running all tests")
for desc, cls in TEST_MAPPING.values():
print(f"=== Running {desc} test ===")
cls().run_test()
successful.append(desc)
elif test_arg in TEST_MAPPING:
desc, cls = TEST_MAPPING[test_arg]
print(f"Running {desc} test")
cls().run_test()
else:
raise RuntimeError(f"Invalid argument {test_arg}")
except Exception:
sys.stdout.flush()
if desc:
print(f"=== Error while running {desc} test ===")
if len(successful) > 0:
print(f"=== Successful tests: {', '.join(successful)} ===")
data_dir = LastPathsTester.data_dir_path()
print("\n### Hoards:")
sys.stdout.flush()
subprocess.run(["tree", str(data_dir)])
print("\n### Home:")
sys.stdout.flush()
subprocess.run(["tree", "-aL", "3", str(Path.home())])
print_checksums()
print_logs()
print("\n### Configs:")
config_dir = LastPathsTester.config_file_path().parent
for file in os.listdir(config_dir):
file_path = config_dir.joinpath(file)
if file_path.is_file():
with open(file_path, "r", encoding="utf-8") as opened:
print(f"##### {file_path}\n")
print(opened.read())
raise
| [
1,
529,
9507,
29958,
455,
29899,
21150,
29914,
21150,
29914,
1649,
3396,
26914,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
6608,
1982,
13,
5215,
2897,
13,
5215,
1014,
5014,
13,
5215,
10876,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
1243,
414,
29889,
14941,
786,
1053,
4522,
29907,
14044,
786,
3057,
261,
13,
3166,
1243,
414,
29889,
15728,
29918,
12523,
1053,
28518,
22463,
3057,
261,
13,
3166,
1243,
414,
29889,
1251,
538,
29918,
12765,
1053,
360,
2593,
6255,
3057,
261,
13,
3166,
1243,
414,
29889,
1251,
538,
29918,
5628,
1053,
7641,
6255,
3057,
261,
13,
3166,
1243,
414,
29889,
1251,
538,
29918,
1761,
1053,
2391,
29950,
29877,
3163,
3057,
261,
13,
3166,
1243,
414,
29889,
1251,
538,
29918,
4882,
1053,
16034,
6255,
3057,
261,
13,
3166,
1243,
414,
29889,
1251,
538,
29918,
1688,
261,
1053,
8335,
538,
2283,
29892,
16738,
13,
3166,
1243,
414,
29889,
17281,
29918,
4572,
1053,
18076,
487,
5072,
3057,
261,
13,
3166,
1243,
414,
29889,
4230,
29918,
24772,
1053,
9208,
2605,
29879,
3057,
261,
13,
3166,
1243,
414,
29889,
1217,
29918,
2917,
29918,
3972,
1053,
4750,
292,
3991,
9170,
3057,
261,
13,
3166,
1243,
414,
29889,
3372,
800,
1053,
20462,
5596,
261,
3057,
261,
13,
3166,
1243,
414,
29889,
25162,
29918,
5924,
1053,
612,
23956,
14039,
3057,
261,
13,
13,
13,
1454,
722,
297,
6796,
8426,
613,
376,
29954,
13054,
7466,
29918,
24705,
29903,
3108,
29901,
13,
1678,
659,
353,
2897,
29889,
21813,
29889,
657,
29898,
1707,
29897,
13,
1678,
565,
659,
338,
6213,
470,
659,
2804,
376,
3009,
1115,
13,
4706,
12020,
24875,
2392,
703,
1349,
968,
6987,
1818,
367,
1065,
373,
25492,
319,
1953,
29991,
1159,
13,
13,
13,
1753,
1596,
29918,
20756,
7295,
13,
1678,
1596,
14182,
29876,
2277,
29937,
4522,
29879,
29901,
1159,
13,
1678,
848,
29918,
3972,
353,
9208,
2605,
29879,
3057,
261,
29889,
1272,
29918,
3972,
29918,
2084,
580,
13,
1678,
363,
4516,
2084,
29892,
17117,
977,
264,
1280,
297,
2897,
29889,
20919,
29898,
1272,
29918,
3972,
1125,
13,
4706,
363,
934,
297,
977,
264,
1280,
29901,
13,
9651,
565,
934,
29889,
1975,
2541,
17350,
1188,
29908,
1125,
13,
18884,
2224,
353,
851,
29898,
2605,
29898,
3972,
2084,
467,
7122,
2084,
29898,
1445,
876,
13,
18884,
1596,
29898,
29888,
26732,
29876,
7346,
2277,
29905,
29876,
29905,
29873,
29912,
2084,
27195,
13,
18884,
10876,
29889,
25393,
29889,
23126,
580,
13,
18884,
1014,
5014,
29889,
3389,
29898,
3366,
4117,
613,
2224,
2314,
13,
18884,
10876,
29889,
25393,
29889,
23126,
580,
13,
18884,
1596,
14182,
29876,
7346,
2277,
1159,
13,
13,
13,
1753,
1596,
29918,
3198,
2083,
29879,
7295,
13,
1678,
1596,
14182,
29876,
2277,
29937,
5399,
2083,
29879,
29901,
1159,
13,
1678,
363,
8829,
297,
1051,
29898,
18649,
1125,
13,
4706,
363,
934,
297,
1051,
29898,
29950,
29877,
538,
2283,
1125,
13,
9651,
565,
934,
338,
451,
8335,
538,
2283,
29889,
2744,
265,
9170,
322,
934,
338,
451,
8335,
538,
2283,
29889,
22175,
9170,
29896,
322,
934,
338,
451,
8335,
538,
2283,
29889,
22175,
9170,
29906,
29901,
13,
18884,
2224,
353,
10802,
29889,
5184,
2141,
7122,
2084,
29898,
29888,
29908,
29912,
6272,
29889,
1767,
3227,
1445,
29889,
1767,
27195,
13,
18884,
565,
2224,
29889,
9933,
7295,
13,
462,
1678,
411,
1722,
29898,
2084,
29892,
376,
6050,
1159,
408,
934,
29901,
13,
462,
4706,
1596,
29898,
29888,
29908,
29912,
2084,
6177,
426,
8568,
1982,
29889,
3487,
29945,
29898,
1445,
29889,
949,
16655,
20970,
7501,
342,
580,
27195,
13,
13,
13,
18267,
29918,
1529,
18009,
4214,
353,
426,
13,
1678,
376,
14941,
786,
1115,
4852,
14941,
786,
613,
4522,
29907,
14044,
786,
3057,
261,
511,
13,
1678,
376,
12765,
29918,
6519,
1115,
4852,
12765,
1899,
613,
360,
2593,
6255,
3057,
261,
511,
13,
1678,
376,
5628,
29918,
6519,
1115,
4852,
5628,
1899,
613,
7641,
6255,
3057,
261,
511,
13,
1678,
376,
12523,
1115,
4852,
9684,
4436,
613,
28518,
22463,
3057,
261,
511,
13,
1678,
376,
17281,
1115,
4852,
17281,
4175,
613,
18076,
487,
5072,
3057,
261,
511,
13,
1678,
376,
4230,
29918,
24772,
1115,
4852,
4230,
10898,
613,
9208,
2605,
29879,
3057,
261,
511,
13,
1678,
376,
1761,
29918,
1251,
3163,
1115,
4852,
1761,
1899,
613,
2391,
29950,
29877,
3163,
3057,
261,
511,
13,
1678,
376,
27259,
29918,
2917,
1115,
4852,
27259,
2295,
4516,
613,
4750,
292,
3991,
9170,
3057,
261,
511,
13,
1678,
376,
16453,
1115,
4852,
16453,
613,
20462,
5596,
261,
3057,
261,
511,
13,
1678,
376,
4882,
29918,
6519,
1115,
4852,
4882,
1899,
613,
16034,
6255,
3057,
261,
511,
13,
1678,
376,
25162,
1115,
4852,
29979,
23956,
10007,
613,
612,
23956,
14039,
3057,
261,
511,
13,
29913,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29896,
29901,
13,
4706,
12020,
24875,
2392,
703,
6716,
2980,
448,
278,
1243,
448,
338,
3734,
1159,
13,
1678,
9150,
353,
5159,
13,
1678,
1018,
29901,
13,
4706,
1243,
29918,
1191,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
4706,
5153,
353,
6213,
13,
4706,
565,
1243,
29918,
1191,
1275,
376,
497,
1115,
13,
9651,
1596,
703,
27795,
599,
6987,
1159,
13,
9651,
363,
5153,
29892,
1067,
29879,
297,
17067,
1254,
29918,
1529,
18009,
4214,
29889,
5975,
7295,
13,
18884,
1596,
29898,
29888,
29908,
25512,
19509,
426,
14273,
29913,
1243,
1275,
543,
29897,
13,
18884,
1067,
29879,
2141,
3389,
29918,
1688,
580,
13,
18884,
9150,
29889,
4397,
29898,
14273,
29897,
13,
4706,
25342,
1243,
29918,
1191,
297,
17067,
1254,
29918,
1529,
18009,
4214,
29901,
13,
9651,
5153,
29892,
1067,
29879,
353,
17067,
1254,
29918,
1529,
18009,
4214,
29961,
1688,
29918,
1191,
29962,
13,
9651,
1596,
29898,
29888,
29908,
27795,
426,
14273,
29913,
1243,
1159,
13,
9651,
1067,
29879,
2141,
3389,
29918,
1688,
580,
13,
4706,
1683,
29901,
13,
9651,
12020,
24875,
2392,
29898,
29888,
29908,
13919,
2980,
426,
1688,
29918,
1191,
27195,
13,
1678,
5174,
8960,
29901,
13,
4706,
10876,
29889,
25393,
29889,
23126,
580,
13,
4706,
565,
5153,
29901,
13,
9651,
1596,
29898,
29888,
29908,
25512,
4829,
1550,
2734,
426,
14273,
29913,
1243,
1275,
543,
29897,
13,
4706,
565,
7431,
29898,
8698,
1319,
29897,
1405,
29871,
29900,
29901,
13,
9651,
1596,
29898,
29888,
29908,
25512,
21397,
1319,
6987,
29901,
426,
742,
15300,
7122,
29898,
8698,
1319,
2915,
1275,
543,
29897,
13,
4706,
848,
29918,
3972,
353,
9208,
2605,
29879,
3057,
261,
29889,
1272,
29918,
3972,
29918,
2084,
580,
13,
4706,
1596,
14182,
29876,
2277,
29937,
8335,
3163,
29901,
1159,
13,
4706,
10876,
29889,
25393,
29889,
23126,
580,
13,
4706,
1014,
5014,
29889,
3389,
29898,
3366,
8336,
613,
851,
29898,
1272,
29918,
3972,
29897,
2314,
13,
4706,
1596,
14182,
29876,
2277,
29937,
8778,
29901,
1159,
13,
4706,
10876,
29889,
25393,
29889,
23126,
580,
13,
4706,
1014,
5014,
29889,
3389,
29898,
3366,
8336,
613,
11663,
29874,
29931,
613,
376,
29941,
613,
851,
29898,
2605,
29889,
5184,
3101,
2314,
13,
4706,
1596,
29918,
3198,
2083,
29879,
580,
13,
4706,
1596,
29918,
20756,
580,
13,
4706,
1596,
14182,
29876,
2277,
29937,
12782,
29879,
29901,
1159,
13,
4706,
2295,
29918,
3972,
353,
9208,
2605,
29879,
3057,
261,
29889,
2917,
29918,
1445,
29918,
2084,
2141,
3560,
13,
4706,
363,
934,
297,
2897,
29889,
1761,
3972,
29898,
2917,
29918,
3972,
1125,
13,
9651,
934,
29918,
2084,
353,
2295,
29918,
3972,
29889,
7122,
2084,
29898,
1445,
29897,
13,
9651,
565,
934,
29918,
2084,
29889,
275,
29918,
1445,
7295,
13,
18884,
411,
1722,
29898,
1445,
29918,
2084,
29892,
376,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
6496,
29901,
13,
462,
1678,
1596,
29898,
29888,
29908,
4136,
29937,
426,
1445,
29918,
2084,
1012,
29876,
1159,
13,
462,
1678,
1596,
29898,
3150,
287,
29889,
949,
3101,
13,
4706,
12020,
13,
2
] |
input/scrap_record.py | ibrahimberb/My-ELASPIC-Web-API | 0 | 194069 | <reponame>ibrahimberb/My-ELASPIC-Web-API
from bs4 import BeautifulSoup as BS
import re
import logging
logging.basicConfig(level=logging.INFO, format='%(message)s')
def split_pair_occurrence(input_str):
"""
Q9HD36.A79T (x11) → (Q9HD36.A79T, 11)
"""
if '(x' not in input_str:
return input_str, 1
pair, occurrence = [item.strip() for item in input_str.split()]
occurrence = int(occurrence[2:-1])
return pair, occurrence
def get_stripped_error_title(error_str):
"""Get rid of paranthesis and numbers within."""
error_title = re.sub(r"\((\d+)\)" + ":", '', error_str).strip()
return error_title
def count_duplicates(values):
"""Counting the number of duplicates."""
return sum([split_pair_occurrence(value)[1] for value in values])
def process_single_error(html_text):
"""
Processes single error with its title and values.
Parameters
----------
html_text : <str>
The HTML text which contains information to be scrapped.
Returns
-------
error_title : <str>
Error title, e.g. Invalid syntax.
values : <list>
Error values, e.g. ['Q9HD36.A79T', 'Q9ULH7.G370R']
num_values : <int>
Number of error values.
If Error title is `Duplicated`, then it counts the number of total occurrences.
e.g. ['Q06418.A379T (x3)'] → 3.
For other cases, returns the number of items in values.
e.g. ['Q9HD36.A79T', 'Q9ULH7.G370R'] → 2
"""
soup_single_error = BS(html_text, 'lxml')
soup_copy = soup_single_error.__copy__()
for s in soup_copy.select('span'):
s.extract()
error_title = get_stripped_error_title(soup_copy.get_text())
logging.info(' TITLE '.center(40, '-')) # TODO, the title can be placed here
logging.info(f'TITLE: {error_title}') # not here.
error_items = soup_single_error.find("span", {"class": "resp"})
values = [value.strip() for value in error_items.get_text().split(',')]
logging.info("VALUES ({}) : {}".format(len(values), values))
if error_title == "Duplicates":
num_values = count_duplicates(values)
else:
num_values = len(values)
logging.info('-' * 40)
return error_title, values, num_values
| [
1,
529,
276,
1112,
420,
29958,
747,
19856,
326,
495,
29890,
29914,
3421,
29899,
6670,
3289,
2227,
29907,
29899,
3609,
29899,
8787,
13,
3166,
24512,
29946,
1053,
25685,
29903,
1132,
408,
350,
29903,
13,
5215,
337,
13,
5215,
12183,
13,
13,
21027,
29889,
16121,
3991,
29898,
5563,
29922,
21027,
29889,
11690,
29892,
3402,
2433,
29995,
29898,
4906,
29897,
29879,
1495,
13,
13,
13,
1753,
6219,
29918,
18784,
29918,
15693,
26841,
29898,
2080,
29918,
710,
1125,
13,
1678,
9995,
13,
1678,
660,
29929,
26124,
29941,
29953,
29889,
29909,
29955,
29929,
29911,
313,
29916,
29896,
29896,
29897,
10309,
313,
29984,
29929,
26124,
29941,
29953,
29889,
29909,
29955,
29929,
29911,
29892,
29871,
29896,
29896,
29897,
13,
1678,
9995,
13,
1678,
565,
525,
29898,
29916,
29915,
451,
297,
1881,
29918,
710,
29901,
13,
4706,
736,
1881,
29918,
710,
29892,
29871,
29896,
13,
13,
1678,
5101,
29892,
27170,
353,
518,
667,
29889,
17010,
580,
363,
2944,
297,
1881,
29918,
710,
29889,
5451,
580,
29962,
13,
1678,
27170,
353,
938,
29898,
15693,
26841,
29961,
29906,
13018,
29896,
2314,
13,
13,
1678,
736,
5101,
29892,
27170,
13,
13,
13,
1753,
679,
29918,
303,
374,
2986,
29918,
2704,
29918,
3257,
29898,
2704,
29918,
710,
1125,
13,
1678,
9995,
2577,
8177,
310,
610,
9716,
6656,
322,
3694,
2629,
1213,
15945,
13,
1678,
1059,
29918,
3257,
353,
337,
29889,
1491,
29898,
29878,
26732,
29898,
1194,
29881,
29974,
2144,
5513,
718,
29242,
613,
15516,
1059,
29918,
710,
467,
17010,
580,
13,
1678,
736,
1059,
29918,
3257,
13,
13,
13,
1753,
2302,
29918,
20908,
15815,
29898,
5975,
1125,
13,
1678,
9995,
3981,
292,
278,
1353,
310,
20955,
1213,
15945,
13,
1678,
736,
2533,
4197,
5451,
29918,
18784,
29918,
15693,
26841,
29898,
1767,
9601,
29896,
29962,
363,
995,
297,
1819,
2314,
13,
13,
13,
1753,
1889,
29918,
14369,
29918,
2704,
29898,
1420,
29918,
726,
1125,
13,
1678,
9995,
13,
4706,
10554,
267,
2323,
1059,
411,
967,
3611,
322,
1819,
29889,
13,
13,
4706,
12662,
2699,
13,
4706,
448,
1378,
29899,
13,
9651,
3472,
29918,
726,
584,
529,
710,
29958,
13,
18884,
450,
4544,
1426,
607,
3743,
2472,
304,
367,
24559,
2986,
29889,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
9651,
1059,
29918,
3257,
584,
529,
710,
29958,
13,
18884,
4829,
3611,
29892,
321,
29889,
29887,
29889,
21403,
5877,
29889,
13,
13,
9651,
1819,
584,
529,
1761,
29958,
13,
18884,
4829,
1819,
29892,
321,
29889,
29887,
29889,
6024,
29984,
29929,
26124,
29941,
29953,
29889,
29909,
29955,
29929,
29911,
742,
525,
29984,
29929,
13309,
29950,
29955,
29889,
29954,
29941,
29955,
29900,
29934,
2033,
13,
13,
9651,
954,
29918,
5975,
584,
529,
524,
29958,
13,
18884,
9681,
310,
1059,
1819,
29889,
13,
18884,
960,
4829,
3611,
338,
421,
29928,
786,
9169,
1673,
769,
372,
18139,
278,
1353,
310,
3001,
13920,
2063,
29889,
13,
462,
1678,
321,
29889,
29887,
29889,
6024,
29984,
29900,
29953,
29946,
29896,
29947,
29889,
29909,
29941,
29955,
29929,
29911,
313,
29916,
29941,
29897,
2033,
10309,
29871,
29941,
29889,
13,
18884,
1152,
916,
4251,
29892,
3639,
278,
1353,
310,
4452,
297,
1819,
29889,
13,
462,
1678,
321,
29889,
29887,
29889,
6024,
29984,
29929,
26124,
29941,
29953,
29889,
29909,
29955,
29929,
29911,
742,
525,
29984,
29929,
13309,
29950,
29955,
29889,
29954,
29941,
29955,
29900,
29934,
2033,
10309,
29871,
29906,
13,
4706,
9995,
13,
13,
1678,
22300,
29918,
14369,
29918,
2704,
353,
350,
29903,
29898,
1420,
29918,
726,
29892,
525,
29880,
3134,
1495,
13,
13,
1678,
22300,
29918,
8552,
353,
22300,
29918,
14369,
29918,
2704,
17255,
8552,
1649,
580,
13,
13,
1678,
363,
269,
297,
22300,
29918,
8552,
29889,
2622,
877,
9653,
29374,
13,
4706,
269,
29889,
21111,
580,
13,
13,
1678,
1059,
29918,
3257,
353,
679,
29918,
303,
374,
2986,
29918,
2704,
29918,
3257,
29898,
29879,
1132,
29918,
8552,
29889,
657,
29918,
726,
3101,
13,
1678,
12183,
29889,
3888,
877,
323,
1806,
1307,
15300,
5064,
29898,
29946,
29900,
29892,
17411,
8785,
29871,
396,
14402,
29892,
278,
3611,
508,
367,
7180,
1244,
13,
1678,
12183,
29889,
3888,
29898,
29888,
29915,
29911,
1806,
1307,
29901,
426,
2704,
29918,
3257,
29913,
1495,
1678,
396,
29871,
451,
1244,
29889,
13,
13,
1678,
1059,
29918,
7076,
353,
22300,
29918,
14369,
29918,
2704,
29889,
2886,
703,
9653,
613,
8853,
1990,
1115,
376,
13713,
29908,
1800,
13,
13,
1678,
1819,
353,
518,
1767,
29889,
17010,
580,
363,
995,
297,
1059,
29918,
7076,
29889,
657,
29918,
726,
2141,
5451,
29317,
1495,
29962,
13,
1678,
12183,
29889,
3888,
703,
8932,
12996,
21313,
1800,
584,
6571,
1642,
4830,
29898,
2435,
29898,
5975,
511,
1819,
876,
13,
13,
1678,
565,
1059,
29918,
3257,
1275,
376,
29928,
786,
15815,
1115,
13,
4706,
954,
29918,
5975,
353,
2302,
29918,
20908,
15815,
29898,
5975,
29897,
13,
1678,
1683,
29901,
13,
4706,
954,
29918,
5975,
353,
7431,
29898,
5975,
29897,
13,
13,
1678,
12183,
29889,
3888,
877,
29899,
29915,
334,
29871,
29946,
29900,
29897,
13,
13,
1678,
736,
1059,
29918,
3257,
29892,
1819,
29892,
954,
29918,
5975,
13,
2
] |
LintCode/DynamicProgramming/20200113_667_longest_palindromic_subsequence.py | Fabriceli/MachingLearning | 0 | 98876 | # -*-coding:utf-8 -*-
#Reference:**********************************************
# @Time : 2020-01-14 00:47
# @Author : <NAME>
# @File : 20200113_667_longest_palindromic_subsequence.py
# @User : liyihao
# @Software : PyCharm
# @Description: Given a string s, find the longest palindromic subsequence's length in s.
# You may assume that the maximum length of s is 1000.
#Reference:**********************************************
"""
Input: "bbbab"
Output: 4
Explanation:
One possible longest palindromic subsequence is "bbbb".
Input: "bbbbb"
Output: 5
"""
class Solution:
def longestPalindromeSubseq(self, s: str) -> int:
if not s:
return 0
if len(s) == 1:
return 1
size = len(s)
dp = [[0 for _ in range(size)] for _ in range(size)]
for i in range(size - 1, -1, -1):
dp[i][i] = 1
for j in range(i + 1, size):
if s[i] == s[j]:
dp[i][j] = dp[i + 1][j - 1] + 2
else:
dp[i][j] = max(dp[i + 1][j], dp[i][j - 1])
return max(dp[0])
if __name__ == '__main__':
s = Solution()
st = 'b'
print(s.longestPalindromeSubseq(st))
| [
1,
396,
448,
29930,
29899,
29883,
3689,
29901,
9420,
29899,
29947,
448,
29930,
29899,
13,
29937,
7422,
29901,
7775,
7775,
4189,
2328,
1068,
13,
29937,
732,
2481,
30081,
20246,
29871,
584,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29896,
29899,
29896,
29946,
29871,
29900,
29900,
29901,
29946,
29955,
13,
29937,
732,
13720,
30081,
29871,
584,
529,
5813,
29958,
13,
29937,
732,
2283,
30081,
20246,
29871,
584,
29871,
29906,
29900,
29906,
29900,
29900,
29896,
29896,
29941,
29918,
29953,
29953,
29955,
29918,
5426,
342,
29918,
7830,
513,
456,
293,
29918,
1491,
16506,
29889,
2272,
13,
29937,
732,
2659,
30081,
20246,
29871,
584,
619,
25675,
2350,
29877,
13,
29937,
732,
6295,
14093,
584,
10772,
1451,
2817,
13,
29937,
732,
9868,
29901,
11221,
263,
1347,
269,
29892,
1284,
278,
27217,
5112,
513,
456,
293,
1014,
16506,
29915,
29879,
3309,
297,
269,
29889,
13,
29937,
1669,
887,
1122,
5251,
393,
278,
7472,
3309,
310,
269,
338,
29871,
29896,
29900,
29900,
29900,
29889,
13,
29937,
7422,
29901,
7775,
7775,
4189,
2328,
1068,
13,
15945,
29908,
13,
4290,
29901,
376,
1327,
29890,
370,
29908,
13,
6466,
29901,
29871,
29946,
13,
1252,
9018,
362,
29901,
13,
6716,
1950,
27217,
5112,
513,
456,
293,
1014,
16506,
338,
376,
1327,
1327,
1642,
13,
13,
4290,
29901,
376,
1327,
1327,
29890,
29908,
13,
6466,
29901,
29871,
29945,
13,
15945,
29908,
13,
13,
1990,
24380,
29901,
13,
1678,
822,
27217,
18210,
513,
4871,
4035,
11762,
29898,
1311,
29892,
269,
29901,
851,
29897,
1599,
938,
29901,
13,
4706,
565,
451,
269,
29901,
13,
9651,
736,
29871,
29900,
13,
4706,
565,
7431,
29898,
29879,
29897,
1275,
29871,
29896,
29901,
13,
9651,
736,
29871,
29896,
13,
4706,
2159,
353,
7431,
29898,
29879,
29897,
13,
4706,
270,
29886,
353,
5519,
29900,
363,
903,
297,
3464,
29898,
2311,
4638,
363,
903,
297,
3464,
29898,
2311,
4638,
13,
13,
4706,
363,
474,
297,
3464,
29898,
2311,
448,
29871,
29896,
29892,
448,
29896,
29892,
448,
29896,
1125,
13,
9651,
270,
29886,
29961,
29875,
3816,
29875,
29962,
353,
29871,
29896,
13,
9651,
363,
432,
297,
3464,
29898,
29875,
718,
29871,
29896,
29892,
2159,
1125,
13,
18884,
565,
269,
29961,
29875,
29962,
1275,
269,
29961,
29926,
5387,
13,
462,
1678,
270,
29886,
29961,
29875,
3816,
29926,
29962,
353,
270,
29886,
29961,
29875,
718,
29871,
29896,
3816,
29926,
448,
29871,
29896,
29962,
718,
29871,
29906,
13,
18884,
1683,
29901,
13,
462,
1678,
270,
29886,
29961,
29875,
3816,
29926,
29962,
353,
4236,
29898,
6099,
29961,
29875,
718,
29871,
29896,
3816,
29926,
1402,
270,
29886,
29961,
29875,
3816,
29926,
448,
29871,
29896,
2314,
13,
4706,
736,
4236,
29898,
6099,
29961,
29900,
2314,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
269,
353,
24380,
580,
13,
1678,
380,
353,
525,
29890,
29915,
13,
1678,
1596,
29898,
29879,
29889,
5426,
342,
18210,
513,
4871,
4035,
11762,
29898,
303,
876,
13,
2
] |
src/cfgparse.py | user12986714/SpamSoup | 0 | 49417 | <reponame>user12986714/SpamSoup<filename>src/cfgparse.py
# coding=utf-8
import json
import decorator
import verinfo
def resolve_path(base, path):
""" Resolve (some) relative path. """
if path[0] == "/":
# Absolute path
return path
return base + path
def depth_first_parser(data_base, route, exec_cfg):
""" Depth first parser for ml route. """
parsed_cfg = list()
for node in route:
parsed_node = dict()
assert node["exec"] in exec_cfg
parsed_node["exec"] = node["exec"]
if exec_cfg[node["exec"]]["type"] in {1, 2}: # Same format
assert isinstance(node["data"], str)
parsed_node["data"] = resolve_path(data_base, node["data"])
if "succ" in node:
assert isinstance(node["succ"], list)
assert node["succ"]
parsed_node["succ"] = depth_first_parser(data_base, node["succ"], exec_cfg)
parsed_cfg.append(parsed_node)
return parsed_cfg
def parse(cfg_file):
""" Parse config. """
# There is no try-except block here, and is intended.
# The program should stop and print out the traceback as
# it won't work properly with invalid config anyway.
with open(cfg_file, "r", encoding="utf-8") as cfg_stream:
cfg = json.load(cfg_stream)
if "general" not in cfg:
bin_base = ""
data_base = ""
print("The old config format is deprecated. Support will be removed in version 3.")
else:
assert isinstance(cfg["general"]["ver"], int)
cfg_ver = cfg["general"]["ver"]
if cfg_ver < verinfo.cfg_ver_min:
err_msg = "Config format is no longer supported. Min support version: {}; active version: {}"
err_msg = err_msg.format(verinfo.cfg_ver_min, verinfo.cfg_ver_active)
print(err_msg)
raise RuntimeError(err_msg)
if cfg_ver < verinfo.cfg_ver_active:
print("Config format is deprecated. Active version: {}".format(verinfo.cfg_ver_active))
if "bin_base" in cfg["general"]:
assert isinstance(cfg["general"]["bin_base"], str)
bin_base = cfg["general"]["bin_base"]
if bin_base[-1] != "/":
bin_base += "/"
if "data_base" in cfg["general"]:
assert isinstance(cfg["general"]["data_base"], str)
data_base = cfg["general"]["data_base"]
if data_base[-1] != "/":
data_base += "/"
output_levels = {"VERBOSE": 0, "DEBUG": 1, "INFO": 2,
"WARNING": 3, "ERROR": 4, "CRITICAL": 5}
config = dict()
assert isinstance(cfg["io"]["dest"], list)
config["msg"] = {"dest": list()}
for file in cfg["io"]["dest"]:
assert isinstance(file["path"], str)
assert isinstance(file["level"], str)
assert file["level"].upper() in output_levels
config["msg"]["dest"].append({"path": file["path"],
"level": output_levels[file["level"].upper()]})
assert isinstance(cfg["ms"]["ms_host"], str)
assert isinstance(cfg["ms"]["ws_host"], str)
assert isinstance(cfg["ms"]["api_key"], str)
assert isinstance(cfg["ms"]["ws_max_retry"], int)
assert isinstance(cfg["ms"]["ws_retry_sleep"], int)
assert isinstance(cfg["ms"]["ws_timeout"], int)
assert cfg["ms"]["ms_host"]
assert cfg["ms"]["ws_host"]
assert cfg["ms"]["api_key"]
assert cfg["ms"]["ws_max_retry"] > -2 # >= -1
assert cfg["ms"]["ws_retry_sleep"] > -1 # >= 0
assert cfg["ms"]["ws_timeout"] > 0
config["ws"] = {"ws_host": cfg["ms"]["ws_host"],
"ms_host": cfg["ms"]["ms_host"],
"api_key": cfg["ms"]["api_key"],
"max_retry": cfg["ms"]["ws_max_retry"],
"retry_sleep": cfg["ms"]["ws_retry_sleep"],
"timeout": cfg["ms"]["ws_timeout"]}
config["msapi"] = {"ms_host": cfg["ms"]["ms_host"],
"api_key": cfg["ms"]["api_key"]}
assert isinstance(cfg["ml"]["feedback"]["naa_to_tp"], float)
assert isinstance(cfg["ml"]["feedback"]["naa_to_fp"], float)
assert isinstance(cfg["ml"]["feedback"]["un_thres"], float)
assert isinstance(cfg["ml"]["feedback"]["co_thres"], float)
config["ml"] = {"feedback": {"naa_to_tp": cfg["ml"]["feedback"]["naa_to_tp"],
"naa_to_fp": cfg["ml"]["feedback"]["naa_to_fp"],
"un_thres": cfg["ml"]["feedback"]["un_thres"],
"co_thres": cfg["ml"]["feedback"]["co_thres"]}}
config["ml"]["exec"] = dict()
for exec_name in cfg["ml"]["exec"]:
assert isinstance(exec_name, str)
assert isinstance(cfg["ml"]["exec"][exec_name]["bin"], str)
assert isinstance(cfg["ml"]["exec"][exec_name]["type"], int)
config["ml"]["exec"][exec_name] = {"bin": resolve_path(bin_base, cfg["ml"]["exec"][exec_name]["bin"]),
"type": cfg["ml"]["exec"][exec_name]["type"]}
if "decorator" in cfg["ml"]["exec"][exec_name]:
assert isinstance(cfg["ml"]["exec"][exec_name]["decorator"], str)
config["ml"]["exec"][exec_name]["decorator"] = getattr(decorator,
cfg["ml"]["exec"][exec_name]["decorator"])
config["ml"]["route"] = list()
config["ml"]["route"] = depth_first_parser(data_base, cfg["ml"]["route"], config["ml"]["exec"])
return config
def parse_sw(sw_file):
""" Parse stopword config. """
with open(sw_file, "r", encoding="utf-8") as sw_stream:
sw = json.load(sw_stream)
assert isinstance(sw["wordlist"], list)
for word in sw["wordlist"]:
assert isinstance(word, str)
stopword = sw["wordlist"]
return stopword
| [
1,
529,
276,
1112,
420,
29958,
1792,
29896,
29906,
29929,
29947,
29953,
29955,
29896,
29946,
29914,
5592,
314,
29903,
1132,
29966,
9507,
29958,
4351,
29914,
16859,
5510,
29889,
2272,
13,
29937,
14137,
29922,
9420,
29899,
29947,
13,
13,
5215,
4390,
13,
5215,
10200,
1061,
13,
5215,
1147,
3888,
13,
13,
13,
1753,
8814,
29918,
2084,
29898,
3188,
29892,
2224,
1125,
13,
1678,
9995,
24062,
345,
313,
5372,
29897,
6198,
2224,
29889,
9995,
13,
1678,
565,
2224,
29961,
29900,
29962,
1275,
5591,
1115,
13,
4706,
396,
1976,
14977,
2224,
13,
4706,
736,
2224,
13,
1678,
736,
2967,
718,
2224,
13,
13,
13,
1753,
10809,
29918,
4102,
29918,
16680,
29898,
1272,
29918,
3188,
29892,
5782,
29892,
2279,
29918,
16859,
1125,
13,
1678,
9995,
10034,
386,
937,
13812,
363,
286,
29880,
5782,
29889,
9995,
13,
1678,
21213,
29918,
16859,
353,
1051,
580,
13,
1678,
363,
2943,
297,
5782,
29901,
13,
4706,
21213,
29918,
3177,
353,
9657,
580,
13,
4706,
4974,
2943,
3366,
4258,
3108,
297,
2279,
29918,
16859,
13,
4706,
21213,
29918,
3177,
3366,
4258,
3108,
353,
2943,
3366,
4258,
3108,
13,
13,
4706,
565,
2279,
29918,
16859,
29961,
3177,
3366,
4258,
3108,
29962,
3366,
1853,
3108,
297,
426,
29896,
29892,
29871,
29906,
6177,
29871,
396,
19491,
3402,
13,
9651,
4974,
338,
8758,
29898,
3177,
3366,
1272,
12436,
851,
29897,
13,
9651,
21213,
29918,
3177,
3366,
1272,
3108,
353,
8814,
29918,
2084,
29898,
1272,
29918,
3188,
29892,
2943,
3366,
1272,
20068,
13,
13,
4706,
565,
376,
2146,
617,
29908,
297,
2943,
29901,
13,
9651,
4974,
338,
8758,
29898,
3177,
3366,
2146,
617,
12436,
1051,
29897,
13,
9651,
4974,
2943,
3366,
2146,
617,
3108,
13,
9651,
21213,
29918,
3177,
3366,
2146,
617,
3108,
353,
10809,
29918,
4102,
29918,
16680,
29898,
1272,
29918,
3188,
29892,
2943,
3366,
2146,
617,
12436,
2279,
29918,
16859,
29897,
13,
13,
4706,
21213,
29918,
16859,
29889,
4397,
29898,
862,
8485,
29918,
3177,
29897,
13,
13,
1678,
736,
21213,
29918,
16859,
13,
13,
13,
1753,
6088,
29898,
16859,
29918,
1445,
1125,
13,
1678,
9995,
20969,
2295,
29889,
9995,
13,
1678,
396,
1670,
338,
694,
1018,
29899,
19499,
2908,
1244,
29892,
322,
338,
9146,
29889,
13,
1678,
396,
450,
1824,
881,
5040,
322,
1596,
714,
278,
9637,
1627,
408,
13,
1678,
396,
372,
2113,
29915,
29873,
664,
6284,
411,
8340,
2295,
8763,
29889,
13,
1678,
411,
1722,
29898,
16859,
29918,
1445,
29892,
376,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
274,
16434,
29918,
5461,
29901,
13,
4706,
274,
16434,
353,
4390,
29889,
1359,
29898,
16859,
29918,
5461,
29897,
13,
13,
1678,
565,
376,
17492,
29908,
451,
297,
274,
16434,
29901,
13,
4706,
9016,
29918,
3188,
353,
5124,
13,
4706,
848,
29918,
3188,
353,
5124,
13,
4706,
1596,
703,
1576,
2030,
2295,
3402,
338,
18164,
29889,
18601,
674,
367,
6206,
297,
1873,
29871,
29941,
23157,
13,
1678,
1683,
29901,
13,
4706,
4974,
338,
8758,
29898,
16859,
3366,
17492,
3108,
3366,
369,
12436,
938,
29897,
13,
4706,
274,
16434,
29918,
369,
353,
274,
16434,
3366,
17492,
3108,
3366,
369,
3108,
13,
4706,
565,
274,
16434,
29918,
369,
529,
1147,
3888,
29889,
16859,
29918,
369,
29918,
1195,
29901,
13,
9651,
4589,
29918,
7645,
353,
376,
3991,
3402,
338,
694,
5520,
6969,
29889,
3080,
2304,
1873,
29901,
15739,
6136,
1873,
29901,
426,
5038,
13,
9651,
4589,
29918,
7645,
353,
4589,
29918,
7645,
29889,
4830,
29898,
369,
3888,
29889,
16859,
29918,
369,
29918,
1195,
29892,
1147,
3888,
29889,
16859,
29918,
369,
29918,
4925,
29897,
13,
9651,
1596,
29898,
3127,
29918,
7645,
29897,
13,
9651,
12020,
24875,
2392,
29898,
3127,
29918,
7645,
29897,
13,
13,
4706,
565,
274,
16434,
29918,
369,
529,
1147,
3888,
29889,
16859,
29918,
369,
29918,
4925,
29901,
13,
9651,
1596,
703,
3991,
3402,
338,
18164,
29889,
10731,
1873,
29901,
6571,
1642,
4830,
29898,
369,
3888,
29889,
16859,
29918,
369,
29918,
4925,
876,
13,
13,
4706,
565,
376,
2109,
29918,
3188,
29908,
297,
274,
16434,
3366,
17492,
3108,
29901,
13,
9651,
4974,
338,
8758,
29898,
16859,
3366,
17492,
3108,
3366,
2109,
29918,
3188,
12436,
851,
29897,
13,
9651,
9016,
29918,
3188,
353,
274,
16434,
3366,
17492,
3108,
3366,
2109,
29918,
3188,
3108,
13,
9651,
565,
9016,
29918,
3188,
14352,
29896,
29962,
2804,
5591,
1115,
13,
18884,
9016,
29918,
3188,
4619,
5591,
29908,
13,
4706,
565,
376,
1272,
29918,
3188,
29908,
297,
274,
16434,
3366,
17492,
3108,
29901,
13,
9651,
4974,
338,
8758,
29898,
16859,
3366,
17492,
3108,
3366,
1272,
29918,
3188,
12436,
851,
29897,
13,
9651,
848,
29918,
3188,
353,
274,
16434,
3366,
17492,
3108,
3366,
1272,
29918,
3188,
3108,
13,
9651,
565,
848,
29918,
3188,
14352,
29896,
29962,
2804,
5591,
1115,
13,
18884,
848,
29918,
3188,
4619,
5591,
29908,
13,
13,
1678,
1962,
29918,
5563,
29879,
353,
8853,
5348,
8456,
1660,
1115,
29871,
29900,
29892,
376,
18525,
1115,
29871,
29896,
29892,
376,
11690,
1115,
29871,
29906,
29892,
13,
462,
268,
376,
29956,
25614,
1115,
29871,
29941,
29892,
376,
11432,
1115,
29871,
29946,
29892,
376,
11341,
1806,
2965,
1964,
1115,
29871,
29945,
29913,
13,
1678,
2295,
353,
9657,
580,
13,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
601,
3108,
3366,
7854,
12436,
1051,
29897,
13,
13,
1678,
2295,
3366,
7645,
3108,
353,
8853,
7854,
1115,
1051,
28296,
13,
1678,
363,
934,
297,
274,
16434,
3366,
601,
3108,
3366,
7854,
3108,
29901,
13,
4706,
4974,
338,
8758,
29898,
1445,
3366,
2084,
12436,
851,
29897,
13,
4706,
4974,
338,
8758,
29898,
1445,
3366,
5563,
12436,
851,
29897,
13,
13,
4706,
4974,
934,
3366,
5563,
16862,
21064,
580,
297,
1962,
29918,
5563,
29879,
13,
13,
4706,
2295,
3366,
7645,
3108,
3366,
7854,
16862,
4397,
3319,
29908,
2084,
1115,
934,
3366,
2084,
12436,
13,
462,
462,
418,
376,
5563,
1115,
1962,
29918,
5563,
29879,
29961,
1445,
3366,
5563,
16862,
21064,
580,
29962,
1800,
13,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
1516,
3108,
3366,
1516,
29918,
3069,
12436,
851,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
1516,
3108,
3366,
5652,
29918,
3069,
12436,
851,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
1516,
3108,
3366,
2754,
29918,
1989,
12436,
851,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
1516,
3108,
3366,
5652,
29918,
3317,
29918,
276,
2202,
12436,
938,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
1516,
3108,
3366,
5652,
29918,
276,
2202,
29918,
17059,
12436,
938,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
1516,
3108,
3366,
5652,
29918,
15619,
12436,
938,
29897,
13,
13,
1678,
4974,
274,
16434,
3366,
1516,
3108,
3366,
1516,
29918,
3069,
3108,
13,
1678,
4974,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
3069,
3108,
13,
1678,
4974,
274,
16434,
3366,
1516,
3108,
3366,
2754,
29918,
1989,
3108,
13,
1678,
4974,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
3317,
29918,
276,
2202,
3108,
1405,
448,
29906,
29871,
396,
6736,
448,
29896,
13,
1678,
4974,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
276,
2202,
29918,
17059,
3108,
1405,
448,
29896,
29871,
396,
6736,
29871,
29900,
13,
1678,
4974,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
15619,
3108,
1405,
29871,
29900,
13,
13,
1678,
2295,
3366,
5652,
3108,
353,
8853,
5652,
29918,
3069,
1115,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
3069,
12436,
13,
462,
1678,
376,
1516,
29918,
3069,
1115,
274,
16434,
3366,
1516,
3108,
3366,
1516,
29918,
3069,
12436,
13,
462,
1678,
376,
2754,
29918,
1989,
1115,
274,
16434,
3366,
1516,
3108,
3366,
2754,
29918,
1989,
12436,
13,
462,
1678,
376,
3317,
29918,
276,
2202,
1115,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
3317,
29918,
276,
2202,
12436,
13,
462,
1678,
376,
276,
2202,
29918,
17059,
1115,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
276,
2202,
29918,
17059,
12436,
13,
462,
1678,
376,
15619,
1115,
274,
16434,
3366,
1516,
3108,
3366,
5652,
29918,
15619,
3108,
29913,
13,
13,
1678,
2295,
3366,
1516,
2754,
3108,
353,
8853,
1516,
29918,
3069,
1115,
274,
16434,
3366,
1516,
3108,
3366,
1516,
29918,
3069,
12436,
13,
462,
539,
376,
2754,
29918,
1989,
1115,
274,
16434,
3366,
1516,
3108,
3366,
2754,
29918,
1989,
3108,
29913,
13,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
1056,
29874,
29918,
517,
29918,
9392,
12436,
5785,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
1056,
29874,
29918,
517,
29918,
18091,
12436,
5785,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
348,
29918,
386,
690,
12436,
5785,
29897,
13,
1678,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
1111,
29918,
386,
690,
12436,
5785,
29897,
13,
13,
1678,
2295,
3366,
828,
3108,
353,
8853,
18798,
1627,
1115,
8853,
1056,
29874,
29918,
517,
29918,
9392,
1115,
274,
16434,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
1056,
29874,
29918,
517,
29918,
9392,
12436,
13,
462,
462,
376,
1056,
29874,
29918,
517,
29918,
18091,
1115,
274,
16434,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
1056,
29874,
29918,
517,
29918,
18091,
12436,
13,
462,
462,
376,
348,
29918,
386,
690,
1115,
274,
16434,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
348,
29918,
386,
690,
12436,
13,
462,
462,
376,
1111,
29918,
386,
690,
1115,
274,
16434,
3366,
828,
3108,
3366,
18798,
1627,
3108,
3366,
1111,
29918,
386,
690,
3108,
930,
13,
13,
1678,
2295,
3366,
828,
3108,
3366,
4258,
3108,
353,
9657,
580,
13,
1678,
363,
2279,
29918,
978,
297,
274,
16434,
3366,
828,
3108,
3366,
4258,
3108,
29901,
13,
4706,
4974,
338,
8758,
29898,
4258,
29918,
978,
29892,
851,
29897,
13,
4706,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
2109,
12436,
851,
29897,
13,
4706,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
1853,
12436,
938,
29897,
13,
13,
4706,
2295,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
353,
8853,
2109,
1115,
8814,
29918,
2084,
29898,
2109,
29918,
3188,
29892,
274,
16434,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
2109,
3108,
511,
13,
462,
462,
965,
376,
1853,
1115,
274,
16434,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
1853,
3108,
29913,
13,
13,
4706,
565,
376,
19557,
1061,
29908,
297,
274,
16434,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
5387,
13,
9651,
4974,
338,
8758,
29898,
16859,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
19557,
1061,
12436,
851,
29897,
13,
9651,
2295,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
19557,
1061,
3108,
353,
679,
5552,
29898,
19557,
1061,
29892,
13,
462,
462,
462,
462,
259,
274,
16434,
3366,
828,
3108,
3366,
4258,
3108,
29961,
4258,
29918,
978,
29962,
3366,
19557,
1061,
20068,
13,
13,
1678,
2295,
3366,
828,
3108,
3366,
13134,
3108,
353,
1051,
580,
13,
1678,
2295,
3366,
828,
3108,
3366,
13134,
3108,
353,
10809,
29918,
4102,
29918,
16680,
29898,
1272,
29918,
3188,
29892,
274,
16434,
3366,
828,
3108,
3366,
13134,
12436,
2295,
3366,
828,
3108,
3366,
4258,
20068,
13,
13,
1678,
736,
2295,
13,
13,
13,
1753,
6088,
29918,
2774,
29898,
2774,
29918,
1445,
1125,
13,
1678,
9995,
20969,
5040,
1742,
2295,
29889,
9995,
13,
1678,
411,
1722,
29898,
2774,
29918,
1445,
29892,
376,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
2381,
29918,
5461,
29901,
13,
4706,
2381,
353,
4390,
29889,
1359,
29898,
2774,
29918,
5461,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
2774,
3366,
1742,
1761,
12436,
1051,
29897,
13,
1678,
363,
1734,
297,
2381,
3366,
1742,
1761,
3108,
29901,
13,
4706,
4974,
338,
8758,
29898,
1742,
29892,
851,
29897,
13,
13,
1678,
5040,
1742,
353,
2381,
3366,
1742,
1761,
3108,
13,
1678,
736,
5040,
1742,
13,
2
] |
filmoteca_api/admin.py | NelsonPenagos/filmoteca-app-api | 0 | 171115 | from django.contrib import admin
from filmoteca_api.models.movie_models import Movie
admin.site.register(Movie)
| [
1,
515,
9557,
29889,
21570,
1053,
4113,
13,
3166,
2706,
19011,
29918,
2754,
29889,
9794,
29889,
27362,
29918,
9794,
1053,
7871,
13,
13,
6406,
29889,
2746,
29889,
9573,
29898,
18749,
29897,
13,
2
] |
Level2/Ex_3.py | zac11/Python_Excerices | 2 | 170710 | """
Question:
Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence
after sorting them alphabetically.
Suppose the following input is supplied to the program:
without,hello,bag,world
Then, the output should be:
bag,hello,without,world
"""
enter_string = input()
items = [x for x in enter_string.split(',')]
items.sort()
print(','.join(items))
"""
Input : lionel, christiano, diego, aguero
Output : aguero, christiano, diego,lionel
""" | [
1,
9995,
13,
13,
16492,
29901,
13,
6113,
263,
1824,
393,
21486,
263,
16694,
13055,
5665,
310,
3838,
408,
1881,
322,
14677,
278,
3838,
297,
263,
16694,
29899,
25048,
630,
5665,
13,
7045,
16548,
963,
22968,
1711,
29889,
13,
20182,
852,
278,
1494,
1881,
338,
19056,
304,
278,
1824,
29901,
13,
14037,
29892,
12199,
29892,
23156,
29892,
11526,
13,
11760,
29892,
278,
1962,
881,
367,
29901,
13,
23156,
29892,
12199,
29892,
14037,
29892,
11526,
13,
13,
15945,
29908,
13,
5893,
29918,
1807,
353,
1881,
580,
13,
13,
7076,
353,
518,
29916,
363,
921,
297,
3896,
29918,
1807,
29889,
5451,
29317,
1495,
29962,
13,
13,
7076,
29889,
6605,
580,
13,
13,
2158,
29898,
3788,
29889,
7122,
29898,
7076,
876,
13,
13,
13,
15945,
29908,
13,
4290,
584,
301,
291,
295,
29892,
25542,
3328,
29892,
762,
1484,
29892,
946,
29884,
1489,
13,
6466,
584,
946,
29884,
1489,
29892,
25542,
3328,
29892,
762,
1484,
29892,
29880,
291,
295,
13,
13,
15945,
29908,
2
] |
tensorflow_probability/python/experimental/mcmc/sample_fold.py | rupei/probability | 0 | 14993 | <gh_stars>0
# Copyright 2020 The TensorFlow Probability Authors.
#
# 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.
# ============================================================================
"""Drivers for streaming reductions framework."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
# Dependency imports
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.experimental.mcmc import sample as exp_sample_lib
from tensorflow_probability.python.experimental.mcmc import sample_discarding_kernel
from tensorflow_probability.python.experimental.mcmc import tracing_reducer
from tensorflow_probability.python.experimental.mcmc import with_reductions
from tensorflow_probability.python.mcmc import sample
from tensorflow.python.util import nest # pylint: disable=g-direct-tensorflow-import
__all__ = [
'sample_chain',
'sample_fold',
]
def sample_fold(
num_steps,
current_state,
previous_kernel_results=None,
kernel=None,
reducer=None,
num_burnin_steps=0,
num_steps_between_results=0,
parallel_iterations=10,
seed=None,
name=None,
):
"""Computes the requested reductions over the `kernel`'s samples.
To wit, runs the given `kernel` for `num_steps` steps, and consumes
the stream of samples with the given `Reducer`s' `one_step` method(s).
This runs in constant memory (unless a given `Reducer` builds a
large structure).
The driver internally composes the correct onion of `WithReductions`
and `SampleDiscardingKernel` to implement the requested optionally
thinned reduction; however, the kernel results of those applied
Transition Kernels will not be returned. Hence, if warm-restarting
reductions is desired, one should manually build the Transition Kernel
onion and use `tfp.experimental.mcmc.step_kernel`.
An arbitrary collection of `reducer` can be provided, and the resulting
finalized statistic(s) will be returned in an identical structure.
Args:
num_steps: Integer or scalar `Tensor` representing the number of `Reducer`
steps.
current_state: `Tensor` or Python `list` of `Tensor`s representing the
current state(s) of the Markov chain(s).
previous_kernel_results: A `Tensor` or a nested collection of `Tensor`s.
Warm-start for the auxiliary state needed by the given `kernel`.
If not supplied, `sample_fold` will cold-start with
`kernel.bootstrap_results`.
kernel: An instance of `tfp.mcmc.TransitionKernel` which implements one step
of the Markov chain.
reducer: A (possibly nested) structure of `Reducer`s to be evaluated
on the `kernel`'s samples. If no reducers are given (`reducer=None`),
then `None` will be returned in place of streaming calculations.
num_burnin_steps: Integer or scalar `Tensor` representing the number
of chain steps to take before starting to collect results.
Defaults to 0 (i.e., no burn-in).
num_steps_between_results: Integer or scalar `Tensor` representing
the number of chain steps between collecting a result. Only one out
of every `num_steps_between_samples + 1` steps is included in the
returned results. Defaults to 0 (i.e., no thinning).
parallel_iterations: The number of iterations allowed to run in parallel. It
must be a positive integer. See `tf.while_loop` for more details.
seed: Optional seed for reproducible sampling.
name: Python `str` name prefixed to Ops created by this function.
Default value: `None` (i.e., 'mcmc_sample_fold').
Returns:
reduction_results: A (possibly nested) structure of finalized reducer
statistics. The structure identically mimics that of `reducer`.
end_state: The final state of the Markov chain(s).
final_kernel_results: `collections.namedtuple` of internal calculations
used to advance the supplied `kernel`. These results do not include
the kernel results of `WithReductions` or `SampleDiscardingKernel`.
"""
with tf.name_scope(name or 'mcmc_sample_fold'):
num_steps = tf.convert_to_tensor(
num_steps, dtype=tf.int32, name='num_steps')
current_state = tf.nest.map_structure(
lambda x: tf.convert_to_tensor(x, name='current_state'),
current_state)
reducer_was_none = False
if reducer is None:
reducer = []
reducer_was_none = True
reduction_kernel = with_reductions.WithReductions(
inner_kernel=sample_discarding_kernel.SampleDiscardingKernel(
inner_kernel=kernel,
num_burnin_steps=num_burnin_steps,
num_steps_between_results=num_steps_between_results),
reducer=reducer,
)
end_state, final_kernel_results = exp_sample_lib.step_kernel(
num_steps=num_steps,
current_state=current_state,
previous_kernel_results=previous_kernel_results,
kernel=reduction_kernel,
return_final_kernel_results=True,
parallel_iterations=parallel_iterations,
seed=seed,
name=name,
)
reduction_results = nest.map_structure_up_to(
reducer,
lambda r, s: r.finalize(s),
reducer,
final_kernel_results.streaming_calculations,
check_types=False)
if reducer_was_none:
reduction_results = None
return (reduction_results,
end_state,
final_kernel_results.inner_results.inner_results)
def _trace_kernel_results(current_state, kernel_results):
del current_state
return kernel_results
def sample_chain(
num_results,
current_state,
previous_kernel_results=None,
kernel=None,
num_burnin_steps=0,
num_steps_between_results=0,
trace_fn=_trace_kernel_results,
return_final_kernel_results=False,
parallel_iterations=10,
seed=None,
name=None,
):
"""Implements Markov chain Monte Carlo via repeated `TransitionKernel` steps.
This function samples from a Markov chain at `current_state` whose
stationary distribution is governed by the supplied `TransitionKernel`
instance (`kernel`).
This function can sample from multiple chains, in parallel. (Whether or not
there are multiple chains is dictated by the `kernel`.)
The `current_state` can be represented as a single `Tensor` or a `list` of
`Tensors` which collectively represent the current state.
Since MCMC states are correlated, it is sometimes desirable to produce
additional intermediate states, and then discard them, ending up with a set of
states with decreased autocorrelation. See [Owen (2017)][1]. Such 'thinning'
is made possible by setting `num_steps_between_results > 0`. The chain then
takes `num_steps_between_results` extra steps between the steps that make it
into the results. The extra steps are never materialized, and thus do not
increase memory requirements.
In addition to returning the chain state, this function supports tracing of
auxiliary variables used by the kernel. The traced values are selected by
specifying `trace_fn`. By default, all kernel results are traced but in the
future the default will be changed to no results being traced, so plan
accordingly. See below for some examples of this feature.
Args:
num_results: Integer number of Markov chain draws.
current_state: `Tensor` or Python `list` of `Tensor`s representing the
current state(s) of the Markov chain(s).
previous_kernel_results: A `Tensor` or a nested collection of `Tensor`s
representing internal calculations made within the previous call to this
function (or as returned by `bootstrap_results`).
kernel: An instance of `tfp.mcmc.TransitionKernel` which implements one step
of the Markov chain.
num_burnin_steps: Integer number of chain steps to take before starting to
collect results.
Default value: 0 (i.e., no burn-in).
num_steps_between_results: Integer number of chain steps between collecting
a result. Only one out of every `num_steps_between_samples + 1` steps is
included in the returned results. The number of returned chain states is
still equal to `num_results`. Default value: 0 (i.e., no thinning).
trace_fn: A callable that takes in the current chain state and the previous
kernel results and return a `Tensor` or a nested collection of `Tensor`s
that is then traced along with the chain state.
return_final_kernel_results: If `True`, then the final kernel results are
returned alongside the chain state and the trace specified by the
`trace_fn`.
parallel_iterations: The number of iterations allowed to run in parallel. It
must be a positive integer. See `tf.while_loop` for more details.
seed: Optional, a seed for reproducible sampling.
name: Python `str` name prefixed to Ops created by this function.
Default value: `None` (i.e., 'experimental_mcmc_sample_chain').
Returns:
checkpointable_states_and_trace: if `return_final_kernel_results` is
`True`. The return value is an instance of
`CheckpointableStatesAndTrace`.
all_states: if `return_final_kernel_results` is `False` and `trace_fn` is
`None`. The return value is a `Tensor` or Python list of `Tensor`s
representing the state(s) of the Markov chain(s) at each result step. Has
same shape as input `current_state` but with a prepended
`num_results`-size dimension.
states_and_trace: if `return_final_kernel_results` is `False` and
`trace_fn` is not `None`. The return value is an instance of
`StatesAndTrace`.
#### References
[1]: <NAME>. Statistically efficient thinning of a Markov chain sampler.
_Technical Report_, 2017.
http://statweb.stanford.edu/~owen/reports/bestthinning.pdf
"""
with tf.name_scope(name or 'experimental_mcmc_sample_chain'):
if not kernel.is_calibrated:
warnings.warn('supplied `TransitionKernel` is not calibrated. Markov '
'chain may not converge to intended target distribution.')
if trace_fn is None:
trace_fn = lambda *args: ()
no_trace = True
else:
no_trace = False
if trace_fn is sample_chain.__defaults__[4]:
warnings.warn('Tracing all kernel results by default is deprecated. Set '
'the `trace_fn` argument to None (the future default '
'value) or an explicit callback that traces the values '
'you are interested in.')
# `WithReductions` assumes all its reducers want to reduce over the
# immediate inner results of its kernel results. However,
# We don't care about the kernel results of `SampleDiscardingKernel`; hence,
# we evaluate the `trace_fn` on a deeper level of inner results.
def real_trace_fn(curr_state, kr):
return curr_state, trace_fn(curr_state, kr.inner_results)
trace_reducer = tracing_reducer.TracingReducer(
trace_fn=real_trace_fn,
size=num_results
)
trace_results, _, final_kernel_results = sample_fold(
num_steps=num_results,
current_state=current_state,
previous_kernel_results=previous_kernel_results,
kernel=kernel,
reducer=trace_reducer,
num_burnin_steps=num_burnin_steps,
num_steps_between_results=num_steps_between_results,
parallel_iterations=parallel_iterations,
seed=seed,
name=name,
)
all_states, trace = trace_results
if return_final_kernel_results:
return sample.CheckpointableStatesAndTrace(
all_states=all_states,
trace=trace,
final_kernel_results=final_kernel_results)
else:
if no_trace:
return all_states
else:
return sample.StatesAndTrace(all_states=all_states, trace=trace)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
450,
323,
6073,
17907,
1019,
29890,
3097,
13189,
943,
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,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
15945,
29908,
29928,
374,
874,
363,
24820,
3724,
1953,
6890,
1213,
15945,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
18116,
13,
13,
29937,
10034,
5197,
24802,
13,
5215,
26110,
29889,
12667,
29889,
29894,
29906,
408,
15886,
13,
3166,
26110,
29918,
22795,
3097,
29889,
4691,
29889,
735,
27910,
29889,
29885,
4912,
29883,
1053,
4559,
408,
1518,
29918,
11249,
29918,
1982,
13,
3166,
26110,
29918,
22795,
3097,
29889,
4691,
29889,
735,
27910,
29889,
29885,
4912,
29883,
1053,
4559,
29918,
2218,
7543,
292,
29918,
17460,
13,
3166,
26110,
29918,
22795,
3097,
29889,
4691,
29889,
735,
27910,
29889,
29885,
4912,
29883,
1053,
16703,
292,
29918,
9313,
2265,
13,
3166,
26110,
29918,
22795,
3097,
29889,
4691,
29889,
735,
27910,
29889,
29885,
4912,
29883,
1053,
411,
29918,
9313,
1953,
13,
3166,
26110,
29918,
22795,
3097,
29889,
4691,
29889,
29885,
4912,
29883,
1053,
4559,
13,
3166,
26110,
29889,
4691,
29889,
4422,
1053,
17763,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
29887,
29899,
11851,
29899,
29056,
29899,
5215,
13,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
525,
11249,
29918,
14153,
742,
13,
1678,
525,
11249,
29918,
8771,
742,
13,
29962,
13,
13,
13,
1753,
4559,
29918,
8771,
29898,
13,
1678,
954,
29918,
24530,
29892,
13,
1678,
1857,
29918,
3859,
29892,
13,
1678,
3517,
29918,
17460,
29918,
9902,
29922,
8516,
29892,
13,
1678,
8466,
29922,
8516,
29892,
13,
1678,
3724,
2265,
29922,
8516,
29892,
13,
1678,
954,
29918,
18712,
262,
29918,
24530,
29922,
29900,
29892,
13,
1678,
954,
29918,
24530,
29918,
14811,
29918,
9902,
29922,
29900,
29892,
13,
1678,
8943,
29918,
1524,
800,
29922,
29896,
29900,
29892,
13,
1678,
16717,
29922,
8516,
29892,
13,
1678,
1024,
29922,
8516,
29892,
13,
1125,
13,
29871,
9995,
20606,
267,
278,
13877,
3724,
1953,
975,
278,
421,
17460,
20497,
29879,
11916,
29889,
13,
13,
29871,
1763,
12309,
29892,
6057,
278,
2183,
421,
17460,
29952,
363,
421,
1949,
29918,
24530,
29952,
6576,
29892,
322,
1136,
9351,
13,
29871,
278,
4840,
310,
11916,
411,
278,
2183,
421,
9039,
1682,
261,
29952,
29879,
29915,
421,
650,
29918,
10568,
29952,
1158,
29898,
29879,
467,
13,
29871,
910,
6057,
297,
4868,
3370,
313,
28952,
263,
2183,
421,
9039,
1682,
261,
29952,
23315,
263,
13,
29871,
2919,
3829,
467,
13,
13,
29871,
450,
7156,
25106,
5541,
267,
278,
1959,
373,
291,
310,
421,
3047,
29934,
6085,
1953,
29952,
13,
29871,
322,
421,
17708,
4205,
7543,
292,
29968,
5851,
29952,
304,
2334,
278,
13877,
2984,
635,
13,
29871,
266,
27464,
20376,
29936,
3138,
29892,
278,
8466,
2582,
310,
1906,
7436,
13,
29871,
4103,
654,
476,
824,
1379,
674,
451,
367,
4133,
29889,
10133,
29892,
565,
14294,
29899,
5060,
442,
292,
13,
29871,
3724,
1953,
338,
7429,
29892,
697,
881,
7522,
2048,
278,
4103,
654,
476,
5851,
13,
29871,
373,
291,
322,
671,
421,
13264,
29886,
29889,
735,
27910,
29889,
29885,
4912,
29883,
29889,
10568,
29918,
17460,
1412,
13,
13,
29871,
530,
11472,
4333,
310,
421,
9313,
2265,
29952,
508,
367,
4944,
29892,
322,
278,
9819,
13,
29871,
2186,
1891,
1002,
4695,
29898,
29879,
29897,
674,
367,
4133,
297,
385,
13557,
3829,
29889,
13,
13,
29871,
826,
3174,
29901,
13,
1678,
954,
29918,
24530,
29901,
8102,
470,
17336,
421,
29911,
6073,
29952,
15783,
278,
1353,
310,
421,
9039,
1682,
261,
29952,
13,
418,
6576,
29889,
13,
1678,
1857,
29918,
3859,
29901,
421,
29911,
6073,
29952,
470,
5132,
421,
1761,
29952,
310,
421,
29911,
6073,
29952,
29879,
15783,
278,
13,
418,
1857,
2106,
29898,
29879,
29897,
310,
278,
4485,
586,
9704,
29898,
29879,
467,
13,
1678,
3517,
29918,
17460,
29918,
9902,
29901,
319,
421,
29911,
6073,
29952,
470,
263,
9322,
4333,
310,
421,
29911,
6073,
29952,
29879,
29889,
13,
418,
399,
2817,
29899,
2962,
363,
278,
29587,
653,
2106,
4312,
491,
278,
2183,
421,
17460,
1412,
13,
418,
960,
451,
19056,
29892,
421,
11249,
29918,
8771,
29952,
674,
11220,
29899,
2962,
411,
13,
418,
421,
17460,
29889,
8704,
29918,
9902,
1412,
13,
1678,
8466,
29901,
530,
2777,
310,
421,
13264,
29886,
29889,
29885,
4912,
29883,
29889,
4300,
654,
29968,
5851,
29952,
607,
10703,
697,
4331,
13,
418,
310,
278,
4485,
586,
9704,
29889,
13,
1678,
3724,
2265,
29901,
319,
313,
28802,
14981,
9322,
29897,
3829,
310,
421,
9039,
1682,
261,
29952,
29879,
304,
367,
19030,
13,
418,
373,
278,
421,
17460,
20497,
29879,
11916,
29889,
960,
694,
3724,
22543,
526,
2183,
6695,
9313,
2265,
29922,
8516,
19775,
13,
418,
769,
421,
8516,
29952,
674,
367,
4133,
297,
2058,
310,
24820,
17203,
29889,
13,
1678,
954,
29918,
18712,
262,
29918,
24530,
29901,
8102,
470,
17336,
421,
29911,
6073,
29952,
15783,
278,
1353,
13,
4706,
310,
9704,
6576,
304,
2125,
1434,
6257,
304,
6314,
2582,
29889,
13,
4706,
13109,
29879,
304,
29871,
29900,
313,
29875,
29889,
29872,
1696,
694,
12138,
29899,
262,
467,
13,
1678,
954,
29918,
24530,
29918,
14811,
29918,
9902,
29901,
8102,
470,
17336,
421,
29911,
6073,
29952,
15783,
13,
418,
278,
1353,
310,
9704,
6576,
1546,
6314,
292,
263,
1121,
29889,
9333,
697,
714,
13,
418,
310,
1432,
421,
1949,
29918,
24530,
29918,
14811,
29918,
27736,
718,
29871,
29896,
29952,
6576,
338,
5134,
297,
278,
13,
418,
4133,
2582,
29889,
13109,
29879,
304,
29871,
29900,
313,
29875,
29889,
29872,
1696,
694,
16835,
1076,
467,
13,
1678,
8943,
29918,
1524,
800,
29901,
450,
1353,
310,
24372,
6068,
304,
1065,
297,
8943,
29889,
739,
13,
418,
1818,
367,
263,
6374,
6043,
29889,
2823,
421,
13264,
29889,
8000,
29918,
7888,
29952,
363,
901,
4902,
29889,
13,
1678,
16717,
29901,
28379,
16717,
363,
9483,
15520,
23460,
29889,
13,
1678,
1024,
29901,
5132,
421,
710,
29952,
1024,
10944,
287,
304,
438,
567,
2825,
491,
445,
740,
29889,
13,
418,
13109,
995,
29901,
421,
8516,
29952,
313,
29875,
29889,
29872,
1696,
525,
29885,
4912,
29883,
29918,
11249,
29918,
8771,
2824,
13,
13,
29871,
16969,
29901,
13,
1678,
20376,
29918,
9902,
29901,
319,
313,
28802,
14981,
9322,
29897,
3829,
310,
2186,
1891,
3724,
2265,
13,
418,
13964,
29889,
450,
3829,
2893,
1711,
286,
326,
1199,
393,
310,
421,
9313,
2265,
1412,
13,
1678,
1095,
29918,
3859,
29901,
450,
2186,
2106,
310,
278,
4485,
586,
9704,
29898,
29879,
467,
13,
1678,
2186,
29918,
17460,
29918,
9902,
29901,
421,
29027,
29889,
17514,
23583,
29952,
310,
7463,
17203,
13,
418,
1304,
304,
6564,
278,
19056,
421,
17460,
1412,
4525,
2582,
437,
451,
3160,
13,
418,
278,
8466,
2582,
310,
421,
3047,
29934,
6085,
1953,
29952,
470,
421,
17708,
4205,
7543,
292,
29968,
5851,
1412,
13,
29871,
9995,
13,
29871,
411,
15886,
29889,
978,
29918,
6078,
29898,
978,
470,
525,
29885,
4912,
29883,
29918,
11249,
29918,
8771,
29374,
13,
1678,
954,
29918,
24530,
353,
15886,
29889,
13441,
29918,
517,
29918,
20158,
29898,
13,
4706,
954,
29918,
24530,
29892,
26688,
29922,
13264,
29889,
524,
29941,
29906,
29892,
1024,
2433,
1949,
29918,
24530,
1495,
13,
1678,
1857,
29918,
3859,
353,
15886,
29889,
17510,
29889,
1958,
29918,
23905,
29898,
13,
4706,
14013,
921,
29901,
15886,
29889,
13441,
29918,
517,
29918,
20158,
29898,
29916,
29892,
1024,
2433,
3784,
29918,
3859,
5477,
13,
4706,
1857,
29918,
3859,
29897,
13,
1678,
3724,
2265,
29918,
11102,
29918,
9290,
353,
7700,
13,
1678,
565,
3724,
2265,
338,
6213,
29901,
13,
418,
3724,
2265,
353,
5159,
13,
418,
3724,
2265,
29918,
11102,
29918,
9290,
353,
5852,
13,
1678,
20376,
29918,
17460,
353,
411,
29918,
9313,
1953,
29889,
3047,
29934,
6085,
1953,
29898,
13,
4706,
6426,
29918,
17460,
29922,
11249,
29918,
2218,
7543,
292,
29918,
17460,
29889,
17708,
4205,
7543,
292,
29968,
5851,
29898,
13,
9651,
6426,
29918,
17460,
29922,
17460,
29892,
13,
9651,
954,
29918,
18712,
262,
29918,
24530,
29922,
1949,
29918,
18712,
262,
29918,
24530,
29892,
13,
9651,
954,
29918,
24530,
29918,
14811,
29918,
9902,
29922,
1949,
29918,
24530,
29918,
14811,
29918,
9902,
511,
13,
4706,
3724,
2265,
29922,
9313,
2265,
29892,
13,
1678,
1723,
13,
1678,
1095,
29918,
3859,
29892,
2186,
29918,
17460,
29918,
9902,
353,
1518,
29918,
11249,
29918,
1982,
29889,
10568,
29918,
17460,
29898,
13,
4706,
954,
29918,
24530,
29922,
1949,
29918,
24530,
29892,
13,
4706,
1857,
29918,
3859,
29922,
3784,
29918,
3859,
29892,
13,
4706,
3517,
29918,
17460,
29918,
9902,
29922,
24957,
29918,
17460,
29918,
9902,
29892,
13,
4706,
8466,
29922,
9313,
428,
29918,
17460,
29892,
13,
4706,
736,
29918,
8394,
29918,
17460,
29918,
9902,
29922,
5574,
29892,
13,
4706,
8943,
29918,
1524,
800,
29922,
23482,
29918,
1524,
800,
29892,
13,
4706,
16717,
29922,
26776,
29892,
13,
4706,
1024,
29922,
978,
29892,
13,
1678,
1723,
13,
1678,
20376,
29918,
9902,
353,
17763,
29889,
1958,
29918,
23905,
29918,
786,
29918,
517,
29898,
13,
4706,
3724,
2265,
29892,
13,
4706,
14013,
364,
29892,
269,
29901,
364,
29889,
8394,
675,
29898,
29879,
511,
13,
4706,
3724,
2265,
29892,
13,
4706,
2186,
29918,
17460,
29918,
9902,
29889,
5461,
292,
29918,
15807,
800,
29892,
13,
4706,
1423,
29918,
8768,
29922,
8824,
29897,
13,
1678,
565,
3724,
2265,
29918,
11102,
29918,
9290,
29901,
13,
418,
20376,
29918,
9902,
353,
6213,
13,
1678,
736,
313,
9313,
428,
29918,
9902,
29892,
13,
9651,
1095,
29918,
3859,
29892,
13,
9651,
2186,
29918,
17460,
29918,
9902,
29889,
3993,
29918,
9902,
29889,
3993,
29918,
9902,
29897,
13,
13,
13,
1753,
903,
15003,
29918,
17460,
29918,
9902,
29898,
3784,
29918,
3859,
29892,
8466,
29918,
9902,
1125,
13,
29871,
628,
1857,
29918,
3859,
13,
29871,
736,
8466,
29918,
9902,
13,
13,
13,
1753,
4559,
29918,
14153,
29898,
13,
1678,
954,
29918,
9902,
29892,
13,
1678,
1857,
29918,
3859,
29892,
13,
1678,
3517,
29918,
17460,
29918,
9902,
29922,
8516,
29892,
13,
1678,
8466,
29922,
8516,
29892,
13,
1678,
954,
29918,
18712,
262,
29918,
24530,
29922,
29900,
29892,
13,
1678,
954,
29918,
24530,
29918,
14811,
29918,
9902,
29922,
29900,
29892,
13,
1678,
9637,
29918,
9144,
29922,
29918,
15003,
29918,
17460,
29918,
9902,
29892,
13,
1678,
736,
29918,
8394,
29918,
17460,
29918,
9902,
29922,
8824,
29892,
13,
1678,
8943,
29918,
1524,
800,
29922,
29896,
29900,
29892,
13,
1678,
16717,
29922,
8516,
29892,
13,
1678,
1024,
29922,
8516,
29892,
13,
1125,
13,
29871,
9995,
1888,
9711,
4485,
586,
9704,
11240,
15021,
3025,
10324,
421,
4300,
654,
29968,
5851,
29952,
6576,
29889,
13,
13,
29871,
910,
740,
11916,
515,
263,
4485,
586,
9704,
472,
421,
3784,
29918,
3859,
29952,
5069,
13,
29871,
5073,
653,
4978,
338,
4095,
287,
491,
278,
19056,
421,
4300,
654,
29968,
5851,
29952,
13,
29871,
2777,
6695,
17460,
12913,
13,
13,
29871,
910,
740,
508,
4559,
515,
2999,
521,
2708,
29892,
297,
8943,
29889,
313,
8809,
1979,
470,
451,
13,
29871,
727,
526,
2999,
521,
2708,
338,
9657,
630,
491,
278,
421,
17460,
1412,
29897,
13,
13,
29871,
450,
421,
3784,
29918,
3859,
29952,
508,
367,
9875,
408,
263,
2323,
421,
29911,
6073,
29952,
470,
263,
421,
1761,
29952,
310,
13,
29871,
421,
29911,
575,
943,
29952,
607,
6314,
3598,
2755,
278,
1857,
2106,
29889,
13,
13,
29871,
4001,
21271,
12513,
5922,
526,
8855,
630,
29892,
372,
338,
6041,
553,
27797,
304,
7738,
13,
29871,
5684,
19697,
5922,
29892,
322,
769,
2313,
538,
963,
29892,
17140,
701,
411,
263,
731,
310,
13,
29871,
5922,
411,
9263,
1463,
1120,
542,
272,
23445,
29889,
29871,
2823,
518,
29949,
15556,
313,
29906,
29900,
29896,
29955,
29897,
3816,
29896,
1822,
10506,
525,
386,
262,
1076,
29915,
13,
29871,
338,
1754,
1950,
491,
4444,
421,
1949,
29918,
24530,
29918,
14811,
29918,
9902,
1405,
29871,
29900,
1412,
450,
9704,
769,
13,
29871,
4893,
421,
1949,
29918,
24530,
29918,
14811,
29918,
9902,
29952,
4805,
6576,
1546,
278,
6576,
393,
1207,
372,
13,
29871,
964,
278,
2582,
29889,
450,
4805,
6576,
526,
2360,
5518,
1891,
29892,
322,
4550,
437,
451,
13,
29871,
7910,
3370,
11780,
29889,
13,
13,
29871,
512,
6124,
304,
7863,
278,
9704,
2106,
29892,
445,
740,
11286,
16703,
292,
310,
13,
29871,
29587,
653,
3651,
1304,
491,
278,
8466,
29889,
450,
16703,
287,
1819,
526,
4629,
491,
13,
29871,
22146,
421,
15003,
29918,
9144,
1412,
2648,
2322,
29892,
599,
8466,
2582,
526,
16703,
287,
541,
297,
278,
13,
29871,
5434,
278,
2322,
674,
367,
3939,
304,
694,
2582,
1641,
16703,
287,
29892,
577,
3814,
13,
29871,
16205,
29889,
2823,
2400,
363,
777,
6455,
310,
445,
4682,
29889,
13,
13,
29871,
826,
3174,
29901,
13,
1678,
954,
29918,
9902,
29901,
8102,
1353,
310,
4485,
586,
9704,
4216,
29879,
29889,
13,
1678,
1857,
29918,
3859,
29901,
421,
29911,
6073,
29952,
470,
5132,
421,
1761,
29952,
310,
421,
29911,
6073,
29952,
29879,
15783,
278,
13,
418,
1857,
2106,
29898,
29879,
29897,
310,
278,
4485,
586,
9704,
29898,
29879,
467,
13,
1678,
3517,
29918,
17460,
29918,
9902,
29901,
319,
421,
29911,
6073,
29952,
470,
263,
9322,
4333,
310,
421,
29911,
6073,
29952,
29879,
13,
418,
15783,
7463,
17203,
1754,
2629,
278,
3517,
1246,
304,
445,
13,
418,
740,
313,
272,
408,
4133,
491,
421,
8704,
29918,
9902,
12913,
13,
1678,
8466,
29901,
530,
2777,
310,
421,
13264,
29886,
29889,
29885,
4912,
29883,
29889,
4300,
654,
29968,
5851,
29952,
607,
10703,
697,
4331,
13,
418,
310,
278,
4485,
586,
9704,
29889,
13,
1678,
954,
29918,
18712,
262,
29918,
24530,
29901,
8102,
1353,
310,
9704,
6576,
304,
2125,
1434,
6257,
304,
13,
418,
6314,
2582,
29889,
13,
418,
13109,
995,
29901,
29871,
29900,
313,
29875,
29889,
29872,
1696,
694,
12138,
29899,
262,
467,
13,
1678,
954,
29918,
24530,
29918,
14811,
29918,
9902,
29901,
8102,
1353,
310,
9704,
6576,
1546,
6314,
292,
13,
418,
263,
1121,
29889,
9333,
697,
714,
310,
1432,
421,
1949,
29918,
24530,
29918,
14811,
29918,
27736,
718,
29871,
29896,
29952,
6576,
338,
13,
418,
5134,
297,
278,
4133,
2582,
29889,
29871,
450,
1353,
310,
4133,
9704,
5922,
338,
13,
418,
1603,
5186,
304,
421,
1949,
29918,
9902,
1412,
29871,
13109,
995,
29901,
29871,
29900,
313,
29875,
29889,
29872,
1696,
694,
16835,
1076,
467,
13,
1678,
9637,
29918,
9144,
29901,
319,
1246,
519,
393,
4893,
297,
278,
1857,
9704,
2106,
322,
278,
3517,
13,
418,
8466,
2582,
322,
736,
263,
421,
29911,
6073,
29952,
470,
263,
9322,
4333,
310,
421,
29911,
6073,
29952,
29879,
13,
418,
393,
338,
769,
16703,
287,
3412,
411,
278,
9704,
2106,
29889,
13,
1678,
736,
29918,
8394,
29918,
17460,
29918,
9902,
29901,
960,
421,
5574,
1673,
769,
278,
2186,
8466,
2582,
526,
13,
418,
4133,
19963,
278,
9704,
2106,
322,
278,
9637,
6790,
491,
278,
13,
418,
421,
15003,
29918,
9144,
1412,
13,
1678,
8943,
29918,
1524,
800,
29901,
450,
1353,
310,
24372,
6068,
304,
1065,
297,
8943,
29889,
739,
13,
418,
1818,
367,
263,
6374,
6043,
29889,
2823,
421,
13264,
29889,
8000,
29918,
7888,
29952,
363,
901,
4902,
29889,
13,
1678,
16717,
29901,
28379,
29892,
263,
16717,
363,
9483,
15520,
23460,
29889,
13,
1678,
1024,
29901,
5132,
421,
710,
29952,
1024,
10944,
287,
304,
438,
567,
2825,
491,
445,
740,
29889,
13,
418,
13109,
995,
29901,
421,
8516,
29952,
313,
29875,
29889,
29872,
1696,
525,
735,
27910,
29918,
29885,
4912,
29883,
29918,
11249,
29918,
14153,
2824,
13,
13,
29871,
16969,
29901,
13,
1678,
1423,
3149,
519,
29918,
28631,
29918,
392,
29918,
15003,
29901,
565,
421,
2457,
29918,
8394,
29918,
17460,
29918,
9902,
29952,
338,
13,
418,
421,
5574,
1412,
450,
736,
995,
338,
385,
2777,
310,
13,
418,
421,
5596,
3149,
519,
855,
1078,
2855,
11591,
1412,
13,
1678,
599,
29918,
28631,
29901,
565,
421,
2457,
29918,
8394,
29918,
17460,
29918,
9902,
29952,
338,
421,
8824,
29952,
322,
421,
15003,
29918,
9144,
29952,
338,
13,
418,
421,
8516,
1412,
450,
736,
995,
338,
263,
421,
29911,
6073,
29952,
470,
5132,
1051,
310,
421,
29911,
6073,
29952,
29879,
13,
418,
15783,
278,
2106,
29898,
29879,
29897,
310,
278,
4485,
586,
9704,
29898,
29879,
29897,
472,
1269,
1121,
4331,
29889,
11699,
13,
418,
1021,
8267,
408,
1881,
421,
3784,
29918,
3859,
29952,
541,
411,
263,
8273,
2760,
13,
418,
421,
1949,
29918,
9902,
27969,
2311,
9927,
29889,
13,
1678,
5922,
29918,
392,
29918,
15003,
29901,
565,
421,
2457,
29918,
8394,
29918,
17460,
29918,
9902,
29952,
338,
421,
8824,
29952,
322,
13,
418,
421,
15003,
29918,
9144,
29952,
338,
451,
421,
8516,
1412,
450,
736,
995,
338,
385,
2777,
310,
13,
418,
421,
855,
1078,
2855,
11591,
1412,
13,
13,
29871,
3191,
28318,
13,
13,
29871,
518,
29896,
5387,
529,
5813,
15513,
13070,
1711,
8543,
16835,
1076,
310,
263,
4485,
586,
9704,
3514,
20069,
29889,
13,
539,
903,
7141,
3049,
936,
13969,
3383,
29871,
29906,
29900,
29896,
29955,
29889,
13,
539,
1732,
597,
6112,
2676,
29889,
14411,
4006,
29889,
6085,
24629,
340,
264,
29914,
276,
4011,
29914,
13318,
386,
262,
1076,
29889,
5140,
13,
29871,
9995,
13,
29871,
411,
15886,
29889,
978,
29918,
6078,
29898,
978,
470,
525,
735,
27910,
29918,
29885,
4912,
29883,
29918,
11249,
29918,
14153,
29374,
13,
1678,
565,
451,
8466,
29889,
275,
29918,
1052,
4626,
630,
29901,
13,
418,
18116,
29889,
25442,
877,
19303,
2957,
421,
4300,
654,
29968,
5851,
29952,
338,
451,
1208,
4626,
630,
29889,
4485,
586,
525,
13,
462,
1678,
525,
14153,
1122,
451,
5486,
479,
304,
9146,
3646,
4978,
29889,
1495,
13,
13,
1678,
565,
9637,
29918,
9144,
338,
6213,
29901,
13,
418,
9637,
29918,
9144,
353,
14013,
334,
5085,
29901,
3861,
13,
418,
694,
29918,
15003,
353,
5852,
13,
1678,
1683,
29901,
13,
418,
694,
29918,
15003,
353,
7700,
13,
13,
1678,
565,
9637,
29918,
9144,
338,
4559,
29918,
14153,
17255,
4381,
29879,
1649,
29961,
29946,
5387,
13,
418,
18116,
29889,
25442,
877,
29911,
945,
292,
599,
8466,
2582,
491,
2322,
338,
18164,
29889,
3789,
525,
13,
462,
1678,
525,
1552,
421,
15003,
29918,
9144,
29952,
2980,
304,
6213,
313,
1552,
5434,
2322,
525,
13,
462,
1678,
525,
1767,
29897,
470,
385,
6261,
6939,
393,
26695,
278,
1819,
525,
13,
462,
1678,
525,
6293,
526,
8852,
297,
29889,
1495,
13,
13,
1678,
396,
421,
3047,
29934,
6085,
1953,
29952,
15894,
599,
967,
3724,
22543,
864,
304,
10032,
975,
278,
13,
1678,
396,
16800,
6426,
2582,
310,
967,
8466,
2582,
29889,
2398,
29892,
13,
1678,
396,
1334,
1016,
29915,
29873,
2562,
1048,
278,
8466,
2582,
310,
421,
17708,
4205,
7543,
292,
29968,
5851,
21966,
8151,
29892,
13,
1678,
396,
591,
14707,
278,
421,
15003,
29918,
9144,
29952,
373,
263,
25871,
3233,
310,
6426,
2582,
29889,
13,
1678,
822,
1855,
29918,
15003,
29918,
9144,
29898,
21962,
29918,
3859,
29892,
12920,
1125,
13,
418,
736,
16256,
29918,
3859,
29892,
9637,
29918,
9144,
29898,
21962,
29918,
3859,
29892,
12920,
29889,
3993,
29918,
9902,
29897,
13,
1678,
9637,
29918,
9313,
2265,
353,
16703,
292,
29918,
9313,
2265,
29889,
29911,
945,
292,
9039,
1682,
261,
29898,
13,
4706,
9637,
29918,
9144,
29922,
6370,
29918,
15003,
29918,
9144,
29892,
13,
4706,
2159,
29922,
1949,
29918,
9902,
13,
1678,
1723,
13,
1678,
9637,
29918,
9902,
29892,
17117,
2186,
29918,
17460,
29918,
9902,
353,
4559,
29918,
8771,
29898,
13,
4706,
954,
29918,
24530,
29922,
1949,
29918,
9902,
29892,
13,
4706,
1857,
29918,
3859,
29922,
3784,
29918,
3859,
29892,
13,
4706,
3517,
29918,
17460,
29918,
9902,
29922,
24957,
29918,
17460,
29918,
9902,
29892,
13,
4706,
8466,
29922,
17460,
29892,
13,
4706,
3724,
2265,
29922,
15003,
29918,
9313,
2265,
29892,
13,
4706,
954,
29918,
18712,
262,
29918,
24530,
29922,
1949,
29918,
18712,
262,
29918,
24530,
29892,
13,
4706,
954,
29918,
24530,
29918,
14811,
29918,
9902,
29922,
1949,
29918,
24530,
29918,
14811,
29918,
9902,
29892,
13,
4706,
8943,
29918,
1524,
800,
29922,
23482,
29918,
1524,
800,
29892,
13,
4706,
16717,
29922,
26776,
29892,
13,
4706,
1024,
29922,
978,
29892,
13,
1678,
1723,
13,
13,
1678,
599,
29918,
28631,
29892,
9637,
353,
9637,
29918,
9902,
13,
1678,
565,
736,
29918,
8394,
29918,
17460,
29918,
9902,
29901,
13,
418,
736,
4559,
29889,
5596,
3149,
519,
855,
1078,
2855,
11591,
29898,
13,
3986,
599,
29918,
28631,
29922,
497,
29918,
28631,
29892,
13,
3986,
9637,
29922,
15003,
29892,
13,
3986,
2186,
29918,
17460,
29918,
9902,
29922,
8394,
29918,
17460,
29918,
9902,
29897,
13,
1678,
1683,
29901,
13,
418,
565,
694,
29918,
15003,
29901,
13,
4706,
736,
599,
29918,
28631,
13,
418,
1683,
29901,
13,
4706,
736,
4559,
29889,
855,
1078,
2855,
11591,
29898,
497,
29918,
28631,
29922,
497,
29918,
28631,
29892,
9637,
29922,
15003,
29897,
13,
2
] |
starfish/core/image/Filter/test/test_zero_by_channel_magnitude.py | haoxusci/starfish | 164 | 1608459 | import numpy as np
from starfish import ImageStack
from starfish.core.image.Filter.zero_by_channel_magnitude import ZeroByChannelMagnitude
def create_imagestack_with_magnitude_scale():
"""create an imagestack with increasing magnitudes"""
data = np.linspace(0, 1, 11, dtype=np.float32)
data = np.repeat(data[None, :], 2, axis=0)
# reshape data into a 2-channel, (1, 11, 1) image in (x, y, z)
data = data.reshape(1, 2, 1, 11, 1)
imagestack = ImageStack.from_numpy(data)
return imagestack
def test_zero_by_channel_magnitude_produces_accurate_results():
imagestack = create_imagestack_with_magnitude_scale()
zcm = ZeroByChannelMagnitude(thresh=np.inf, normalize=False)
filtered = zcm.run(imagestack, in_place=False, n_processes=1)
assert np.all(filtered.xarray == 0)
| [
1,
1053,
12655,
408,
7442,
13,
13,
3166,
5810,
15161,
1053,
7084,
7264,
13,
3166,
5810,
15161,
29889,
3221,
29889,
3027,
29889,
5072,
29889,
9171,
29918,
1609,
29918,
12719,
29918,
29885,
4211,
4279,
1053,
28933,
2059,
13599,
29924,
4211,
4279,
13,
13,
1753,
1653,
29918,
326,
351,
342,
547,
29918,
2541,
29918,
29885,
4211,
4279,
29918,
7052,
7295,
13,
1678,
9995,
3258,
385,
6382,
342,
547,
411,
10231,
9119,
20816,
15945,
29908,
13,
1678,
848,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29896,
29892,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
848,
353,
7442,
29889,
14358,
29898,
1272,
29961,
8516,
29892,
584,
1402,
29871,
29906,
29892,
9685,
29922,
29900,
29897,
13,
1678,
396,
620,
14443,
848,
964,
263,
29871,
29906,
29899,
12719,
29892,
313,
29896,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29897,
1967,
297,
313,
29916,
29892,
343,
29892,
503,
29897,
13,
1678,
848,
353,
848,
29889,
690,
14443,
29898,
29896,
29892,
29871,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29897,
13,
1678,
6382,
342,
547,
353,
7084,
7264,
29889,
3166,
29918,
23749,
29898,
1272,
29897,
13,
1678,
736,
6382,
342,
547,
13,
13,
13,
1753,
1243,
29918,
9171,
29918,
1609,
29918,
12719,
29918,
29885,
4211,
4279,
29918,
5498,
778,
29918,
562,
2764,
403,
29918,
9902,
7295,
13,
1678,
6382,
342,
547,
353,
1653,
29918,
326,
351,
342,
547,
29918,
2541,
29918,
29885,
4211,
4279,
29918,
7052,
580,
13,
13,
1678,
503,
4912,
353,
28933,
2059,
13599,
29924,
4211,
4279,
29898,
386,
3781,
29922,
9302,
29889,
7192,
29892,
4226,
675,
29922,
8824,
29897,
13,
1678,
22289,
353,
503,
4912,
29889,
3389,
29898,
326,
351,
342,
547,
29892,
297,
29918,
6689,
29922,
8824,
29892,
302,
29918,
5014,
267,
29922,
29896,
29897,
13,
1678,
4974,
7442,
29889,
497,
29898,
4572,
287,
29889,
29916,
2378,
1275,
29871,
29900,
29897,
13,
2
] |
submissions/diverta2019/a.py | m-star18/atcoder | 1 | 54903 | n, k = map(int, input().split())
ans = n-k+1
print(ans)
| [
1,
302,
29892,
413,
353,
2910,
29898,
524,
29892,
1881,
2141,
5451,
3101,
13,
550,
353,
302,
29899,
29895,
29974,
29896,
13,
2158,
29898,
550,
29897,
13,
2
] |
python3/hackerrank_leetcode/defactor_power_sum/main.py | seLain/codesnippets | 0 | 77135 | <filename>python3/hackerrank_leetcode/defactor_power_sum/main.py
import sys, copy
from collections import defaultdict, Counter
sys.setrecursionlimit(10000)
memory = defaultdict(list)
memory[1] = [{1}]
def recur_powerSum(X, N):
#print('enter f(x='+str(X)+')')
if X == 1:
return memory[1]
all_combs = [] # keep all possible combinations as set instances
k = 1
next_X = X - pow(k, N)
while next_X > 0:
#print('prepare for enter f(x='+str(next_X)+') from f(x='+str(X)+')')
if next_X not in memory.keys():
remain_combs = recur_powerSum(next_X, N)
memory[next_X] = remain_combs # keep in memory
#print('end of f(x='+str(next_X)+') with '+str(len(memory[next_X]))+' combs. re-entering f(x='+str(X)+')')
#print('combs:'+str(memory[next_X]))
for comb in memory[next_X]:
if k not in comb:
new_comb = comb | {k}
if new_comb not in all_combs:
all_combs.append(new_comb)
#print('appended combs:'+str(all_combs))
k += 1
next_X = X - pow(k, N)
#print('X:'+str(X)+' next:'+str(next_X))
if next_X == 0:
all_combs.append({k})
break
return all_combs
def powerSum(X, N):
# Complete this function
r = len(recur_powerSum(X, N))
#print(memory)
return r
if __name__ == "__main__":
X = int(input().strip())
N = int(input().strip())
result = powerSum(X, N)
print(result) | [
1,
529,
9507,
29958,
4691,
29941,
29914,
29882,
28940,
10003,
29918,
280,
300,
401,
29914,
1753,
7168,
29918,
13519,
29918,
2083,
29914,
3396,
29889,
2272,
13,
5215,
10876,
29892,
3509,
13,
3166,
16250,
1053,
2322,
8977,
29892,
315,
5336,
13,
9675,
29889,
842,
3757,
1295,
291,
13400,
29898,
29896,
29900,
29900,
29900,
29900,
29897,
13,
13,
14834,
353,
2322,
8977,
29898,
1761,
29897,
13,
14834,
29961,
29896,
29962,
353,
15974,
29896,
6525,
13,
13,
1753,
1162,
332,
29918,
13519,
11139,
29898,
29990,
29892,
405,
1125,
13,
1678,
396,
2158,
877,
5893,
285,
29898,
29916,
2433,
29974,
710,
29898,
29990,
7240,
1495,
1495,
13,
1678,
565,
1060,
1275,
29871,
29896,
29901,
13,
4706,
736,
3370,
29961,
29896,
29962,
13,
268,
13,
1678,
599,
29918,
510,
5824,
353,
5159,
396,
3013,
599,
1950,
18240,
408,
731,
8871,
13,
1678,
413,
353,
29871,
29896,
13,
1678,
2446,
29918,
29990,
353,
1060,
448,
4764,
29898,
29895,
29892,
405,
29897,
13,
1678,
1550,
2446,
29918,
29990,
1405,
29871,
29900,
29901,
13,
4706,
396,
2158,
877,
19125,
363,
3896,
285,
29898,
29916,
2433,
29974,
710,
29898,
4622,
29918,
29990,
7240,
1495,
515,
285,
29898,
29916,
2433,
29974,
710,
29898,
29990,
7240,
1495,
1495,
13,
4706,
565,
2446,
29918,
29990,
451,
297,
3370,
29889,
8149,
7295,
13,
9651,
3933,
29918,
510,
5824,
353,
1162,
332,
29918,
13519,
11139,
29898,
4622,
29918,
29990,
29892,
405,
29897,
13,
9651,
3370,
29961,
4622,
29918,
29990,
29962,
353,
3933,
29918,
510,
5824,
396,
3013,
297,
3370,
13,
4706,
396,
2158,
877,
355,
310,
285,
29898,
29916,
2433,
29974,
710,
29898,
4622,
29918,
29990,
7240,
1495,
411,
525,
29974,
710,
29898,
2435,
29898,
14834,
29961,
4622,
29918,
29990,
12622,
23097,
4145,
29879,
29889,
337,
29899,
296,
3241,
285,
29898,
29916,
2433,
29974,
710,
29898,
29990,
7240,
1495,
1495,
13,
4706,
396,
2158,
877,
510,
5824,
11283,
29974,
710,
29898,
14834,
29961,
4622,
29918,
29990,
12622,
13,
4706,
363,
4145,
297,
3370,
29961,
4622,
29918,
29990,
5387,
13,
9651,
565,
413,
451,
297,
4145,
29901,
13,
18884,
716,
29918,
17743,
353,
4145,
891,
426,
29895,
29913,
13,
18884,
565,
716,
29918,
17743,
451,
297,
599,
29918,
510,
5824,
29901,
13,
462,
1678,
599,
29918,
510,
5824,
29889,
4397,
29898,
1482,
29918,
17743,
29897,
13,
4706,
396,
2158,
877,
932,
2760,
4145,
29879,
11283,
29974,
710,
29898,
497,
29918,
510,
5824,
876,
13,
4706,
413,
4619,
29871,
29896,
13,
4706,
2446,
29918,
29990,
353,
1060,
448,
4764,
29898,
29895,
29892,
405,
29897,
13,
4706,
396,
2158,
877,
29990,
11283,
29974,
710,
29898,
29990,
7240,
29915,
2446,
11283,
29974,
710,
29898,
4622,
29918,
29990,
876,
13,
4706,
565,
2446,
29918,
29990,
1275,
29871,
29900,
29901,
13,
9651,
599,
29918,
510,
5824,
29889,
4397,
3319,
29895,
1800,
13,
9651,
2867,
13,
308,
13,
1678,
736,
599,
29918,
510,
5824,
13,
13,
1753,
3081,
11139,
29898,
29990,
29892,
405,
1125,
13,
1678,
396,
25034,
445,
740,
13,
1678,
364,
353,
7431,
29898,
276,
2764,
29918,
13519,
11139,
29898,
29990,
29892,
405,
876,
13,
1678,
396,
2158,
29898,
14834,
29897,
13,
1678,
736,
364,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1060,
353,
938,
29898,
2080,
2141,
17010,
3101,
13,
1678,
405,
353,
938,
29898,
2080,
2141,
17010,
3101,
13,
1678,
1121,
353,
3081,
11139,
29898,
29990,
29892,
405,
29897,
13,
1678,
1596,
29898,
2914,
29897,
2
] |
app/appdev.py | student1304/co2 | 0 | 178999 | <gh_stars>0
import streamlit as st
import pandas as pd
#import numpy as np
#import time
from api_tools import get_product_info
# load md text from file and display on page
path_to_md = "./intro.md"
with open(path_to_md, "r") as f:
md_text = f.read()
st.markdown(md_text)
# load and display cart
cart_csv = st.file_uploader('Drag&Drop CSV oder Upload hier', type="csv")
if cart_csv is not None:
data = pd.read_csv(cart_csv, sep=',', decimal='.')
st.write(data)
st.balloons()
#loop through cart and show categories
for gtin in data.GTIN:
#st.write(gtin)
info = get_product_info(gtin)
st.info('getting info for... '+str(gtin))
if info['status'] != 1:
st.markdown(' - **no info** available in openfoodfacts.org')
else:
image_url = info['product']['selected_images']['front']['thumb']['de']
st.markdown('' %image_url)
st.write(
info['product']['packaging_tags'],
info['product']['categories_hierarchy']
)
st.success('it worked!')
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
4840,
19411,
408,
380,
13,
5215,
11701,
408,
10518,
13,
29937,
5215,
12655,
408,
7442,
13,
29937,
5215,
931,
13,
3166,
7882,
29918,
8504,
1053,
679,
29918,
4704,
29918,
3888,
13,
13,
13,
29937,
2254,
22821,
1426,
515,
934,
322,
2479,
373,
1813,
13,
2084,
29918,
517,
29918,
3487,
353,
376,
6904,
23333,
29889,
3487,
29908,
13,
2541,
1722,
29898,
2084,
29918,
517,
29918,
3487,
29892,
376,
29878,
1159,
408,
285,
29901,
13,
1678,
22821,
29918,
726,
353,
285,
29889,
949,
580,
13,
303,
29889,
3502,
3204,
29898,
3487,
29918,
726,
29897,
13,
13,
29937,
2254,
322,
2479,
7774,
13,
13823,
29918,
7638,
353,
380,
29889,
1445,
29918,
9009,
261,
877,
23978,
29987,
15063,
16874,
4461,
5020,
1359,
6128,
742,
1134,
543,
7638,
1159,
13,
361,
7774,
29918,
7638,
338,
451,
6213,
29901,
13,
1678,
848,
353,
10518,
29889,
949,
29918,
7638,
29898,
13823,
29918,
7638,
29892,
16345,
29922,
742,
742,
13677,
2433,
29889,
1495,
13,
1678,
380,
29889,
3539,
29898,
1272,
29897,
13,
1678,
380,
29889,
5521,
417,
787,
580,
13,
13,
13,
1678,
396,
7888,
1549,
7774,
322,
1510,
13997,
13,
1678,
363,
330,
29873,
262,
297,
848,
29889,
23799,
1177,
29901,
13,
4706,
396,
303,
29889,
3539,
29898,
4141,
262,
29897,
13,
4706,
5235,
353,
679,
29918,
4704,
29918,
3888,
29898,
4141,
262,
29897,
13,
4706,
380,
29889,
3888,
877,
29264,
5235,
363,
856,
525,
29974,
710,
29898,
4141,
262,
876,
13,
4706,
565,
5235,
1839,
4882,
2033,
2804,
29871,
29896,
29901,
13,
9651,
380,
29889,
3502,
3204,
877,
259,
448,
3579,
1217,
5235,
1068,
3625,
297,
1722,
1181,
397,
17028,
29879,
29889,
990,
1495,
13,
4706,
1683,
29901,
13,
9651,
1967,
29918,
2271,
353,
5235,
1839,
4704,
16215,
8391,
29918,
8346,
16215,
8862,
16215,
386,
3774,
16215,
311,
2033,
13,
9651,
380,
29889,
3502,
3204,
877,
21298,
2940,
850,
29995,
29879,
16029,
1273,
3027,
29918,
2271,
29897,
13,
9651,
380,
29889,
3539,
29898,
13,
18884,
5235,
1839,
4704,
16215,
4058,
6751,
29918,
11338,
7464,
29871,
13,
18884,
5235,
1839,
4704,
16215,
20683,
29918,
29882,
631,
12040,
2033,
13,
9651,
1723,
13,
1678,
380,
29889,
8698,
877,
277,
3796,
29991,
1495,
13,
308,
2
] |
common/layers.py | bhneo/FMRouting | 0 | 171513 | import time
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import Layer
from tensorflow.python.keras.utils import tf_utils
from common import utils
from common.ops import ops as custom_ops
from common.ops import transformation
from common.ops.em_routing import em_routing
from common.ops.routing import dynamic_routing
eps = 1e-10
class Activation(Layer):
def __init__(self,
activation='squash',
with_prob=False,
**kwargs):
super(Activation, self).__init__(**kwargs)
self.activation_fn = custom_ops.get_activation(activation)
self.with_prob = with_prob
def call(self, inputs, **kwargs):
if self.activation_fn:
pose, prob = self.activation_fn(inputs, axis=-1)
else:
pose, prob = inputs, None
if self.with_prob:
return pose, prob
else:
return pose
class PrimaryCapsule(Layer):
def __init__(self,
kernel_size,
strides,
use_bias=False,
conv_caps=False,
padding='valid',
groups=32,
atoms=8,
activation='squash',
kernel_initializer=keras.initializers.glorot_normal(),
kernel_regularizer=None,
**kwargs):
super(PrimaryCapsule, self).__init__(**kwargs)
self.kernel_size = kernel_size
self.strides = strides
self.padding = padding
self.groups = groups
self.atoms = atoms
self.conv_caps = conv_caps
self.activation_fn = custom_ops.get_activation(activation)
self.conv = keras.layers.Conv2D(filters=self.groups * self.atoms,
kernel_size=self.kernel_size,
strides=self.strides,
padding=self.padding,
use_bias=use_bias,
activation=None,
kernel_initializer=kernel_initializer,
kernel_regularizer=kernel_regularizer)
def call(self, inputs, **kwargs):
pose = self.conv(inputs)
pose_shape = pose.get_shape().as_list()
if self.conv_caps:
pose = tf.reshape(pose, shape=[-1, pose_shape[1], pose_shape[2], self.groups, self.atoms])
else:
pose = tf.reshape(pose, shape=[-1, pose_shape[1]*pose_shape[2]*self.groups, self.atoms])
if self.activation_fn:
pose, prob = self.activation_fn(pose, axis=-1)
return pose, prob
else:
return pose
class CapsuleTransformDense(Layer):
def __init__(self,
num_out,
out_atom,
share_weights=False,
matrix=False,
initializer=keras.initializers.glorot_normal(),
regularizer=None,
**kwargs):
super(CapsuleTransformDense, self).__init__(**kwargs)
self.num_out = num_out
self.out_atom = out_atom
self.share_weights = share_weights
self.matrix = matrix
self.wide = None
self.initializer = initializer
self.regularizer = regularizer
def build(self, input_shape):
in_atom = input_shape[-1]
in_num = input_shape[-2]
if self.matrix:
self.wide = int(np.sqrt(in_atom))
if self.share_weights:
if self.wide:
self.kernel = self.add_weight(
name='capsule_kernel',
shape=(1, self.num_out, self.wide, self.wide),
initializer=self.initializer,
regularizer=self.regularizer,
trainable=True)
self.kernel = tf.tile(self.kernel, [in_num, 1, 1, 1])
else:
self.kernel = self.add_weight(
name='capsule_kernel',
shape=(1, in_atom,
self.num_out * self.out_atom),
initializer=self.initializer,
regularizer=self.regularizer,
trainable=True)
self.kernel = tf.tile(self.kernel, [in_num, 1, 1])
else:
if self.wide:
self.kernel = self.add_weight(
name='capsule_kernel',
shape=(in_num, self.num_out, self.wide, self.wide),
initializer=self.initializer,
regularizer=self.regularizer,
trainable=True)
else:
self.kernel = self.add_weight(
name='capsule_kernel',
shape=(in_num, in_atom,
self.num_out * self.out_atom),
initializer=self.initializer,
regularizer=self.regularizer,
trainable=True)
def call(self, inputs, **kwargs):
in_shape = inputs.get_shape().as_list()
in_shape[0] = -1
if self.wide:
# [bs, in_num, in_atom] -> [bs, in_num, wide, wide]
inputs = tf.reshape(inputs, in_shape[:-1]+[self.wide, self.wide])
# [bs, in_num, a, b] X [in_num, out_num, b, c]
# -> [bs, in_num, out_num, a, c]
outputs = transformation.matrix_capsule_element_wise(inputs, self.kernel, self.num_out)
outputs = tf.reshape(outputs, in_shape[:-1] + [self.num_out] + [in_shape[-1]])
else:
# [bs, in_num, in_atom] X [in_num, in_atom, out_num*out_atom]
# -> [bs, in_num, out_num, out_atom]
outputs = transformation.matmul_element_wise(inputs, self.kernel, self.num_out, self.out_atom)
return outputs
class CapsuleTransformConv(Layer):
def __init__(self,
kernel_size,
stride,
filter,
atom,
initializer=keras.initializers.glorot_normal(),
regularizer=None,
**kwargs):
super(CapsuleTransformConv, self).__init__(**kwargs)
self.kernel_size = kernel_size
self.stride = stride
self.filter = filter
self.atom = atom
self.initializer = initializer
self.regularizer = regularizer
def build(self, input_shape):
# inputs [bs, height, width, channel, in_atom]
in_channel = input_shape[-2]
in_atom = input_shape[-1]
self.matrix = self.add_weight(
name='capsule_kernel',
shape=(self.kernel_size*self.kernel_size*in_channel, in_atom,
self.filter*self.atom),
initializer=self.initializer,
regularizer=self.regularizer,
trainable=True)
def call(self, inputs, **kwargs):
# inputs [bs, height, width, channel, in_atom]
inputs_tile, _ = utils.kernel_tile(inputs, self.kernel_size, self.stride)
# tile [bs, out_height, out_width, kernel*kernel*channel, in_atom]
outputs = transformation.matmul_element_wise(inputs_tile, self.matrix, self.filter, self.atom)
# [bs, out_height, out_width, kernel*kernel*channel, out_num, out_atom]
return outputs
class CapsuleGroups(Layer):
def __init__(self,
height,
width,
channel,
atoms,
activation=None,
**kwargs):
super(CapsuleGroups, self).__init__(**kwargs)
self.height = height
self.width = width
self.channel = channel
self.atoms = atoms
self.activation_fn = custom_ops.get_activation(activation)
def call(self, inputs, **kwargs):
group_num = self.channel // self.atoms
vote = tf.reshape(inputs, shape=[-1, self.height * self.width, group_num, self.atoms])
if self.activation_fn:
vote, _ = self.activation_fn(vote)
return vote
class RoutingPooling(Layer):
def __init__(self,
kernel_size,
strides,
atoms,
in_norm=True,
num_routing=2,
temper=1.0,
**kwargs):
super(RoutingPooling, self).__init__(**kwargs)
self.kernel_size = kernel_size
self.strides = strides
self.atoms = atoms
self.in_norm = in_norm
self.num_routing = num_routing
self.temper = temper
def call(self, inputs, **kwargs):
patched = batch_2d(inputs, self.kernel_size, self.strides)
patched_shape = patched.get_shape().as_list()
patched = tf.reshape(patched,
[-1] + patched_shape[1:4] + [patched_shape[4] // self.atoms, self.atoms])
patched = tf.transpose(patched, perm=[0, 1, 2, 4, 3, 5])
patched = tf.expand_dims(patched, axis=-2)
pose, _ = dynamic_routing(patched,
num_routing=self.num_routing,
softmax_in=True,
temper=self.temper,
activation='norm')
pose = tf.reshape(pose, [-1] + patched_shape[1:3] + [patched_shape[4]])
return pose
class FMPooling(Layer):
def __init__(self,
kernel_size,
strides,
fm_norm,
atoms,
out_norm=False,
**kwargs):
super(FMPooling, self).__init__(**kwargs)
self.kernel_size = kernel_size
self.strides = strides
self.fm_norm = fm_norm
self.atoms = atoms
self.out_norm = out_norm
def call(self, inputs, **kwargs):
patched = batch_2d(inputs, self.kernel_size, self.strides)
patched_shape = patched.get_shape().as_list()
patched = tf.reshape(patched,
[-1] + patched_shape[1:4] + [patched_shape[4] // self.atoms, self.atoms])
patched = tf.transpose(patched, perm=[0, 1, 2, 4, 3, 5])
pool = get_factorization_machines(patched, axis=-2)
pool = tf.reshape(pool, [-1] + patched_shape[1:3] + [patched_shape[4]])
if self.out_norm:
pool, _ = custom_ops.vector_norm(pool)
return pool
class DynamicRouting(Layer):
def __init__(self,
num_routing=3,
softmax_in=False,
temper=1.0,
activation='squash',
pooling=False,
log=None,
**kwargs):
super(DynamicRouting, self).__init__(**kwargs)
self.num_routing = num_routing
self.softmax_in = softmax_in
self.temper = temper
self.activation = activation
self.pooling = pooling
self.log = log
def call(self, inputs, **kwargs):
if self.pooling:
inputs = tf.expand_dims(inputs, -2)
pose, prob = dynamic_routing(inputs,
num_routing=self.num_routing,
softmax_in=self.softmax_in,
temper=self.temper,
activation=self.activation)
pose = tf.squeeze(pose, axis=-3)
prob = tf.squeeze(prob, axis=[-3, -1])
return pose, prob
class EMRouting(Layer):
def __init__(self,
num_routing=3,
log=None,
**kwargs):
super(EMRouting, self).__init__(**kwargs)
self.num_routing = num_routing
self.log = log
def build(self, input_shape):
# ----- Betas -----#
"""
# Initialization from <NAME> [1]:
beta_v_hui = tf.get_variable(
name='beta_v',
shape=[1, 1, 1, o],
dtype=tf.float32,
initializer=tf.contrib.layers.xavier_initializer())
beta_a_hui = tf.get_variable(
name='beta_a',
shape=[1, 1, 1, o],
dtype=tf.float32,
initializer=tf.contrib.layers.xavier_initializer())
# AG 21/11/2018:
# Tried to find std according to Hinton's comments on OpenReview
# https://openreview.net/forum?id=HJWLfGWRb¬eId=r1lQjCAChm
# Hinton: "We used truncated_normal_initializer and set the std so that at the
# start of training half of the capsules in each layer are active and half
# inactive (for the Primary Capsule layer where the activation is not computed
# through routing we use different std for activation convolution weights &
# for pose parameter convolution weights)."
#
# std beta_v seems to control the spread of activations
# To try and achieve what Hinton said about half active and half not active,
# I change the std values and check the histogram/distributions in
# Tensorboard
# to try and get a good spread across all values. I couldn't get this working
# nicely.
beta_v_hui = slim.model_variable(
name='beta_v',
shape=[1, 1, 1, 1, o, 1],
dtype=tf.float32,
initializer=tf.truncated_normal_initializer(mean=0.0, stddev=10.0))
"""
o = input_shape[0].as_list()[-2] # out caps
self.beta_a = self.add_weight(name='beta_a',
shape=[1, 1, o, 1],
dtype=tf.float32,
initializer=tf.keras.initializers.TruncatedNormal(mean=-1000.0, stddev=500.0))
# AG 04/10/2018: using slim.variable to create instead of tf.get_variable so
# that they get correctly placed on the CPU instead of GPU in the multi-gpu
# version.
# One beta per output capsule type
# (N, i, o, atom)
self.beta_v = self.add_weight(name='beta_v',
shape=[1, 1, o, 1],
dtype=tf.float32,
initializer=tf.keras.initializers.GlorotNormal(),
regularizer=None)
def call(self, inputs, **kwargs):
# votes (bs, in, out, atom)
# activations (bs, in, 1)
votes_flat, activation_flat = inputs
pose, prob = em_routing(votes_flat,
activation_flat,
self.beta_a,
self.beta_v,
self.num_routing,
final_lambda=0.01,
epsilon=1e-9,
spatial_routing_matrix=[[1]])
prob = tf.squeeze(prob, axis=[-1])
return pose, prob
class Decoder(Layer):
def __init__(self,
height,
width,
channel,
balance_factor,
layers=[512, 1024],
**kwargs):
super(Decoder, self).__init__(**kwargs)
self.height = height
self.width = width
self.channel = channel
self.balance_factor = balance_factor
self.layers = []
for layer in layers:
self.layers.append(keras.layers.Dense(layer, tf.nn.relu))
self.layers.append(keras.layers.Dense(self.height*self.width*self.channel, tf.sigmoid))
def call(self, inputs, **kwargs):
active_caps, images = inputs
for layer in self.layers:
active_caps = layer(active_caps)
recons = active_caps
recons_img = tf.reshape(recons, [-1, self.height, self.width, self.channel])
distance = tf.pow(recons_img - images, 2)
loss = tf.reduce_sum(distance, [-1, -2, -3])
recons_loss = self.balance_factor * tf.reduce_mean(loss)
self.add_loss(recons_loss)
return recons_loss, recons_img
class Mask(Layer):
def __init__(self,
order,
share=True,
out_num=10,
**kwargs):
super(Mask, self).__init__(**kwargs)
self.order = order
self.share = share
self.out_num = out_num
def call(self, inputs, **kwargs):
poses, probs, labels = inputs
if len(labels.get_shape()) != len(probs.get_shape()):
labels = tf.one_hot(labels, probs.get_shape().as_list()[-1])
def inference():
if self.order > 0:
_, top_k = tf.nn.top_k(probs, self.order + 1)
split = tf.split(top_k, self.order + 1, -1)
split = split[-1]
predictions = tf.expand_dims(tf.one_hot(tf.squeeze(split, -1), self.out_num), -1)
else:
predictions = tf.expand_dims(tf.one_hot(tf.argmax(probs, -1), self.out_num), -1)
return predictions
training = keras.backend.learning_phase()
mask = tf_utils.smart_cond(training, lambda: tf.expand_dims(labels, -1), inference)
masked_caps = tf.multiply(poses, mask)
if self.share:
active_caps = tf.reduce_sum(masked_caps, axis=-2)
else:
active_caps = keras.layers.Flatten()(masked_caps)
return active_caps
class DecoderConv(Layer):
def __init__(self,
height,
width,
channel,
balance_factor,
base=10,
filter=64,
kernel_initializer=keras.initializers.he_normal(),
kernel_regularizer=keras.regularizers.l2(1e-4),
**kwargs):
super(DecoderConv, self).__init__(**kwargs)
self.height = height
self.width = width
self.channel = channel
self.balance_factor = balance_factor
self.layers = [keras.layers.Dense(base*base*filter),
keras.layers.BatchNormalization(),
keras.layers.LeakyReLU(),
keras.layers.Reshape((base, base, filter)),
keras.layers.Conv2DTranspose(filter//2, (5, 5), strides=(1, 1), padding='same',
kernel_initializer=kernel_initializer,
kernel_regularizer=kernel_regularizer),
keras.layers.BatchNormalization(),
keras.layers.LeakyReLU(),
keras.layers.Conv2DTranspose(filter//4, (5, 5), strides=(2, 2), padding='same',
kernel_initializer=kernel_initializer,
kernel_regularizer=kernel_regularizer),
keras.layers.BatchNormalization(),
keras.layers.LeakyReLU(),
keras.layers.Conv2DTranspose(1, (5, 5), strides=(2, 2), padding='same', activation=tf.sigmoid,
kernel_initializer=kernel_initializer,
kernel_regularizer=kernel_regularizer),
]
def call(self, inputs, **kwargs):
active_caps, images = inputs
for layer in self.layers:
active_caps = layer(active_caps)
recons_img = active_caps
distance = tf.pow(recons_img - images, 2)
loss = tf.reduce_sum(distance, [-1, -2, -3])
recons_loss = self.balance_factor * tf.reduce_mean(loss)
self.add_loss(recons_loss)
return recons_loss, recons_img
class VectorNorm(Layer):
def __init__(self, **kwargs):
super(VectorNorm, self).__init__(**kwargs)
def call(self, inputs, **kwargs):
x = custom_ops.vector_norm(inputs, -1)
return x
class LastFMPool(Layer):
def __init__(self,
axis=-2,
activation='accumulate',
shrink=None,
stable=False,
norm_pose=True,
log=None,
regularize=True,
**kwargs):
super(LastFMPool, self).__init__(**kwargs)
self.axis = axis
self.activation = activation
self.shrink = shrink
self.stable = stable
self.norm_pose = norm_pose
self.log = log
self.regularize = regularize
def call(self, inputs, **kwargs):
# [bs, caps_in, caps_out, atom]
outputs, importance = get_factorization_machines(inputs,
self.axis,
regularize=self.regularize)
if self.log:
if importance:
self.log.add_hist('importance', importance)
self.log.add_hist('fm_out', outputs)
self.log.add_hist('fm_similarity', tf.reduce_sum(outputs, axis=-1))
if self.activation == 'accumulate':
outputs, norm = custom_ops.accumulate(outputs, shrink=self.shrink, stable=self.stable, norm_pose=self.norm_pose)
norm = tf.squeeze(norm, -1)
return outputs, norm
elif self.activation == 'squash':
outputs, norm = custom_ops.squash(outputs)
norm = tf.squeeze(norm, -1)
return outputs, norm
elif self.activation == 'norm':
outputs, _ = custom_ops.vector_norm(outputs)
return outputs
else:
return outputs
class LastAveragePooling(Layer):
def __init__(self,
axis=-2,
**kwargs):
super(LastAveragePooling, self).__init__(**kwargs)
self.axis = axis
def call(self, inputs, **kwargs):
outputs = tf.reduce_mean(inputs, axis=self.axis)
return outputs
class LastMaxPooling(Layer):
def __init__(self,
axis=-2,
**kwargs):
super(LastMaxPooling, self).__init__(**kwargs)
self.axis = axis
def call(self, inputs, **kwargs):
outputs = tf.reduce_max(inputs, axis=self.axis)
return outputs
def get_original_capsule_layer(inputs, num_out, out_atom, num_routing=3, temper=1.0):
transformed = CapsuleTransformDense(num_out=num_out, out_atom=out_atom, share_weights=False)(inputs)
routed = DynamicRouting(num_routing=num_routing, temper=temper)(transformed)
return routed
def get_factorization_machines(inputs, axis=-2, regularize=True):
# [bs, caps_in, caps_out, atom]
if regularize:
cap_in = inputs.get_shape()[1]
inputs /= np.sqrt(cap_in)
x1 = tf.reduce_sum(inputs, axis, keepdims=True) # [bs, 1, caps_out, atom]
x1 = tf.square(x1)
x2_square = tf.square(inputs)
x2 = tf.reduce_sum(x2_square, axis, keepdims=True) # [bs, 1, caps_out, atom]
outputs = x1 - x2
outputs = tf.squeeze(outputs, axis)
weight = None
return outputs, weight
def get_average_pooling(inputs):
x = tf.reduce_mean(inputs, axis=-2)
return
def get_cross_mul(inputs):
n = inputs.get_shape().as_list()[-2]
outputs = 0
for i in range(n):
for j in range(n):
if i != j:
outputs += inputs[i] * inputs[j]
outputs /= (2 * n)
return outputs
def batch_2d(inputs, kernel_size, strides, name=None):
if not isinstance(kernel_size, tuple):
kernel_size = (kernel_size, kernel_size)
if not isinstance(strides, tuple):
strides = (strides, strides)
name = "batch_to_pool" if name is None else name
with tf.name_scope(name):
height, width = inputs.get_shape().as_list()[1:3]
h_offsets = [[(h + k) for k in range(0, kernel_size[0])] for h in range(0, height + 1 - kernel_size[0], strides[0])]
w_offsets = [[(w + k) for k in range(0, kernel_size[1])] for w in range(0, width + 1 - kernel_size[1], strides[1])]
patched = tf.gather(inputs, h_offsets, axis=1)
patched = tf.gather(patched, w_offsets, axis=3)
perm = [0, 1, 3, 2, 4, 5]
patched = tf.transpose(patched, perm=perm)
shape = patched.get_shape().as_list()
shape = [-1] + shape[1:3] + [np.prod(shape[3:-1]), shape[-1]]
patched = tf.reshape(patched, shape=shape)
return patched
def test_routing_pool():
x = tf.random.normal([64, 16, 16, 64])
x = RoutingPooling(3, 2, 8)(x)
print(x.shape)
def test_batch_2d():
x = tf.random.normal([128, 32, 32, 3])
x = batch_2d(x, 2, 2)
print(x.shape)
def verify_factorization_machines():
x = tf.random.normal([1000, 16])
t1 = time.time()
out1 = get_cross_mul(x)
t2 = time.time()
print('cross mul cost:', t2 - t1)
print('cross mul result:', out1)
out2 = get_factorization_machines(x)
t3 = time.time()
print('FM cost:', t3 - t2)
print('FM result:', out2)
def test_ablation_fm():
num = 1000
atom = 16
a = tf.random.normal([10000, num, atom], 2, 20)
a = a / tf.norm(a, axis=-1, keepdims=True)
a = a / tf.sqrt(tf.cast(num, tf.float32))
b1 = tf.square(tf.reduce_sum(a, 1))
# b1_mean, b1_var = tf.nn.moments(b1, 0)
# print('b1_mean:', b1_mean.numpy())
# print('b1_var:', b1_var.numpy())
b2 = tf.reduce_sum(tf.square(a), 1)
# b2_mean, b2_var = tf.nn.moments(b2, 0)
# print('b2_mean:', b2_mean.numpy())
# print('b2_var:', b2_var.numpy())
fm = b1 - b2
b3_mean, b3_var = tf.nn.moments(fm, 0)
print('b3_mean:', b3_mean.numpy())
print('b3_var:', b3_var.numpy())
act = tf.reduce_sum(fm, 1)
act_mean, act_var = tf.nn.moments(act, 0)
print('act_mean:', act_mean.numpy())
print('act_var:', act_var.numpy())
def verify_vec_norm():
vec_norm = VectorNorm()
x = tf.random.normal([64, 16])
x = vec_norm(x)
print(tf.norm(x, axis=-1))
def verify_average_pooling():
x = tf.random.normal([10, 8, 8, 64])
x1 = keras.layers.AveragePooling2D([8, 8])(x)
x1 = tf.squeeze(x1)
x = tf.reshape(x, [10, 64, 64])
x2 = LastAveragePooling()(x)
print(tf.reduce_sum(x1-x2))
def verify_pri_capsule():
x = tf.random.normal([10, 8, 8, 64])
x = CapsuleGroups(height=8,
width=8,
channel=64,
atoms=32,
activation='norm')(x)
print(tf.norm(x, axis=-1))
def verify_dynamic_routing():
x = tf.random.normal([10, 2, 64, 1, 32])
y = DynamicRouting()(x)
print(y)
def verify_fm_pool():
x = tf.random.normal([128, 32, 32, 64])
y = FMPooling(3, 2, 8)(x)
print(y)
def verify_last_fm_pool():
x = tf.random.normal([128, 1152, 16])
x_mean, x_var = tf.nn.moments(x, [0,1,2])
y = LastFMPool(activation=None)(x)
y_mean, y_var = tf.nn.moments(y, [0,1])
print(y)
print(y_var)
def verify_transform():
x = tf.random.normal((128, 30, 8))
trans = CapsuleTransformDense(10, 16)(x)
print(trans)
def var_experiments():
x = tf.random.normal([10240, 64])
x1_mean, x1_var = tf.nn.moments(x, [0, 1])
x2_mean, x2_var = tf.nn.moments(x*x, [0, 1])
x4_mean = tf.reduce_mean(x*x*x*x)
print('x1_var', x1_var)
print('x2_var', x2_var)
print('x4_mean', x4_mean)
y = get_factorization_machines(x, 1)
y_mean, y_var = tf.nn.moments(y, [0])
print('y_mean', y_mean)
print('y_var', y_var)
def var_vec_norm_scale():
x = tf.random.normal([12800, 160])
x_norm, _ = custom_ops.vector_norm_scale(x, -1)
x_norm_verify = tf.norm(x_norm, axis=-1)
y_mean, y_var = tf.nn.moments(x_norm, [0, 1])
print('E:',y_mean.numpy(), 'D:', y_var.numpy())
if __name__ == "__main__":
# verify_factorization_machines()
# verify_last_fm_pool()
# var_experiments()
# verify_dynamic_routing()
# verify_transform()
# test_batch_2d()
# test_routing_pool()
# verify_fm_pool()
var_vec_norm_scale()
| [
1,
1053,
931,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
26110,
408,
15886,
13,
3166,
26110,
1053,
13023,
294,
13,
3166,
26110,
29889,
3946,
294,
29889,
29277,
1053,
365,
2747,
13,
3166,
26110,
29889,
4691,
29889,
3946,
294,
29889,
13239,
1053,
15886,
29918,
13239,
13,
13,
3166,
3619,
1053,
3667,
29879,
13,
3166,
3619,
29889,
3554,
1053,
288,
567,
408,
2888,
29918,
3554,
13,
3166,
3619,
29889,
3554,
1053,
13852,
13,
3166,
3619,
29889,
3554,
29889,
331,
29918,
14608,
292,
1053,
953,
29918,
14608,
292,
13,
3166,
3619,
29889,
3554,
29889,
14608,
292,
1053,
7343,
29918,
14608,
292,
13,
13,
8961,
353,
29871,
29896,
29872,
29899,
29896,
29900,
13,
13,
13,
1990,
21775,
362,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
26229,
2433,
26613,
1161,
742,
13,
462,
411,
29918,
22795,
29922,
8824,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
21786,
362,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
11236,
362,
29918,
9144,
353,
2888,
29918,
3554,
29889,
657,
29918,
11236,
362,
29898,
11236,
362,
29897,
13,
4706,
1583,
29889,
2541,
29918,
22795,
353,
411,
29918,
22795,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
11236,
362,
29918,
9144,
29901,
13,
9651,
18593,
29892,
2070,
353,
1583,
29889,
11236,
362,
29918,
9144,
29898,
2080,
29879,
29892,
9685,
10457,
29896,
29897,
13,
4706,
1683,
29901,
13,
9651,
18593,
29892,
2070,
353,
10970,
29892,
6213,
13,
4706,
565,
1583,
29889,
2541,
29918,
22795,
29901,
13,
9651,
736,
18593,
29892,
2070,
13,
4706,
1683,
29901,
13,
9651,
736,
18593,
13,
13,
13,
1990,
28267,
29907,
2547,
1297,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
8466,
29918,
2311,
29892,
13,
462,
851,
2247,
29892,
13,
462,
671,
29918,
29890,
3173,
29922,
8824,
29892,
13,
462,
7602,
29918,
29883,
2547,
29922,
8824,
29892,
13,
462,
7164,
2433,
3084,
742,
13,
462,
6471,
29922,
29941,
29906,
29892,
13,
462,
28422,
29922,
29947,
29892,
13,
462,
26229,
2433,
26613,
1161,
742,
13,
462,
8466,
29918,
11228,
3950,
29922,
3946,
294,
29889,
11228,
19427,
29889,
3820,
272,
327,
29918,
8945,
3285,
13,
462,
8466,
29918,
15227,
3950,
29922,
8516,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
26666,
29907,
2547,
1297,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
17460,
29918,
2311,
353,
8466,
29918,
2311,
13,
4706,
1583,
29889,
710,
2247,
353,
851,
2247,
13,
4706,
1583,
29889,
12791,
353,
7164,
13,
4706,
1583,
29889,
13155,
353,
6471,
13,
4706,
1583,
29889,
271,
4835,
353,
28422,
13,
4706,
1583,
29889,
20580,
29918,
29883,
2547,
353,
7602,
29918,
29883,
2547,
13,
4706,
1583,
29889,
11236,
362,
29918,
9144,
353,
2888,
29918,
3554,
29889,
657,
29918,
11236,
362,
29898,
11236,
362,
29897,
13,
4706,
1583,
29889,
20580,
353,
13023,
294,
29889,
29277,
29889,
1168,
29894,
29906,
29928,
29898,
26705,
29922,
1311,
29889,
13155,
334,
1583,
29889,
271,
4835,
29892,
13,
462,
462,
4706,
8466,
29918,
2311,
29922,
1311,
29889,
17460,
29918,
2311,
29892,
13,
462,
462,
4706,
851,
2247,
29922,
1311,
29889,
710,
2247,
29892,
13,
462,
462,
4706,
7164,
29922,
1311,
29889,
12791,
29892,
13,
462,
462,
4706,
671,
29918,
29890,
3173,
29922,
1509,
29918,
29890,
3173,
29892,
13,
462,
462,
4706,
26229,
29922,
8516,
29892,
13,
462,
462,
4706,
8466,
29918,
11228,
3950,
29922,
17460,
29918,
11228,
3950,
29892,
13,
462,
462,
4706,
8466,
29918,
15227,
3950,
29922,
17460,
29918,
15227,
3950,
29897,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
18593,
353,
1583,
29889,
20580,
29898,
2080,
29879,
29897,
13,
4706,
18593,
29918,
12181,
353,
18593,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
13,
4706,
565,
1583,
29889,
20580,
29918,
29883,
2547,
29901,
13,
9651,
18593,
353,
15886,
29889,
690,
14443,
29898,
4220,
29892,
8267,
11759,
29899,
29896,
29892,
18593,
29918,
12181,
29961,
29896,
1402,
18593,
29918,
12181,
29961,
29906,
1402,
1583,
29889,
13155,
29892,
1583,
29889,
271,
4835,
2314,
13,
4706,
1683,
29901,
13,
9651,
18593,
353,
15886,
29889,
690,
14443,
29898,
4220,
29892,
8267,
11759,
29899,
29896,
29892,
18593,
29918,
12181,
29961,
29896,
14178,
4220,
29918,
12181,
29961,
29906,
14178,
1311,
29889,
13155,
29892,
1583,
29889,
271,
4835,
2314,
13,
4706,
565,
1583,
29889,
11236,
362,
29918,
9144,
29901,
13,
9651,
18593,
29892,
2070,
353,
1583,
29889,
11236,
362,
29918,
9144,
29898,
4220,
29892,
9685,
10457,
29896,
29897,
13,
9651,
736,
18593,
29892,
2070,
13,
4706,
1683,
29901,
13,
9651,
736,
18593,
13,
13,
13,
1990,
315,
2547,
1297,
13372,
29928,
1947,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
954,
29918,
449,
29892,
13,
462,
714,
29918,
8678,
29892,
13,
462,
6232,
29918,
705,
5861,
29922,
8824,
29892,
13,
462,
4636,
29922,
8824,
29892,
13,
462,
2847,
3950,
29922,
3946,
294,
29889,
11228,
19427,
29889,
3820,
272,
327,
29918,
8945,
3285,
13,
462,
4943,
3950,
29922,
8516,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
29907,
2547,
1297,
13372,
29928,
1947,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
1949,
29918,
449,
353,
954,
29918,
449,
13,
4706,
1583,
29889,
449,
29918,
8678,
353,
714,
29918,
8678,
13,
4706,
1583,
29889,
13653,
29918,
705,
5861,
353,
6232,
29918,
705,
5861,
13,
4706,
1583,
29889,
5344,
353,
4636,
13,
4706,
1583,
29889,
8157,
353,
6213,
13,
4706,
1583,
29889,
11228,
3950,
353,
2847,
3950,
13,
4706,
1583,
29889,
15227,
3950,
353,
4943,
3950,
13,
13,
1678,
822,
2048,
29898,
1311,
29892,
1881,
29918,
12181,
1125,
13,
4706,
297,
29918,
8678,
353,
1881,
29918,
12181,
14352,
29896,
29962,
13,
4706,
297,
29918,
1949,
353,
1881,
29918,
12181,
14352,
29906,
29962,
13,
4706,
565,
1583,
29889,
5344,
29901,
13,
9651,
1583,
29889,
8157,
353,
938,
29898,
9302,
29889,
3676,
29898,
262,
29918,
8678,
876,
13,
4706,
565,
1583,
29889,
13653,
29918,
705,
5861,
29901,
13,
9651,
565,
1583,
29889,
8157,
29901,
13,
18884,
1583,
29889,
17460,
353,
1583,
29889,
1202,
29918,
7915,
29898,
13,
462,
1678,
1024,
2433,
29883,
2547,
1297,
29918,
17460,
742,
13,
462,
1678,
8267,
7607,
29896,
29892,
1583,
29889,
1949,
29918,
449,
29892,
1583,
29889,
8157,
29892,
1583,
29889,
8157,
511,
13,
462,
1678,
2847,
3950,
29922,
1311,
29889,
11228,
3950,
29892,
13,
462,
1678,
4943,
3950,
29922,
1311,
29889,
15227,
3950,
29892,
13,
462,
1678,
7945,
519,
29922,
5574,
29897,
13,
18884,
1583,
29889,
17460,
353,
15886,
29889,
29873,
488,
29898,
1311,
29889,
17460,
29892,
518,
262,
29918,
1949,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
2314,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
17460,
353,
1583,
29889,
1202,
29918,
7915,
29898,
13,
462,
1678,
1024,
2433,
29883,
2547,
1297,
29918,
17460,
742,
13,
462,
1678,
8267,
7607,
29896,
29892,
297,
29918,
8678,
29892,
13,
462,
965,
1583,
29889,
1949,
29918,
449,
334,
1583,
29889,
449,
29918,
8678,
511,
13,
462,
1678,
2847,
3950,
29922,
1311,
29889,
11228,
3950,
29892,
13,
462,
1678,
4943,
3950,
29922,
1311,
29889,
15227,
3950,
29892,
13,
462,
1678,
7945,
519,
29922,
5574,
29897,
13,
18884,
1583,
29889,
17460,
353,
15886,
29889,
29873,
488,
29898,
1311,
29889,
17460,
29892,
518,
262,
29918,
1949,
29892,
29871,
29896,
29892,
29871,
29896,
2314,
13,
4706,
1683,
29901,
13,
9651,
565,
1583,
29889,
8157,
29901,
13,
18884,
1583,
29889,
17460,
353,
1583,
29889,
1202,
29918,
7915,
29898,
13,
462,
1678,
1024,
2433,
29883,
2547,
1297,
29918,
17460,
742,
13,
462,
1678,
8267,
7607,
262,
29918,
1949,
29892,
1583,
29889,
1949,
29918,
449,
29892,
1583,
29889,
8157,
29892,
1583,
29889,
8157,
511,
13,
462,
1678,
2847,
3950,
29922,
1311,
29889,
11228,
3950,
29892,
13,
462,
1678,
4943,
3950,
29922,
1311,
29889,
15227,
3950,
29892,
13,
462,
1678,
7945,
519,
29922,
5574,
29897,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
17460,
353,
1583,
29889,
1202,
29918,
7915,
29898,
13,
462,
1678,
1024,
2433,
29883,
2547,
1297,
29918,
17460,
742,
13,
462,
1678,
8267,
7607,
262,
29918,
1949,
29892,
297,
29918,
8678,
29892,
13,
462,
965,
1583,
29889,
1949,
29918,
449,
334,
1583,
29889,
449,
29918,
8678,
511,
13,
462,
1678,
2847,
3950,
29922,
1311,
29889,
11228,
3950,
29892,
13,
462,
1678,
4943,
3950,
29922,
1311,
29889,
15227,
3950,
29892,
13,
462,
1678,
7945,
519,
29922,
5574,
29897,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
297,
29918,
12181,
353,
10970,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
13,
4706,
297,
29918,
12181,
29961,
29900,
29962,
353,
448,
29896,
13,
4706,
565,
1583,
29889,
8157,
29901,
13,
9651,
396,
518,
5824,
29892,
297,
29918,
1949,
29892,
297,
29918,
8678,
29962,
1599,
518,
5824,
29892,
297,
29918,
1949,
29892,
9377,
29892,
9377,
29962,
13,
9651,
10970,
353,
15886,
29889,
690,
14443,
29898,
2080,
29879,
29892,
297,
29918,
12181,
7503,
29899,
29896,
10062,
29961,
1311,
29889,
8157,
29892,
1583,
29889,
8157,
2314,
13,
9651,
396,
518,
5824,
29892,
297,
29918,
1949,
29892,
263,
29892,
289,
29962,
29871,
1060,
29871,
518,
262,
29918,
1949,
29892,
714,
29918,
1949,
29892,
289,
29892,
274,
29962,
13,
9651,
396,
1599,
518,
5824,
29892,
297,
29918,
1949,
29892,
714,
29918,
1949,
29892,
263,
29892,
274,
29962,
13,
9651,
14391,
353,
13852,
29889,
5344,
29918,
29883,
2547,
1297,
29918,
5029,
29918,
3538,
29898,
2080,
29879,
29892,
1583,
29889,
17460,
29892,
1583,
29889,
1949,
29918,
449,
29897,
13,
9651,
14391,
353,
15886,
29889,
690,
14443,
29898,
4905,
29879,
29892,
297,
29918,
12181,
7503,
29899,
29896,
29962,
718,
518,
1311,
29889,
1949,
29918,
449,
29962,
718,
518,
262,
29918,
12181,
14352,
29896,
24960,
13,
4706,
1683,
29901,
13,
9651,
396,
518,
5824,
29892,
297,
29918,
1949,
29892,
297,
29918,
8678,
29962,
1060,
518,
262,
29918,
1949,
29892,
297,
29918,
8678,
29892,
714,
29918,
1949,
29930,
449,
29918,
8678,
29962,
13,
9651,
396,
29871,
1599,
518,
5824,
29892,
297,
29918,
1949,
29892,
714,
29918,
1949,
29892,
714,
29918,
8678,
29962,
13,
9651,
14391,
353,
13852,
29889,
2922,
16109,
29918,
5029,
29918,
3538,
29898,
2080,
29879,
29892,
1583,
29889,
17460,
29892,
1583,
29889,
1949,
29918,
449,
29892,
1583,
29889,
449,
29918,
8678,
29897,
13,
4706,
736,
14391,
13,
13,
13,
1990,
315,
2547,
1297,
13372,
1168,
29894,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
8466,
29918,
2311,
29892,
13,
462,
380,
2426,
29892,
13,
462,
4175,
29892,
13,
462,
12301,
29892,
13,
462,
2847,
3950,
29922,
3946,
294,
29889,
11228,
19427,
29889,
3820,
272,
327,
29918,
8945,
3285,
13,
462,
4943,
3950,
29922,
8516,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
29907,
2547,
1297,
13372,
1168,
29894,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
17460,
29918,
2311,
353,
8466,
29918,
2311,
13,
4706,
1583,
29889,
303,
2426,
353,
380,
2426,
13,
4706,
1583,
29889,
4572,
353,
4175,
13,
4706,
1583,
29889,
8678,
353,
12301,
13,
4706,
1583,
29889,
11228,
3950,
353,
2847,
3950,
13,
4706,
1583,
29889,
15227,
3950,
353,
4943,
3950,
13,
13,
1678,
822,
2048,
29898,
1311,
29892,
1881,
29918,
12181,
1125,
13,
4706,
396,
10970,
518,
5824,
29892,
3171,
29892,
2920,
29892,
8242,
29892,
297,
29918,
8678,
29962,
13,
4706,
297,
29918,
12719,
353,
1881,
29918,
12181,
14352,
29906,
29962,
13,
4706,
297,
29918,
8678,
353,
1881,
29918,
12181,
14352,
29896,
29962,
13,
13,
4706,
1583,
29889,
5344,
353,
1583,
29889,
1202,
29918,
7915,
29898,
13,
9651,
1024,
2433,
29883,
2547,
1297,
29918,
17460,
742,
13,
9651,
8267,
7607,
1311,
29889,
17460,
29918,
2311,
29930,
1311,
29889,
17460,
29918,
2311,
29930,
262,
29918,
12719,
29892,
297,
29918,
8678,
29892,
13,
462,
259,
1583,
29889,
4572,
29930,
1311,
29889,
8678,
511,
13,
9651,
2847,
3950,
29922,
1311,
29889,
11228,
3950,
29892,
13,
9651,
4943,
3950,
29922,
1311,
29889,
15227,
3950,
29892,
13,
9651,
7945,
519,
29922,
5574,
29897,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
396,
10970,
518,
5824,
29892,
3171,
29892,
2920,
29892,
8242,
29892,
297,
29918,
8678,
29962,
13,
4706,
10970,
29918,
29873,
488,
29892,
903,
353,
3667,
29879,
29889,
17460,
29918,
29873,
488,
29898,
2080,
29879,
29892,
1583,
29889,
17460,
29918,
2311,
29892,
1583,
29889,
303,
2426,
29897,
13,
4706,
396,
25900,
518,
5824,
29892,
714,
29918,
3545,
29892,
714,
29918,
2103,
29892,
8466,
29930,
17460,
29930,
12719,
29892,
297,
29918,
8678,
29962,
13,
4706,
14391,
353,
13852,
29889,
2922,
16109,
29918,
5029,
29918,
3538,
29898,
2080,
29879,
29918,
29873,
488,
29892,
1583,
29889,
5344,
29892,
1583,
29889,
4572,
29892,
1583,
29889,
8678,
29897,
13,
4706,
396,
518,
5824,
29892,
714,
29918,
3545,
29892,
714,
29918,
2103,
29892,
8466,
29930,
17460,
29930,
12719,
29892,
714,
29918,
1949,
29892,
714,
29918,
8678,
29962,
13,
4706,
736,
14391,
13,
13,
13,
1990,
315,
2547,
1297,
24020,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
3171,
29892,
13,
462,
2920,
29892,
13,
462,
8242,
29892,
13,
462,
28422,
29892,
13,
462,
26229,
29922,
8516,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
29907,
2547,
1297,
24020,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
3545,
353,
3171,
13,
4706,
1583,
29889,
2103,
353,
2920,
13,
4706,
1583,
29889,
12719,
353,
8242,
13,
4706,
1583,
29889,
271,
4835,
353,
28422,
13,
4706,
1583,
29889,
11236,
362,
29918,
9144,
353,
2888,
29918,
3554,
29889,
657,
29918,
11236,
362,
29898,
11236,
362,
29897,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
2318,
29918,
1949,
353,
1583,
29889,
12719,
849,
1583,
29889,
271,
4835,
13,
4706,
11719,
353,
15886,
29889,
690,
14443,
29898,
2080,
29879,
29892,
8267,
11759,
29899,
29896,
29892,
1583,
29889,
3545,
334,
1583,
29889,
2103,
29892,
2318,
29918,
1949,
29892,
1583,
29889,
271,
4835,
2314,
13,
4706,
565,
1583,
29889,
11236,
362,
29918,
9144,
29901,
13,
9651,
11719,
29892,
903,
353,
1583,
29889,
11236,
362,
29918,
9144,
29898,
15814,
29897,
13,
4706,
736,
11719,
13,
13,
13,
1990,
20829,
292,
11426,
292,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
8466,
29918,
2311,
29892,
13,
462,
851,
2247,
29892,
13,
462,
28422,
29892,
13,
462,
297,
29918,
12324,
29922,
5574,
29892,
13,
462,
954,
29918,
14608,
292,
29922,
29906,
29892,
13,
462,
6238,
29922,
29896,
29889,
29900,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
24254,
292,
11426,
292,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
17460,
29918,
2311,
353,
8466,
29918,
2311,
13,
4706,
1583,
29889,
710,
2247,
353,
851,
2247,
13,
4706,
1583,
29889,
271,
4835,
353,
28422,
13,
4706,
1583,
29889,
262,
29918,
12324,
353,
297,
29918,
12324,
13,
4706,
1583,
29889,
1949,
29918,
14608,
292,
353,
954,
29918,
14608,
292,
13,
4706,
1583,
29889,
12863,
353,
6238,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
13261,
287,
353,
9853,
29918,
29906,
29881,
29898,
2080,
29879,
29892,
1583,
29889,
17460,
29918,
2311,
29892,
1583,
29889,
710,
2247,
29897,
13,
4706,
13261,
287,
29918,
12181,
353,
13261,
287,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
13,
4706,
13261,
287,
353,
15886,
29889,
690,
14443,
29898,
5041,
287,
29892,
13,
462,
632,
21069,
29896,
29962,
718,
13261,
287,
29918,
12181,
29961,
29896,
29901,
29946,
29962,
718,
518,
5041,
287,
29918,
12181,
29961,
29946,
29962,
849,
1583,
29889,
271,
4835,
29892,
1583,
29889,
271,
4835,
2314,
13,
4706,
13261,
287,
353,
15886,
29889,
3286,
4220,
29898,
5041,
287,
29892,
3635,
11759,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29941,
29892,
29871,
29945,
2314,
13,
4706,
13261,
287,
353,
15886,
29889,
18837,
29918,
6229,
29879,
29898,
5041,
287,
29892,
9685,
10457,
29906,
29897,
13,
13,
4706,
18593,
29892,
903,
353,
7343,
29918,
14608,
292,
29898,
5041,
287,
29892,
13,
462,
462,
29871,
954,
29918,
14608,
292,
29922,
1311,
29889,
1949,
29918,
14608,
292,
29892,
13,
462,
462,
29871,
4964,
3317,
29918,
262,
29922,
5574,
29892,
13,
462,
462,
29871,
6238,
29922,
1311,
29889,
12863,
29892,
13,
462,
462,
29871,
26229,
2433,
12324,
1495,
13,
4706,
18593,
353,
15886,
29889,
690,
14443,
29898,
4220,
29892,
21069,
29896,
29962,
718,
13261,
287,
29918,
12181,
29961,
29896,
29901,
29941,
29962,
718,
518,
5041,
287,
29918,
12181,
29961,
29946,
24960,
13,
4706,
736,
18593,
13,
13,
13,
1990,
383,
3580,
1507,
292,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
8466,
29918,
2311,
29892,
13,
462,
851,
2247,
29892,
13,
462,
285,
29885,
29918,
12324,
29892,
13,
462,
28422,
29892,
13,
462,
714,
29918,
12324,
29922,
8824,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
29943,
3580,
1507,
292,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
17460,
29918,
2311,
353,
8466,
29918,
2311,
13,
4706,
1583,
29889,
710,
2247,
353,
851,
2247,
13,
4706,
1583,
29889,
24826,
29918,
12324,
353,
285,
29885,
29918,
12324,
13,
4706,
1583,
29889,
271,
4835,
353,
28422,
13,
4706,
1583,
29889,
449,
29918,
12324,
353,
714,
29918,
12324,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
13261,
287,
353,
9853,
29918,
29906,
29881,
29898,
2080,
29879,
29892,
1583,
29889,
17460,
29918,
2311,
29892,
1583,
29889,
710,
2247,
29897,
13,
4706,
13261,
287,
29918,
12181,
353,
13261,
287,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
13,
4706,
13261,
287,
353,
15886,
29889,
690,
14443,
29898,
5041,
287,
29892,
13,
462,
632,
21069,
29896,
29962,
718,
13261,
287,
29918,
12181,
29961,
29896,
29901,
29946,
29962,
718,
518,
5041,
287,
29918,
12181,
29961,
29946,
29962,
849,
1583,
29889,
271,
4835,
29892,
1583,
29889,
271,
4835,
2314,
13,
4706,
13261,
287,
353,
15886,
29889,
3286,
4220,
29898,
5041,
287,
29892,
3635,
11759,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29941,
29892,
29871,
29945,
2314,
13,
13,
4706,
11565,
353,
679,
29918,
19790,
2133,
29918,
29885,
496,
1475,
29898,
5041,
287,
29892,
9685,
10457,
29906,
29897,
13,
4706,
11565,
353,
15886,
29889,
690,
14443,
29898,
10109,
29892,
21069,
29896,
29962,
718,
13261,
287,
29918,
12181,
29961,
29896,
29901,
29941,
29962,
718,
518,
5041,
287,
29918,
12181,
29961,
29946,
24960,
13,
4706,
565,
1583,
29889,
449,
29918,
12324,
29901,
13,
9651,
11565,
29892,
903,
353,
2888,
29918,
3554,
29889,
8111,
29918,
12324,
29898,
10109,
29897,
13,
4706,
736,
11565,
13,
13,
13,
1990,
27747,
24254,
292,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
954,
29918,
14608,
292,
29922,
29941,
29892,
13,
462,
4964,
3317,
29918,
262,
29922,
8824,
29892,
13,
462,
6238,
29922,
29896,
29889,
29900,
29892,
13,
462,
26229,
2433,
26613,
1161,
742,
13,
462,
11565,
292,
29922,
8824,
29892,
13,
462,
1480,
29922,
8516,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
24001,
24254,
292,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
1949,
29918,
14608,
292,
353,
954,
29918,
14608,
292,
13,
4706,
1583,
29889,
2695,
3317,
29918,
262,
353,
4964,
3317,
29918,
262,
13,
4706,
1583,
29889,
12863,
353,
6238,
13,
4706,
1583,
29889,
11236,
362,
353,
26229,
13,
4706,
1583,
29889,
10109,
292,
353,
11565,
292,
13,
4706,
1583,
29889,
1188,
353,
1480,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
10109,
292,
29901,
13,
9651,
10970,
353,
15886,
29889,
18837,
29918,
6229,
29879,
29898,
2080,
29879,
29892,
448,
29906,
29897,
13,
4706,
18593,
29892,
2070,
353,
7343,
29918,
14608,
292,
29898,
2080,
29879,
29892,
13,
462,
462,
268,
954,
29918,
14608,
292,
29922,
1311,
29889,
1949,
29918,
14608,
292,
29892,
13,
462,
462,
268,
4964,
3317,
29918,
262,
29922,
1311,
29889,
2695,
3317,
29918,
262,
29892,
13,
462,
462,
268,
6238,
29922,
1311,
29889,
12863,
29892,
13,
462,
462,
268,
26229,
29922,
1311,
29889,
11236,
362,
29897,
13,
4706,
18593,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
4220,
29892,
9685,
10457,
29941,
29897,
13,
4706,
2070,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
22795,
29892,
9685,
11759,
29899,
29941,
29892,
448,
29896,
2314,
13,
4706,
736,
18593,
29892,
2070,
13,
13,
13,
1990,
382,
21055,
449,
292,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
954,
29918,
14608,
292,
29922,
29941,
29892,
13,
462,
1480,
29922,
8516,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
12665,
24254,
292,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
1949,
29918,
14608,
292,
353,
954,
29918,
14608,
292,
13,
4706,
1583,
29889,
1188,
353,
1480,
13,
13,
1678,
822,
2048,
29898,
1311,
29892,
1881,
29918,
12181,
1125,
13,
4706,
396,
448,
807,
6313,
294,
448,
807,
29937,
13,
13,
4706,
9995,
13,
4706,
396,
17250,
2133,
515,
529,
5813,
29958,
518,
29896,
5387,
13,
4706,
21762,
29918,
29894,
29918,
15669,
353,
15886,
29889,
657,
29918,
11918,
29898,
13,
3986,
1024,
2433,
3571,
29918,
29894,
742,
13,
3986,
8267,
11759,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
288,
1402,
13,
3986,
26688,
29922,
13264,
29889,
7411,
29941,
29906,
29892,
13,
3986,
2847,
3950,
29922,
13264,
29889,
21570,
29889,
29277,
29889,
29916,
18852,
29918,
11228,
3950,
3101,
13,
4706,
21762,
29918,
29874,
29918,
15669,
353,
15886,
29889,
657,
29918,
11918,
29898,
13,
3986,
1024,
2433,
3571,
29918,
29874,
742,
13,
3986,
8267,
11759,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
288,
1402,
13,
3986,
26688,
29922,
13264,
29889,
7411,
29941,
29906,
29892,
13,
3986,
2847,
3950,
29922,
13264,
29889,
21570,
29889,
29277,
29889,
29916,
18852,
29918,
11228,
3950,
3101,
13,
13,
4706,
396,
16369,
29871,
29906,
29896,
29914,
29896,
29896,
29914,
29906,
29900,
29896,
29947,
29901,
13,
4706,
396,
29547,
304,
1284,
3659,
5034,
304,
379,
16929,
29915,
29879,
6589,
373,
4673,
1123,
1493,
13,
4706,
396,
2045,
597,
3150,
27828,
29889,
1212,
29914,
23343,
29973,
333,
29922,
29950,
29967,
29956,
29931,
29888,
29954,
9980,
29890,
29987,
6812,
1204,
29922,
29878,
29896,
29880,
29984,
29926,
5454,
1451,
29885,
13,
4706,
396,
379,
16929,
29901,
376,
4806,
1304,
21022,
630,
29918,
8945,
29918,
11228,
3950,
322,
731,
278,
3659,
577,
393,
472,
278,
13,
4706,
396,
1369,
310,
6694,
4203,
310,
278,
26091,
2540,
297,
1269,
7546,
526,
6136,
322,
4203,
13,
4706,
396,
297,
4925,
313,
1454,
278,
28267,
315,
2547,
1297,
7546,
988,
278,
26229,
338,
451,
15712,
13,
4706,
396,
1549,
21398,
591,
671,
1422,
3659,
363,
26229,
26851,
18177,
669,
13,
4706,
396,
363,
18593,
3443,
26851,
18177,
467,
29908,
13,
4706,
396,
13,
4706,
396,
3659,
21762,
29918,
29894,
2444,
304,
2761,
278,
9677,
310,
5039,
800,
13,
4706,
396,
1763,
1018,
322,
6176,
825,
379,
16929,
1497,
1048,
4203,
6136,
322,
4203,
451,
6136,
29892,
13,
4706,
396,
306,
1735,
278,
3659,
1819,
322,
1423,
278,
9825,
13342,
29914,
27691,
29879,
297,
13,
4706,
396,
323,
6073,
3377,
13,
4706,
396,
304,
1018,
322,
679,
263,
1781,
9677,
4822,
599,
1819,
29889,
306,
8496,
29915,
29873,
679,
445,
1985,
13,
4706,
396,
28138,
29889,
13,
4706,
21762,
29918,
29894,
29918,
15669,
353,
2243,
326,
29889,
4299,
29918,
11918,
29898,
13,
3986,
1024,
2433,
3571,
29918,
29894,
742,
13,
3986,
8267,
11759,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
288,
29892,
29871,
29896,
1402,
13,
3986,
26688,
29922,
13264,
29889,
7411,
29941,
29906,
29892,
13,
3986,
2847,
3950,
29922,
13264,
29889,
509,
4661,
630,
29918,
8945,
29918,
11228,
3950,
29898,
12676,
29922,
29900,
29889,
29900,
29892,
3659,
3359,
29922,
29896,
29900,
29889,
29900,
876,
13,
4706,
9995,
13,
4706,
288,
353,
1881,
29918,
12181,
29961,
29900,
1822,
294,
29918,
1761,
580,
14352,
29906,
29962,
29871,
396,
714,
26091,
13,
4706,
1583,
29889,
3571,
29918,
29874,
353,
1583,
29889,
1202,
29918,
7915,
29898,
978,
2433,
3571,
29918,
29874,
742,
13,
462,
462,
418,
8267,
11759,
29896,
29892,
29871,
29896,
29892,
288,
29892,
29871,
29896,
1402,
13,
462,
462,
418,
26688,
29922,
13264,
29889,
7411,
29941,
29906,
29892,
13,
462,
462,
418,
2847,
3950,
29922,
13264,
29889,
3946,
294,
29889,
11228,
19427,
29889,
2308,
4661,
630,
19077,
29898,
12676,
10457,
29896,
29900,
29900,
29900,
29889,
29900,
29892,
3659,
3359,
29922,
29945,
29900,
29900,
29889,
29900,
876,
13,
13,
4706,
396,
16369,
29871,
29900,
29946,
29914,
29896,
29900,
29914,
29906,
29900,
29896,
29947,
29901,
773,
2243,
326,
29889,
11918,
304,
1653,
2012,
310,
15886,
29889,
657,
29918,
11918,
577,
13,
4706,
396,
393,
896,
679,
5149,
7180,
373,
278,
10808,
2012,
310,
22796,
297,
278,
2473,
29899,
29887,
3746,
13,
4706,
396,
1873,
29889,
13,
4706,
396,
3118,
21762,
639,
1962,
26091,
1297,
1134,
13,
4706,
396,
313,
29940,
29892,
474,
29892,
288,
29892,
12301,
29897,
13,
4706,
1583,
29889,
3571,
29918,
29894,
353,
1583,
29889,
1202,
29918,
7915,
29898,
978,
2433,
3571,
29918,
29894,
742,
13,
462,
462,
418,
8267,
11759,
29896,
29892,
29871,
29896,
29892,
288,
29892,
29871,
29896,
1402,
13,
462,
462,
418,
26688,
29922,
13264,
29889,
7411,
29941,
29906,
29892,
13,
462,
462,
418,
2847,
3950,
29922,
13264,
29889,
3946,
294,
29889,
11228,
19427,
29889,
29954,
5095,
327,
19077,
3285,
13,
462,
462,
418,
4943,
3950,
29922,
8516,
29897,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
396,
18952,
313,
5824,
29892,
297,
29892,
714,
29892,
12301,
29897,
13,
4706,
396,
5039,
800,
313,
5824,
29892,
297,
29892,
29871,
29896,
29897,
13,
4706,
18952,
29918,
20620,
29892,
26229,
29918,
20620,
353,
10970,
13,
4706,
18593,
29892,
2070,
353,
953,
29918,
14608,
292,
29898,
29894,
4769,
29918,
20620,
29892,
13,
462,
18884,
26229,
29918,
20620,
29892,
13,
462,
18884,
1583,
29889,
3571,
29918,
29874,
29892,
13,
462,
18884,
1583,
29889,
3571,
29918,
29894,
29892,
13,
462,
18884,
1583,
29889,
1949,
29918,
14608,
292,
29892,
13,
462,
18884,
2186,
29918,
2892,
29922,
29900,
29889,
29900,
29896,
29892,
13,
462,
18884,
321,
3232,
29922,
29896,
29872,
29899,
29929,
29892,
13,
462,
18884,
18652,
29918,
14608,
292,
29918,
5344,
29922,
8999,
29896,
24960,
13,
4706,
2070,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
22795,
29892,
9685,
11759,
29899,
29896,
2314,
13,
4706,
736,
18593,
29892,
2070,
13,
13,
13,
1990,
3826,
6119,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
3171,
29892,
13,
462,
2920,
29892,
13,
462,
8242,
29892,
13,
462,
17346,
29918,
19790,
29892,
13,
462,
15359,
11759,
29945,
29896,
29906,
29892,
29871,
29896,
29900,
29906,
29946,
1402,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
6185,
6119,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
3545,
353,
3171,
13,
4706,
1583,
29889,
2103,
353,
2920,
13,
4706,
1583,
29889,
12719,
353,
8242,
13,
4706,
1583,
29889,
5521,
749,
29918,
19790,
353,
17346,
29918,
19790,
13,
4706,
1583,
29889,
29277,
353,
5159,
13,
4706,
363,
7546,
297,
15359,
29901,
13,
9651,
1583,
29889,
29277,
29889,
4397,
29898,
3946,
294,
29889,
29277,
29889,
29928,
1947,
29898,
13148,
29892,
15886,
29889,
15755,
29889,
2674,
29884,
876,
13,
4706,
1583,
29889,
29277,
29889,
4397,
29898,
3946,
294,
29889,
29277,
29889,
29928,
1947,
29898,
1311,
29889,
3545,
29930,
1311,
29889,
2103,
29930,
1311,
29889,
12719,
29892,
15886,
29889,
18816,
29885,
3398,
876,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
6136,
29918,
29883,
2547,
29892,
4558,
353,
10970,
13,
4706,
363,
7546,
297,
1583,
29889,
29277,
29901,
13,
9651,
6136,
29918,
29883,
2547,
353,
7546,
29898,
4925,
29918,
29883,
2547,
29897,
13,
4706,
337,
3200,
353,
6136,
29918,
29883,
2547,
13,
4706,
337,
3200,
29918,
2492,
353,
15886,
29889,
690,
14443,
29898,
276,
3200,
29892,
21069,
29896,
29892,
1583,
29889,
3545,
29892,
1583,
29889,
2103,
29892,
1583,
29889,
12719,
2314,
13,
4706,
5418,
353,
15886,
29889,
12248,
29898,
276,
3200,
29918,
2492,
448,
4558,
29892,
29871,
29906,
29897,
13,
4706,
6410,
353,
15886,
29889,
17469,
29918,
2083,
29898,
19244,
29892,
21069,
29896,
29892,
448,
29906,
29892,
448,
29941,
2314,
13,
4706,
337,
3200,
29918,
6758,
353,
1583,
29889,
5521,
749,
29918,
19790,
334,
15886,
29889,
17469,
29918,
12676,
29898,
6758,
29897,
13,
4706,
1583,
29889,
1202,
29918,
6758,
29898,
276,
3200,
29918,
6758,
29897,
13,
4706,
736,
337,
3200,
29918,
6758,
29892,
337,
3200,
29918,
2492,
13,
13,
13,
1990,
341,
1278,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1797,
29892,
13,
462,
6232,
29922,
5574,
29892,
13,
462,
714,
29918,
1949,
29922,
29896,
29900,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
19832,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
2098,
353,
1797,
13,
4706,
1583,
29889,
13653,
353,
6232,
13,
4706,
1583,
29889,
449,
29918,
1949,
353,
714,
29918,
1949,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
926,
267,
29892,
2070,
29879,
29892,
11073,
353,
10970,
13,
4706,
565,
7431,
29898,
21134,
29889,
657,
29918,
12181,
3101,
2804,
7431,
29898,
771,
5824,
29889,
657,
29918,
12181,
580,
1125,
13,
9651,
11073,
353,
15886,
29889,
650,
29918,
8711,
29898,
21134,
29892,
2070,
29879,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
14352,
29896,
2314,
13,
13,
4706,
822,
27262,
7295,
13,
9651,
565,
1583,
29889,
2098,
1405,
29871,
29900,
29901,
13,
18884,
17117,
2246,
29918,
29895,
353,
15886,
29889,
15755,
29889,
3332,
29918,
29895,
29898,
771,
5824,
29892,
1583,
29889,
2098,
718,
29871,
29896,
29897,
13,
18884,
6219,
353,
15886,
29889,
5451,
29898,
3332,
29918,
29895,
29892,
1583,
29889,
2098,
718,
29871,
29896,
29892,
448,
29896,
29897,
13,
18884,
6219,
353,
6219,
14352,
29896,
29962,
13,
18884,
27303,
353,
15886,
29889,
18837,
29918,
6229,
29879,
29898,
13264,
29889,
650,
29918,
8711,
29898,
13264,
29889,
29879,
802,
29872,
911,
29898,
5451,
29892,
448,
29896,
511,
1583,
29889,
449,
29918,
1949,
511,
448,
29896,
29897,
13,
9651,
1683,
29901,
13,
18884,
27303,
353,
15886,
29889,
18837,
29918,
6229,
29879,
29898,
13264,
29889,
650,
29918,
8711,
29898,
13264,
29889,
1191,
3317,
29898,
771,
5824,
29892,
448,
29896,
511,
1583,
29889,
449,
29918,
1949,
511,
448,
29896,
29897,
13,
9651,
736,
27303,
13,
13,
4706,
6694,
353,
13023,
294,
29889,
27852,
29889,
21891,
29918,
21646,
580,
13,
4706,
11105,
353,
15886,
29918,
13239,
29889,
3844,
442,
29918,
1116,
29898,
26495,
29892,
14013,
29901,
15886,
29889,
18837,
29918,
6229,
29879,
29898,
21134,
29892,
448,
29896,
511,
27262,
29897,
13,
4706,
11105,
287,
29918,
29883,
2547,
353,
15886,
29889,
18056,
368,
29898,
10590,
29892,
11105,
29897,
13,
4706,
565,
1583,
29889,
13653,
29901,
13,
9651,
6136,
29918,
29883,
2547,
353,
15886,
29889,
17469,
29918,
2083,
29898,
13168,
287,
29918,
29883,
2547,
29892,
9685,
10457,
29906,
29897,
13,
4706,
1683,
29901,
13,
9651,
6136,
29918,
29883,
2547,
353,
13023,
294,
29889,
29277,
29889,
29943,
5066,
841,
580,
29898,
13168,
287,
29918,
29883,
2547,
29897,
13,
4706,
736,
6136,
29918,
29883,
2547,
13,
13,
13,
1990,
3826,
6119,
1168,
29894,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
3171,
29892,
13,
462,
2920,
29892,
13,
462,
8242,
29892,
13,
462,
17346,
29918,
19790,
29892,
13,
462,
2967,
29922,
29896,
29900,
29892,
13,
462,
4175,
29922,
29953,
29946,
29892,
13,
462,
8466,
29918,
11228,
3950,
29922,
3946,
294,
29889,
11228,
19427,
29889,
354,
29918,
8945,
3285,
13,
462,
8466,
29918,
15227,
3950,
29922,
3946,
294,
29889,
15227,
19427,
29889,
29880,
29906,
29898,
29896,
29872,
29899,
29946,
511,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
6185,
6119,
1168,
29894,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
3545,
353,
3171,
13,
4706,
1583,
29889,
2103,
353,
2920,
13,
4706,
1583,
29889,
12719,
353,
8242,
13,
4706,
1583,
29889,
5521,
749,
29918,
19790,
353,
17346,
29918,
19790,
13,
4706,
1583,
29889,
29277,
353,
518,
3946,
294,
29889,
29277,
29889,
29928,
1947,
29898,
3188,
29930,
3188,
29930,
4572,
511,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
23145,
19077,
2133,
3285,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
3226,
557,
29891,
1123,
29931,
29965,
3285,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
1666,
14443,
3552,
3188,
29892,
2967,
29892,
4175,
8243,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
1168,
29894,
29906,
29928,
4300,
4220,
29898,
4572,
458,
29906,
29892,
313,
29945,
29892,
29871,
29945,
511,
851,
2247,
7607,
29896,
29892,
29871,
29896,
511,
7164,
2433,
17642,
742,
13,
462,
462,
462,
1678,
8466,
29918,
11228,
3950,
29922,
17460,
29918,
11228,
3950,
29892,
13,
462,
462,
462,
1678,
8466,
29918,
15227,
3950,
29922,
17460,
29918,
15227,
3950,
511,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
23145,
19077,
2133,
3285,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
3226,
557,
29891,
1123,
29931,
29965,
3285,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
1168,
29894,
29906,
29928,
4300,
4220,
29898,
4572,
458,
29946,
29892,
313,
29945,
29892,
29871,
29945,
511,
851,
2247,
7607,
29906,
29892,
29871,
29906,
511,
7164,
2433,
17642,
742,
13,
462,
462,
462,
1678,
8466,
29918,
11228,
3950,
29922,
17460,
29918,
11228,
3950,
29892,
13,
462,
462,
462,
1678,
8466,
29918,
15227,
3950,
29922,
17460,
29918,
15227,
3950,
511,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
23145,
19077,
2133,
3285,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
3226,
557,
29891,
1123,
29931,
29965,
3285,
13,
462,
539,
13023,
294,
29889,
29277,
29889,
1168,
29894,
29906,
29928,
4300,
4220,
29898,
29896,
29892,
313,
29945,
29892,
29871,
29945,
511,
851,
2247,
7607,
29906,
29892,
29871,
29906,
511,
7164,
2433,
17642,
742,
26229,
29922,
13264,
29889,
18816,
29885,
3398,
29892,
13,
462,
462,
462,
1678,
8466,
29918,
11228,
3950,
29922,
17460,
29918,
11228,
3950,
29892,
13,
462,
462,
462,
1678,
8466,
29918,
15227,
3950,
29922,
17460,
29918,
15227,
3950,
511,
13,
462,
539,
4514,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
6136,
29918,
29883,
2547,
29892,
4558,
353,
10970,
13,
4706,
363,
7546,
297,
1583,
29889,
29277,
29901,
13,
9651,
6136,
29918,
29883,
2547,
353,
7546,
29898,
4925,
29918,
29883,
2547,
29897,
13,
4706,
337,
3200,
29918,
2492,
353,
6136,
29918,
29883,
2547,
13,
4706,
5418,
353,
15886,
29889,
12248,
29898,
276,
3200,
29918,
2492,
448,
4558,
29892,
29871,
29906,
29897,
13,
4706,
6410,
353,
15886,
29889,
17469,
29918,
2083,
29898,
19244,
29892,
21069,
29896,
29892,
448,
29906,
29892,
448,
29941,
2314,
13,
4706,
337,
3200,
29918,
6758,
353,
1583,
29889,
5521,
749,
29918,
19790,
334,
15886,
29889,
17469,
29918,
12676,
29898,
6758,
29897,
13,
4706,
1583,
29889,
1202,
29918,
6758,
29898,
276,
3200,
29918,
6758,
29897,
13,
4706,
736,
337,
3200,
29918,
6758,
29892,
337,
3200,
29918,
2492,
13,
13,
13,
1990,
16510,
29940,
555,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
12877,
29940,
555,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
921,
353,
2888,
29918,
3554,
29889,
8111,
29918,
12324,
29898,
2080,
29879,
29892,
448,
29896,
29897,
13,
4706,
736,
921,
13,
13,
13,
1990,
9208,
29943,
3580,
1507,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
9685,
10457,
29906,
29892,
13,
462,
26229,
2433,
5753,
398,
5987,
742,
13,
462,
14653,
682,
29922,
8516,
29892,
13,
462,
13714,
29922,
8824,
29892,
13,
462,
6056,
29918,
4220,
29922,
5574,
29892,
13,
462,
1480,
29922,
8516,
29892,
13,
462,
4943,
675,
29922,
5574,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
8897,
29943,
3580,
1507,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
8990,
353,
9685,
13,
4706,
1583,
29889,
11236,
362,
353,
26229,
13,
4706,
1583,
29889,
845,
29878,
682,
353,
14653,
682,
13,
4706,
1583,
29889,
13844,
353,
13714,
13,
4706,
1583,
29889,
12324,
29918,
4220,
353,
6056,
29918,
4220,
13,
4706,
1583,
29889,
1188,
353,
1480,
13,
4706,
1583,
29889,
15227,
675,
353,
4943,
675,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
396,
518,
5824,
29892,
26091,
29918,
262,
29892,
26091,
29918,
449,
29892,
12301,
29962,
13,
4706,
14391,
29892,
13500,
353,
679,
29918,
19790,
2133,
29918,
29885,
496,
1475,
29898,
2080,
29879,
29892,
13,
462,
462,
462,
308,
1583,
29889,
8990,
29892,
13,
462,
462,
462,
308,
4943,
675,
29922,
1311,
29889,
15227,
675,
29897,
13,
4706,
565,
1583,
29889,
1188,
29901,
13,
9651,
565,
13500,
29901,
13,
18884,
1583,
29889,
1188,
29889,
1202,
29918,
29882,
391,
877,
5215,
749,
742,
13500,
29897,
13,
9651,
1583,
29889,
1188,
29889,
1202,
29918,
29882,
391,
877,
24826,
29918,
449,
742,
14391,
29897,
13,
9651,
1583,
29889,
1188,
29889,
1202,
29918,
29882,
391,
877,
24826,
29918,
29764,
537,
742,
15886,
29889,
17469,
29918,
2083,
29898,
4905,
29879,
29892,
9685,
10457,
29896,
876,
13,
4706,
565,
1583,
29889,
11236,
362,
1275,
525,
5753,
398,
5987,
2396,
13,
9651,
14391,
29892,
6056,
353,
2888,
29918,
3554,
29889,
5753,
398,
5987,
29898,
4905,
29879,
29892,
14653,
682,
29922,
1311,
29889,
845,
29878,
682,
29892,
13714,
29922,
1311,
29889,
13844,
29892,
6056,
29918,
4220,
29922,
1311,
29889,
12324,
29918,
4220,
29897,
13,
9651,
6056,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
12324,
29892,
448,
29896,
29897,
13,
9651,
736,
14391,
29892,
6056,
13,
4706,
25342,
1583,
29889,
11236,
362,
1275,
525,
26613,
1161,
2396,
13,
9651,
14391,
29892,
6056,
353,
2888,
29918,
3554,
29889,
26613,
1161,
29898,
4905,
29879,
29897,
13,
9651,
6056,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
12324,
29892,
448,
29896,
29897,
13,
9651,
736,
14391,
29892,
6056,
13,
4706,
25342,
1583,
29889,
11236,
362,
1275,
525,
12324,
2396,
13,
9651,
14391,
29892,
903,
353,
2888,
29918,
3554,
29889,
8111,
29918,
12324,
29898,
4905,
29879,
29897,
13,
9651,
736,
14391,
13,
4706,
1683,
29901,
13,
9651,
736,
14391,
13,
13,
13,
1990,
9208,
29909,
19698,
11426,
292,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
9685,
10457,
29906,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
8897,
29909,
19698,
11426,
292,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
8990,
353,
9685,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
14391,
353,
15886,
29889,
17469,
29918,
12676,
29898,
2080,
29879,
29892,
9685,
29922,
1311,
29889,
8990,
29897,
13,
4706,
736,
14391,
13,
13,
13,
1990,
9208,
7976,
11426,
292,
29898,
14420,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
9685,
10457,
29906,
29892,
13,
462,
3579,
19290,
1125,
13,
4706,
2428,
29898,
8897,
7976,
11426,
292,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
8990,
353,
9685,
13,
13,
1678,
822,
1246,
29898,
1311,
29892,
10970,
29892,
3579,
19290,
1125,
13,
4706,
14391,
353,
15886,
29889,
17469,
29918,
3317,
29898,
2080,
29879,
29892,
9685,
29922,
1311,
29889,
8990,
29897,
13,
4706,
736,
14391,
13,
13,
13,
1753,
679,
29918,
13492,
29918,
29883,
2547,
1297,
29918,
13148,
29898,
2080,
29879,
29892,
954,
29918,
449,
29892,
714,
29918,
8678,
29892,
954,
29918,
14608,
292,
29922,
29941,
29892,
6238,
29922,
29896,
29889,
29900,
1125,
13,
1678,
27615,
353,
315,
2547,
1297,
13372,
29928,
1947,
29898,
1949,
29918,
449,
29922,
1949,
29918,
449,
29892,
714,
29918,
8678,
29922,
449,
29918,
8678,
29892,
6232,
29918,
705,
5861,
29922,
8824,
5033,
2080,
29879,
29897,
13,
1678,
6745,
287,
353,
27747,
24254,
292,
29898,
1949,
29918,
14608,
292,
29922,
1949,
29918,
14608,
292,
29892,
6238,
29922,
12863,
5033,
9067,
287,
29897,
13,
1678,
736,
6745,
287,
13,
13,
13,
1753,
679,
29918,
19790,
2133,
29918,
29885,
496,
1475,
29898,
2080,
29879,
29892,
9685,
10457,
29906,
29892,
4943,
675,
29922,
5574,
1125,
13,
1678,
396,
518,
5824,
29892,
26091,
29918,
262,
29892,
26091,
29918,
449,
29892,
12301,
29962,
13,
1678,
565,
4943,
675,
29901,
13,
4706,
2117,
29918,
262,
353,
10970,
29889,
657,
29918,
12181,
580,
29961,
29896,
29962,
13,
4706,
10970,
847,
29922,
7442,
29889,
3676,
29898,
5030,
29918,
262,
29897,
13,
1678,
921,
29896,
353,
15886,
29889,
17469,
29918,
2083,
29898,
2080,
29879,
29892,
9685,
29892,
3013,
6229,
29879,
29922,
5574,
29897,
29871,
396,
518,
5824,
29892,
29871,
29896,
29892,
26091,
29918,
449,
29892,
12301,
29962,
13,
1678,
921,
29896,
353,
15886,
29889,
17619,
29898,
29916,
29896,
29897,
13,
1678,
921,
29906,
29918,
17619,
353,
15886,
29889,
17619,
29898,
2080,
29879,
29897,
13,
1678,
921,
29906,
353,
15886,
29889,
17469,
29918,
2083,
29898,
29916,
29906,
29918,
17619,
29892,
9685,
29892,
3013,
6229,
29879,
29922,
5574,
29897,
29871,
396,
518,
5824,
29892,
29871,
29896,
29892,
26091,
29918,
449,
29892,
12301,
29962,
13,
1678,
14391,
353,
921,
29896,
448,
921,
29906,
13,
1678,
14391,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
4905,
29879,
29892,
9685,
29897,
13,
1678,
7688,
353,
6213,
13,
1678,
736,
14391,
29892,
7688,
13,
13,
13,
1753,
679,
29918,
12483,
482,
29918,
10109,
292,
29898,
2080,
29879,
1125,
13,
1678,
921,
353,
15886,
29889,
17469,
29918,
12676,
29898,
2080,
29879,
29892,
9685,
10457,
29906,
29897,
13,
1678,
736,
13,
13,
13,
1753,
679,
29918,
19128,
29918,
16109,
29898,
2080,
29879,
1125,
13,
1678,
302,
353,
10970,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
14352,
29906,
29962,
13,
1678,
14391,
353,
29871,
29900,
13,
1678,
363,
474,
297,
3464,
29898,
29876,
1125,
13,
4706,
363,
432,
297,
3464,
29898,
29876,
1125,
13,
9651,
565,
474,
2804,
432,
29901,
13,
18884,
14391,
4619,
10970,
29961,
29875,
29962,
334,
10970,
29961,
29926,
29962,
13,
1678,
14391,
847,
29922,
313,
29906,
334,
302,
29897,
13,
1678,
736,
14391,
13,
13,
13,
1753,
9853,
29918,
29906,
29881,
29898,
2080,
29879,
29892,
8466,
29918,
2311,
29892,
851,
2247,
29892,
1024,
29922,
8516,
1125,
13,
1678,
565,
451,
338,
8758,
29898,
17460,
29918,
2311,
29892,
18761,
1125,
13,
4706,
8466,
29918,
2311,
353,
313,
17460,
29918,
2311,
29892,
8466,
29918,
2311,
29897,
13,
1678,
565,
451,
338,
8758,
29898,
710,
2247,
29892,
18761,
1125,
13,
4706,
851,
2247,
353,
313,
710,
2247,
29892,
851,
2247,
29897,
13,
1678,
1024,
353,
376,
16175,
29918,
517,
29918,
10109,
29908,
565,
1024,
338,
6213,
1683,
1024,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
29898,
978,
1125,
13,
4706,
3171,
29892,
2920,
353,
10970,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
29961,
29896,
29901,
29941,
29962,
13,
4706,
298,
29918,
2696,
7224,
353,
5519,
29898,
29882,
718,
413,
29897,
363,
413,
297,
3464,
29898,
29900,
29892,
8466,
29918,
2311,
29961,
29900,
2314,
29962,
363,
298,
297,
3464,
29898,
29900,
29892,
3171,
718,
29871,
29896,
448,
8466,
29918,
2311,
29961,
29900,
1402,
851,
2247,
29961,
29900,
2314,
29962,
13,
4706,
281,
29918,
2696,
7224,
353,
5519,
29898,
29893,
718,
413,
29897,
363,
413,
297,
3464,
29898,
29900,
29892,
8466,
29918,
2311,
29961,
29896,
2314,
29962,
363,
281,
297,
3464,
29898,
29900,
29892,
2920,
718,
29871,
29896,
448,
8466,
29918,
2311,
29961,
29896,
1402,
851,
2247,
29961,
29896,
2314,
29962,
13,
4706,
13261,
287,
353,
15886,
29889,
29887,
1624,
29898,
2080,
29879,
29892,
298,
29918,
2696,
7224,
29892,
9685,
29922,
29896,
29897,
13,
4706,
13261,
287,
353,
15886,
29889,
29887,
1624,
29898,
5041,
287,
29892,
281,
29918,
2696,
7224,
29892,
9685,
29922,
29941,
29897,
13,
4706,
3635,
353,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29945,
29962,
13,
4706,
13261,
287,
353,
15886,
29889,
3286,
4220,
29898,
5041,
287,
29892,
3635,
29922,
17858,
29897,
13,
4706,
8267,
353,
13261,
287,
29889,
657,
29918,
12181,
2141,
294,
29918,
1761,
580,
13,
4706,
8267,
353,
21069,
29896,
29962,
718,
8267,
29961,
29896,
29901,
29941,
29962,
718,
518,
9302,
29889,
10633,
29898,
12181,
29961,
29941,
13018,
29896,
11724,
8267,
14352,
29896,
5262,
13,
4706,
13261,
287,
353,
15886,
29889,
690,
14443,
29898,
5041,
287,
29892,
8267,
29922,
12181,
29897,
13,
1678,
736,
13261,
287,
13,
13,
13,
1753,
1243,
29918,
14608,
292,
29918,
10109,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29953,
29946,
29892,
29871,
29896,
29953,
29892,
29871,
29896,
29953,
29892,
29871,
29953,
29946,
2314,
13,
1678,
921,
353,
20829,
292,
11426,
292,
29898,
29941,
29892,
29871,
29906,
29892,
29871,
29947,
5033,
29916,
29897,
13,
1678,
1596,
29898,
29916,
29889,
12181,
29897,
13,
13,
13,
1753,
1243,
29918,
16175,
29918,
29906,
29881,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29906,
29947,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
2314,
13,
1678,
921,
353,
9853,
29918,
29906,
29881,
29898,
29916,
29892,
29871,
29906,
29892,
29871,
29906,
29897,
13,
1678,
1596,
29898,
29916,
29889,
12181,
29897,
13,
13,
13,
1753,
11539,
29918,
19790,
2133,
29918,
29885,
496,
1475,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29900,
29900,
29900,
29892,
29871,
29896,
29953,
2314,
13,
1678,
260,
29896,
353,
931,
29889,
2230,
580,
13,
1678,
714,
29896,
353,
679,
29918,
19128,
29918,
16109,
29898,
29916,
29897,
13,
1678,
260,
29906,
353,
931,
29889,
2230,
580,
13,
1678,
1596,
877,
19128,
15065,
3438,
29901,
742,
260,
29906,
448,
260,
29896,
29897,
13,
1678,
1596,
877,
19128,
15065,
1121,
29901,
742,
714,
29896,
29897,
13,
1678,
714,
29906,
353,
679,
29918,
19790,
2133,
29918,
29885,
496,
1475,
29898,
29916,
29897,
13,
1678,
260,
29941,
353,
931,
29889,
2230,
580,
13,
1678,
1596,
877,
22192,
3438,
29901,
742,
260,
29941,
448,
260,
29906,
29897,
13,
1678,
1596,
877,
22192,
1121,
29901,
742,
714,
29906,
29897,
13,
13,
13,
1753,
1243,
29918,
12478,
362,
29918,
24826,
7295,
13,
1678,
954,
353,
29871,
29896,
29900,
29900,
29900,
13,
1678,
12301,
353,
29871,
29896,
29953,
13,
1678,
263,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29900,
29900,
29900,
29900,
29892,
954,
29892,
12301,
1402,
29871,
29906,
29892,
29871,
29906,
29900,
29897,
13,
1678,
263,
353,
263,
847,
15886,
29889,
12324,
29898,
29874,
29892,
9685,
10457,
29896,
29892,
3013,
6229,
29879,
29922,
5574,
29897,
13,
1678,
263,
353,
263,
847,
15886,
29889,
3676,
29898,
13264,
29889,
4384,
29898,
1949,
29892,
15886,
29889,
7411,
29941,
29906,
876,
13,
1678,
289,
29896,
353,
15886,
29889,
17619,
29898,
13264,
29889,
17469,
29918,
2083,
29898,
29874,
29892,
29871,
29896,
876,
13,
1678,
396,
289,
29896,
29918,
12676,
29892,
289,
29896,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29890,
29896,
29892,
29871,
29900,
29897,
13,
1678,
396,
1596,
877,
29890,
29896,
29918,
12676,
29901,
742,
289,
29896,
29918,
12676,
29889,
23749,
3101,
13,
1678,
396,
1596,
877,
29890,
29896,
29918,
1707,
29901,
742,
289,
29896,
29918,
1707,
29889,
23749,
3101,
13,
1678,
289,
29906,
353,
15886,
29889,
17469,
29918,
2083,
29898,
13264,
29889,
17619,
29898,
29874,
511,
29871,
29896,
29897,
13,
1678,
396,
289,
29906,
29918,
12676,
29892,
289,
29906,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29890,
29906,
29892,
29871,
29900,
29897,
13,
1678,
396,
1596,
877,
29890,
29906,
29918,
12676,
29901,
742,
289,
29906,
29918,
12676,
29889,
23749,
3101,
13,
1678,
396,
1596,
877,
29890,
29906,
29918,
1707,
29901,
742,
289,
29906,
29918,
1707,
29889,
23749,
3101,
13,
1678,
285,
29885,
353,
289,
29896,
448,
289,
29906,
13,
1678,
289,
29941,
29918,
12676,
29892,
289,
29941,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
24826,
29892,
29871,
29900,
29897,
13,
1678,
1596,
877,
29890,
29941,
29918,
12676,
29901,
742,
289,
29941,
29918,
12676,
29889,
23749,
3101,
13,
1678,
1596,
877,
29890,
29941,
29918,
1707,
29901,
742,
289,
29941,
29918,
1707,
29889,
23749,
3101,
13,
1678,
1044,
353,
15886,
29889,
17469,
29918,
2083,
29898,
24826,
29892,
29871,
29896,
29897,
13,
1678,
1044,
29918,
12676,
29892,
1044,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
627,
29892,
29871,
29900,
29897,
13,
1678,
1596,
877,
627,
29918,
12676,
29901,
742,
1044,
29918,
12676,
29889,
23749,
3101,
13,
1678,
1596,
877,
627,
29918,
1707,
29901,
742,
1044,
29918,
1707,
29889,
23749,
3101,
13,
13,
13,
1753,
11539,
29918,
2003,
29918,
12324,
7295,
13,
1678,
9649,
29918,
12324,
353,
16510,
29940,
555,
580,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29953,
29946,
29892,
29871,
29896,
29953,
2314,
13,
1678,
921,
353,
9649,
29918,
12324,
29898,
29916,
29897,
13,
1678,
1596,
29898,
13264,
29889,
12324,
29898,
29916,
29892,
9685,
10457,
29896,
876,
13,
13,
13,
1753,
11539,
29918,
12483,
482,
29918,
10109,
292,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29900,
29892,
29871,
29947,
29892,
29871,
29947,
29892,
29871,
29953,
29946,
2314,
13,
1678,
921,
29896,
353,
13023,
294,
29889,
29277,
29889,
29909,
19698,
11426,
292,
29906,
29928,
4197,
29947,
29892,
29871,
29947,
2314,
29898,
29916,
29897,
13,
1678,
921,
29896,
353,
15886,
29889,
29879,
802,
29872,
911,
29898,
29916,
29896,
29897,
13,
1678,
921,
353,
15886,
29889,
690,
14443,
29898,
29916,
29892,
518,
29896,
29900,
29892,
29871,
29953,
29946,
29892,
29871,
29953,
29946,
2314,
13,
1678,
921,
29906,
353,
9208,
29909,
19698,
11426,
292,
580,
29898,
29916,
29897,
13,
1678,
1596,
29898,
13264,
29889,
17469,
29918,
2083,
29898,
29916,
29896,
29899,
29916,
29906,
876,
13,
13,
13,
1753,
11539,
29918,
29886,
374,
29918,
29883,
2547,
1297,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29900,
29892,
29871,
29947,
29892,
29871,
29947,
29892,
29871,
29953,
29946,
2314,
13,
1678,
921,
353,
315,
2547,
1297,
24020,
29898,
3545,
29922,
29947,
29892,
13,
462,
418,
2920,
29922,
29947,
29892,
13,
462,
418,
8242,
29922,
29953,
29946,
29892,
13,
462,
418,
28422,
29922,
29941,
29906,
29892,
13,
462,
418,
26229,
2433,
12324,
1495,
29898,
29916,
29897,
13,
1678,
1596,
29898,
13264,
29889,
12324,
29898,
29916,
29892,
9685,
10457,
29896,
876,
13,
13,
13,
1753,
11539,
29918,
16626,
29918,
14608,
292,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29900,
29892,
29871,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29896,
29892,
29871,
29941,
29906,
2314,
13,
1678,
343,
353,
27747,
24254,
292,
580,
29898,
29916,
29897,
13,
1678,
1596,
29898,
29891,
29897,
13,
13,
13,
1753,
11539,
29918,
24826,
29918,
10109,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29906,
29947,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29906,
29892,
29871,
29953,
29946,
2314,
13,
1678,
343,
353,
383,
3580,
1507,
292,
29898,
29941,
29892,
29871,
29906,
29892,
29871,
29947,
5033,
29916,
29897,
13,
1678,
1596,
29898,
29891,
29897,
13,
13,
13,
1753,
11539,
29918,
4230,
29918,
24826,
29918,
10109,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29906,
29947,
29892,
29871,
29896,
29896,
29945,
29906,
29892,
29871,
29896,
29953,
2314,
13,
1678,
921,
29918,
12676,
29892,
921,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29916,
29892,
518,
29900,
29892,
29896,
29892,
29906,
2314,
13,
1678,
343,
353,
9208,
29943,
3580,
1507,
29898,
11236,
362,
29922,
8516,
5033,
29916,
29897,
13,
1678,
343,
29918,
12676,
29892,
343,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29891,
29892,
518,
29900,
29892,
29896,
2314,
13,
1678,
1596,
29898,
29891,
29897,
13,
1678,
1596,
29898,
29891,
29918,
1707,
29897,
13,
13,
13,
1753,
11539,
29918,
9067,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
3552,
29896,
29906,
29947,
29892,
29871,
29941,
29900,
29892,
29871,
29947,
876,
13,
1678,
1301,
353,
315,
2547,
1297,
13372,
29928,
1947,
29898,
29896,
29900,
29892,
29871,
29896,
29953,
5033,
29916,
29897,
13,
1678,
1596,
29898,
3286,
29897,
13,
13,
13,
1753,
722,
29918,
735,
546,
7862,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29900,
29906,
29946,
29900,
29892,
29871,
29953,
29946,
2314,
13,
1678,
921,
29896,
29918,
12676,
29892,
921,
29896,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29916,
29892,
518,
29900,
29892,
29871,
29896,
2314,
13,
1678,
921,
29906,
29918,
12676,
29892,
921,
29906,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29916,
29930,
29916,
29892,
518,
29900,
29892,
29871,
29896,
2314,
13,
1678,
921,
29946,
29918,
12676,
353,
15886,
29889,
17469,
29918,
12676,
29898,
29916,
29930,
29916,
29930,
29916,
29930,
29916,
29897,
13,
1678,
1596,
877,
29916,
29896,
29918,
1707,
742,
921,
29896,
29918,
1707,
29897,
13,
1678,
1596,
877,
29916,
29906,
29918,
1707,
742,
921,
29906,
29918,
1707,
29897,
13,
1678,
1596,
877,
29916,
29946,
29918,
12676,
742,
921,
29946,
29918,
12676,
29897,
13,
1678,
343,
353,
679,
29918,
19790,
2133,
29918,
29885,
496,
1475,
29898,
29916,
29892,
29871,
29896,
29897,
13,
1678,
343,
29918,
12676,
29892,
343,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29891,
29892,
518,
29900,
2314,
13,
1678,
1596,
877,
29891,
29918,
12676,
742,
343,
29918,
12676,
29897,
13,
1678,
1596,
877,
29891,
29918,
1707,
742,
343,
29918,
1707,
29897,
13,
13,
13,
1753,
722,
29918,
2003,
29918,
12324,
29918,
7052,
7295,
13,
1678,
921,
353,
15886,
29889,
8172,
29889,
8945,
4197,
29896,
29906,
29947,
29900,
29900,
29892,
29871,
29896,
29953,
29900,
2314,
13,
1678,
921,
29918,
12324,
29892,
903,
353,
2888,
29918,
3554,
29889,
8111,
29918,
12324,
29918,
7052,
29898,
29916,
29892,
448,
29896,
29897,
13,
1678,
921,
29918,
12324,
29918,
27902,
353,
15886,
29889,
12324,
29898,
29916,
29918,
12324,
29892,
9685,
10457,
29896,
29897,
13,
1678,
343,
29918,
12676,
29892,
343,
29918,
1707,
353,
15886,
29889,
15755,
29889,
29885,
290,
1237,
29898,
29916,
29918,
12324,
29892,
518,
29900,
29892,
29871,
29896,
2314,
13,
1678,
1596,
877,
29923,
29901,
742,
29891,
29918,
12676,
29889,
23749,
3285,
525,
29928,
29901,
742,
343,
29918,
1707,
29889,
23749,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
396,
11539,
29918,
19790,
2133,
29918,
29885,
496,
1475,
580,
13,
1678,
396,
11539,
29918,
4230,
29918,
24826,
29918,
10109,
580,
13,
1678,
396,
722,
29918,
735,
546,
7862,
580,
13,
1678,
396,
11539,
29918,
16626,
29918,
14608,
292,
580,
13,
1678,
396,
11539,
29918,
9067,
580,
13,
1678,
396,
1243,
29918,
16175,
29918,
29906,
29881,
580,
13,
1678,
396,
1243,
29918,
14608,
292,
29918,
10109,
580,
13,
1678,
396,
11539,
29918,
24826,
29918,
10109,
580,
13,
1678,
722,
29918,
2003,
29918,
12324,
29918,
7052,
580,
13,
2
] |
apps/steam.py | nestorcalvo/Buencafe_dashboard | 0 | 23917 | import dash
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import pandas as pd
import plotly.express as px
import plotly.graph_objs as go
from datetime import date
import dash_loading_spinners as dls
from dash.dependencies import Input, Output, ClientsideFunction, State
from app import app
import requests
features = ["Screw Speed", "Gas Flow Rate", "Steam Pressure", "Oven-Home Temperature",
"Water Temperature", "Oxygen_pct", "Oven-Home Pressure", "Combustion Air Pressure",
"Temperature before prear", "Temperature after prear", "Burner Position", "Burner_pct",
"Borra Flow Rate_kgh", "Cisco Flow Rate_kgh"]
cardtab_1 = dbc.Card([
html.Div(
id='output-container-date-picker-range',
className="month-container"
),
dls.Hash(
dcc.Graph(id="graph-steam", className = "graph-card"),
size = 160,
speed_multiplier = 0.8,
debounce = 200
)
])
cardtab_2 = dbc.Card([
html.Div(
id='output-container-date-picker-range',
className="month-container"
),
dls.Hash(
dcc.Graph(id="graph-distribution", className = "graph-card"),
size = 160,
speed_multiplier = 0.8,
debounce = 200
)
])
card_3 = dbc.Card(
[
dbc.Col([
dbc.Col([
html.P(
"Select date range that you want to see:"
),
dcc.DatePickerRange(
id='my-date-picker-range',
min_date_allowed=date(2020, 10, 1),
max_date_allowed=date(2021, 6, 30),
initial_visible_month=date(2020, 10, 1),
end_date=date(2021, 6, 30),
clearable=True,
with_portal=True,
month_format="MMMM, YYYY",
number_of_months_shown=3
)
]),
html.Hr(),
dbc.Col([
html.P(
"Select the data frequency:"
),
dbc.RadioItems(
id='frequency-radioitems',
labelStyle={"display": "inline-block"},
options= [
{"label": "Daily", "value": "data_daily"},
{"label": "Hourly", "value": "data_hourly"}
], value= "data_daily",
style= {"color": "black"}
)
])
])
])
card_4 = dbc.Card([
dbc.Col([
dbc.FormGroup([
dbc.Label("Y - Axis"),
dcc.Dropdown(
id="y-variable",
options=[{
"label": col,
"value": col
} for col in features],
value="Gas Flow Rate",
),
]),
html.H6("Efficiency Range"),
dcc.RangeSlider(
id='slider-efficiency',
min=0,
max=1.00,
step=0.01,
value=[0, 1.00]
),
html.P(id='range-efficiency')
])
])
card_5 = dbc.Card([
html.Div(
id='output-container-date-picker-range',
className="month-container"
),
dls.Hash(
dcc.Graph(id="graph-comparison", className = "graph-card"),
size = 160,
speed_multiplier = 0.8,
debounce = 200
)
])
layout= [
html.Div([
# html.Img(
# src = "/assets/images/C1_icon_1.png",
# className = "corr-icon"
# ),
html.Img(
src = "/assets/images/Buencafe-logo.png",
className = "corr-icon"
),
html.H2(
"Steam Analytics",
className = "content-title"
),
html.Div(children=[
html.Div([
# dbc.Row([
# dbc.Col(
# dbc.Tabs([
# dbc.Tab(cardtab_1, label="Time series"),
# dbc.Tab(cardtab_2, label="Distribution"),
# ],
# id="card-tabs",
# card=True,
# active_tab="tab-1",
# ),
# width=9
# ),
# dbc.Col(
# card_3, width=3
# )
# ]),
dbc.Tabs([
dbc.Tab(cardtab_1, label="Time series"),
dbc.Tab(cardtab_2, label="Distribution"),
],
id="card-tabs",
card=True,
active_tab="tab-1",
),
card_3,
], className = "graph_col_1"),
html.Div(children =[
# dbc.Row([
# dbc.Col(
# card_4, width=3
# ),
# dbc.Col(
# card_5, width=9
# )
# ]),
card_4,
card_5
], className = "data_col_2")
], className = "wrapper__steam-data")
],className = "wrapper__steam"),
]
@app.callback(
Output('graph-steam','figure'),
[Input('my-date-picker-range', 'start_date'),
Input('my-date-picker-range', 'end_date'),
Input('frequency-radioitems', 'value')]
)
def update_figure(start_date, end_date, value_radio):
# if value_radio == "data_daily":
# data = pd.read_csv("data/data_interpolate_daily.csv", parse_dates=["Time"])
# data.set_index(["Time"], inplace=True)
# elif value_radio == "data_hourly":
# data = pd.read_csv("data/data_interpolate_hourly.csv", parse_dates=["Time"])
# data.set_index(["Time"], inplace=True)
try:
if value_radio == "data_daily":
query = "SELECT * FROM daily"
payload = {
"query": query
}
petition = requests.post('https://k8nmzco6tb.execute-api.us-east-1.amazonaws.com/dev/data',payload)
test_var = petition.json()['body']
data = pd.DataFrame(test_var)
data['Time'] = pd.to_datetime(data['Time']).dt.date.astype("datetime64[ns]")
# print("Llegada ", data2['Time'].value_counts())
data.set_index(["Time"], inplace=True)
elif value_radio == "data_hourly":
query = "SELECT * FROM hourly"
payload = {
"query": query
}
petition = requests.post('https://k8nmzco6tb.execute-api.us-east-1.amazonaws.com/dev/data',payload)
test_var = petition.json()['body']
data = pd.DataFrame(test_var)
data['Time'] = pd.to_datetime(data['Time'])
data.set_index(["Time"], inplace=True)
fig = go.Figure()
fig.add_trace(go.Scatter(
x = data.loc[start_date: end_date].index,
y = data.loc[start_date: end_date]["Steam Flow Rate"],
mode = "lines",
name = "Steam"
))
fig.update_layout(title = 'Steam Generation',
xaxis_title='Date',
yaxis_title='Steam (Kg/hour)',
transition_duration=500,
paper_bgcolor='rgba(0,0,0,0)',
plot_bgcolor='rgba(0,0,0,0)')
return fig
except:
fig = go.Figure()
fig.update_layout(title = 'Steam Generation',
xaxis_title='Date',
yaxis_title='Steam (Kg/hour)',
transition_duration=500,
paper_bgcolor='rgba(0,0,0,0)',
plot_bgcolor='rgba(0,0,0,0)')
return fig
@app.callback(
Output('graph-distribution','figure'),
[Input('my-date-picker-range', 'start_date'),
Input('my-date-picker-range', 'end_date')]
)
def update_figure2(start_date, end_date):
# df = pd.read_csv("data/data_interpolate_hourly.csv", parse_dates=["Time"])
# df.set_index(["Time"], inplace=True)
try:
query = "SELECT * FROM daily"
payload = {
"query": query
}
petition = requests.post('https://k8nmzco6tb.execute-api.us-east-1.amazonaws.com/dev/data',payload)
test_var = petition.json()['body']
df = pd.DataFrame(test_var)
df['Time'] = pd.to_datetime(df['Time']).dt.date.astype("datetime64[ns]")
# print("Llegada ", data2['Time'].value_counts())
df.set_index(["Time"], inplace=True)
# df = pd.read_csv("data/data_interpolate_hourly.csv", parse_dates=["Time"])
# df.set_index(["Time"], inplace=True)
fig = px.histogram(df.loc[start_date: end_date], x="Steam Flow Rate", nbins=100)
fig.update_layout(title = 'Steam Flow Rate Distribution',
xaxis_title='Steam (Kg/hour)',
yaxis_title='Count',
transition_duration=500,
paper_bgcolor='rgba(0,0,0,0)',
plot_bgcolor='rgba(0,0,0,0)')
return fig
except:
fig = px.histogram()
fig.update_layout(title = 'Steam Flow Rate Distribution',
xaxis_title='Steam (Kg/hour)',
yaxis_title='Count',
transition_duration=500,
paper_bgcolor='rgba(0,0,0,0)',
plot_bgcolor='rgba(0,0,0,0)')
return fig
@app.callback(
[Output("graph-comparison", "figure"),
Output("range-efficiency", "children")],
[Input("y-variable", "value"),
Input("slider-efficiency", "value"),]
)
def update_figure3(feature, efficiency):
# df2 = pd.read_csv("data/data_interpolate_hourly.csv", parse_dates=["Time"])
# df2.set_index(["Time"], inplace=True)
try:
query = "SELECT * FROM hourly"
payload = {
"query": query
}
petition = requests.post('https://k8nmzco6tb.execute-api.us-east-1.amazonaws.com/dev/data',payload)
test_var = petition.json()['body']
df2 = pd.DataFrame(test_var)
df2['Time'] = pd.to_datetime(df2['Time']).dt.date.astype("datetime64[ns]")
# print("Llegada ", data2['Time'].value_counts())
df2.set_index(["Time"], inplace=True)
fig = px.scatter(
x = df2[(df2['Efficiency'] < efficiency[1]) & (df2['Efficiency'] > efficiency[0])]["Steam Flow Rate"],
y = df2[(df2['Efficiency'] < efficiency[1]) & (df2['Efficiency'] > efficiency[0])][feature]
)
# fig.layout.plot_bgcolor = '#fff'
# fig.layout.paper_bgcolor = '#fff'
fig.update_layout(title = 'Steam Flow Rate Comparison',
xaxis_title= 'Steam (Kg/hour)',
yaxis_title= feature,
transition_duration= 500,
paper_bgcolor='rgba(0,0,0,0)',
plot_bgcolor='rgba(0,0,0,0)')
range_efficiency = str(efficiency[0]) + " - " + str(efficiency[1])
return fig, range_efficiency
except:
fig = px.scatter()
fig.update_layout(title = 'Steam Flow Rate Comparison',
xaxis_title= 'Steam (Kg/hour)',
yaxis_title= feature,
transition_duration= 500,
paper_bgcolor='rgba(0,0,0,0)',
plot_bgcolor='rgba(0,0,0,0)')
range_efficiency = str(efficiency[0]) + " - " + str(efficiency[1])
return fig, range_efficiency | [
1,
1053,
12569,
13,
5215,
12569,
29918,
3221,
29918,
14036,
408,
270,
617,
13,
5215,
12569,
29918,
8704,
29918,
14036,
408,
4833,
29883,
13,
5215,
12569,
29918,
1420,
29918,
14036,
408,
3472,
13,
5215,
11701,
408,
10518,
13,
5215,
6492,
368,
29889,
17073,
408,
282,
29916,
13,
5215,
6492,
368,
29889,
4262,
29918,
711,
1315,
408,
748,
13,
3166,
12865,
1053,
2635,
13,
5215,
12569,
29918,
13234,
29918,
1028,
16697,
408,
270,
3137,
13,
3166,
12569,
29889,
22594,
1053,
10567,
29892,
10604,
29892,
315,
492,
1237,
680,
6678,
29892,
4306,
13,
3166,
623,
1053,
623,
13,
5215,
7274,
13,
13,
22100,
353,
6796,
29903,
1037,
29893,
24839,
613,
376,
29954,
294,
22787,
390,
403,
613,
376,
7789,
314,
5254,
545,
613,
376,
29949,
854,
29899,
11184,
6789,
546,
1535,
613,
13,
9651,
376,
29956,
1008,
6789,
546,
1535,
613,
376,
29949,
28596,
29918,
29886,
312,
613,
376,
29949,
854,
29899,
11184,
5254,
545,
613,
376,
1523,
29890,
504,
291,
5593,
5254,
545,
613,
13,
9651,
376,
5776,
546,
1535,
1434,
758,
279,
613,
376,
5776,
546,
1535,
1156,
758,
279,
613,
376,
29933,
595,
261,
20627,
613,
376,
29933,
595,
261,
29918,
29886,
312,
613,
29871,
13,
9651,
376,
29933,
272,
336,
22787,
390,
403,
29918,
9415,
29882,
613,
376,
29907,
275,
1111,
22787,
390,
403,
29918,
9415,
29882,
3108,
13,
13,
7543,
3891,
29918,
29896,
353,
4833,
29883,
29889,
13200,
4197,
13,
4706,
3472,
29889,
12596,
29898,
13,
9651,
1178,
2433,
4905,
29899,
7611,
29899,
1256,
29899,
13908,
29899,
3881,
742,
13,
9651,
22030,
543,
10874,
29899,
7611,
29908,
13,
4706,
10353,
13,
4706,
270,
3137,
29889,
10438,
29898,
13,
9651,
270,
617,
29889,
9527,
29898,
333,
543,
4262,
29899,
1655,
314,
613,
22030,
353,
376,
4262,
29899,
7543,
4968,
13,
9651,
2159,
353,
29871,
29896,
29953,
29900,
29892,
13,
9651,
6210,
29918,
18056,
4926,
353,
29871,
29900,
29889,
29947,
29892,
13,
9651,
2553,
21543,
353,
29871,
29906,
29900,
29900,
13,
462,
1678,
1723,
13,
268,
2314,
13,
13,
7543,
3891,
29918,
29906,
353,
4833,
29883,
29889,
13200,
4197,
13,
4706,
3472,
29889,
12596,
29898,
13,
9651,
1178,
2433,
4905,
29899,
7611,
29899,
1256,
29899,
13908,
29899,
3881,
742,
13,
9651,
22030,
543,
10874,
29899,
7611,
29908,
13,
4706,
10353,
13,
4706,
270,
3137,
29889,
10438,
29898,
13,
9651,
270,
617,
29889,
9527,
29898,
333,
543,
4262,
29899,
27691,
613,
22030,
353,
376,
4262,
29899,
7543,
4968,
13,
9651,
2159,
353,
29871,
29896,
29953,
29900,
29892,
13,
9651,
6210,
29918,
18056,
4926,
353,
29871,
29900,
29889,
29947,
29892,
13,
9651,
2553,
21543,
353,
29871,
29906,
29900,
29900,
13,
9651,
1723,
13,
268,
2314,
13,
13,
7543,
29918,
29941,
353,
4833,
29883,
29889,
13200,
29898,
13,
1678,
518,
13,
4706,
4833,
29883,
29889,
1625,
4197,
13,
9651,
4833,
29883,
29889,
1625,
4197,
13,
18884,
3472,
29889,
29925,
29898,
13,
462,
1678,
376,
3549,
2635,
3464,
393,
366,
864,
304,
1074,
6160,
13,
18884,
10353,
13,
18884,
270,
617,
29889,
2539,
13954,
6069,
29898,
13,
462,
1678,
1178,
2433,
1357,
29899,
1256,
29899,
13908,
29899,
3881,
742,
13,
462,
1678,
1375,
29918,
1256,
29918,
24622,
29922,
1256,
29898,
29906,
29900,
29906,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
511,
13,
462,
1678,
4236,
29918,
1256,
29918,
24622,
29922,
1256,
29898,
29906,
29900,
29906,
29896,
29892,
29871,
29953,
29892,
29871,
29941,
29900,
511,
13,
462,
1678,
2847,
29918,
12872,
29918,
10874,
29922,
1256,
29898,
29906,
29900,
29906,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
511,
13,
462,
1678,
1095,
29918,
1256,
29922,
1256,
29898,
29906,
29900,
29906,
29896,
29892,
29871,
29953,
29892,
29871,
29941,
29900,
511,
13,
462,
1678,
2821,
519,
29922,
5574,
29892,
13,
462,
1678,
411,
29918,
25089,
29922,
5574,
29892,
13,
462,
1678,
4098,
29918,
4830,
543,
7428,
7428,
29892,
612,
14995,
29979,
613,
13,
462,
1678,
1353,
29918,
974,
29918,
10874,
29879,
29918,
845,
776,
29922,
29941,
13,
18884,
1723,
13,
9651,
4514,
511,
13,
9651,
3472,
29889,
29950,
29878,
3285,
13,
9651,
4833,
29883,
29889,
1625,
4197,
13,
18884,
3472,
29889,
29925,
29898,
13,
462,
1678,
376,
3549,
278,
848,
10868,
6160,
13,
18884,
10353,
13,
18884,
4833,
29883,
29889,
21818,
6913,
29898,
13,
462,
1678,
1178,
2433,
10745,
23860,
29899,
13399,
7076,
742,
13,
462,
1678,
3858,
5568,
3790,
29908,
4990,
1115,
376,
14764,
29899,
1271,
10758,
13,
462,
1678,
3987,
29922,
518,
13,
462,
4706,
8853,
1643,
1115,
376,
29928,
8683,
613,
376,
1767,
1115,
376,
1272,
29918,
29881,
8683,
10758,
13,
462,
4706,
8853,
1643,
1115,
376,
29950,
473,
368,
613,
376,
1767,
1115,
376,
1272,
29918,
18721,
368,
9092,
13,
462,
1678,
21251,
995,
29922,
376,
1272,
29918,
29881,
8683,
613,
13,
462,
1678,
3114,
29922,
8853,
2780,
1115,
376,
8517,
9092,
13,
18884,
1723,
13,
632,
2314,
13,
308,
2314,
13,
268,
2314,
13,
13,
7543,
29918,
29946,
353,
4833,
29883,
29889,
13200,
4197,
13,
4706,
4833,
29883,
29889,
1625,
4197,
13,
9651,
4833,
29883,
29889,
2500,
4782,
4197,
13,
18884,
4833,
29883,
29889,
4775,
703,
29979,
448,
319,
11497,
4968,
13,
18884,
270,
617,
29889,
15063,
3204,
29898,
13,
462,
1678,
1178,
543,
29891,
29899,
11918,
613,
13,
462,
1678,
3987,
11759,
29912,
13,
462,
4706,
376,
1643,
1115,
784,
29892,
13,
462,
4706,
376,
1767,
1115,
784,
13,
462,
1678,
500,
363,
784,
297,
5680,
1402,
13,
462,
1678,
995,
543,
29954,
294,
22787,
390,
403,
613,
13,
18884,
10353,
13,
9651,
4514,
511,
13,
9651,
3472,
29889,
29950,
29953,
703,
29923,
2416,
13396,
12146,
4968,
13,
9651,
270,
617,
29889,
6069,
16973,
1241,
29898,
13,
18884,
1178,
2433,
23165,
29899,
29872,
2416,
13396,
742,
13,
18884,
1375,
29922,
29900,
29892,
13,
18884,
4236,
29922,
29896,
29889,
29900,
29900,
29892,
13,
18884,
4331,
29922,
29900,
29889,
29900,
29896,
29892,
13,
18884,
995,
11759,
29900,
29892,
29871,
29896,
29889,
29900,
29900,
29962,
13,
9651,
10353,
13,
9651,
3472,
29889,
29925,
29898,
333,
2433,
3881,
29899,
29872,
2416,
13396,
1495,
13,
308,
2314,
13,
268,
2314,
13,
13,
7543,
29918,
29945,
353,
4833,
29883,
29889,
13200,
4197,
13,
4706,
3472,
29889,
12596,
29898,
13,
9651,
1178,
2433,
4905,
29899,
7611,
29899,
1256,
29899,
13908,
29899,
3881,
742,
13,
9651,
22030,
543,
10874,
29899,
7611,
29908,
13,
4706,
10353,
13,
4706,
270,
3137,
29889,
10438,
29898,
13,
9651,
270,
617,
29889,
9527,
29898,
333,
543,
4262,
29899,
510,
20941,
613,
22030,
353,
376,
4262,
29899,
7543,
4968,
13,
9651,
2159,
353,
29871,
29896,
29953,
29900,
29892,
13,
9651,
6210,
29918,
18056,
4926,
353,
29871,
29900,
29889,
29947,
29892,
13,
9651,
2553,
21543,
353,
29871,
29906,
29900,
29900,
13,
4706,
1723,
13,
268,
2314,
13,
13,
2680,
29922,
518,
13,
1678,
3472,
29889,
12596,
4197,
13,
4706,
396,
3472,
29889,
25518,
29898,
13,
4706,
396,
268,
4765,
353,
5591,
16596,
29914,
8346,
29914,
29907,
29896,
29918,
4144,
29918,
29896,
29889,
2732,
613,
13,
4706,
396,
268,
22030,
353,
376,
29725,
29899,
4144,
29908,
13,
4706,
396,
10353,
13,
4706,
3472,
29889,
25518,
29898,
13,
9651,
4765,
353,
5591,
16596,
29914,
8346,
29914,
3727,
264,
1113,
1725,
29899,
14569,
29889,
2732,
613,
13,
9651,
22030,
353,
376,
29725,
29899,
4144,
29908,
13,
4706,
10353,
13,
4706,
3472,
29889,
29950,
29906,
29898,
13,
9651,
376,
7789,
314,
11597,
22026,
613,
13,
9651,
22030,
353,
376,
3051,
29899,
3257,
29908,
13,
4706,
10353,
13,
4706,
3472,
29889,
12596,
29898,
11991,
11759,
13,
13,
9651,
3472,
29889,
12596,
4197,
13,
18884,
396,
4833,
29883,
29889,
4301,
4197,
13,
18884,
396,
268,
4833,
29883,
29889,
1625,
29898,
13,
18884,
396,
308,
4833,
29883,
29889,
29911,
6897,
4197,
13,
18884,
396,
632,
4833,
29883,
29889,
8863,
29898,
7543,
3891,
29918,
29896,
29892,
3858,
543,
2481,
3652,
4968,
13,
18884,
396,
632,
4833,
29883,
29889,
8863,
29898,
7543,
3891,
29918,
29906,
29892,
3858,
543,
13398,
3224,
4968,
13,
18884,
396,
632,
21251,
13,
18884,
396,
632,
1178,
543,
7543,
29899,
21175,
613,
13,
18884,
396,
632,
5881,
29922,
5574,
29892,
13,
18884,
396,
632,
6136,
29918,
3891,
543,
3891,
29899,
29896,
613,
13,
18884,
396,
308,
10353,
13,
18884,
396,
308,
2920,
29922,
29929,
13,
18884,
396,
268,
10353,
13,
18884,
396,
268,
4833,
29883,
29889,
1625,
29898,
13,
18884,
396,
308,
5881,
29918,
29941,
29892,
2920,
29922,
29941,
462,
259,
13,
18884,
396,
268,
1723,
13,
18884,
396,
4514,
511,
13,
18884,
4833,
29883,
29889,
29911,
6897,
4197,
13,
462,
1678,
4833,
29883,
29889,
8863,
29898,
7543,
3891,
29918,
29896,
29892,
3858,
543,
2481,
3652,
4968,
13,
462,
1678,
4833,
29883,
29889,
8863,
29898,
7543,
3891,
29918,
29906,
29892,
3858,
543,
13398,
3224,
4968,
13,
462,
1678,
21251,
13,
462,
1678,
1178,
543,
7543,
29899,
21175,
613,
13,
462,
1678,
5881,
29922,
5574,
29892,
13,
462,
1678,
6136,
29918,
3891,
543,
3891,
29899,
29896,
613,
13,
18884,
10353,
13,
18884,
5881,
29918,
29941,
29892,
13,
13,
9651,
21251,
22030,
353,
376,
4262,
29918,
1054,
29918,
29896,
4968,
13,
9651,
3472,
29889,
12596,
29898,
11991,
353,
29961,
13,
13,
18884,
396,
4833,
29883,
29889,
4301,
4197,
13,
18884,
396,
268,
4833,
29883,
29889,
1625,
29898,
13,
18884,
396,
308,
5881,
29918,
29946,
29892,
2920,
29922,
29941,
13,
18884,
396,
268,
10353,
13,
18884,
396,
268,
4833,
29883,
29889,
1625,
29898,
13,
18884,
396,
308,
5881,
29918,
29945,
29892,
2920,
29922,
29929,
13,
18884,
396,
268,
1723,
13,
18884,
396,
4514,
511,
13,
18884,
5881,
29918,
29946,
29892,
13,
18884,
5881,
29918,
29945,
13,
9651,
21251,
22030,
353,
376,
1272,
29918,
1054,
29918,
29906,
1159,
13,
4706,
21251,
22030,
353,
376,
17699,
1649,
1655,
314,
29899,
1272,
1159,
13,
13,
1678,
21251,
27542,
353,
376,
17699,
1649,
1655,
314,
4968,
13,
29962,
13,
13,
29992,
932,
29889,
14035,
29898,
13,
1678,
10604,
877,
4262,
29899,
1655,
314,
3788,
4532,
5477,
13,
1678,
518,
4290,
877,
1357,
29899,
1256,
29899,
13908,
29899,
3881,
742,
525,
2962,
29918,
1256,
5477,
13,
1678,
10567,
877,
1357,
29899,
1256,
29899,
13908,
29899,
3881,
742,
525,
355,
29918,
1256,
5477,
13,
1678,
10567,
877,
10745,
23860,
29899,
13399,
7076,
742,
525,
1767,
1495,
29962,
13,
29897,
13,
13,
1753,
2767,
29918,
4532,
29898,
2962,
29918,
1256,
29892,
1095,
29918,
1256,
29892,
995,
29918,
13399,
1125,
13,
1678,
396,
565,
995,
29918,
13399,
1275,
376,
1272,
29918,
29881,
8683,
1115,
13,
1678,
396,
268,
848,
353,
10518,
29889,
949,
29918,
7638,
703,
1272,
29914,
1272,
29918,
1639,
3733,
403,
29918,
29881,
8683,
29889,
7638,
613,
6088,
29918,
15190,
29922,
3366,
2481,
20068,
13,
1678,
396,
268,
848,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
1678,
396,
25342,
995,
29918,
13399,
1275,
376,
1272,
29918,
18721,
368,
1115,
13,
1678,
396,
268,
848,
353,
10518,
29889,
949,
29918,
7638,
703,
1272,
29914,
1272,
29918,
1639,
3733,
403,
29918,
18721,
368,
29889,
7638,
613,
6088,
29918,
15190,
29922,
3366,
2481,
20068,
13,
1678,
396,
268,
848,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
1678,
1018,
29901,
13,
13,
4706,
565,
995,
29918,
13399,
1275,
376,
1272,
29918,
29881,
8683,
1115,
13,
9651,
2346,
353,
376,
6404,
334,
3895,
14218,
29908,
13,
9651,
20092,
353,
426,
13,
18884,
376,
1972,
1115,
2346,
13,
9651,
500,
13,
9651,
5697,
654,
353,
7274,
29889,
2490,
877,
991,
597,
29895,
29947,
22882,
29920,
1111,
29953,
22625,
29889,
7978,
29899,
2754,
29889,
375,
29899,
23027,
29899,
29896,
29889,
17260,
10467,
29889,
510,
29914,
3359,
29914,
1272,
742,
23813,
29897,
13,
632,
13,
9651,
1243,
29918,
1707,
353,
5697,
654,
29889,
3126,
580,
1839,
2587,
2033,
13,
9651,
848,
353,
10518,
29889,
17271,
29898,
1688,
29918,
1707,
29897,
13,
9651,
848,
1839,
2481,
2033,
353,
10518,
29889,
517,
29918,
12673,
29898,
1272,
1839,
2481,
2033,
467,
6008,
29889,
1256,
29889,
579,
668,
703,
12673,
29953,
29946,
29961,
1983,
29962,
1159,
13,
9651,
396,
1596,
703,
29931,
1397,
1114,
9162,
848,
29906,
1839,
2481,
13359,
1767,
29918,
2798,
29879,
3101,
13,
9651,
848,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
4706,
25342,
995,
29918,
13399,
1275,
376,
1272,
29918,
18721,
368,
1115,
13,
9651,
2346,
353,
376,
6404,
334,
3895,
7234,
368,
29908,
13,
9651,
20092,
353,
426,
13,
18884,
376,
1972,
1115,
2346,
13,
9651,
500,
13,
9651,
5697,
654,
353,
7274,
29889,
2490,
877,
991,
597,
29895,
29947,
22882,
29920,
1111,
29953,
22625,
29889,
7978,
29899,
2754,
29889,
375,
29899,
23027,
29899,
29896,
29889,
17260,
10467,
29889,
510,
29914,
3359,
29914,
1272,
742,
23813,
29897,
13,
9651,
1243,
29918,
1707,
353,
5697,
654,
29889,
3126,
580,
1839,
2587,
2033,
13,
9651,
848,
353,
10518,
29889,
17271,
29898,
1688,
29918,
1707,
29897,
13,
9651,
848,
1839,
2481,
2033,
353,
10518,
29889,
517,
29918,
12673,
29898,
1272,
1839,
2481,
11287,
13,
9651,
848,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
13,
13,
4706,
2537,
353,
748,
29889,
13080,
545,
580,
13,
4706,
2537,
29889,
1202,
29918,
15003,
29898,
1484,
29889,
4421,
2620,
29898,
13,
9651,
921,
353,
848,
29889,
2029,
29961,
2962,
29918,
1256,
29901,
1095,
29918,
1256,
1822,
2248,
29892,
13,
9651,
343,
353,
848,
29889,
2029,
29961,
2962,
29918,
1256,
29901,
1095,
29918,
1256,
29962,
3366,
7789,
314,
22787,
390,
403,
12436,
13,
9651,
4464,
353,
376,
9012,
613,
13,
9651,
1024,
353,
376,
7789,
314,
29908,
13,
308,
876,
13,
4706,
2537,
29889,
5504,
29918,
2680,
29898,
3257,
353,
525,
7789,
314,
28203,
742,
13,
462,
4706,
921,
8990,
29918,
3257,
2433,
2539,
742,
13,
462,
4706,
343,
8990,
29918,
3257,
2433,
7789,
314,
313,
29968,
29887,
29914,
18721,
29897,
742,
13,
462,
4706,
9558,
29918,
19708,
29922,
29945,
29900,
29900,
29892,
13,
462,
4706,
5650,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
742,
13,
462,
4706,
6492,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
1495,
13,
4706,
736,
2537,
13,
1678,
5174,
29901,
13,
4706,
2537,
353,
748,
29889,
13080,
545,
580,
13,
4706,
2537,
29889,
5504,
29918,
2680,
29898,
3257,
353,
525,
7789,
314,
28203,
742,
13,
18884,
921,
8990,
29918,
3257,
2433,
2539,
742,
13,
18884,
343,
8990,
29918,
3257,
2433,
7789,
314,
313,
29968,
29887,
29914,
18721,
29897,
742,
13,
18884,
9558,
29918,
19708,
29922,
29945,
29900,
29900,
29892,
13,
18884,
5650,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
742,
13,
18884,
6492,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
1495,
13,
4706,
736,
2537,
13,
268,
13,
13,
29992,
932,
29889,
14035,
29898,
13,
1678,
10604,
877,
4262,
29899,
27691,
3788,
4532,
5477,
13,
1678,
518,
4290,
877,
1357,
29899,
1256,
29899,
13908,
29899,
3881,
742,
525,
2962,
29918,
1256,
5477,
13,
1678,
10567,
877,
1357,
29899,
1256,
29899,
13908,
29899,
3881,
742,
525,
355,
29918,
1256,
1495,
29962,
13,
29897,
13,
13,
1753,
2767,
29918,
4532,
29906,
29898,
2962,
29918,
1256,
29892,
1095,
29918,
1256,
1125,
13,
1678,
396,
4489,
353,
10518,
29889,
949,
29918,
7638,
703,
1272,
29914,
1272,
29918,
1639,
3733,
403,
29918,
18721,
368,
29889,
7638,
613,
6088,
29918,
15190,
29922,
3366,
2481,
20068,
13,
1678,
396,
4489,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
1678,
1018,
29901,
13,
4706,
2346,
353,
376,
6404,
334,
3895,
14218,
29908,
13,
4706,
20092,
353,
426,
13,
9651,
376,
1972,
1115,
2346,
13,
4706,
500,
13,
4706,
5697,
654,
353,
7274,
29889,
2490,
877,
991,
597,
29895,
29947,
22882,
29920,
1111,
29953,
22625,
29889,
7978,
29899,
2754,
29889,
375,
29899,
23027,
29899,
29896,
29889,
17260,
10467,
29889,
510,
29914,
3359,
29914,
1272,
742,
23813,
29897,
13,
4706,
1243,
29918,
1707,
353,
5697,
654,
29889,
3126,
580,
1839,
2587,
2033,
13,
4706,
4489,
353,
10518,
29889,
17271,
29898,
1688,
29918,
1707,
29897,
13,
4706,
4489,
1839,
2481,
2033,
353,
10518,
29889,
517,
29918,
12673,
29898,
2176,
1839,
2481,
2033,
467,
6008,
29889,
1256,
29889,
579,
668,
703,
12673,
29953,
29946,
29961,
1983,
29962,
1159,
13,
4706,
396,
1596,
703,
29931,
1397,
1114,
9162,
848,
29906,
1839,
2481,
13359,
1767,
29918,
2798,
29879,
3101,
13,
4706,
4489,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
4706,
396,
4489,
353,
10518,
29889,
949,
29918,
7638,
703,
1272,
29914,
1272,
29918,
1639,
3733,
403,
29918,
18721,
368,
29889,
7638,
613,
6088,
29918,
15190,
29922,
3366,
2481,
20068,
13,
4706,
396,
4489,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
4706,
2537,
353,
282,
29916,
29889,
29882,
391,
13342,
29898,
2176,
29889,
2029,
29961,
2962,
29918,
1256,
29901,
1095,
29918,
1256,
1402,
921,
543,
7789,
314,
22787,
390,
403,
613,
302,
29890,
1144,
29922,
29896,
29900,
29900,
29897,
13,
4706,
2537,
29889,
5504,
29918,
2680,
29898,
3257,
353,
525,
7789,
314,
22787,
390,
403,
17740,
742,
13,
462,
4706,
921,
8990,
29918,
3257,
2433,
7789,
314,
313,
29968,
29887,
29914,
18721,
29897,
742,
13,
462,
4706,
343,
8990,
29918,
3257,
2433,
3981,
742,
13,
462,
4706,
9558,
29918,
19708,
29922,
29945,
29900,
29900,
29892,
13,
462,
4706,
5650,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
742,
13,
462,
4706,
6492,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
1495,
13,
4706,
736,
2537,
13,
1678,
5174,
29901,
13,
4706,
2537,
353,
282,
29916,
29889,
29882,
391,
13342,
580,
13,
4706,
2537,
29889,
5504,
29918,
2680,
29898,
3257,
353,
525,
7789,
314,
22787,
390,
403,
17740,
742,
13,
462,
4706,
921,
8990,
29918,
3257,
2433,
7789,
314,
313,
29968,
29887,
29914,
18721,
29897,
742,
13,
462,
4706,
343,
8990,
29918,
3257,
2433,
3981,
742,
13,
462,
4706,
9558,
29918,
19708,
29922,
29945,
29900,
29900,
29892,
13,
462,
4706,
5650,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
742,
13,
462,
4706,
6492,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
1495,
13,
4706,
736,
2537,
13,
13,
13,
29992,
932,
29889,
14035,
29898,
13,
1678,
518,
6466,
703,
4262,
29899,
510,
20941,
613,
376,
4532,
4968,
13,
1678,
10604,
703,
3881,
29899,
29872,
2416,
13396,
613,
376,
11991,
1159,
1402,
13,
1678,
518,
4290,
703,
29891,
29899,
11918,
613,
376,
1767,
4968,
13,
1678,
10567,
703,
23165,
29899,
29872,
2416,
13396,
613,
376,
1767,
4968,
29962,
13,
29897,
13,
13,
1753,
2767,
29918,
4532,
29941,
29898,
14394,
29892,
19201,
1125,
13,
1678,
396,
4489,
29906,
353,
10518,
29889,
949,
29918,
7638,
703,
1272,
29914,
1272,
29918,
1639,
3733,
403,
29918,
18721,
368,
29889,
7638,
613,
6088,
29918,
15190,
29922,
3366,
2481,
20068,
13,
1678,
396,
4489,
29906,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
1678,
1018,
29901,
13,
4706,
2346,
353,
376,
6404,
334,
3895,
7234,
368,
29908,
13,
4706,
20092,
353,
426,
13,
9651,
376,
1972,
1115,
2346,
13,
4706,
500,
13,
4706,
5697,
654,
353,
7274,
29889,
2490,
877,
991,
597,
29895,
29947,
22882,
29920,
1111,
29953,
22625,
29889,
7978,
29899,
2754,
29889,
375,
29899,
23027,
29899,
29896,
29889,
17260,
10467,
29889,
510,
29914,
3359,
29914,
1272,
742,
23813,
29897,
13,
4706,
1243,
29918,
1707,
353,
5697,
654,
29889,
3126,
580,
1839,
2587,
2033,
13,
4706,
4489,
29906,
353,
10518,
29889,
17271,
29898,
1688,
29918,
1707,
29897,
13,
4706,
4489,
29906,
1839,
2481,
2033,
353,
10518,
29889,
517,
29918,
12673,
29898,
2176,
29906,
1839,
2481,
2033,
467,
6008,
29889,
1256,
29889,
579,
668,
703,
12673,
29953,
29946,
29961,
1983,
29962,
1159,
13,
4706,
396,
1596,
703,
29931,
1397,
1114,
9162,
848,
29906,
1839,
2481,
13359,
1767,
29918,
2798,
29879,
3101,
13,
4706,
4489,
29906,
29889,
842,
29918,
2248,
29898,
3366,
2481,
12436,
297,
6689,
29922,
5574,
29897,
13,
4706,
2537,
353,
282,
29916,
29889,
1557,
2620,
29898,
13,
9651,
921,
353,
4489,
29906,
15625,
2176,
29906,
1839,
29923,
2416,
13396,
2033,
529,
19201,
29961,
29896,
2314,
669,
313,
2176,
29906,
1839,
29923,
2416,
13396,
2033,
1405,
19201,
29961,
29900,
2314,
29962,
3366,
7789,
314,
22787,
390,
403,
12436,
13,
9651,
343,
353,
4489,
29906,
15625,
2176,
29906,
1839,
29923,
2416,
13396,
2033,
529,
19201,
29961,
29896,
2314,
669,
313,
2176,
29906,
1839,
29923,
2416,
13396,
2033,
1405,
19201,
29961,
29900,
2314,
3816,
14394,
29962,
13,
4706,
1723,
13,
4706,
396,
2537,
29889,
2680,
29889,
5317,
29918,
16264,
2780,
353,
16321,
18725,
29915,
13,
4706,
396,
2537,
29889,
2680,
29889,
19773,
29918,
16264,
2780,
353,
16321,
18725,
29915,
13,
4706,
2537,
29889,
5504,
29918,
2680,
29898,
3257,
353,
525,
7789,
314,
22787,
390,
403,
422,
20941,
742,
13,
462,
4706,
921,
8990,
29918,
3257,
29922,
525,
7789,
314,
313,
29968,
29887,
29914,
18721,
29897,
742,
13,
462,
4706,
343,
8990,
29918,
3257,
29922,
4682,
29892,
13,
462,
4706,
9558,
29918,
19708,
29922,
29871,
29945,
29900,
29900,
29892,
13,
462,
4706,
5650,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
742,
13,
462,
4706,
6492,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
1495,
13,
308,
13,
4706,
3464,
29918,
29872,
2416,
13396,
353,
851,
29898,
29872,
2416,
13396,
29961,
29900,
2314,
718,
376,
448,
376,
718,
851,
29898,
29872,
2416,
13396,
29961,
29896,
2314,
13,
4706,
736,
2537,
29892,
3464,
29918,
29872,
2416,
13396,
13,
1678,
5174,
29901,
13,
4706,
2537,
353,
282,
29916,
29889,
1557,
2620,
580,
13,
4706,
2537,
29889,
5504,
29918,
2680,
29898,
3257,
353,
525,
7789,
314,
22787,
390,
403,
422,
20941,
742,
13,
18884,
921,
8990,
29918,
3257,
29922,
525,
7789,
314,
313,
29968,
29887,
29914,
18721,
29897,
742,
13,
18884,
343,
8990,
29918,
3257,
29922,
4682,
29892,
13,
18884,
9558,
29918,
19708,
29922,
29871,
29945,
29900,
29900,
29892,
13,
18884,
5650,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
742,
13,
18884,
6492,
29918,
16264,
2780,
2433,
11007,
2291,
29898,
29900,
29892,
29900,
29892,
29900,
29892,
29900,
29897,
1495,
13,
308,
13,
4706,
3464,
29918,
29872,
2416,
13396,
353,
851,
29898,
29872,
2416,
13396,
29961,
29900,
2314,
718,
376,
448,
376,
718,
851,
29898,
29872,
2416,
13396,
29961,
29896,
2314,
13,
4706,
736,
2537,
29892,
3464,
29918,
29872,
2416,
13396,
2
] |
interface.py | chuong/robot-arm-manipulation | 0 | 59532 |
"""
the camera robot, position position must be fixed
in process of calculating transformation, the paper position must be fixed
the final y position must be same as the proginal y position
@author: yuboya
"""
import time
import sys
from DobotSerialInterface import DobotSerialInterface
dobot_interface = DobotSerialInterface()
print "Opened connection"
dobot_interface.set_speed()
dobot_interface.set_playback_config()
i=0
sleep_duration = 5 #3
first_round = False
time.sleep(2) # wait for robot initialization
while True:
print 1 # point 1
dobot_interface.send_absolute_position(220, 210, 20, 20, 3) # JUMP
print 2 # point 2
dobot_interface.send_absolute_position(130, 230, 20, -3, 2)
print 2 # point 2
#dobot_interface.send_absolute_position(210, -180, 50, 0) # JUMP
dobot_interface.send_absolute_position(130, 230, 20, -3, 3) # JUMP
print 1 # point 1
dobot_interface.send_absolute_position(220, 210, 20, -3, 2) # JUMP
i = i+1
print ('i='),i
# 5 cycles
if i==5:
print ('Last Round: Move to initial position!')
dobot_interface.send_absolute_position(265, 0, 25, 0, 3) # JUMP
time.sleep(sleep_duration)
sys.exit(0)
| [
1,
29871,
13,
13,
15945,
29908,
13,
1552,
10656,
19964,
29892,
2602,
2602,
1818,
367,
4343,
13,
262,
1889,
310,
25202,
13852,
29892,
278,
5650,
2602,
1818,
367,
4343,
29871,
13,
1552,
2186,
343,
2602,
1818,
367,
1021,
408,
278,
410,
29887,
979,
343,
2602,
13,
13,
29992,
8921,
29901,
343,
431,
29877,
3761,
13,
15945,
29908,
13,
13,
5215,
931,
13,
5215,
10876,
13,
3166,
21451,
327,
9125,
10448,
1053,
21451,
327,
9125,
10448,
13,
13,
11152,
327,
29918,
13248,
353,
21451,
327,
9125,
10448,
580,
13,
13,
2158,
376,
6585,
287,
3957,
29908,
13,
11152,
327,
29918,
13248,
29889,
842,
29918,
19322,
580,
13,
11152,
327,
29918,
13248,
29889,
842,
29918,
1456,
1627,
29918,
2917,
580,
13,
13,
29875,
29922,
29900,
13,
17059,
29918,
19708,
353,
29871,
29945,
396,
29941,
13,
13,
4102,
29918,
14486,
353,
7700,
13,
2230,
29889,
17059,
29898,
29906,
29897,
396,
4480,
363,
19964,
17865,
13,
13,
8000,
5852,
29901,
13,
13,
13,
1678,
1596,
29871,
29896,
396,
1298,
29871,
29896,
13,
1678,
437,
7451,
29918,
13248,
29889,
6717,
29918,
23552,
29918,
3283,
29898,
29906,
29906,
29900,
29892,
29871,
29906,
29896,
29900,
29892,
29871,
29906,
29900,
29892,
29871,
29906,
29900,
29892,
29871,
29941,
29897,
29871,
396,
435,
29965,
3580,
13,
268,
13,
1678,
1596,
29871,
29906,
396,
1298,
29871,
29906,
13,
1678,
437,
7451,
29918,
13248,
29889,
6717,
29918,
23552,
29918,
3283,
29898,
29896,
29941,
29900,
29892,
29871,
29906,
29941,
29900,
29892,
29871,
29906,
29900,
29892,
448,
29941,
29892,
29871,
29906,
29897,
13,
13,
1678,
1596,
29871,
29906,
396,
1298,
29871,
29906,
13,
1678,
396,
11152,
327,
29918,
13248,
29889,
6717,
29918,
23552,
29918,
3283,
29898,
29906,
29896,
29900,
29892,
448,
29896,
29947,
29900,
29892,
29871,
29945,
29900,
29892,
29871,
29900,
29897,
29871,
396,
435,
29965,
3580,
13,
1678,
437,
7451,
29918,
13248,
29889,
6717,
29918,
23552,
29918,
3283,
29898,
29896,
29941,
29900,
29892,
29871,
29906,
29941,
29900,
29892,
29871,
29906,
29900,
29892,
448,
29941,
29892,
29871,
29941,
29897,
29871,
396,
435,
29965,
3580,
13,
268,
13,
1678,
1596,
29871,
29896,
396,
1298,
29871,
29896,
13,
1678,
437,
7451,
29918,
13248,
29889,
6717,
29918,
23552,
29918,
3283,
29898,
29906,
29906,
29900,
29892,
29871,
29906,
29896,
29900,
29892,
29871,
29906,
29900,
29892,
448,
29941,
29892,
29871,
29906,
29897,
29871,
396,
435,
29965,
3580,
13,
13,
1678,
474,
353,
474,
29974,
29896,
13,
1678,
1596,
6702,
29875,
2433,
511,
29875,
13,
268,
13,
1678,
396,
29871,
29945,
25785,
13,
1678,
565,
474,
1360,
29945,
29901,
13,
4706,
1596,
6702,
8897,
21595,
29901,
25249,
304,
2847,
2602,
29991,
1495,
13,
4706,
437,
7451,
29918,
13248,
29889,
6717,
29918,
23552,
29918,
3283,
29898,
29906,
29953,
29945,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29892,
29871,
29900,
29892,
29871,
29941,
29897,
29871,
396,
435,
29965,
3580,
13,
4706,
931,
29889,
17059,
29898,
17059,
29918,
19708,
29897,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
13,
308,
13,
13,
2
] |
hon/preprocessors/variables.py | swquinn/hon | 0 | 57975 | import re
from collections import namedtuple
from hon.utils.numberutils import to_int_ns
from .preprocessor import Preprocessor
class VariablesPreprocessor(Preprocessor):
"""The variable preprocessor.
The variable preprocessor takes the variables defined in the book's
configuration file, i.e. ``book.yaml``, and adds them to the context.
"""
_name = 'variables'
def on_run(self, book, renderer, context):
"""
"""
variables = book.config.get('variables', {})
context.data['book'].update(variables)
| [
1,
1053,
337,
13,
3166,
16250,
1053,
4257,
23583,
13,
3166,
4207,
29889,
13239,
29889,
4537,
13239,
1053,
304,
29918,
524,
29918,
1983,
13,
3166,
869,
1457,
26482,
1053,
4721,
26482,
13,
13,
13,
1990,
9586,
1849,
6572,
26482,
29898,
6572,
26482,
1125,
13,
1678,
9995,
1576,
2286,
758,
26482,
29889,
13,
13,
1678,
450,
2286,
758,
26482,
4893,
278,
3651,
3342,
297,
278,
3143,
29915,
29879,
13,
1678,
5285,
934,
29892,
474,
29889,
29872,
29889,
4954,
2909,
29889,
25162,
29952,
1673,
322,
12778,
963,
304,
278,
3030,
29889,
13,
1678,
9995,
13,
1678,
903,
978,
353,
525,
20897,
29915,
13,
13,
1678,
822,
373,
29918,
3389,
29898,
1311,
29892,
3143,
29892,
4050,
261,
29892,
3030,
1125,
13,
4706,
9995,
13,
4706,
9995,
13,
4706,
3651,
353,
3143,
29889,
2917,
29889,
657,
877,
20897,
742,
426,
1800,
13,
4706,
3030,
29889,
1272,
1839,
2909,
13359,
5504,
29898,
20897,
29897,
13,
2
] |
App/migrations/0010_remove_user_percentage_preferences_user_preferences.py | dlanghorne0428/StudioMusicPlayer | 0 | 6349 | <filename>App/migrations/0010_remove_user_percentage_preferences_user_preferences.py
# Generated by Django 4.0 on 2022-03-03 02:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('App', '0009_alter_song_holiday_alter_songfileinput_holiday'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='percentage_preferences',
),
migrations.AddField(
model_name='user',
name='preferences',
field=models.JSONField(null=True),
),
]
| [
1,
529,
9507,
29958,
2052,
29914,
26983,
800,
29914,
29900,
29900,
29896,
29900,
29918,
5992,
29918,
1792,
29918,
25376,
482,
29918,
1457,
10662,
29918,
1792,
29918,
1457,
10662,
29889,
2272,
13,
29937,
3251,
630,
491,
15337,
29871,
29946,
29889,
29900,
373,
29871,
29906,
29900,
29906,
29906,
29899,
29900,
29941,
29899,
29900,
29941,
29871,
29900,
29906,
29901,
29896,
29945,
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,
2052,
742,
525,
29900,
29900,
29900,
29929,
29918,
13794,
29918,
21453,
29918,
5391,
22394,
29918,
13794,
29918,
21453,
1445,
2080,
29918,
5391,
22394,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
15941,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1792,
742,
13,
9651,
1024,
2433,
25376,
482,
29918,
1457,
10662,
742,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1792,
742,
13,
9651,
1024,
2433,
1457,
10662,
742,
13,
9651,
1746,
29922,
9794,
29889,
7249,
3073,
29898,
4304,
29922,
5574,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
src/gt4sd/training_pipelines/paccmann/core.py | hhhsu0825/gt4sd-core | 0 | 101175 | <gh_stars>0
"""PaccMann training utilities."""
from dataclasses import dataclass, field
from typing import Any, Dict
from ..core import TrainingPipeline, TrainingPipelineArguments
class PaccMannTrainingPipeline(TrainingPipeline):
"""PyTorch lightining training pipelines."""
def train( # type: ignore
self,
training_args: Dict[str, Any],
model_args: Dict[str, Any],
dataset_args: Dict[str, Any],
) -> None:
"""Generic training function for PaccMann training.
Args:
training_args: training arguments passed to the configuration.
model_args: model arguments passed to the configuration.
dataset_args: dataset arguments passed to the configuration.
Raises:
NotImplementedError: the generic trainer does not implement the pipeline.
"""
raise NotImplementedError
@dataclass
class PaccMannTrainingArguments(TrainingPipelineArguments):
"""Arguments related to PaccMann trainer."""
__name__ = "training_args"
model_path: str = field(
metadata={"help": "Path where the model artifacts are stored."}
)
training_name: str = field(metadata={"help": "Name used to identify the training."})
epochs: int = field(default=50, metadata={"help": "Number of epochs."})
batch_size: int = field(default=256, metadata={"help": "Size of the batch."})
learning_rate: float = field(
default=0.0005, metadata={"help": "Learning rate used in training."}
)
optimizer: str = field(
default="adam", metadata={"help": "Optimizer used during training."}
)
log_interval: int = field(
default=100, metadata={"help": "Number of steps between log intervals."}
)
save_interval: int = field(
default=1000, metadata={"help": "Number of steps between model save intervals."}
)
eval_interval: int = field(
default=500, metadata={"help": "Number of steps between evaluation intervals."}
)
@dataclass
class PaccMannDataArguments(TrainingPipelineArguments):
"""Arguments related to PaccMann data loading."""
__name__ = "dataset_args"
train_smiles_filepath: str = field(
metadata={"help": "Training file containing SMILES in .smi format."}
)
test_smiles_filepath: str = field(
metadata={"help": "Testing file containing SMILES in .smi format."}
)
smiles_language_filepath: str = field(
default="none", metadata={"help": "Optional SMILES language file."}
)
add_start_stop_token: bool = field(
default=True, metadata={"help": "Whether start and stop token should be added."}
)
selfies: bool = field(
default=True, metadata={"help": "Whether SELFIES representations are used."}
)
num_workers: int = field(
default=0, metadata={"help": "Number of workers used in data loading."}
)
pin_memory: bool = field(
default=False, metadata={"help": "Whether memory in the data loader is pinned."}
)
augment_smiles: bool = field(
default=False, metadata={"help": "Whether SMILES augumentation is used."}
)
canonical: bool = field(
default=False, metadata={"help": "Whether SMILES canonicalization is used."}
)
kekulize: bool = field(
default=False, metadata={"help": "Whether SMILES kekulization is used."}
)
all_bonds_explicit: bool = field(
default=False, metadata={"help": "Whether all bonds are explicit."}
)
all_hs_explicit: bool = field(
default=False, metadata={"help": "Whether all hydrogens are explicit."}
)
remove_bonddir: bool = field(
default=False, metadata={"help": "Remove bond directionality."}
)
remove_chirality: bool = field(
default=False, metadata={"help": "Remove chirality."}
)
@dataclass
class PaccMannSavingArguments(TrainingPipelineArguments):
"""Saving arguments related to PaccMann trainer."""
__name__ = "saving_args"
model_path: str = field(
metadata={"help": "Path where the model artifacts are stored."}
)
training_name: str = field(metadata={"help": "Name used to identify the training."})
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
29925,
5753,
29924,
812,
6694,
3667,
1907,
1213,
15945,
13,
13,
3166,
848,
13203,
1053,
848,
1990,
29892,
1746,
13,
3166,
19229,
1053,
3139,
29892,
360,
919,
13,
13,
3166,
6317,
3221,
1053,
26101,
29925,
23828,
29892,
26101,
29925,
23828,
26915,
13,
13,
13,
1990,
349,
5753,
29924,
812,
5323,
2827,
29925,
23828,
29898,
5323,
2827,
29925,
23828,
1125,
13,
1678,
9995,
19737,
29911,
25350,
3578,
2827,
6694,
8450,
24210,
1213,
15945,
13,
13,
1678,
822,
7945,
29898,
29871,
396,
1134,
29901,
11455,
13,
4706,
1583,
29892,
13,
4706,
6694,
29918,
5085,
29901,
360,
919,
29961,
710,
29892,
3139,
1402,
13,
4706,
1904,
29918,
5085,
29901,
360,
919,
29961,
710,
29892,
3139,
1402,
13,
4706,
8783,
29918,
5085,
29901,
360,
919,
29961,
710,
29892,
3139,
1402,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
9995,
15809,
6694,
740,
363,
349,
5753,
29924,
812,
6694,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
6694,
29918,
5085,
29901,
6694,
6273,
4502,
304,
278,
5285,
29889,
13,
9651,
1904,
29918,
5085,
29901,
1904,
6273,
4502,
304,
278,
5285,
29889,
13,
9651,
8783,
29918,
5085,
29901,
8783,
6273,
4502,
304,
278,
5285,
29889,
13,
13,
4706,
390,
1759,
267,
29901,
13,
9651,
2216,
1888,
2037,
287,
2392,
29901,
278,
10035,
1020,
4983,
947,
451,
2334,
278,
16439,
29889,
13,
4706,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
349,
5753,
29924,
812,
5323,
2827,
26915,
29898,
5323,
2827,
29925,
23828,
26915,
1125,
13,
1678,
9995,
26915,
4475,
304,
349,
5753,
29924,
812,
1020,
4983,
1213,
15945,
13,
13,
1678,
4770,
978,
1649,
353,
376,
26495,
29918,
5085,
29908,
13,
13,
1678,
1904,
29918,
2084,
29901,
851,
353,
1746,
29898,
13,
4706,
15562,
3790,
29908,
8477,
1115,
376,
2605,
988,
278,
1904,
24238,
29879,
526,
6087,
1213,
29913,
13,
1678,
1723,
13,
1678,
6694,
29918,
978,
29901,
851,
353,
1746,
29898,
19635,
3790,
29908,
8477,
1115,
376,
1170,
1304,
304,
12439,
278,
6694,
1213,
1800,
13,
1678,
21502,
12168,
29901,
938,
353,
1746,
29898,
4381,
29922,
29945,
29900,
29892,
15562,
3790,
29908,
8477,
1115,
376,
4557,
310,
21502,
12168,
1213,
1800,
13,
1678,
9853,
29918,
2311,
29901,
938,
353,
1746,
29898,
4381,
29922,
29906,
29945,
29953,
29892,
15562,
3790,
29908,
8477,
1115,
376,
3505,
310,
278,
9853,
1213,
1800,
13,
1678,
6509,
29918,
10492,
29901,
5785,
353,
1746,
29898,
13,
4706,
2322,
29922,
29900,
29889,
29900,
29900,
29900,
29945,
29892,
15562,
3790,
29908,
8477,
1115,
376,
29931,
799,
1076,
6554,
1304,
297,
6694,
1213,
29913,
13,
1678,
1723,
13,
1678,
5994,
3950,
29901,
851,
353,
1746,
29898,
13,
4706,
2322,
543,
328,
314,
613,
15562,
3790,
29908,
8477,
1115,
376,
20624,
326,
3950,
1304,
2645,
6694,
1213,
29913,
13,
1678,
1723,
13,
1678,
1480,
29918,
19207,
29901,
938,
353,
1746,
29898,
13,
4706,
2322,
29922,
29896,
29900,
29900,
29892,
15562,
3790,
29908,
8477,
1115,
376,
4557,
310,
6576,
1546,
1480,
18747,
1213,
29913,
13,
1678,
1723,
13,
1678,
4078,
29918,
19207,
29901,
938,
353,
1746,
29898,
13,
4706,
2322,
29922,
29896,
29900,
29900,
29900,
29892,
15562,
3790,
29908,
8477,
1115,
376,
4557,
310,
6576,
1546,
1904,
4078,
18747,
1213,
29913,
13,
1678,
1723,
13,
1678,
19745,
29918,
19207,
29901,
938,
353,
1746,
29898,
13,
4706,
2322,
29922,
29945,
29900,
29900,
29892,
15562,
3790,
29908,
8477,
1115,
376,
4557,
310,
6576,
1546,
17983,
18747,
1213,
29913,
13,
1678,
1723,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
349,
5753,
29924,
812,
1469,
26915,
29898,
5323,
2827,
29925,
23828,
26915,
1125,
13,
1678,
9995,
26915,
4475,
304,
349,
5753,
29924,
812,
848,
8363,
1213,
15945,
13,
13,
1678,
4770,
978,
1649,
353,
376,
24713,
29918,
5085,
29908,
13,
13,
1678,
7945,
29918,
3844,
5475,
29918,
1445,
2084,
29901,
851,
353,
1746,
29898,
13,
4706,
15562,
3790,
29908,
8477,
1115,
376,
5323,
2827,
934,
6943,
317,
10403,
17101,
297,
869,
29879,
2460,
3402,
1213,
29913,
13,
1678,
1723,
13,
1678,
1243,
29918,
3844,
5475,
29918,
1445,
2084,
29901,
851,
353,
1746,
29898,
13,
4706,
15562,
3790,
29908,
8477,
1115,
376,
3057,
292,
934,
6943,
317,
10403,
17101,
297,
869,
29879,
2460,
3402,
1213,
29913,
13,
1678,
1723,
13,
1678,
1560,
5475,
29918,
11675,
29918,
1445,
2084,
29901,
851,
353,
1746,
29898,
13,
4706,
2322,
543,
9290,
613,
15562,
3790,
29908,
8477,
1115,
376,
27636,
317,
10403,
17101,
4086,
934,
1213,
29913,
13,
1678,
1723,
13,
1678,
788,
29918,
2962,
29918,
9847,
29918,
6979,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
5574,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
1369,
322,
5040,
5993,
881,
367,
2715,
1213,
29913,
13,
1678,
1723,
13,
1678,
1583,
583,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
5574,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
3725,
29931,
3738,
2890,
22540,
526,
1304,
1213,
29913,
13,
1678,
1723,
13,
1678,
954,
29918,
1287,
414,
29901,
938,
353,
1746,
29898,
13,
4706,
2322,
29922,
29900,
29892,
15562,
3790,
29908,
8477,
1115,
376,
4557,
310,
17162,
1304,
297,
848,
8363,
1213,
29913,
13,
1678,
1723,
13,
1678,
12534,
29918,
14834,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
3370,
297,
278,
848,
23466,
338,
282,
27464,
1213,
29913,
13,
1678,
1723,
13,
1678,
18765,
29918,
3844,
5475,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
317,
10403,
17101,
11307,
942,
362,
338,
1304,
1213,
29913,
13,
1678,
1723,
13,
1678,
24420,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
317,
10403,
17101,
24420,
2133,
338,
1304,
1213,
29913,
13,
1678,
1723,
13,
1678,
413,
1416,
352,
675,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
317,
10403,
17101,
413,
1416,
352,
2133,
338,
1304,
1213,
29913,
13,
1678,
1723,
13,
1678,
599,
29918,
29890,
13788,
29918,
4548,
4019,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
599,
289,
13788,
526,
6261,
1213,
29913,
13,
1678,
1723,
13,
1678,
599,
29918,
9499,
29918,
4548,
4019,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
8809,
1979,
599,
27246,
9102,
575,
526,
6261,
1213,
29913,
13,
1678,
1723,
13,
1678,
3349,
29918,
29890,
898,
3972,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
15941,
21224,
5305,
2877,
1213,
29913,
13,
1678,
1723,
13,
1678,
3349,
29918,
305,
381,
2877,
29901,
6120,
353,
1746,
29898,
13,
4706,
2322,
29922,
8824,
29892,
15562,
3790,
29908,
8477,
1115,
376,
15941,
521,
381,
2877,
1213,
29913,
13,
1678,
1723,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
349,
5753,
29924,
812,
29903,
5555,
26915,
29898,
5323,
2827,
29925,
23828,
26915,
1125,
13,
1678,
9995,
29903,
5555,
6273,
4475,
304,
349,
5753,
29924,
812,
1020,
4983,
1213,
15945,
13,
13,
1678,
4770,
978,
1649,
353,
376,
29879,
5555,
29918,
5085,
29908,
13,
13,
1678,
1904,
29918,
2084,
29901,
851,
353,
1746,
29898,
13,
4706,
15562,
3790,
29908,
8477,
1115,
376,
2605,
988,
278,
1904,
24238,
29879,
526,
6087,
1213,
29913,
13,
1678,
1723,
13,
1678,
6694,
29918,
978,
29901,
851,
353,
1746,
29898,
19635,
3790,
29908,
8477,
1115,
376,
1170,
1304,
304,
12439,
278,
6694,
1213,
1800,
13,
2
] |
HospitalManagement/Landing/views.py | yonathanF/Hospital_Management | 0 | 184720 | <reponame>yonathanF/Hospital_Management
from django.http import HttpResponse
from django.shortcuts import render
def index(request):
''' renders the landing html page ... everything is in the html for this '''
return HttpResponse(render(request, 'Landing/index.html'))
| [
1,
529,
276,
1112,
420,
29958,
29891,
265,
11385,
29943,
29914,
29950,
8189,
29918,
27107,
13,
3166,
9557,
29889,
1124,
1053,
9056,
5103,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
13,
13,
1753,
2380,
29898,
3827,
1125,
13,
1678,
14550,
7697,
414,
278,
25325,
3472,
1813,
2023,
4129,
338,
297,
278,
3472,
363,
445,
14550,
13,
13,
1678,
736,
9056,
5103,
29898,
9482,
29898,
3827,
29892,
525,
22677,
292,
29914,
2248,
29889,
1420,
8785,
13,
2
] |
VTiger_KPI_Dashboard/cases/migrations/0001_initial.py | roovyshapiro/VTiger_Sales_Dashboard | 2 | 56267 | <filename>VTiger_KPI_Dashboard/cases/migrations/0001_initial.py
# Generated by Django 3.0.3 on 2020-12-14 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Cases',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('assigned_user_id', models.CharField(max_length=50)),
('case_no', models.CharField(max_length=50)),
('casestatus', models.CharField(max_length=50)),
('contact_id', models.CharField(max_length=50)),
('created_user_id', models.CharField(max_length=50)),
('createdtime', models.DateTimeField()),
('group_id', models.CharField(max_length=50)),
('case_id', models.CharField(max_length=50)),
('modifiedby', models.CharField(max_length=50)),
('modifiedtime', models.DateTimeField()),
('title', models.CharField(max_length=250)),
('time_spent', models.CharField(max_length=50)),
('time_spent_hr', models.CharField(max_length=75)),
('assigned_username', models.CharField(max_length=75)),
('assigned_groupname', models.CharField(max_length=75)),
('case_resolved', models.DateTimeField(null=True)),
('date_created', models.DateTimeField(auto_now_add=True)),
('date_modified', models.DateTimeField(auto_now=True)),
],
),
]
| [
1,
529,
9507,
29958,
29963,
29911,
4087,
29918,
29968,
2227,
29918,
29928,
1161,
3377,
29914,
11436,
29914,
26983,
800,
29914,
29900,
29900,
29900,
29896,
29918,
11228,
29889,
2272,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29900,
29889,
29941,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29896,
29906,
29899,
29896,
29946,
29871,
29906,
29900,
29901,
29941,
29945,
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,
2847,
353,
5852,
13,
13,
1678,
9962,
353,
518,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
29907,
2129,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
465,
12961,
29918,
1792,
29918,
333,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
4878,
29918,
1217,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
9398,
342,
2389,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
12346,
29918,
333,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
11600,
29918,
1792,
29918,
333,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
11600,
2230,
742,
4733,
29889,
11384,
3073,
25739,
13,
18884,
6702,
2972,
29918,
333,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
4878,
29918,
333,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
1545,
2164,
1609,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
1545,
2164,
2230,
742,
4733,
29889,
11384,
3073,
25739,
13,
18884,
6702,
3257,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29900,
8243,
13,
18884,
6702,
2230,
29918,
1028,
296,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29945,
29900,
8243,
13,
18884,
6702,
2230,
29918,
1028,
296,
29918,
1092,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29955,
29945,
8243,
13,
18884,
6702,
465,
12961,
29918,
6786,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29955,
29945,
8243,
13,
18884,
6702,
465,
12961,
29918,
2972,
978,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29955,
29945,
8243,
13,
18884,
6702,
4878,
29918,
9778,
1490,
742,
4733,
29889,
11384,
3073,
29898,
4304,
29922,
5574,
8243,
13,
18884,
6702,
1256,
29918,
11600,
742,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
8243,
13,
18884,
6702,
1256,
29918,
1545,
2164,
742,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
8243,
13,
9651,
21251,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
desafios/des003/des003_p03.py | brenoedl0/python | 0 | 22473 | nota1 = float(input('nota 1: '))
nota2 = float(input('nota 2: '))
media = (nota1 + nota2)/2
print('A media entre a nota 1 e a nota 2 é {}'.format(media))
| [
1,
451,
29874,
29896,
353,
5785,
29898,
2080,
877,
1333,
29874,
29871,
29896,
29901,
525,
876,
13,
1333,
29874,
29906,
353,
5785,
29898,
2080,
877,
1333,
29874,
29871,
29906,
29901,
525,
876,
13,
9799,
353,
313,
1333,
29874,
29896,
718,
451,
29874,
29906,
6802,
29906,
13,
2158,
877,
29909,
5745,
2637,
263,
451,
29874,
29871,
29896,
321,
263,
451,
29874,
29871,
29906,
904,
6571,
4286,
4830,
29898,
9799,
876,
13,
2
] |
venv/lib/python3.5/site-packages/igraph/test/atlas.py | dtklinh/Protein-Rigid-Domains-Estimation | 2 | 7640 | <reponame>dtklinh/Protein-Rigid-Domains-Estimation
import warnings
import unittest
from igraph import *
class TestBase(unittest.TestCase):
def testPageRank(self):
for idx, g in enumerate(self.__class__.graphs):
try:
pr = g.pagerank()
except Exception as ex:
self.assertTrue(False, msg="PageRank calculation threw exception for graph #%d: %s" % (idx, ex))
raise
if g.vcount() == 0:
self.assertEqual([], pr)
continue
self.assertAlmostEqual(1.0, sum(pr), places=5, \
msg="PageRank sum is not 1.0 for graph #%d (%r)" % (idx, pr))
self.assertTrue(min(pr) >= 0, \
msg="Minimum PageRank is less than 0 for graph #%d (%r)" % (idx, pr))
def testEigenvectorCentrality(self):
# Temporarily turn off the warning handler because g.evcent() will print
# a warning for DAGs
warnings.simplefilter("ignore")
try:
for idx, g in enumerate(self.__class__.graphs):
try:
ec, eval = g.evcent(return_eigenvalue=True)
except Exception as ex:
self.assertTrue(False, msg="Eigenvector centrality threw exception for graph #%d: %s" % (idx, ex))
raise
if g.vcount() == 0:
self.assertEqual([], ec)
continue
if not g.is_connected():
# Skip disconnected graphs; this will be fixed in igraph 0.7
continue
n = g.vcount()
if abs(eval) < 1e-4:
self.assertTrue(min(ec) >= -1e-10,
msg="Minimum eigenvector centrality is smaller than 0 for graph #%d" % idx)
self.assertTrue(max(ec) <= 1,
msg="Maximum eigenvector centrality is greater than 1 for graph #%d" % idx)
continue
self.assertAlmostEqual(max(ec), 1, places=7, \
msg="Maximum eigenvector centrality is %r (not 1) for graph #%d (%r)" % \
(max(ec), idx, ec))
self.assertTrue(min(ec) >= 0, \
msg="Minimum eigenvector centrality is less than 0 for graph #%d" % idx)
ec2 = [sum(ec[u.index] for u in v.predecessors()) for v in g.vs]
for i in range(n):
self.assertAlmostEqual(ec[i] * eval, ec2[i], places=7, \
msg="Eigenvector centrality in graph #%d seems to be invalid "\
"for vertex %d" % (idx, i))
finally:
# Reset the warning handler
warnings.resetwarnings()
def testHubScore(self):
for idx, g in enumerate(self.__class__.graphs):
sc = g.hub_score()
if g.vcount() == 0:
self.assertEqual([], sc)
continue
self.assertAlmostEqual(max(sc), 1, places=7, \
msg="Maximum authority score is not 1 for graph #%d" % idx)
self.assertTrue(min(sc) >= 0, \
msg="Minimum hub score is less than 0 for graph #%d" % idx)
def testAuthorityScore(self):
for idx, g in enumerate(self.__class__.graphs):
sc = g.authority_score()
if g.vcount() == 0:
self.assertEqual([], sc)
continue
self.assertAlmostEqual(max(sc), 1, places=7, \
msg="Maximum authority score is not 1 for graph #%d" % idx)
self.assertTrue(min(sc) >= 0, \
msg="Minimum authority score is less than 0 for graph #%d" % idx)
class GraphAtlasTests(TestBase):
graphs = [Graph.Atlas(i) for i in range(1253)]
class IsoclassTests(TestBase):
graphs = [Graph.Isoclass(3, i, directed=True) for i in range(16)] + \
[Graph.Isoclass(4, i, directed=True) for i in range(218)]
def suite():
atlas_suite = unittest.makeSuite(GraphAtlasTests)
isoclass_suite = unittest.makeSuite(IsoclassTests)
return unittest.TestSuite([atlas_suite, isoclass_suite])
def test():
runner = unittest.TextTestRunner()
runner.run(suite())
if __name__ == "__main__":
test()
| [
1,
529,
276,
1112,
420,
29958,
6008,
29895,
1915,
29882,
29914,
1184,
371,
262,
29899,
29934,
335,
333,
29899,
11096,
2708,
29899,
12787,
7715,
13,
13,
13,
5215,
18116,
13,
5215,
443,
27958,
13,
3166,
8919,
1140,
1053,
334,
13,
13,
1990,
4321,
5160,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
1243,
5074,
29934,
804,
29898,
1311,
1125,
13,
4706,
363,
22645,
29892,
330,
297,
26985,
29898,
1311,
17255,
1990,
26914,
4262,
29879,
1125,
13,
9651,
1018,
29901,
13,
18884,
544,
353,
330,
29889,
29886,
1875,
804,
580,
13,
9651,
5174,
8960,
408,
429,
29901,
13,
18884,
1583,
29889,
9294,
5574,
29898,
8824,
29892,
10191,
543,
5074,
29934,
804,
13944,
18318,
3682,
363,
3983,
396,
29995,
29881,
29901,
1273,
29879,
29908,
1273,
313,
13140,
29892,
429,
876,
13,
18884,
12020,
13,
13,
9651,
565,
330,
29889,
29894,
2798,
580,
1275,
29871,
29900,
29901,
13,
18884,
1583,
29889,
9294,
9843,
4197,
1402,
544,
29897,
13,
18884,
6773,
13,
13,
9651,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
29896,
29889,
29900,
29892,
2533,
29898,
558,
511,
7600,
29922,
29945,
29892,
320,
13,
462,
1678,
10191,
543,
5074,
29934,
804,
2533,
338,
451,
29871,
29896,
29889,
29900,
363,
3983,
396,
29995,
29881,
313,
29995,
29878,
5513,
1273,
313,
13140,
29892,
544,
876,
13,
9651,
1583,
29889,
9294,
5574,
29898,
1195,
29898,
558,
29897,
6736,
29871,
29900,
29892,
320,
13,
462,
1678,
10191,
543,
8140,
12539,
9305,
29934,
804,
338,
3109,
1135,
29871,
29900,
363,
3983,
396,
29995,
29881,
313,
29995,
29878,
5513,
1273,
313,
13140,
29892,
544,
876,
13,
13,
1678,
822,
1243,
29923,
2101,
8111,
23369,
1705,
537,
29898,
1311,
1125,
13,
4706,
396,
6789,
1971,
6275,
2507,
1283,
278,
9177,
7834,
1363,
330,
29889,
5750,
1760,
580,
674,
1596,
13,
4706,
396,
263,
9177,
363,
360,
10051,
29879,
13,
4706,
18116,
29889,
12857,
4572,
703,
17281,
1159,
13,
13,
4706,
1018,
29901,
13,
9651,
363,
22645,
29892,
330,
297,
26985,
29898,
1311,
17255,
1990,
26914,
4262,
29879,
1125,
13,
18884,
1018,
29901,
13,
462,
1678,
21226,
29892,
19745,
353,
330,
29889,
5750,
1760,
29898,
2457,
29918,
29872,
2101,
1767,
29922,
5574,
29897,
13,
18884,
5174,
8960,
408,
429,
29901,
13,
462,
1678,
1583,
29889,
9294,
5574,
29898,
8824,
29892,
10191,
543,
29923,
2101,
8111,
6555,
537,
18318,
3682,
363,
3983,
396,
29995,
29881,
29901,
1273,
29879,
29908,
1273,
313,
13140,
29892,
429,
876,
13,
462,
1678,
12020,
13,
13,
18884,
565,
330,
29889,
29894,
2798,
580,
1275,
29871,
29900,
29901,
13,
462,
1678,
1583,
29889,
9294,
9843,
4197,
1402,
21226,
29897,
13,
462,
1678,
6773,
13,
13,
18884,
565,
451,
330,
29889,
275,
29918,
18045,
7295,
13,
462,
1678,
396,
4971,
666,
766,
18045,
18445,
29936,
445,
674,
367,
4343,
297,
8919,
1140,
29871,
29900,
29889,
29955,
13,
462,
1678,
6773,
13,
13,
18884,
302,
353,
330,
29889,
29894,
2798,
580,
13,
18884,
565,
6425,
29898,
14513,
29897,
529,
29871,
29896,
29872,
29899,
29946,
29901,
13,
462,
1678,
1583,
29889,
9294,
5574,
29898,
1195,
29898,
687,
29897,
6736,
448,
29896,
29872,
29899,
29896,
29900,
29892,
13,
462,
9651,
10191,
543,
8140,
12539,
7388,
8111,
6555,
537,
338,
7968,
1135,
29871,
29900,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
462,
1678,
1583,
29889,
9294,
5574,
29898,
3317,
29898,
687,
29897,
5277,
29871,
29896,
29892,
13,
462,
9651,
10191,
543,
7976,
12539,
7388,
8111,
6555,
537,
338,
7621,
1135,
29871,
29896,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
462,
1678,
6773,
13,
13,
18884,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
3317,
29898,
687,
511,
29871,
29896,
29892,
7600,
29922,
29955,
29892,
320,
13,
462,
4706,
10191,
543,
7976,
12539,
7388,
8111,
6555,
537,
338,
1273,
29878,
313,
1333,
29871,
29896,
29897,
363,
3983,
396,
29995,
29881,
313,
29995,
29878,
5513,
1273,
320,
13,
462,
4706,
313,
3317,
29898,
687,
511,
22645,
29892,
21226,
876,
13,
18884,
1583,
29889,
9294,
5574,
29898,
1195,
29898,
687,
29897,
6736,
29871,
29900,
29892,
320,
13,
462,
4706,
10191,
543,
8140,
12539,
7388,
8111,
6555,
537,
338,
3109,
1135,
29871,
29900,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
13,
18884,
21226,
29906,
353,
518,
2083,
29898,
687,
29961,
29884,
29889,
2248,
29962,
363,
318,
297,
325,
29889,
1457,
311,
985,
943,
3101,
363,
325,
297,
330,
29889,
4270,
29962,
13,
18884,
363,
474,
297,
3464,
29898,
29876,
1125,
13,
462,
1678,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
687,
29961,
29875,
29962,
334,
19745,
29892,
21226,
29906,
29961,
29875,
1402,
7600,
29922,
29955,
29892,
320,
13,
462,
9651,
10191,
543,
29923,
2101,
8111,
6555,
537,
297,
3983,
396,
29995,
29881,
2444,
304,
367,
8340,
6634,
13,
462,
9651,
376,
1454,
12688,
1273,
29881,
29908,
1273,
313,
13140,
29892,
474,
876,
13,
4706,
7146,
29901,
13,
9651,
396,
2538,
300,
278,
9177,
7834,
13,
9651,
18116,
29889,
12071,
25442,
886,
580,
13,
13,
1678,
822,
1243,
16046,
20097,
29898,
1311,
1125,
13,
4706,
363,
22645,
29892,
330,
297,
26985,
29898,
1311,
17255,
1990,
26914,
4262,
29879,
1125,
13,
9651,
885,
353,
330,
29889,
29882,
431,
29918,
13628,
580,
13,
9651,
565,
330,
29889,
29894,
2798,
580,
1275,
29871,
29900,
29901,
13,
18884,
1583,
29889,
9294,
9843,
4197,
1402,
885,
29897,
13,
18884,
6773,
13,
13,
9651,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
3317,
29898,
1557,
511,
29871,
29896,
29892,
7600,
29922,
29955,
29892,
320,
13,
462,
1678,
10191,
543,
7976,
12539,
14329,
8158,
338,
451,
29871,
29896,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
9651,
1583,
29889,
9294,
5574,
29898,
1195,
29898,
1557,
29897,
6736,
29871,
29900,
29892,
320,
13,
462,
1678,
10191,
543,
8140,
12539,
19766,
8158,
338,
3109,
1135,
29871,
29900,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
13,
1678,
822,
1243,
13720,
537,
20097,
29898,
1311,
1125,
13,
4706,
363,
22645,
29892,
330,
297,
26985,
29898,
1311,
17255,
1990,
26914,
4262,
29879,
1125,
13,
9651,
885,
353,
330,
29889,
8921,
537,
29918,
13628,
580,
13,
9651,
565,
330,
29889,
29894,
2798,
580,
1275,
29871,
29900,
29901,
13,
18884,
1583,
29889,
9294,
9843,
4197,
1402,
885,
29897,
13,
18884,
6773,
13,
13,
9651,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
3317,
29898,
1557,
511,
29871,
29896,
29892,
7600,
29922,
29955,
29892,
320,
13,
462,
1678,
10191,
543,
7976,
12539,
14329,
8158,
338,
451,
29871,
29896,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
9651,
1583,
29889,
9294,
5574,
29898,
1195,
29898,
1557,
29897,
6736,
29871,
29900,
29892,
320,
13,
462,
1678,
10191,
543,
8140,
12539,
14329,
8158,
338,
3109,
1135,
29871,
29900,
363,
3983,
396,
29995,
29881,
29908,
1273,
22645,
29897,
13,
13,
1990,
12367,
27753,
24376,
29898,
3057,
5160,
1125,
13,
1678,
18445,
353,
518,
9527,
29889,
27753,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29896,
29906,
29945,
29941,
4638,
13,
13,
1990,
1317,
542,
605,
24376,
29898,
3057,
5160,
1125,
13,
1678,
18445,
353,
518,
9527,
29889,
3624,
542,
605,
29898,
29941,
29892,
474,
29892,
10624,
29922,
5574,
29897,
363,
474,
297,
3464,
29898,
29896,
29953,
4638,
718,
320,
13,
632,
518,
9527,
29889,
3624,
542,
605,
29898,
29946,
29892,
474,
29892,
10624,
29922,
5574,
29897,
363,
474,
297,
3464,
29898,
29906,
29896,
29947,
4638,
13,
13,
1753,
9460,
7295,
13,
1678,
472,
3333,
29918,
13495,
353,
443,
27958,
29889,
5675,
5091,
568,
29898,
9527,
27753,
24376,
29897,
13,
1678,
338,
542,
605,
29918,
13495,
353,
443,
27958,
29889,
5675,
5091,
568,
29898,
3624,
542,
605,
24376,
29897,
13,
1678,
736,
443,
27958,
29889,
3057,
5091,
568,
4197,
271,
3333,
29918,
13495,
29892,
338,
542,
605,
29918,
13495,
2314,
13,
13,
1753,
1243,
7295,
13,
1678,
28877,
353,
443,
27958,
29889,
1626,
3057,
16802,
580,
13,
1678,
28877,
29889,
3389,
29898,
13495,
3101,
13,
268,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1243,
580,
13,
13,
2
] |
python/pytest_fixtures/fizzbuzz.py | zkan/100DaysOfCode | 2 | 138672 | <reponame>zkan/100DaysOfCode
class FizzBuzz(object):
def say(self, number):
if number % 3 == 0 and number % 5 == 0:
return 'FizzBuzz'
elif number % 3 == 0:
return 'Fizz'
elif number % 5 == 0:
return 'Buzz'
else:
return number
| [
1,
529,
276,
1112,
420,
29958,
7730,
273,
29914,
29896,
29900,
29900,
25991,
2776,
3399,
13,
1990,
383,
4981,
29933,
18813,
29898,
3318,
1125,
13,
1678,
822,
1827,
29898,
1311,
29892,
1353,
1125,
13,
4706,
565,
1353,
1273,
29871,
29941,
1275,
29871,
29900,
322,
1353,
1273,
29871,
29945,
1275,
29871,
29900,
29901,
13,
9651,
736,
525,
29943,
4981,
29933,
18813,
29915,
13,
4706,
25342,
1353,
1273,
29871,
29941,
1275,
29871,
29900,
29901,
13,
9651,
736,
525,
29943,
4981,
29915,
13,
4706,
25342,
1353,
1273,
29871,
29945,
1275,
29871,
29900,
29901,
13,
9651,
736,
525,
29933,
18813,
29915,
13,
4706,
1683,
29901,
13,
9651,
736,
1353,
13,
2
] |
algoanim/stats.py | Gaming32/Python-AlgoAnim | 0 | 32513 | <reponame>Gaming32/Python-AlgoAnim<filename>algoanim/stats.py
class Stats:
writes: int
reads: int
accesses: int
def __init__(self) -> None:
self.reset()
def reset(self) -> None:
self.writes = 0
self.reads = 0
self.accesses = 0
def add_reads(self, count: int = 1) -> None:
self.reads += count
self.accesses += count
def add_writes(self, count: int = 1) -> None:
self.writes += count
self.accesses += count
| [
1,
529,
276,
1112,
420,
29958,
29954,
11500,
29941,
29906,
29914,
11980,
29899,
2499,
1484,
21645,
29966,
9507,
29958,
284,
1484,
11576,
29914,
16202,
29889,
2272,
13,
1990,
624,
1446,
29901,
13,
1678,
15873,
29901,
938,
13,
1678,
13623,
29901,
938,
13,
1678,
2130,
267,
29901,
938,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
12071,
580,
13,
13,
1678,
822,
10092,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
8231,
267,
353,
29871,
29900,
13,
4706,
1583,
29889,
949,
29879,
353,
29871,
29900,
13,
4706,
1583,
29889,
5943,
267,
353,
29871,
29900,
13,
13,
1678,
822,
788,
29918,
949,
29879,
29898,
1311,
29892,
2302,
29901,
938,
353,
29871,
29896,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
949,
29879,
4619,
2302,
13,
4706,
1583,
29889,
5943,
267,
4619,
2302,
13,
13,
1678,
822,
788,
29918,
8231,
267,
29898,
1311,
29892,
2302,
29901,
938,
353,
29871,
29896,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
8231,
267,
4619,
2302,
13,
4706,
1583,
29889,
5943,
267,
4619,
2302,
13,
2
] |
python/iter/generator1.py | bismog/leetcode | 0 | 1613388 | <reponame>bismog/leetcode<filename>python/iter/generator1.py
#!/usr/bin/env python
#-*- coding:utf-8 -*-
def count():
c = 0
while True:
c = c + 1
yield c
a = count()
print a.next()
print a.send(None)
# print a.send()
print a.next()
b = a.__iter__()
print b.next()
c = count()
print c.next()
| [
1,
529,
276,
1112,
420,
29958,
29890,
1608,
468,
29914,
280,
300,
401,
29966,
9507,
29958,
4691,
29914,
1524,
29914,
27959,
29896,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
29899,
29930,
29899,
14137,
29901,
9420,
29899,
29947,
448,
29930,
29899,
13,
13,
1753,
2302,
7295,
13,
1678,
274,
353,
29871,
29900,
13,
1678,
1550,
5852,
29901,
13,
4706,
274,
353,
274,
718,
29871,
29896,
13,
4706,
7709,
274,
13,
13,
29874,
353,
2302,
580,
13,
2158,
263,
29889,
4622,
580,
13,
2158,
263,
29889,
6717,
29898,
8516,
29897,
13,
29937,
1596,
263,
29889,
6717,
580,
13,
2158,
263,
29889,
4622,
580,
13,
13,
29890,
353,
263,
17255,
1524,
1649,
580,
13,
2158,
289,
29889,
4622,
580,
13,
13,
29883,
353,
2302,
580,
13,
2158,
274,
29889,
4622,
580,
13,
13,
13,
2
] |
app/dropins/adafruit_bme280.py | NaeiKinDus/ANCS | 0 | 74248 | # -*- coding: utf-8 -*-
from app.core.dropin.base_i2c_dropin import BaseI2CDropIn
from logging import Logger
from prometheus_client import Gauge, Counter, metrics, Info, Enum
from typing import Optional, Dict
class DropIn(BaseI2CDropIn):
"""
Drop-in to use Adafruit's BME280 sensor using I2C.
"""
DEFAULT_ADDRESS: int = 0x77 # dec: 119
DEFAULT_BUS: int = 1
DROP_IN_VERSION: str = '0.0.1'
DROP_IN_ID: str = 'adafruit_bme280'
FLASK_ROUTING_RULE: str = 'bme280'
HANDLED_METHODS = ('GET', 'POST')
_metrics: Dict[str, metrics.MetricWrapperBase] = {}
def __init__(self, logger: Logger, bus: int = None, address: int = None, connector: object = None):
"""
Constructor.
note: `connector` may be a lambda or function that returns an object that MUST exhibit the
same properties as adafruit_bme280.Adafruit_BME280_I2C() for full compatibility. The
function will be provided with two positional parameters, `bus` and `address`, corresponding to
the I2C connection parameters.
@todo Modify the way connectors are handled to allow easier configuration of I2C parameters.
:param logger: logger instance
:type logger: Logger
:param bus: I2C bus used
:type bus: int
:param address: I2C address of the sensor
:type address: int
:param connector: connector used to talk to the I2C device, defaults to adafruit_bme280 implementation
:type connector: object
"""
current_address: int = address if address else self.DEFAULT_ADDRESS
current_bus: int = bus if bus else self.DEFAULT_BUS
current_connector: object
if callable(connector):
current_connector = connector(bus=current_bus, address=current_address)
else:
try:
from adafruit_bme280 import Adafruit_BME280_I2C
import board
import busio
except NotImplementedError:
logger.error('Missing python dependencies, please review your setup')
raise
i2c_setup = busio.I2C(board.SCL, board.SDA)
current_connector = Adafruit_BME280_I2C(i2c_setup)
super().__init__(current_bus, current_address, logger, connector=current_connector)
self._setup_metrics()
self._metrics['state'].labels('bme280').state('ready')
def _setup_metrics(self):
# Setup metrics objects. Should never be called by anything except the # __init__() method.
self._metrics['state'] = Enum(
self.DROP_IN_ID + '_drop_in_status',
'Current status of the drop-in',
['drop_in_name'],
states=['starting', 'ready', 'measuring']
)
self._metrics['state'].labels('bme280').state('starting')
self._metrics['periodic_passes'] = Counter(
self.DROP_IN_ID + '_measurements_count',
'Number of times periodic measurements were performed',
['drop_in_name']
)
self._metrics['temperature'] = Gauge(
self.DROP_IN_ID + '_temperature',
'Temperature (Celsius degrees)',
['drop_in_name']
)
self._metrics['altitude'] = Gauge(
self.DROP_IN_ID + '_altitude',
'Altitude (meters)',
['drop_in_name']
)
self._metrics['humidity'] = Gauge(
self.DROP_IN_ID + '_humidity',
'Humidity (%)',
['drop_in_name']
)
self._metrics['pressure'] = Gauge(
self.DROP_IN_ID + '_pressure',
'Pressure (hPa)',
['drop_in_name']
)
self._metrics['bme280'] = Info(
self.DROP_IN_ID + '_drop_in',
'Information regarding this drop_in',
['drop_in_name']
)
self._metrics['bme280'].labels('bme280').info(
{
'version': self.DROP_IN_VERSION,
'id': self.DROP_IN_ID,
'rule': self.FLASK_ROUTING_RULE,
'capabilities': 'temperature, altitude, humidity, pressure'
}
)
def periodic_call(self, context: dict = None) -> None:
"""
Called by the watcher thread, used to perform periodic measurements and increase
relevant Prometheus counters.
"""
self.logger.debug('running periodic upkeep for {}'.format(self.DROP_IN_ID))
self._metrics['state'].labels('bme280').state('measuring')
self._metrics['periodic_passes'].labels('bme280').inc()
self._metrics['temperature'].labels('bme280').set(round(self._connector.temperature, 1))
self._metrics['humidity'].labels('bme280').set(round(self._connector.humidity))
self._metrics['pressure'].labels('bme280').set(round(self._connector.pressure))
self._metrics['altitude'].labels('bme280').set(round(self._connector.altitude))
self._metrics['state'].labels('bme280').state('ready')
self.logger.debug('periodic upkeep succeeded')
def handler(self, context: dict = None) -> Optional[str]:
"""
Exposed as a REST webservice; call that handles queries that match a specific endpoint.
:param context: an optional context object containing a query's context data
:type context: dict
:return: a json-encoded string that contains the response
:rtype: str
"""
pass
@property
def identity(self) -> dict:
"""
Property returning a dictionary used to register drop-ins and their end point(s).
:return: identity dict for this drop-in
:rtype: dict
"""
return {
'id': self.DROP_IN_ID,
'rule': self.FLASK_ROUTING_RULE,
'endpoint': '/' + self.FLASK_ROUTING_RULE,
'version': self.DROP_IN_VERSION,
'handler': self.handler,
'methods': self.HANDLED_METHODS
}
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
623,
29889,
3221,
29889,
8865,
262,
29889,
3188,
29918,
29875,
29906,
29883,
29918,
8865,
262,
1053,
7399,
29902,
29906,
6530,
1336,
797,
13,
3166,
12183,
1053,
28468,
13,
3166,
2504,
23043,
375,
29918,
4645,
1053,
402,
585,
479,
29892,
315,
5336,
29892,
21556,
29892,
22140,
29892,
1174,
398,
13,
3166,
19229,
1053,
28379,
29892,
360,
919,
13,
13,
13,
1990,
20724,
797,
29898,
5160,
29902,
29906,
6530,
1336,
797,
1125,
13,
1678,
9995,
13,
1678,
20724,
29899,
262,
304,
671,
23255,
29888,
9216,
29915,
29879,
350,
2303,
29906,
29947,
29900,
23530,
773,
306,
29906,
29907,
29889,
13,
1678,
9995,
13,
1678,
22236,
29918,
17744,
26785,
29901,
938,
353,
29871,
29900,
29916,
29955,
29955,
29871,
396,
1602,
29901,
29871,
29896,
29896,
29929,
13,
1678,
22236,
29918,
29933,
3308,
29901,
938,
353,
29871,
29896,
13,
1678,
360,
29366,
29918,
1177,
29918,
16358,
29901,
851,
353,
525,
29900,
29889,
29900,
29889,
29896,
29915,
13,
1678,
360,
29366,
29918,
1177,
29918,
1367,
29901,
851,
353,
525,
1114,
29888,
9216,
29918,
29890,
1004,
29906,
29947,
29900,
29915,
13,
1678,
383,
29931,
3289,
29968,
29918,
1672,
2692,
4214,
29918,
28283,
1307,
29901,
851,
353,
525,
29890,
1004,
29906,
29947,
29900,
29915,
13,
1678,
379,
9468,
20566,
29918,
2303,
4690,
29949,
8452,
353,
6702,
7194,
742,
525,
5438,
1495,
13,
13,
1678,
903,
2527,
10817,
29901,
360,
919,
29961,
710,
29892,
21556,
29889,
10095,
2200,
15646,
5160,
29962,
353,
6571,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
17927,
29901,
28468,
29892,
3593,
29901,
938,
353,
6213,
29892,
3211,
29901,
938,
353,
6213,
29892,
1826,
2801,
29901,
1203,
353,
6213,
1125,
13,
4706,
9995,
13,
4706,
1281,
18769,
29889,
13,
4706,
4443,
29901,
421,
11958,
2801,
29952,
1122,
367,
263,
14013,
470,
740,
393,
3639,
385,
1203,
393,
341,
17321,
10371,
277,
278,
13,
9651,
1021,
4426,
408,
594,
2142,
9216,
29918,
29890,
1004,
29906,
29947,
29900,
29889,
29909,
1388,
29888,
9216,
29918,
29933,
2303,
29906,
29947,
29900,
29918,
29902,
29906,
29907,
580,
363,
2989,
24521,
29889,
450,
13,
9651,
740,
674,
367,
4944,
411,
1023,
2602,
284,
4128,
29892,
421,
8262,
29952,
322,
421,
7328,
1673,
6590,
304,
13,
9651,
278,
306,
29906,
29907,
3957,
4128,
29889,
13,
4706,
732,
29873,
8144,
3382,
1598,
278,
982,
4511,
943,
526,
16459,
304,
2758,
6775,
5285,
310,
306,
29906,
29907,
4128,
29889,
13,
13,
4706,
584,
3207,
17927,
29901,
17927,
2777,
13,
4706,
584,
1853,
17927,
29901,
28468,
13,
4706,
584,
3207,
3593,
29901,
306,
29906,
29907,
3593,
1304,
13,
4706,
584,
1853,
3593,
29901,
938,
13,
4706,
584,
3207,
3211,
29901,
306,
29906,
29907,
3211,
310,
278,
23530,
13,
4706,
584,
1853,
3211,
29901,
938,
13,
4706,
584,
3207,
1826,
2801,
29901,
1826,
2801,
1304,
304,
5193,
304,
278,
306,
29906,
29907,
4742,
29892,
21274,
304,
594,
2142,
9216,
29918,
29890,
1004,
29906,
29947,
29900,
5314,
13,
4706,
584,
1853,
1826,
2801,
29901,
1203,
13,
4706,
9995,
13,
4706,
1857,
29918,
7328,
29901,
938,
353,
3211,
565,
3211,
1683,
1583,
29889,
23397,
29918,
17744,
26785,
13,
4706,
1857,
29918,
8262,
29901,
938,
353,
3593,
565,
3593,
1683,
1583,
29889,
23397,
29918,
29933,
3308,
13,
4706,
1857,
29918,
11958,
2801,
29901,
1203,
13,
13,
4706,
565,
1246,
519,
29898,
11958,
2801,
1125,
13,
9651,
1857,
29918,
11958,
2801,
353,
1826,
2801,
29898,
8262,
29922,
3784,
29918,
8262,
29892,
3211,
29922,
3784,
29918,
7328,
29897,
13,
4706,
1683,
29901,
13,
9651,
1018,
29901,
13,
18884,
515,
594,
2142,
9216,
29918,
29890,
1004,
29906,
29947,
29900,
1053,
23255,
29888,
9216,
29918,
29933,
2303,
29906,
29947,
29900,
29918,
29902,
29906,
29907,
13,
18884,
1053,
7613,
13,
18884,
1053,
3593,
601,
13,
9651,
5174,
2216,
1888,
2037,
287,
2392,
29901,
13,
18884,
17927,
29889,
2704,
877,
18552,
292,
3017,
9962,
29892,
3113,
9076,
596,
6230,
1495,
13,
18884,
12020,
13,
13,
9651,
474,
29906,
29883,
29918,
14669,
353,
3593,
601,
29889,
29902,
29906,
29907,
29898,
3377,
29889,
29903,
6154,
29892,
7613,
29889,
7230,
29909,
29897,
13,
9651,
1857,
29918,
11958,
2801,
353,
23255,
29888,
9216,
29918,
29933,
2303,
29906,
29947,
29900,
29918,
29902,
29906,
29907,
29898,
29875,
29906,
29883,
29918,
14669,
29897,
13,
4706,
2428,
2141,
1649,
2344,
12035,
3784,
29918,
8262,
29892,
1857,
29918,
7328,
29892,
17927,
29892,
1826,
2801,
29922,
3784,
29918,
11958,
2801,
29897,
13,
4706,
1583,
3032,
14669,
29918,
2527,
10817,
580,
13,
4706,
1583,
3032,
2527,
10817,
1839,
3859,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
3859,
877,
2040,
1495,
13,
13,
1678,
822,
903,
14669,
29918,
2527,
10817,
29898,
1311,
1125,
13,
4706,
396,
3789,
786,
21556,
3618,
29889,
10575,
2360,
367,
2000,
491,
3099,
5174,
278,
396,
4770,
2344,
1649,
580,
1158,
29889,
13,
4706,
1583,
3032,
2527,
10817,
1839,
3859,
2033,
353,
1174,
398,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
8865,
29918,
262,
29918,
4882,
742,
13,
9651,
525,
7583,
4660,
310,
278,
5768,
29899,
262,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
7464,
13,
9651,
5922,
29922,
1839,
2962,
292,
742,
525,
2040,
742,
525,
1004,
294,
3864,
2033,
13,
4706,
1723,
13,
4706,
1583,
3032,
2527,
10817,
1839,
3859,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
3859,
877,
2962,
292,
1495,
13,
13,
4706,
1583,
3032,
2527,
10817,
1839,
19145,
293,
29918,
3364,
267,
2033,
353,
315,
5336,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
26658,
1860,
29918,
2798,
742,
13,
9651,
525,
4557,
310,
3064,
29591,
20398,
892,
8560,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
2033,
13,
4706,
1723,
13,
13,
4706,
1583,
3032,
2527,
10817,
1839,
12863,
1535,
2033,
353,
402,
585,
479,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
12863,
1535,
742,
13,
9651,
525,
5776,
546,
1535,
313,
29907,
295,
1039,
375,
14496,
29897,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
2033,
13,
4706,
1723,
13,
4706,
1583,
3032,
2527,
10817,
1839,
1997,
4279,
2033,
353,
402,
585,
479,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
1997,
4279,
742,
13,
9651,
525,
24528,
4279,
313,
2527,
414,
29897,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
2033,
13,
4706,
1723,
13,
4706,
1583,
3032,
2527,
10817,
1839,
16063,
333,
537,
2033,
353,
402,
585,
479,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
16063,
333,
537,
742,
13,
9651,
525,
29950,
398,
333,
537,
313,
10997,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
2033,
13,
4706,
1723,
13,
4706,
1583,
3032,
2527,
10817,
1839,
2139,
545,
2033,
353,
402,
585,
479,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
2139,
545,
742,
13,
9651,
525,
10923,
545,
313,
29882,
11868,
29897,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
2033,
13,
4706,
1723,
13,
13,
4706,
1583,
3032,
2527,
10817,
1839,
29890,
1004,
29906,
29947,
29900,
2033,
353,
22140,
29898,
13,
9651,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
718,
22868,
8865,
29918,
262,
742,
13,
9651,
525,
20350,
11211,
445,
5768,
29918,
262,
742,
13,
9651,
6024,
8865,
29918,
262,
29918,
978,
2033,
13,
4706,
1723,
13,
4706,
1583,
3032,
2527,
10817,
1839,
29890,
1004,
29906,
29947,
29900,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
3888,
29898,
13,
9651,
426,
13,
18884,
525,
3259,
2396,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
16358,
29892,
13,
18884,
525,
333,
2396,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
29892,
13,
18884,
525,
7491,
2396,
1583,
29889,
10536,
3289,
29968,
29918,
1672,
2692,
4214,
29918,
28283,
1307,
29892,
13,
18884,
525,
5030,
11614,
2396,
525,
12863,
1535,
29892,
5272,
4279,
29892,
3165,
333,
537,
29892,
12959,
29915,
13,
9651,
500,
13,
4706,
1723,
13,
13,
1678,
822,
29591,
29918,
4804,
29898,
1311,
29892,
3030,
29901,
9657,
353,
6213,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
3037,
839,
491,
278,
6505,
261,
3244,
29892,
1304,
304,
2189,
29591,
20398,
322,
7910,
13,
4706,
8018,
9705,
23043,
375,
2613,
2153,
29889,
13,
4706,
9995,
13,
4706,
1583,
29889,
21707,
29889,
8382,
877,
21094,
29591,
701,
17462,
363,
6571,
4286,
4830,
29898,
1311,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
876,
13,
4706,
1583,
3032,
2527,
10817,
1839,
3859,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
3859,
877,
1004,
294,
3864,
1495,
13,
13,
4706,
1583,
3032,
2527,
10817,
1839,
19145,
293,
29918,
3364,
267,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
3742,
580,
13,
4706,
1583,
3032,
2527,
10817,
1839,
12863,
1535,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
842,
29898,
14486,
29898,
1311,
3032,
11958,
2801,
29889,
12863,
1535,
29892,
29871,
29896,
876,
13,
4706,
1583,
3032,
2527,
10817,
1839,
16063,
333,
537,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
842,
29898,
14486,
29898,
1311,
3032,
11958,
2801,
29889,
16063,
333,
537,
876,
13,
4706,
1583,
3032,
2527,
10817,
1839,
2139,
545,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
842,
29898,
14486,
29898,
1311,
3032,
11958,
2801,
29889,
2139,
545,
876,
13,
4706,
1583,
3032,
2527,
10817,
1839,
1997,
4279,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
842,
29898,
14486,
29898,
1311,
3032,
11958,
2801,
29889,
1997,
4279,
876,
13,
13,
4706,
1583,
3032,
2527,
10817,
1839,
3859,
13359,
21134,
877,
29890,
1004,
29906,
29947,
29900,
2824,
3859,
877,
2040,
1495,
13,
4706,
1583,
29889,
21707,
29889,
8382,
877,
19145,
293,
701,
17462,
14792,
1495,
13,
13,
1678,
822,
7834,
29898,
1311,
29892,
3030,
29901,
9657,
353,
6213,
29897,
1599,
28379,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
1222,
4752,
408,
263,
16759,
1856,
5509,
29936,
1246,
393,
17766,
9365,
393,
1993,
263,
2702,
16248,
29889,
13,
4706,
584,
3207,
3030,
29901,
385,
13136,
3030,
1203,
6943,
263,
2346,
29915,
29879,
3030,
848,
13,
4706,
584,
1853,
3030,
29901,
9657,
13,
4706,
584,
2457,
29901,
263,
4390,
29899,
26716,
1347,
393,
3743,
278,
2933,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
1209,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10110,
29898,
1311,
29897,
1599,
9657,
29901,
13,
4706,
9995,
13,
4706,
9079,
7863,
263,
8600,
1304,
304,
6036,
5768,
29899,
1144,
322,
1009,
1095,
1298,
29898,
29879,
467,
13,
13,
4706,
584,
2457,
29901,
10110,
9657,
363,
445,
5768,
29899,
262,
13,
4706,
584,
29878,
1853,
29901,
9657,
13,
4706,
9995,
13,
4706,
736,
426,
13,
9651,
525,
333,
2396,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
1367,
29892,
13,
9651,
525,
7491,
2396,
1583,
29889,
10536,
3289,
29968,
29918,
1672,
2692,
4214,
29918,
28283,
1307,
29892,
13,
9651,
525,
29734,
2396,
8207,
29915,
718,
1583,
29889,
10536,
3289,
29968,
29918,
1672,
2692,
4214,
29918,
28283,
1307,
29892,
13,
9651,
525,
3259,
2396,
1583,
29889,
29928,
29366,
29918,
1177,
29918,
16358,
29892,
13,
9651,
525,
13789,
2396,
1583,
29889,
13789,
29892,
13,
9651,
525,
23515,
2396,
1583,
29889,
29950,
9468,
20566,
29918,
2303,
4690,
29949,
8452,
13,
4706,
500,
13,
2
] |
ajit.py | kuehnelth/aheui-editor | 1 | 157145 | import os
import sys
def do_nothing(machine, code):
pass
def exit_machine(machine, code):
machine.terminate_flag = True
def select_storage(machine, code):
machine.select_storage(code)
def send(machine, code):
machine.current_storage.send(machine.get_storage(code))
def compare(machine, code):
storage = machine.current_storage
if storage.pop() > storage.pop():
storage.push(0)
else:
storage.push(1)
def decide(machine, code):
if machine.current_storage.pop() == 0:
machine.cursor.reflect()
def pop(machine, code):
value = machine.current_storage.pop()
output = machine.output
if code == 21:
output(unicode(str(value)))
elif code == 27:
output(unichr(value))
def push(machine, code):
if code == 21:
value = machine.number_input()
elif code == 27:
value = machine.character_input()
else:
value = get_stroke_count(code)
machine.current_storage.push(value)
def duplicate(machine, code):
machine.current_storage.duplicate()
def swap(machine, code):
machine.current_storage.swap()
def arithmetic(func):
def operation(machine, code):
storage = machine.current_storage
right = storage.pop()
left = storage.pop()
storage.push(func(left, right))
return operation
@arithmetic
def add(left, right):
return left + right
@arithmetic
def subtract(left, right):
return left - right
@arithmetic
def multiply(left, right):
return left * right
@arithmetic
def divide(left, right):
return left // right
@arithmetic
def modulo(left, right):
return left % right
operation_table = [
(do_nothing, 0), # 0
(do_nothing, 0), # 1
(divide, 2), # 2
(add, 2), # 3
(multiply, 2), # 4
(modulo, 2), # 5
(pop, 1), # 6
(push, 0), # 7
(duplicate, 1), # 8
(select_storage, 0), # 9
(send, 1), # 10
(do_nothing, 0), # 11
(compare, 2), # 12
(do_nothing, 0), # 13
(decide, 1), # 14
(do_nothing, 0), # 15
(subtract, 2), # 16
(swap, 2), # 17
(exit_machine, 0), # 18
]
def get_operation(code):
try:
if code < 0:
return do_nothing
else:
return operation_table[code][0]
except IndexError:
return do_nothing
def get_parameter_required(code):
try:
if code < 0:
return 0
else:
return operation_table[code][1]
except IndexError:
return 0
stroke_count_table = [
0, 2, 4, 4, 2,
5, 5, 3, 5, 7,
9, 9, 7, 9, 9,
8, 4, 4, 6, 2,
4, 1, 3, 4, 3,
4, 4, 3,
]
def get_stroke_count(code):
try:
return stroke_count_table[code]
except IndexError:
return 0
class Cursor:
def __init__(self, codespace, x=0, y=0, dx=0, dy=1):
self.codespace = codespace
self.x = x
self.y = y
self.dx = dx
self.dy = dy
def line(self):
try:
return self.codespace[self.y]
except IndexError:
return None
def code(self):
line = self.line()
if line is None:
return (-1, -1, -1)
try:
return line[self.x]
except IndexError:
return (-1, -1, -1)
def move(self):
self.x = self.x + self.dx
self.y = self.y + self.dy
line = self.line()
width = len(line) if line is not None else 0
height = len(self.codespace)
if self.x < 0 and self.dx < 0:
self.x = width - 1
elif self.x >= width and self.dx > 0:
self.x = 0
if self.y < 0 and self.dy < 0:
self.y = height - 1
elif self.y >= height and self.dy > 0:
self.y = 0
def reflect(self):
self.dx, self.dy = -self.dx, -self.dy
def turn(self, code):
if code == 0:
self.dx, self.dy = 1, 0
elif code == 2:
self.dx, self.dy = 2, 0
elif code == 4:
self.dx, self.dy = -1, 0
elif code == 6:
self.dx, self.dy = -2, 0
elif code == 8:
self.dx, self.dy = 0, -1
elif code == 12:
self.dx, self.dy = 0, -2
elif code == 13:
self.dx, self.dy = 0, 1
elif code == 17:
self.dx, self.dy = 0, 2
elif code == 18:
self.dy = -self.dy
elif code == 19:
self.reflect()
elif code == 20:
self.dx = -self.dx
class Storage:
def __init__(self):
self.list = []
def __len__(self):
return self.count()
def count(self):
return len(self.list)
def push(self, value):
self.list.append(value)
def send(self, to):
to.push(self.pop())
def pop(self):
return 0
def duplicate(self):
pass
def swap(self):
pass
class Stack(Storage):
def pop(self):
try:
return self.list.pop()
except IndexError:
return 0
def duplicate(self):
self.list.append(self.list[-1])
def swap(self):
self.list[-1], self.list[-2] = self.list[-2], self.list[-1]
class Queue(Storage):
def pop(self):
try:
return self.list.pop(0)
except IndexError:
return 0
def duplicate(self):
self.list.insert(0, self.list[0])
def swap(self):
self.list[0], self.list[1] = self.list[1], self.list[0]
class Machine:
def __init__(self, codespace):
self.cursor = Cursor(codespace)
self.storages = [
Queue() if x == 21 or x == 27 else Stack()
for x in range(28)
]
self.select_storage(0)
def run(self):
self.terminate_flag = False
while not self.terminate_flag:
self.step()
try:
raise AheuiExit(self.current_storage.pop())
except IndexError:
raise AheuiExit(0)
def step(self):
cho, jung, jong = self.cursor.code()
operation = get_operation(cho)
self.cursor.turn(jung)
if self.current_storage.count() < get_parameter_required(cho):
self.cursor.reflect()
else:
operation(self, jong)
self.cursor.move()
def get_storage(self, code):
return self.storages[code]
def select_storage(self, code):
self.current_storage = self.get_storage(code)
class AheuiExit(Exception):
def __init__(self, exit_code):
self.code = exit_code
def __str__(self):
return "Aheui machine terminated with exit code: " + str(self.code)
def extract_index(func):
def extractor(code):
if 0xac00 <= code <= 0xd7a3:
return func(code - 0xac00)
return -1
return extractor
@extract_index
def get_cho(syllable_code):
return syllable_code // 588
@extract_index
def get_jung(syllable_code):
return (syllable_code // 28) % 21
@extract_index
def get_jong(syllable_code):
return syllable_code % 28
def parse(code):
result = []
line = []
for char in code:
if char == u"\r":
continue
elif char == u"\n":
result.append(line)
line = []
else:
charcode = ord(char)
line.append(
(get_cho(charcode),
get_jung(charcode),
get_jong(charcode)))
result.append(line)
return result
def read_character():
bytes = ""
while True:
byte = os.read(0, 1)
if len(byte) == 0:
break
bytes = bytes + byte
try:
char = bytes.decode("utf-8")[0]
charcode = ord(char)
if (len(bytes) != 1 and charcode == 0 or
ord(byte[0]) != charcode == 0):
continue
else:
return char
except UnicodeError:
pass
return u"\x00"[0]
def aheui_number_input():
buf = ""
last = -1
while True:
char = read_character()
charcode = ord(char)
if (charcode == 0 or charcode == 10 or
charcode == 13 or charcode == 32):
return last
buf = buf + str(char)
try:
last = int(buf)
except ValueError:
return last
def aheui_character_input():
return ord(read_character())
def aheui_output(value):
os.write(1, value.encode("utf-8"))
def entry_point(argv):
filename = argv[1]
fp = os.open(filename, os.O_RDONLY, 0777)
code = ""
while True:
read = os.read(fp, 4096)
if len(read) == 0:
break
code += read
code = code.decode("utf-8")
machine = Machine(parse(code))
machine.number_input = aheui_number_input
machine.character_input = aheui_character_input
machine.output = aheui_output
try:
machine.run()
except AheuiExit as e:
return e.code
return 0
def target(*args):
return entry_point, None
if __name__ == "__main__":
entry_point(sys.argv)
| [
1,
1053,
2897,
13,
5215,
10876,
13,
13,
1753,
437,
29918,
28450,
29898,
23523,
29892,
775,
1125,
13,
1678,
1209,
13,
13,
1753,
6876,
29918,
23523,
29898,
23523,
29892,
775,
1125,
13,
1678,
4933,
29889,
18821,
403,
29918,
15581,
353,
5852,
13,
13,
1753,
1831,
29918,
12925,
29898,
23523,
29892,
775,
1125,
13,
1678,
4933,
29889,
2622,
29918,
12925,
29898,
401,
29897,
13,
13,
1753,
3638,
29898,
23523,
29892,
775,
1125,
13,
1678,
4933,
29889,
3784,
29918,
12925,
29889,
6717,
29898,
23523,
29889,
657,
29918,
12925,
29898,
401,
876,
13,
13,
1753,
7252,
29898,
23523,
29892,
775,
1125,
13,
1678,
8635,
353,
4933,
29889,
3784,
29918,
12925,
13,
1678,
565,
8635,
29889,
7323,
580,
1405,
8635,
29889,
7323,
7295,
13,
4706,
8635,
29889,
5910,
29898,
29900,
29897,
13,
1678,
1683,
29901,
13,
4706,
8635,
29889,
5910,
29898,
29896,
29897,
13,
13,
1753,
11097,
29898,
23523,
29892,
775,
1125,
13,
1678,
565,
4933,
29889,
3784,
29918,
12925,
29889,
7323,
580,
1275,
29871,
29900,
29901,
13,
4706,
4933,
29889,
18127,
29889,
13191,
580,
13,
13,
1753,
1835,
29898,
23523,
29892,
775,
1125,
13,
1678,
995,
353,
4933,
29889,
3784,
29918,
12925,
29889,
7323,
580,
13,
1678,
1962,
353,
4933,
29889,
4905,
13,
1678,
565,
775,
1275,
29871,
29906,
29896,
29901,
13,
4706,
1962,
29898,
2523,
356,
29898,
710,
29898,
1767,
4961,
13,
1678,
25342,
775,
1275,
29871,
29906,
29955,
29901,
13,
4706,
1962,
29898,
348,
436,
29878,
29898,
1767,
876,
13,
13,
1753,
5503,
29898,
23523,
29892,
775,
1125,
13,
1678,
565,
775,
1275,
29871,
29906,
29896,
29901,
13,
4706,
995,
353,
4933,
29889,
4537,
29918,
2080,
580,
13,
1678,
25342,
775,
1275,
29871,
29906,
29955,
29901,
13,
4706,
995,
353,
4933,
29889,
18609,
29918,
2080,
580,
13,
1678,
1683,
29901,
13,
4706,
995,
353,
679,
29918,
25893,
29918,
2798,
29898,
401,
29897,
13,
1678,
4933,
29889,
3784,
29918,
12925,
29889,
5910,
29898,
1767,
29897,
13,
13,
1753,
7929,
29898,
23523,
29892,
775,
1125,
13,
1678,
4933,
29889,
3784,
29918,
12925,
29889,
20908,
5926,
580,
13,
13,
1753,
17945,
29898,
23523,
29892,
775,
1125,
13,
1678,
4933,
29889,
3784,
29918,
12925,
29889,
26276,
580,
13,
13,
1753,
23342,
29898,
9891,
1125,
13,
1678,
822,
5858,
29898,
23523,
29892,
775,
1125,
13,
4706,
8635,
353,
4933,
29889,
3784,
29918,
12925,
13,
4706,
1492,
353,
8635,
29889,
7323,
580,
13,
4706,
2175,
353,
8635,
29889,
7323,
580,
13,
4706,
8635,
29889,
5910,
29898,
9891,
29898,
1563,
29892,
1492,
876,
13,
1678,
736,
5858,
13,
13,
29992,
279,
18542,
13,
1753,
788,
29898,
1563,
29892,
1492,
1125,
13,
1678,
736,
2175,
718,
1492,
13,
13,
29992,
279,
18542,
13,
1753,
23197,
29898,
1563,
29892,
1492,
1125,
13,
1678,
736,
2175,
448,
1492,
13,
13,
29992,
279,
18542,
13,
1753,
22932,
29898,
1563,
29892,
1492,
1125,
13,
1678,
736,
2175,
334,
1492,
13,
13,
29992,
279,
18542,
13,
1753,
16429,
29898,
1563,
29892,
1492,
1125,
13,
1678,
736,
2175,
849,
1492,
13,
13,
29992,
279,
18542,
13,
1753,
878,
7207,
29898,
1563,
29892,
1492,
1125,
13,
1678,
736,
2175,
1273,
1492,
13,
13,
16453,
29918,
2371,
353,
518,
13,
1678,
313,
1867,
29918,
28450,
29892,
29871,
29900,
511,
462,
1678,
396,
29871,
29900,
13,
1678,
313,
1867,
29918,
28450,
29892,
29871,
29900,
511,
462,
1678,
396,
29871,
29896,
13,
1678,
313,
4563,
680,
29892,
29871,
29906,
511,
462,
4706,
396,
29871,
29906,
13,
1678,
313,
1202,
29892,
29871,
29906,
511,
462,
965,
396,
29871,
29941,
13,
1678,
313,
18056,
368,
29892,
29871,
29906,
511,
462,
418,
396,
29871,
29946,
13,
1678,
313,
1545,
7207,
29892,
29871,
29906,
511,
462,
4706,
396,
29871,
29945,
13,
1678,
313,
7323,
29892,
29871,
29896,
511,
462,
965,
396,
29871,
29953,
13,
1678,
313,
5910,
29892,
29871,
29900,
511,
462,
3986,
396,
29871,
29955,
13,
1678,
313,
20908,
5926,
29892,
29871,
29896,
511,
462,
268,
396,
29871,
29947,
13,
1678,
313,
2622,
29918,
12925,
29892,
29871,
29900,
511,
18884,
396,
29871,
29929,
13,
1678,
313,
6717,
29892,
29871,
29896,
511,
462,
3986,
396,
29871,
29896,
29900,
13,
1678,
313,
1867,
29918,
28450,
29892,
29871,
29900,
511,
462,
1678,
396,
29871,
29896,
29896,
13,
1678,
313,
18307,
29892,
29871,
29906,
511,
462,
539,
396,
29871,
29896,
29906,
13,
1678,
313,
1867,
29918,
28450,
29892,
29871,
29900,
511,
462,
1678,
396,
29871,
29896,
29941,
13,
1678,
313,
311,
8204,
29892,
29871,
29896,
511,
462,
4706,
396,
29871,
29896,
29946,
13,
1678,
313,
1867,
29918,
28450,
29892,
29871,
29900,
511,
462,
1678,
396,
29871,
29896,
29945,
13,
1678,
313,
1491,
29873,
1461,
29892,
29871,
29906,
511,
462,
418,
396,
29871,
29896,
29953,
13,
1678,
313,
26276,
29892,
29871,
29906,
511,
462,
3986,
396,
29871,
29896,
29955,
13,
1678,
313,
13322,
29918,
23523,
29892,
29871,
29900,
511,
462,
29871,
396,
29871,
29896,
29947,
13,
29962,
13,
13,
1753,
679,
29918,
16453,
29898,
401,
1125,
13,
1678,
1018,
29901,
13,
4706,
565,
775,
529,
29871,
29900,
29901,
13,
9651,
736,
437,
29918,
28450,
13,
4706,
1683,
29901,
13,
9651,
736,
5858,
29918,
2371,
29961,
401,
3816,
29900,
29962,
13,
1678,
5174,
11374,
2392,
29901,
13,
4706,
736,
437,
29918,
28450,
13,
13,
1753,
679,
29918,
15501,
29918,
12403,
29898,
401,
1125,
13,
1678,
1018,
29901,
13,
4706,
565,
775,
529,
29871,
29900,
29901,
13,
9651,
736,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
736,
5858,
29918,
2371,
29961,
401,
3816,
29896,
29962,
13,
1678,
5174,
11374,
2392,
29901,
13,
4706,
736,
29871,
29900,
13,
13,
25893,
29918,
2798,
29918,
2371,
353,
518,
13,
268,
29900,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
13,
268,
29945,
29892,
29871,
29945,
29892,
29871,
29941,
29892,
29871,
29945,
29892,
29871,
29955,
29892,
13,
268,
29929,
29892,
29871,
29929,
29892,
29871,
29955,
29892,
29871,
29929,
29892,
29871,
29929,
29892,
13,
268,
29947,
29892,
29871,
29946,
29892,
29871,
29946,
29892,
29871,
29953,
29892,
29871,
29906,
29892,
13,
268,
29946,
29892,
29871,
29896,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29941,
29892,
13,
268,
29946,
29892,
29871,
29946,
29892,
29871,
29941,
29892,
13,
29962,
13,
13,
1753,
679,
29918,
25893,
29918,
2798,
29898,
401,
1125,
13,
1678,
1018,
29901,
13,
4706,
736,
19782,
29918,
2798,
29918,
2371,
29961,
401,
29962,
13,
1678,
5174,
11374,
2392,
29901,
13,
4706,
736,
29871,
29900,
13,
13,
1990,
315,
5966,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11561,
3535,
29892,
921,
29922,
29900,
29892,
343,
29922,
29900,
29892,
15414,
29922,
29900,
29892,
13475,
29922,
29896,
1125,
13,
4706,
1583,
29889,
18137,
3535,
353,
11561,
3535,
13,
4706,
1583,
29889,
29916,
353,
921,
13,
4706,
1583,
29889,
29891,
353,
343,
13,
4706,
1583,
29889,
8235,
353,
15414,
13,
4706,
1583,
29889,
4518,
353,
13475,
13,
13,
1678,
822,
1196,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
29889,
18137,
3535,
29961,
1311,
29889,
29891,
29962,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
736,
6213,
13,
13,
1678,
822,
775,
29898,
1311,
1125,
13,
4706,
1196,
353,
1583,
29889,
1220,
580,
13,
4706,
565,
1196,
338,
6213,
29901,
13,
9651,
736,
8521,
29896,
29892,
448,
29896,
29892,
448,
29896,
29897,
13,
4706,
1018,
29901,
13,
9651,
736,
1196,
29961,
1311,
29889,
29916,
29962,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
736,
8521,
29896,
29892,
448,
29896,
29892,
448,
29896,
29897,
13,
13,
1678,
822,
4337,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29916,
353,
1583,
29889,
29916,
718,
1583,
29889,
8235,
13,
4706,
1583,
29889,
29891,
353,
1583,
29889,
29891,
718,
1583,
29889,
4518,
13,
4706,
1196,
353,
1583,
29889,
1220,
580,
13,
4706,
2920,
353,
7431,
29898,
1220,
29897,
565,
1196,
338,
451,
6213,
1683,
29871,
29900,
13,
4706,
3171,
353,
7431,
29898,
1311,
29889,
18137,
3535,
29897,
13,
4706,
565,
1583,
29889,
29916,
529,
29871,
29900,
322,
1583,
29889,
8235,
529,
29871,
29900,
29901,
13,
9651,
1583,
29889,
29916,
353,
2920,
448,
29871,
29896,
13,
4706,
25342,
1583,
29889,
29916,
6736,
2920,
322,
1583,
29889,
8235,
1405,
29871,
29900,
29901,
13,
9651,
1583,
29889,
29916,
353,
29871,
29900,
13,
4706,
565,
1583,
29889,
29891,
529,
29871,
29900,
322,
1583,
29889,
4518,
529,
29871,
29900,
29901,
13,
9651,
1583,
29889,
29891,
353,
3171,
448,
29871,
29896,
13,
4706,
25342,
1583,
29889,
29891,
6736,
3171,
322,
1583,
29889,
4518,
1405,
29871,
29900,
29901,
13,
9651,
1583,
29889,
29891,
353,
29871,
29900,
13,
13,
1678,
822,
9432,
29898,
1311,
1125,
13,
4706,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
448,
1311,
29889,
8235,
29892,
448,
1311,
29889,
4518,
13,
13,
1678,
822,
2507,
29898,
1311,
29892,
775,
1125,
13,
4706,
565,
775,
1275,
29871,
29900,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
29871,
29896,
29892,
29871,
29900,
13,
4706,
25342,
775,
1275,
29871,
29906,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
29871,
29906,
29892,
29871,
29900,
13,
4706,
25342,
775,
1275,
29871,
29946,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
448,
29896,
29892,
29871,
29900,
13,
4706,
25342,
775,
1275,
29871,
29953,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
448,
29906,
29892,
29871,
29900,
13,
4706,
25342,
775,
1275,
29871,
29947,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
29871,
29900,
29892,
448,
29896,
13,
4706,
25342,
775,
1275,
29871,
29896,
29906,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
29871,
29900,
29892,
448,
29906,
13,
4706,
25342,
775,
1275,
29871,
29896,
29941,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
29871,
29900,
29892,
29871,
29896,
13,
4706,
25342,
775,
1275,
29871,
29896,
29955,
29901,
13,
9651,
1583,
29889,
8235,
29892,
1583,
29889,
4518,
353,
29871,
29900,
29892,
29871,
29906,
13,
4706,
25342,
775,
1275,
29871,
29896,
29947,
29901,
13,
9651,
1583,
29889,
4518,
353,
448,
1311,
29889,
4518,
13,
4706,
25342,
775,
1275,
29871,
29896,
29929,
29901,
13,
9651,
1583,
29889,
13191,
580,
13,
4706,
25342,
775,
1275,
29871,
29906,
29900,
29901,
13,
9651,
1583,
29889,
8235,
353,
448,
1311,
29889,
8235,
13,
13,
1990,
26162,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
1761,
353,
5159,
13,
1678,
822,
4770,
2435,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
2798,
580,
13,
1678,
822,
2302,
29898,
1311,
1125,
13,
4706,
736,
7431,
29898,
1311,
29889,
1761,
29897,
13,
1678,
822,
5503,
29898,
1311,
29892,
995,
1125,
13,
4706,
1583,
29889,
1761,
29889,
4397,
29898,
1767,
29897,
13,
1678,
822,
3638,
29898,
1311,
29892,
304,
1125,
13,
4706,
304,
29889,
5910,
29898,
1311,
29889,
7323,
3101,
13,
1678,
822,
1835,
29898,
1311,
1125,
13,
4706,
736,
29871,
29900,
13,
1678,
822,
7929,
29898,
1311,
1125,
13,
4706,
1209,
13,
1678,
822,
17945,
29898,
1311,
1125,
13,
4706,
1209,
13,
13,
1990,
10292,
29898,
10486,
1125,
13,
1678,
822,
1835,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
29889,
1761,
29889,
7323,
580,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
736,
29871,
29900,
13,
1678,
822,
7929,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1761,
29889,
4397,
29898,
1311,
29889,
1761,
14352,
29896,
2314,
13,
1678,
822,
17945,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1761,
14352,
29896,
1402,
1583,
29889,
1761,
14352,
29906,
29962,
353,
1583,
29889,
1761,
14352,
29906,
1402,
1583,
29889,
1761,
14352,
29896,
29962,
13,
13,
1990,
5462,
434,
29898,
10486,
1125,
13,
1678,
822,
1835,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
29889,
1761,
29889,
7323,
29898,
29900,
29897,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
736,
29871,
29900,
13,
1678,
822,
7929,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1761,
29889,
7851,
29898,
29900,
29892,
1583,
29889,
1761,
29961,
29900,
2314,
13,
1678,
822,
17945,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1761,
29961,
29900,
1402,
1583,
29889,
1761,
29961,
29896,
29962,
353,
1583,
29889,
1761,
29961,
29896,
1402,
1583,
29889,
1761,
29961,
29900,
29962,
13,
13,
1990,
6189,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11561,
3535,
1125,
13,
4706,
1583,
29889,
18127,
353,
315,
5966,
29898,
18137,
3535,
29897,
13,
4706,
1583,
29889,
28957,
1179,
353,
518,
13,
9651,
5462,
434,
580,
565,
921,
1275,
29871,
29906,
29896,
470,
921,
1275,
29871,
29906,
29955,
1683,
10292,
580,
13,
9651,
363,
921,
297,
3464,
29898,
29906,
29947,
29897,
13,
4706,
4514,
13,
4706,
1583,
29889,
2622,
29918,
12925,
29898,
29900,
29897,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
1583,
29889,
18821,
403,
29918,
15581,
353,
7700,
13,
4706,
1550,
451,
1583,
29889,
18821,
403,
29918,
15581,
29901,
13,
9651,
1583,
29889,
10568,
580,
13,
4706,
1018,
29901,
13,
9651,
12020,
319,
354,
1481,
24365,
29898,
1311,
29889,
3784,
29918,
12925,
29889,
7323,
3101,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
12020,
319,
354,
1481,
24365,
29898,
29900,
29897,
13,
13,
1678,
822,
4331,
29898,
1311,
1125,
13,
4706,
3060,
29892,
432,
686,
29892,
432,
549,
353,
1583,
29889,
18127,
29889,
401,
580,
13,
4706,
5858,
353,
679,
29918,
16453,
29898,
1859,
29897,
13,
4706,
1583,
29889,
18127,
29889,
685,
29898,
29926,
686,
29897,
13,
4706,
565,
1583,
29889,
3784,
29918,
12925,
29889,
2798,
580,
529,
679,
29918,
15501,
29918,
12403,
29898,
1859,
1125,
13,
9651,
1583,
29889,
18127,
29889,
13191,
580,
13,
4706,
1683,
29901,
13,
9651,
5858,
29898,
1311,
29892,
432,
549,
29897,
13,
4706,
1583,
29889,
18127,
29889,
11631,
580,
13,
13,
1678,
822,
679,
29918,
12925,
29898,
1311,
29892,
775,
1125,
13,
4706,
736,
1583,
29889,
28957,
1179,
29961,
401,
29962,
13,
13,
1678,
822,
1831,
29918,
12925,
29898,
1311,
29892,
775,
1125,
13,
4706,
1583,
29889,
3784,
29918,
12925,
353,
1583,
29889,
657,
29918,
12925,
29898,
401,
29897,
13,
13,
1990,
319,
354,
1481,
24365,
29898,
2451,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
6876,
29918,
401,
1125,
13,
4706,
1583,
29889,
401,
353,
6876,
29918,
401,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
376,
29909,
354,
1481,
4933,
29185,
411,
6876,
775,
29901,
376,
718,
851,
29898,
1311,
29889,
401,
29897,
13,
13,
1753,
6597,
29918,
2248,
29898,
9891,
1125,
13,
1678,
822,
6597,
272,
29898,
401,
1125,
13,
4706,
565,
29871,
29900,
29916,
562,
29900,
29900,
5277,
775,
5277,
29871,
29900,
29916,
29881,
29955,
29874,
29941,
29901,
13,
9651,
736,
3653,
29898,
401,
448,
29871,
29900,
29916,
562,
29900,
29900,
29897,
13,
4706,
736,
448,
29896,
13,
1678,
736,
6597,
272,
13,
13,
29992,
21111,
29918,
2248,
13,
1753,
679,
29918,
1859,
29898,
29879,
15114,
519,
29918,
401,
1125,
13,
1678,
736,
9878,
645,
519,
29918,
401,
849,
29871,
29945,
29947,
29947,
13,
13,
29992,
21111,
29918,
2248,
13,
1753,
679,
29918,
29926,
686,
29898,
29879,
15114,
519,
29918,
401,
1125,
13,
1678,
736,
313,
29879,
15114,
519,
29918,
401,
849,
29871,
29906,
29947,
29897,
1273,
29871,
29906,
29896,
13,
13,
29992,
21111,
29918,
2248,
13,
1753,
679,
29918,
29926,
549,
29898,
29879,
15114,
519,
29918,
401,
1125,
13,
1678,
736,
9878,
645,
519,
29918,
401,
1273,
29871,
29906,
29947,
13,
13,
1753,
6088,
29898,
401,
1125,
13,
1678,
1121,
353,
5159,
13,
1678,
1196,
353,
5159,
13,
1678,
363,
1373,
297,
775,
29901,
13,
4706,
565,
1373,
1275,
318,
26732,
29878,
1115,
13,
9651,
6773,
13,
4706,
25342,
1373,
1275,
318,
26732,
29876,
1115,
13,
9651,
1121,
29889,
4397,
29898,
1220,
29897,
13,
9651,
1196,
353,
5159,
13,
4706,
1683,
29901,
13,
9651,
1373,
401,
353,
4356,
29898,
3090,
29897,
13,
9651,
1196,
29889,
4397,
29898,
13,
18884,
313,
657,
29918,
1859,
29898,
3090,
401,
511,
13,
462,
679,
29918,
29926,
686,
29898,
3090,
401,
511,
13,
462,
679,
29918,
29926,
549,
29898,
3090,
401,
4961,
13,
1678,
1121,
29889,
4397,
29898,
1220,
29897,
13,
1678,
736,
1121,
13,
13,
1753,
1303,
29918,
18609,
7295,
13,
1678,
6262,
353,
5124,
13,
1678,
1550,
5852,
29901,
13,
4706,
7023,
353,
2897,
29889,
949,
29898,
29900,
29892,
29871,
29896,
29897,
13,
4706,
565,
7431,
29898,
10389,
29897,
1275,
29871,
29900,
29901,
13,
9651,
2867,
13,
4706,
6262,
353,
6262,
718,
7023,
13,
4706,
1018,
29901,
13,
9651,
1373,
353,
6262,
29889,
13808,
703,
9420,
29899,
29947,
1159,
29961,
29900,
29962,
13,
9651,
1373,
401,
353,
4356,
29898,
3090,
29897,
13,
9651,
565,
313,
2435,
29898,
13193,
29897,
2804,
29871,
29896,
322,
1373,
401,
1275,
29871,
29900,
470,
13,
18884,
4356,
29898,
10389,
29961,
29900,
2314,
2804,
1373,
401,
1275,
29871,
29900,
1125,
13,
18884,
6773,
13,
9651,
1683,
29901,
13,
18884,
736,
1373,
13,
4706,
5174,
23862,
2392,
29901,
13,
9651,
1209,
13,
1678,
736,
318,
26732,
29916,
29900,
29900,
29908,
29961,
29900,
29962,
13,
13,
1753,
263,
354,
1481,
29918,
4537,
29918,
2080,
7295,
13,
1678,
18392,
353,
5124,
13,
1678,
1833,
353,
448,
29896,
13,
1678,
1550,
5852,
29901,
13,
4706,
1373,
353,
1303,
29918,
18609,
580,
13,
4706,
1373,
401,
353,
4356,
29898,
3090,
29897,
13,
4706,
565,
313,
3090,
401,
1275,
29871,
29900,
470,
1373,
401,
1275,
29871,
29896,
29900,
470,
13,
9651,
1373,
401,
1275,
29871,
29896,
29941,
470,
1373,
401,
1275,
29871,
29941,
29906,
1125,
13,
9651,
736,
1833,
13,
4706,
18392,
353,
18392,
718,
851,
29898,
3090,
29897,
13,
4706,
1018,
29901,
13,
9651,
1833,
353,
938,
29898,
9721,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
736,
1833,
13,
13,
1753,
263,
354,
1481,
29918,
18609,
29918,
2080,
7295,
13,
1678,
736,
4356,
29898,
949,
29918,
18609,
3101,
13,
13,
1753,
263,
354,
1481,
29918,
4905,
29898,
1767,
1125,
13,
1678,
2897,
29889,
3539,
29898,
29896,
29892,
995,
29889,
12508,
703,
9420,
29899,
29947,
5783,
13,
13,
1753,
6251,
29918,
3149,
29898,
19218,
1125,
13,
1678,
10422,
353,
1852,
29894,
29961,
29896,
29962,
13,
1678,
285,
29886,
353,
2897,
29889,
3150,
29898,
9507,
29892,
2897,
29889,
29949,
29918,
29934,
29928,
1164,
16786,
29892,
29871,
29900,
29955,
29955,
29955,
29897,
13,
1678,
775,
353,
5124,
13,
1678,
1550,
5852,
29901,
13,
4706,
1303,
353,
2897,
29889,
949,
29898,
18091,
29892,
29871,
29946,
29900,
29929,
29953,
29897,
13,
4706,
565,
7431,
29898,
949,
29897,
1275,
29871,
29900,
29901,
13,
9651,
2867,
13,
4706,
775,
4619,
1303,
13,
1678,
775,
353,
775,
29889,
13808,
703,
9420,
29899,
29947,
1159,
13,
1678,
4933,
353,
6189,
29898,
5510,
29898,
401,
876,
13,
1678,
4933,
29889,
4537,
29918,
2080,
353,
263,
354,
1481,
29918,
4537,
29918,
2080,
13,
1678,
4933,
29889,
18609,
29918,
2080,
353,
263,
354,
1481,
29918,
18609,
29918,
2080,
13,
1678,
4933,
29889,
4905,
353,
263,
354,
1481,
29918,
4905,
13,
1678,
1018,
29901,
13,
4706,
4933,
29889,
3389,
580,
13,
1678,
5174,
319,
354,
1481,
24365,
408,
321,
29901,
13,
4706,
736,
321,
29889,
401,
13,
1678,
736,
29871,
29900,
13,
13,
1753,
3646,
10456,
5085,
1125,
13,
1678,
736,
6251,
29918,
3149,
29892,
6213,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
6251,
29918,
3149,
29898,
9675,
29889,
19218,
29897,
13,
2
] |
electrum/dnssec.py | Jesusown/electrum | 5,905 | 321 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Check DNSSEC trust chain.
# Todo: verify expiration dates
#
# Based on
# http://backreference.org/2010/11/17/dnssec-verification-with-dig/
# https://github.com/rthalley/dnspython/blob/master/tests/test_dnssec.py
import dns
import dns.name
import dns.query
import dns.dnssec
import dns.message
import dns.resolver
import dns.rdatatype
import dns.rdtypes.ANY.NS
import dns.rdtypes.ANY.CNAME
import dns.rdtypes.ANY.DLV
import dns.rdtypes.ANY.DNSKEY
import dns.rdtypes.ANY.DS
import dns.rdtypes.ANY.NSEC
import dns.rdtypes.ANY.NSEC3
import dns.rdtypes.ANY.NSEC3PARAM
import dns.rdtypes.ANY.RRSIG
import dns.rdtypes.ANY.SOA
import dns.rdtypes.ANY.TXT
import dns.rdtypes.IN.A
import dns.rdtypes.IN.AAAA
from .logging import get_logger
_logger = get_logger(__name__)
# hard-coded trust anchors (root KSKs)
trust_anchors = [
# KSK-2017:
dns.rrset.from_text('.', 1 , 'IN', 'DNSKEY', '<KEY>),
# KSK-2010:
dns.rrset.from_text('.', 15202, 'IN', 'DNSKEY', '257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjF FVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoX bfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaD X6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpz W<KEY>S Qageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulq QxA+Uk1ihz0='),
]
def _check_query(ns, sub, _type, keys):
q = dns.message.make_query(sub, _type, want_dnssec=True)
response = dns.query.tcp(q, ns, timeout=5)
assert response.rcode() == 0, 'No answer'
answer = response.answer
assert len(answer) != 0, ('No DNS record found', sub, _type)
assert len(answer) != 1, ('No DNSSEC record found', sub, _type)
if answer[0].rdtype == dns.rdatatype.RRSIG:
rrsig, rrset = answer
elif answer[1].rdtype == dns.rdatatype.RRSIG:
rrset, rrsig = answer
else:
raise Exception('No signature set in record')
if keys is None:
keys = {dns.name.from_text(sub):rrset}
dns.dnssec.validate(rrset, rrsig, keys)
return rrset
def _get_and_validate(ns, url, _type):
# get trusted root key
root_rrset = None
for dnskey_rr in trust_anchors:
try:
# Check if there is a valid signature for the root dnskey
root_rrset = _check_query(ns, '', dns.rdatatype.DNSKEY, {dns.name.root: dnskey_rr})
break
except dns.dnssec.ValidationFailure:
# It's OK as long as one key validates
continue
if not root_rrset:
raise dns.dnssec.ValidationFailure('None of the trust anchors found in DNS')
keys = {dns.name.root: root_rrset}
# top-down verification
parts = url.split('.')
for i in range(len(parts), 0, -1):
sub = '.'.join(parts[i-1:])
name = dns.name.from_text(sub)
# If server is authoritative, don't fetch DNSKEY
query = dns.message.make_query(sub, dns.rdatatype.NS)
response = dns.query.udp(query, ns, 3)
assert response.rcode() == dns.rcode.NOERROR, "query error"
rrset = response.authority[0] if len(response.authority) > 0 else response.answer[0]
rr = rrset[0]
if rr.rdtype == dns.rdatatype.SOA:
continue
# get DNSKEY (self-signed)
rrset = _check_query(ns, sub, dns.rdatatype.DNSKEY, None)
# get DS (signed by parent)
ds_rrset = _check_query(ns, sub, dns.rdatatype.DS, keys)
# verify that a signed DS validates DNSKEY
for ds in ds_rrset:
for dnskey in rrset:
htype = 'SHA256' if ds.digest_type == 2 else 'SHA1'
good_ds = dns.dnssec.make_ds(name, dnskey, htype)
if ds == good_ds:
break
else:
continue
break
else:
raise Exception("DS does not match DNSKEY")
# set key for next iteration
keys = {name: rrset}
# get TXT record (signed by zone)
rrset = _check_query(ns, url, _type, keys)
return rrset
def query(url, rtype):
# 8.8.8.8 is Google's public DNS server
nameservers = ['8.8.8.8']
ns = nameservers[0]
try:
out = _get_and_validate(ns, url, rtype)
validated = True
except Exception as e:
_logger.info(f"DNSSEC error: {repr(e)}")
out = dns.resolver.resolve(url, rtype)
validated = False
return out, validated
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
13,
29937,
10513,
5848,
448,
3578,
7915,
18531,
1111,
262,
3132,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29945,
529,
5813,
29958,
13,
29937,
13,
29937,
20894,
2333,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
13,
29937,
4017,
292,
263,
3509,
310,
445,
7047,
322,
6942,
5106,
2066,
13,
29937,
313,
1552,
376,
6295,
14093,
4968,
304,
5376,
297,
278,
18540,
1728,
24345,
29892,
13,
29937,
3704,
1728,
29485,
278,
10462,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
13,
29937,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
14591,
310,
278,
18540,
29892,
13,
29937,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
15252,
3276,
304,
437,
577,
29892,
13,
29937,
4967,
304,
278,
1494,
5855,
29901,
13,
29937,
13,
29937,
450,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
13,
29937,
5134,
297,
599,
14591,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
29937,
13,
29937,
6093,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
13,
29937,
8528,
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,
29937,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
13,
29937,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
13,
29937,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
13,
29937,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
19474,
8079,
6323,
2672,
13,
29937,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
6093,
13,
29937,
7791,
7818,
12982,
1525,
29889,
13,
13,
29937,
5399,
16332,
1660,
29907,
9311,
9704,
29889,
13,
29937,
7561,
29877,
29901,
11539,
1518,
12232,
10116,
13,
29937,
13,
29937,
16564,
373,
13,
29937,
29871,
1732,
597,
1627,
5679,
29889,
990,
29914,
29906,
29900,
29896,
29900,
29914,
29896,
29896,
29914,
29896,
29955,
29914,
29881,
1983,
3471,
29899,
369,
2450,
29899,
2541,
29899,
7501,
29914,
13,
29937,
29871,
2045,
597,
3292,
29889,
510,
29914,
29878,
386,
284,
2330,
29914,
5200,
1028,
1656,
29914,
10054,
29914,
6207,
29914,
21150,
29914,
1688,
29918,
29881,
1983,
3471,
29889,
2272,
13,
13,
13,
5215,
270,
1983,
13,
5215,
270,
1983,
29889,
978,
13,
5215,
270,
1983,
29889,
1972,
13,
5215,
270,
1983,
29889,
29881,
1983,
3471,
13,
5215,
270,
1983,
29889,
4906,
13,
5215,
270,
1983,
29889,
9778,
369,
13,
5215,
270,
1983,
29889,
29878,
4130,
23179,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
3059,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29907,
5813,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
19558,
29963,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29928,
3059,
10818,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
8452,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29940,
1660,
29907,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29940,
1660,
29907,
29941,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29940,
1660,
29907,
29941,
16320,
5194,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29934,
29934,
5425,
29954,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
6156,
29909,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
2190,
29979,
29889,
29911,
12188,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
1177,
29889,
29909,
13,
5215,
270,
1983,
29889,
5499,
8768,
29889,
1177,
29889,
23184,
13,
13,
3166,
869,
21027,
1053,
679,
29918,
21707,
13,
13,
13,
29918,
21707,
353,
679,
29918,
21707,
22168,
978,
1649,
29897,
13,
13,
13,
29937,
2898,
29899,
29659,
9311,
23791,
943,
313,
4632,
476,
16033,
29879,
29897,
13,
509,
504,
29918,
14588,
943,
353,
518,
13,
1678,
396,
476,
16033,
29899,
29906,
29900,
29896,
29955,
29901,
13,
1678,
270,
1983,
29889,
21478,
842,
29889,
3166,
29918,
726,
12839,
742,
29871,
29896,
1678,
1919,
525,
1177,
742,
525,
29928,
3059,
10818,
742,
12801,
10818,
29958,
511,
13,
1678,
396,
476,
16033,
29899,
29906,
29900,
29896,
29900,
29901,
13,
1678,
270,
1983,
29889,
21478,
842,
29889,
3166,
29918,
726,
12839,
742,
29871,
29896,
29945,
29906,
29900,
29906,
29892,
525,
1177,
742,
525,
29928,
3059,
10818,
742,
525,
29906,
29945,
29955,
29871,
29941,
29871,
29947,
22886,
29923,
6344,
351,
29909,
23328,
29880,
29963,
29999,
19080,
29907,
29953,
29902,
29874,
29955,
29887,
29923,
29920,
801,
1955,
29974,
29929,
29956,
29906,
29929,
29872,
1314,
29882,
29967,
29882,
29963,
29963,
3927,
29891,
29984,
29890,
1660,
29956,
29900,
29949,
29947,
27354,
29907,
29926,
29943,
383,
29963,
29984,
2692,
29888,
29953,
29894,
29945,
29947,
29888,
29931,
29926,
29893,
29933,
29881,
29900,
29979,
29902,
29900,
29923,
29920,
29878,
10644,
29984,
29939,
29933,
8766,
17599,
29914,
29934,
855,
29902,
29877,
29949,
29947,
29887,
29900,
29940,
9144,
29888,
29931,
29906,
11490,
29967,
29934,
29895,
29916,
29877,
29990,
289,
29888,
27838,
29965,
29872,
18510,
2182,
29979,
29923,
29882,
29887,
29941,
29955,
29940,
29999,
12982,
29967,
29984,
29929,
29963,
29876,
29924,
10699,
29916,
29925,
29914,
29963,
15444,
29946,
29929,
29953,
29924,
29914,
29984,
29999,
29916,
29895,
29926,
29888,
29945,
29914,
29923,
29888,
1682,
29886,
29906,
3249,
29928,
1060,
29953,
12445,
29953,
29907,
29990,
1129,
29979,
29953,
29947,
29931,
4501,
29925,
29963,
29926,
29934,
29900,
29999,
10840,
5617,
29896,
481,
16748,
29894,
29940,
29929,
11671,
29920,
29923,
354,
29990,
29955,
2965,
29967,
14388,
9161,
29909,
29953,
29954,
29941,
29931,
29984,
29886,
29920,
399,
29966,
10818,
29958,
29903,
660,
482,
29884,
29974,
666,
3253,
19988,
29967,
29906,
29945,
2887,
29934,
6040,
283,
29890,
29947,
20614,
29883,
29931,
28466,
29878,
6833,
2241,
26067,
29925,
29896,
2176,
1332,
29979,
29933,
29946,
29940,
29955,
3959,
29940,
29876,
352,
29939,
660,
29916,
29909,
29974,
29965,
29895,
29896,
4861,
29920,
29900,
2433,
511,
13,
29962,
13,
13,
13,
1753,
903,
3198,
29918,
1972,
29898,
1983,
29892,
1014,
29892,
903,
1853,
29892,
6611,
1125,
13,
1678,
3855,
353,
270,
1983,
29889,
4906,
29889,
5675,
29918,
1972,
29898,
1491,
29892,
903,
1853,
29892,
864,
29918,
29881,
1983,
3471,
29922,
5574,
29897,
13,
1678,
2933,
353,
270,
1983,
29889,
1972,
29889,
23981,
29898,
29939,
29892,
17534,
29892,
11815,
29922,
29945,
29897,
13,
1678,
4974,
2933,
29889,
29878,
401,
580,
1275,
29871,
29900,
29892,
525,
3782,
1234,
29915,
13,
1678,
1234,
353,
2933,
29889,
12011,
13,
1678,
4974,
7431,
29898,
12011,
29897,
2804,
29871,
29900,
29892,
6702,
3782,
16332,
2407,
1476,
742,
1014,
29892,
903,
1853,
29897,
13,
1678,
4974,
7431,
29898,
12011,
29897,
2804,
29871,
29896,
29892,
6702,
3782,
16332,
1660,
29907,
2407,
1476,
742,
1014,
29892,
903,
1853,
29897,
13,
1678,
565,
1234,
29961,
29900,
1822,
5499,
1853,
1275,
270,
1983,
29889,
29878,
4130,
23179,
29889,
29934,
29934,
5425,
29954,
29901,
13,
4706,
364,
2288,
335,
29892,
364,
29878,
842,
353,
1234,
13,
1678,
25342,
1234,
29961,
29896,
1822,
5499,
1853,
1275,
270,
1983,
29889,
29878,
4130,
23179,
29889,
29934,
29934,
5425,
29954,
29901,
13,
4706,
364,
29878,
842,
29892,
364,
2288,
335,
353,
1234,
13,
1678,
1683,
29901,
13,
4706,
12020,
8960,
877,
3782,
12608,
731,
297,
2407,
1495,
13,
1678,
565,
6611,
338,
6213,
29901,
13,
4706,
6611,
353,
426,
29881,
1983,
29889,
978,
29889,
3166,
29918,
726,
29898,
1491,
1125,
21478,
842,
29913,
13,
1678,
270,
1983,
29889,
29881,
1983,
3471,
29889,
15480,
29898,
21478,
842,
29892,
364,
2288,
335,
29892,
6611,
29897,
13,
1678,
736,
364,
29878,
842,
13,
13,
13,
1753,
903,
657,
29918,
392,
29918,
15480,
29898,
1983,
29892,
3142,
29892,
903,
1853,
1125,
13,
1678,
396,
679,
9311,
287,
3876,
1820,
13,
1678,
3876,
29918,
21478,
842,
353,
6213,
13,
1678,
363,
270,
1983,
1989,
29918,
21478,
297,
9311,
29918,
14588,
943,
29901,
13,
4706,
1018,
29901,
13,
9651,
396,
5399,
565,
727,
338,
263,
2854,
12608,
363,
278,
3876,
270,
1983,
1989,
13,
9651,
3876,
29918,
21478,
842,
353,
903,
3198,
29918,
1972,
29898,
1983,
29892,
15516,
270,
1983,
29889,
29878,
4130,
23179,
29889,
29928,
3059,
10818,
29892,
426,
29881,
1983,
29889,
978,
29889,
4632,
29901,
270,
1983,
1989,
29918,
21478,
1800,
13,
9651,
2867,
13,
4706,
5174,
270,
1983,
29889,
29881,
1983,
3471,
29889,
19448,
24155,
29901,
13,
9651,
396,
739,
29915,
29879,
9280,
408,
1472,
408,
697,
1820,
2854,
1078,
13,
9651,
6773,
13,
1678,
565,
451,
3876,
29918,
21478,
842,
29901,
13,
4706,
12020,
270,
1983,
29889,
29881,
1983,
3471,
29889,
19448,
24155,
877,
8516,
310,
278,
9311,
23791,
943,
1476,
297,
16332,
1495,
13,
1678,
6611,
353,
426,
29881,
1983,
29889,
978,
29889,
4632,
29901,
3876,
29918,
21478,
842,
29913,
13,
1678,
396,
2246,
29899,
3204,
1147,
2450,
13,
1678,
5633,
353,
3142,
29889,
5451,
12839,
1495,
13,
1678,
363,
474,
297,
3464,
29898,
2435,
29898,
20895,
511,
29871,
29900,
29892,
448,
29896,
1125,
13,
4706,
1014,
353,
15300,
4286,
7122,
29898,
20895,
29961,
29875,
29899,
29896,
29901,
2314,
13,
4706,
1024,
353,
270,
1983,
29889,
978,
29889,
3166,
29918,
726,
29898,
1491,
29897,
13,
4706,
396,
960,
1923,
338,
4148,
23378,
29892,
1016,
29915,
29873,
6699,
16332,
10818,
13,
4706,
2346,
353,
270,
1983,
29889,
4906,
29889,
5675,
29918,
1972,
29898,
1491,
29892,
270,
1983,
29889,
29878,
4130,
23179,
29889,
3059,
29897,
13,
4706,
2933,
353,
270,
1983,
29889,
1972,
29889,
566,
29886,
29898,
1972,
29892,
17534,
29892,
29871,
29941,
29897,
13,
4706,
4974,
2933,
29889,
29878,
401,
580,
1275,
270,
1983,
29889,
29878,
401,
29889,
6632,
11432,
29892,
376,
1972,
1059,
29908,
13,
4706,
364,
29878,
842,
353,
2933,
29889,
8921,
537,
29961,
29900,
29962,
565,
7431,
29898,
5327,
29889,
8921,
537,
29897,
1405,
29871,
29900,
1683,
2933,
29889,
12011,
29961,
29900,
29962,
13,
4706,
364,
29878,
353,
364,
29878,
842,
29961,
29900,
29962,
13,
4706,
565,
364,
29878,
29889,
5499,
1853,
1275,
270,
1983,
29889,
29878,
4130,
23179,
29889,
6156,
29909,
29901,
13,
9651,
6773,
13,
4706,
396,
679,
16332,
10818,
313,
1311,
29899,
7433,
29897,
13,
4706,
364,
29878,
842,
353,
903,
3198,
29918,
1972,
29898,
1983,
29892,
1014,
29892,
270,
1983,
29889,
29878,
4130,
23179,
29889,
29928,
3059,
10818,
29892,
6213,
29897,
13,
4706,
396,
679,
360,
29903,
313,
7433,
491,
3847,
29897,
13,
4706,
18031,
29918,
21478,
842,
353,
903,
3198,
29918,
1972,
29898,
1983,
29892,
1014,
29892,
270,
1983,
29889,
29878,
4130,
23179,
29889,
8452,
29892,
6611,
29897,
13,
4706,
396,
11539,
393,
263,
8794,
360,
29903,
2854,
1078,
16332,
10818,
13,
4706,
363,
18031,
297,
18031,
29918,
21478,
842,
29901,
13,
9651,
363,
270,
1983,
1989,
297,
364,
29878,
842,
29901,
13,
18884,
298,
1853,
353,
525,
23498,
29906,
29945,
29953,
29915,
565,
18031,
29889,
7501,
342,
29918,
1853,
1275,
29871,
29906,
1683,
525,
23498,
29896,
29915,
13,
18884,
1781,
29918,
6289,
353,
270,
1983,
29889,
29881,
1983,
3471,
29889,
5675,
29918,
6289,
29898,
978,
29892,
270,
1983,
1989,
29892,
298,
1853,
29897,
13,
18884,
565,
18031,
1275,
1781,
29918,
6289,
29901,
13,
462,
1678,
2867,
13,
9651,
1683,
29901,
13,
18884,
6773,
13,
9651,
2867,
13,
4706,
1683,
29901,
13,
9651,
12020,
8960,
703,
8452,
947,
451,
1993,
16332,
10818,
1159,
13,
4706,
396,
731,
1820,
363,
2446,
12541,
13,
4706,
6611,
353,
426,
978,
29901,
364,
29878,
842,
29913,
13,
1678,
396,
679,
323,
12188,
2407,
313,
7433,
491,
10640,
29897,
13,
1678,
364,
29878,
842,
353,
903,
3198,
29918,
1972,
29898,
1983,
29892,
3142,
29892,
903,
1853,
29892,
6611,
29897,
13,
1678,
736,
364,
29878,
842,
13,
13,
13,
1753,
2346,
29898,
2271,
29892,
364,
1853,
1125,
13,
1678,
396,
29871,
29947,
29889,
29947,
29889,
29947,
29889,
29947,
338,
5087,
29915,
29879,
970,
16332,
1923,
13,
1678,
2983,
261,
874,
353,
6024,
29947,
29889,
29947,
29889,
29947,
29889,
29947,
2033,
13,
1678,
17534,
353,
2983,
261,
874,
29961,
29900,
29962,
13,
1678,
1018,
29901,
13,
4706,
714,
353,
903,
657,
29918,
392,
29918,
15480,
29898,
1983,
29892,
3142,
29892,
364,
1853,
29897,
13,
4706,
2854,
630,
353,
5852,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
903,
21707,
29889,
3888,
29898,
29888,
29908,
29928,
3059,
1660,
29907,
1059,
29901,
426,
276,
558,
29898,
29872,
2915,
1159,
13,
4706,
714,
353,
270,
1983,
29889,
9778,
369,
29889,
17863,
29898,
2271,
29892,
364,
1853,
29897,
13,
4706,
2854,
630,
353,
7700,
13,
1678,
736,
714,
29892,
2854,
630,
13,
2
] |
arni_countermeasure/src/arni_countermeasure/reaction_publish_rosout_node.py | UTNuclearRobotics/arni | 16 | 49791 | from reaction import *
import rospy
class ReactionPublishRosOutNode(Reaction):
"""A reaction that is able to publish a message on rosout."""
def __init__(self, autonomy_level, message, loglevel):
super(ReactionPublishRosOutNode, self).__init__(None, autonomy_level)
#: The message to publish.
#: :type: string
self._message = message
if loglevel == "info":
log = rospy.loginfo
elif loglevel == "debug":
log = rospy.logdebug
elif loglevel == "err":
log = rospy.logerr
elif loglevel == "warn":
log = rospy.logwarn
elif loglevel == "fatal":
log = rospy.logfatal
else:
# loglevel does not make sense
rospy.logwarn(
"A reaction wants to log on loglevel"
+ " '%s', but that loglevel does not exist." % loglevel
+ " Setting loglevel to info.")
log = rospy.info
#: The logging function to use.
self.__log = log
def execute_reaction(self):
"""Log the reaction message at a specific loglevel."""
self.__log(self._message)
| [
1,
515,
19848,
1053,
334,
13,
5215,
696,
1028,
29891,
13,
13,
13,
1990,
830,
2467,
21076,
1674,
29934,
359,
3744,
4247,
29898,
1123,
2467,
1125,
13,
13,
1678,
9995,
29909,
19848,
393,
338,
2221,
304,
9805,
263,
2643,
373,
14652,
449,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1120,
21926,
29918,
5563,
29892,
2643,
29892,
1480,
5563,
1125,
13,
4706,
2428,
29898,
1123,
2467,
21076,
1674,
29934,
359,
3744,
4247,
29892,
1583,
467,
1649,
2344,
12035,
8516,
29892,
1120,
21926,
29918,
5563,
29897,
13,
13,
4706,
396,
29901,
450,
2643,
304,
9805,
29889,
13,
4706,
396,
29901,
584,
1853,
29901,
1347,
13,
4706,
1583,
3032,
4906,
353,
2643,
13,
13,
4706,
565,
1480,
5563,
1275,
376,
3888,
1115,
13,
9651,
1480,
353,
696,
1028,
29891,
29889,
1188,
3888,
13,
4706,
25342,
1480,
5563,
1275,
376,
8382,
1115,
13,
9651,
1480,
353,
696,
1028,
29891,
29889,
1188,
8382,
13,
4706,
25342,
1480,
5563,
1275,
376,
3127,
1115,
13,
9651,
1480,
353,
696,
1028,
29891,
29889,
417,
914,
29878,
13,
4706,
25342,
1480,
5563,
1275,
376,
25442,
1115,
13,
9651,
1480,
353,
696,
1028,
29891,
29889,
1188,
25442,
13,
4706,
25342,
1480,
5563,
1275,
376,
29888,
2075,
1115,
13,
9651,
1480,
353,
696,
1028,
29891,
29889,
1188,
29888,
2075,
13,
4706,
1683,
29901,
13,
9651,
396,
1480,
5563,
947,
451,
1207,
4060,
13,
9651,
696,
1028,
29891,
29889,
1188,
25442,
29898,
13,
18884,
376,
29909,
19848,
10753,
304,
1480,
373,
1480,
5563,
29908,
13,
18884,
718,
376,
14210,
29879,
742,
541,
393,
1480,
5563,
947,
451,
1863,
1213,
1273,
1480,
5563,
13,
18884,
718,
376,
21605,
1480,
5563,
304,
5235,
23157,
13,
9651,
1480,
353,
696,
1028,
29891,
29889,
3888,
13,
13,
4706,
396,
29901,
450,
12183,
740,
304,
671,
29889,
13,
4706,
1583,
17255,
1188,
353,
1480,
13,
13,
1678,
822,
6222,
29918,
276,
2467,
29898,
1311,
1125,
13,
4706,
9995,
3403,
278,
19848,
2643,
472,
263,
2702,
1480,
5563,
1213,
15945,
13,
4706,
1583,
17255,
1188,
29898,
1311,
3032,
4906,
29897,
13,
2
] |
src/surfclass/__init__.py | plimkilde/surfclass | 3 | 152194 | """Process LiDAR data into a surface clasified raster."""
from collections import namedtuple
__version__ = "0.0.1"
__description__ = "Processes Lidar-Data into a surface classified raster"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__uri__ = "https://github.com/septima/surfclass"
__license__ = "Licensed under the MIT license"
Bbox = namedtuple("Bbox", ["xmin", "ymin", "xmax", "ymax"])
| [
1,
9995,
7032,
2718,
29928,
1718,
848,
964,
263,
7101,
22215,
2164,
364,
1901,
1213,
15945,
13,
3166,
16250,
1053,
4257,
23583,
13,
13,
1649,
3259,
1649,
353,
376,
29900,
29889,
29900,
29889,
29896,
29908,
13,
1649,
8216,
1649,
353,
376,
7032,
267,
365,
333,
279,
29899,
1469,
964,
263,
7101,
770,
2164,
364,
1901,
29908,
13,
1649,
8921,
1649,
353,
9872,
5813,
11903,
13,
1649,
5269,
1649,
353,
9872,
26862,
6227,
11903,
13,
1649,
5338,
1649,
353,
376,
991,
597,
3292,
29889,
510,
29914,
344,
415,
2946,
29914,
7610,
29888,
1990,
29908,
13,
1649,
506,
1947,
1649,
353,
376,
29931,
293,
21144,
1090,
278,
341,
1806,
19405,
29908,
13,
13,
29933,
1884,
353,
4257,
23583,
703,
29933,
1884,
613,
6796,
29916,
1195,
613,
376,
962,
262,
613,
376,
29916,
3317,
613,
376,
29891,
3317,
20068,
13,
2
] |
Curso de Desarrollo Web con Flask/Flask/example7.py | Emir-97/My-practices-with-Flask | 0 | 1604929 | <reponame>Emir-97/My-practices-with-Flask
import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
#SE CREA EL DIRECTORIO DE NUESTRO ARCHIVO PARA LA BASE DE DATOS
directory = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
#SE CONFIGURA LA BASE DE DATOS Y SE ESTABLECE PARA CREAR EL ALRCHIVO .sqlite
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(directory, 'data.sqlite')
#ESTEBLECEMOS QUE NO HABRÁ MODIFICACIONES EN NUESTRA BASE DE DATOS
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
#SE CREA LA BASE DE DATOS POR MEDIO DE UNA INSTANCIA DE LA CLASE SQLAlchemy CON PARAMETRO
# NUESTRA APP
dataBase = SQLAlchemy(app)
#SE UTILIZA ESTE MÉTODO Migrate PARA QUE SE PUEDAN ENVIAR LAS ACTUALIZACIONES CORRESPONDIENTES DE LA TABLA
# A LA BASE DE DATOS SIN NECESIDAD DE REHACERLA
Migrate(app, dataBase)
#SE CREA NUESTRA TABLA CON LOS DATOS QUE TENDRAN EN SUS COLUMNAS
class Person(dataBase.Model):
#SE ESTABLECE EL NOMBRE DE NUESTRA TABLA PERO NO ES NECESARIO YA
#QUE EL NOMBRE ESTABLECIDO EN LA class SERÍA EL DE NUESTRA TABLA
__tablename__ = 'Persons'
id = dataBase.Column(dataBase.Integer, primary_key = True)
name = dataBase.Column(dataBase.Text)
age = dataBase.Column(dataBase.Integer)
country = dataBase.Column(dataBase.Text)
def __init__(self, name, age, country):
self.name = name
self.age = age
self.country = country
def __repr__(self):
text = "Person: {} is {} from {}".format(self.name, self.age, self.country)
return text
| [
1,
529,
276,
1112,
420,
29958,
6026,
381,
29899,
29929,
29955,
29914,
3421,
29899,
29886,
1461,
1575,
29899,
2541,
29899,
8754,
1278,
13,
5215,
2897,
30004,
13,
3166,
29784,
1053,
2379,
1278,
30004,
13,
3166,
29784,
29918,
2850,
284,
305,
6764,
1053,
3758,
2499,
305,
6764,
30004,
13,
3166,
29784,
29918,
26983,
403,
1053,
341,
4481,
403,
30004,
13,
30004,
13,
29937,
1660,
315,
1525,
29909,
14845,
22471,
26282,
1955,
5971,
5012,
405,
4462,
1254,
1672,
9033,
3210,
5667,
29949,
349,
1718,
29909,
17900,
350,
8127,
5012,
27640,
3267,
30004,
13,
12322,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
30004,
13,
30004,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
8443,
13,
30004,
13,
29937,
1660,
8707,
18667,
4574,
29909,
17900,
350,
8127,
5012,
27640,
3267,
612,
3725,
382,
1254,
6181,
4741,
349,
1718,
29909,
315,
1525,
1718,
14845,
14445,
29934,
3210,
5667,
29949,
869,
22793,
30004,
13,
932,
29889,
2917,
1839,
4176,
1964,
3210,
12665,
29979,
29918,
25832,
27982,
29918,
15551,
2033,
353,
29871,
525,
22793,
597,
22208,
718,
2897,
29889,
2084,
29889,
7122,
29898,
12322,
29892,
525,
1272,
29889,
22793,
1495,
30004,
13,
30004,
13,
29937,
29923,
1254,
25752,
1307,
4741,
29924,
3267,
660,
4462,
11698,
379,
2882,
29934,
30102,
16999,
4571,
29943,
2965,
2477,
2725,
2890,
12524,
405,
4462,
1254,
4717,
350,
8127,
5012,
27640,
3267,
30004,
13,
932,
29889,
2917,
1839,
4176,
1964,
3210,
12665,
29979,
29918,
5659,
11375,
29918,
6720,
4571,
29943,
28541,
29903,
2033,
353,
7700,
30004,
13,
30004,
13,
29937,
1660,
315,
1525,
29909,
17900,
350,
8127,
5012,
27640,
3267,
349,
1955,
341,
3352,
5971,
5012,
501,
3521,
2672,
1254,
2190,
8426,
29909,
5012,
17900,
315,
4375,
1660,
3758,
2499,
305,
6764,
8707,
349,
1718,
25797,
29911,
1672,
30004,
13,
29937,
405,
4462,
1254,
4717,
12279,
29925,
30004,
13,
1272,
5160,
353,
3758,
2499,
305,
6764,
29898,
932,
8443,
13,
30004,
13,
29937,
1660,
501,
24301,
5265,
29999,
29909,
382,
1254,
29923,
341,
30062,
4986,
3970,
341,
4481,
403,
349,
1718,
29909,
660,
4462,
3725,
349,
29965,
3352,
2190,
12524,
18118,
1718,
365,
3289,
319,
1783,
29965,
1964,
26664,
2477,
2725,
2890,
315,
1955,
1525,
5550,
1164,
4571,
3919,
2890,
5012,
17900,
323,
2882,
4375,
30004,
13,
29937,
319,
17900,
350,
8127,
5012,
27640,
3267,
317,
1177,
405,
11206,
2890,
1367,
3035,
5012,
5195,
29950,
2477,
1001,
4375,
30004,
13,
29924,
4481,
403,
29898,
932,
29892,
848,
5160,
8443,
13,
30004,
13,
29937,
1660,
315,
1525,
29909,
405,
4462,
1254,
4717,
323,
2882,
4375,
8707,
365,
3267,
27640,
3267,
660,
4462,
323,
1430,
8353,
2190,
12524,
317,
3308,
23958,
29127,
3289,
30004,
13,
1990,
5196,
29898,
1272,
5160,
29889,
3195,
1125,
30004,
13,
1678,
396,
1660,
382,
1254,
6181,
4741,
14845,
405,
6488,
29933,
1525,
5012,
405,
4462,
1254,
4717,
323,
2882,
4375,
349,
1001,
29949,
11698,
17956,
405,
11206,
2890,
1718,
5971,
612,
29909,
30004,
13,
1678,
396,
11144,
14845,
29871,
405,
6488,
29933,
1525,
382,
1254,
6181,
29907,
1367,
29949,
12524,
17900,
770,
26996,
30175,
29909,
14845,
5012,
405,
4462,
1254,
4717,
323,
2882,
4375,
30004,
13,
1678,
4770,
3891,
2435,
420,
1649,
353,
525,
15136,
787,
29915,
30004,
13,
30004,
13,
1678,
1178,
353,
848,
5160,
29889,
4409,
29898,
1272,
5160,
29889,
7798,
29892,
7601,
29918,
1989,
353,
5852,
8443,
13,
1678,
1024,
353,
848,
5160,
29889,
4409,
29898,
1272,
5160,
29889,
1626,
8443,
13,
1678,
5046,
353,
848,
5160,
29889,
4409,
29898,
1272,
5160,
29889,
7798,
8443,
13,
1678,
4234,
353,
848,
5160,
29889,
4409,
29898,
1272,
5160,
29889,
1626,
8443,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
5046,
29892,
4234,
1125,
30004,
13,
4706,
1583,
29889,
978,
353,
1024,
30004,
13,
4706,
1583,
29889,
482,
353,
5046,
30004,
13,
4706,
1583,
29889,
13509,
353,
4234,
30004,
13,
30004,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
30004,
13,
4706,
1426,
353,
376,
7435,
29901,
6571,
338,
6571,
515,
6571,
1642,
4830,
29898,
1311,
29889,
978,
29892,
1583,
29889,
482,
29892,
1583,
29889,
13509,
8443,
13,
4706,
736,
1426,
30004,
13,
2
] |
Tests/modules/misc/test_system_namespaces.py | aisk/ironpython3 | 1,872 | 136332 | <filename>Tests/modules/misc/test_system_namespaces.py
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
'''
Ensures we can import from .NET 2.0 namespaces and types
'''
import unittest
from iptest import IronPythonTestCase, is_cli, is_mono, is_netcoreapp, run_test, skipUnlessIronPython
if is_cli and not is_netcoreapp:
import clr
clr.AddReference("System.Configuration")
clr.AddReference("System.Configuration.Install")
clr.AddReference("System.Data")
clr.AddReference("System.Data.OracleClient")
if is_mono:
clr.AddReference("System.Data.SqlClient")
else:
clr.AddReference("System.Data.SqlXml")
clr.AddReference("System.Deployment")
clr.AddReference("System.Design")
clr.AddReference("System.DirectoryServices")
clr.AddReference("System.DirectoryServices.Protocols")
clr.AddReference("System.Drawing.Design")
clr.AddReference("System.Drawing")
clr.AddReference("System.EnterpriseServices")
clr.AddReference("System.Management")
clr.AddReference("System.Messaging")
clr.AddReference("System.Runtime.Remoting")
clr.AddReference("System.Runtime.Serialization.Formatters.Soap")
clr.AddReference("System.Security")
clr.AddReference("System.ServiceProcess")
clr.AddReference("System.Transactions")
clr.AddReference("System.Web")
clr.AddReference("System.Web.Mobile")
clr.AddReference("System.Web.RegularExpressions")
clr.AddReference("System.Web.Services")
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Xml")
from System import *
from System.CodeDom import *
from System.CodeDom.Compiler import *
from System.Collections import *
from System.Collections.Generic import *
from System.Collections.ObjectModel import *
from System.Collections.Specialized import *
from System.ComponentModel import *
from System.ComponentModel.Design import *
from System.ComponentModel.Design.Data import *
from System.ComponentModel.Design.Serialization import *
from System.Configuration import *
from System.Configuration.Assemblies import *
from System.Configuration.Install import *
from System.Configuration.Internal import *
from System.Configuration.Provider import *
from System.Data import *
from System.Data.Common import *
from System.Data.Design import *
from System.Data.Odbc import *
from System.Data.OleDb import *
from System.Data.OracleClient import *
from System.Data.Sql import *
from System.Data.SqlClient import *
from System.Data.SqlTypes import *
if not is_mono:
from System.Deployment.Application import *
from System.Deployment.Internal import *
from System.Diagnostics import *
from System.Diagnostics.CodeAnalysis import *
from System.Diagnostics.Design import *
from System.Diagnostics.SymbolStore import *
from System.DirectoryServices import *
from System.DirectoryServices.ActiveDirectory import *
from System.DirectoryServices.Protocols import *
from System.Drawing import *
from System.Drawing.Design import *
from System.Drawing.Drawing2D import *
from System.Drawing.Imaging import *
from System.Drawing.Printing import *
from System.Drawing.Text import *
from System.EnterpriseServices import *
from System.EnterpriseServices.CompensatingResourceManager import *
from System.EnterpriseServices.Internal import *
from System.Globalization import *
from System.IO import *
from System.IO.Compression import *
from System.IO.IsolatedStorage import *
from System.IO.Ports import *
from System.Management import *
from System.Management.Instrumentation import *
from System.Media import *
from System.Messaging import *
from System.Messaging.Design import *
from System.Net import *
from System.Net.Cache import *
from System.Net.Configuration import *
from System.Net.Mail import *
from System.Net.Mime import *
from System.Net.NetworkInformation import *
from System.Net.Security import *
from System.Net.Sockets import *
from System.Reflection import *
from System.Reflection.Emit import *
from System.Resources import *
from System.Resources.Tools import *
from System.Runtime import *
from System.Runtime.CompilerServices import *
from System.Runtime.ConstrainedExecution import *
from System.Runtime.Hosting import *
from System.Runtime.InteropServices import *
from System.Runtime.InteropServices.ComTypes import *
from System.Runtime.InteropServices.Expando import *
from System.Runtime.Remoting import *
from System.Runtime.Remoting.Activation import *
from System.Runtime.Remoting.Channels import *
from System.Runtime.Remoting.Channels.Http import *
from System.Runtime.Remoting.Channels.Ipc import *
from System.Runtime.Remoting.Channels.Tcp import *
from System.Runtime.Remoting.Contexts import *
from System.Runtime.Remoting.Lifetime import *
from System.Runtime.Remoting.Messaging import *
from System.Runtime.Remoting.Metadata import *
from System.Runtime.Remoting.Metadata.W3cXsd2001 import *
from System.Runtime.Remoting.MetadataServices import *
from System.Runtime.Remoting.Proxies import *
from System.Runtime.Remoting.Services import *
from System.Runtime.Serialization import *
from System.Runtime.Serialization.Formatters import *
from System.Runtime.Serialization.Formatters.Binary import *
from System.Runtime.Serialization.Formatters.Soap import *
from System.Runtime.Versioning import *
from System.Security import *
from System.Security.AccessControl import *
from System.Security.Authentication import *
from System.Security.Cryptography import *
from System.Security.Cryptography.Pkcs import *
from System.Security.Cryptography.X509Certificates import *
from System.Security.Cryptography.Xml import *
from System.Security.Permissions import *
from System.Security.Policy import *
from System.Security.Principal import *
from System.ServiceProcess import *
from System.ServiceProcess.Design import *
from System.Text import *
from System.Text.RegularExpressions import *
from System.Threading import *
from System.Timers import *
from System.Transactions import *
from System.Transactions.Configuration import *
from System.Web import *
from System.Web.Caching import *
from System.Web.Compilation import *
from System.Web.Configuration import *
from System.Web.Configuration.Internal import *
from System.Web.Handlers import *
from System.Web.Hosting import *
from System.Web.Mail import *
from System.Web.Management import *
if not is_mono:
from System.Web.Mobile import *
from System.Web.RegularExpressions import *
from System.Web.Profile import *
from System.Web.Security import *
from System.Web.Services import *
from System.Web.Services.Configuration import *
from System.Web.Services.Description import *
from System.Web.Services.Discovery import *
from System.Web.Services.Protocols import *
from System.Web.SessionState import *
from System.Web.UI import *
from System.Web.UI.Adapters import *
from System.Web.UI.Design import *
if not is_mono:
from System.Web.UI.Design.MobileControls import *
from System.Web.UI.Design.MobileControls.Converters import *
from System.Web.UI.MobileControls import *
from System.Web.UI.MobileControls.Adapters import *
from System.Web.UI.MobileControls.Adapters.XhtmlAdapters import *
from System.Web.UI.Design.WebControls.WebParts import *
from System.Web.UI.Design.WebControls import *
from System.Web.UI.HtmlControls import *
from System.Web.UI.WebControls import *
from System.Web.UI.WebControls.Adapters import *
from System.Web.UI.WebControls.WebParts import *
from System.Web.Util import *
from System.Windows.Forms import *
from System.Windows.Forms.ComponentModel.Com2Interop import *
from System.Windows.Forms.Design import *
from System.Windows.Forms.Design.Behavior import *
from System.Windows.Forms.Layout import *
from System.Windows.Forms.PropertyGridInternal import *
from System.Windows.Forms.VisualStyles import *
from System.Xml import *
from System.Xml.Schema import *
from System.Xml.Serialization import *
from System.Xml.Serialization.Advanced import *
from System.Xml.Serialization.Configuration import *
from System.Xml.XPath import *
from System.Xml.Xsl import *
from System.Xml.Xsl.Runtime import *
broken_types = []
def deep_dive(in_name, in_type):
if is_cli:
import System
stuff_list = dir(in_type)
for member in stuff_list:
member_type = eval("type(%s.%s)" % (in_name, member))
member_fullname = in_name + "." + member
if (member_type in [type, type(System)]) and (member not in ["__class__"]):
if member_fullname in broken_types:
print("SKIPPING", member_fullname)
continue
net_type = Type.GetType(member_fullname)
#We can only import * from static classes.
if not net_type or (not (net_type.IsAbstract and net_type.IsSealed) and not net_type.IsEnum):
continue
print(member_fullname)
exec("from " + member_fullname + " import *")
deep_dive(member_fullname, member_type)
@unittest.skipIf(is_netcoreapp, 'references are different')
@skipUnlessIronPython()
class SystemNamespacesTest(IronPythonTestCase):
def test_system_deep(self):
import System
deep_dive("System", System)
run_test(__name__)
| [
1,
529,
9507,
29958,
24376,
29914,
7576,
29914,
29885,
10669,
29914,
1688,
29918,
5205,
29918,
7039,
22459,
29889,
2272,
13,
29937,
10413,
21144,
304,
278,
869,
6006,
10606,
1090,
697,
470,
901,
8571,
4110,
29889,
13,
29937,
450,
869,
6006,
10606,
7794,
11259,
445,
934,
304,
366,
1090,
278,
13380,
29871,
29906,
29889,
29900,
19245,
29889,
13,
29937,
2823,
278,
365,
2965,
1430,
1660,
934,
297,
278,
2060,
3876,
363,
901,
2472,
29889,
13,
13,
12008,
13,
29923,
1983,
1973,
591,
508,
1053,
515,
869,
6006,
29871,
29906,
29889,
29900,
2983,
22459,
322,
4072,
13,
12008,
13,
13,
5215,
443,
27958,
13,
13,
3166,
474,
415,
342,
1053,
20492,
11980,
3057,
8259,
29892,
338,
29918,
11303,
29892,
338,
29918,
29885,
3231,
29892,
338,
29918,
1212,
3221,
932,
29892,
1065,
29918,
1688,
29892,
14383,
2525,
2222,
29902,
1617,
11980,
13,
13,
361,
338,
29918,
11303,
322,
451,
338,
29918,
1212,
3221,
932,
29901,
13,
1678,
1053,
1067,
29878,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
8614,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
8614,
29889,
23271,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
1469,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
1469,
29889,
29949,
10792,
4032,
1159,
13,
1678,
565,
338,
29918,
29885,
3231,
29901,
13,
4706,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
1469,
29889,
10520,
4032,
1159,
13,
1678,
1683,
29901,
13,
4706,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
1469,
29889,
10520,
11089,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
8498,
22812,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
4002,
647,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
9882,
13779,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
9882,
13779,
29889,
17830,
29879,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
16327,
29889,
4002,
647,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
16327,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
10399,
7734,
13779,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
27107,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
19058,
6751,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
7944,
29889,
7301,
11427,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
7944,
29889,
9125,
2133,
29889,
5809,
2153,
29889,
6295,
481,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
13228,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
3170,
7032,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
4300,
7387,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
3609,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
3609,
29889,
29295,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
3609,
29889,
4597,
1070,
27404,
1080,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
3609,
29889,
13779,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
7685,
29889,
12605,
1159,
13,
1678,
1067,
29878,
29889,
2528,
7422,
703,
3924,
29889,
11089,
1159,
13,
13,
1678,
515,
2184,
1053,
334,
13,
1678,
515,
2184,
29889,
3399,
11096,
1053,
334,
13,
1678,
515,
2184,
29889,
3399,
11096,
29889,
25333,
1053,
334,
13,
1678,
515,
2184,
29889,
19466,
1053,
334,
13,
1678,
515,
2184,
29889,
19466,
29889,
15809,
1053,
334,
13,
1678,
515,
2184,
29889,
19466,
29889,
2061,
3195,
1053,
334,
13,
1678,
515,
2184,
29889,
19466,
29889,
24780,
1891,
1053,
334,
13,
1678,
515,
2184,
29889,
5308,
3195,
1053,
334,
13,
1678,
515,
2184,
29889,
5308,
3195,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
5308,
3195,
29889,
4002,
647,
29889,
1469,
1053,
334,
13,
1678,
515,
2184,
29889,
5308,
3195,
29889,
4002,
647,
29889,
9125,
2133,
1053,
334,
13,
1678,
515,
2184,
29889,
8614,
1053,
334,
13,
1678,
515,
2184,
29889,
8614,
29889,
7900,
1590,
3687,
1053,
334,
13,
1678,
515,
2184,
29889,
8614,
29889,
23271,
1053,
334,
13,
1678,
515,
2184,
29889,
8614,
29889,
16491,
1053,
334,
13,
1678,
515,
2184,
29889,
8614,
29889,
6980,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
18877,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
29949,
11140,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
29949,
280,
10234,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
29949,
10792,
4032,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
10520,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
10520,
4032,
1053,
334,
13,
1678,
515,
2184,
29889,
1469,
29889,
10520,
10562,
1053,
334,
13,
1678,
565,
451,
338,
29918,
29885,
3231,
29901,
13,
4706,
515,
2184,
29889,
8498,
22812,
29889,
4873,
1053,
334,
13,
4706,
515,
2184,
29889,
8498,
22812,
29889,
16491,
1053,
334,
13,
1678,
515,
2184,
29889,
12130,
20921,
1053,
334,
13,
1678,
515,
2184,
29889,
12130,
20921,
29889,
3399,
21067,
4848,
1053,
334,
13,
1678,
515,
2184,
29889,
12130,
20921,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
12130,
20921,
29889,
14730,
9044,
1053,
334,
13,
1678,
515,
2184,
29889,
9882,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
9882,
13779,
29889,
9966,
9882,
1053,
334,
13,
1678,
515,
2184,
29889,
9882,
13779,
29889,
17830,
29879,
1053,
334,
13,
1678,
515,
2184,
29889,
16327,
1053,
334,
13,
1678,
515,
2184,
29889,
16327,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
16327,
29889,
16327,
29906,
29928,
1053,
334,
13,
1678,
515,
2184,
29889,
16327,
29889,
1888,
6751,
1053,
334,
13,
1678,
515,
2184,
29889,
16327,
29889,
11816,
292,
1053,
334,
13,
1678,
515,
2184,
29889,
16327,
29889,
1626,
1053,
334,
13,
1678,
515,
2184,
29889,
10399,
7734,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
10399,
7734,
13779,
29889,
6843,
575,
1218,
6848,
3260,
1053,
334,
13,
1678,
515,
2184,
29889,
10399,
7734,
13779,
29889,
16491,
1053,
334,
13,
1678,
515,
2184,
29889,
12756,
2133,
1053,
334,
13,
1678,
515,
2184,
29889,
5971,
1053,
334,
13,
1678,
515,
2184,
29889,
5971,
29889,
1523,
2590,
1053,
334,
13,
1678,
515,
2184,
29889,
5971,
29889,
29902,
2929,
630,
10486,
1053,
334,
13,
1678,
515,
2184,
29889,
5971,
29889,
2290,
29879,
1053,
334,
13,
1678,
515,
2184,
29889,
27107,
1053,
334,
13,
1678,
515,
2184,
29889,
27107,
29889,
3379,
15461,
362,
1053,
334,
13,
1678,
515,
2184,
29889,
10572,
1053,
334,
13,
1678,
515,
2184,
29889,
19058,
6751,
1053,
334,
13,
1678,
515,
2184,
29889,
19058,
6751,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
10408,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
8614,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
14925,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
29924,
603,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
13724,
20350,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
13228,
1053,
334,
13,
1678,
515,
2184,
29889,
6779,
29889,
29903,
1698,
1691,
1053,
334,
13,
1678,
515,
2184,
29889,
5620,
1464,
1053,
334,
13,
1678,
515,
2184,
29889,
5620,
1464,
29889,
29923,
2415,
1053,
334,
13,
1678,
515,
2184,
29889,
13770,
1053,
334,
13,
1678,
515,
2184,
29889,
13770,
29889,
24183,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
25333,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
14131,
1312,
20418,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
8514,
292,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
4074,
459,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
4074,
459,
13779,
29889,
1523,
10562,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
4074,
459,
13779,
29889,
9544,
1743,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
21786,
362,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
1451,
12629,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
1451,
12629,
29889,
5506,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
1451,
12629,
29889,
29902,
6739,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
1451,
12629,
29889,
29911,
6814,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
2677,
29879,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
29931,
361,
5410,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
19058,
6751,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
18417,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
18417,
29889,
29956,
29941,
29883,
29990,
4928,
29906,
29900,
29900,
29896,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
18417,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
1184,
29916,
583,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
7301,
11427,
29889,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
9125,
2133,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
9125,
2133,
29889,
5809,
2153,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
9125,
2133,
29889,
5809,
2153,
29889,
25196,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
9125,
2133,
29889,
5809,
2153,
29889,
6295,
481,
1053,
334,
13,
1678,
515,
2184,
29889,
7944,
29889,
6594,
292,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
6638,
4809,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
16746,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
29907,
4641,
5275,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
29907,
4641,
5275,
29889,
29925,
29895,
2395,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
29907,
4641,
5275,
29889,
29990,
29945,
29900,
29929,
20455,
928,
1078,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
29907,
4641,
5275,
29889,
11089,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
15737,
6847,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
15644,
1053,
334,
13,
1678,
515,
2184,
29889,
13228,
29889,
4040,
26706,
1053,
334,
13,
1678,
515,
2184,
29889,
3170,
7032,
1053,
334,
13,
1678,
515,
2184,
29889,
3170,
7032,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
1626,
1053,
334,
13,
1678,
515,
2184,
29889,
1626,
29889,
4597,
1070,
27404,
1080,
1053,
334,
13,
1678,
515,
2184,
29889,
4899,
292,
1053,
334,
13,
1678,
515,
2184,
29889,
13711,
414,
1053,
334,
13,
1678,
515,
2184,
29889,
4300,
7387,
1053,
334,
13,
1678,
515,
2184,
29889,
4300,
7387,
29889,
8614,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
29907,
9733,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
6843,
8634,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
8614,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
8614,
29889,
16491,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3481,
9306,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
8514,
292,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
14925,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
27107,
1053,
334,
13,
1678,
565,
451,
338,
29918,
29885,
3231,
29901,
13,
4706,
515,
2184,
29889,
3609,
29889,
29295,
1053,
334,
13,
4706,
515,
2184,
29889,
3609,
29889,
4597,
1070,
27404,
1080,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13909,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13228,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13779,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13779,
29889,
8614,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13779,
29889,
9868,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13779,
29889,
4205,
11911,
29891,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
13779,
29889,
17830,
29879,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
7317,
2792,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
3253,
481,
2153,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
4002,
647,
1053,
334,
13,
1678,
565,
451,
338,
29918,
29885,
3231,
29901,
13,
4706,
515,
2184,
29889,
3609,
29889,
3120,
29889,
4002,
647,
29889,
29295,
17825,
1053,
334,
13,
4706,
515,
2184,
29889,
3609,
29889,
3120,
29889,
4002,
647,
29889,
29295,
17825,
29889,
1168,
369,
2153,
1053,
334,
13,
4706,
515,
2184,
29889,
3609,
29889,
3120,
29889,
29295,
17825,
1053,
334,
13,
4706,
515,
2184,
29889,
3609,
29889,
3120,
29889,
29295,
17825,
29889,
3253,
481,
2153,
1053,
334,
13,
4706,
515,
2184,
29889,
3609,
29889,
3120,
29889,
29295,
17825,
29889,
3253,
481,
2153,
29889,
29990,
1420,
3253,
481,
2153,
1053,
334,
13,
4706,
515,
2184,
29889,
3609,
29889,
3120,
29889,
4002,
647,
29889,
3609,
17825,
29889,
3609,
29925,
5708,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
4002,
647,
29889,
3609,
17825,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
10922,
17825,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
3609,
17825,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
3609,
17825,
29889,
3253,
481,
2153,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
3120,
29889,
3609,
17825,
29889,
3609,
29925,
5708,
1053,
334,
13,
1678,
515,
2184,
29889,
3609,
29889,
7270,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
29889,
5308,
3195,
29889,
1523,
29906,
4074,
459,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
29889,
4002,
647,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
29889,
4002,
647,
29889,
28100,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
29889,
3453,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
29889,
4854,
5756,
16491,
1053,
334,
13,
1678,
515,
2184,
29889,
7685,
29889,
12605,
29889,
16227,
855,
5577,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
12763,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
9125,
2133,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
9125,
2133,
29889,
3253,
16858,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
9125,
2133,
29889,
8614,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
29990,
2605,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
29990,
2536,
1053,
334,
13,
1678,
515,
2184,
29889,
11089,
29889,
29990,
2536,
29889,
7944,
1053,
334,
13,
13,
6729,
1717,
29918,
8768,
353,
5159,
13,
13,
1753,
6483,
29918,
29881,
573,
29898,
262,
29918,
978,
29892,
297,
29918,
1853,
1125,
13,
1678,
565,
338,
29918,
11303,
29901,
13,
4706,
1053,
2184,
13,
1678,
6433,
29918,
1761,
353,
4516,
29898,
262,
29918,
1853,
29897,
13,
13,
1678,
363,
4509,
297,
6433,
29918,
1761,
29901,
13,
4706,
4509,
29918,
1853,
353,
19745,
703,
1853,
29414,
29879,
29889,
29995,
29879,
5513,
1273,
313,
262,
29918,
978,
29892,
4509,
876,
13,
4706,
4509,
29918,
8159,
978,
353,
297,
29918,
978,
718,
376,
1213,
718,
4509,
13,
4706,
565,
313,
14242,
29918,
1853,
297,
518,
1853,
29892,
1134,
29898,
3924,
29897,
2314,
322,
313,
14242,
451,
297,
6796,
1649,
1990,
1649,
3108,
1125,
13,
9651,
565,
4509,
29918,
8159,
978,
297,
9391,
29918,
8768,
29901,
13,
18884,
1596,
703,
16033,
5690,
29925,
4214,
613,
4509,
29918,
8159,
978,
29897,
13,
18884,
6773,
13,
13,
9651,
7787,
29918,
1853,
353,
5167,
29889,
2577,
1542,
29898,
14242,
29918,
8159,
978,
29897,
13,
9651,
396,
4806,
508,
871,
1053,
334,
515,
2294,
4413,
29889,
13,
9651,
565,
451,
7787,
29918,
1853,
470,
313,
1333,
313,
1212,
29918,
1853,
29889,
3624,
9118,
322,
7787,
29918,
1853,
29889,
3624,
2008,
7943,
29897,
322,
451,
7787,
29918,
1853,
29889,
3624,
16854,
1125,
13,
18884,
6773,
13,
13,
9651,
1596,
29898,
14242,
29918,
8159,
978,
29897,
13,
9651,
2279,
703,
3166,
376,
718,
4509,
29918,
8159,
978,
718,
376,
1053,
334,
1159,
13,
13,
9651,
6483,
29918,
29881,
573,
29898,
14242,
29918,
8159,
978,
29892,
4509,
29918,
1853,
29897,
13,
13,
29992,
348,
27958,
29889,
11014,
3644,
29898,
275,
29918,
1212,
3221,
932,
29892,
525,
276,
10662,
526,
1422,
1495,
13,
29992,
11014,
2525,
2222,
29902,
1617,
11980,
580,
13,
1990,
2184,
8659,
22459,
3057,
29898,
29902,
1617,
11980,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
5205,
29918,
24535,
29898,
1311,
1125,
13,
4706,
1053,
2184,
13,
4706,
6483,
29918,
29881,
573,
703,
3924,
613,
2184,
29897,
13,
13,
3389,
29918,
1688,
22168,
978,
1649,
29897,
13,
2
] |
config/tools/export.py | ghjinlei/one_mmorpg | 0 | 37181 | #!/usr/bin/env python3
#coding:utf-8
import os, sys
from sys import exit
from utils.excel import read_excel_data
import utils.path as utils_path
from utils.logger import Logger
os.chdir(utils_path.TOOLS_ROOT_PATH)
key_map = {
"cmd" : "string",
"lang" : "string",
"script" : "string",
"args" : "string",
"output_client" : "string",
"output_server" : "string",
}
cmd_info_map = read_excel_data("./export_cmds.xlsx", "main", key_map, "cmd")
logger = Logger(sys.stderr)
def save_autocode(filepath, data):
dirpath = os.path.dirname(filepath)
if not os.path.exists(dirpath):
os.makedirs(dirpath)
data = data.replace("\r\n", "\n")
with open(filepath, "w+") as f:
f.write(data)
f.flush()
f.close()
def gen_autocode_by_info(cmd_info):
if "output_client" in cmd_info:
pfile = os.popen("%s %s %s %s"%(cmd_info["lang"], cmd_info["script"], "-t c", cmd_info["args"]))
data = pfile.read()
pfile.close()
save_autocode(cmd_info["output_client"], data)
if "output_server" in cmd_info:
pfile = os.popen("%s %s %s %s"%(cmd_info["lang"], cmd_info["script"], "-t s", cmd_info["args"]))
data = pfile.read()
pfile.close()
save_autocode(cmd_info["output_server"], data)
return True
def gen_autocode(cmd):
cmd_info = cmd_info_map[cmd]
logger.info("start gen %s"%cmd)
ok = gen_autocode_by_info(cmd_info)
if ok:
logger.info("gen %s success"%cmd)
else:
logger.info("gen %s failed"%cmd)
def main():
if len(sys.argv) == 1:
while(True):
cmd = input("cmd:")
gen_autocode(cmd)
elif len(sys.argv) == 2:
cmd = sys.argv[1]
gen_autocode(cmd)
if __name__ == "__main__":
main()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
29883,
3689,
29901,
9420,
29899,
29947,
13,
13,
5215,
2897,
29892,
10876,
13,
3166,
10876,
1053,
6876,
13,
3166,
3667,
29879,
29889,
24633,
1053,
1303,
29918,
24633,
29918,
1272,
13,
5215,
3667,
29879,
29889,
2084,
408,
3667,
29879,
29918,
2084,
13,
3166,
3667,
29879,
29889,
21707,
1053,
28468,
13,
13,
359,
29889,
305,
3972,
29898,
13239,
29918,
2084,
29889,
4986,
5607,
29903,
29918,
21289,
29918,
10145,
29897,
13,
13,
1989,
29918,
1958,
353,
426,
13,
1678,
376,
9006,
29908,
9651,
584,
376,
1807,
613,
13,
1678,
376,
3893,
29908,
965,
584,
376,
1807,
613,
13,
1678,
376,
2154,
29908,
308,
584,
376,
1807,
613,
13,
1678,
376,
5085,
29908,
965,
584,
376,
1807,
613,
13,
1678,
376,
4905,
29918,
4645,
29908,
29871,
584,
376,
1807,
613,
13,
1678,
376,
4905,
29918,
2974,
29908,
29871,
584,
376,
1807,
613,
13,
29913,
13,
9006,
29918,
3888,
29918,
1958,
353,
1303,
29918,
24633,
29918,
1272,
703,
6904,
15843,
29918,
9006,
29879,
29889,
20267,
29916,
613,
376,
3396,
613,
1820,
29918,
1958,
29892,
376,
9006,
1159,
13,
13,
21707,
353,
28468,
29898,
9675,
29889,
303,
20405,
29897,
13,
13,
1753,
4078,
29918,
6921,
401,
29898,
1445,
2084,
29892,
848,
1125,
13,
1678,
4516,
2084,
353,
2897,
29889,
2084,
29889,
25721,
29898,
1445,
2084,
29897,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
3972,
2084,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
3972,
2084,
29897,
13,
13,
1678,
848,
353,
848,
29889,
6506,
14182,
29878,
29905,
29876,
613,
6634,
29876,
1159,
13,
1678,
411,
1722,
29898,
1445,
2084,
29892,
376,
29893,
29974,
1159,
408,
285,
29901,
13,
4706,
285,
29889,
3539,
29898,
1272,
29897,
13,
4706,
285,
29889,
23126,
580,
13,
4706,
285,
29889,
5358,
580,
13,
13,
13,
1753,
2531,
29918,
6921,
401,
29918,
1609,
29918,
3888,
29898,
9006,
29918,
3888,
1125,
13,
1678,
565,
376,
4905,
29918,
4645,
29908,
297,
9920,
29918,
3888,
29901,
13,
4706,
282,
1445,
353,
2897,
29889,
29886,
3150,
11702,
29879,
1273,
29879,
1273,
29879,
1273,
29879,
29908,
29995,
29898,
9006,
29918,
3888,
3366,
3893,
12436,
9920,
29918,
3888,
3366,
2154,
12436,
11663,
29873,
274,
613,
9920,
29918,
3888,
3366,
5085,
3108,
876,
13,
4706,
848,
353,
282,
1445,
29889,
949,
580,
13,
4706,
282,
1445,
29889,
5358,
580,
13,
4706,
4078,
29918,
6921,
401,
29898,
9006,
29918,
3888,
3366,
4905,
29918,
4645,
12436,
848,
29897,
13,
13,
1678,
565,
376,
4905,
29918,
2974,
29908,
297,
9920,
29918,
3888,
29901,
13,
4706,
282,
1445,
353,
2897,
29889,
29886,
3150,
11702,
29879,
1273,
29879,
1273,
29879,
1273,
29879,
29908,
29995,
29898,
9006,
29918,
3888,
3366,
3893,
12436,
9920,
29918,
3888,
3366,
2154,
12436,
11663,
29873,
269,
613,
9920,
29918,
3888,
3366,
5085,
3108,
876,
13,
4706,
848,
353,
282,
1445,
29889,
949,
580,
13,
4706,
282,
1445,
29889,
5358,
580,
13,
4706,
4078,
29918,
6921,
401,
29898,
9006,
29918,
3888,
3366,
4905,
29918,
2974,
12436,
848,
29897,
13,
13,
1678,
736,
5852,
13,
13,
1753,
2531,
29918,
6921,
401,
29898,
9006,
1125,
13,
1678,
9920,
29918,
3888,
353,
9920,
29918,
3888,
29918,
1958,
29961,
9006,
29962,
13,
13,
1678,
17927,
29889,
3888,
703,
2962,
2531,
1273,
29879,
29908,
29995,
9006,
29897,
13,
1678,
3431,
353,
2531,
29918,
6921,
401,
29918,
1609,
29918,
3888,
29898,
9006,
29918,
3888,
29897,
13,
1678,
565,
3431,
29901,
13,
4706,
17927,
29889,
3888,
703,
1885,
1273,
29879,
2551,
29908,
29995,
9006,
29897,
13,
1678,
1683,
29901,
13,
4706,
17927,
29889,
3888,
703,
1885,
1273,
29879,
5229,
29908,
29995,
9006,
29897,
13,
13,
1753,
1667,
7295,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29896,
29901,
13,
4706,
1550,
29898,
5574,
1125,
13,
9651,
9920,
353,
1881,
703,
9006,
29901,
1159,
13,
9651,
2531,
29918,
6921,
401,
29898,
9006,
29897,
13,
1678,
25342,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29906,
29901,
13,
4706,
9920,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
4706,
2531,
29918,
6921,
401,
29898,
9006,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
13,
2
] |
Chatbot.py | stardust55/SoniFer | 0 | 53729 | <gh_stars>0
# import Chatbot module from chatterbot library
# import ChatterBotCorpusTrainer from chatterbot.trainers library
# import ListTrainer from chatterbot.trainers library
# importing json file
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from chatterbot.trainers import ListTrainer
import json
data = json.loads(open('nfL6.json', 'r').read())
train = []
for k, row in enumerate(data):
train.append(row['question'])
train.append(row['answer'])
# created ChatBot named Trevor
chatbot = ChatBot('Trevor')
def train_bot():
trainer1 = ChatterBotCorpusTrainer(chatbot)
trainer1.train(
"chatterbot.corpus.english.greetings",
"chatterbot.corpus.english.conversations"
)
trainer = ListTrainer(chatbot)
# Training the Bot
# Limiting the questions and answers database to 1024 as it
# would take time in loading
trainer.train(train[:1024])
def get_bot_response(text):
return chatbot.get_response(text)
if __name__ == '__main__':
print("Hi I am Trevor, the Bot ")
print("Your companion in the entire journey")
while True:
request = input('You: ')
response = chatbot.get_response(request)
print('Trevor: ', response)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
1053,
678,
271,
7451,
3883,
515,
521,
2620,
7451,
3489,
30004,
13,
29937,
1053,
678,
2620,
29933,
327,
12521,
13364,
5323,
4983,
515,
521,
2620,
7451,
29889,
14968,
414,
3489,
30004,
13,
29937,
1053,
2391,
5323,
4983,
515,
521,
2620,
7451,
29889,
14968,
414,
3489,
30004,
13,
29937,
28348,
4390,
934,
30004,
13,
3166,
521,
2620,
7451,
1053,
678,
271,
29933,
327,
30004,
13,
3166,
521,
2620,
7451,
29889,
14968,
414,
1053,
678,
2620,
29933,
327,
12521,
13364,
5323,
4983,
30004,
13,
3166,
521,
2620,
7451,
29889,
14968,
414,
1053,
2391,
5323,
4983,
30004,
13,
5215,
4390,
30004,
13,
30004,
13,
1272,
353,
4390,
29889,
18132,
29898,
3150,
877,
29876,
29888,
29931,
29953,
29889,
3126,
742,
525,
29878,
2824,
949,
3101,
30004,
13,
30004,
13,
14968,
353,
5159,
30004,
13,
30004,
13,
1454,
413,
29892,
1948,
297,
26985,
29898,
1272,
1125,
30004,
13,
1678,
7945,
29889,
4397,
29898,
798,
1839,
12470,
2033,
8443,
13,
1678,
7945,
29889,
4397,
29898,
798,
1839,
12011,
2033,
8443,
13,
30004,
13,
29937,
2825,
678,
271,
29933,
327,
4257,
6479,
5267,
30004,
13,
13496,
7451,
353,
678,
271,
29933,
327,
877,
29911,
276,
5267,
1495,
30004,
13,
30004,
13,
30004,
13,
1753,
7945,
29918,
7451,
7295,
30004,
13,
1678,
1020,
4983,
29896,
353,
678,
2620,
29933,
327,
12521,
13364,
5323,
4983,
29898,
13496,
7451,
8443,
13,
1678,
1020,
4983,
29896,
29889,
14968,
29898,
30004,
13,
4706,
376,
305,
2620,
7451,
29889,
2616,
13364,
29889,
996,
1674,
29889,
29887,
4521,
886,
15231,
13,
4706,
376,
305,
2620,
7451,
29889,
2616,
13364,
29889,
996,
1674,
29889,
535,
874,
800,
19451,
13,
1678,
1723,
30004,
13,
30004,
13,
1678,
1020,
4983,
353,
2391,
5323,
4983,
29898,
13496,
7451,
8443,
13,
30004,
13,
1678,
396,
26101,
278,
11273,
30004,
13,
1678,
396,
9628,
11407,
278,
5155,
322,
6089,
2566,
304,
29871,
29896,
29900,
29906,
29946,
408,
372,
30004,
13,
1678,
396,
723,
2125,
931,
297,
8363,
30004,
13,
1678,
1020,
4983,
29889,
14968,
29898,
14968,
7503,
29896,
29900,
29906,
29946,
2314,
30004,
13,
30004,
13,
30004,
13,
1753,
679,
29918,
7451,
29918,
5327,
29898,
726,
1125,
30004,
13,
1678,
736,
13563,
7451,
29889,
657,
29918,
5327,
29898,
726,
8443,
13,
30004,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
30004,
13,
1678,
1596,
703,
18567,
306,
626,
6479,
5267,
29892,
278,
11273,
376,
8443,
13,
1678,
1596,
703,
10858,
18708,
297,
278,
4152,
16342,
1159,
30004,
13,
30004,
13,
1678,
1550,
5852,
29901,
30004,
13,
4706,
2009,
353,
1881,
877,
3492,
29901,
525,
8443,
13,
4706,
2933,
353,
13563,
7451,
29889,
657,
29918,
5327,
29898,
3827,
8443,
13,
4706,
1596,
877,
29911,
276,
5267,
29901,
13420,
2933,
8443,
13,
2
] |
core/network/utils.py | jlin/inventory | 22 | 50154 | <gh_stars>10-100
from core.network.models import Network
def calc_networks(network, nq=None):
network.update_network()
eldars = []
sub_networks = []
if not nq:
nq = Network.objects.all()
for pnet in nq.order_by('prefixlen', 'ip_upper', 'ip_lower'):
pnet.update_network()
if pnet.pk == network.pk:
continue
if pnet.network.overlaps(network.network):
if pnet.prefixlen > network.prefixlen:
sub_networks.append(pnet)
else:
eldars.append(pnet)
return eldars, sub_networks
def calc_parent(network):
eldars, sub_net = calc_networks(network)
if not eldars:
return []
parent = list(reversed(sorted(eldars, key=lambda n: n.prefixlen)))[0]
return parent
def calc_parent_str(network_str, ip_type):
network = Network(network_str=network_str, ip_type=ip_type)
return calc_parent(network)
def calc_networks_str(network_str, ip_type):
network = Network(network_str=network_str, ip_type=ip_type)
return calc_networks(network)
def calc_top_level_networks(site):
networks = list(
site.network_set.order_by('prefixlen', 'ip_upper', 'ip_lower')
)
nq = Network.objects.filter(site=site)
tlns = []
while True:
try:
cur = networks.pop(0)
except IndexError:
break
super_nets, sub_nets = calc_networks(cur, nq=nq)
if not super_nets:
tlns.append(cur)
for sn in sub_nets:
try:
networks.remove(sn)
except ValueError:
pass # The network might have a different site
def ncmp(n1, n2):
pd = n1.prefixlen - n2.prefixlen
if pd != 0:
return pd
n_u_d = n1.ip_upper - n2.ip_upper
if n_u_d != 0:
return n_u_d
return n1.ip_lower - n2.ip_lower
#return sorted(tlns, cmp=lambda n1, n2: int(ncmp(n1, n2) % 2))
return tlns
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
7136,
29889,
11618,
29889,
9794,
1053,
8527,
13,
13,
13,
1753,
22235,
29918,
11618,
29879,
29898,
11618,
29892,
302,
29939,
29922,
8516,
1125,
13,
1678,
3564,
29889,
5504,
29918,
11618,
580,
13,
1678,
560,
29881,
1503,
353,
5159,
13,
1678,
1014,
29918,
11618,
29879,
353,
5159,
13,
1678,
565,
451,
302,
29939,
29901,
13,
4706,
302,
29939,
353,
8527,
29889,
12650,
29889,
497,
580,
13,
13,
1678,
363,
282,
1212,
297,
302,
29939,
29889,
2098,
29918,
1609,
877,
13506,
2435,
742,
525,
666,
29918,
21064,
742,
525,
666,
29918,
13609,
29374,
13,
4706,
282,
1212,
29889,
5504,
29918,
11618,
580,
13,
4706,
565,
282,
1212,
29889,
20571,
1275,
3564,
29889,
20571,
29901,
13,
9651,
6773,
13,
4706,
565,
282,
1212,
29889,
11618,
29889,
957,
14128,
29898,
11618,
29889,
11618,
1125,
13,
9651,
565,
282,
1212,
29889,
13506,
2435,
1405,
3564,
29889,
13506,
2435,
29901,
13,
18884,
1014,
29918,
11618,
29879,
29889,
4397,
29898,
29886,
1212,
29897,
13,
9651,
1683,
29901,
13,
18884,
560,
29881,
1503,
29889,
4397,
29898,
29886,
1212,
29897,
13,
13,
1678,
736,
560,
29881,
1503,
29892,
1014,
29918,
11618,
29879,
13,
13,
13,
1753,
22235,
29918,
3560,
29898,
11618,
1125,
13,
1678,
560,
29881,
1503,
29892,
1014,
29918,
1212,
353,
22235,
29918,
11618,
29879,
29898,
11618,
29897,
13,
1678,
565,
451,
560,
29881,
1503,
29901,
13,
4706,
736,
5159,
13,
1678,
3847,
353,
1051,
29898,
276,
874,
287,
29898,
24582,
29898,
2495,
1503,
29892,
1820,
29922,
2892,
302,
29901,
302,
29889,
13506,
2435,
4961,
29961,
29900,
29962,
13,
1678,
736,
3847,
13,
13,
13,
1753,
22235,
29918,
3560,
29918,
710,
29898,
11618,
29918,
710,
29892,
10377,
29918,
1853,
1125,
13,
1678,
3564,
353,
8527,
29898,
11618,
29918,
710,
29922,
11618,
29918,
710,
29892,
10377,
29918,
1853,
29922,
666,
29918,
1853,
29897,
13,
1678,
736,
22235,
29918,
3560,
29898,
11618,
29897,
13,
13,
13,
1753,
22235,
29918,
11618,
29879,
29918,
710,
29898,
11618,
29918,
710,
29892,
10377,
29918,
1853,
1125,
13,
1678,
3564,
353,
8527,
29898,
11618,
29918,
710,
29922,
11618,
29918,
710,
29892,
10377,
29918,
1853,
29922,
666,
29918,
1853,
29897,
13,
1678,
736,
22235,
29918,
11618,
29879,
29898,
11618,
29897,
13,
13,
13,
1753,
22235,
29918,
3332,
29918,
5563,
29918,
11618,
29879,
29898,
2746,
1125,
13,
1678,
14379,
353,
1051,
29898,
13,
4706,
3268,
29889,
11618,
29918,
842,
29889,
2098,
29918,
1609,
877,
13506,
2435,
742,
525,
666,
29918,
21064,
742,
525,
666,
29918,
13609,
1495,
13,
1678,
1723,
13,
1678,
302,
29939,
353,
8527,
29889,
12650,
29889,
4572,
29898,
2746,
29922,
2746,
29897,
13,
1678,
260,
29880,
1983,
353,
5159,
13,
1678,
1550,
5852,
29901,
13,
4706,
1018,
29901,
13,
9651,
3151,
353,
14379,
29889,
7323,
29898,
29900,
29897,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
2867,
13,
13,
4706,
2428,
29918,
1212,
29879,
29892,
1014,
29918,
1212,
29879,
353,
22235,
29918,
11618,
29879,
29898,
2764,
29892,
302,
29939,
29922,
29876,
29939,
29897,
13,
4706,
565,
451,
2428,
29918,
1212,
29879,
29901,
13,
9651,
260,
29880,
1983,
29889,
4397,
29898,
2764,
29897,
13,
13,
4706,
363,
5807,
297,
1014,
29918,
1212,
29879,
29901,
13,
9651,
1018,
29901,
13,
18884,
14379,
29889,
5992,
29898,
16586,
29897,
13,
9651,
5174,
7865,
2392,
29901,
13,
18884,
1209,
29871,
396,
450,
3564,
1795,
505,
263,
1422,
3268,
13,
13,
1678,
822,
302,
21058,
29898,
29876,
29896,
29892,
302,
29906,
1125,
13,
4706,
10518,
353,
302,
29896,
29889,
13506,
2435,
448,
302,
29906,
29889,
13506,
2435,
13,
4706,
565,
10518,
2804,
29871,
29900,
29901,
13,
9651,
736,
10518,
13,
4706,
302,
29918,
29884,
29918,
29881,
353,
302,
29896,
29889,
666,
29918,
21064,
448,
302,
29906,
29889,
666,
29918,
21064,
13,
4706,
565,
302,
29918,
29884,
29918,
29881,
2804,
29871,
29900,
29901,
13,
9651,
736,
302,
29918,
29884,
29918,
29881,
13,
4706,
736,
302,
29896,
29889,
666,
29918,
13609,
448,
302,
29906,
29889,
666,
29918,
13609,
13,
13,
1678,
396,
2457,
12705,
29898,
15206,
1983,
29892,
274,
1526,
29922,
2892,
302,
29896,
29892,
302,
29906,
29901,
938,
29898,
17608,
1526,
29898,
29876,
29896,
29892,
302,
29906,
29897,
1273,
29871,
29906,
876,
13,
1678,
736,
260,
29880,
1983,
13,
2
] |
service/service.py | caohui-ouba/cadvis-graph-analysis-server | 1 | 134246 | import networkx as nx
from entity.entity import Graph, Node
from node2vec import Node2Vec
import numpy as np
from gensim.models.word2vec import Word2Vec
from flask import current_app
from sklearn.decomposition import PCA
from sklearn import manifold
from algorithm.search_community import PyLouvain
from algorithm.similar_structure import get_similar_structure
from algorithm.structure_correspond import find_structure_correspond
import config.task_mapping as TASK_ID
import logging
import os
import pickle
def node2vec(graph: nx.Graph, model_path: str, dimensions: int = 20, walk_length: int = 80, num_walks: int = 10, workers: int = 4):
model = None
if os.path.exists(model_path) is False:
# The model is not saved before, now fit the graph and save model to model_path.
node2vec = Node2Vec(graph, dimensions=dimensions,
walk_length=walk_length, num_walks=num_walks, workers=workers, temp_folder="./temp")
model = node2vec.fit(workers=workers)
model.save(model_path)
logging.info("Saved model to file '%s'." % model_path)
else:
# The model is saved before, load it directly.
if os.path.isfile(model_path) is False:
raise FileNotFoundError("The path %s is not a file !" % model_path)
model = Word2Vec.load(model_path)
logging.info("Loaded model from file '%s'. " % model_path)
return model
def get_graph_by_name(name: str):
nxGraph, model = get_graph_model_by_name(name)
graph = Graph()
X = []
for i in range(len(nxGraph.nodes)):
X.append(model.wv.get_vector(str(i + 1)))
X_2 = sigmoid(decomposition(X))
for node_id in nxGraph.nodes():
node = Node(node_id)
"""node_id index from 1 but X_2 index from 0."""
node.vec = [float(x) for x in X_2[node_id - 1]]
graph.add_node(node)
graph.edges = list(nxGraph.edges())
# print(graph.edges[0])
return graph
def get_graph_model_by_name(graph_name: str):
if "soc_blog_catalog" == graph_name:
return current_app.config["soc_blog_graph"], current_app.config["soc_blog_model"]
elif "mock_community_graph" == graph_name:
return current_app.config["mock_community_graph"], current_app.config["mock_community_model"]
return None, None
def get_similar_struc(name: str, nodes: list, k: int):
graph, model = get_graph_model_by_name(name)
compoments = get_similar_structure(name, nodes, k)
correspond = find_structure_correspond(nodes, model, compoments)
return {"compoments": compoments, "correspond": correspond}
def get_commutity_by_name(name: str):
if 'soc_blog_catalog' == name:
return get_patition_model_by_name(name, './dump/community/soc_blog_community')
elif 'mock_community_graph' == name:
return get_patition_model_by_name(name, './dump/community/mock_community_graph')
return None
def get_patition_model_by_name(name: str, path: str):
"""
If dumped the partition before, load the partition directly,
if not , use algrithm to search partition first, then dump it to file while the method's param specific.
"""
partition = None
if os.path.exists(path):
pickle_file = open(path, 'rb')
partition = pickle.load(pickle_file)
logging.info("Loaded partition from file '%s'." % path)
else:
graph, model = get_graph_model_by_name(name)
alg = PyLouvain.from_graph(graph)
res, q = alg.apply_method()
partition = []
for arr in res:
partition.append([a + 1 for a in arr])
dump_file = open(path, 'wb')
pickle.dump(partition, dump_file)
logging.info("Dumped partition to file '%s' " % path)
return partition
def decomposition(X: list, n_component: int = 2):
pca = PCA(n_component)
pca.fit(X)
res = pca.fit_transform(X)
return res
def decomposition_by_tsne(X: list, n_component: int = 2):
embeded = manifold.TSNE(n_components=n_component,
random_state=1).fit_transform(X)
return embeded
def sigmoid(X):
return 1.0 / (1 + np.exp(-X))
def doTask(task, container: dict = None):
if dict is None:
raise AttributeError("container is None in 'doTask'!")
"""task是一个Task类型的json"""
taskId = task.taskId
if taskId == TASK_ID.COMMUNITY_DETECT:
__checkParam(task, "graph_name")
container[taskId] = get_commutity_by_name(task["params"]["graph_name"])
__doSubTasks(task, container)
elif taskId == TASK_ID.NODE_EMBEDDING:
__checkParam(task, "graph_name")
container[taskId] = get_graph_by_name(task["params"]["graph_name"])
__doSubTasks(task, container)
elif taskId == TASK_ID.UNUSUAL_NODE_DETECT:
pass
elif taskId == TASK_ID.SIMILAR_STRUCTURE:
__checkParam(task, "graph_name")
__checkParam(task, "nodes")
__checkParam(task, "k")
container[taskId] = get_graph_by_name(
task["params"]["graph_name"], task["params"]["nodes"], task["params"]["k"])
__doSubTasks(task, container)
elif taskId == TASK_ID.NODE_CORESSPOND:
pass
else:
pass
def __doSubTasks(task, container):
if "subTasks" in task:
for subTask in task["subTasks"]:
doTask(subTask, container)
def __checkParam(task: dict, paramName: str):
if "params" not in task:
raise AttributeError(
"params is None in '%s' !" % task.taskName)
if paramName not in task["params"]:
raise AttributeError(
"params '%s' is None in 'doTask' of task '%s' !" % (paramName, task.taskName))
| [
1,
1053,
3564,
29916,
408,
302,
29916,
13,
3166,
7855,
29889,
10041,
1053,
12367,
29892,
9071,
13,
3166,
2943,
29906,
2003,
1053,
9071,
29906,
25987,
13,
5215,
12655,
408,
7442,
13,
3166,
26943,
326,
29889,
9794,
29889,
1742,
29906,
2003,
1053,
10803,
29906,
25987,
13,
3166,
29784,
1053,
1857,
29918,
932,
13,
3166,
2071,
19668,
29889,
311,
510,
3283,
1053,
349,
5454,
13,
3166,
2071,
19668,
1053,
25941,
13,
3166,
5687,
29889,
4478,
29918,
23834,
1053,
10772,
29931,
5128,
475,
13,
3166,
5687,
29889,
29764,
29918,
23905,
1053,
679,
29918,
29764,
29918,
23905,
13,
3166,
5687,
29889,
23905,
29918,
2616,
3636,
1053,
1284,
29918,
23905,
29918,
2616,
3636,
13,
5215,
2295,
29889,
7662,
29918,
20698,
408,
323,
3289,
29968,
29918,
1367,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
5839,
280,
13,
13,
13,
1753,
2943,
29906,
2003,
29898,
4262,
29901,
302,
29916,
29889,
9527,
29892,
1904,
29918,
2084,
29901,
851,
29892,
13391,
29901,
938,
353,
29871,
29906,
29900,
29892,
6686,
29918,
2848,
29901,
938,
353,
29871,
29947,
29900,
29892,
954,
29918,
14625,
2039,
29901,
938,
353,
29871,
29896,
29900,
29892,
17162,
29901,
938,
353,
29871,
29946,
1125,
13,
1678,
1904,
353,
6213,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
4299,
29918,
2084,
29897,
338,
7700,
29901,
13,
4706,
396,
450,
1904,
338,
451,
7160,
1434,
29892,
1286,
6216,
278,
3983,
322,
4078,
1904,
304,
1904,
29918,
2084,
29889,
13,
4706,
2943,
29906,
2003,
353,
9071,
29906,
25987,
29898,
4262,
29892,
13391,
29922,
6229,
5580,
29892,
13,
462,
9651,
6686,
29918,
2848,
29922,
20919,
29918,
2848,
29892,
954,
29918,
14625,
2039,
29922,
1949,
29918,
14625,
2039,
29892,
17162,
29922,
1287,
414,
29892,
5694,
29918,
12083,
543,
6904,
7382,
1159,
13,
4706,
1904,
353,
2943,
29906,
2003,
29889,
9202,
29898,
1287,
414,
29922,
1287,
414,
29897,
13,
4706,
1904,
29889,
7620,
29898,
4299,
29918,
2084,
29897,
13,
4706,
12183,
29889,
3888,
703,
29903,
10511,
1904,
304,
934,
14210,
29879,
29915,
1213,
1273,
1904,
29918,
2084,
29897,
13,
1678,
1683,
29901,
13,
4706,
396,
450,
1904,
338,
7160,
1434,
29892,
2254,
372,
4153,
29889,
13,
4706,
565,
2897,
29889,
2084,
29889,
275,
1445,
29898,
4299,
29918,
2084,
29897,
338,
7700,
29901,
13,
9651,
12020,
3497,
17413,
2392,
703,
1576,
2224,
1273,
29879,
338,
451,
263,
934,
1738,
29908,
1273,
1904,
29918,
2084,
29897,
13,
4706,
1904,
353,
10803,
29906,
25987,
29889,
1359,
29898,
4299,
29918,
2084,
29897,
13,
4706,
12183,
29889,
3888,
703,
29147,
1904,
515,
934,
14210,
29879,
4286,
376,
1273,
1904,
29918,
2084,
29897,
13,
1678,
736,
1904,
13,
13,
13,
1753,
679,
29918,
4262,
29918,
1609,
29918,
978,
29898,
978,
29901,
851,
1125,
13,
1678,
302,
29916,
9527,
29892,
1904,
353,
679,
29918,
4262,
29918,
4299,
29918,
1609,
29918,
978,
29898,
978,
29897,
13,
1678,
3983,
353,
12367,
580,
13,
1678,
1060,
353,
5159,
13,
1678,
363,
474,
297,
3464,
29898,
2435,
29898,
23818,
9527,
29889,
18010,
22164,
13,
4706,
1060,
29889,
4397,
29898,
4299,
29889,
29893,
29894,
29889,
657,
29918,
8111,
29898,
710,
29898,
29875,
718,
29871,
29896,
4961,
13,
13,
1678,
1060,
29918,
29906,
353,
4365,
29885,
3398,
29898,
311,
510,
3283,
29898,
29990,
876,
13,
1678,
363,
2943,
29918,
333,
297,
302,
29916,
9527,
29889,
18010,
7295,
13,
4706,
2943,
353,
9071,
29898,
3177,
29918,
333,
29897,
13,
4706,
9995,
3177,
29918,
333,
2380,
515,
29871,
29896,
541,
1060,
29918,
29906,
2380,
515,
29871,
29900,
1213,
15945,
13,
4706,
2943,
29889,
2003,
353,
518,
7411,
29898,
29916,
29897,
363,
921,
297,
1060,
29918,
29906,
29961,
3177,
29918,
333,
448,
29871,
29896,
5262,
13,
4706,
3983,
29889,
1202,
29918,
3177,
29898,
3177,
29897,
13,
1678,
3983,
29889,
287,
2710,
353,
1051,
29898,
23818,
9527,
29889,
287,
2710,
3101,
13,
1678,
396,
1596,
29898,
4262,
29889,
287,
2710,
29961,
29900,
2314,
13,
1678,
736,
3983,
13,
13,
13,
1753,
679,
29918,
4262,
29918,
4299,
29918,
1609,
29918,
978,
29898,
4262,
29918,
978,
29901,
851,
1125,
13,
1678,
565,
376,
29879,
542,
29918,
7312,
29918,
28045,
29908,
1275,
3983,
29918,
978,
29901,
13,
4706,
736,
1857,
29918,
932,
29889,
2917,
3366,
29879,
542,
29918,
7312,
29918,
4262,
12436,
1857,
29918,
932,
29889,
2917,
3366,
29879,
542,
29918,
7312,
29918,
4299,
3108,
13,
1678,
25342,
376,
17640,
29918,
23834,
29918,
4262,
29908,
1275,
3983,
29918,
978,
29901,
13,
4706,
736,
1857,
29918,
932,
29889,
2917,
3366,
17640,
29918,
23834,
29918,
4262,
12436,
1857,
29918,
932,
29889,
2917,
3366,
17640,
29918,
23834,
29918,
4299,
3108,
13,
1678,
736,
6213,
29892,
6213,
13,
13,
13,
1753,
679,
29918,
29764,
29918,
10582,
29883,
29898,
978,
29901,
851,
29892,
7573,
29901,
1051,
29892,
413,
29901,
938,
1125,
13,
1678,
3983,
29892,
1904,
353,
679,
29918,
4262,
29918,
4299,
29918,
1609,
29918,
978,
29898,
978,
29897,
13,
1678,
752,
290,
1237,
353,
679,
29918,
29764,
29918,
23905,
29898,
978,
29892,
7573,
29892,
413,
29897,
13,
1678,
3928,
353,
1284,
29918,
23905,
29918,
2616,
3636,
29898,
18010,
29892,
1904,
29892,
752,
290,
1237,
29897,
13,
1678,
736,
8853,
2388,
290,
1237,
1115,
752,
290,
1237,
29892,
376,
2616,
3636,
1115,
3928,
29913,
13,
13,
13,
1753,
679,
29918,
2055,
329,
537,
29918,
1609,
29918,
978,
29898,
978,
29901,
851,
1125,
13,
1678,
565,
525,
29879,
542,
29918,
7312,
29918,
28045,
29915,
1275,
1024,
29901,
13,
4706,
736,
679,
29918,
5031,
654,
29918,
4299,
29918,
1609,
29918,
978,
29898,
978,
29892,
19283,
15070,
29914,
23834,
29914,
29879,
542,
29918,
7312,
29918,
23834,
1495,
13,
1678,
25342,
525,
17640,
29918,
23834,
29918,
4262,
29915,
1275,
1024,
29901,
13,
4706,
736,
679,
29918,
5031,
654,
29918,
4299,
29918,
1609,
29918,
978,
29898,
978,
29892,
19283,
15070,
29914,
23834,
29914,
17640,
29918,
23834,
29918,
4262,
1495,
13,
1678,
736,
6213,
13,
13,
13,
1753,
679,
29918,
5031,
654,
29918,
4299,
29918,
1609,
29918,
978,
29898,
978,
29901,
851,
29892,
2224,
29901,
851,
1125,
13,
1678,
9995,
13,
1678,
960,
16766,
287,
278,
8877,
1434,
29892,
2254,
278,
8877,
4153,
29892,
13,
1678,
565,
451,
1919,
671,
394,
629,
389,
29885,
304,
2740,
8877,
937,
29892,
769,
16766,
372,
304,
934,
1550,
278,
1158,
29915,
29879,
1828,
2702,
29889,
13,
1678,
9995,
13,
1678,
8877,
353,
6213,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
2084,
1125,
13,
4706,
5839,
280,
29918,
1445,
353,
1722,
29898,
2084,
29892,
525,
6050,
1495,
13,
4706,
8877,
353,
5839,
280,
29889,
1359,
29898,
23945,
280,
29918,
1445,
29897,
13,
4706,
12183,
29889,
3888,
703,
29147,
8877,
515,
934,
14210,
29879,
29915,
1213,
1273,
2224,
29897,
13,
1678,
1683,
29901,
13,
4706,
3983,
29892,
1904,
353,
679,
29918,
4262,
29918,
4299,
29918,
1609,
29918,
978,
29898,
978,
29897,
13,
4706,
3093,
353,
10772,
29931,
5128,
475,
29889,
3166,
29918,
4262,
29898,
4262,
29897,
13,
4706,
620,
29892,
3855,
353,
3093,
29889,
7302,
29918,
5696,
580,
13,
4706,
8877,
353,
5159,
13,
4706,
363,
3948,
297,
620,
29901,
13,
9651,
8877,
29889,
4397,
4197,
29874,
718,
29871,
29896,
363,
263,
297,
3948,
2314,
13,
4706,
16766,
29918,
1445,
353,
1722,
29898,
2084,
29892,
525,
29893,
29890,
1495,
13,
4706,
5839,
280,
29889,
15070,
29898,
16707,
29892,
16766,
29918,
1445,
29897,
13,
4706,
12183,
29889,
3888,
703,
29928,
3427,
287,
8877,
304,
934,
14210,
29879,
29915,
376,
1273,
2224,
29897,
13,
1678,
736,
8877,
13,
13,
13,
1753,
26227,
29898,
29990,
29901,
1051,
29892,
302,
29918,
9700,
29901,
938,
353,
29871,
29906,
1125,
13,
1678,
282,
1113,
353,
349,
5454,
29898,
29876,
29918,
9700,
29897,
13,
1678,
282,
1113,
29889,
9202,
29898,
29990,
29897,
13,
1678,
620,
353,
282,
1113,
29889,
9202,
29918,
9067,
29898,
29990,
29897,
13,
1678,
736,
620,
13,
13,
13,
1753,
26227,
29918,
1609,
29918,
1372,
484,
29898,
29990,
29901,
1051,
29892,
302,
29918,
9700,
29901,
938,
353,
29871,
29906,
1125,
13,
13,
1678,
8297,
287,
353,
25941,
29889,
9375,
8186,
29898,
29876,
29918,
14036,
29922,
29876,
29918,
9700,
29892,
13,
462,
9651,
4036,
29918,
3859,
29922,
29896,
467,
9202,
29918,
9067,
29898,
29990,
29897,
13,
1678,
736,
8297,
287,
13,
13,
13,
1753,
4365,
29885,
3398,
29898,
29990,
1125,
13,
1678,
736,
29871,
29896,
29889,
29900,
847,
313,
29896,
718,
7442,
29889,
4548,
6278,
29990,
876,
13,
13,
13,
1753,
437,
5398,
29898,
7662,
29892,
5639,
29901,
9657,
353,
6213,
1125,
13,
1678,
565,
9657,
338,
6213,
29901,
13,
4706,
12020,
23833,
2392,
703,
7611,
338,
6213,
297,
525,
1867,
5398,
29915,
29991,
1159,
13,
1678,
9995,
7662,
30392,
30287,
30502,
5398,
30832,
30883,
30210,
3126,
15945,
29908,
13,
1678,
3414,
1204,
353,
3414,
29889,
7662,
1204,
13,
1678,
565,
3414,
1204,
1275,
323,
3289,
29968,
29918,
1367,
29889,
3217,
7428,
3904,
11937,
29918,
2287,
4330,
1783,
29901,
13,
4706,
4770,
3198,
4736,
29898,
7662,
29892,
376,
4262,
29918,
978,
1159,
13,
4706,
5639,
29961,
7662,
1204,
29962,
353,
679,
29918,
2055,
329,
537,
29918,
1609,
29918,
978,
29898,
7662,
3366,
7529,
3108,
3366,
4262,
29918,
978,
20068,
13,
4706,
4770,
1867,
4035,
26249,
29898,
7662,
29892,
5639,
29897,
13,
1678,
25342,
3414,
1204,
1275,
323,
3289,
29968,
29918,
1367,
29889,
6632,
2287,
29918,
29923,
9486,
3352,
29928,
4214,
29901,
13,
4706,
4770,
3198,
4736,
29898,
7662,
29892,
376,
4262,
29918,
978,
1159,
13,
4706,
5639,
29961,
7662,
1204,
29962,
353,
679,
29918,
4262,
29918,
1609,
29918,
978,
29898,
7662,
3366,
7529,
3108,
3366,
4262,
29918,
978,
20068,
13,
4706,
4770,
1867,
4035,
26249,
29898,
7662,
29892,
5639,
29897,
13,
1678,
25342,
3414,
1204,
1275,
323,
3289,
29968,
29918,
1367,
29889,
3904,
3308,
29965,
1964,
29918,
6632,
2287,
29918,
2287,
4330,
1783,
29901,
13,
4706,
1209,
13,
1678,
25342,
3414,
1204,
1275,
323,
3289,
29968,
29918,
1367,
29889,
5425,
29924,
6227,
1718,
29918,
10810,
29965,
1783,
11499,
29901,
13,
4706,
4770,
3198,
4736,
29898,
7662,
29892,
376,
4262,
29918,
978,
1159,
13,
4706,
4770,
3198,
4736,
29898,
7662,
29892,
376,
18010,
1159,
13,
4706,
4770,
3198,
4736,
29898,
7662,
29892,
376,
29895,
1159,
13,
4706,
5639,
29961,
7662,
1204,
29962,
353,
679,
29918,
4262,
29918,
1609,
29918,
978,
29898,
13,
9651,
3414,
3366,
7529,
3108,
3366,
4262,
29918,
978,
12436,
3414,
3366,
7529,
3108,
3366,
18010,
12436,
3414,
3366,
7529,
3108,
3366,
29895,
20068,
13,
4706,
4770,
1867,
4035,
26249,
29898,
7662,
29892,
5639,
29897,
13,
1678,
25342,
3414,
1204,
1275,
323,
3289,
29968,
29918,
1367,
29889,
6632,
2287,
29918,
3217,
26785,
29925,
1164,
29928,
29901,
13,
4706,
1209,
13,
1678,
1683,
29901,
13,
4706,
1209,
13,
13,
13,
1753,
4770,
1867,
4035,
26249,
29898,
7662,
29892,
5639,
1125,
13,
1678,
565,
376,
1491,
26249,
29908,
297,
3414,
29901,
13,
4706,
363,
1014,
5398,
297,
3414,
3366,
1491,
26249,
3108,
29901,
13,
9651,
437,
5398,
29898,
1491,
5398,
29892,
5639,
29897,
13,
13,
13,
1753,
4770,
3198,
4736,
29898,
7662,
29901,
9657,
29892,
1828,
1170,
29901,
851,
1125,
13,
1678,
565,
376,
7529,
29908,
451,
297,
3414,
29901,
13,
4706,
12020,
23833,
2392,
29898,
13,
9651,
376,
7529,
338,
6213,
297,
14210,
29879,
29915,
1738,
29908,
1273,
3414,
29889,
7662,
1170,
29897,
13,
1678,
565,
1828,
1170,
451,
297,
3414,
3366,
7529,
3108,
29901,
13,
4706,
12020,
23833,
2392,
29898,
13,
9651,
376,
7529,
14210,
29879,
29915,
338,
6213,
297,
525,
1867,
5398,
29915,
310,
3414,
14210,
29879,
29915,
1738,
29908,
1273,
313,
3207,
1170,
29892,
3414,
29889,
7662,
1170,
876,
13,
2
] |
stockquant/odl/tushare/util.py | dabuc/StockQuant | 0 | 140998 | from stockquant.util import logger
from datetime import datetime
from stockquant.settings import CQ_Config
from stockquant.util.models import TaskTable
from stockquant.util.stringhelper import TaskEnum
import concurrent.futures
from stockquant.util.database import get_new_session
from tqdm import tqdm
import time
import copy
from sqlalchemy import desc
_logger = logger.Logger(__name__).get_log()
def extract_data(
taskEnum: TaskEnum,
pro_api_func,
pro_api_func_pramas: dict,
load_data_func,
load_data_func_params: dict,
log_desc: str,
sleep_time=0.2,
):
"""
抽取远端数据
"""
with concurrent.futures.ThreadPoolExecutor() as executor:
sm = get_new_session()
try:
rp = sm.query(TaskTable).filter(TaskTable.task == taskEnum.value, TaskTable.finished == False) # noqa
if CQ_Config.IDB_DEBUG == "1": # 如果是测试环境
rp = rp.order_by(desc(TaskTable.begin_date))
rp = rp.limit(30)
rp = rp.all()
for task in tqdm(rp):
if task.finished:
continue
max_try = 8 # 失败重连的最大次数
for i in range(max_try):
try:
tasktime = datetime.strftime(task.begin_date, "%Y%m%d")
if pro_api_func_pramas:
pramas = copy.deepcopy(pro_api_func_pramas)
else:
pramas = {}
pramas["trade_date"] = tasktime
result = pro_api_func(**pramas)
if load_data_func_params:
load_pramas = copy.deepcopy(load_data_func_params)
else:
load_pramas = {}
load_pramas["result"] = result
load_pramas["task_date"] = task.begin_date
executor.submit(load_data_func, load_pramas)
task.finished = True
time.sleep(sleep_time)
break
except Exception as e:
if i < (max_try - 1):
t = (i + 1) * 2
time.sleep(t)
_logger.error("[{}]异常重连/{}".format(task.ts_code, repr(e)))
continue
else:
_logger.error("获取[{}]{}失败/{}".format(task.ts_code, log_desc, repr(e)))
raise
sm.commit()
except: # noqa
sm.commit()
raise
finally:
sm.close()
| [
1,
515,
10961,
12150,
29889,
4422,
1053,
17927,
13,
3166,
12865,
1053,
12865,
13,
3166,
10961,
12150,
29889,
11027,
1053,
315,
29984,
29918,
3991,
13,
3166,
10961,
12150,
29889,
4422,
29889,
9794,
1053,
9330,
3562,
13,
3166,
10961,
12150,
29889,
4422,
29889,
1807,
20907,
1053,
9330,
16854,
13,
5215,
21984,
29889,
29888,
329,
1973,
13,
3166,
10961,
12150,
29889,
4422,
29889,
9803,
1053,
679,
29918,
1482,
29918,
7924,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
5215,
931,
13,
5215,
3509,
13,
3166,
4576,
284,
305,
6764,
1053,
5153,
13,
13,
29918,
21707,
353,
17927,
29889,
16363,
22168,
978,
1649,
467,
657,
29918,
1188,
580,
13,
13,
13,
1753,
6597,
29918,
1272,
29898,
13,
1678,
3414,
16854,
29901,
9330,
16854,
29892,
13,
1678,
410,
29918,
2754,
29918,
9891,
29892,
13,
1678,
410,
29918,
2754,
29918,
9891,
29918,
558,
314,
294,
29901,
9657,
29892,
13,
1678,
2254,
29918,
1272,
29918,
9891,
29892,
13,
1678,
2254,
29918,
1272,
29918,
9891,
29918,
7529,
29901,
9657,
29892,
13,
1678,
1480,
29918,
14273,
29901,
851,
29892,
13,
1678,
8709,
29918,
2230,
29922,
29900,
29889,
29906,
29892,
13,
1125,
13,
1678,
9995,
13,
268,
233,
141,
192,
30683,
235,
194,
159,
234,
174,
178,
30354,
30763,
13,
1678,
9995,
13,
1678,
411,
21984,
29889,
29888,
329,
1973,
29889,
23574,
13366,
580,
408,
2279,
3406,
29901,
13,
4706,
1560,
353,
679,
29918,
1482,
29918,
7924,
580,
13,
4706,
1018,
29901,
13,
9651,
364,
29886,
353,
1560,
29889,
1972,
29898,
5398,
3562,
467,
4572,
29898,
5398,
3562,
29889,
7662,
1275,
3414,
16854,
29889,
1767,
29892,
9330,
3562,
29889,
4951,
3276,
1275,
7700,
29897,
29871,
396,
694,
25621,
13,
9651,
565,
315,
29984,
29918,
3991,
29889,
1367,
29933,
29918,
18525,
1275,
376,
29896,
1115,
29871,
396,
29871,
30847,
30801,
30392,
31851,
31787,
234,
145,
178,
232,
165,
134,
13,
18884,
364,
29886,
353,
364,
29886,
29889,
2098,
29918,
1609,
29898,
14273,
29898,
5398,
3562,
29889,
463,
29918,
1256,
876,
13,
18884,
364,
29886,
353,
364,
29886,
29889,
13400,
29898,
29941,
29900,
29897,
13,
13,
9651,
364,
29886,
353,
364,
29886,
29889,
497,
580,
13,
13,
9651,
363,
3414,
297,
260,
29939,
18933,
29898,
19080,
1125,
13,
18884,
565,
3414,
29889,
4951,
3276,
29901,
13,
462,
1678,
6773,
13,
13,
18884,
4236,
29918,
2202,
353,
29871,
29947,
29871,
396,
29871,
31369,
31955,
30908,
31903,
30210,
30878,
30257,
30936,
30354,
13,
18884,
363,
474,
297,
3464,
29898,
3317,
29918,
2202,
1125,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
260,
294,
1193,
603,
353,
12865,
29889,
710,
615,
603,
29898,
7662,
29889,
463,
29918,
1256,
29892,
11860,
29979,
29995,
29885,
29995,
29881,
1159,
13,
462,
4706,
565,
410,
29918,
2754,
29918,
9891,
29918,
558,
314,
294,
29901,
13,
462,
9651,
544,
314,
294,
353,
3509,
29889,
24535,
8552,
29898,
771,
29918,
2754,
29918,
9891,
29918,
558,
314,
294,
29897,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
544,
314,
294,
353,
6571,
13,
462,
4706,
544,
314,
294,
3366,
3018,
311,
29918,
1256,
3108,
353,
260,
294,
1193,
603,
13,
462,
4706,
1121,
353,
410,
29918,
2754,
29918,
9891,
29898,
1068,
558,
314,
294,
29897,
13,
13,
462,
4706,
565,
2254,
29918,
1272,
29918,
9891,
29918,
7529,
29901,
13,
462,
9651,
2254,
29918,
558,
314,
294,
353,
3509,
29889,
24535,
8552,
29898,
1359,
29918,
1272,
29918,
9891,
29918,
7529,
29897,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
2254,
29918,
558,
314,
294,
353,
6571,
13,
13,
462,
4706,
2254,
29918,
558,
314,
294,
3366,
2914,
3108,
353,
1121,
13,
462,
4706,
2254,
29918,
558,
314,
294,
3366,
7662,
29918,
1256,
3108,
353,
3414,
29889,
463,
29918,
1256,
13,
462,
4706,
2279,
3406,
29889,
7892,
29898,
1359,
29918,
1272,
29918,
9891,
29892,
2254,
29918,
558,
314,
294,
29897,
13,
13,
462,
4706,
3414,
29889,
4951,
3276,
353,
5852,
13,
462,
4706,
931,
29889,
17059,
29898,
17059,
29918,
2230,
29897,
13,
462,
4706,
2867,
13,
462,
1678,
5174,
8960,
408,
321,
29901,
13,
462,
4706,
565,
474,
529,
313,
3317,
29918,
2202,
448,
29871,
29896,
1125,
13,
462,
9651,
260,
353,
313,
29875,
718,
29871,
29896,
29897,
334,
29871,
29906,
13,
462,
9651,
931,
29889,
17059,
29898,
29873,
29897,
13,
462,
9651,
903,
21707,
29889,
2704,
703,
19660,
6525,
232,
191,
133,
31190,
30908,
31903,
29914,
8875,
1642,
4830,
29898,
7662,
29889,
1372,
29918,
401,
29892,
2062,
29898,
29872,
4961,
13,
462,
9651,
6773,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
903,
21707,
29889,
2704,
703,
31024,
30683,
29961,
8875,
3199,
29913,
31369,
31955,
29914,
8875,
1642,
4830,
29898,
7662,
29889,
1372,
29918,
401,
29892,
1480,
29918,
14273,
29892,
2062,
29898,
29872,
4961,
13,
462,
9651,
12020,
13,
9651,
1560,
29889,
15060,
580,
13,
4706,
5174,
29901,
29871,
396,
694,
25621,
13,
9651,
1560,
29889,
15060,
580,
13,
9651,
12020,
13,
4706,
7146,
29901,
13,
9651,
1560,
29889,
5358,
580,
13,
2
] |
oops_fhir/r4/value_set/provenance_activity_type.py | Mikuana/oops_fhir | 0 | 33213 | <gh_stars>0
from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_participation_type import v3ParticipationType
__all__ = ["ProvenanceActivityType"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class ProvenanceActivityType(ValueSet):
"""
Provenance activity type
This value set contains representative Activity Type codes, which
includes codes from the HL7 DocumentCompletion, ActStatus, and
DataOperations code system, W3C PROV-DM and PROV-N concepts and display
names, several HL7 Lifecycle Event codes for which there are agreed upon
definitions, and non-duplicated codes from the HL7 Security and Privacy
Ontology Operations codes.
Status: draft - Version: 4.0.1
http://hl7.org/fhir/ValueSet/provenance-activity-type
"""
# TODO: fix this template issue1
pass
class Meta:
resource = _resource
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
2224,
1982,
1053,
10802,
13,
13,
3166,
285,
29882,
381,
29889,
13237,
29889,
5975,
300,
1053,
7865,
2697,
408,
903,
1917,
2697,
13,
13,
3166,
288,
3554,
29918,
29888,
29882,
381,
29889,
13239,
1053,
7865,
2697,
13,
13,
13,
3166,
288,
3554,
29918,
29888,
29882,
381,
29889,
29878,
29946,
29889,
401,
29918,
5205,
29889,
29894,
29941,
29918,
1595,
12654,
362,
29918,
1853,
1053,
325,
29941,
7439,
12654,
362,
1542,
13,
13,
13,
1649,
497,
1649,
353,
6796,
1184,
854,
749,
3886,
1542,
3108,
13,
13,
29918,
10314,
353,
903,
1917,
2697,
29889,
5510,
29918,
1445,
29898,
2605,
22168,
1445,
1649,
467,
2541,
29918,
2146,
600,
861,
17350,
3126,
5783,
13,
13,
13,
1990,
1019,
854,
749,
3886,
1542,
29898,
1917,
2697,
1125,
13,
1678,
9995,
13,
1678,
1019,
854,
749,
6354,
1134,
13,
13,
1678,
910,
995,
731,
3743,
21097,
13414,
5167,
11561,
29892,
607,
13,
24572,
11561,
515,
278,
379,
29931,
29955,
10854,
28958,
29892,
3185,
5709,
29892,
322,
13,
1469,
7094,
800,
775,
1788,
29892,
399,
29941,
29907,
13756,
29963,
29899,
23560,
322,
13756,
29963,
29899,
29940,
22001,
322,
2479,
13,
7039,
29892,
3196,
379,
29931,
29955,
365,
22532,
6864,
11561,
363,
607,
727,
526,
15502,
2501,
13,
25476,
2187,
29892,
322,
1661,
29899,
20908,
9169,
11561,
515,
278,
379,
29931,
29955,
14223,
322,
18936,
4135,
13,
29949,
593,
3002,
6607,
800,
11561,
29889,
13,
13,
1678,
16034,
29901,
18195,
448,
10079,
29901,
29871,
29946,
29889,
29900,
29889,
29896,
13,
13,
1678,
1732,
597,
4415,
29955,
29889,
990,
29914,
29888,
29882,
381,
29914,
1917,
2697,
29914,
771,
854,
749,
29899,
10072,
29899,
1853,
13,
1678,
9995,
13,
13,
1678,
396,
14402,
29901,
2329,
445,
4472,
2228,
29896,
13,
1678,
1209,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
6503,
353,
903,
10314,
13,
2
] |
client/ros2/pymkeros2/pymkeros2/pymkeros2_node.py | MagikEyeInc/SDK | 12 | 112280 | <reponame>MagikEyeInc/SDK
#!/usr/bin/env python3
"""
* python_mkeros2_node
*
* Copyright (c) 2020-2021, Magik-Eye Inc.
* author: <NAME>, <EMAIL>
"""
# ============================================================================
# ROS2
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import PointCloud2, PointField
from example_interfaces.srv import Trigger
# ============================================================================
# System
import threading
import time
import sys
# ============================================================================
# mkeros2_node
import argparse
from pymkeros2.device_info import DeviceInfo
from pymkeros2.device_discovery import DeviceDiscovery
from pymkeros2.publisher import MkEPointCloudPublisher
# ============================================================================
# Globals
publisher = None
device_discovery = DeviceDiscovery()
device_info = DeviceInfo()
# ============================================================================
# ============================================================================
# ROS callbacks
"""
Start service callback.
@param std_srvs/Trigger/Request req
@return std_srvs/Trigger/Response res
@brief
To Start publishing on PCD Topic
"""
def start_service_callback(req, res):
global publisher, device_info, device_discovery
if not publisher:
return True
uid = device_info.getUnitId()
start_service = device_info.getStartServiceName()
try:
if uid:
publisher.get_logger().info(f"Looking for device: {uid}")
device_discovery.updateDeviceList()
dinfo = DeviceInfo()
if not device_discovery.validateDevice(uid, dinfo):
raise RuntimeError(f"Cannot find device: {uid}")
publisher.get_logger().info(f"Found device: {dinfo.getUnitId()}:\
{dinfo.getIpAddr()}")
publisher.setDeviceInfo(dinfo)
publisher.startPublishing()
status_msg = f"Started point cloud publishing at {start_service}"
res.success = True
res.message = status_msg
publisher.get_logger().info(status_msg)
except Exception as e:
res.success = False
res.message = str(e)
status_msg = f"Failed to start point cloud publishing at \
{start_service} : {str(e)}"
publisher.get_logger().info(status_msg)
return res
# ============================================================================
"""
Stop service callback.
@param std_srvs/Trigger/Request req
@return std_srvs/Trigger/Response res - [Success/Failure and message]
@brief
To Stop publishing on PCD Topic
"""
def stop_service_callback(req, res):
global publisher, device_info, device_discovery
if (not publisher):
return True
stop_service = device_info.getStopServiceName()
try:
publisher.stopPublishing()
status_msg = f"Stopped point cloud publishing at {stop_service}"
res.success = True
res.message = status_msg
publisher.get_logger().info(status_msg)
except Exception as e:
res.success = False
res.message = str(e)
status_msg = f"Failed to stop point cloud publishing at \
{stop_service} : {str(e)}"
publisher.get_logger().info(status_msg)
return res
# ============================================================================
# ============================================================================
# ROS node initialization
def launch_node(dinfo):
global publisher, device_discovery
publisher = MkEPointCloudPublisher(dinfo)
publisher.get_logger().info(f"Launching node: {dinfo.getNodeName()}")
# Start service server
start_service = dinfo.getStartServiceName()
publisher.get_logger().info(f"Starting service: {start_service}")
service_start = publisher.create_service(
Trigger, start_service, start_service_callback)
# Stop service server
stop_service = dinfo.getStopServiceName()
publisher.get_logger().info(f"Starting service: {stop_service}")
service_stop = publisher.create_service(
Trigger, stop_service, stop_service_callback)
rclpy.spin(publisher)
# ============================================================================
def start_publishing(dinfo):
n = Node(dinfo.getStartServiceNodeName())
start_service = dinfo.getStartServiceName()
start_client = n.create_client(Trigger, start_service)
n.get_logger().info(f"Calling service:, {start_service}")
while not start_client.wait_for_service(timeout_sec=1.0):
n.get_logger().info('service not available, waiting again...')
req = Trigger.Request()
result = start_client.call_async(req)
while rclpy.ok():
rclpy.spin_once(n)
if result.done():
try:
response = result.result()
except Exception as e:
n.get_logger().info(
f"Service call failed {str(e)}")
else:
n.get_logger().info(
f"Service called successfully: {start_service}")
break
n.destroy_node()
rclpy.shutdown()
return 0
# ============================================================================
def stop_publishing(dinfo):
n = Node(dinfo.getStopServiceNodeName())
stop_service = dinfo.getStopServiceName()
stop_client = n.create_client(Trigger, stop_service)
n.get_logger().info(f"Calling service:, {stop_service}")
while not stop_client.wait_for_service(timeout_sec=1.0):
n.get_logger().info('service not available, waiting again...')
req = Trigger.Request()
result = stop_client.call_async(req)
while rclpy.ok():
rclpy.spin_once(n)
if result.done():
try:
response = result.result()
except Exception as e:
n.get_logger().info(
f"Service call failed {str(e)}")
else:
n.get_logger().info(
f"Service called successfully: {stop_service}")
break
n.destroy_node()
rclpy.shutdown()
return 0
# ============================================================================
# ============================================================================
# Argparse
# TODO: With correct implementation to take from CMakeLists.txt
PYMKEROS2_VERSION = "1.0.0"
CliParser = argparse.ArgumentParser(
f"This is pymkeros2_node v {PYMKEROS2_VERSION}(c) MagikEye 2020-2021")
CliParser.add_argument("-v", "--version", help="Output version string",
action="store_true", default=False)
group = CliParser.add_mutually_exclusive_group()
group.add_argument("--start", help="Start node services (if applicable), "
"and point cloud publishing topic",
action="store_true", default=False)
group.add_argument("--stop", help="Stop point cloud publiblishing topic",
action="store_true", default=False)
group.add_argument("--launch", help="Launch node and start its services",
action="store_true", default=False)
CliParser.add_argument("--discover", help="Perform the local network sensor\
discovery procedure and output a list of available sensor",
action="store_true", default=False)
CliParser.add_argument("--device", type=str, help="IP address or Unit ID of \
an MkE device", default="")
CliParser.add_argument("--alias", type=str, help="Device name alias",
default="")
CliParser.add_argument("--timeout", type=int, help="Device discovery timeout\
[s]", default=1)
# ============================================================================
# ============================================================================
# Main
def main(args=None):
try:
rclpy.init(args=args)
param_node = Node("MKEROS_NODE")
param_node.declare_parameter("device", "")
device_param = param_node.get_parameter(
"device").get_parameter_value().string_value
if device_param:
if DeviceDiscovery.isIpAddress(device_param):
device_info.setIpAddr(device_param)
else:
device_info.setUnitId(device_param)
param_node.declare_parameter("alias", "")
alias_param = param_node.get_parameter(
"alias").get_parameter_value().string_value
if alias_param:
device_info.setAlias(alias_param)
else:
device_info.setAlias()
launch_node(device_info)
return 0
cli = CliParser.parse_args()
if cli.version:
print(MKEROS2_VERSION)
device_discovery.setTimeout(cli.timeout)
if cli.discover:
if not cli.device:
device_discovery.updateDeviceList()
for key, value in device_discovery.getDeviceList().items():
print(f"{key} : {value}")
return 0
else:
# Search for devices on local network
device_discovery.updateDeviceList()
# Check the availability of the cli.device only
if(device_discovery.validateDevice(cli.device)):
return 0
else:
exit(1)
if DeviceDiscovery.isIpAddress(cli.device):
device_info.setIpAddr(cli.device)
else:
device_info.setUnitId(cli.device)
device_info.setAlias(cli.alias)
# Perform launch/start/stop action
if cli.launch:
if not cli.device:
raise RuntimeError('Please set the --device option')
launch_node(device_info)
elif cli.start:
if not device_info.getName():
raise RuntimeError('Please set the --device or --alias option')
return start_publishing(device_info)
elif cli.stop:
if not device_info.getName():
raise RuntimeError('Please set the --device or --alias option')
return stop_publishing(device_info)
except Exception as e:
print(f"mkeros2_node fatal error: {str(e)}")
return 1
return 0
if __name__ == "__main__":
main()
| [
1,
529,
276,
1112,
420,
29958,
19095,
638,
29923,
4099,
797,
29883,
29914,
26912,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
15945,
29908,
13,
29930,
3017,
29918,
29885,
3946,
359,
29906,
29918,
3177,
13,
29930,
13,
29930,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29900,
29899,
29906,
29900,
29906,
29896,
29892,
3561,
638,
29899,
29923,
4099,
9266,
29889,
13,
29930,
4148,
29901,
529,
5813,
10202,
529,
26862,
6227,
29958,
13,
15945,
29908,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
390,
3267,
29906,
13,
13,
5215,
364,
695,
2272,
13,
3166,
364,
695,
2272,
29889,
3177,
1053,
9071,
13,
3166,
23530,
29918,
1516,
3174,
29889,
7645,
1053,
8984,
20442,
29906,
29892,
8984,
3073,
13,
3166,
1342,
29918,
1639,
8726,
29889,
29879,
15291,
1053,
1605,
3567,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
2184,
13,
13,
5215,
3244,
292,
13,
5215,
931,
13,
5215,
10876,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
286,
3946,
359,
29906,
29918,
3177,
13,
13,
5215,
1852,
5510,
13,
3166,
282,
962,
3946,
359,
29906,
29889,
10141,
29918,
3888,
1053,
21830,
3401,
13,
3166,
282,
962,
3946,
359,
29906,
29889,
10141,
29918,
2218,
11911,
29891,
1053,
21830,
4205,
11911,
29891,
13,
3166,
282,
962,
3946,
359,
29906,
29889,
23679,
261,
1053,
341,
29895,
29923,
5228,
20442,
21076,
1674,
261,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
402,
2127,
1338,
13,
13,
23679,
261,
353,
6213,
13,
10141,
29918,
2218,
11911,
29891,
353,
21830,
4205,
11911,
29891,
580,
13,
10141,
29918,
3888,
353,
21830,
3401,
580,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
390,
3267,
6939,
29879,
13,
13,
15945,
29908,
13,
1678,
7370,
2669,
6939,
29889,
13,
1678,
732,
3207,
3659,
29918,
21935,
4270,
29914,
20211,
29914,
3089,
12428,
13,
1678,
732,
2457,
3659,
29918,
21935,
4270,
29914,
20211,
29914,
5103,
620,
13,
1678,
732,
1182,
2575,
13,
1678,
1763,
7370,
27256,
373,
349,
6530,
7488,
293,
13,
15945,
29908,
13,
13,
13,
1753,
1369,
29918,
5509,
29918,
14035,
29898,
7971,
29892,
620,
1125,
13,
13,
1678,
5534,
9805,
261,
29892,
4742,
29918,
3888,
29892,
4742,
29918,
2218,
11911,
29891,
13,
13,
1678,
565,
451,
9805,
261,
29901,
13,
4706,
736,
5852,
13,
13,
1678,
318,
333,
353,
4742,
29918,
3888,
29889,
657,
8325,
1204,
580,
13,
1678,
1369,
29918,
5509,
353,
4742,
29918,
3888,
29889,
657,
4763,
3170,
1170,
580,
13,
13,
1678,
1018,
29901,
13,
4706,
565,
318,
333,
29901,
13,
9651,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
14959,
292,
363,
4742,
29901,
426,
5416,
27195,
13,
9651,
4742,
29918,
2218,
11911,
29891,
29889,
5504,
11501,
1293,
580,
13,
13,
9651,
270,
3888,
353,
21830,
3401,
580,
13,
9651,
565,
451,
4742,
29918,
2218,
11911,
29891,
29889,
15480,
11501,
29898,
5416,
29892,
270,
3888,
1125,
13,
18884,
12020,
24875,
2392,
29898,
29888,
29908,
29089,
1284,
4742,
29901,
426,
5416,
27195,
13,
13,
9651,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
9692,
4742,
29901,
426,
29881,
3888,
29889,
657,
8325,
1204,
28296,
3583,
13,
462,
462,
539,
426,
29881,
3888,
29889,
657,
29902,
29886,
2528,
29878,
580,
27195,
13,
9651,
9805,
261,
29889,
842,
11501,
3401,
29898,
29881,
3888,
29897,
13,
13,
4706,
9805,
261,
29889,
2962,
21076,
1674,
292,
580,
13,
13,
4706,
4660,
29918,
7645,
353,
285,
29908,
4763,
287,
1298,
9570,
27256,
472,
426,
2962,
29918,
5509,
5038,
13,
13,
4706,
620,
29889,
8698,
353,
5852,
13,
4706,
620,
29889,
4906,
353,
4660,
29918,
7645,
13,
13,
4706,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
4882,
29918,
7645,
29897,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
620,
29889,
8698,
353,
7700,
13,
4706,
620,
29889,
4906,
353,
851,
29898,
29872,
29897,
13,
13,
4706,
4660,
29918,
7645,
353,
285,
29908,
17776,
304,
1369,
1298,
9570,
27256,
472,
320,
13,
462,
539,
426,
2962,
29918,
5509,
29913,
584,
426,
710,
29898,
29872,
2915,
29908,
13,
13,
4706,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
4882,
29918,
7645,
29897,
13,
13,
1678,
736,
620,
13,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
15945,
29908,
13,
1678,
22303,
2669,
6939,
29889,
13,
1678,
732,
3207,
3659,
29918,
21935,
4270,
29914,
20211,
29914,
3089,
12428,
13,
1678,
732,
2457,
3659,
29918,
21935,
4270,
29914,
20211,
29914,
5103,
620,
448,
518,
14191,
29914,
24155,
322,
2643,
29962,
13,
1678,
732,
1182,
2575,
13,
1678,
1763,
22303,
27256,
373,
349,
6530,
7488,
293,
13,
15945,
29908,
13,
13,
13,
1753,
5040,
29918,
5509,
29918,
14035,
29898,
7971,
29892,
620,
1125,
13,
13,
1678,
5534,
9805,
261,
29892,
4742,
29918,
3888,
29892,
4742,
29918,
2218,
11911,
29891,
13,
13,
1678,
565,
313,
1333,
9805,
261,
1125,
13,
4706,
736,
5852,
13,
13,
1678,
5040,
29918,
5509,
353,
4742,
29918,
3888,
29889,
657,
16329,
3170,
1170,
580,
13,
13,
1678,
1018,
29901,
13,
4706,
9805,
261,
29889,
9847,
21076,
1674,
292,
580,
13,
4706,
4660,
29918,
7645,
353,
285,
29908,
20754,
2986,
1298,
9570,
27256,
472,
426,
9847,
29918,
5509,
5038,
13,
13,
4706,
620,
29889,
8698,
353,
5852,
13,
4706,
620,
29889,
4906,
353,
4660,
29918,
7645,
13,
13,
4706,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
4882,
29918,
7645,
29897,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
620,
29889,
8698,
353,
7700,
13,
4706,
620,
29889,
4906,
353,
851,
29898,
29872,
29897,
13,
13,
4706,
4660,
29918,
7645,
353,
285,
29908,
17776,
304,
5040,
1298,
9570,
27256,
472,
320,
13,
462,
539,
426,
9847,
29918,
5509,
29913,
584,
426,
710,
29898,
29872,
2915,
29908,
13,
13,
4706,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
4882,
29918,
7645,
29897,
13,
13,
1678,
736,
620,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
390,
3267,
2943,
17865,
13,
13,
13,
1753,
6826,
29918,
3177,
29898,
29881,
3888,
1125,
13,
1678,
5534,
9805,
261,
29892,
4742,
29918,
2218,
11911,
29891,
13,
13,
1678,
9805,
261,
353,
341,
29895,
29923,
5228,
20442,
21076,
1674,
261,
29898,
29881,
3888,
29897,
13,
13,
1678,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
17641,
292,
2943,
29901,
426,
29881,
3888,
29889,
657,
4247,
1170,
580,
27195,
13,
13,
1678,
396,
7370,
2669,
1923,
13,
1678,
1369,
29918,
5509,
353,
270,
3888,
29889,
657,
4763,
3170,
1170,
580,
13,
1678,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
4763,
292,
2669,
29901,
426,
2962,
29918,
5509,
27195,
13,
1678,
2669,
29918,
2962,
353,
9805,
261,
29889,
3258,
29918,
5509,
29898,
13,
4706,
1605,
3567,
29892,
1369,
29918,
5509,
29892,
1369,
29918,
5509,
29918,
14035,
29897,
13,
13,
1678,
396,
22303,
2669,
1923,
13,
1678,
5040,
29918,
5509,
353,
270,
3888,
29889,
657,
16329,
3170,
1170,
580,
13,
1678,
9805,
261,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
4763,
292,
2669,
29901,
426,
9847,
29918,
5509,
27195,
13,
1678,
2669,
29918,
9847,
353,
9805,
261,
29889,
3258,
29918,
5509,
29898,
13,
4706,
1605,
3567,
29892,
5040,
29918,
5509,
29892,
5040,
29918,
5509,
29918,
14035,
29897,
13,
13,
1678,
364,
695,
2272,
29889,
1028,
262,
29898,
23679,
261,
29897,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
13,
13,
1753,
1369,
29918,
23679,
292,
29898,
29881,
3888,
1125,
13,
1678,
302,
353,
9071,
29898,
29881,
3888,
29889,
657,
4763,
3170,
4247,
1170,
3101,
13,
13,
1678,
1369,
29918,
5509,
353,
270,
3888,
29889,
657,
4763,
3170,
1170,
580,
13,
13,
1678,
1369,
29918,
4645,
353,
302,
29889,
3258,
29918,
4645,
29898,
20211,
29892,
1369,
29918,
5509,
29897,
13,
13,
1678,
302,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
5594,
292,
2669,
29901,
29892,
426,
2962,
29918,
5509,
27195,
13,
13,
1678,
1550,
451,
1369,
29918,
4645,
29889,
10685,
29918,
1454,
29918,
5509,
29898,
15619,
29918,
3471,
29922,
29896,
29889,
29900,
1125,
13,
4706,
302,
29889,
657,
29918,
21707,
2141,
3888,
877,
5509,
451,
3625,
29892,
10534,
1449,
856,
1495,
13,
13,
1678,
12428,
353,
1605,
3567,
29889,
3089,
580,
13,
1678,
1121,
353,
1369,
29918,
4645,
29889,
4804,
29918,
12674,
29898,
7971,
29897,
13,
13,
1678,
1550,
364,
695,
2272,
29889,
554,
7295,
13,
4706,
364,
695,
2272,
29889,
1028,
262,
29918,
10646,
29898,
29876,
29897,
13,
4706,
565,
1121,
29889,
15091,
7295,
13,
9651,
1018,
29901,
13,
18884,
2933,
353,
1121,
29889,
2914,
580,
13,
9651,
5174,
8960,
408,
321,
29901,
13,
18884,
302,
29889,
657,
29918,
21707,
2141,
3888,
29898,
13,
462,
1678,
285,
29908,
3170,
1246,
5229,
426,
710,
29898,
29872,
2915,
1159,
13,
9651,
1683,
29901,
13,
18884,
302,
29889,
657,
29918,
21707,
2141,
3888,
29898,
13,
462,
1678,
285,
29908,
3170,
2000,
8472,
29901,
426,
2962,
29918,
5509,
27195,
13,
9651,
2867,
13,
13,
1678,
302,
29889,
20524,
29918,
3177,
580,
13,
1678,
364,
695,
2272,
29889,
845,
329,
3204,
580,
13,
1678,
736,
29871,
29900,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
13,
13,
1753,
5040,
29918,
23679,
292,
29898,
29881,
3888,
1125,
13,
1678,
302,
353,
9071,
29898,
29881,
3888,
29889,
657,
16329,
3170,
4247,
1170,
3101,
13,
13,
1678,
5040,
29918,
5509,
353,
270,
3888,
29889,
657,
16329,
3170,
1170,
580,
13,
13,
1678,
5040,
29918,
4645,
353,
302,
29889,
3258,
29918,
4645,
29898,
20211,
29892,
5040,
29918,
5509,
29897,
13,
13,
1678,
302,
29889,
657,
29918,
21707,
2141,
3888,
29898,
29888,
29908,
5594,
292,
2669,
29901,
29892,
426,
9847,
29918,
5509,
27195,
13,
13,
1678,
1550,
451,
5040,
29918,
4645,
29889,
10685,
29918,
1454,
29918,
5509,
29898,
15619,
29918,
3471,
29922,
29896,
29889,
29900,
1125,
13,
4706,
302,
29889,
657,
29918,
21707,
2141,
3888,
877,
5509,
451,
3625,
29892,
10534,
1449,
856,
1495,
13,
13,
1678,
12428,
353,
1605,
3567,
29889,
3089,
580,
13,
1678,
1121,
353,
5040,
29918,
4645,
29889,
4804,
29918,
12674,
29898,
7971,
29897,
13,
13,
1678,
1550,
364,
695,
2272,
29889,
554,
7295,
13,
4706,
364,
695,
2272,
29889,
1028,
262,
29918,
10646,
29898,
29876,
29897,
13,
4706,
565,
1121,
29889,
15091,
7295,
13,
9651,
1018,
29901,
13,
18884,
2933,
353,
1121,
29889,
2914,
580,
13,
9651,
5174,
8960,
408,
321,
29901,
13,
18884,
302,
29889,
657,
29918,
21707,
2141,
3888,
29898,
13,
462,
1678,
285,
29908,
3170,
1246,
5229,
426,
710,
29898,
29872,
2915,
1159,
13,
9651,
1683,
29901,
13,
18884,
302,
29889,
657,
29918,
21707,
2141,
3888,
29898,
13,
462,
1678,
285,
29908,
3170,
2000,
8472,
29901,
426,
9847,
29918,
5509,
27195,
13,
9651,
2867,
13,
13,
1678,
302,
29889,
20524,
29918,
3177,
580,
13,
1678,
364,
695,
2272,
29889,
845,
329,
3204,
580,
13,
1678,
736,
29871,
29900,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
11842,
5510,
13,
13,
13,
29937,
14402,
29901,
2973,
1959,
5314,
304,
2125,
515,
315,
9984,
1293,
29879,
29889,
3945,
13,
20055,
29924,
29968,
1001,
3267,
29906,
29918,
16358,
353,
376,
29896,
29889,
29900,
29889,
29900,
29908,
13,
13,
29907,
492,
11726,
353,
1852,
5510,
29889,
15730,
11726,
29898,
13,
1678,
285,
29908,
4013,
338,
282,
962,
3946,
359,
29906,
29918,
3177,
325,
426,
20055,
29924,
29968,
1001,
3267,
29906,
29918,
16358,
2119,
29883,
29897,
3561,
638,
29923,
4099,
29871,
29906,
29900,
29906,
29900,
29899,
29906,
29900,
29906,
29896,
1159,
13,
13,
29907,
492,
11726,
29889,
1202,
29918,
23516,
703,
29899,
29894,
613,
376,
489,
3259,
613,
1371,
543,
6466,
1873,
1347,
613,
13,
462,
539,
3158,
543,
8899,
29918,
3009,
613,
2322,
29922,
8824,
29897,
13,
13,
2972,
353,
315,
492,
11726,
29889,
1202,
29918,
6149,
1474,
29918,
735,
7009,
573,
29918,
2972,
580,
13,
2972,
29889,
1202,
29918,
23516,
703,
489,
2962,
613,
1371,
543,
4763,
2943,
5786,
313,
361,
22903,
511,
376,
13,
462,
259,
376,
392,
1298,
9570,
27256,
11261,
613,
13,
462,
259,
3158,
543,
8899,
29918,
3009,
613,
2322,
29922,
8824,
29897,
13,
2972,
29889,
1202,
29918,
23516,
703,
489,
9847,
613,
1371,
543,
16329,
1298,
9570,
2529,
1982,
1674,
292,
11261,
613,
13,
462,
259,
3158,
543,
8899,
29918,
3009,
613,
2322,
29922,
8824,
29897,
13,
2972,
29889,
1202,
29918,
23516,
703,
489,
15343,
613,
1371,
543,
17641,
2943,
322,
1369,
967,
5786,
613,
13,
462,
259,
3158,
543,
8899,
29918,
3009,
613,
2322,
29922,
8824,
29897,
13,
13,
29907,
492,
11726,
29889,
1202,
29918,
23516,
703,
489,
2218,
11911,
613,
1371,
543,
5894,
689,
278,
1887,
3564,
23530,
29905,
13,
18884,
20699,
8792,
322,
1962,
263,
1051,
310,
3625,
23530,
613,
13,
462,
539,
3158,
543,
8899,
29918,
3009,
613,
2322,
29922,
8824,
29897,
13,
13,
29907,
492,
11726,
29889,
1202,
29918,
23516,
703,
489,
10141,
613,
1134,
29922,
710,
29892,
1371,
543,
5690,
3211,
470,
13223,
3553,
310,
320,
13,
18884,
385,
341,
29895,
29923,
4742,
613,
2322,
543,
1159,
13,
29907,
492,
11726,
29889,
1202,
29918,
23516,
703,
489,
19973,
613,
1134,
29922,
710,
29892,
1371,
543,
11501,
1024,
13995,
613,
13,
462,
539,
2322,
543,
1159,
13,
13,
29907,
492,
11726,
29889,
1202,
29918,
23516,
703,
489,
15619,
613,
1134,
29922,
524,
29892,
1371,
543,
11501,
20699,
11815,
29905,
13,
18884,
518,
29879,
29962,
613,
2322,
29922,
29896,
29897,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
29937,
4241,
13,
13,
13,
1753,
1667,
29898,
5085,
29922,
8516,
1125,
13,
1678,
1018,
29901,
13,
4706,
364,
695,
2272,
29889,
2344,
29898,
5085,
29922,
5085,
29897,
13,
4706,
1828,
29918,
3177,
353,
9071,
703,
29924,
29968,
1001,
3267,
29918,
6632,
2287,
1159,
13,
13,
4706,
1828,
29918,
3177,
29889,
7099,
8663,
29918,
15501,
703,
10141,
613,
20569,
13,
4706,
4742,
29918,
3207,
353,
1828,
29918,
3177,
29889,
657,
29918,
15501,
29898,
13,
9651,
376,
10141,
2564,
657,
29918,
15501,
29918,
1767,
2141,
1807,
29918,
1767,
13,
13,
4706,
565,
4742,
29918,
3207,
29901,
13,
9651,
565,
21830,
4205,
11911,
29891,
29889,
275,
29902,
29886,
7061,
29898,
10141,
29918,
3207,
1125,
13,
18884,
4742,
29918,
3888,
29889,
842,
29902,
29886,
2528,
29878,
29898,
10141,
29918,
3207,
29897,
13,
9651,
1683,
29901,
13,
18884,
4742,
29918,
3888,
29889,
842,
8325,
1204,
29898,
10141,
29918,
3207,
29897,
13,
13,
9651,
1828,
29918,
3177,
29889,
7099,
8663,
29918,
15501,
703,
19973,
613,
20569,
13,
9651,
13995,
29918,
3207,
353,
1828,
29918,
3177,
29889,
657,
29918,
15501,
29898,
13,
18884,
376,
19973,
2564,
657,
29918,
15501,
29918,
1767,
2141,
1807,
29918,
1767,
13,
13,
9651,
565,
13995,
29918,
3207,
29901,
13,
18884,
4742,
29918,
3888,
29889,
842,
29909,
18849,
29898,
19973,
29918,
3207,
29897,
13,
9651,
1683,
29901,
13,
18884,
4742,
29918,
3888,
29889,
842,
29909,
18849,
580,
13,
13,
9651,
6826,
29918,
3177,
29898,
10141,
29918,
3888,
29897,
13,
9651,
736,
29871,
29900,
13,
13,
4706,
9335,
353,
315,
492,
11726,
29889,
5510,
29918,
5085,
580,
13,
4706,
565,
9335,
29889,
3259,
29901,
13,
9651,
1596,
29898,
29924,
29968,
1001,
3267,
29906,
29918,
16358,
29897,
13,
13,
4706,
4742,
29918,
2218,
11911,
29891,
29889,
842,
10851,
29898,
11303,
29889,
15619,
29897,
13,
13,
4706,
565,
9335,
29889,
2218,
11911,
29901,
13,
9651,
565,
451,
9335,
29889,
10141,
29901,
13,
18884,
4742,
29918,
2218,
11911,
29891,
29889,
5504,
11501,
1293,
580,
13,
18884,
363,
1820,
29892,
995,
297,
4742,
29918,
2218,
11911,
29891,
29889,
657,
11501,
1293,
2141,
7076,
7295,
13,
462,
1678,
1596,
29898,
29888,
29908,
29912,
1989,
29913,
584,
426,
1767,
27195,
13,
13,
18884,
736,
29871,
29900,
13,
9651,
1683,
29901,
13,
18884,
396,
11856,
363,
9224,
373,
1887,
3564,
13,
18884,
4742,
29918,
2218,
11911,
29891,
29889,
5504,
11501,
1293,
580,
13,
13,
18884,
396,
5399,
278,
20847,
3097,
310,
278,
9335,
29889,
10141,
871,
13,
18884,
565,
29898,
10141,
29918,
2218,
11911,
29891,
29889,
15480,
11501,
29898,
11303,
29889,
10141,
22164,
13,
462,
1678,
736,
29871,
29900,
13,
18884,
1683,
29901,
13,
462,
1678,
6876,
29898,
29896,
29897,
13,
13,
4706,
565,
21830,
4205,
11911,
29891,
29889,
275,
29902,
29886,
7061,
29898,
11303,
29889,
10141,
1125,
13,
9651,
4742,
29918,
3888,
29889,
842,
29902,
29886,
2528,
29878,
29898,
11303,
29889,
10141,
29897,
13,
4706,
1683,
29901,
13,
9651,
4742,
29918,
3888,
29889,
842,
8325,
1204,
29898,
11303,
29889,
10141,
29897,
13,
13,
4706,
4742,
29918,
3888,
29889,
842,
29909,
18849,
29898,
11303,
29889,
19973,
29897,
13,
13,
4706,
396,
27313,
6826,
29914,
2962,
29914,
9847,
3158,
13,
4706,
565,
9335,
29889,
15343,
29901,
13,
9651,
565,
451,
9335,
29889,
10141,
29901,
13,
18884,
12020,
24875,
2392,
877,
12148,
731,
278,
1192,
10141,
2984,
1495,
13,
13,
9651,
6826,
29918,
3177,
29898,
10141,
29918,
3888,
29897,
13,
13,
4706,
25342,
9335,
29889,
2962,
29901,
13,
9651,
565,
451,
4742,
29918,
3888,
29889,
19629,
7295,
13,
18884,
12020,
24875,
2392,
877,
12148,
731,
278,
1192,
10141,
470,
1192,
19973,
2984,
1495,
13,
13,
9651,
736,
1369,
29918,
23679,
292,
29898,
10141,
29918,
3888,
29897,
13,
13,
4706,
25342,
9335,
29889,
9847,
29901,
13,
9651,
565,
451,
4742,
29918,
3888,
29889,
19629,
7295,
13,
18884,
12020,
24875,
2392,
877,
12148,
731,
278,
1192,
10141,
470,
1192,
19973,
2984,
1495,
13,
13,
9651,
736,
5040,
29918,
23679,
292,
29898,
10141,
29918,
3888,
29897,
13,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
1596,
29898,
29888,
29908,
29885,
3946,
359,
29906,
29918,
3177,
18409,
1059,
29901,
426,
710,
29898,
29872,
2915,
1159,
13,
4706,
736,
29871,
29896,
13,
13,
1678,
736,
29871,
29900,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
arjuna/core/discovery.py | test-mile/arjuna | 9 | 177044 | '''
This file is a part of Test Mile Arjuna
Copyright 2018 Test Mile Software Testing Pvt Ltd
Website: www.TestMile.com
Email: support [at] testmile.com
Creator: <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.
'''
import os
from arjuna.core.enums import *
from arjuna.core.utils import file_utils
from arjuna.core.utils import sys_utils
class DiscoveredFile:
def __init__(self):
self.props = {}
def attr(self, attr):
return self.props[attr]
def set_attr(self, name, attr):
self.props[name] = attr
fa_msg1 = '''Duplicate test file found with name: %s.
Check package and class names in test directory.
Arjuna follows a case-INSENSITIVE approach for test names.'''
class FileAggregator:
def __init__(self):
self.files = []
self.found_class_names = set()
self.temp_map = {}
from arjuna.tpi import Arjuna
self.logger = Arjuna.get_logger()
self.console = Arjuna.get_console()
def add(self, df):
key = df.attr(DiscoveredFileAttributeEnum.DIRECTORY_ABSOLUTE_PATH) + "/" + df.attr(
DiscoveredFileAttributeEnum.FULL_NAME).upper()
if key in self.found_class_names or key in self.temp_map:
fa_msg1.format(DiscoveredFileAttributeEnum.FULL_NAME)
self.console.display_error(fa_msg1)
sys_utils.fexit()
self.temp_map[key] = df
def freeze(self):
paths = []
paths.extend(self.temp_map.keys())
paths.sort()
for path in paths:
self.files.append(self.temp_map[path])
def __iter__(self):
return iter(self.files)
def enumerate(self):
for f in self:
self.logger.debug("-------------------------")
self.logger.debug("Name:\t" + f.attr(DiscoveredFileAttributeEnum.NAME))
self.logger.debug("Extension:\t" + f.attr(DiscoveredFileAttributeEnum.EXTENSION))
self.logger.debug("Full Name:\t" + f.attr(DiscoveredFileAttributeEnum.FULL_NAME))
self.logger.debug("Package Dot Notation:\t" + f.attr(DiscoveredFileAttributeEnum.PACKAGE_DOT_NOTATION))
self.logger.debug(
"Directory Relative Path:\t" + f.attr(DiscoveredFileAttributeEnum.DIRECTORY_RELATIVE_PATH))
self.logger.debug(
"Directory Absolute Path:\t" + f.attr(DiscoveredFileAttributeEnum.DIRECTORY_ABSOLUTE_PATH))
self.logger.debug("Comma Separated Relative Path:\t"
+ f.attr(DiscoveredFileAttributeEnum.COMMA_SEPATARED_RELATIVE_PATH))
# self.logger.debug("Container:\t" + f.attr(DiscoveredFileAttributeEnum.CONTAINER))
# self.logger.debug("Container Type:\t" + f.attr(DiscoveredFileAttributeEnum.CONTAINER_TYPE))
self.logger.debug("-------------------------")
class FileDiscoverer:
def __init__(self, aggregator, root_dir, include_prefixes=None):
self.aggregator = aggregator
if root_dir.endswith("\\") or root_dir.endswith("//"):
self.root_dir = root_dir[0:-1]
else:
self.root_dir = root_dir
self.root_dir = file_utils.normalize_path(self.root_dir)
self.cdir = None
self.cabsdir = None
self.prefixes = [file_utils.normalize_path(p) for p in include_prefixes]
def discover(self):
for d, subdlist, flist in os.walk(self.root_dir):
normalized_d = file_utils.normalize_path(d)
if flist:
for f in flist:
full_path = file_utils.normalize_path(os.path.abspath(os.path.join(normalized_d, f)))
consider = False
for prefix in self.prefixes:
if normalized_d.startswith(prefix):
consider = True
break
if not consider: continue
file_ext = file_utils.get_extension(full_path)
if file_ext.lower() not in set(['py']): continue
parent_dir = file_utils.normalize_path(os.path.dirname(full_path))
pkg_parent_dir = None # os.path.commonpath()
if parent_dir == self.root_dir:
pkg_parent_dir = ""
else:
pkg_parent_dir = parent_dir[parent_dir.index(self.root_dir) + len(self.root_dir) + 1:]
file_ext = file_utils.get_extension(full_path)
df = DiscoveredFile()
df.set_attr(DiscoveredFileAttributeEnum.NAME, file_utils.get_nonext_basename(full_path))
df.set_attr(DiscoveredFileAttributeEnum.EXTENSION, file_ext)
df.set_attr(DiscoveredFileAttributeEnum.FULL_NAME, f)
df.set_attr(DiscoveredFileAttributeEnum.PACKAGE_DOT_NOTATION,
pkg_parent_dir.replace("/", "."))
df.set_attr(DiscoveredFileAttributeEnum.DIRECTORY_RELATIVE_PATH, pkg_parent_dir)
df.set_attr(DiscoveredFileAttributeEnum.DIRECTORY_ABSOLUTE_PATH, parent_dir)
replaced = df.attr(DiscoveredFileAttributeEnum.DIRECTORY_RELATIVE_PATH).replace("/", "|")
replaced = replaced.replace("\\", "|")
df.set_attr(DiscoveredFileAttributeEnum.COMMA_SEPATARED_RELATIVE_PATH,
",".join(replaced.split("|")))
# df.set_attr(DiscoveredFileAttributeEnum.CONTAINER, attr.NA_STRING)
# df.set_attr(DiscoveredFileAttributeEnum.CONTAINER_TYPE, attr.NA_STRING)
self.aggregator.add(df)
self.aggregator.freeze()
| [
1,
14550,
13,
4013,
934,
338,
263,
760,
310,
4321,
341,
488,
826,
29926,
4347,
13,
11882,
1266,
29871,
29906,
29900,
29896,
29947,
4321,
341,
488,
18540,
4321,
292,
349,
21908,
19806,
13,
13,
3609,
2746,
29901,
7821,
29889,
3057,
29924,
488,
29889,
510,
13,
9823,
29901,
2304,
518,
271,
29962,
1243,
26763,
29889,
510,
13,
9832,
1061,
29901,
529,
5813,
29958,
13,
13,
29931,
293,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
6293,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
3492,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
13,
29871,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
13,
2525,
2222,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
5721,
7541,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29956,
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,
13393,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
13400,
800,
1090,
278,
19245,
29889,
13,
12008,
13,
13,
5215,
2897,
13,
13,
3166,
564,
29926,
4347,
29889,
3221,
29889,
264,
6762,
1053,
334,
13,
3166,
564,
29926,
4347,
29889,
3221,
29889,
13239,
1053,
934,
29918,
13239,
13,
3166,
564,
29926,
4347,
29889,
3221,
29889,
13239,
1053,
10876,
29918,
13239,
13,
13,
1990,
8565,
957,
287,
2283,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
11030,
353,
6571,
13,
308,
13,
1678,
822,
12421,
29898,
1311,
29892,
12421,
1125,
13,
4706,
736,
1583,
29889,
11030,
29961,
5552,
29962,
13,
13,
1678,
822,
731,
29918,
5552,
29898,
1311,
29892,
1024,
29892,
12421,
1125,
13,
4706,
1583,
29889,
11030,
29961,
978,
29962,
353,
12421,
13,
13,
13,
5444,
29918,
7645,
29896,
353,
14550,
29928,
786,
5926,
1243,
934,
1476,
411,
1024,
29901,
1273,
29879,
29889,
13,
5596,
3577,
322,
770,
2983,
297,
1243,
3884,
29889,
13,
1433,
29926,
4347,
4477,
263,
1206,
29899,
1177,
29903,
1430,
29903,
1806,
18474,
2948,
363,
1243,
2983,
29889,
12008,
13,
13,
13,
1990,
3497,
29909,
26127,
1061,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
5325,
353,
5159,
13,
4706,
1583,
29889,
11940,
29918,
1990,
29918,
7039,
353,
731,
580,
13,
4706,
1583,
29889,
7382,
29918,
1958,
353,
6571,
13,
4706,
515,
564,
29926,
4347,
29889,
29873,
1631,
1053,
826,
29926,
4347,
13,
4706,
1583,
29889,
21707,
353,
826,
29926,
4347,
29889,
657,
29918,
21707,
580,
13,
4706,
1583,
29889,
11058,
353,
826,
29926,
4347,
29889,
657,
29918,
11058,
580,
13,
13,
1678,
822,
788,
29898,
1311,
29892,
4489,
1125,
13,
4706,
1820,
353,
4489,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
4571,
26282,
18929,
29918,
2882,
29903,
5607,
26027,
29918,
10145,
29897,
718,
5591,
29908,
718,
4489,
29889,
5552,
29898,
13,
9651,
8565,
957,
287,
2283,
6708,
16854,
29889,
29943,
3299,
29918,
5813,
467,
21064,
580,
13,
4706,
565,
1820,
297,
1583,
29889,
11940,
29918,
1990,
29918,
7039,
470,
1820,
297,
1583,
29889,
7382,
29918,
1958,
29901,
13,
9651,
2258,
29918,
7645,
29896,
29889,
4830,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
29943,
3299,
29918,
5813,
29897,
13,
9651,
1583,
29889,
11058,
29889,
4990,
29918,
2704,
29898,
5444,
29918,
7645,
29896,
29897,
13,
9651,
10876,
29918,
13239,
29889,
29888,
13322,
580,
13,
4706,
1583,
29889,
7382,
29918,
1958,
29961,
1989,
29962,
353,
4489,
13,
13,
1678,
822,
3889,
911,
29898,
1311,
1125,
13,
4706,
10898,
353,
5159,
13,
4706,
10898,
29889,
21843,
29898,
1311,
29889,
7382,
29918,
1958,
29889,
8149,
3101,
13,
4706,
10898,
29889,
6605,
580,
13,
4706,
363,
2224,
297,
10898,
29901,
13,
9651,
1583,
29889,
5325,
29889,
4397,
29898,
1311,
29889,
7382,
29918,
1958,
29961,
2084,
2314,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
736,
4256,
29898,
1311,
29889,
5325,
29897,
13,
13,
1678,
822,
26985,
29898,
1311,
1125,
13,
4706,
363,
285,
297,
1583,
29901,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
2683,
1378,
29899,
1159,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
1170,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
5813,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
17657,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
12194,
1430,
13381,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
13658,
4408,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
29943,
3299,
29918,
5813,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
14459,
360,
327,
2216,
362,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
29925,
11375,
10461,
29918,
29928,
2891,
29918,
12256,
8098,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
29898,
13,
18884,
376,
9882,
6376,
1230,
10802,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
4571,
26282,
18929,
29918,
1525,
29931,
1299,
18474,
29918,
10145,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
29898,
13,
18884,
376,
9882,
1976,
14977,
10802,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
4571,
26282,
18929,
29918,
2882,
29903,
5607,
26027,
29918,
10145,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
1523,
655,
922,
862,
630,
6376,
1230,
10802,
3583,
29873,
29908,
13,
462,
308,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
19795,
1529,
29918,
1660,
29925,
8254,
19386,
29918,
1525,
29931,
1299,
18474,
29918,
10145,
876,
13,
9651,
396,
1583,
29889,
21707,
29889,
8382,
703,
7895,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
6007,
6040,
1177,
1001,
876,
13,
9651,
396,
1583,
29889,
21707,
29889,
8382,
703,
7895,
5167,
3583,
29873,
29908,
718,
285,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
6007,
6040,
1177,
1001,
29918,
11116,
876,
13,
9651,
1583,
29889,
21707,
29889,
8382,
703,
2683,
1378,
29899,
1159,
13,
13,
13,
1990,
3497,
4205,
11911,
261,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11404,
1061,
29892,
3876,
29918,
3972,
29892,
3160,
29918,
13506,
267,
29922,
8516,
1125,
13,
4706,
1583,
29889,
26193,
1061,
353,
11404,
1061,
13,
4706,
565,
3876,
29918,
3972,
29889,
1975,
2541,
703,
1966,
1159,
470,
3876,
29918,
3972,
29889,
1975,
2541,
703,
458,
29908,
1125,
13,
9651,
1583,
29889,
4632,
29918,
3972,
353,
3876,
29918,
3972,
29961,
29900,
13018,
29896,
29962,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
4632,
29918,
3972,
353,
3876,
29918,
3972,
13,
4706,
1583,
29889,
4632,
29918,
3972,
353,
934,
29918,
13239,
29889,
8945,
675,
29918,
2084,
29898,
1311,
29889,
4632,
29918,
3972,
29897,
13,
4706,
1583,
29889,
2252,
381,
353,
6213,
13,
4706,
1583,
29889,
29883,
6897,
3972,
353,
6213,
13,
4706,
1583,
29889,
13506,
267,
353,
518,
1445,
29918,
13239,
29889,
8945,
675,
29918,
2084,
29898,
29886,
29897,
363,
282,
297,
3160,
29918,
13506,
267,
29962,
13,
13,
1678,
822,
6523,
29898,
1311,
1125,
13,
4706,
363,
270,
29892,
1014,
29881,
1761,
29892,
1652,
391,
297,
2897,
29889,
20919,
29898,
1311,
29889,
4632,
29918,
3972,
1125,
13,
9651,
4226,
1891,
29918,
29881,
353,
934,
29918,
13239,
29889,
8945,
675,
29918,
2084,
29898,
29881,
29897,
13,
9651,
565,
1652,
391,
29901,
13,
18884,
363,
285,
297,
1652,
391,
29901,
13,
462,
1678,
2989,
29918,
2084,
353,
934,
29918,
13239,
29889,
8945,
675,
29918,
2084,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
7122,
29898,
8945,
1891,
29918,
29881,
29892,
285,
4961,
13,
462,
1678,
2050,
353,
7700,
13,
462,
1678,
363,
10944,
297,
1583,
29889,
13506,
267,
29901,
13,
462,
4706,
565,
4226,
1891,
29918,
29881,
29889,
27382,
2541,
29898,
13506,
1125,
13,
462,
9651,
2050,
353,
5852,
13,
462,
9651,
2867,
13,
462,
1678,
565,
451,
2050,
29901,
6773,
13,
462,
1678,
934,
29918,
1062,
353,
934,
29918,
13239,
29889,
657,
29918,
17588,
29898,
8159,
29918,
2084,
29897,
13,
462,
1678,
565,
934,
29918,
1062,
29889,
13609,
580,
451,
297,
731,
18959,
2272,
2033,
1125,
6773,
13,
462,
1678,
3847,
29918,
3972,
353,
934,
29918,
13239,
29889,
8945,
675,
29918,
2084,
29898,
359,
29889,
2084,
29889,
25721,
29898,
8159,
29918,
2084,
876,
13,
462,
1678,
282,
9415,
29918,
3560,
29918,
3972,
353,
6213,
29871,
396,
2897,
29889,
2084,
29889,
9435,
2084,
580,
13,
462,
1678,
565,
3847,
29918,
3972,
1275,
1583,
29889,
4632,
29918,
3972,
29901,
13,
462,
4706,
282,
9415,
29918,
3560,
29918,
3972,
353,
5124,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
282,
9415,
29918,
3560,
29918,
3972,
353,
3847,
29918,
3972,
29961,
3560,
29918,
3972,
29889,
2248,
29898,
1311,
29889,
4632,
29918,
3972,
29897,
718,
7431,
29898,
1311,
29889,
4632,
29918,
3972,
29897,
718,
29871,
29896,
17531,
13,
462,
1678,
934,
29918,
1062,
353,
934,
29918,
13239,
29889,
657,
29918,
17588,
29898,
8159,
29918,
2084,
29897,
13,
13,
462,
1678,
4489,
353,
8565,
957,
287,
2283,
580,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
5813,
29892,
934,
29918,
13239,
29889,
657,
29918,
9290,
486,
29918,
6500,
3871,
29898,
8159,
29918,
2084,
876,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
12194,
1430,
13381,
29892,
934,
29918,
1062,
29897,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
29943,
3299,
29918,
5813,
29892,
285,
29897,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
29925,
11375,
10461,
29918,
29928,
2891,
29918,
12256,
8098,
29892,
13,
462,
462,
282,
9415,
29918,
3560,
29918,
3972,
29889,
6506,
11974,
613,
376,
1213,
876,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
4571,
26282,
18929,
29918,
1525,
29931,
1299,
18474,
29918,
10145,
29892,
282,
9415,
29918,
3560,
29918,
3972,
29897,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
4571,
26282,
18929,
29918,
2882,
29903,
5607,
26027,
29918,
10145,
29892,
3847,
29918,
3972,
29897,
13,
462,
1678,
8611,
353,
4489,
29889,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
4571,
26282,
18929,
29918,
1525,
29931,
1299,
18474,
29918,
10145,
467,
6506,
11974,
613,
376,
29989,
1159,
13,
462,
1678,
8611,
353,
8611,
29889,
6506,
703,
1966,
613,
376,
29989,
1159,
13,
462,
1678,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
19795,
1529,
29918,
1660,
29925,
8254,
19386,
29918,
1525,
29931,
1299,
18474,
29918,
10145,
29892,
13,
462,
462,
9162,
1642,
7122,
29898,
3445,
433,
1133,
29889,
5451,
703,
29989,
29908,
4961,
13,
462,
1678,
396,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
6007,
6040,
1177,
1001,
29892,
12421,
29889,
3521,
29918,
20785,
29897,
13,
462,
1678,
396,
4489,
29889,
842,
29918,
5552,
29898,
4205,
11911,
287,
2283,
6708,
16854,
29889,
6007,
6040,
1177,
1001,
29918,
11116,
29892,
12421,
29889,
3521,
29918,
20785,
29897,
13,
462,
1678,
1583,
29889,
26193,
1061,
29889,
1202,
29898,
2176,
29897,
13,
13,
4706,
1583,
29889,
26193,
1061,
29889,
9021,
911,
580,
13,
2
] |
examples/trackers.py | noah-ziethen/py-pde | 0 | 135063 | """
Using simulation trackers
=========================
This example illustrates how trackers can be used to analyze simulations.
"""
from pde import (DiffusionPDE, UnitGrid, ScalarField, MemoryStorage,
PlotTracker, PrintTracker, RealtimeIntervals)
grid = UnitGrid([32, 32]) # generate grid
state = ScalarField.random_uniform(grid) # generate initial condition
storage = MemoryStorage()
trackers = [
'progress', # show progress bar during simulation
'steady_state', # abort when steady state is reached
storage.tracker(interval=1), # store data every simulation time unit
PlotTracker(show=True), # show images during simulation
# print some output every 5 real seconds:
PrintTracker(interval=RealtimeIntervals(duration=5))
]
eq = DiffusionPDE(0.1) # define the PDE
eq.solve(state, 3, dt=0.1, tracker=trackers)
for field in storage:
print(field.integral)
| [
1,
9995,
13,
15156,
17402,
5702,
414,
13,
9166,
4936,
29922,
13,
13,
4013,
1342,
8632,
1078,
920,
5702,
414,
508,
367,
1304,
304,
27599,
23876,
29889,
13,
15945,
29908,
13,
13,
3166,
282,
311,
1053,
313,
26023,
3958,
29925,
2287,
29892,
13223,
5756,
29892,
317,
1052,
279,
3073,
29892,
18914,
10486,
29892,
13,
462,
18399,
5323,
4937,
29892,
13905,
5323,
4937,
29892,
830,
1997,
603,
12506,
29879,
29897,
13,
13,
7720,
353,
13223,
5756,
4197,
29941,
29906,
29892,
29871,
29941,
29906,
2314,
29871,
396,
5706,
6856,
13,
3859,
353,
317,
1052,
279,
3073,
29889,
8172,
29918,
29590,
29898,
7720,
29897,
29871,
396,
5706,
2847,
4195,
13,
13,
12925,
353,
18914,
10486,
580,
13,
13,
11294,
414,
353,
518,
13,
1678,
525,
18035,
742,
462,
1678,
396,
1510,
6728,
2594,
2645,
17402,
13,
1678,
525,
303,
1479,
29891,
29918,
3859,
742,
18884,
396,
27450,
746,
27357,
2106,
338,
7450,
13,
1678,
8635,
29889,
3018,
4937,
29898,
19207,
29922,
29896,
511,
259,
396,
3787,
848,
1432,
17402,
931,
5190,
13,
1678,
18399,
5323,
4937,
29898,
4294,
29922,
5574,
511,
4706,
396,
1510,
4558,
2645,
17402,
13,
1678,
396,
1596,
777,
1962,
1432,
29871,
29945,
1855,
6923,
29901,
13,
1678,
13905,
5323,
4937,
29898,
19207,
29922,
1123,
1997,
603,
12506,
29879,
29898,
19708,
29922,
29945,
876,
13,
29962,
13,
13,
1837,
353,
360,
2593,
3958,
29925,
2287,
29898,
29900,
29889,
29896,
29897,
29871,
396,
4529,
278,
349,
2287,
13,
1837,
29889,
2929,
345,
29898,
3859,
29892,
29871,
29941,
29892,
11636,
29922,
29900,
29889,
29896,
29892,
1020,
4937,
29922,
11294,
414,
29897,
13,
13,
13,
1454,
1746,
297,
8635,
29901,
13,
1678,
1596,
29898,
2671,
29889,
14146,
284,
29897,
13,
2
] |
7. Call function using a button.py | codingprivacy/Developing-GUI-with-Python-Tkinter | 1 | 162058 | import tkinter as tk
root = tk.Tk()
root.title("CodingPrivacy")
root.geometry("300x150")
def func():
print("Button is clicked!!")
btn = tk.Button(root, text="click here", command = func)
btn.pack(side="top")
root.mainloop()
| [
1,
1053,
18883,
1639,
408,
18883,
13,
13,
4632,
353,
18883,
29889,
29911,
29895,
580,
13,
4632,
29889,
3257,
703,
29907,
3689,
29925,
1150,
4135,
1159,
13,
4632,
29889,
19156,
703,
29941,
29900,
29900,
29916,
29896,
29945,
29900,
1159,
13,
13,
1753,
3653,
7295,
13,
1678,
1596,
703,
3125,
338,
11484,
6824,
1159,
13,
13,
7290,
353,
18883,
29889,
3125,
29898,
4632,
29892,
1426,
543,
3808,
1244,
613,
1899,
353,
3653,
29897,
13,
7290,
29889,
4058,
29898,
2975,
543,
3332,
1159,
13,
13,
4632,
29889,
3396,
7888,
580,
13,
2
] |
keras/lstm_my.py | mobarski/sandbox | 0 | 44358 | text = """
ala ma kota
a kot ma ale
"""
# ------------------------------------------------------------------------------
# TODO as class
chars = list(sorted(set(text))) # stabilne indeksy
len_chars = len(chars)+1
c_to_i = {c:i+1 for i,c in enumerate(chars)}
i_to_c = {i+1:c for i,c in enumerate(chars)}
def text_to_i(text):
return [c_to_i.get(c,0) for c in text]
def text_to_hot(text):
out = [[0]*len_chars for _ in text]
i_list = text_to_i(text)
for n,i in enumerate(i_list):
out[n][i] = 1
return out
# ------------------------------------------------------------------------------
import numpy as np
INPUT = 4
sentences = [text[i:i+INPUT+1] for i in range(len(text)-INPUT-1)]
x = np.zeros((len(sentences),INPUT,len_chars),dtype='b')
y = np.zeros((len(sentences),len_chars),dtype='b')
for i,text in enumerate(sentences):
x[i]=text_to_hot(text[:-1])
y[i]=text_to_hot(text[-1:])[0]
print(x)
print(y)
# ------------------------------------------------------------------------------
from keras.models import Sequential,load_model
from keras.layers import Dense,LSTM
from keras.optimizers import RMSprop
if 0:
model = Sequential()
model.add(LSTM(4, input_shape=(INPUT,len_chars)))
#model.add(LSTM(4, batch_input_shape=(3,INPUT,len_chars), stateful=True))
model.add(Dense(len_chars,activation='softmax'))
optimizer=RMSprop(learning_rate=0.1)
model.compile(optimizer,loss='categorical_crossentropy')
model.fit(x,y,batch_size=3,epochs=20)
model.save('lstm_my.h5')
else:
model = load_model('lstm_my.h5')
# ------------------------------------------------------------------------------
def sample(p_list, t=1.0):
if not t: return np.argmax(p_list)
p_list = p_list.astype('float64') # bez tego suma norm_p moze byc > 1
log_p = np.log(p_list) / t
exp_p = np.exp(log_p)
norm_p = exp_p / np.sum(exp_p)
results = np.random.multinomial(1, norm_p, 1)
return np.argmax(results)
# ------------------------------------------------------------------------------
if 0:
px = np.array([text_to_hot('kot')])
py = model.predict(px)
pi=sample(py,0)
pc=i_to_c[pi]
print(px)
print(py)
print(i_to_c)
print(pi)
print(pc)
# ------------------------------------------------------------------------------
# TODO function
text = 'ala '
out = text[:]
for j in range(20):
x = np.array([text_to_hot(text)])
py = model.predict(x)[0]
pc=i_to_c[sample(py,1.0)]
out = out + pc
text = out[-INPUT:]
print(out)
| [
1,
1426,
353,
9995,
13,
2883,
611,
413,
4616,
13,
29874,
21062,
611,
8080,
13,
15945,
29908,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
29937,
14402,
408,
770,
13,
13,
305,
1503,
353,
1051,
29898,
24582,
29898,
842,
29898,
726,
4961,
396,
16160,
484,
5704,
2039,
29891,
13,
2435,
29918,
305,
1503,
353,
7431,
29898,
305,
1503,
7240,
29896,
13,
29883,
29918,
517,
29918,
29875,
353,
426,
29883,
29901,
29875,
29974,
29896,
363,
474,
29892,
29883,
297,
26985,
29898,
305,
1503,
2915,
13,
29875,
29918,
517,
29918,
29883,
353,
426,
29875,
29974,
29896,
29901,
29883,
363,
474,
29892,
29883,
297,
26985,
29898,
305,
1503,
2915,
13,
13,
1753,
1426,
29918,
517,
29918,
29875,
29898,
726,
1125,
13,
12,
2457,
518,
29883,
29918,
517,
29918,
29875,
29889,
657,
29898,
29883,
29892,
29900,
29897,
363,
274,
297,
1426,
29962,
13,
13,
1753,
1426,
29918,
517,
29918,
8711,
29898,
726,
1125,
13,
12,
449,
353,
5519,
29900,
14178,
2435,
29918,
305,
1503,
363,
903,
297,
1426,
29962,
13,
12,
29875,
29918,
1761,
353,
1426,
29918,
517,
29918,
29875,
29898,
726,
29897,
13,
12,
1454,
302,
29892,
29875,
297,
26985,
29898,
29875,
29918,
1761,
1125,
13,
12,
12,
449,
29961,
29876,
3816,
29875,
29962,
353,
29871,
29896,
13,
12,
2457,
714,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
5215,
12655,
408,
7442,
13,
13,
1177,
12336,
353,
29871,
29946,
13,
13,
18616,
2063,
353,
518,
726,
29961,
29875,
29901,
29875,
29974,
1177,
12336,
29974,
29896,
29962,
363,
474,
297,
3464,
29898,
2435,
29898,
726,
6817,
1177,
12336,
29899,
29896,
4638,
13,
29916,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
18616,
2063,
511,
1177,
12336,
29892,
2435,
29918,
305,
1503,
511,
29881,
1853,
2433,
29890,
1495,
13,
29891,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
18616,
2063,
511,
2435,
29918,
305,
1503,
511,
29881,
1853,
2433,
29890,
1495,
13,
1454,
474,
29892,
726,
297,
26985,
29898,
18616,
2063,
1125,
13,
12,
29916,
29961,
29875,
13192,
726,
29918,
517,
29918,
8711,
29898,
726,
7503,
29899,
29896,
2314,
13,
12,
29891,
29961,
29875,
13192,
726,
29918,
517,
29918,
8711,
29898,
726,
14352,
29896,
29901,
2314,
29961,
29900,
29962,
13,
13,
2158,
29898,
29916,
29897,
13,
2158,
29898,
29891,
29897,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
3166,
13023,
294,
29889,
9794,
1053,
922,
339,
2556,
29892,
1359,
29918,
4299,
13,
3166,
13023,
294,
29889,
29277,
1053,
360,
1947,
29892,
29931,
1254,
29924,
13,
3166,
13023,
294,
29889,
20640,
19427,
1053,
390,
4345,
7728,
13,
13,
361,
29871,
29900,
29901,
13,
12,
4299,
353,
922,
339,
2556,
580,
13,
12,
4299,
29889,
1202,
29898,
29931,
1254,
29924,
29898,
29946,
29892,
1881,
29918,
12181,
7607,
1177,
12336,
29892,
2435,
29918,
305,
1503,
4961,
13,
12,
29937,
4299,
29889,
1202,
29898,
29931,
1254,
29924,
29898,
29946,
29892,
9853,
29918,
2080,
29918,
12181,
7607,
29941,
29892,
1177,
12336,
29892,
2435,
29918,
305,
1503,
511,
2106,
1319,
29922,
5574,
876,
13,
12,
4299,
29889,
1202,
29898,
29928,
1947,
29898,
2435,
29918,
305,
1503,
29892,
11236,
362,
2433,
2695,
3317,
8785,
13,
13,
12,
20640,
3950,
29922,
29934,
4345,
7728,
29898,
21891,
29918,
10492,
29922,
29900,
29889,
29896,
29897,
13,
12,
4299,
29889,
12198,
29898,
20640,
3950,
29892,
6758,
2433,
29883,
20440,
936,
29918,
19128,
296,
14441,
1495,
13,
12,
4299,
29889,
9202,
29898,
29916,
29892,
29891,
29892,
16175,
29918,
2311,
29922,
29941,
29892,
1022,
2878,
29879,
29922,
29906,
29900,
29897,
13,
12,
4299,
29889,
7620,
877,
20155,
29885,
29918,
1357,
29889,
29882,
29945,
1495,
13,
2870,
29901,
13,
12,
4299,
353,
2254,
29918,
4299,
877,
20155,
29885,
29918,
1357,
29889,
29882,
29945,
1495,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
1753,
4559,
29898,
29886,
29918,
1761,
29892,
260,
29922,
29896,
29889,
29900,
1125,
13,
12,
361,
451,
260,
29901,
736,
7442,
29889,
1191,
3317,
29898,
29886,
29918,
1761,
29897,
13,
12,
29886,
29918,
1761,
353,
282,
29918,
1761,
29889,
579,
668,
877,
7411,
29953,
29946,
1495,
396,
11151,
19237,
2533,
29874,
6056,
29918,
29886,
2730,
911,
491,
29883,
1405,
29871,
29896,
13,
12,
1188,
29918,
29886,
353,
7442,
29889,
1188,
29898,
29886,
29918,
1761,
29897,
847,
260,
13,
12,
4548,
29918,
29886,
353,
7442,
29889,
4548,
29898,
1188,
29918,
29886,
29897,
13,
12,
12324,
29918,
29886,
353,
1518,
29918,
29886,
847,
7442,
29889,
2083,
29898,
4548,
29918,
29886,
29897,
13,
12,
9902,
353,
7442,
29889,
8172,
29889,
4713,
262,
7615,
29898,
29896,
29892,
6056,
29918,
29886,
29892,
29871,
29896,
29897,
13,
12,
2457,
7442,
29889,
1191,
3317,
29898,
9902,
29897,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
361,
29871,
29900,
29901,
13,
12,
1756,
353,
7442,
29889,
2378,
4197,
726,
29918,
517,
29918,
8711,
877,
29895,
327,
1495,
2314,
13,
12,
2272,
353,
1904,
29889,
27711,
29898,
1756,
29897,
13,
13,
12,
1631,
29922,
11249,
29898,
2272,
29892,
29900,
29897,
13,
12,
6739,
29922,
29875,
29918,
517,
29918,
29883,
29961,
1631,
29962,
13,
13,
12,
2158,
29898,
1756,
29897,
13,
12,
2158,
29898,
2272,
29897,
13,
12,
2158,
29898,
29875,
29918,
517,
29918,
29883,
29897,
13,
12,
2158,
29898,
1631,
29897,
13,
12,
2158,
29898,
6739,
29897,
13,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
29937,
14402,
740,
13,
13,
726,
353,
525,
2883,
525,
13,
449,
353,
1426,
7503,
29962,
13,
1454,
432,
297,
3464,
29898,
29906,
29900,
1125,
13,
12,
29916,
353,
7442,
29889,
2378,
4197,
726,
29918,
517,
29918,
8711,
29898,
726,
29897,
2314,
13,
12,
2272,
353,
1904,
29889,
27711,
29898,
29916,
9601,
29900,
29962,
13,
12,
6739,
29922,
29875,
29918,
517,
29918,
29883,
29961,
11249,
29898,
2272,
29892,
29896,
29889,
29900,
4638,
13,
12,
449,
353,
714,
718,
22844,
13,
12,
726,
353,
714,
14352,
1177,
12336,
17531,
13,
2158,
29898,
449,
29897,
13,
2
] |
src/api/handlers/projects/tokens.py | sap-steffen/InfraBox | 50 | 23465 | <filename>src/api/handlers/projects/tokens.py<gh_stars>10-100
from flask import request, g, abort
from flask_restplus import Resource, fields
from pyinfrabox.utils import validate_uuid4
from pyinfraboxutils.ibflask import auth_required, OK
from pyinfraboxutils.ibrestplus import api
from pyinfraboxutils.token import encode_project_token
from api.namespaces import project as ns
project_token_model = api.model('ProjectToken', {
'description': fields.String(required=True),
'scope_push': fields.Boolean(required=True),
'scope_pull': fields.Boolean(required=True),
'id': fields.String(required=False)
})
@ns.route('/<project_id>/tokens')
class Tokens(Resource):
@auth_required(['user'])
@api.marshal_list_with(project_token_model)
def get(self, project_id):
p = g.db.execute_many_dict('''
SELECT description, scope_push, scope_pull, id
FROM auth_token
WHERE project_id = %s
''', [project_id])
return p
@auth_required(['user'])
@api.expect(project_token_model)
def post(self, project_id):
b = request.get_json()
result = g.db.execute_one("""
SELECT COUNT(*) FROM auth_token
WHERE project_id = %s AND description = %s
""", [project_id, b['description']])[0]
if result != 0:
return abort(400, 'Token with such a description already exists.')
result = g.db.execute_one_dict("""
INSERT INTO auth_token (description, scope_push, scope_pull, project_id)
VALUES (%s, %s, %s, %s) RETURNING id
""", [b['description'], b['scope_push'], b['scope_pull'], project_id])
token_id = result['id']
token = encode_project_token(token_id, project_id)
g.db.commit()
return OK('Successfully added token', {'token': token})
@ns.route('/<project_id>/tokens/<token_id>')
class Token(Resource):
@auth_required(['user'])
def delete(self, project_id, token_id):
if not validate_uuid4(token_id):
abort(400, "Invalid project-token uuid")
num_tokens = g.db.execute_one("""
SELECT COUNT(*) FROM auth_token
WHERE project_id = %s and id = %s
""", [project_id, token_id])[0]
if num_tokens == 0:
return abort(400, 'Such token does not exist.')
g.db.execute("""
DELETE FROM auth_token
WHERE project_id = %s and id = %s
""", [project_id, token_id])
g.db.commit()
return OK('Successfully deleted token')
| [
1,
529,
9507,
29958,
4351,
29914,
2754,
29914,
3179,
9306,
29914,
16418,
29914,
517,
12360,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
29784,
1053,
2009,
29892,
330,
29892,
27450,
13,
3166,
29784,
29918,
5060,
11242,
1053,
18981,
29892,
4235,
13,
13,
3166,
11451,
7192,
336,
1884,
29889,
13239,
1053,
12725,
29918,
25118,
29946,
13,
3166,
11451,
7192,
336,
1884,
13239,
29889,
747,
1579,
1278,
1053,
4817,
29918,
12403,
29892,
9280,
13,
3166,
11451,
7192,
336,
1884,
13239,
29889,
4626,
342,
11242,
1053,
7882,
13,
3166,
11451,
7192,
336,
1884,
13239,
29889,
6979,
1053,
19750,
29918,
4836,
29918,
6979,
13,
3166,
7882,
29889,
7039,
22459,
1053,
2060,
408,
17534,
13,
13,
4836,
29918,
6979,
29918,
4299,
353,
7882,
29889,
4299,
877,
7653,
6066,
742,
426,
13,
1678,
525,
8216,
2396,
4235,
29889,
1231,
29898,
12403,
29922,
5574,
511,
13,
1678,
525,
6078,
29918,
5910,
2396,
4235,
29889,
18146,
29898,
12403,
29922,
5574,
511,
13,
1678,
525,
6078,
29918,
26746,
2396,
4235,
29889,
18146,
29898,
12403,
29922,
5574,
511,
13,
1678,
525,
333,
2396,
4235,
29889,
1231,
29898,
12403,
29922,
8824,
29897,
13,
1800,
13,
13,
29992,
1983,
29889,
13134,
11219,
29966,
4836,
29918,
333,
20690,
517,
12360,
1495,
13,
1990,
11890,
575,
29898,
6848,
1125,
13,
13,
1678,
732,
5150,
29918,
12403,
18959,
1792,
11287,
13,
1678,
732,
2754,
29889,
3034,
23258,
29918,
1761,
29918,
2541,
29898,
4836,
29918,
6979,
29918,
4299,
29897,
13,
1678,
822,
679,
29898,
1311,
29892,
2060,
29918,
333,
1125,
13,
4706,
282,
353,
330,
29889,
2585,
29889,
7978,
29918,
13011,
29918,
8977,
877,
4907,
13,
9651,
5097,
6139,
29892,
6874,
29918,
5910,
29892,
6874,
29918,
26746,
29892,
1178,
13,
9651,
3895,
4817,
29918,
6979,
13,
9651,
5754,
2060,
29918,
333,
353,
1273,
29879,
13,
4706,
6629,
742,
518,
4836,
29918,
333,
2314,
13,
4706,
736,
282,
13,
13,
13,
1678,
732,
5150,
29918,
12403,
18959,
1792,
11287,
13,
1678,
732,
2754,
29889,
17854,
29898,
4836,
29918,
6979,
29918,
4299,
29897,
13,
1678,
822,
1400,
29898,
1311,
29892,
2060,
29918,
333,
1125,
13,
4706,
289,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
13,
4706,
1121,
353,
330,
29889,
2585,
29889,
7978,
29918,
650,
703,
15945,
13,
9651,
5097,
21122,
22798,
3895,
4817,
29918,
6979,
13,
9651,
5754,
2060,
29918,
333,
353,
1273,
29879,
5300,
6139,
353,
1273,
29879,
13,
4706,
5124,
613,
518,
4836,
29918,
333,
29892,
289,
1839,
8216,
2033,
2314,
29961,
29900,
29962,
13,
13,
4706,
565,
1121,
2804,
29871,
29900,
29901,
13,
9651,
736,
27450,
29898,
29946,
29900,
29900,
29892,
525,
6066,
411,
1316,
263,
6139,
2307,
4864,
29889,
1495,
13,
13,
4706,
1121,
353,
330,
29889,
2585,
29889,
7978,
29918,
650,
29918,
8977,
703,
15945,
13,
9651,
14482,
11646,
4817,
29918,
6979,
313,
8216,
29892,
6874,
29918,
5910,
29892,
6874,
29918,
26746,
29892,
2060,
29918,
333,
29897,
13,
9651,
15673,
313,
29995,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29892,
1273,
29879,
29897,
28081,
24015,
4214,
1178,
13,
4706,
5124,
613,
518,
29890,
1839,
8216,
7464,
289,
1839,
6078,
29918,
5910,
7464,
289,
1839,
6078,
29918,
26746,
7464,
2060,
29918,
333,
2314,
13,
13,
4706,
5993,
29918,
333,
353,
1121,
1839,
333,
2033,
13,
4706,
5993,
353,
19750,
29918,
4836,
29918,
6979,
29898,
6979,
29918,
333,
29892,
2060,
29918,
333,
29897,
13,
13,
4706,
330,
29889,
2585,
29889,
15060,
580,
13,
13,
4706,
736,
9280,
877,
14191,
3730,
2715,
5993,
742,
11117,
6979,
2396,
5993,
1800,
13,
13,
29992,
1983,
29889,
13134,
11219,
29966,
4836,
29918,
333,
20690,
517,
12360,
29914,
29966,
6979,
29918,
333,
29958,
1495,
13,
1990,
25159,
29898,
6848,
1125,
13,
13,
1678,
732,
5150,
29918,
12403,
18959,
1792,
11287,
13,
1678,
822,
5217,
29898,
1311,
29892,
2060,
29918,
333,
29892,
5993,
29918,
333,
1125,
13,
4706,
565,
451,
12725,
29918,
25118,
29946,
29898,
6979,
29918,
333,
1125,
13,
9651,
27450,
29898,
29946,
29900,
29900,
29892,
376,
13919,
2060,
29899,
6979,
318,
5416,
1159,
13,
13,
4706,
954,
29918,
517,
12360,
353,
330,
29889,
2585,
29889,
7978,
29918,
650,
703,
15945,
13,
9651,
5097,
21122,
22798,
3895,
4817,
29918,
6979,
13,
9651,
5754,
2060,
29918,
333,
353,
1273,
29879,
322,
1178,
353,
1273,
29879,
13,
4706,
5124,
613,
518,
4836,
29918,
333,
29892,
5993,
29918,
333,
2314,
29961,
29900,
29962,
13,
13,
4706,
565,
954,
29918,
517,
12360,
1275,
29871,
29900,
29901,
13,
9651,
736,
27450,
29898,
29946,
29900,
29900,
29892,
525,
29903,
987,
5993,
947,
451,
1863,
29889,
1495,
13,
13,
4706,
330,
29889,
2585,
29889,
7978,
703,
15945,
13,
462,
268,
5012,
18476,
3895,
4817,
29918,
6979,
13,
462,
268,
5754,
2060,
29918,
333,
353,
1273,
29879,
322,
1178,
353,
1273,
29879,
13,
4706,
5124,
613,
518,
4836,
29918,
333,
29892,
5993,
29918,
333,
2314,
13,
4706,
330,
29889,
2585,
29889,
15060,
580,
13,
13,
4706,
736,
9280,
877,
14191,
3730,
11132,
5993,
1495,
13,
2
] |
geolocations_service/service/brumadinho/migrations/0002_auto_20190129_2219.py | JBezerra/brumadinho_location | 666 | 160118 | # Generated by Django 2.1.3 on 2019-01-29 22:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('brumadinho', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='FoundPeople',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('full_name', models.CharField(blank=True, help_text='Full name of the found people.', max_length=150)),
('gender', models.CharField(blank=True, choices=[('M', 'Male'), ('F', 'Female')], default=None, help_text='Gender of the found people.', max_length=2, null=True)),
('status_condition', models.CharField(blank=True, choices=[('Alive', 'Alive'), ('Dead', 'Dead')], default=None, help_text='Status condition of the found people.', max_length=5, null=True)),
],
),
migrations.AddField(
model_name='visitedlocation',
name='encounter_number',
field=models.IntegerField(default=0, help_text='Number of people found in this location.'),
preserve_default=False,
),
migrations.AddField(
model_name='visitedlocation',
name='visitation_date',
field=models.DateTimeField(blank=True, help_text='Datetime of the location analysis.', null=True),
),
migrations.AlterField(
model_name='visitedlocation',
name='location',
field=models.ForeignKey(help_text='Geoposition of the visited area.', on_delete=django.db.models.deletion.PROTECT, to='brumadinho.Geolocation'),
),
migrations.AlterField(
model_name='visitedlocation',
name='reference',
field=models.CharField(help_text='Reference and information.', max_length=100),
),
migrations.AlterUniqueTogether(
name='geolocation',
unique_together={('latitude', 'longitude')},
),
migrations.AddField(
model_name='foundpeople',
name='location',
field=models.ForeignKey(blank=True, help_text='Found location.', null=True, on_delete=django.db.models.deletion.PROTECT, to='brumadinho.Geolocation'),
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29906,
29889,
29896,
29889,
29941,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29896,
29899,
29906,
29929,
29871,
29906,
29906,
29901,
29896,
29929,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
1182,
398,
328,
21307,
742,
525,
29900,
29900,
29900,
29896,
29918,
11228,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
9692,
15666,
1991,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
8159,
29918,
978,
742,
4733,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
1371,
29918,
726,
2433,
13658,
1024,
310,
278,
1476,
2305,
29889,
742,
4236,
29918,
2848,
29922,
29896,
29945,
29900,
8243,
13,
18884,
6702,
26098,
742,
4733,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
19995,
11759,
877,
29924,
742,
525,
29924,
744,
5477,
6702,
29943,
742,
525,
29943,
331,
744,
1495,
1402,
2322,
29922,
8516,
29892,
1371,
29918,
726,
2433,
29954,
1581,
310,
278,
1476,
2305,
29889,
742,
4236,
29918,
2848,
29922,
29906,
29892,
1870,
29922,
5574,
8243,
13,
18884,
6702,
4882,
29918,
16122,
742,
4733,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
19995,
11759,
877,
29909,
9258,
742,
525,
29909,
9258,
5477,
6702,
29928,
1479,
742,
525,
29928,
1479,
1495,
1402,
2322,
29922,
8516,
29892,
1371,
29918,
726,
2433,
5709,
4195,
310,
278,
1476,
2305,
29889,
742,
4236,
29918,
2848,
29922,
29945,
29892,
1870,
29922,
5574,
8243,
13,
9651,
21251,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1730,
1573,
5479,
742,
13,
9651,
1024,
2433,
3977,
5336,
29918,
4537,
742,
13,
9651,
1746,
29922,
9794,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29892,
1371,
29918,
726,
2433,
4557,
310,
2305,
1476,
297,
445,
4423,
29889,
5477,
13,
9651,
19905,
29918,
4381,
29922,
8824,
29892,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1730,
1573,
5479,
742,
13,
9651,
1024,
2433,
1730,
7018,
29918,
1256,
742,
13,
9651,
1746,
29922,
9794,
29889,
11384,
3073,
29898,
19465,
29922,
5574,
29892,
1371,
29918,
726,
2433,
16390,
5410,
310,
278,
4423,
7418,
29889,
742,
1870,
29922,
5574,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1730,
1573,
5479,
742,
13,
9651,
1024,
2433,
5479,
742,
13,
9651,
1746,
29922,
9794,
29889,
27755,
2558,
29898,
8477,
29918,
726,
2433,
7999,
459,
4490,
310,
278,
16669,
4038,
29889,
742,
373,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
8618,
4330,
1783,
29892,
304,
2433,
1182,
398,
328,
21307,
29889,
7999,
324,
10610,
5477,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1730,
1573,
5479,
742,
13,
9651,
1024,
2433,
5679,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
8477,
29918,
726,
2433,
7422,
322,
2472,
29889,
742,
4236,
29918,
2848,
29922,
29896,
29900,
29900,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
8110,
802,
29911,
12966,
29898,
13,
9651,
1024,
2433,
479,
324,
10610,
742,
13,
9651,
5412,
29918,
29873,
12966,
3790,
877,
5066,
4279,
742,
525,
5426,
4279,
1495,
1118,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
11940,
25719,
742,
13,
9651,
1024,
2433,
5479,
742,
13,
9651,
1746,
29922,
9794,
29889,
27755,
2558,
29898,
19465,
29922,
5574,
29892,
1371,
29918,
726,
2433,
9692,
4423,
29889,
742,
1870,
29922,
5574,
29892,
373,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
8618,
4330,
1783,
29892,
304,
2433,
1182,
398,
328,
21307,
29889,
7999,
324,
10610,
5477,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
mandelbruh/util.py | pereradrian/mandelbruh | 0 | 4869 | import numpy as np
def normalize(x):
return x / np.linalg.norm(x)
def norm_sq(v):
return np.dot(v,v)
def norm(v):
return np.linalg.norm(v)
def get_sub_keys(v):
if type(v) is not tuple and type(v) is not list:
return []
return [k for k in v if type(k) is str]
def to_vec3(v):
if isinstance(v, (float, int)):
return np.array([v, v, v], dtype=np.float32)
elif len(get_sub_keys(v)) > 0:
return v
else:
return np.array([v[0], v[1], v[2]], dtype=np.float32)
def to_str(x):
if type(x) is bool:
return "1" if x else "0"
elif isinstance(x, (list, tuple)):
return vec3_str(x)
else:
return str(x)
def float_str(x):
if type(x) is str:
return '_' + x
else:
return str(x)
def vec3_str(v):
if type(v) is str:
return '_' + v
elif isinstance(v, (float, int)):
return 'vec3(' + str(v) + ')'
else:
return 'vec3(' + float_str(v[0]) + ',' + float_str(v[1]) + ',' + float_str(v[2]) + ')'
def vec3_eq(v, val):
if type(v) is str:
return False
for i in range(3):
if v[i] != val[i]:
return False
return True
def smin(a, b, k):
h = min(max(0.5 + 0.5*(b - a)/k, 0.0), 1.0)
return b*(1 - h) + a*h - k*h*(1.0 - h)
def get_global(k):
if type(k) is str:
return _mandelbruh_GLOBAL_VARS[k]
elif type(k) is tuple or type(k) is list:
return np.array([get_global(i) for i in k], dtype=np.float32)
else:
return k
def set_global_float(k):
if type(k) is str:
_mandelbruh_GLOBAL_VARS[k] = 0.0
return k
def set_global_vec3(k):
if type(k) is str:
_mandelbruh_GLOBAL_VARS[k] = to_vec3((0,0,0))
return k
elif isinstance(k, (float, int)):
return to_vec3(k)
else:
sk = get_sub_keys(k)
for i in sk:
_mandelbruh_GLOBAL_VARS[i] = 0.0
return to_vec3(k)
def cond_offset(p):
if type(p) is str or np.count_nonzero(p) > 0:
return ' - vec4(' + vec3_str(p) + ', 0)'
return ''
def cond_subtract(p):
if type(p) is str or p > 0:
return ' - ' + float_str(p)
return ''
def make_color(geo):
if type(geo.color) is tuple or type(geo.color) is np.ndarray:
return 'vec4(' + vec3_str(geo.color) + ', ' + geo.glsl() + ')'
elif geo.color == 'orbit' or geo.color == 'o':
return 'vec4(orbit, ' + geo.glsl() + ')'
else:
raise Exception("Invalid coloring type")
_mandelbruh_GLOBAL_VARS = {}
| [
1,
1053,
12655,
408,
7442,
13,
13,
1753,
4226,
675,
29898,
29916,
1125,
13,
12,
2457,
921,
847,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
29916,
29897,
13,
13,
1753,
6056,
29918,
3044,
29898,
29894,
1125,
13,
12,
2457,
7442,
29889,
6333,
29898,
29894,
29892,
29894,
29897,
13,
13,
1753,
6056,
29898,
29894,
1125,
13,
12,
2457,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
29894,
29897,
13,
13,
1753,
679,
29918,
1491,
29918,
8149,
29898,
29894,
1125,
13,
12,
361,
1134,
29898,
29894,
29897,
338,
451,
18761,
322,
1134,
29898,
29894,
29897,
338,
451,
1051,
29901,
13,
12,
12,
2457,
5159,
13,
12,
2457,
518,
29895,
363,
413,
297,
325,
565,
1134,
29898,
29895,
29897,
338,
851,
29962,
13,
13,
1753,
304,
29918,
2003,
29941,
29898,
29894,
1125,
13,
12,
361,
338,
8758,
29898,
29894,
29892,
313,
7411,
29892,
938,
22164,
13,
12,
12,
2457,
7442,
29889,
2378,
4197,
29894,
29892,
325,
29892,
325,
1402,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
12,
23681,
7431,
29898,
657,
29918,
1491,
29918,
8149,
29898,
29894,
876,
1405,
29871,
29900,
29901,
13,
12,
12,
2457,
325,
13,
12,
2870,
29901,
13,
12,
12,
2457,
7442,
29889,
2378,
4197,
29894,
29961,
29900,
1402,
325,
29961,
29896,
1402,
325,
29961,
29906,
20526,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
1753,
304,
29918,
710,
29898,
29916,
1125,
13,
12,
361,
1134,
29898,
29916,
29897,
338,
6120,
29901,
13,
12,
12,
2457,
376,
29896,
29908,
565,
921,
1683,
376,
29900,
29908,
13,
12,
23681,
338,
8758,
29898,
29916,
29892,
313,
1761,
29892,
18761,
22164,
13,
12,
12,
2457,
9649,
29941,
29918,
710,
29898,
29916,
29897,
13,
12,
2870,
29901,
13,
12,
12,
2457,
851,
29898,
29916,
29897,
13,
13,
1753,
5785,
29918,
710,
29898,
29916,
1125,
13,
12,
361,
1134,
29898,
29916,
29897,
338,
851,
29901,
13,
12,
12,
2457,
22868,
29915,
718,
921,
13,
12,
2870,
29901,
13,
12,
12,
2457,
851,
29898,
29916,
29897,
13,
13,
1753,
9649,
29941,
29918,
710,
29898,
29894,
1125,
13,
12,
361,
1134,
29898,
29894,
29897,
338,
851,
29901,
13,
12,
12,
2457,
22868,
29915,
718,
325,
13,
12,
23681,
338,
8758,
29898,
29894,
29892,
313,
7411,
29892,
938,
22164,
13,
12,
12,
2457,
525,
2003,
29941,
877,
718,
851,
29898,
29894,
29897,
718,
525,
16029,
13,
12,
2870,
29901,
13,
12,
12,
2457,
525,
2003,
29941,
877,
718,
5785,
29918,
710,
29898,
29894,
29961,
29900,
2314,
718,
525,
5501,
718,
5785,
29918,
710,
29898,
29894,
29961,
29896,
2314,
718,
525,
5501,
718,
5785,
29918,
710,
29898,
29894,
29961,
29906,
2314,
718,
525,
16029,
13,
13,
1753,
9649,
29941,
29918,
1837,
29898,
29894,
29892,
659,
1125,
13,
12,
361,
1134,
29898,
29894,
29897,
338,
851,
29901,
13,
12,
12,
2457,
7700,
13,
12,
1454,
474,
297,
3464,
29898,
29941,
1125,
13,
12,
12,
361,
325,
29961,
29875,
29962,
2804,
659,
29961,
29875,
5387,
13,
12,
12,
12,
2457,
7700,
13,
12,
2457,
5852,
13,
13,
1753,
269,
1195,
29898,
29874,
29892,
289,
29892,
413,
1125,
13,
12,
29882,
353,
1375,
29898,
3317,
29898,
29900,
29889,
29945,
718,
29871,
29900,
29889,
29945,
16395,
29890,
448,
263,
6802,
29895,
29892,
29871,
29900,
29889,
29900,
511,
29871,
29896,
29889,
29900,
29897,
13,
12,
2457,
289,
16395,
29896,
448,
298,
29897,
718,
263,
29930,
29882,
448,
413,
29930,
29882,
16395,
29896,
29889,
29900,
448,
298,
29897,
13,
13,
1753,
679,
29918,
10945,
29898,
29895,
1125,
13,
12,
361,
1134,
29898,
29895,
29897,
338,
851,
29901,
13,
12,
12,
2457,
903,
29885,
392,
295,
16670,
29882,
29918,
29954,
28902,
1964,
29918,
26865,
29903,
29961,
29895,
29962,
13,
12,
23681,
1134,
29898,
29895,
29897,
338,
18761,
470,
1134,
29898,
29895,
29897,
338,
1051,
29901,
13,
12,
12,
2457,
7442,
29889,
2378,
4197,
657,
29918,
10945,
29898,
29875,
29897,
363,
474,
297,
413,
1402,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
12,
2870,
29901,
13,
12,
12,
2457,
413,
13,
13,
1753,
731,
29918,
10945,
29918,
7411,
29898,
29895,
1125,
13,
12,
361,
1134,
29898,
29895,
29897,
338,
851,
29901,
13,
12,
12,
29918,
29885,
392,
295,
16670,
29882,
29918,
29954,
28902,
1964,
29918,
26865,
29903,
29961,
29895,
29962,
353,
29871,
29900,
29889,
29900,
13,
12,
2457,
413,
13,
13,
1753,
731,
29918,
10945,
29918,
2003,
29941,
29898,
29895,
1125,
13,
12,
361,
1134,
29898,
29895,
29897,
338,
851,
29901,
13,
12,
12,
29918,
29885,
392,
295,
16670,
29882,
29918,
29954,
28902,
1964,
29918,
26865,
29903,
29961,
29895,
29962,
353,
304,
29918,
2003,
29941,
3552,
29900,
29892,
29900,
29892,
29900,
876,
13,
12,
12,
2457,
413,
13,
12,
23681,
338,
8758,
29898,
29895,
29892,
313,
7411,
29892,
938,
22164,
13,
12,
12,
2457,
304,
29918,
2003,
29941,
29898,
29895,
29897,
13,
12,
2870,
29901,
13,
12,
12,
808,
353,
679,
29918,
1491,
29918,
8149,
29898,
29895,
29897,
13,
12,
12,
1454,
474,
297,
2071,
29901,
13,
12,
12,
12,
29918,
29885,
392,
295,
16670,
29882,
29918,
29954,
28902,
1964,
29918,
26865,
29903,
29961,
29875,
29962,
353,
29871,
29900,
29889,
29900,
13,
12,
12,
2457,
304,
29918,
2003,
29941,
29898,
29895,
29897,
13,
13,
1753,
2148,
29918,
10289,
29898,
29886,
1125,
13,
12,
361,
1134,
29898,
29886,
29897,
338,
851,
470,
7442,
29889,
2798,
29918,
5464,
9171,
29898,
29886,
29897,
1405,
29871,
29900,
29901,
13,
12,
12,
2457,
525,
448,
9649,
29946,
877,
718,
9649,
29941,
29918,
710,
29898,
29886,
29897,
718,
13420,
29871,
29900,
16029,
13,
12,
2457,
6629,
13,
13,
1753,
2148,
29918,
1491,
29873,
1461,
29898,
29886,
1125,
13,
12,
361,
1134,
29898,
29886,
29897,
338,
851,
470,
282,
1405,
29871,
29900,
29901,
13,
12,
12,
2457,
525,
448,
525,
718,
5785,
29918,
710,
29898,
29886,
29897,
13,
12,
2457,
6629,
13,
13,
1753,
1207,
29918,
2780,
29898,
24756,
1125,
13,
12,
361,
1134,
29898,
24756,
29889,
2780,
29897,
338,
18761,
470,
1134,
29898,
24756,
29889,
2780,
29897,
338,
7442,
29889,
299,
2378,
29901,
13,
12,
12,
2457,
525,
2003,
29946,
877,
718,
9649,
29941,
29918,
710,
29898,
24756,
29889,
2780,
29897,
718,
13420,
525,
718,
1737,
29877,
29889,
3820,
2536,
580,
718,
525,
16029,
13,
12,
23681,
1737,
29877,
29889,
2780,
1275,
525,
272,
2966,
29915,
470,
1737,
29877,
29889,
2780,
1275,
525,
29877,
2396,
13,
12,
12,
2457,
525,
2003,
29946,
29898,
272,
2966,
29892,
525,
718,
1737,
29877,
29889,
3820,
2536,
580,
718,
525,
16029,
13,
12,
2870,
29901,
13,
12,
12,
22692,
8960,
703,
13919,
2927,
292,
1134,
1159,
13,
13,
29918,
29885,
392,
295,
16670,
29882,
29918,
29954,
28902,
1964,
29918,
26865,
29903,
353,
6571,
13,
2
] |
python_module/SuperGLU/Services/TextProcessing/Tests/Inflect/test_pl_si.py | GeneralizedLearningUtilities/SuperGLU | 8 | 168448 |
# use nosetest to run these tests
from nose.tools import eq_
import inflect
FNAME = 'tests/words.txt'
# FNAME = 'tests/list-of-nouns.txt'
# FNAME = '/usr/share/dict/british-english'
# FNAME = 'tricky.txt'
def getwords():
words = open(FNAME).readlines()
words = [w.strip() for w in words]
return words
def test_pl_si():
p = inflect.engine()
words = getwords()
for word in words:
if word == '':
continue
if word[-2:] == "'s":
continue
# if word[-1] == 's':
# continue
p.classical(all=False)
yield check_pl_si, p, word
p.classical(all=True)
yield check_pl_si, p, word
def check_pl_si(p, word):
if p.singular_noun(p.plural_noun(word, 2), 1) != word:
f = open('badsi.txt', 'a')
f.write('%s %s %s\n' % (word, p.plural_noun(word, 2),
p.singular_noun(p.plural_noun(word, 2), 1)))
f.close()
eq_(p.singular_noun(p.plural_noun(word, 2), 1), word,
msg='''word==%s
plnoun(%s)==%s
sinoun(%s)==%s''' % (word,
word, p.plural_noun(word, 2),
p.plural_noun(word, 2), p.singular_noun(p.plural_noun(word, 2), 1)))
| [
1,
29871,
13,
29937,
671,
7814,
300,
342,
304,
1065,
1438,
6987,
13,
13,
3166,
26414,
29889,
8504,
1053,
11594,
29918,
13,
13,
5215,
3041,
781,
13,
13,
29943,
5813,
353,
525,
21150,
29914,
9303,
29889,
3945,
29915,
13,
29937,
383,
5813,
353,
525,
21150,
29914,
1761,
29899,
974,
29899,
29876,
1309,
29879,
29889,
3945,
29915,
13,
29937,
383,
5813,
353,
8207,
4855,
29914,
13653,
29914,
8977,
29914,
26549,
728,
29899,
996,
1674,
29915,
13,
29937,
383,
5813,
353,
525,
509,
18219,
29889,
3945,
29915,
13,
13,
13,
1753,
679,
9303,
7295,
13,
1678,
3838,
353,
1722,
29898,
29943,
5813,
467,
949,
9012,
580,
13,
1678,
3838,
353,
518,
29893,
29889,
17010,
580,
363,
281,
297,
3838,
29962,
13,
1678,
736,
3838,
13,
13,
13,
1753,
1243,
29918,
572,
29918,
1039,
7295,
13,
1678,
282,
353,
3041,
781,
29889,
10599,
580,
13,
1678,
3838,
353,
679,
9303,
580,
13,
1678,
363,
1734,
297,
3838,
29901,
13,
4706,
565,
1734,
1275,
525,
2396,
13,
9651,
6773,
13,
4706,
565,
1734,
14352,
29906,
17531,
1275,
13577,
29879,
1115,
13,
9651,
6773,
13,
29937,
4706,
565,
1734,
14352,
29896,
29962,
1275,
525,
29879,
2396,
13,
29937,
9651,
6773,
13,
4706,
282,
29889,
1990,
936,
29898,
497,
29922,
8824,
29897,
13,
4706,
7709,
1423,
29918,
572,
29918,
1039,
29892,
282,
29892,
1734,
13,
4706,
282,
29889,
1990,
936,
29898,
497,
29922,
5574,
29897,
13,
4706,
7709,
1423,
29918,
572,
29918,
1039,
29892,
282,
29892,
1734,
13,
13,
13,
1753,
1423,
29918,
572,
29918,
1039,
29898,
29886,
29892,
1734,
1125,
13,
1678,
565,
282,
29889,
2976,
1070,
29918,
29876,
1309,
29898,
29886,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
29871,
29896,
29897,
2804,
1734,
29901,
13,
4706,
285,
353,
1722,
877,
12313,
1039,
29889,
3945,
742,
525,
29874,
1495,
13,
4706,
285,
29889,
3539,
877,
29995,
29879,
1273,
29879,
1273,
29879,
29905,
29876,
29915,
1273,
313,
1742,
29892,
282,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
13,
462,
18884,
282,
29889,
2976,
1070,
29918,
29876,
1309,
29898,
29886,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
29871,
29896,
4961,
13,
4706,
285,
29889,
5358,
580,
13,
4706,
11594,
23538,
29886,
29889,
2976,
1070,
29918,
29876,
1309,
29898,
29886,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
29871,
29896,
511,
1734,
29892,
13,
9651,
10191,
2433,
4907,
1742,
1360,
29995,
29879,
13,
572,
29876,
1309,
29414,
29879,
29897,
1360,
29995,
29879,
13,
5223,
1309,
29414,
29879,
29897,
1360,
29995,
29879,
12008,
1273,
313,
1742,
29892,
13,
9651,
1734,
29892,
282,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
13,
9651,
282,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
282,
29889,
2976,
1070,
29918,
29876,
1309,
29898,
29886,
29889,
572,
3631,
29918,
29876,
1309,
29898,
1742,
29892,
29871,
29906,
511,
29871,
29896,
4961,
13,
2
] |
[Kaleido-subs]/Dropped/FGO - Absolute Demonic Front - Babylonia/ac_Babylonia_00.py | tuilakhanh/Encoding-Projects | 57 | 92735 | <reponame>tuilakhanh/Encoding-Projects
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
import lvsfunc as lvf
from subprocess import call
core = vs.core
ts_in = r'G:/src/[Funimation] Fate Grand Order Zettai Majuu Sensen Babylonia - 00 [1080p].mkv'
src = lvf.src(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(289, src.num_frames)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio(r'Babylonia00_cut.m4a', audio_source=r'G:/src/[Funimation] Fate Grand Order Zettai Majuu Sensen Babylonia - 00 [1080p]_Track02.aac')
| [
1,
529,
276,
1112,
420,
29958,
9161,
309,
557,
5403,
29882,
29914,
14934,
29899,
25119,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
5215,
325,
481,
2470,
948,
386,
408,
7186,
13,
5215,
16147,
542,
6463,
13,
5215,
301,
4270,
9891,
408,
301,
29894,
29888,
13,
3166,
1014,
5014,
1053,
1246,
13,
13,
13,
3221,
353,
7186,
29889,
3221,
13,
1372,
29918,
262,
353,
364,
29915,
29954,
8419,
4351,
29914,
29961,
25394,
7715,
29962,
383,
403,
6265,
8170,
796,
11300,
29875,
6973,
29884,
29884,
317,
14762,
14525,
2904,
6405,
448,
29871,
29900,
29900,
518,
29896,
29900,
29947,
29900,
29886,
1822,
11256,
29894,
29915,
13,
4351,
353,
301,
29894,
29888,
29889,
4351,
29898,
1372,
29918,
262,
29897,
13,
13,
562,
353,
16147,
542,
6463,
29889,
17111,
29907,
6463,
580,
13,
13,
8590,
353,
1274,
29889,
5451,
29898,
4351,
29892,
17288,
29906,
29947,
29929,
29892,
4765,
29889,
1949,
29918,
19935,
29897,
2314,
13,
13,
562,
29889,
2040,
29918,
29939,
29886,
29918,
392,
29918,
305,
481,
2153,
29898,
8590,
29897,
13,
13,
8590,
29889,
842,
29918,
4905,
29898,
29900,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1274,
29889,
7582,
29918,
18494,
29898,
29878,
29915,
29933,
370,
2904,
6405,
29900,
29900,
29918,
7582,
29889,
29885,
29946,
29874,
742,
10348,
29918,
4993,
29922,
29878,
29915,
29954,
8419,
4351,
29914,
29961,
25394,
7715,
29962,
383,
403,
6265,
8170,
796,
11300,
29875,
6973,
29884,
29884,
317,
14762,
14525,
2904,
6405,
448,
29871,
29900,
29900,
518,
29896,
29900,
29947,
29900,
29886,
21540,
17936,
29900,
29906,
29889,
29874,
562,
1495,
13,
2
] |
Subsets and Splits