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
linkedin/__init__.py
ptwobrussell/python-linkedin
6
88616
<filename>linkedin/__init__.py __version__ = '2.0' VERSION = tuple(map(int, __version__.split('.')))
[ 1, 529, 9507, 29958, 2324, 287, 262, 29914, 1649, 2344, 26914, 2272, 13, 1649, 3259, 1649, 353, 525, 29906, 29889, 29900, 29915, 13, 16358, 353, 18761, 29898, 1958, 29898, 524, 29892, 4770, 3259, 26914, 5451, 877, 6169, 4961, 13, 2 ]
day15p1.py
minddrive/adventofcode2017
0
79774
<gh_stars>0 #!/usr/bin/env python3 def next_nums(): A = 703 B = 516 for _ in range(40000000): A *= 16807 A %= 2147483647 B *= 48271 B %= 2147483647 yield (A, B) count = 0 for newA, newB in next_nums(): if newA % 65536 == newB % 65536: count += 1 print(count)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 13, 1753, 2446, 29918, 1949, 29879, 7295, 13, 1678, 319, 353, 29871, 29955, 29900, 29941, 13, 1678, 350, 353, 29871, 29945, 29896, 29953, 13, 13, 1678, 363, 903, 297, 3464, 29898, 29946, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 1125, 13, 4706, 319, 334, 29922, 29871, 29896, 29953, 29947, 29900, 29955, 13, 4706, 319, 1273, 29922, 29871, 29906, 29896, 29946, 29955, 29946, 29947, 29941, 29953, 29946, 29955, 13, 4706, 350, 334, 29922, 29871, 29946, 29947, 29906, 29955, 29896, 13, 4706, 350, 1273, 29922, 29871, 29906, 29896, 29946, 29955, 29946, 29947, 29941, 29953, 29946, 29955, 13, 4706, 7709, 313, 29909, 29892, 350, 29897, 13, 13, 13, 2798, 353, 29871, 29900, 13, 13, 1454, 716, 29909, 29892, 716, 29933, 297, 2446, 29918, 1949, 29879, 7295, 13, 1678, 565, 716, 29909, 1273, 29871, 29953, 29945, 29945, 29941, 29953, 1275, 716, 29933, 1273, 29871, 29953, 29945, 29945, 29941, 29953, 29901, 13, 4706, 2302, 4619, 29871, 29896, 13, 13, 2158, 29898, 2798, 29897, 13, 2 ]
examples/optimization_applications/search_space_example.py
nevinadalal/Hyperactive
4
59738
<reponame>nevinadalal/Hyperactive<filename>examples/optimization_applications/search_space_example.py """ Hyperactive is very versatile, because it can handle not just numerical or string variables in the search space, but also functions. If you want to search for the best list, numpy array, dataframed or class you can put them into a function that returns them as shown in the example below. This enables many possibilities for more complex optimization applications. Neural architecture search, feature engineering, ensemble optimization and many other applications are only possible or much easier if you can put functions in the search space. """ from hyperactive import Hyperactive def function_0(): # do stuff in function0 return def function_1(): # do stuff in function1 return def function_2(): # do stuff in function2 return def list1(): return [1, 0, 0] def list2(): return [0, 1, 0] def list3(): return [0, 0, 1] # Hyperactive can handle python objects in the search space search_space = { "int": list(range(1, 10)), "float": [0.1, 0.01, 0.001], "string": ["string1", "string2"], "function": [function_0, function_1, function_2], "list": [list1, list2, list3], } def objective_function(para): # score must be a number score = 1 return score hyper = Hyperactive() hyper.add_search(objective_function, search_space, n_iter=20) hyper.run() search_data = hyper.search_data(objective_function) print("\n Search Data: \n", search_data)
[ 1, 529, 276, 1112, 420, 29958, 484, 3845, 27283, 284, 29914, 26322, 546, 4925, 29966, 9507, 29958, 19057, 29914, 20640, 2133, 29918, 932, 5795, 29914, 4478, 29918, 3493, 29918, 4773, 29889, 2272, 13, 15945, 29908, 13, 26322, 546, 4925, 338, 1407, 1224, 24285, 29892, 1363, 372, 508, 4386, 451, 925, 16259, 470, 29871, 13, 1807, 3651, 297, 278, 2740, 2913, 29892, 541, 884, 3168, 29889, 960, 366, 864, 304, 13, 4478, 363, 278, 1900, 1051, 29892, 12655, 1409, 29892, 848, 1341, 2795, 470, 770, 366, 508, 1925, 963, 964, 263, 13, 2220, 393, 3639, 963, 408, 4318, 297, 278, 1342, 2400, 29889, 13, 13, 4013, 28936, 1784, 24496, 363, 901, 4280, 13883, 8324, 29889, 13, 8139, 3631, 11258, 2740, 29892, 4682, 21639, 29892, 21285, 13883, 322, 1784, 916, 8324, 526, 29871, 13, 6194, 1950, 470, 1568, 6775, 565, 366, 508, 1925, 3168, 297, 278, 2740, 2913, 29889, 13, 15945, 29908, 13, 13, 3166, 11266, 4925, 1053, 26078, 4925, 13, 13, 13, 1753, 740, 29918, 29900, 7295, 13, 1678, 396, 437, 6433, 297, 740, 29900, 13, 1678, 736, 29871, 13, 13, 13, 1753, 740, 29918, 29896, 7295, 13, 1678, 396, 437, 6433, 297, 740, 29896, 13, 1678, 736, 29871, 13, 13, 13, 1753, 740, 29918, 29906, 7295, 13, 1678, 396, 437, 6433, 297, 740, 29906, 13, 1678, 736, 29871, 13, 13, 13, 1753, 1051, 29896, 7295, 13, 1678, 736, 518, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 29962, 13, 13, 13, 1753, 1051, 29906, 7295, 13, 1678, 736, 518, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 29962, 13, 13, 13, 1753, 1051, 29941, 7295, 13, 1678, 736, 518, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29962, 13, 13, 13, 29937, 26078, 4925, 508, 4386, 3017, 3618, 297, 278, 2740, 2913, 13, 4478, 29918, 3493, 353, 426, 13, 1678, 376, 524, 1115, 1051, 29898, 3881, 29898, 29896, 29892, 29871, 29896, 29900, 8243, 13, 1678, 376, 7411, 1115, 518, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29900, 29896, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 1402, 13, 1678, 376, 1807, 1115, 6796, 1807, 29896, 613, 376, 1807, 29906, 12436, 13, 1678, 376, 2220, 1115, 518, 2220, 29918, 29900, 29892, 740, 29918, 29896, 29892, 740, 29918, 29906, 1402, 13, 1678, 376, 1761, 1115, 518, 1761, 29896, 29892, 1051, 29906, 29892, 1051, 29941, 1402, 13, 29913, 13, 13, 13, 1753, 12091, 29918, 2220, 29898, 22752, 1125, 13, 1678, 396, 8158, 1818, 367, 263, 1353, 13, 1678, 8158, 353, 29871, 29896, 13, 1678, 736, 8158, 13, 13, 13, 24947, 353, 26078, 4925, 580, 13, 24947, 29889, 1202, 29918, 4478, 29898, 3318, 573, 29918, 2220, 29892, 2740, 29918, 3493, 29892, 302, 29918, 1524, 29922, 29906, 29900, 29897, 13, 24947, 29889, 3389, 580, 13, 13, 4478, 29918, 1272, 353, 11266, 29889, 4478, 29918, 1272, 29898, 3318, 573, 29918, 2220, 29897, 13, 13, 2158, 14182, 29876, 11856, 3630, 29901, 320, 29876, 613, 2740, 29918, 1272, 29897, 13, 2 ]
code/improved method/SpatialColumnDetection.py
astrob3rry/spatial-data-profiling
0
40300
<filename>code/improved method/SpatialColumnDetection.py import pandas as pd import sys, os import numpy as np from snapy import MinHash, LSH from fuzzywuzzy import fuzz from fuzzywuzzy import process import random import re import Settings as Settings from pyspark.sql import SparkSession spark = SparkSession.builder.appName("project-test").config("spark.some.config.option", "some-value").getOrCreate() spark.sparkContext.addPyFile("/home/wh2099/project/mmh3.py") spark.sparkContext.addPyFile("/home/wh2099/project/snapy.zip") import mmh3 from snapy import MinHash, LSH class SpatialColumnDetection: def __init__(self, df, defaultFiles, index): self.types = Settings.types self.df = df # column names self.columnNames = list(df.columns) # lower case column names self.lcColumnNames = [] # lower case column name to orginal name map self.lowerUpperDict = {} self.upperLowerDict = {} # each column is what type self.colNameType = {} self.defaultFiles = defaultFiles self.index = index # get the dtype dictionary first self.dtypes = {} for keyVal in df.dtypes: self.dtypes[keyVal[0]] = keyVal[1] def initReturnResult(self): self.colNameType["file_index"] = str(self.index) self.colNameType["total_spatial_attributes"] = 0 self.colNameType["attributes"] = {} for colName in self.columnNames: self.colNameType["attributes"][colName] = {} # change all column names to lower cases def changeLowerCase(self, ): for colName in self.columnNames: lwColName = colName.lower() self.lcColumnNames.append(lwColName) self.lowerUpperDict[lwColName] = colName self.upperLowerDict[colName] = lwColName def lcs(self, X, Y): # find the length of the strings m = len(X) n = len(Y) # declaring the array for storing the dp values L = [[None] * (n + 1) for i in range(m + 1)] """Following steps build L[m + 1][n + 1] in bottom up fashion Note: L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1]""" for i in range(m + 1): for j in range(n + 1): if i == 0 or j == 0: L[i][j] = 0 elif X[i - 1] == Y[j - 1]: L[i][j] = L[i - 1][j - 1] + 1 else: L[i][j] = max(L[i - 1][j], L[i][j - 1]) # L[m][n] contains the length of LCS of X[0..n-1] & Y[0..m-1] return L[m][n] def editDistance(self, x, y): return len(x) + len(y) - 2 * self.lcs(x, y) def detect(self, ): self.changeLowerCase() self.initReturnResult() colIndex = 0 for colName in self.columnNames: # change to lower case and trip it colNameLwStrip = colName.lower().strip() if self.detectLongitude(colNameLwStrip, colName): type = "longitude" elif self.detectLatitude(colNameLwStrip, colName): type = "latitude" elif self.detectAddress(colNameLwStrip, colName): type = "address" # elif self.detectCounty(colNameLwStrip, colName): # type = "county" elif self.detectBorough(colNameLwStrip, colName): type = "borough" elif self.detectCity(colNameLwStrip, colName): type = "city" elif self.detectState(colNameLwStrip, colName): type = "state" elif self.detectCountry(colNameLwStrip, colName): type = "country" elif self.detectZipcode(colNameLwStrip, colName): type = "zipcode" elif self.detectOtherLocationAttribute(colNameLwStrip, colName): type = "other location attribute" else: type = "not spatial attribute" self.colNameType["attributes"][colName]["type"] = type self.colNameType["attributes"][colName]["index"] = colIndex colIndex += 1 count = 0 for colName in self.columnNames: if self.colNameType["attributes"][colName]["type"] != "not spatial attribute": count += 1 self.colNameType["attributes"][colName]["is_spatial"] = True else: self.colNameType["attributes"][colName]["is_spatial"] = False self.colNameType["total_spatial_attributes"] = count return self.colNameType def commonDetectMethod(self, colNameLw, names, thredshold): for name in names: if (colNameLw in name) or (name in colNameLw): return True # use fuzz ratio, which uses the idea of levestain distance, we can specify elsewhere for name in names: if fuzz.ratio(name, colNameLw) > thredshold: return True return False # TODO: to be finish, colName passed in is lowercase, colNameLw is the lower case and stip() def detectLongitude(self, colNameLw, colName): names = ["longitude", "lon"] thredshold = 75 if self.commonDetectMethod(colNameLw, names, thredshold): return True return False # TODO: use datamart def detectLatitude(self, colNameLw, colName): names = ["latitude"] thredshold = 75 if self.commonDetectMethod(colNameLw, names, thredshold): return True return False # list all the country out, count how many of the sample column values are in country list def detectCountry(self, colNameLw,colName): # quite similar word if "county" in colNameLw: return False names = ["country"] thredshold = 100 if self.commonDetectMethod(colNameLw, names, thredshold): return True # this not work for "yes" or "no" column because "no" stands for norway if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string"): dfCountryNames = self.defaultFiles.dfCountryNames # sampling and pair wise comparison sampleSize = 500 sampleSize = min(sampleSize, self.df.count()) columnValuesSample = random.sample(self.df.select(colName).rdd.flatMap(lambda x: x).collect(), sampleSize) columnValuesSample = [x for x in columnValuesSample if type(x) == str] sampleLength = len(columnValuesSample) # meanning many are nan if sampleLength / sampleSize < 0.1: return False # get the average length of the values avgLen = sum(map(len, columnValuesSample)) / len(columnValuesSample) # compare with country code, other wise compare with country full name if avgLen <= 2.3: countries = dfCountryNames.select("Code").rdd.flatMap(lambda x: x).collect() countries = [code for code in countries if code != "NO"] else: countries = dfCountryNames.select("Name").rdd.flatMap(lambda x: x).collect() countries = [code for code in countries if code != "Norway"] # equality count count = 0 for value in columnValuesSample: for country in countries: if value.lower() == country.lower(): count += 1 break if count / sampleLength > 0.7: return True return False # list all the state out, fullname and abbreviation, can use sampling def detectState(self, colNameLw, colName): names = ["state"] thredshold = 90 if self.commonDetectMethod(colNameLw, names, thredshold): return True if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string"): dfStateNames = self.defaultFiles.dfStateNames # sampling and pair wise comparison sampleSize = 500 sampleSize = min(sampleSize, self.df.count()) columnValuesSample = random.sample(self.df.select(colName).rdd.flatMap(lambda x: x).collect(), sampleSize) columnValuesSample = [x for x in columnValuesSample if type(x) == str] sampleLength = len(columnValuesSample) # meanning many are nan if sampleLength / sampleSize < 0.1: return False # get the average length of the values avgLen = sum(map(len, columnValuesSample)) / len(columnValuesSample) # compare with state code, other wise compare with state full name if avgLen <= 2.3: states = dfStateNames.select("Code").rdd.flatMap(lambda x: x).collect() else: states = dfStateNames.select("Name").rdd.flatMap(lambda x: x).collect() # equality count count = 0 for value in columnValuesSample: for state in states: if value.lower() == state.lower(): count += 1 break if count / sampleLength > 0.6: return True return False # can use sampling def detectCity(self, colNameLw, colName): names = ["city", "town"] thredshold = 90 # if self.commonDetectMethod(colNameLw, names, thredshold): # return True # avoid capcity, ethnicity, electricity words for name in names: if colNameLw == name: return True # some column name states, county but have New York inside if self.commonDetectMethod(colNameLw, ["state", "county"], thredshold): return False if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string"): dfCityNames = self.defaultFiles.dfCityNames # sampling and pair wise comparison sampleSize = 500 sampleSize = min(sampleSize, self.df.count()) columnValuesSample = random.sample(self.df.select(colName).rdd.flatMap(lambda x: x).collect(), sampleSize) columnValuesSample = [x for x in columnValuesSample if type(x) == str] sampleLength = len(columnValuesSample) # meanning many are nan if sampleLength / sampleSize < 0.1: return False cities = dfCityNames.select("Name").rdd.flatMap(lambda x: x).collect() # equality count count = 0 for value in columnValuesSample: for city in cities: if value == city: count += 1 break if count / sampleLength > 0.6: return True return False # list all the county out, count how many of the sample column values are in county list. Not country!!! def detectCounty(self, colNameLw, colName): # quite similar word if "country" in colNameLw: return False names = ["county"] thredshold = 70 if self.commonDetectMethod(colNameLw, names, thredshold): return True if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string"): dfCountyNames = self.defaultFiles.dfCountyNames # sampling and pair wise comparison sampleSize = 500 sampleSize = min(sampleSize, self.df.count()) columnValuesSample = random.sample(self.df.select(colName).rdd.flatMap(lambda x: x).collect(), sampleSize) columnValuesSample = [x for x in columnValuesSample if type(x) == str] sampleLength = len(columnValuesSample) # meaning many are nan if sampleLength / sampleSize < 0.1: return False counties = dfCountyNames.select("Name").rdd.flatMap(lambda x: x).collect() # equality count count = 0 for value in columnValuesSample: for county in counties: if value.lower() == county.lower(): count += 1 break if count / sampleLength > 0.6: return True return False def detectBorough(self, colNameLw, colName): names = ["borough", "boro", "borocode"] thredshold = 80 if self.commonDetectMethod(colNameLw, names, thredshold): return True return False # need to use sampling def detectAddress(self, colNameLw, colName): names = ["address", "street", "block"] thredshold = 80 if self.commonDetectMethod(colNameLw, names, thredshold): # add one more condition if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string"): return True if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string"): # sampling and pair wise comparison sampleSize = 500 sampleSize = min(sampleSize, self.df.count()) columnValuesSample = random.sample(self.df.select(colName).rdd.flatMap(lambda x: x).collect(), sampleSize) columnValuesSample = [x for x in columnValuesSample if type(x) == str] sampleLength = len(columnValuesSample) # meanning many are nan if sampleLength / sampleSize < 0.1: return False # get the average length of the values avgLen = sum(map(len, columnValuesSample)) / len(columnValuesSample) # probably not address if avgLen < 5: return False # use regex expression, detect full address regexPattern =""" \b\d{1,6} +.{2,25}\b(avenue|ave|court|ct|street|st| drive|dr|lane|ln|road|rd|blvd|plaza|parkway|pkwy| boulevard|)[.,]?(.{0,25} +\b\d{5}\b)? """ count = 0 for x in columnValuesSample: result = re.match(regexPattern, x) if result != None: if result.group() > 10: count += 1 if count / sampleLength > 0.6: return True # use regex expression to detect street name like regexPattern2 =""" \d+[ ](?:[A-Za-z0-9.-]+[ ]?)+(?:Avenue|Lane|Road| Boulevard|Drive|Street|Ave|Dr|Rd|Blvd|Ln|St)\.? """ count = 0 for x in columnValuesSample: result = re.match(regexPattern2, x) if result != None: if result.group() > 10: count += 1 if count / sampleLength > 0.7: return True # TODO use the addr_detection package # try: # clf2 = Postal_clf() # result = clf2.predict(columnValuesSample) # except: # return False return False # need to use sampling, and regex def detectZipcode(self, colNameLw, colName): names = ["zip", "zipcode", "zcode", "postcode"] thredshold = 70 if self.commonDetectMethod(colNameLw, names, thredshold): return True if (self.dtypes[colName] == object) or (self.dtypes[colName] == "string") or \ (self.dtypes[colName] == "int") or (self.dtypes[colName] == "bigint"): # sampling and pair wise comparison sampleSize = 500 sampleSize = min(sampleSize, self.df.count()) columnValuesSample = random.sample(self.df.select(colName).rdd.flatMap(lambda x: x).collect(), sampleSize) if (self.dtypes[colName] == "int") or (self.dtypes[colName] == "bigint"): columnValuesSample = [str(x) for x in columnValuesSample] else: columnValuesSample = [x for x in columnValuesSample if type(x) == str] sampleLength = len(columnValuesSample) # meanning many are nan if sampleLength / sampleSize < 0.1: return False # just us country here, can use other api? regexPattern = r"^[0-9]{5}(?:-[0-9]{3})?$" matches = [] for x in columnValuesSample: result = re.match(regexPattern, x) if result != None: matches.append(bool(x)) count = sum([bool(x) for x in matches]) if count / sampleLength > 0.6: return True return False def detectOtherLocationAttribute(self, colNameLw, colName): names = ["location", "home", "house", "lot", "bin", "bbl", "nta", "geom", "precinct", "census_tract", "community", "district", "building"] thredshold = 70 if self.commonDetectMethod(colNameLw, names, thredshold): return True return False
[ 1, 529, 9507, 29958, 401, 29914, 326, 771, 1490, 1158, 29914, 29903, 5031, 616, 4409, 29928, 2650, 428, 29889, 2272, 13, 5215, 11701, 408, 10518, 13, 5215, 10876, 29892, 2897, 13, 5215, 12655, 408, 7442, 13, 3166, 15101, 29891, 1053, 3080, 10438, 29892, 365, 7068, 13, 3166, 285, 3365, 1537, 29893, 3365, 1537, 1053, 285, 18813, 13, 3166, 285, 3365, 1537, 29893, 3365, 1537, 1053, 1889, 13, 5215, 4036, 13, 5215, 337, 13, 5215, 19215, 408, 19215, 13, 13, 3166, 282, 952, 6378, 29889, 2850, 1053, 20814, 7317, 13, 13, 12597, 353, 20814, 7317, 29889, 16409, 29889, 932, 1170, 703, 4836, 29899, 1688, 2564, 2917, 703, 12597, 29889, 5372, 29889, 2917, 29889, 3385, 613, 376, 5372, 29899, 1767, 2564, 657, 2816, 4391, 580, 13, 12597, 29889, 12597, 2677, 29889, 1202, 19737, 2283, 11974, 5184, 29914, 1332, 29906, 29900, 29929, 29929, 29914, 4836, 29914, 4317, 29882, 29941, 29889, 2272, 1159, 13, 12597, 29889, 12597, 2677, 29889, 1202, 19737, 2283, 11974, 5184, 29914, 1332, 29906, 29900, 29929, 29929, 29914, 4836, 29914, 29879, 8971, 29891, 29889, 7554, 1159, 13, 5215, 5654, 29882, 29941, 13, 3166, 15101, 29891, 1053, 3080, 10438, 29892, 365, 7068, 13, 13, 1990, 1706, 15238, 4409, 29928, 2650, 428, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4489, 29892, 2322, 10547, 29892, 2380, 1125, 13, 4706, 1583, 29889, 8768, 353, 19215, 29889, 8768, 13, 13, 4706, 1583, 29889, 2176, 353, 4489, 13, 4706, 396, 1897, 2983, 13, 4706, 1583, 29889, 4914, 8659, 353, 1051, 29898, 2176, 29889, 13099, 29897, 13, 4706, 396, 5224, 1206, 1897, 2983, 13, 4706, 1583, 29889, 29880, 29883, 4409, 8659, 353, 5159, 13, 4706, 396, 5224, 1206, 1897, 1024, 304, 1638, 979, 1024, 2910, 13, 4706, 1583, 29889, 13609, 26214, 21533, 353, 6571, 13, 4706, 1583, 29889, 21064, 19357, 21533, 353, 6571, 13, 4706, 396, 1269, 1897, 338, 825, 1134, 13, 4706, 1583, 29889, 1054, 1170, 1542, 353, 6571, 13, 13, 4706, 1583, 29889, 4381, 10547, 353, 2322, 10547, 13, 4706, 1583, 29889, 2248, 353, 2380, 13, 4706, 396, 679, 278, 26688, 8600, 937, 13, 4706, 1583, 29889, 29881, 8768, 353, 6571, 13, 4706, 363, 1820, 1440, 297, 4489, 29889, 29881, 8768, 29901, 13, 9651, 1583, 29889, 29881, 8768, 29961, 1989, 1440, 29961, 29900, 5262, 353, 1820, 1440, 29961, 29896, 29962, 13, 13, 1678, 822, 2069, 11609, 3591, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1054, 1170, 1542, 3366, 1445, 29918, 2248, 3108, 353, 851, 29898, 1311, 29889, 2248, 29897, 13, 4706, 1583, 29889, 1054, 1170, 1542, 3366, 7827, 29918, 1028, 15238, 29918, 15697, 3108, 353, 29871, 29900, 13, 4706, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 353, 6571, 13, 4706, 363, 784, 1170, 297, 1583, 29889, 4914, 8659, 29901, 13, 9651, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 29961, 1054, 1170, 29962, 353, 6571, 13, 13, 13, 1678, 396, 1735, 599, 1897, 2983, 304, 5224, 4251, 13, 1678, 822, 1735, 19357, 8259, 29898, 1311, 29892, 29871, 1125, 13, 4706, 363, 784, 1170, 297, 1583, 29889, 4914, 8659, 29901, 13, 9651, 301, 29893, 1625, 1170, 353, 784, 1170, 29889, 13609, 580, 13, 9651, 1583, 29889, 29880, 29883, 4409, 8659, 29889, 4397, 29898, 29880, 29893, 1625, 1170, 29897, 13, 9651, 1583, 29889, 13609, 26214, 21533, 29961, 29880, 29893, 1625, 1170, 29962, 353, 784, 1170, 13, 9651, 1583, 29889, 21064, 19357, 21533, 29961, 1054, 1170, 29962, 353, 301, 29893, 1625, 1170, 13, 13, 1678, 822, 301, 2395, 29898, 1311, 29892, 1060, 29892, 612, 1125, 13, 4706, 396, 1284, 278, 3309, 310, 278, 6031, 13, 4706, 286, 353, 7431, 29898, 29990, 29897, 13, 4706, 302, 353, 7431, 29898, 29979, 29897, 13, 13, 4706, 396, 25136, 278, 1409, 363, 15446, 278, 270, 29886, 1819, 13, 4706, 365, 353, 5519, 8516, 29962, 334, 313, 29876, 718, 29871, 29896, 29897, 363, 474, 297, 3464, 29898, 29885, 718, 29871, 29896, 4638, 13, 13, 4706, 9995, 29943, 2952, 292, 6576, 2048, 365, 29961, 29885, 718, 29871, 29896, 3816, 29876, 718, 29871, 29896, 29962, 297, 5970, 701, 13460, 29871, 13, 4706, 3940, 29901, 365, 29961, 29875, 3816, 29926, 29962, 3743, 3309, 310, 365, 9295, 310, 1060, 29961, 29900, 636, 29875, 29899, 29896, 29962, 29871, 13, 4706, 322, 612, 29961, 29900, 636, 29926, 29899, 29896, 29962, 15945, 29908, 13, 4706, 363, 474, 297, 3464, 29898, 29885, 718, 29871, 29896, 1125, 13, 9651, 363, 432, 297, 3464, 29898, 29876, 718, 29871, 29896, 1125, 13, 18884, 565, 474, 1275, 29871, 29900, 470, 432, 1275, 29871, 29900, 29901, 13, 462, 1678, 365, 29961, 29875, 3816, 29926, 29962, 353, 29871, 29900, 13, 18884, 25342, 1060, 29961, 29875, 448, 29871, 29896, 29962, 1275, 612, 29961, 29926, 448, 29871, 29896, 5387, 13, 462, 1678, 365, 29961, 29875, 3816, 29926, 29962, 353, 365, 29961, 29875, 448, 29871, 29896, 3816, 29926, 448, 29871, 29896, 29962, 718, 29871, 29896, 13, 18884, 1683, 29901, 13, 462, 1678, 365, 29961, 29875, 3816, 29926, 29962, 353, 4236, 29898, 29931, 29961, 29875, 448, 29871, 29896, 3816, 29926, 1402, 365, 29961, 29875, 3816, 29926, 448, 29871, 29896, 2314, 13, 13, 462, 1678, 396, 365, 29961, 29885, 3816, 29876, 29962, 3743, 278, 3309, 310, 365, 9295, 310, 1060, 29961, 29900, 636, 29876, 29899, 29896, 29962, 669, 612, 29961, 29900, 636, 29885, 29899, 29896, 29962, 13, 4706, 736, 365, 29961, 29885, 3816, 29876, 29962, 13, 13, 1678, 822, 3863, 27469, 29898, 1311, 29892, 921, 29892, 343, 1125, 13, 4706, 736, 7431, 29898, 29916, 29897, 718, 7431, 29898, 29891, 29897, 448, 29871, 29906, 334, 1583, 29889, 29880, 2395, 29898, 29916, 29892, 343, 29897, 13, 13, 1678, 822, 6459, 29898, 1311, 29892, 29871, 1125, 13, 4706, 1583, 29889, 3167, 19357, 8259, 580, 13, 4706, 1583, 29889, 2344, 11609, 3591, 580, 13, 4706, 784, 3220, 353, 29871, 29900, 13, 4706, 363, 784, 1170, 297, 1583, 29889, 4914, 8659, 29901, 13, 9651, 396, 1735, 304, 5224, 1206, 322, 17487, 372, 13, 9651, 784, 1170, 29931, 29893, 855, 6472, 353, 784, 1170, 29889, 13609, 2141, 17010, 580, 13, 9651, 565, 1583, 29889, 4801, 522, 8208, 4279, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 5426, 4279, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 13992, 4279, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 5066, 4279, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 7061, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 7328, 29908, 13, 9651, 396, 25342, 1583, 29889, 4801, 522, 3981, 29891, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 9651, 396, 268, 1134, 353, 376, 2798, 29891, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 29933, 272, 820, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 22187, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 16885, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 12690, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 2792, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 3859, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 20779, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 13509, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 26264, 401, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 7554, 401, 29908, 13, 9651, 25342, 1583, 29889, 4801, 522, 16107, 6508, 6708, 29898, 1054, 1170, 29931, 29893, 855, 6472, 29892, 784, 1170, 1125, 13, 18884, 1134, 353, 376, 1228, 4423, 5352, 29908, 13, 9651, 1683, 29901, 13, 18884, 1134, 353, 376, 1333, 18652, 5352, 29908, 13, 13, 9651, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 29961, 1054, 1170, 29962, 3366, 1853, 3108, 353, 1134, 13, 9651, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 29961, 1054, 1170, 29962, 3366, 2248, 3108, 353, 784, 3220, 13, 9651, 784, 3220, 4619, 29871, 29896, 13, 13, 4706, 2302, 353, 29871, 29900, 13, 4706, 363, 784, 1170, 297, 1583, 29889, 4914, 8659, 29901, 13, 9651, 565, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 29961, 1054, 1170, 29962, 3366, 1853, 3108, 2804, 376, 1333, 18652, 5352, 1115, 13, 18884, 2302, 4619, 29871, 29896, 13, 18884, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 29961, 1054, 1170, 29962, 3366, 275, 29918, 1028, 15238, 3108, 353, 5852, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 1054, 1170, 1542, 3366, 15697, 3108, 29961, 1054, 1170, 29962, 3366, 275, 29918, 1028, 15238, 3108, 353, 7700, 13, 4706, 1583, 29889, 1054, 1170, 1542, 3366, 7827, 29918, 1028, 15238, 29918, 15697, 3108, 353, 2302, 13, 13, 4706, 736, 1583, 29889, 1054, 1170, 1542, 13, 13, 1678, 822, 3619, 6362, 522, 4062, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 4706, 363, 1024, 297, 2983, 29901, 13, 9651, 565, 313, 1054, 1170, 29931, 29893, 297, 1024, 29897, 470, 313, 978, 297, 784, 1170, 29931, 29893, 1125, 13, 18884, 736, 5852, 13, 4706, 396, 671, 285, 18813, 11959, 29892, 607, 3913, 278, 2969, 310, 454, 10147, 475, 5418, 29892, 591, 508, 6084, 17551, 13, 4706, 363, 1024, 297, 2983, 29901, 13, 9651, 565, 285, 18813, 29889, 3605, 601, 29898, 978, 29892, 784, 1170, 29931, 29893, 29897, 1405, 266, 1127, 845, 1025, 29901, 13, 18884, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 396, 14402, 29901, 304, 367, 8341, 29892, 784, 1170, 4502, 297, 338, 5224, 4878, 29892, 784, 1170, 29931, 29893, 338, 278, 5224, 1206, 322, 380, 666, 580, 13, 1678, 822, 6459, 8208, 4279, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 5426, 4279, 613, 376, 12957, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29955, 29945, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 396, 14402, 29901, 671, 1418, 314, 442, 13, 1678, 822, 6459, 13992, 4279, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 5066, 4279, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29955, 29945, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 396, 1051, 599, 278, 4234, 714, 29892, 2302, 920, 1784, 310, 278, 4559, 1897, 1819, 526, 297, 4234, 1051, 13, 1678, 822, 6459, 20779, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 1054, 1170, 1125, 13, 4706, 396, 3755, 2788, 1734, 13, 4706, 565, 376, 2798, 29891, 29908, 297, 784, 1170, 29931, 29893, 29901, 13, 9651, 736, 7700, 13, 4706, 2983, 353, 6796, 13509, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29896, 29900, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 13, 4706, 396, 445, 451, 664, 363, 376, 3582, 29908, 470, 376, 1217, 29908, 1897, 1363, 376, 1217, 29908, 15028, 363, 3643, 1582, 13, 4706, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 29908, 1125, 13, 9651, 4489, 20779, 8659, 353, 1583, 29889, 4381, 10547, 29889, 2176, 20779, 8659, 13, 9651, 396, 23460, 322, 5101, 19396, 10230, 13, 9651, 4559, 3505, 353, 29871, 29945, 29900, 29900, 13, 9651, 4559, 3505, 353, 1375, 29898, 11249, 3505, 29892, 1583, 29889, 2176, 29889, 2798, 3101, 13, 9651, 1897, 9065, 17708, 353, 4036, 29889, 11249, 29898, 1311, 29889, 2176, 29889, 2622, 29898, 1054, 1170, 467, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 3285, 4559, 3505, 29897, 13, 9651, 1897, 9065, 17708, 353, 518, 29916, 363, 921, 297, 1897, 9065, 17708, 565, 1134, 29898, 29916, 29897, 1275, 851, 29962, 13, 9651, 4559, 6513, 353, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 592, 9450, 1784, 526, 23432, 13, 9651, 565, 4559, 6513, 847, 4559, 3505, 529, 29871, 29900, 29889, 29896, 29901, 13, 18884, 736, 7700, 13, 13, 9651, 396, 679, 278, 6588, 3309, 310, 278, 1819, 13, 9651, 1029, 29887, 21515, 353, 2533, 29898, 1958, 29898, 2435, 29892, 1897, 9065, 17708, 876, 847, 7431, 29898, 4914, 9065, 17708, 29897, 13, 13, 9651, 396, 7252, 411, 4234, 775, 29892, 916, 19396, 7252, 411, 4234, 2989, 1024, 13, 9651, 565, 1029, 29887, 21515, 5277, 29871, 29906, 29889, 29941, 29901, 13, 18884, 10916, 353, 4489, 20779, 8659, 29889, 2622, 703, 3399, 2564, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 580, 13, 18884, 10916, 353, 518, 401, 363, 775, 297, 10916, 565, 775, 2804, 376, 6632, 3108, 13, 9651, 1683, 29901, 13, 18884, 10916, 353, 4489, 20779, 8659, 29889, 2622, 703, 1170, 2564, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 580, 13, 18884, 10916, 353, 518, 401, 363, 775, 297, 10916, 565, 775, 2804, 376, 29940, 272, 1582, 3108, 13, 13, 9651, 396, 17193, 2302, 13, 9651, 2302, 353, 29871, 29900, 13, 9651, 363, 995, 297, 1897, 9065, 17708, 29901, 13, 18884, 363, 4234, 297, 10916, 29901, 13, 462, 1678, 565, 995, 29889, 13609, 580, 1275, 4234, 29889, 13609, 7295, 13, 462, 4706, 2302, 4619, 29871, 29896, 13, 462, 4706, 2867, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29955, 29901, 13, 18884, 736, 5852, 13, 13, 4706, 736, 7700, 13, 13, 1678, 396, 1051, 599, 278, 2106, 714, 29892, 2989, 978, 322, 29759, 14641, 29892, 508, 671, 23460, 13, 1678, 822, 6459, 2792, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 3859, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29929, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 29908, 1125, 13, 9651, 4489, 2792, 8659, 353, 1583, 29889, 4381, 10547, 29889, 2176, 2792, 8659, 13, 9651, 396, 23460, 322, 5101, 19396, 10230, 13, 9651, 4559, 3505, 353, 29871, 29945, 29900, 29900, 13, 9651, 4559, 3505, 353, 1375, 29898, 11249, 3505, 29892, 1583, 29889, 2176, 29889, 2798, 3101, 13, 9651, 1897, 9065, 17708, 353, 4036, 29889, 11249, 29898, 1311, 29889, 2176, 29889, 2622, 29898, 1054, 1170, 467, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 3285, 4559, 3505, 29897, 13, 9651, 1897, 9065, 17708, 353, 518, 29916, 363, 921, 297, 1897, 9065, 17708, 565, 1134, 29898, 29916, 29897, 1275, 851, 29962, 13, 9651, 4559, 6513, 353, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 592, 9450, 1784, 526, 23432, 13, 9651, 565, 4559, 6513, 847, 4559, 3505, 529, 29871, 29900, 29889, 29896, 29901, 13, 18884, 736, 7700, 13, 13, 9651, 396, 679, 278, 6588, 3309, 310, 278, 1819, 13, 9651, 1029, 29887, 21515, 353, 2533, 29898, 1958, 29898, 2435, 29892, 1897, 9065, 17708, 876, 847, 7431, 29898, 4914, 9065, 17708, 29897, 13, 13, 9651, 396, 7252, 411, 2106, 775, 29892, 916, 19396, 7252, 411, 2106, 2989, 1024, 13, 9651, 565, 1029, 29887, 21515, 5277, 29871, 29906, 29889, 29941, 29901, 13, 18884, 5922, 353, 4489, 2792, 8659, 29889, 2622, 703, 3399, 2564, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 580, 13, 9651, 1683, 29901, 13, 18884, 5922, 353, 4489, 2792, 8659, 29889, 2622, 703, 1170, 2564, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 580, 13, 13, 9651, 396, 17193, 2302, 13, 9651, 2302, 353, 29871, 29900, 13, 9651, 363, 995, 297, 1897, 9065, 17708, 29901, 13, 18884, 363, 2106, 297, 5922, 29901, 13, 462, 1678, 565, 995, 29889, 13609, 580, 1275, 2106, 29889, 13609, 7295, 13, 462, 4706, 2302, 4619, 29871, 29896, 13, 462, 4706, 2867, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29953, 29901, 13, 18884, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 396, 508, 671, 23460, 13, 1678, 822, 6459, 16885, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 12690, 613, 376, 27734, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29929, 29900, 13, 4706, 396, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 4706, 396, 268, 736, 5852, 13, 4706, 396, 4772, 2117, 12690, 29892, 11314, 7823, 537, 29892, 12646, 537, 3838, 13, 4706, 363, 1024, 297, 2983, 29901, 13, 9651, 565, 784, 1170, 29931, 29893, 1275, 1024, 29901, 13, 18884, 736, 5852, 13, 4706, 396, 777, 1897, 1024, 5922, 29892, 15178, 541, 505, 1570, 3088, 2768, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 6796, 3859, 613, 376, 2798, 29891, 12436, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 7700, 13, 4706, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 29908, 1125, 13, 9651, 4489, 16885, 8659, 353, 1583, 29889, 4381, 10547, 29889, 2176, 16885, 8659, 13, 9651, 396, 23460, 322, 5101, 19396, 10230, 13, 9651, 4559, 3505, 353, 29871, 29945, 29900, 29900, 13, 9651, 4559, 3505, 353, 1375, 29898, 11249, 3505, 29892, 1583, 29889, 2176, 29889, 2798, 3101, 13, 9651, 1897, 9065, 17708, 353, 4036, 29889, 11249, 29898, 1311, 29889, 2176, 29889, 2622, 29898, 1054, 1170, 467, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 3285, 4559, 3505, 29897, 13, 9651, 1897, 9065, 17708, 353, 518, 29916, 363, 921, 297, 1897, 9065, 17708, 565, 1134, 29898, 29916, 29897, 1275, 851, 29962, 13, 9651, 4559, 6513, 353, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 592, 9450, 1784, 526, 23432, 13, 9651, 565, 4559, 6513, 847, 4559, 3505, 529, 29871, 29900, 29889, 29896, 29901, 13, 18884, 736, 7700, 13, 13, 9651, 14368, 353, 4489, 16885, 8659, 29889, 2622, 703, 1170, 2564, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 580, 13, 9651, 396, 17193, 2302, 13, 9651, 2302, 353, 29871, 29900, 13, 9651, 363, 995, 297, 1897, 9065, 17708, 29901, 13, 18884, 363, 4272, 297, 14368, 29901, 13, 462, 1678, 565, 995, 1275, 4272, 29901, 13, 462, 4706, 2302, 4619, 29871, 29896, 13, 462, 4706, 2867, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29953, 29901, 13, 18884, 736, 5852, 13, 4706, 736, 7700, 13, 13, 4706, 396, 1051, 599, 278, 15178, 714, 29892, 2302, 920, 1784, 310, 278, 4559, 1897, 1819, 526, 297, 15178, 1051, 29889, 2216, 4234, 21004, 13, 13, 1678, 822, 6459, 3981, 29891, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 396, 3755, 2788, 1734, 13, 4706, 565, 376, 13509, 29908, 297, 784, 1170, 29931, 29893, 29901, 13, 9651, 736, 7700, 13, 4706, 2983, 353, 6796, 2798, 29891, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29955, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 29908, 1125, 13, 9651, 4489, 3981, 29891, 8659, 353, 1583, 29889, 4381, 10547, 29889, 2176, 3981, 29891, 8659, 13, 9651, 396, 23460, 322, 5101, 19396, 10230, 13, 9651, 4559, 3505, 353, 29871, 29945, 29900, 29900, 13, 9651, 4559, 3505, 353, 1375, 29898, 11249, 3505, 29892, 1583, 29889, 2176, 29889, 2798, 3101, 13, 9651, 1897, 9065, 17708, 353, 4036, 29889, 11249, 29898, 1311, 29889, 2176, 29889, 2622, 29898, 1054, 1170, 467, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 3285, 4559, 3505, 29897, 13, 9651, 1897, 9065, 17708, 353, 518, 29916, 363, 921, 297, 1897, 9065, 17708, 565, 1134, 29898, 29916, 29897, 1275, 851, 29962, 13, 9651, 4559, 6513, 353, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 6593, 1784, 526, 23432, 13, 9651, 565, 4559, 6513, 847, 4559, 3505, 529, 29871, 29900, 29889, 29896, 29901, 13, 18884, 736, 7700, 13, 13, 9651, 2302, 583, 353, 4489, 3981, 29891, 8659, 29889, 2622, 703, 1170, 2564, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 580, 13, 9651, 396, 17193, 2302, 13, 9651, 2302, 353, 29871, 29900, 13, 9651, 363, 995, 297, 1897, 9065, 17708, 29901, 13, 18884, 363, 15178, 297, 2302, 583, 29901, 13, 462, 1678, 565, 995, 29889, 13609, 580, 1275, 15178, 29889, 13609, 7295, 13, 462, 4706, 2302, 4619, 29871, 29896, 13, 462, 4706, 2867, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29953, 29901, 13, 18884, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 822, 6459, 29933, 272, 820, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 22187, 613, 376, 4089, 29877, 613, 376, 4089, 29877, 401, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29947, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 396, 817, 304, 671, 23460, 13, 1678, 822, 6459, 7061, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 7328, 613, 376, 29352, 613, 376, 1271, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29947, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 396, 788, 697, 901, 4195, 13, 9651, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 29908, 1125, 13, 18884, 736, 5852, 13, 4706, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 29908, 1125, 13, 9651, 396, 23460, 322, 5101, 19396, 10230, 13, 9651, 4559, 3505, 353, 29871, 29945, 29900, 29900, 13, 9651, 4559, 3505, 353, 1375, 29898, 11249, 3505, 29892, 1583, 29889, 2176, 29889, 2798, 3101, 13, 9651, 1897, 9065, 17708, 353, 4036, 29889, 11249, 29898, 1311, 29889, 2176, 29889, 2622, 29898, 1054, 1170, 467, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 3285, 4559, 3505, 29897, 13, 9651, 1897, 9065, 17708, 353, 518, 29916, 363, 921, 297, 1897, 9065, 17708, 565, 1134, 29898, 29916, 29897, 1275, 851, 29962, 13, 9651, 4559, 6513, 353, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 592, 9450, 1784, 526, 23432, 13, 9651, 565, 4559, 6513, 847, 4559, 3505, 529, 29871, 29900, 29889, 29896, 29901, 13, 18884, 736, 7700, 13, 13, 9651, 396, 679, 278, 6588, 3309, 310, 278, 1819, 13, 9651, 1029, 29887, 21515, 353, 2533, 29898, 1958, 29898, 2435, 29892, 1897, 9065, 17708, 876, 847, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 3117, 451, 3211, 13, 9651, 565, 1029, 29887, 21515, 529, 29871, 29945, 29901, 13, 18884, 736, 7700, 13, 13, 9651, 396, 671, 6528, 4603, 29892, 6459, 2989, 3211, 13, 9651, 6528, 17144, 353, 15945, 29908, 13, 9651, 320, 29890, 29905, 29881, 29912, 29896, 29892, 29953, 29913, 718, 29889, 29912, 29906, 29892, 29906, 29945, 1012, 29890, 29898, 3496, 434, 29989, 1351, 29989, 27845, 29989, 312, 29989, 29352, 29989, 303, 29989, 13, 9651, 7899, 29989, 7707, 29989, 25821, 29989, 3083, 29989, 9972, 29989, 5499, 29989, 2204, 27491, 29989, 13974, 1362, 29989, 6378, 1582, 29989, 29886, 11022, 29891, 29989, 13, 9651, 16380, 2608, 538, 29989, 9601, 1696, 29962, 29973, 11891, 29912, 29900, 29892, 29906, 29945, 29913, 17501, 29890, 29905, 29881, 29912, 29945, 1012, 29890, 6877, 13, 9651, 9995, 13, 9651, 2302, 353, 29871, 29900, 13, 9651, 363, 921, 297, 1897, 9065, 17708, 29901, 13, 18884, 1121, 353, 337, 29889, 4352, 29898, 13087, 17144, 29892, 921, 29897, 13, 18884, 565, 1121, 2804, 6213, 29901, 13, 462, 1678, 565, 1121, 29889, 2972, 580, 1405, 29871, 29896, 29900, 29901, 13, 462, 4706, 2302, 4619, 29871, 29896, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29953, 29901, 13, 18884, 736, 5852, 13, 13, 9651, 396, 671, 6528, 4603, 304, 6459, 11952, 1024, 763, 13, 9651, 6528, 17144, 29906, 353, 15945, 29908, 13, 9651, 320, 29881, 29974, 29961, 29871, 850, 29973, 10834, 29909, 29899, 29999, 29874, 29899, 29920, 29900, 29899, 29929, 9229, 10062, 29961, 4514, 29973, 7240, 10780, 29901, 29909, 9947, 29989, 29931, 1662, 29989, 9588, 328, 29989, 13, 9651, 12476, 2608, 538, 29989, 29928, 4401, 29989, 855, 4521, 29989, 29909, 345, 29989, 25639, 29989, 29934, 29881, 29989, 10358, 27491, 29989, 29931, 29876, 29989, 855, 2144, 29889, 29973, 13, 9651, 9995, 13, 9651, 2302, 353, 29871, 29900, 13, 9651, 363, 921, 297, 1897, 9065, 17708, 29901, 13, 18884, 1121, 353, 337, 29889, 4352, 29898, 13087, 17144, 29906, 29892, 921, 29897, 13, 18884, 565, 1121, 2804, 6213, 29901, 13, 462, 1678, 565, 1121, 29889, 2972, 580, 1405, 29871, 29896, 29900, 29901, 13, 462, 4706, 2302, 4619, 29871, 29896, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29955, 29901, 13, 18884, 736, 5852, 13, 13, 18884, 396, 14402, 671, 278, 28915, 29918, 29881, 2650, 428, 3577, 13, 18884, 396, 632, 1018, 29901, 13, 18884, 396, 462, 1067, 29888, 29906, 353, 4918, 284, 29918, 695, 29888, 580, 13, 18884, 396, 462, 1121, 353, 1067, 29888, 29906, 29889, 27711, 29898, 4914, 9065, 17708, 29897, 13, 18884, 396, 632, 5174, 29901, 13, 18884, 396, 462, 736, 7700, 13, 4706, 736, 7700, 13, 13, 1678, 396, 817, 304, 671, 23460, 29892, 322, 6528, 13, 1678, 822, 6459, 26264, 401, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 7554, 613, 376, 7554, 401, 613, 376, 29920, 401, 613, 376, 2490, 401, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29955, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 1203, 29897, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 1807, 1159, 470, 320, 13, 9651, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 524, 1159, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 3752, 524, 29908, 1125, 13, 9651, 396, 23460, 322, 5101, 19396, 10230, 13, 9651, 4559, 3505, 353, 29871, 29945, 29900, 29900, 13, 9651, 4559, 3505, 353, 1375, 29898, 11249, 3505, 29892, 1583, 29889, 2176, 29889, 2798, 3101, 13, 9651, 1897, 9065, 17708, 353, 4036, 29889, 11249, 29898, 1311, 29889, 2176, 29889, 2622, 29898, 1054, 1170, 467, 29878, 1289, 29889, 20620, 3388, 29898, 2892, 921, 29901, 921, 467, 15914, 3285, 4559, 3505, 29897, 13, 9651, 565, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 524, 1159, 470, 313, 1311, 29889, 29881, 8768, 29961, 1054, 1170, 29962, 1275, 376, 3752, 524, 29908, 1125, 13, 18884, 1897, 9065, 17708, 353, 518, 710, 29898, 29916, 29897, 363, 921, 297, 1897, 9065, 17708, 29962, 13, 9651, 1683, 29901, 13, 18884, 1897, 9065, 17708, 353, 518, 29916, 363, 921, 297, 1897, 9065, 17708, 565, 1134, 29898, 29916, 29897, 1275, 851, 29962, 13, 9651, 4559, 6513, 353, 7431, 29898, 4914, 9065, 17708, 29897, 13, 9651, 396, 592, 9450, 1784, 526, 23432, 13, 9651, 565, 4559, 6513, 847, 4559, 3505, 529, 29871, 29900, 29889, 29896, 29901, 13, 18884, 736, 7700, 13, 9651, 396, 925, 502, 4234, 1244, 29892, 508, 671, 916, 7882, 29973, 13, 9651, 6528, 17144, 353, 364, 29908, 29985, 29961, 29900, 29899, 29929, 3199, 29945, 2119, 29973, 13018, 29961, 29900, 29899, 29929, 3199, 29941, 1800, 29973, 29938, 29908, 13, 9651, 7087, 353, 5159, 13, 9651, 363, 921, 297, 1897, 9065, 17708, 29901, 13, 18884, 1121, 353, 337, 29889, 4352, 29898, 13087, 17144, 29892, 921, 29897, 13, 18884, 565, 1121, 2804, 6213, 29901, 13, 462, 1678, 7087, 29889, 4397, 29898, 11227, 29898, 29916, 876, 13, 9651, 2302, 353, 2533, 4197, 11227, 29898, 29916, 29897, 363, 921, 297, 7087, 2314, 13, 9651, 565, 2302, 847, 4559, 6513, 1405, 29871, 29900, 29889, 29953, 29901, 13, 18884, 736, 5852, 13, 4706, 736, 7700, 13, 13, 13, 1678, 822, 6459, 16107, 6508, 6708, 29898, 1311, 29892, 784, 1170, 29931, 29893, 29892, 784, 1170, 1125, 13, 4706, 2983, 353, 6796, 5479, 613, 376, 5184, 613, 376, 8697, 613, 376, 8276, 613, 376, 2109, 613, 376, 1327, 29880, 613, 376, 593, 29874, 613, 376, 479, 290, 613, 376, 17990, 5562, 613, 13, 462, 376, 29883, 8841, 29918, 29873, 1461, 613, 376, 23834, 613, 376, 29881, 6801, 613, 376, 25237, 3108, 13, 4706, 266, 1127, 845, 1025, 353, 29871, 29955, 29900, 13, 4706, 565, 1583, 29889, 9435, 6362, 522, 4062, 29898, 1054, 1170, 29931, 29893, 29892, 2983, 29892, 266, 1127, 845, 1025, 1125, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 2 ]
openstates/openstates-master/openstates/de/legislators.py
Jgorsick/Advocacy_Angular
0
6029
import re import lxml.html from openstates.utils import LXMLMixin from billy.scrape.legislators import LegislatorScraper, Legislator class DELegislatorScraper(LegislatorScraper,LXMLMixin): jurisdiction = 'de' def scrape(self, chamber, term): url = { 'upper': 'http://legis.delaware.gov/legislature.nsf/sen?openview', 'lower': 'http://legis.delaware.gov/Legislature.nsf/Reps?openview', }[chamber] doc = self.lxmlize(url) if chamber == "upper": #for the senate, it's the same table #but the html is hard-coded in js. table_js = doc.xpath('.//script')[-1].text_content() table = None for line in table_js.split("\n"): if line.strip().startswith("var") and "sen=" in line: table = line.replace("var","") table = table.replace('sen="<','<') table = table.replace('>";','>') break assert table is not None, "Senate table could not be found" table = lxml.html.fromstring(table) table.make_links_absolute(url) trs = table.xpath('//tr') else: #same table for the house, but kindly in actual html trs = doc.xpath('//tr') base_url = "http://legis.delaware.gov" for tr in trs: name_and_url = tr.xpath('.//a')[0] bio_url = name_and_url.attrib["href"] bio_url = bio_url.replace("JavaScript:window.top.location.href=","") bio_url = bio_url.replace('"','') name = name_and_url.text_content() if name.strip() == "." or name.strip() == "": continue if name.strip().lower().startswith("vacant"): continue re_spaces=re.compile(r'\s{1,5}') name = ' '.join(re_spaces.split(name)) district = tr.xpath('.//td')[2].text_content() district = district.replace("District:","").strip() leg = self.scrape_bio(term, chamber, district, name, bio_url) leg.add_source(bio_url, page="legislator detail page") leg.add_source(url, page="legislator list page") self.save_legislator(leg) def scrape_bio(self, term, chamber, district, name, url): # this opens the committee section without having to do another request url += '&TableRow=1.5.5' frame_doc = self.lxmlize(url) actual_url = frame_doc.xpath("//frame[@name='right']/@src")[0] doc = self.lxmlize(actual_url) # party is in one of these party = doc.xpath('//div[@id="page_header"]')[0].text.strip()[-3:] if '(D)' in party: party = 'Democratic' elif '(R)' in party: party = 'Republican' else: raise AssertionError("No party found for {name}".format(name=name)) leg = Legislator(term, chamber, district, name, party=party) photo_url = doc.xpath('//img[contains(@src, "jpg")]/@src') if photo_url: leg['photo_url'] = photo_url[0] contact_info = self.scrape_contact_info(doc) leg.update(contact_info) return leg def scrape_contact_info(self, doc): # Email email = doc.xpath(".//a[contains(@href,'mailto')]") email = email[0].text_content().strip() leg_email = None dist_email = None try: emails = email.split(";") except AttributeError: pass else: for e in emails: e = e.strip() if e: if "state.de.us" in e: leg_email = e else: dist_email = e # Offices leg_office = dict(name="Capitol Office", type="capitol", phone=None, fax=None, email=leg_email, address=None) dist_office = dict(name="Outside Office", type="capitol", phone=None,fax=None, email=dist_email, address=None) #this is enormously painful, DE. office_list = doc.xpath("//tr") for office in office_list: title_td = 0 #in some trs the photo is the first td if len(office.xpath("./td/img")) > 0: title_td = 1 try: title_text = office.xpath("./td")[title_td].text_content().lower() content = office.xpath("./td")[title_td+1].text_content() except IndexError: continue leg_office = self.add_contact("legislative", title_text,content,leg_office) dist_office = self.add_contact("outside", title_text,content,dist_office) offices = [o for o in [leg_office,dist_office] if o["address"]] assert len(offices) > 0, "No offices with addresses found "\ "make sure we're not losing any data." return {"offices":offices} def add_contact(self,office_type, title_text,content,office): #office type is the name of the office #either "legislative" or "outside" if "{} office".format(office_type) in title_text: office["address"] = content.strip() if "{} phone".format(office_type) in title_text: phones = content.lower().split("\n") if len(phones) == 1: phone = self.clean_phone(phones[0]) if phone: office["phone"] = phone else: for line in phones: if "phone" in line: phone = self.clean_phone(line) if phone: office["phone"] = phone elif "fax" in line: phone = self.clean_phone(line) if phone: office["fax"] = phone return office def clean_phone(self,phone): if not phone.strip(): return if not re.search("\d",phone): return if not ":" in phone: return phone return phone.split(":")[1].strip()
[ 1, 1053, 337, 13, 5215, 301, 3134, 29889, 1420, 13, 3166, 1722, 28631, 29889, 13239, 1053, 365, 9165, 29924, 861, 262, 13, 13, 3166, 289, 9403, 29889, 1557, 336, 412, 29889, 1397, 7497, 4097, 1053, 18991, 1061, 4421, 336, 546, 29892, 18991, 1061, 13, 13, 13, 1990, 5012, 22988, 7497, 1061, 4421, 336, 546, 29898, 22988, 7497, 1061, 4421, 336, 546, 29892, 29931, 9165, 29924, 861, 262, 1125, 13, 1678, 24894, 29467, 353, 525, 311, 29915, 13, 13, 1678, 822, 24559, 412, 29898, 1311, 29892, 24171, 29892, 1840, 1125, 13, 13, 4706, 3142, 353, 426, 13, 9651, 525, 21064, 2396, 525, 1124, 597, 1397, 275, 29889, 6144, 28327, 29889, 13513, 29914, 1397, 7497, 1535, 29889, 1983, 29888, 29914, 4881, 29973, 3150, 1493, 742, 13, 9651, 525, 13609, 2396, 525, 1124, 597, 1397, 275, 29889, 6144, 28327, 29889, 13513, 29914, 22988, 7497, 1535, 29889, 1983, 29888, 29914, 1123, 567, 29973, 3150, 1493, 742, 13, 9651, 500, 29961, 305, 314, 495, 29962, 13, 13, 4706, 1574, 353, 1583, 29889, 29880, 3134, 675, 29898, 2271, 29897, 13, 13, 4706, 565, 24171, 1275, 376, 21064, 1115, 13, 9651, 396, 1454, 278, 6940, 403, 29892, 372, 29915, 29879, 278, 1021, 1591, 13, 9651, 396, 4187, 278, 3472, 338, 2898, 29899, 29659, 297, 6965, 29889, 13, 9651, 1591, 29918, 1315, 353, 1574, 29889, 23635, 12839, 458, 2154, 1495, 14352, 29896, 1822, 726, 29918, 3051, 580, 13, 9651, 1591, 353, 6213, 13, 9651, 363, 1196, 297, 1591, 29918, 1315, 29889, 5451, 14182, 29876, 29908, 1125, 13, 18884, 565, 1196, 29889, 17010, 2141, 27382, 2541, 703, 1707, 1159, 322, 376, 4881, 543, 297, 1196, 29901, 13, 462, 1678, 1591, 353, 1196, 29889, 6506, 703, 1707, 3284, 1159, 13, 462, 1678, 1591, 353, 1591, 29889, 6506, 877, 4881, 543, 29966, 3788, 29966, 1495, 13, 462, 1678, 1591, 353, 1591, 29889, 6506, 877, 16871, 3788, 29958, 1495, 13, 462, 1678, 2867, 13, 13, 9651, 4974, 1591, 338, 451, 6213, 29892, 376, 29903, 264, 403, 1591, 1033, 451, 367, 1476, 29908, 13, 13, 9651, 1591, 353, 301, 3134, 29889, 1420, 29889, 3166, 1807, 29898, 2371, 29897, 13, 9651, 1591, 29889, 5675, 29918, 4965, 29918, 23552, 29898, 2271, 29897, 13, 9651, 534, 29879, 353, 1591, 29889, 23635, 877, 458, 509, 1495, 13, 13, 13, 4706, 1683, 29901, 13, 9651, 396, 17642, 1591, 363, 278, 3699, 29892, 541, 25036, 297, 3935, 3472, 13, 9651, 534, 29879, 353, 1574, 29889, 23635, 877, 458, 509, 1495, 13, 13, 4706, 2967, 29918, 2271, 353, 376, 1124, 597, 1397, 275, 29889, 6144, 28327, 29889, 13513, 29908, 13, 13, 4706, 363, 534, 297, 534, 29879, 29901, 13, 13, 9651, 1024, 29918, 392, 29918, 2271, 353, 534, 29889, 23635, 12839, 458, 29874, 29861, 29900, 29962, 13, 9651, 17799, 29918, 2271, 353, 1024, 29918, 392, 29918, 2271, 29889, 1131, 1091, 3366, 12653, 3108, 13, 9651, 17799, 29918, 2271, 353, 17799, 29918, 2271, 29889, 6506, 703, 16963, 29901, 7165, 29889, 3332, 29889, 5479, 29889, 12653, 543, 1699, 1159, 13, 9651, 17799, 29918, 2271, 353, 17799, 29918, 2271, 29889, 6506, 877, 29908, 3788, 1495, 13, 9651, 1024, 353, 1024, 29918, 392, 29918, 2271, 29889, 726, 29918, 3051, 580, 13, 9651, 565, 1024, 29889, 17010, 580, 1275, 376, 1213, 470, 1024, 29889, 17010, 580, 1275, 376, 1115, 13, 18884, 6773, 13, 9651, 565, 1024, 29889, 17010, 2141, 13609, 2141, 27382, 2541, 703, 29894, 562, 424, 29908, 1125, 13, 18884, 6773, 13, 9651, 337, 29918, 22854, 29922, 276, 29889, 12198, 29898, 29878, 12764, 29879, 29912, 29896, 29892, 29945, 29913, 1495, 13, 9651, 1024, 353, 525, 15300, 7122, 29898, 276, 29918, 22854, 29889, 5451, 29898, 978, 876, 13, 9651, 6474, 353, 534, 29889, 23635, 12839, 458, 1594, 29861, 29906, 1822, 726, 29918, 3051, 580, 13, 9651, 6474, 353, 6474, 29889, 6506, 703, 29928, 6801, 29901, 3284, 2564, 17010, 580, 13, 13, 13, 9651, 2814, 353, 1583, 29889, 1557, 336, 412, 29918, 24840, 29898, 8489, 29892, 24171, 29892, 6474, 29892, 1024, 29892, 17799, 29918, 2271, 29897, 13, 9651, 2814, 29889, 1202, 29918, 4993, 29898, 24840, 29918, 2271, 29892, 1813, 543, 1397, 7497, 1061, 9493, 1813, 1159, 13, 9651, 2814, 29889, 1202, 29918, 4993, 29898, 2271, 29892, 1813, 543, 1397, 7497, 1061, 1051, 1813, 1159, 13, 9651, 1583, 29889, 7620, 29918, 1397, 7497, 1061, 29898, 1397, 29897, 13, 13, 1678, 822, 24559, 412, 29918, 24840, 29898, 1311, 29892, 1840, 29892, 24171, 29892, 6474, 29892, 1024, 29892, 3142, 1125, 13, 4706, 396, 445, 13246, 278, 21118, 4004, 1728, 2534, 304, 437, 1790, 2009, 13, 4706, 3142, 4619, 525, 29987, 3562, 4301, 29922, 29896, 29889, 29945, 29889, 29945, 29915, 13, 4706, 3515, 29918, 1514, 353, 1583, 29889, 29880, 3134, 675, 29898, 2271, 29897, 13, 4706, 3935, 29918, 2271, 353, 3515, 29918, 1514, 29889, 23635, 703, 458, 2557, 17548, 978, 2433, 1266, 2033, 29368, 4351, 1159, 29961, 29900, 29962, 13, 4706, 1574, 353, 1583, 29889, 29880, 3134, 675, 29898, 19304, 29918, 2271, 29897, 13, 13, 4706, 396, 6263, 338, 297, 697, 310, 1438, 13, 4706, 6263, 353, 1574, 29889, 23635, 877, 458, 4563, 17548, 333, 543, 3488, 29918, 6672, 3108, 29861, 29900, 1822, 726, 29889, 17010, 580, 14352, 29941, 17531, 13, 4706, 565, 525, 29898, 29928, 16029, 297, 6263, 29901, 13, 9651, 6263, 353, 525, 29928, 331, 8415, 2454, 29915, 13, 4706, 25342, 525, 29898, 29934, 16029, 297, 6263, 29901, 13, 9651, 6263, 353, 525, 5612, 803, 273, 29915, 13, 4706, 1683, 29901, 13, 9651, 12020, 16499, 291, 2392, 703, 3782, 6263, 1476, 363, 426, 978, 29913, 1642, 4830, 29898, 978, 29922, 978, 876, 13, 13, 4706, 2814, 353, 18991, 1061, 29898, 8489, 29892, 24171, 29892, 6474, 29892, 1024, 29892, 6263, 29922, 22633, 29897, 13, 13, 4706, 15373, 29918, 2271, 353, 1574, 29889, 23635, 877, 458, 2492, 29961, 11516, 10394, 4351, 29892, 376, 6173, 13531, 29368, 4351, 1495, 13, 4706, 565, 15373, 29918, 2271, 29901, 13, 9651, 2814, 1839, 21596, 29918, 2271, 2033, 353, 15373, 29918, 2271, 29961, 29900, 29962, 13, 13, 4706, 6958, 29918, 3888, 353, 1583, 29889, 1557, 336, 412, 29918, 12346, 29918, 3888, 29898, 1514, 29897, 13, 4706, 2814, 29889, 5504, 29898, 12346, 29918, 3888, 29897, 13, 4706, 736, 2814, 13, 13, 1678, 822, 24559, 412, 29918, 12346, 29918, 3888, 29898, 1311, 29892, 1574, 1125, 13, 13, 4706, 396, 22608, 13, 4706, 4876, 353, 1574, 29889, 23635, 17350, 458, 29874, 29961, 11516, 10394, 12653, 5501, 2549, 517, 1495, 29962, 1159, 13, 4706, 4876, 353, 4876, 29961, 29900, 1822, 726, 29918, 3051, 2141, 17010, 580, 13, 4706, 2814, 29918, 5269, 353, 6213, 13, 4706, 1320, 29918, 5269, 353, 6213, 13, 4706, 1018, 29901, 13, 9651, 24609, 353, 4876, 29889, 5451, 703, 29936, 1159, 13, 4706, 5174, 23833, 2392, 29901, 13, 9651, 1209, 13, 4706, 1683, 29901, 13, 9651, 363, 321, 297, 24609, 29901, 13, 18884, 321, 353, 321, 29889, 17010, 580, 13, 18884, 565, 321, 29901, 13, 462, 1678, 565, 376, 3859, 29889, 311, 29889, 375, 29908, 297, 321, 29901, 13, 462, 4706, 2814, 29918, 5269, 353, 321, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1320, 29918, 5269, 353, 321, 13, 308, 13, 13, 4706, 396, 5947, 1575, 13, 13, 4706, 2814, 29918, 20205, 353, 9657, 29898, 978, 543, 12415, 277, 324, 11367, 613, 1134, 543, 5030, 277, 324, 613, 13, 462, 4706, 9008, 29922, 8516, 29892, 285, 1165, 29922, 8516, 29892, 4876, 29922, 1397, 29918, 5269, 29892, 3211, 29922, 8516, 29897, 13, 4706, 1320, 29918, 20205, 353, 9657, 29898, 978, 543, 3744, 2975, 11367, 613, 1134, 543, 5030, 277, 324, 613, 13, 462, 4706, 9008, 29922, 8516, 29892, 29888, 1165, 29922, 8516, 29892, 4876, 29922, 5721, 29918, 5269, 29892, 3211, 29922, 8516, 29897, 29871, 13, 13, 4706, 396, 1366, 338, 18886, 5794, 6788, 1319, 29892, 5012, 29889, 13, 4706, 8034, 29918, 1761, 353, 1574, 29889, 23635, 703, 458, 509, 1159, 13, 4706, 363, 8034, 297, 8034, 29918, 1761, 29901, 13, 9651, 3611, 29918, 1594, 353, 29871, 29900, 13, 9651, 396, 262, 777, 534, 29879, 278, 15373, 338, 278, 937, 22599, 13, 9651, 565, 7431, 29898, 20205, 29889, 23635, 703, 6904, 1594, 29914, 2492, 5783, 1405, 29871, 29900, 29901, 13, 18884, 3611, 29918, 1594, 353, 29871, 29896, 13, 9651, 1018, 29901, 13, 18884, 3611, 29918, 726, 353, 8034, 29889, 23635, 703, 6904, 1594, 1159, 29961, 3257, 29918, 1594, 1822, 726, 29918, 3051, 2141, 13609, 580, 13, 18884, 2793, 353, 8034, 29889, 23635, 703, 6904, 1594, 1159, 29961, 3257, 29918, 1594, 29974, 29896, 1822, 726, 29918, 3051, 580, 13, 13, 9651, 5174, 11374, 2392, 29901, 13, 18884, 6773, 13, 13, 9651, 2814, 29918, 20205, 353, 1583, 29889, 1202, 29918, 12346, 703, 1397, 7497, 1230, 613, 13, 462, 1678, 3611, 29918, 726, 29892, 3051, 29892, 1397, 29918, 20205, 29897, 13, 9651, 1320, 29918, 20205, 353, 1583, 29889, 1202, 29918, 12346, 703, 449, 2975, 613, 13, 462, 1678, 3611, 29918, 726, 29892, 3051, 29892, 5721, 29918, 20205, 29897, 13, 13, 4706, 25222, 353, 518, 29877, 363, 288, 297, 518, 1397, 29918, 20205, 29892, 5721, 29918, 20205, 29962, 565, 288, 3366, 7328, 3108, 29962, 13, 4706, 4974, 7431, 29898, 2696, 1575, 29897, 1405, 29871, 29900, 29892, 376, 3782, 25222, 411, 14157, 1476, 6634, 13, 9651, 376, 5675, 1854, 591, 29915, 276, 451, 19035, 738, 848, 1213, 13, 4706, 736, 8853, 2696, 1575, 1115, 2696, 1575, 29913, 13, 13, 1678, 822, 788, 29918, 12346, 29898, 1311, 29892, 20205, 29918, 1853, 29892, 13, 462, 1678, 3611, 29918, 726, 29892, 3051, 29892, 20205, 1125, 13, 4706, 396, 20205, 1134, 338, 278, 1024, 310, 278, 8034, 13, 4706, 396, 29872, 2121, 376, 1397, 7497, 1230, 29908, 470, 376, 449, 2975, 29908, 13, 4706, 565, 376, 8875, 8034, 1642, 4830, 29898, 20205, 29918, 1853, 29897, 297, 3611, 29918, 726, 29901, 13, 9651, 8034, 3366, 7328, 3108, 353, 2793, 29889, 17010, 580, 13, 4706, 565, 376, 8875, 9008, 1642, 4830, 29898, 20205, 29918, 1853, 29897, 297, 3611, 29918, 726, 29901, 13, 9651, 1374, 2873, 353, 2793, 29889, 13609, 2141, 5451, 14182, 29876, 1159, 13, 9651, 565, 7431, 29898, 561, 2873, 29897, 1275, 29871, 29896, 29901, 13, 18884, 9008, 353, 1583, 29889, 14941, 29918, 6710, 29898, 561, 2873, 29961, 29900, 2314, 13, 18884, 565, 9008, 29901, 13, 462, 1678, 8034, 3366, 6710, 3108, 353, 9008, 13, 9651, 1683, 29901, 13, 18884, 363, 1196, 297, 1374, 2873, 29901, 13, 462, 1678, 565, 376, 6710, 29908, 297, 1196, 29901, 13, 462, 4706, 9008, 353, 1583, 29889, 14941, 29918, 6710, 29898, 1220, 29897, 13, 462, 4706, 565, 9008, 29901, 13, 462, 9651, 8034, 3366, 6710, 3108, 353, 9008, 13, 462, 1678, 25342, 376, 29888, 1165, 29908, 297, 1196, 29901, 13, 462, 4706, 9008, 353, 1583, 29889, 14941, 29918, 6710, 29898, 1220, 29897, 13, 462, 4706, 565, 9008, 29901, 13, 462, 9651, 8034, 3366, 29888, 1165, 3108, 353, 9008, 13, 4706, 736, 8034, 13, 13, 1678, 822, 5941, 29918, 6710, 29898, 1311, 29892, 6710, 1125, 13, 4706, 565, 451, 9008, 29889, 17010, 7295, 13, 9651, 736, 13, 4706, 565, 451, 337, 29889, 4478, 14182, 29881, 613, 6710, 1125, 13, 9651, 736, 13, 4706, 565, 451, 376, 6160, 297, 9008, 29901, 13, 9651, 736, 9008, 13, 4706, 736, 9008, 29889, 5451, 703, 29901, 1159, 29961, 29896, 1822, 17010, 580, 13, 13, 2 ]
tests/test_handler.py
CJSoldier/webssh
13
4247
<filename>tests/test_handler.py import unittest import paramiko from tornado.httputil import HTTPServerRequest from tests.utils import read_file, make_tests_data_path from webssh.handler import MixinHandler, IndexHandler, InvalidValueError class TestMixinHandler(unittest.TestCase): def test_get_real_client_addr(self): handler = MixinHandler() handler.request = HTTPServerRequest(uri='/') self.assertIsNone(handler.get_real_client_addr()) ip = '127.0.0.1' handler.request.headers.add('X-Real-Ip', ip) self.assertEqual(handler.get_real_client_addr(), False) handler.request.headers.add('X-Real-Port', '12345x') self.assertEqual(handler.get_real_client_addr(), False) handler.request.headers.update({'X-Real-Port': '12345'}) self.assertEqual(handler.get_real_client_addr(), (ip, 12345)) handler.request.headers.update({'X-Real-ip': None}) self.assertEqual(handler.get_real_client_addr(), False) handler.request.headers.update({'X-Real-Port': '12345x'}) self.assertEqual(handler.get_real_client_addr(), False) class TestIndexHandler(unittest.TestCase): def test_get_specific_pkey_with_plain_key(self): fname = 'test_rsa.key' cls = paramiko.RSAKey key = read_file(make_tests_data_path(fname)) pkey = IndexHandler.get_specific_pkey(cls, key, None) self.assertIsInstance(pkey, cls) pkey = IndexHandler.get_specific_pkey(cls, key, 'iginored') self.assertIsInstance(pkey, cls) pkey = IndexHandler.get_specific_pkey(cls, 'x'+key, None) self.assertIsNone(pkey) def test_get_specific_pkey_with_encrypted_key(self): fname = 'test_rsa_password.key' cls = paramiko.RSAKey password = '<PASSWORD>' key = read_file(make_tests_data_path(fname)) pkey = IndexHandler.get_specific_pkey(cls, key, password) self.assertIsInstance(pkey, cls) pkey = IndexHandler.get_specific_pkey(cls, 'x'+key, None) self.assertIsNone(pkey) with self.assertRaises(paramiko.PasswordRequiredException): pkey = IndexHandler.get_specific_pkey(cls, key, None) def test_get_pkey_obj_with_plain_key(self): fname = 'test_ed25519.key' cls = paramiko.Ed25519Key key = read_file(make_tests_data_path(fname)) pkey = IndexHandler.get_pkey_obj(key, None, fname) self.assertIsInstance(pkey, cls) pkey = IndexHandler.get_pkey_obj(key, 'iginored', fname) self.assertIsInstance(pkey, cls) with self.assertRaises(InvalidValueError) as exc: pkey = IndexHandler.get_pkey_obj('x'+key, None, fname) self.assertIn('Invalid private key', str(exc)) def test_get_pkey_obj_with_encrypted_key(self): fname = 'test_ed25519_password.key' password = '<PASSWORD>' cls = paramiko.Ed25519Key key = read_file(make_tests_data_path(fname)) pkey = IndexHandler.get_pkey_obj(key, password, fname) self.assertIsInstance(pkey, cls) with self.assertRaises(InvalidValueError) as exc: pkey = IndexHandler.get_pkey_obj(key, 'wrongpass', fname) self.assertIn('Wrong password', str(exc)) with self.assertRaises(InvalidValueError) as exc: pkey = IndexHandler.get_pkey_obj('x'+key, password, fname) self.assertIn('Invalid private key', str(exc)) with self.assertRaises(paramiko.PasswordRequiredException): pkey = IndexHandler.get_pkey_obj(key, '', fname)
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 13789, 29889, 2272, 13, 5215, 443, 27958, 13, 5215, 1828, 10349, 13, 13, 3166, 10146, 912, 29889, 691, 649, 309, 1053, 7331, 6004, 3089, 13, 3166, 6987, 29889, 13239, 1053, 1303, 29918, 1445, 29892, 1207, 29918, 21150, 29918, 1272, 29918, 2084, 13, 3166, 1856, 15269, 29889, 13789, 1053, 23478, 262, 4598, 29892, 11374, 4598, 29892, 21403, 1917, 2392, 13, 13, 13, 1990, 4321, 29924, 861, 262, 4598, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 6370, 29918, 4645, 29918, 10030, 29898, 1311, 1125, 13, 4706, 7834, 353, 23478, 262, 4598, 580, 13, 4706, 7834, 29889, 3827, 353, 7331, 6004, 3089, 29898, 5338, 2433, 29914, 1495, 13, 4706, 1583, 29889, 9294, 3624, 8516, 29898, 13789, 29889, 657, 29918, 6370, 29918, 4645, 29918, 10030, 3101, 13, 13, 4706, 10377, 353, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29915, 13, 4706, 7834, 29889, 3827, 29889, 13662, 29889, 1202, 877, 29990, 29899, 21713, 29899, 29902, 29886, 742, 10377, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13789, 29889, 657, 29918, 6370, 29918, 4645, 29918, 10030, 3285, 7700, 29897, 13, 13, 4706, 7834, 29889, 3827, 29889, 13662, 29889, 1202, 877, 29990, 29899, 21713, 29899, 2290, 742, 525, 29896, 29906, 29941, 29946, 29945, 29916, 1495, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13789, 29889, 657, 29918, 6370, 29918, 4645, 29918, 10030, 3285, 7700, 29897, 13, 13, 4706, 7834, 29889, 3827, 29889, 13662, 29889, 5504, 3319, 29915, 29990, 29899, 21713, 29899, 2290, 2396, 525, 29896, 29906, 29941, 29946, 29945, 29915, 1800, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13789, 29889, 657, 29918, 6370, 29918, 4645, 29918, 10030, 3285, 313, 666, 29892, 29871, 29896, 29906, 29941, 29946, 29945, 876, 13, 13, 4706, 7834, 29889, 3827, 29889, 13662, 29889, 5504, 3319, 29915, 29990, 29899, 21713, 29899, 666, 2396, 6213, 1800, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13789, 29889, 657, 29918, 6370, 29918, 4645, 29918, 10030, 3285, 7700, 29897, 13, 13, 4706, 7834, 29889, 3827, 29889, 13662, 29889, 5504, 3319, 29915, 29990, 29899, 21713, 29899, 2290, 2396, 525, 29896, 29906, 29941, 29946, 29945, 29916, 29915, 1800, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13789, 29889, 657, 29918, 6370, 29918, 4645, 29918, 10030, 3285, 7700, 29897, 13, 13, 13, 1990, 4321, 3220, 4598, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 14940, 29918, 29886, 1989, 29918, 2541, 29918, 24595, 29918, 1989, 29898, 1311, 1125, 13, 13, 4706, 285, 978, 353, 525, 1688, 29918, 2288, 29874, 29889, 1989, 29915, 13, 4706, 1067, 29879, 353, 1828, 10349, 29889, 29934, 8132, 2558, 13, 4706, 1820, 353, 1303, 29918, 1445, 29898, 5675, 29918, 21150, 29918, 1272, 29918, 2084, 29898, 29888, 978, 876, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 14940, 29918, 29886, 1989, 29898, 25932, 29892, 1820, 29892, 6213, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29886, 1989, 29892, 1067, 29879, 29897, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 14940, 29918, 29886, 1989, 29898, 25932, 29892, 1820, 29892, 525, 7238, 4395, 1495, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29886, 1989, 29892, 1067, 29879, 29897, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 14940, 29918, 29886, 1989, 29898, 25932, 29892, 525, 29916, 18717, 1989, 29892, 6213, 29897, 13, 4706, 1583, 29889, 9294, 3624, 8516, 29898, 29886, 1989, 29897, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 14940, 29918, 29886, 1989, 29918, 2541, 29918, 3977, 14740, 29918, 1989, 29898, 1311, 1125, 13, 4706, 285, 978, 353, 525, 1688, 29918, 2288, 29874, 29918, 5630, 29889, 1989, 29915, 13, 4706, 1067, 29879, 353, 1828, 10349, 29889, 29934, 8132, 2558, 13, 4706, 4800, 353, 12801, 25711, 17013, 16299, 13, 13, 4706, 1820, 353, 1303, 29918, 1445, 29898, 5675, 29918, 21150, 29918, 1272, 29918, 2084, 29898, 29888, 978, 876, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 14940, 29918, 29886, 1989, 29898, 25932, 29892, 1820, 29892, 4800, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29886, 1989, 29892, 1067, 29879, 29897, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 14940, 29918, 29886, 1989, 29898, 25932, 29892, 525, 29916, 18717, 1989, 29892, 6213, 29897, 13, 4706, 1583, 29889, 9294, 3624, 8516, 29898, 29886, 1989, 29897, 13, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 3207, 10349, 29889, 10048, 19347, 2451, 1125, 13, 9651, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 14940, 29918, 29886, 1989, 29898, 25932, 29892, 1820, 29892, 6213, 29897, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 29886, 1989, 29918, 5415, 29918, 2541, 29918, 24595, 29918, 1989, 29898, 1311, 1125, 13, 4706, 285, 978, 353, 525, 1688, 29918, 287, 29906, 29945, 29945, 29896, 29929, 29889, 1989, 29915, 13, 4706, 1067, 29879, 353, 1828, 10349, 29889, 3853, 29906, 29945, 29945, 29896, 29929, 2558, 13, 4706, 1820, 353, 1303, 29918, 1445, 29898, 5675, 29918, 21150, 29918, 1272, 29918, 2084, 29898, 29888, 978, 876, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 29898, 1989, 29892, 6213, 29892, 285, 978, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29886, 1989, 29892, 1067, 29879, 29897, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 29898, 1989, 29892, 525, 7238, 4395, 742, 285, 978, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29886, 1989, 29892, 1067, 29879, 29897, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13919, 1917, 2392, 29897, 408, 5566, 29901, 13, 9651, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 877, 29916, 18717, 1989, 29892, 6213, 29892, 285, 978, 29897, 13, 9651, 1583, 29889, 9294, 797, 877, 13919, 2024, 1820, 742, 851, 29898, 735, 29883, 876, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 29886, 1989, 29918, 5415, 29918, 2541, 29918, 3977, 14740, 29918, 1989, 29898, 1311, 1125, 13, 4706, 285, 978, 353, 525, 1688, 29918, 287, 29906, 29945, 29945, 29896, 29929, 29918, 5630, 29889, 1989, 29915, 13, 4706, 4800, 353, 12801, 25711, 17013, 16299, 13, 4706, 1067, 29879, 353, 1828, 10349, 29889, 3853, 29906, 29945, 29945, 29896, 29929, 2558, 13, 4706, 1820, 353, 1303, 29918, 1445, 29898, 5675, 29918, 21150, 29918, 1272, 29918, 2084, 29898, 29888, 978, 876, 13, 4706, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 29898, 1989, 29892, 4800, 29892, 285, 978, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29886, 1989, 29892, 1067, 29879, 29897, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13919, 1917, 2392, 29897, 408, 5566, 29901, 13, 9651, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 29898, 1989, 29892, 525, 15866, 549, 3364, 742, 285, 978, 29897, 13, 9651, 1583, 29889, 9294, 797, 877, 29956, 29373, 4800, 742, 851, 29898, 735, 29883, 876, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13919, 1917, 2392, 29897, 408, 5566, 29901, 13, 9651, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 877, 29916, 18717, 1989, 29892, 4800, 29892, 285, 978, 29897, 13, 9651, 1583, 29889, 9294, 797, 877, 13919, 2024, 1820, 742, 851, 29898, 735, 29883, 876, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 3207, 10349, 29889, 10048, 19347, 2451, 1125, 13, 9651, 282, 1989, 353, 11374, 4598, 29889, 657, 29918, 29886, 1989, 29918, 5415, 29898, 1989, 29892, 15516, 285, 978, 29897, 13, 2 ]
chap3-3.py
mikidake/Ex3
0
27253
<gh_stars>0 # Chapter3 Ex.3) # Modification of 'Guess My Number' # Guess My Number # # The computer picks a random number between 1 and 100 # The player tries to guess it and the computer lets # the player know if the guess is too high, too low # or right on the money # The player can try to guess up to three times import random print("\tWelcome to 'Guess My Number'!") print("\nI'm thinking of a number between 1 and 100.") print("Try to guess it in as few attempts as possible.") print("You have three chances to try!\n") # set the initial values the_number = random.randint(1, 100) tries = 1 maxTries = 3 # guessing loop while tries <= maxTries: guess = int(input("Take a guess: ")) if guess == the_number: print("\nYou guessed it! The number was", the_number) if tries == 1: print("And it only took you", tries, "try!\n") break else: print("And it only took you", tries, "tries!\n") break elif guess > the_number: print("Guess Lower..") else: print("Guess Higher..") tries += 1 if tries > maxTries: print("\nSorry you ran out of tries! The random number was ", the_number) input("\n\nPress the enter key to exit.")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 23040, 29941, 1222, 29889, 29941, 8443, 13, 29937, 3382, 2450, 310, 525, 9485, 404, 1619, 9681, 29915, 30004, 13, 30004, 13, 29937, 2088, 404, 1619, 9681, 30004, 13, 29937, 30004, 13, 29937, 450, 6601, 5839, 29879, 263, 4036, 1353, 1546, 29871, 29896, 322, 29871, 29896, 29900, 29900, 30004, 13, 29937, 450, 4847, 14335, 304, 4140, 372, 322, 278, 6601, 16869, 30004, 13, 29937, 278, 4847, 1073, 565, 278, 4140, 338, 2086, 1880, 29892, 2086, 4482, 30004, 13, 29937, 470, 1492, 373, 278, 6909, 30004, 13, 29937, 450, 4847, 508, 1018, 304, 4140, 701, 304, 2211, 3064, 30004, 13, 30004, 13, 5215, 4036, 29871, 6756, 13, 30004, 13, 2158, 14182, 29873, 28862, 2763, 304, 525, 9485, 404, 1619, 9681, 29915, 29991, 1159, 30004, 13, 2158, 14182, 29876, 29902, 29915, 29885, 7291, 310, 263, 1353, 1546, 29871, 29896, 322, 29871, 29896, 29900, 29900, 23157, 30004, 13, 2158, 703, 15870, 304, 4140, 372, 297, 408, 2846, 14734, 408, 1950, 23157, 30004, 13, 2158, 703, 3492, 505, 2211, 521, 2925, 304, 1018, 9903, 29876, 1159, 30004, 13, 30004, 13, 29937, 731, 278, 2847, 1819, 30004, 13, 1552, 29918, 4537, 353, 4036, 29889, 9502, 524, 29898, 29896, 29892, 29871, 29896, 29900, 29900, 8443, 13, 29873, 2722, 353, 29871, 29896, 30004, 13, 3317, 29911, 2722, 353, 29871, 29941, 30004, 13, 30004, 13, 29937, 20680, 2425, 30004, 13, 8000, 14335, 5277, 4236, 29911, 2722, 29901, 30004, 13, 1678, 4140, 353, 938, 29898, 2080, 703, 26772, 263, 4140, 29901, 376, 876, 30004, 13, 1678, 565, 4140, 1275, 278, 29918, 4537, 29901, 30004, 13, 4706, 1596, 14182, 29876, 3492, 4140, 287, 372, 29991, 450, 1353, 471, 613, 278, 29918, 4537, 8443, 13, 4706, 565, 14335, 1275, 29871, 29896, 29901, 30004, 13, 9651, 1596, 703, 2855, 372, 871, 3614, 366, 613, 14335, 29892, 376, 2202, 9903, 29876, 1159, 30004, 13, 9651, 2867, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 1596, 703, 2855, 372, 871, 3614, 366, 613, 14335, 29892, 376, 29873, 2722, 9903, 29876, 1159, 30004, 13, 9651, 2867, 30004, 13, 1678, 25342, 4140, 1405, 278, 29918, 4537, 29901, 30004, 13, 4706, 1596, 703, 9485, 404, 27723, 636, 1159, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 1596, 703, 9485, 404, 5057, 261, 636, 1159, 30004, 13, 1678, 14335, 4619, 29871, 29896, 30004, 13, 1678, 565, 14335, 1405, 4236, 29911, 2722, 29901, 30004, 13, 4706, 1596, 14182, 29876, 29903, 3818, 366, 6350, 714, 310, 14335, 29991, 450, 4036, 1353, 471, 9162, 278, 29918, 4537, 8443, 13, 4706, 6756, 13, 2080, 14182, 29876, 29905, 29876, 10923, 278, 3896, 1820, 304, 6876, 23157, 2 ]
tests/dce_models/test_dibem.py
michaelberks/madym_python
0
146402
''' Test file for the dce_models sub-module ''' import pytest import os import sys import numpy as np from tempfile import TemporaryDirectory sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'src'))) #------------------------------------------------------------------------------- # Tests for dibem module from QbiPy.dce_models import dibem, two_cxm_model, active_uptake_model from QbiPy.dce_models import dce_aif #------------------------------------------------------------------------------- def test_params_AUEM(): #Test consistency of conversion to/from DIBEM F_p = 1.0 v_ecs = 0.2 k_i = 0.25 k_ef = 0.05 dibem_params = active_uptake_model.params_to_DIBEM(F_p, v_ecs, k_i, k_ef, False) F_p2, v_ecs2, k_i2, k_ef2 = active_uptake_model.params_from_DIBEM(*dibem_params, False) dibem_params = active_uptake_model.params_to_DIBEM(F_p, v_ecs, k_i, k_ef, True) F_p3, v_ecs3, k_i3, k_ef3 = active_uptake_model.params_from_DIBEM(*dibem_params, True) assert F_p == pytest.approx(F_p2) assert v_ecs == pytest.approx(v_ecs2) assert k_i == pytest.approx(k_i2) assert k_ef == pytest.approx(k_ef2) assert F_p == pytest.approx(F_p3) assert v_ecs == pytest.approx(v_ecs3) assert k_i == pytest.approx(k_i3) assert k_ef == pytest.approx(k_ef3) def test_params_2CXM(): F_p = 1.0 PS = 0.2 v_e = 0.2 v_p = 0.1 dibem_params = two_cxm_model.params_to_DIBEM(F_p, PS, v_e, v_p, False) print('params_2CXM_to_DIBEM: ', dibem_params) F_p2, PS2, v_e2, v_p2 = two_cxm_model.params_from_DIBEM(*dibem_params, False) dibem_params = two_cxm_model.params_to_DIBEM(F_p, PS, v_e, v_p, True) print('params_2CXM_to_DIBEM: ', dibem_params) F_p3, PS3, v_e3, v_p3 = two_cxm_model.params_from_DIBEM(*dibem_params, True) assert F_p == pytest.approx(F_p2) assert PS == pytest.approx(PS2) assert v_e == pytest.approx(v_e2) assert v_p == pytest.approx(v_p2) assert F_p == pytest.approx(F_p3) assert PS == pytest.approx(PS3) assert v_e == pytest.approx(v_e3) assert v_p == pytest.approx(v_p3) def test_concentration_from_model_scalar(): times = np.linspace(0, 6, 50) aif = dce_aif.Aif(times = times) F_pos = 0.2 F_neg = 0.2 K_pos = 0.5 K_neg = 4.0 f_a = 0.5 tau_a = 0.1 tau_v = 0.05 C_t = dibem.concentration_from_model( aif, F_pos, F_neg, K_pos, K_neg, f_a, tau_a, tau_v ) assert C_t.size == times.size assert np.all(np.isfinite(C_t)) def test_concentration_from_array(): times = np.linspace(0, 6, 50) aif = dce_aif.Aif(times = times) F_pos = [0.2, 0.25] F_neg = [0.2, 0.25] K_pos = [0.5, 0.55] K_neg = [4.0, 4.5] f_a = 0.5 tau_a = 0.1 tau_v = 0.05 C_t = dibem.concentration_from_model( aif, F_pos, F_neg, K_pos, K_neg, f_a, tau_a, tau_v ) assert C_t.size == 2*times.size assert np.all(np.isfinite(C_t))
[ 1, 14550, 13, 3057, 934, 363, 278, 270, 346, 29918, 9794, 1014, 29899, 5453, 13, 12008, 13, 5215, 11451, 1688, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 12655, 408, 7442, 13, 3166, 5694, 1445, 1053, 6789, 1971, 653, 9882, 13, 9675, 29889, 2084, 29889, 7851, 29898, 29900, 29892, 29871, 13, 1678, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 525, 636, 742, 525, 636, 742, 525, 4351, 29915, 4961, 13, 13, 29937, 2683, 2683, 2683, 2683, 9072, 5634, 13, 29937, 4321, 29879, 363, 652, 29890, 331, 3883, 13, 3166, 660, 5365, 19737, 29889, 29881, 346, 29918, 9794, 1053, 652, 29890, 331, 29892, 1023, 29918, 18904, 29885, 29918, 4299, 29892, 6136, 29918, 21245, 1296, 29918, 4299, 13, 3166, 660, 5365, 19737, 29889, 29881, 346, 29918, 9794, 1053, 270, 346, 29918, 29874, 361, 13, 29937, 2683, 2683, 2683, 2683, 9072, 5634, 13, 13, 1753, 1243, 29918, 7529, 29918, 29909, 4462, 29924, 7295, 13, 1678, 396, 3057, 5718, 3819, 310, 11301, 304, 29914, 3166, 360, 8979, 12665, 13, 1678, 383, 29918, 29886, 353, 29871, 29896, 29889, 29900, 13, 1678, 325, 29918, 687, 29879, 353, 29871, 29900, 29889, 29906, 29871, 13, 1678, 413, 29918, 29875, 353, 29871, 29900, 29889, 29906, 29945, 29871, 13, 1678, 413, 29918, 1389, 353, 29871, 29900, 29889, 29900, 29945, 13, 13, 1678, 652, 29890, 331, 29918, 7529, 353, 6136, 29918, 21245, 1296, 29918, 4299, 29889, 7529, 29918, 517, 29918, 4571, 29933, 12665, 29898, 29943, 29918, 29886, 29892, 325, 29918, 687, 29879, 29892, 413, 29918, 29875, 29892, 413, 29918, 1389, 29892, 7700, 29897, 13, 1678, 383, 29918, 29886, 29906, 29892, 325, 29918, 687, 29879, 29906, 29892, 413, 29918, 29875, 29906, 29892, 413, 29918, 1389, 29906, 353, 6136, 29918, 21245, 1296, 29918, 4299, 29889, 7529, 29918, 3166, 29918, 4571, 29933, 12665, 10456, 29881, 747, 331, 29918, 7529, 29892, 7700, 29897, 13, 13, 1678, 652, 29890, 331, 29918, 7529, 353, 6136, 29918, 21245, 1296, 29918, 4299, 29889, 7529, 29918, 517, 29918, 4571, 29933, 12665, 29898, 29943, 29918, 29886, 29892, 325, 29918, 687, 29879, 29892, 413, 29918, 29875, 29892, 413, 29918, 1389, 29892, 5852, 29897, 13, 1678, 383, 29918, 29886, 29941, 29892, 325, 29918, 687, 29879, 29941, 29892, 413, 29918, 29875, 29941, 29892, 413, 29918, 1389, 29941, 353, 6136, 29918, 21245, 1296, 29918, 4299, 29889, 7529, 29918, 3166, 29918, 4571, 29933, 12665, 10456, 29881, 747, 331, 29918, 7529, 29892, 5852, 29897, 13, 13, 1678, 4974, 383, 29918, 29886, 1275, 11451, 1688, 29889, 14850, 29898, 29943, 29918, 29886, 29906, 29897, 13, 1678, 4974, 325, 29918, 687, 29879, 1275, 11451, 1688, 29889, 14850, 29898, 29894, 29918, 687, 29879, 29906, 29897, 13, 1678, 4974, 413, 29918, 29875, 1275, 11451, 1688, 29889, 14850, 29898, 29895, 29918, 29875, 29906, 29897, 13, 1678, 4974, 413, 29918, 1389, 1275, 11451, 1688, 29889, 14850, 29898, 29895, 29918, 1389, 29906, 29897, 13, 1678, 4974, 383, 29918, 29886, 1275, 11451, 1688, 29889, 14850, 29898, 29943, 29918, 29886, 29941, 29897, 13, 1678, 4974, 325, 29918, 687, 29879, 1275, 11451, 1688, 29889, 14850, 29898, 29894, 29918, 687, 29879, 29941, 29897, 13, 1678, 4974, 413, 29918, 29875, 1275, 11451, 1688, 29889, 14850, 29898, 29895, 29918, 29875, 29941, 29897, 13, 1678, 4974, 413, 29918, 1389, 1275, 11451, 1688, 29889, 14850, 29898, 29895, 29918, 1389, 29941, 29897, 13, 13, 1753, 1243, 29918, 7529, 29918, 29906, 29907, 29990, 29924, 7295, 13, 1678, 383, 29918, 29886, 353, 29871, 29896, 29889, 29900, 13, 1678, 11323, 353, 29871, 29900, 29889, 29906, 29871, 13, 1678, 325, 29918, 29872, 353, 29871, 29900, 29889, 29906, 29871, 13, 1678, 325, 29918, 29886, 353, 29871, 29900, 29889, 29896, 13, 13, 1678, 652, 29890, 331, 29918, 7529, 353, 1023, 29918, 18904, 29885, 29918, 4299, 29889, 7529, 29918, 517, 29918, 4571, 29933, 12665, 29898, 29943, 29918, 29886, 29892, 11323, 29892, 325, 29918, 29872, 29892, 325, 29918, 29886, 29892, 7700, 29897, 13, 1678, 1596, 877, 7529, 29918, 29906, 29907, 29990, 29924, 29918, 517, 29918, 4571, 29933, 12665, 29901, 13420, 652, 29890, 331, 29918, 7529, 29897, 13, 1678, 383, 29918, 29886, 29906, 29892, 11323, 29906, 29892, 325, 29918, 29872, 29906, 29892, 325, 29918, 29886, 29906, 353, 1023, 29918, 18904, 29885, 29918, 4299, 29889, 7529, 29918, 3166, 29918, 4571, 29933, 12665, 10456, 29881, 747, 331, 29918, 7529, 29892, 7700, 29897, 13, 13, 1678, 652, 29890, 331, 29918, 7529, 353, 1023, 29918, 18904, 29885, 29918, 4299, 29889, 7529, 29918, 517, 29918, 4571, 29933, 12665, 29898, 29943, 29918, 29886, 29892, 11323, 29892, 325, 29918, 29872, 29892, 325, 29918, 29886, 29892, 5852, 29897, 13, 1678, 1596, 877, 7529, 29918, 29906, 29907, 29990, 29924, 29918, 517, 29918, 4571, 29933, 12665, 29901, 13420, 652, 29890, 331, 29918, 7529, 29897, 13, 1678, 383, 29918, 29886, 29941, 29892, 11323, 29941, 29892, 325, 29918, 29872, 29941, 29892, 325, 29918, 29886, 29941, 353, 1023, 29918, 18904, 29885, 29918, 4299, 29889, 7529, 29918, 3166, 29918, 4571, 29933, 12665, 10456, 29881, 747, 331, 29918, 7529, 29892, 5852, 29897, 13, 13, 1678, 4974, 383, 29918, 29886, 1275, 11451, 1688, 29889, 14850, 29898, 29943, 29918, 29886, 29906, 29897, 13, 1678, 4974, 11323, 1275, 11451, 1688, 29889, 14850, 29898, 7024, 29906, 29897, 13, 1678, 4974, 325, 29918, 29872, 1275, 11451, 1688, 29889, 14850, 29898, 29894, 29918, 29872, 29906, 29897, 13, 1678, 4974, 325, 29918, 29886, 1275, 11451, 1688, 29889, 14850, 29898, 29894, 29918, 29886, 29906, 29897, 13, 1678, 4974, 383, 29918, 29886, 1275, 11451, 1688, 29889, 14850, 29898, 29943, 29918, 29886, 29941, 29897, 13, 1678, 4974, 11323, 1275, 11451, 1688, 29889, 14850, 29898, 7024, 29941, 29897, 13, 1678, 4974, 325, 29918, 29872, 1275, 11451, 1688, 29889, 14850, 29898, 29894, 29918, 29872, 29941, 29897, 13, 1678, 4974, 325, 29918, 29886, 1275, 11451, 1688, 29889, 14850, 29898, 29894, 29918, 29886, 29941, 29897, 13, 13, 1753, 1243, 29918, 535, 1760, 29878, 362, 29918, 3166, 29918, 4299, 29918, 19529, 279, 7295, 13, 1678, 3064, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29953, 29892, 29871, 29945, 29900, 29897, 13, 1678, 263, 361, 353, 270, 346, 29918, 29874, 361, 29889, 29909, 361, 29898, 3706, 353, 3064, 29897, 13, 1678, 383, 29918, 1066, 353, 29871, 29900, 29889, 29906, 13, 1678, 383, 29918, 10052, 353, 29871, 29900, 29889, 29906, 29871, 13, 1678, 476, 29918, 1066, 353, 29871, 29900, 29889, 29945, 29871, 13, 1678, 476, 29918, 10052, 353, 29871, 29946, 29889, 29900, 29871, 13, 1678, 285, 29918, 29874, 353, 29871, 29900, 29889, 29945, 29871, 13, 1678, 260, 585, 29918, 29874, 353, 29871, 29900, 29889, 29896, 29871, 13, 1678, 260, 585, 29918, 29894, 353, 29871, 29900, 29889, 29900, 29945, 13, 1678, 315, 29918, 29873, 353, 652, 29890, 331, 29889, 535, 1760, 29878, 362, 29918, 3166, 29918, 4299, 29898, 13, 4706, 263, 361, 29892, 29871, 13, 4706, 383, 29918, 1066, 29892, 383, 29918, 10052, 29892, 476, 29918, 1066, 29892, 476, 29918, 10052, 29892, 29871, 13, 4706, 285, 29918, 29874, 29892, 260, 585, 29918, 29874, 29892, 260, 585, 29918, 29894, 13, 1678, 1723, 13, 1678, 4974, 315, 29918, 29873, 29889, 2311, 1275, 3064, 29889, 2311, 13, 1678, 4974, 7442, 29889, 497, 29898, 9302, 29889, 4492, 262, 568, 29898, 29907, 29918, 29873, 876, 13, 13, 1753, 1243, 29918, 535, 1760, 29878, 362, 29918, 3166, 29918, 2378, 7295, 13, 1678, 3064, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29953, 29892, 29871, 29945, 29900, 29897, 13, 1678, 263, 361, 353, 270, 346, 29918, 29874, 361, 29889, 29909, 361, 29898, 3706, 353, 3064, 29897, 13, 1678, 383, 29918, 1066, 353, 518, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29945, 29962, 13, 1678, 383, 29918, 10052, 353, 518, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29945, 29962, 29871, 13, 1678, 476, 29918, 1066, 353, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 29945, 29962, 29871, 13, 1678, 476, 29918, 10052, 353, 518, 29946, 29889, 29900, 29892, 29871, 29946, 29889, 29945, 29962, 29871, 13, 1678, 285, 29918, 29874, 353, 29871, 29900, 29889, 29945, 29871, 13, 1678, 260, 585, 29918, 29874, 353, 29871, 29900, 29889, 29896, 29871, 13, 1678, 260, 585, 29918, 29894, 353, 29871, 29900, 29889, 29900, 29945, 13, 1678, 315, 29918, 29873, 353, 652, 29890, 331, 29889, 535, 1760, 29878, 362, 29918, 3166, 29918, 4299, 29898, 13, 4706, 263, 361, 29892, 29871, 13, 4706, 383, 29918, 1066, 29892, 383, 29918, 10052, 29892, 476, 29918, 1066, 29892, 476, 29918, 10052, 29892, 29871, 13, 4706, 285, 29918, 29874, 29892, 260, 585, 29918, 29874, 29892, 260, 585, 29918, 29894, 13, 1678, 1723, 13, 1678, 4974, 315, 29918, 29873, 29889, 2311, 1275, 29871, 29906, 29930, 3706, 29889, 2311, 13, 1678, 4974, 7442, 29889, 497, 29898, 9302, 29889, 4492, 262, 568, 29898, 29907, 29918, 29873, 876, 2 ]
hkl/user.py
NSLS-II/hklpy
1
168409
<filename>hkl/user.py """ Provide a simplified UI for hklpy diffractometer users. The user must define a diffractometer instance, then register that instance here calling `select_diffractometer(instance)`. FUNCTIONS .. autosummary:: ~cahkl ~cahkl_table ~calc_UB ~list_samples ~new_sample ~or_swap ~select_diffractometer ~set_energy ~setor ~show_sample ~show_selected_diffractometer ~update_sample ~wh ~pa """ __all__ = """ cahkl cahkl_table calc_UB change_sample list_samples new_sample or_swap pa select_diffractometer set_energy setor show_sample show_selected_diffractometer update_sample wh """.split() import logging import gi gi.require_version("Hkl", "5.0") logger = logging.getLogger(__name__) from .diffract import Diffractometer from .util import Lattice import numpy import pyRestTable _geom_ = None # selected diffractometer geometry def _check_geom_selected(*args, **kwargs): """Raise ValueError if no diffractometer geometry is selected.""" if _geom_ is None: raise ValueError( "No diffractometer selected." " Call 'select_diffractometer(diffr)' where" " 'diffr' is a diffractometer instance." ) def cahkl(h, k, l): """ Calculate motor positions for one reflection. Returns a namedtuple. Does not move motors. """ _check_geom_selected() # TODO: make certain this will not move the motors! return _geom_.forward(h, k, l) def cahkl_table(reflections, digits=5): """ Print a table with motor positions for each reflection given. Parameters ---------- reflections : list(tuple(number,number,number)) This is a list of reflections where each reflection is a tuple of 3 numbers specifying (h, k, l) of the reflection to compute the ``forward()`` computation. Example: ``[(1,0,0), (1,1,1)]`` digits : int Number of digits to roundoff each position value. Default is 5. """ _check_geom_selected() print(_geom_.forward_solutions_table(reflections, digits=digits)) # def calc_energy(): # # TODO: should this be added? # raise NotImplementedError def calc_UB(r1, r2, wavelength=None): """Compute the UB matrix with two reflections.""" _check_geom_selected() _geom_.calc.sample.compute_UB(r1, r2) print(_geom_.calc.sample.UB) def change_sample(sample): """Pick a known sample to be the current selection.""" _check_geom_selected() if sample not in _geom_.calc._samples: # fmt: off raise KeyError( f"Sample '{sample}' is unknown." f" Known samples: {list(_geom_.calc._samples.keys())}" ) # fmt: on _geom_.calc.sample = sample show_sample(sample) def list_samples(verbose=True): """List all defined crystal samples.""" _check_geom_selected() # always show the default sample first current_name = _geom_.calc.sample_name show_sample(current_name, verbose=verbose) # now, show any other samples for sample in _geom_.calc._samples.keys(): if sample != current_name: if verbose: print("") show_sample(sample, verbose=verbose) def new_sample(nm, a, b, c, alpha, beta, gamma): """Define a new crystal sample.""" _check_geom_selected() if nm in _geom_.calc._samples: logger.warning( ( "Sample '%s' is already defined." " Use 'update_sample()' to change lattice parameters" " on the *current* sample." ), nm, ) else: lattice = Lattice(a=a, b=b, c=c, alpha=alpha, beta=beta, gamma=gamma) _geom_.calc.new_sample(nm, lattice=lattice) show_sample() def or_swap(): """Swap the 2 [UB] reflections, re-compute & return new [UB].""" # note: or_swap is how the community of SPEC users knows this function _check_geom_selected() return _geom_.calc.sample.swap_orientation_reflections() def select_diffractometer(instrument=None): """Name the diffractometer to be used.""" global _geom_ if instrument is None or isinstance(instrument, Diffractometer): _geom_ = instrument else: raise TypeError(f"{instrument} must be a 'Diffractometer' subclass") def set_energy(value, units=None, offset=None): """ Set the energy (thus wavelength) to be used. """ _check_geom_selected() if units is not None: _geom_.energy_units.put(units) if offset is not None: _geom_.energy_offset.put(offset) _geom_.energy.put(value) def setor(h, k, l, *args, wavelength=None, **kwargs): """Define a crystal reflection and its motor positions.""" _check_geom_selected() if len(args) == 0: if len(kwargs) == 0: pos = _geom_.real_position else: # fmt: off pos = [ kwargs[m] for m in _geom_.calc.physical_axis_names if m in kwargs ] # fmt: on else: pos = args # NOTE: libhkl gets the wavelength on a reflection from hkl.calc # when the wavelength is set, it calls libhkl directly # as self._geometry.wavelength_set(wavelength, self._units) # The code here uses that procedure. if wavelength not in (None, 0): _geom_.calc.wavelength = wavelength refl = _geom_.calc.sample.add_reflection(h, k, l, position=pos) return refl def show_sample(sample_name=None, verbose=True): """Print the default sample name and crystal lattice.""" _check_geom_selected() sample_name = sample_name or _geom_.calc.sample_name sample = _geom_.calc._samples[sample_name] title = sample_name if sample_name == _geom_.calc.sample.name: title += " (*)" # Print Lattice more simply (than as a namedtuple). lattice = [getattr(sample.lattice, parm) for parm in sample.lattice._fields] if verbose: tbl = pyRestTable.Table() tbl.addLabel("key") tbl.addLabel("value") tbl.addRow(("name", sample_name)) tbl.addRow(("lattice", lattice)) for i, r in enumerate(sample.reflections): tbl.addRow((f"reflection {i+1}", r)) tbl.addRow(("U", numpy.round(sample.U, 5))) tbl.addRow(("UB", numpy.round(sample.UB, 5))) print(f"Sample: {title}\n") print(tbl) else: print(f"{title}: {lattice}") def show_selected_diffractometer(instrument=None): """Print the name of the selected diffractometer.""" if _geom_ is None: print("No diffractometer selected.") print(_geom_.name) def update_sample(a, b, c, alpha, beta, gamma): """Update current sample lattice.""" _check_geom_selected() _geom_.calc.sample.lattice = ( a, b, c, alpha, beta, gamma, ) # define the current sample show_sample(_geom_.calc.sample.name, verbose=False) def pa(): """Report (all) the diffractometer settings.""" _check_geom_selected() _geom_.pa() def wh(): """Report (brief) where is the diffractometer.""" _check_geom_selected() _geom_.wh()
[ 1, 529, 9507, 29958, 29882, 6321, 29914, 1792, 29889, 2272, 13, 15945, 29908, 13, 1184, 29894, 680, 263, 20875, 3740, 363, 298, 6321, 2272, 2923, 1461, 8328, 4160, 29889, 13, 13, 1576, 1404, 1818, 4529, 263, 2923, 1461, 8328, 2777, 29892, 769, 13, 9573, 393, 2777, 1244, 5432, 421, 2622, 29918, 12765, 1461, 8328, 29898, 8758, 14466, 13, 13, 29943, 28700, 29903, 13, 13, 636, 1120, 359, 398, 5219, 1057, 13, 13, 1678, 3695, 29883, 801, 6321, 13, 1678, 3695, 29883, 801, 6321, 29918, 2371, 13, 1678, 3695, 28667, 29918, 7466, 13, 1678, 3695, 1761, 29918, 27736, 13, 1678, 3695, 1482, 29918, 11249, 13, 1678, 3695, 272, 29918, 26276, 13, 1678, 3695, 2622, 29918, 12765, 1461, 8328, 13, 1678, 3695, 842, 29918, 27548, 13, 1678, 3695, 842, 272, 13, 1678, 3695, 4294, 29918, 11249, 13, 1678, 3695, 4294, 29918, 8391, 29918, 12765, 1461, 8328, 13, 1678, 3695, 5504, 29918, 11249, 13, 1678, 3695, 1332, 13, 1678, 3695, 3274, 13, 15945, 29908, 13, 13, 1649, 497, 1649, 353, 9995, 13, 1678, 274, 801, 6321, 13, 1678, 274, 801, 6321, 29918, 2371, 13, 1678, 22235, 29918, 7466, 13, 1678, 1735, 29918, 11249, 13, 1678, 1051, 29918, 27736, 13, 1678, 716, 29918, 11249, 13, 1678, 470, 29918, 26276, 13, 1678, 3300, 13, 1678, 1831, 29918, 12765, 1461, 8328, 13, 1678, 731, 29918, 27548, 13, 1678, 731, 272, 13, 1678, 1510, 29918, 11249, 13, 1678, 1510, 29918, 8391, 29918, 12765, 1461, 8328, 13, 1678, 2767, 29918, 11249, 13, 1678, 377, 13, 15945, 1642, 5451, 580, 13, 13, 5215, 12183, 13, 5215, 4005, 13, 13, 3146, 29889, 12277, 29918, 3259, 703, 29950, 6321, 613, 376, 29945, 29889, 29900, 1159, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 3166, 869, 12765, 1461, 1053, 360, 2593, 1461, 8328, 13, 3166, 869, 4422, 1053, 365, 19704, 13, 5215, 12655, 13, 5215, 11451, 15078, 3562, 13, 13, 13, 29918, 479, 290, 29918, 353, 6213, 29871, 396, 4629, 2923, 1461, 8328, 16303, 13, 13, 13, 1753, 903, 3198, 29918, 479, 290, 29918, 8391, 10456, 5085, 29892, 3579, 19290, 1125, 13, 1678, 9995, 29934, 29874, 895, 7865, 2392, 565, 694, 2923, 1461, 8328, 16303, 338, 4629, 1213, 15945, 13, 1678, 565, 903, 479, 290, 29918, 338, 6213, 29901, 13, 4706, 12020, 7865, 2392, 29898, 13, 9651, 376, 3782, 2923, 1461, 8328, 4629, 1213, 13, 9651, 376, 8251, 525, 2622, 29918, 12765, 1461, 8328, 29898, 29881, 361, 1341, 16029, 988, 29908, 13, 9651, 376, 525, 29881, 361, 1341, 29915, 338, 263, 2923, 1461, 8328, 2777, 1213, 13, 4706, 1723, 13, 13, 13, 1753, 274, 801, 6321, 29898, 29882, 29892, 413, 29892, 301, 1125, 13, 1678, 9995, 13, 1678, 20535, 403, 10992, 11909, 363, 697, 17842, 29889, 13, 13, 1678, 16969, 263, 4257, 23583, 29889, 13, 1678, 5538, 451, 4337, 3184, 943, 29889, 13, 1678, 9995, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 396, 14402, 29901, 1207, 3058, 445, 674, 451, 4337, 278, 3184, 943, 29991, 13, 1678, 736, 903, 479, 290, 5396, 11333, 29898, 29882, 29892, 413, 29892, 301, 29897, 13, 13, 13, 1753, 274, 801, 6321, 29918, 2371, 29898, 999, 5942, 29892, 13340, 29922, 29945, 1125, 13, 1678, 9995, 13, 1678, 13905, 263, 1591, 411, 10992, 11909, 363, 1269, 17842, 2183, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 2143, 5942, 584, 1051, 29898, 23583, 29898, 4537, 29892, 4537, 29892, 4537, 876, 13, 4706, 910, 338, 263, 1051, 310, 2143, 5942, 988, 13, 4706, 1269, 17842, 338, 263, 18761, 310, 29871, 29941, 3694, 13, 4706, 22146, 313, 29882, 29892, 413, 29892, 301, 29897, 310, 278, 17842, 13, 4706, 304, 10272, 278, 4954, 11333, 2555, 29952, 16287, 29889, 13, 13, 4706, 8741, 29901, 29871, 4954, 15625, 29896, 29892, 29900, 29892, 29900, 511, 313, 29896, 29892, 29896, 29892, 29896, 4638, 16159, 13, 1678, 13340, 584, 938, 13, 4706, 9681, 310, 13340, 304, 4513, 2696, 1269, 2602, 13, 4706, 995, 29889, 29871, 13109, 338, 29871, 29945, 29889, 13, 1678, 9995, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 1596, 7373, 479, 290, 5396, 11333, 29918, 2929, 17925, 29918, 2371, 29898, 999, 5942, 29892, 13340, 29922, 7501, 1169, 876, 13, 13, 13, 29937, 822, 22235, 29918, 27548, 7295, 13, 29937, 268, 396, 14402, 29901, 881, 445, 367, 2715, 29973, 13, 29937, 268, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 13, 1753, 22235, 29918, 7466, 29898, 29878, 29896, 29892, 364, 29906, 29892, 281, 6447, 1477, 29922, 8516, 1125, 13, 1678, 9995, 20606, 29872, 278, 501, 29933, 4636, 411, 1023, 2143, 5942, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 903, 479, 290, 5396, 28667, 29889, 11249, 29889, 26017, 29918, 7466, 29898, 29878, 29896, 29892, 364, 29906, 29897, 13, 1678, 1596, 7373, 479, 290, 5396, 28667, 29889, 11249, 29889, 7466, 29897, 13, 13, 13, 1753, 1735, 29918, 11249, 29898, 11249, 1125, 13, 1678, 9995, 29925, 860, 263, 2998, 4559, 304, 367, 278, 1857, 9262, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 565, 4559, 451, 297, 903, 479, 290, 5396, 28667, 3032, 27736, 29901, 13, 4706, 396, 19200, 29901, 1283, 13, 4706, 12020, 7670, 2392, 29898, 13, 9651, 285, 29908, 17708, 22372, 11249, 10162, 338, 9815, 1213, 13, 9651, 285, 29908, 29871, 8360, 776, 11916, 29901, 426, 1761, 7373, 479, 290, 5396, 28667, 3032, 27736, 29889, 8149, 580, 2915, 29908, 13, 4706, 1723, 13, 4706, 396, 19200, 29901, 373, 13, 1678, 903, 479, 290, 5396, 28667, 29889, 11249, 353, 4559, 13, 1678, 1510, 29918, 11249, 29898, 11249, 29897, 13, 13, 13, 1753, 1051, 29918, 27736, 29898, 369, 15828, 29922, 5574, 1125, 13, 1678, 9995, 1293, 599, 3342, 10901, 11195, 11916, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 396, 2337, 1510, 278, 2322, 4559, 937, 13, 1678, 1857, 29918, 978, 353, 903, 479, 290, 5396, 28667, 29889, 11249, 29918, 978, 13, 1678, 1510, 29918, 11249, 29898, 3784, 29918, 978, 29892, 26952, 29922, 369, 15828, 29897, 13, 13, 1678, 396, 1286, 29892, 1510, 738, 916, 11916, 13, 1678, 363, 4559, 297, 903, 479, 290, 5396, 28667, 3032, 27736, 29889, 8149, 7295, 13, 4706, 565, 4559, 2804, 1857, 29918, 978, 29901, 13, 9651, 565, 26952, 29901, 13, 18884, 1596, 703, 1159, 13, 9651, 1510, 29918, 11249, 29898, 11249, 29892, 26952, 29922, 369, 15828, 29897, 13, 13, 13, 1753, 716, 29918, 11249, 29898, 22882, 29892, 263, 29892, 289, 29892, 274, 29892, 15595, 29892, 21762, 29892, 330, 2735, 1125, 13, 1678, 9995, 3206, 457, 263, 716, 10901, 11195, 4559, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 565, 302, 29885, 297, 903, 479, 290, 5396, 28667, 3032, 27736, 29901, 13, 4706, 17927, 29889, 27392, 29898, 13, 9651, 313, 13, 18884, 376, 17708, 14210, 29879, 29915, 338, 2307, 3342, 1213, 13, 18884, 376, 29871, 4803, 525, 5504, 29918, 11249, 580, 29915, 304, 1735, 24094, 4128, 29908, 13, 18884, 376, 373, 278, 334, 3784, 29930, 4559, 1213, 13, 9651, 10353, 13, 9651, 302, 29885, 29892, 13, 4706, 1723, 13, 1678, 1683, 29901, 13, 4706, 24094, 353, 365, 19704, 29898, 29874, 29922, 29874, 29892, 289, 29922, 29890, 29892, 274, 29922, 29883, 29892, 15595, 29922, 2312, 29892, 21762, 29922, 3571, 29892, 330, 2735, 29922, 4283, 29897, 13, 4706, 903, 479, 290, 5396, 28667, 29889, 1482, 29918, 11249, 29898, 22882, 29892, 24094, 29922, 29880, 19704, 29897, 13, 1678, 1510, 29918, 11249, 580, 13, 13, 13, 1753, 470, 29918, 26276, 7295, 13, 1678, 9995, 10840, 481, 278, 29871, 29906, 518, 7466, 29962, 2143, 5942, 29892, 337, 29899, 26017, 669, 736, 716, 518, 7466, 29962, 1213, 15945, 13, 1678, 396, 4443, 29901, 470, 29918, 26276, 338, 920, 278, 7881, 310, 317, 4162, 29907, 4160, 9906, 445, 740, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 736, 903, 479, 290, 5396, 28667, 29889, 11249, 29889, 26276, 29918, 20659, 29918, 999, 5942, 580, 13, 13, 13, 1753, 1831, 29918, 12765, 1461, 8328, 29898, 2611, 15461, 29922, 8516, 1125, 13, 1678, 9995, 1170, 278, 2923, 1461, 8328, 304, 367, 1304, 1213, 15945, 13, 1678, 5534, 903, 479, 290, 29918, 13, 1678, 565, 11395, 338, 6213, 470, 338, 8758, 29898, 2611, 15461, 29892, 360, 2593, 1461, 8328, 1125, 13, 4706, 903, 479, 290, 29918, 353, 11395, 13, 1678, 1683, 29901, 13, 4706, 12020, 20948, 29898, 29888, 29908, 29912, 2611, 15461, 29913, 1818, 367, 263, 525, 26023, 1461, 8328, 29915, 19481, 1159, 13, 13, 13, 1753, 731, 29918, 27548, 29898, 1767, 29892, 10340, 29922, 8516, 29892, 9210, 29922, 8516, 1125, 13, 1678, 9995, 13, 1678, 3789, 278, 5864, 313, 386, 375, 281, 6447, 1477, 29897, 304, 367, 1304, 29889, 13, 1678, 9995, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 565, 10340, 338, 451, 6213, 29901, 13, 4706, 903, 479, 290, 5396, 27548, 29918, 348, 1169, 29889, 649, 29898, 348, 1169, 29897, 13, 1678, 565, 9210, 338, 451, 6213, 29901, 13, 4706, 903, 479, 290, 5396, 27548, 29918, 10289, 29889, 649, 29898, 10289, 29897, 13, 1678, 903, 479, 290, 5396, 27548, 29889, 649, 29898, 1767, 29897, 13, 13, 13, 1753, 731, 272, 29898, 29882, 29892, 413, 29892, 301, 29892, 334, 5085, 29892, 281, 6447, 1477, 29922, 8516, 29892, 3579, 19290, 1125, 13, 1678, 9995, 3206, 457, 263, 10901, 11195, 17842, 322, 967, 10992, 11909, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 565, 7431, 29898, 5085, 29897, 1275, 29871, 29900, 29901, 13, 4706, 565, 7431, 29898, 19290, 29897, 1275, 29871, 29900, 29901, 13, 9651, 926, 353, 903, 479, 290, 5396, 6370, 29918, 3283, 13, 4706, 1683, 29901, 13, 9651, 396, 19200, 29901, 1283, 13, 9651, 926, 353, 518, 13, 18884, 9049, 5085, 29961, 29885, 29962, 13, 18884, 363, 286, 297, 903, 479, 290, 5396, 28667, 29889, 14017, 936, 29918, 8990, 29918, 7039, 13, 18884, 565, 286, 297, 9049, 5085, 13, 9651, 4514, 13, 9651, 396, 19200, 29901, 373, 13, 1678, 1683, 29901, 13, 4706, 926, 353, 6389, 13, 13, 1678, 396, 6058, 29923, 29901, 4303, 29882, 6321, 4947, 278, 281, 6447, 1477, 373, 263, 17842, 515, 298, 6321, 29889, 28667, 13, 1678, 396, 746, 278, 281, 6447, 1477, 338, 731, 29892, 372, 5717, 4303, 29882, 6321, 4153, 13, 1678, 396, 408, 1583, 3032, 19156, 29889, 29893, 6447, 1477, 29918, 842, 29898, 29893, 6447, 1477, 29892, 1583, 3032, 348, 1169, 29897, 13, 1678, 396, 450, 775, 1244, 3913, 393, 8792, 29889, 13, 1678, 565, 281, 6447, 1477, 451, 297, 313, 8516, 29892, 29871, 29900, 1125, 13, 4706, 903, 479, 290, 5396, 28667, 29889, 29893, 6447, 1477, 353, 281, 6447, 1477, 13, 13, 1678, 337, 1579, 353, 903, 479, 290, 5396, 28667, 29889, 11249, 29889, 1202, 29918, 999, 1464, 29898, 29882, 29892, 413, 29892, 301, 29892, 2602, 29922, 1066, 29897, 13, 1678, 736, 337, 1579, 13, 13, 13, 1753, 1510, 29918, 11249, 29898, 11249, 29918, 978, 29922, 8516, 29892, 26952, 29922, 5574, 1125, 13, 1678, 9995, 11816, 278, 2322, 4559, 1024, 322, 10901, 11195, 24094, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 4559, 29918, 978, 353, 4559, 29918, 978, 470, 903, 479, 290, 5396, 28667, 29889, 11249, 29918, 978, 13, 1678, 4559, 353, 903, 479, 290, 5396, 28667, 3032, 27736, 29961, 11249, 29918, 978, 29962, 13, 13, 1678, 3611, 353, 4559, 29918, 978, 13, 1678, 565, 4559, 29918, 978, 1275, 903, 479, 290, 5396, 28667, 29889, 11249, 29889, 978, 29901, 13, 4706, 3611, 4619, 376, 3070, 5513, 13, 13, 1678, 396, 13905, 365, 19704, 901, 3763, 313, 27603, 408, 263, 4257, 23583, 467, 13, 1678, 24094, 353, 518, 657, 5552, 29898, 11249, 29889, 29880, 19704, 29892, 610, 29885, 29897, 363, 610, 29885, 297, 4559, 29889, 29880, 19704, 3032, 9621, 29962, 13, 1678, 565, 26952, 29901, 13, 4706, 19018, 353, 11451, 15078, 3562, 29889, 3562, 580, 13, 4706, 19018, 29889, 1202, 4775, 703, 1989, 1159, 13, 4706, 19018, 29889, 1202, 4775, 703, 1767, 1159, 13, 4706, 19018, 29889, 1202, 4301, 29898, 703, 978, 613, 4559, 29918, 978, 876, 13, 4706, 19018, 29889, 1202, 4301, 29898, 703, 29880, 19704, 613, 24094, 876, 13, 4706, 363, 474, 29892, 364, 297, 26985, 29898, 11249, 29889, 999, 5942, 1125, 13, 9651, 19018, 29889, 1202, 4301, 3552, 29888, 29908, 999, 1464, 426, 29875, 29974, 29896, 17671, 364, 876, 13, 4706, 19018, 29889, 1202, 4301, 29898, 703, 29965, 613, 12655, 29889, 14486, 29898, 11249, 29889, 29965, 29892, 29871, 29945, 4961, 13, 4706, 19018, 29889, 1202, 4301, 29898, 703, 7466, 613, 12655, 29889, 14486, 29898, 11249, 29889, 7466, 29892, 29871, 29945, 4961, 13, 13, 4706, 1596, 29898, 29888, 29908, 17708, 29901, 426, 3257, 1012, 29876, 1159, 13, 4706, 1596, 29898, 16400, 29897, 13, 1678, 1683, 29901, 13, 4706, 1596, 29898, 29888, 29908, 29912, 3257, 6177, 426, 29880, 19704, 27195, 13, 13, 13, 1753, 1510, 29918, 8391, 29918, 12765, 1461, 8328, 29898, 2611, 15461, 29922, 8516, 1125, 13, 1678, 9995, 11816, 278, 1024, 310, 278, 4629, 2923, 1461, 8328, 1213, 15945, 13, 1678, 565, 903, 479, 290, 29918, 338, 6213, 29901, 13, 4706, 1596, 703, 3782, 2923, 1461, 8328, 4629, 23157, 13, 1678, 1596, 7373, 479, 290, 5396, 978, 29897, 13, 13, 13, 1753, 2767, 29918, 11249, 29898, 29874, 29892, 289, 29892, 274, 29892, 15595, 29892, 21762, 29892, 330, 2735, 1125, 13, 1678, 9995, 6422, 1857, 4559, 24094, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 903, 479, 290, 5396, 28667, 29889, 11249, 29889, 29880, 19704, 353, 313, 13, 4706, 263, 29892, 13, 4706, 289, 29892, 13, 4706, 274, 29892, 13, 4706, 15595, 29892, 13, 4706, 21762, 29892, 13, 4706, 330, 2735, 29892, 13, 1678, 1723, 29871, 396, 4529, 278, 1857, 4559, 13, 1678, 1510, 29918, 11249, 7373, 479, 290, 5396, 28667, 29889, 11249, 29889, 978, 29892, 26952, 29922, 8824, 29897, 13, 13, 13, 1753, 3300, 7295, 13, 1678, 9995, 13020, 313, 497, 29897, 278, 2923, 1461, 8328, 6055, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 903, 479, 290, 5396, 3274, 580, 13, 13, 13, 1753, 377, 7295, 13, 1678, 9995, 13020, 313, 1182, 2575, 29897, 988, 338, 278, 2923, 1461, 8328, 1213, 15945, 13, 1678, 903, 3198, 29918, 479, 290, 29918, 8391, 580, 13, 1678, 903, 479, 290, 5396, 1332, 580, 13, 2 ]
Network_and_802.11/scapy/check_if_rogue_dhcp.py
hacky1997/My-Gray-Hacker-Resources
14
128805
<gh_stars>10-100 #!/usr/bin/env python from scapy.all import * import threading from colorama import Back from sys import argv from time import sleep global lock lock = threading.Lock() def BootpPacket(): fm, hw = get_if_raw_hwaddr(scapy.all.conf.iface) ether=Ether(dst="ff:ff:ff:ff:ff:ff") ip=IP(src="0.0.0.0",dst="255.255.255.255") udp=UDP(sport=68,dport=67) bootp=BOOTP(chaddr=hw) dhcp=DHCP(options=[("message-type","discover"),"end"]) DHCPDiscover = ether/ip/udp/bootp/dhcp return DHCPDiscover def sendpkt(DHCPDiscover): srp(DHCPDiscover,timeout=2,inter=5, verbose=0) a = sniff(prn=test) # Thread2 for sniffing BOOTP Message on the network (DHCP OFFER MSG) t2 = threading.Thread(target=test) t2.start() def test(pkt): if pkt.haslayer(BOOTP): if pkt[IP].src != "0.0.0.0" and pkt[IP].src != LegalDHCPServer and pkt[BOOTP].op ==2: if pkt[IP].src not in dhcpservers: try: lock.acquire() print "Rogue DHCP Server(hacker) is at " + Back.RED+"%s"%pkt[IP].src+Back.RESET dhcpservers.add(pkt[IP].src) except : lock.acquire() finally: lock.release() else: pass else: if pkt[IP].src not in legalservers: try: lock.acquire() print "Legal DHCP Server:%s"%pkt[IP].src legalservers.add(pkt[IP].src) except: lock.acquire() finally: lock.release() else: pass else: pass if __name__ == '__main__': DHCPDiscover = BootpPacket() legalservers = set() dhcpservers = set() while True: if len(argv) != 2: print 'Usage: %s <LegalServersIP>'%argv[0] exit(0) else: LegalDHCPServer = argv[1] t = threading.Thread(target=sendpkt,args=DHCPDiscover) t.start() sleep(5)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 3166, 885, 27580, 29889, 497, 1053, 334, 13, 5215, 3244, 292, 13, 3166, 2927, 3304, 1053, 7437, 13, 3166, 10876, 1053, 1852, 29894, 13, 3166, 931, 1053, 8709, 13, 13, 10945, 7714, 13, 908, 353, 3244, 292, 29889, 16542, 580, 13, 13, 1753, 13760, 29886, 16638, 300, 7295, 13, 1678, 285, 29885, 29892, 298, 29893, 353, 679, 29918, 361, 29918, 1610, 29918, 26828, 10030, 29898, 1557, 27580, 29889, 497, 29889, 5527, 29889, 361, 815, 29897, 13, 268, 1979, 29922, 29923, 721, 29898, 22992, 543, 600, 29901, 600, 29901, 600, 29901, 600, 29901, 600, 29901, 600, 1159, 13, 1678, 10377, 29922, 5690, 29898, 4351, 543, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 613, 22992, 543, 29906, 29945, 29945, 29889, 29906, 29945, 29945, 29889, 29906, 29945, 29945, 29889, 29906, 29945, 29945, 1159, 13, 1678, 318, 6099, 29922, 29965, 11191, 29898, 29879, 637, 29922, 29953, 29947, 29892, 29881, 637, 29922, 29953, 29955, 29897, 13, 1678, 6579, 29886, 29922, 8456, 2891, 29925, 29898, 305, 10030, 29922, 26828, 29897, 13, 1678, 270, 29882, 6814, 29922, 29928, 29950, 6271, 29898, 6768, 11759, 703, 4906, 29899, 1853, 3284, 2218, 11911, 4968, 29908, 355, 20068, 13, 1678, 360, 29950, 6271, 4205, 11911, 353, 29871, 1979, 29914, 666, 29914, 566, 29886, 29914, 4777, 29886, 29914, 12744, 6814, 13, 1678, 736, 360, 29950, 6271, 4205, 11911, 13, 13, 1753, 3638, 29886, 1193, 29898, 29928, 29950, 6271, 4205, 11911, 1125, 13, 1678, 269, 19080, 29898, 29928, 29950, 6271, 4205, 11911, 29892, 15619, 29922, 29906, 29892, 1639, 29922, 29945, 29892, 26952, 29922, 29900, 29897, 13, 1678, 263, 353, 5807, 2593, 29898, 558, 29876, 29922, 1688, 29897, 13, 1678, 396, 10480, 29906, 363, 5807, 2593, 292, 16437, 2891, 29925, 7777, 373, 278, 3564, 313, 29928, 29950, 6271, 438, 28483, 10888, 29954, 29897, 13, 1678, 260, 29906, 353, 3244, 292, 29889, 4899, 29898, 5182, 29922, 1688, 29897, 13, 1678, 260, 29906, 29889, 2962, 580, 13, 13, 13, 1753, 1243, 29898, 29886, 1193, 1125, 13, 1678, 565, 282, 1193, 29889, 5349, 13148, 29898, 8456, 2891, 29925, 1125, 13, 4706, 565, 282, 1193, 29961, 5690, 1822, 4351, 2804, 376, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29908, 322, 282, 1193, 29961, 5690, 1822, 4351, 2804, 5682, 284, 29928, 29950, 6271, 6004, 322, 282, 1193, 29961, 8456, 2891, 29925, 1822, 459, 1275, 29906, 29901, 13, 9651, 565, 282, 1193, 29961, 5690, 1822, 4351, 451, 297, 270, 29882, 29883, 567, 261, 874, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 7714, 29889, 562, 1548, 580, 13, 462, 1678, 1596, 376, 29934, 468, 434, 360, 29950, 6271, 5656, 29898, 29882, 28940, 29897, 338, 472, 376, 718, 7437, 29889, 19386, 13578, 29995, 29879, 29908, 29995, 29886, 1193, 29961, 5690, 1822, 4351, 29974, 5841, 29889, 1525, 10490, 13, 462, 1678, 270, 29882, 29883, 567, 261, 874, 29889, 1202, 29898, 29886, 1193, 29961, 5690, 1822, 4351, 29897, 13, 18884, 5174, 584, 13, 462, 1678, 7714, 29889, 562, 1548, 580, 13, 18884, 7146, 29901, 13, 462, 1678, 7714, 29889, 14096, 580, 13, 9651, 1683, 29901, 13, 18884, 1209, 13, 4706, 1683, 29901, 13, 13, 9651, 565, 282, 1193, 29961, 5690, 1822, 4351, 451, 297, 11706, 643, 874, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 7714, 29889, 562, 1548, 580, 13, 462, 1678, 1596, 376, 22988, 284, 360, 29950, 6271, 5656, 16664, 29879, 29908, 29995, 29886, 1193, 29961, 5690, 1822, 4351, 13, 462, 1678, 11706, 643, 874, 29889, 1202, 29898, 29886, 1193, 29961, 5690, 1822, 4351, 29897, 13, 18884, 5174, 29901, 13, 462, 1678, 7714, 29889, 562, 1548, 580, 13, 18884, 7146, 29901, 13, 462, 1678, 7714, 29889, 14096, 580, 13, 9651, 1683, 29901, 13, 18884, 1209, 13, 1678, 1683, 29901, 13, 4706, 1209, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 360, 29950, 6271, 4205, 11911, 353, 13760, 29886, 16638, 300, 580, 13, 1678, 11706, 643, 874, 353, 731, 580, 13, 1678, 270, 29882, 29883, 567, 261, 874, 353, 731, 580, 13, 1678, 1550, 5852, 29901, 13, 4706, 565, 7431, 29898, 19218, 29897, 2804, 29871, 29906, 29901, 13, 9651, 1596, 525, 27573, 29901, 1273, 29879, 529, 22988, 284, 1748, 874, 5690, 16299, 29995, 19218, 29961, 29900, 29962, 13, 9651, 6876, 29898, 29900, 29897, 13, 4706, 1683, 29901, 13, 9651, 5682, 284, 29928, 29950, 6271, 6004, 353, 1852, 29894, 29961, 29896, 29962, 13, 9651, 260, 353, 3244, 292, 29889, 4899, 29898, 5182, 29922, 6717, 29886, 1193, 29892, 5085, 29922, 29928, 29950, 6271, 4205, 11911, 29897, 13, 9651, 260, 29889, 2962, 580, 13, 9651, 8709, 29898, 29945, 29897, 2 ]
logistic_regression/logistic_regression.py
suitnecniv/dota2
127
194928
<filename>logistic_regression/logistic_regression.py import numpy as np import pickle, os NUM_HEROES = 108 NUM_FEATURES = NUM_HEROES * 2 class D2LogisticRegression: def __init__(self, model_root='logistic_regression'): model_path = os.path.join(model_root, 'model.pkl') with open(model_path, 'r') as input_file: self.model = pickle.load(input_file) def transform(self, my_team, their_team): X = np.zeros(NUM_FEATURES, dtype=np.int8) for hero_id in my_team: X[hero_id - 1] = 1 for hero_id in their_team: X[hero_id - 1 + NUM_HEROES] = 1 return X def recommend(self, my_team, their_team, hero_candidates): '''Returns a list of (hero, probablility of winning with hero added) recommended to complete my_team.''' team_possibilities = [(candidate, my_team + [candidate]) for candidate in hero_candidates] prob_candidate_pairs = [] for candidate, team in team_possibilities: query = self.transform(team, their_team) prob = self.score(query) #self.model.predict_proba(query)[0][1] prob_candidate_pairs.append((prob, candidate)) prob_candidate_pairs = sorted(prob_candidate_pairs, reverse=True)[0:5 - len(my_team)] return prob_candidate_pairs def score(self, query): '''Score the query using the model, considering both radiant and dire teams.''' radiant_query = query dire_query = np.concatenate((radiant_query[NUM_HEROES:NUM_FEATURES], radiant_query[0:NUM_HEROES])) rad_prob = self.model.predict_proba(radiant_query)[0][1] dire_prob = self.model.predict_proba(dire_query)[0][0] return (rad_prob + dire_prob) / 2 def predict(self, dream_team, their_team): '''Returns the probability of the dream_team winning against their_team.''' dream_team_query = self.transform(dream_team, their_team) return self.score(dream_team_query) #return self.model.predict_proba(dream_team_query)[0][1]
[ 1, 529, 9507, 29958, 1188, 4695, 29918, 276, 11476, 29914, 1188, 4695, 29918, 276, 11476, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 5839, 280, 29892, 2897, 13, 13, 13967, 29918, 4448, 29949, 2890, 353, 29871, 29896, 29900, 29947, 13, 13967, 29918, 16359, 1299, 11499, 29903, 353, 28019, 29918, 4448, 29949, 2890, 334, 29871, 29906, 13, 13, 1990, 360, 29906, 3403, 4695, 4597, 23881, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1904, 29918, 4632, 2433, 1188, 4695, 29918, 276, 11476, 29374, 13, 4706, 1904, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4299, 29918, 4632, 29892, 525, 4299, 29889, 29886, 6321, 1495, 13, 4706, 411, 1722, 29898, 4299, 29918, 2084, 29892, 525, 29878, 1495, 408, 1881, 29918, 1445, 29901, 13, 9651, 1583, 29889, 4299, 353, 5839, 280, 29889, 1359, 29898, 2080, 29918, 1445, 29897, 13, 13, 1678, 822, 4327, 29898, 1311, 29892, 590, 29918, 14318, 29892, 1009, 29918, 14318, 1125, 13, 4706, 1060, 353, 7442, 29889, 3298, 359, 29898, 13967, 29918, 16359, 1299, 11499, 29903, 29892, 26688, 29922, 9302, 29889, 524, 29947, 29897, 13, 4706, 363, 13444, 29918, 333, 297, 590, 29918, 14318, 29901, 13, 9651, 1060, 29961, 29882, 1489, 29918, 333, 448, 29871, 29896, 29962, 353, 29871, 29896, 13, 4706, 363, 13444, 29918, 333, 297, 1009, 29918, 14318, 29901, 13, 9651, 1060, 29961, 29882, 1489, 29918, 333, 448, 29871, 29896, 718, 28019, 29918, 4448, 29949, 2890, 29962, 353, 29871, 29896, 13, 4706, 736, 1060, 13, 13, 1678, 822, 6907, 29898, 1311, 29892, 590, 29918, 14318, 29892, 1009, 29918, 14318, 29892, 13444, 29918, 29883, 5380, 1078, 1125, 13, 4706, 14550, 11609, 29879, 263, 1051, 310, 313, 29882, 1489, 29892, 2070, 12478, 1793, 310, 15613, 411, 13444, 2715, 29897, 13622, 304, 4866, 590, 29918, 14318, 29889, 12008, 13, 4706, 3815, 29918, 28802, 747, 9770, 353, 17288, 29883, 5380, 403, 29892, 590, 29918, 14318, 718, 518, 29883, 5380, 403, 2314, 363, 14020, 297, 13444, 29918, 29883, 5380, 1078, 29962, 13, 13, 4706, 2070, 29918, 29883, 5380, 403, 29918, 29886, 7121, 353, 5159, 13, 4706, 363, 14020, 29892, 3815, 297, 3815, 29918, 28802, 747, 9770, 29901, 13, 9651, 2346, 353, 1583, 29889, 9067, 29898, 14318, 29892, 1009, 29918, 14318, 29897, 13, 9651, 2070, 353, 1583, 29889, 13628, 29898, 1972, 29897, 396, 1311, 29889, 4299, 29889, 27711, 29918, 771, 2291, 29898, 1972, 9601, 29900, 3816, 29896, 29962, 13, 9651, 2070, 29918, 29883, 5380, 403, 29918, 29886, 7121, 29889, 4397, 3552, 22795, 29892, 14020, 876, 13, 4706, 2070, 29918, 29883, 5380, 403, 29918, 29886, 7121, 353, 12705, 29898, 22795, 29918, 29883, 5380, 403, 29918, 29886, 7121, 29892, 11837, 29922, 5574, 9601, 29900, 29901, 29945, 448, 7431, 29898, 1357, 29918, 14318, 4638, 13, 4706, 736, 2070, 29918, 29883, 5380, 403, 29918, 29886, 7121, 13, 13, 1678, 822, 8158, 29898, 1311, 29892, 2346, 1125, 13, 4706, 14550, 20097, 278, 2346, 773, 278, 1904, 29892, 13858, 1716, 17937, 424, 322, 2970, 10907, 29889, 12008, 13, 4706, 17937, 424, 29918, 1972, 353, 2346, 13, 4706, 2970, 29918, 1972, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 3665, 29875, 424, 29918, 1972, 29961, 13967, 29918, 4448, 29949, 2890, 29901, 13967, 29918, 16359, 1299, 11499, 29903, 1402, 17937, 424, 29918, 1972, 29961, 29900, 29901, 13967, 29918, 4448, 29949, 2890, 12622, 13, 4706, 2971, 29918, 22795, 353, 1583, 29889, 4299, 29889, 27711, 29918, 771, 2291, 29898, 3665, 29875, 424, 29918, 1972, 9601, 29900, 3816, 29896, 29962, 13, 4706, 2970, 29918, 22795, 353, 1583, 29889, 4299, 29889, 27711, 29918, 771, 2291, 29898, 20146, 29918, 1972, 9601, 29900, 3816, 29900, 29962, 13, 4706, 736, 313, 3665, 29918, 22795, 718, 2970, 29918, 22795, 29897, 847, 29871, 29906, 13, 13, 1678, 822, 8500, 29898, 1311, 29892, 12561, 29918, 14318, 29892, 1009, 29918, 14318, 1125, 13, 4706, 14550, 11609, 29879, 278, 6976, 310, 278, 12561, 29918, 14318, 15613, 2750, 1009, 29918, 14318, 29889, 12008, 13, 4706, 12561, 29918, 14318, 29918, 1972, 353, 1583, 29889, 9067, 29898, 29881, 1633, 29918, 14318, 29892, 1009, 29918, 14318, 29897, 13, 4706, 736, 1583, 29889, 13628, 29898, 29881, 1633, 29918, 14318, 29918, 1972, 29897, 13, 4706, 396, 2457, 1583, 29889, 4299, 29889, 27711, 29918, 771, 2291, 29898, 29881, 1633, 29918, 14318, 29918, 1972, 9601, 29900, 3816, 29896, 29962, 13, 2 ]
main/faq.py
vanessa-bell/hd-kiosk-v2
0
69045
<gh_stars>0 import flask import flask_wtf import wtforms import auth import model import util from google.appengine.ext import ndb from main import app class FaqUpdateForm(flask_wtf.FlaskForm): question = wtforms.TextAreaField('Question', [wtforms.validators.required()]) answer = wtforms.TextAreaField('Answer', [wtforms.validators.required()]) category = wtforms.SelectField('Category', [wtforms.validators.required()], choices=[('About/History','About/History'),('Financials','Financials'),('The Physical Space','The Physical Space'),('Other Hackerspaces','Other Hackerspaces'),('Paperwork and Logistics','Paperwork and Logistics'),('Miscellaneous','Miscellaneous')]) @app.route('/faqs/create/', methods=['GET', 'POST']) @auth.login_required def faq_create(): form = FaqUpdateForm() if form.validate_on_submit(): faq_db = model.Faq( user_key=auth.current_user_key(), question=form.question.data, answer=form.answer.data, category=form.category.data, ) faq_db.put() return flask.redirect(flask.url_for('welcome')) return flask.render_template( 'faq_create.html', html_class='faq-create', title='Create FAQ', form=form, ) @app.route('/faqs/') def faqs_list(): faq_dbs, faq_cursor = model.Faq.get_dbs() return flask.render_template( 'faqs_list.html', html_class='faqs-list', title='Frequently Asked Questions', faq_dbs=faq_dbs, next_url=util.generate_next_url(faq_cursor), ) @app.route('/faqs/stats') def statistics(): faq_dbs, faq_cursor = model.Faq.get_dbs() return flask.render_template( 'statistics.html', html_class='statistics', title='Statistics', faq_dbs=faq_dbs, next_url=util.generate_next_url(faq_cursor), ) @app.route('/faqs/<int:faq_id>/update/', methods=['GET', 'POST']) @auth.login_required def faq_update(faq_id): faq_db = model.Faq.get_by_id(faq_id) if not faq_db: # or faq_db.user_key != auth.current_user_key() flask.abort(404) form = FaqUpdateForm(obj=faq_db) if form.validate_on_submit(): form.populate_obj(faq_db) faq_db.put() return flask.redirect(flask.url_for('faqs_list')) return flask.render_template( 'faq_update.html', html_class='faq-update', title=faq_db.question, form=form, faq_db=faq_db, faq_id=faq_id ) @app.route('/faqs/<int:faq_id>/delete/', methods=['GET', 'POST']) @auth.login_required def faq_delete(faq_id): faq_key = ndb.Key("Faq",faq_id) faq_key.delete() faq_dbs = model.Faq.get_dbs() return flask.redirect(flask.url_for('faqs_list')) @app.route('/faqs/<int:faq_id>/count/', methods=['GET', 'POST']) def faq_count(faq_id): stat_db = model.Stat( faq_key=ndb.Key("Faq",faq_id), ) stat_db.put() faq_db = model.Faq.get_by_id(faq_id) faq_db.count = faq_db.count + 1 faq_db.put() return 'done' # return response, 200, {'Content-Type': 'text/plain'}
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 29784, 13, 5215, 29784, 29918, 29893, 13264, 13, 5215, 281, 29873, 9514, 13, 13, 5215, 4817, 13, 5215, 1904, 13, 5215, 3667, 13, 3166, 5386, 29889, 932, 10599, 29889, 1062, 1053, 29871, 299, 29890, 13, 13, 3166, 1667, 1053, 623, 13, 13, 1990, 7748, 29939, 6422, 2500, 29898, 1579, 1278, 29918, 29893, 13264, 29889, 8754, 1278, 2500, 1125, 13, 29871, 1139, 353, 281, 29873, 9514, 29889, 1626, 13799, 3073, 877, 16492, 742, 518, 14554, 9514, 29889, 3084, 4097, 29889, 12403, 580, 2314, 13, 29871, 1234, 353, 281, 29873, 9514, 29889, 1626, 13799, 3073, 877, 22550, 742, 518, 14554, 9514, 29889, 3084, 4097, 29889, 12403, 580, 2314, 13, 29871, 7663, 353, 281, 29873, 9514, 29889, 3549, 3073, 877, 10900, 742, 518, 14554, 9514, 29889, 3084, 4097, 29889, 12403, 580, 1402, 19995, 11759, 877, 28173, 29914, 20570, 3788, 28173, 29914, 20570, 5477, 877, 12881, 8463, 1338, 3788, 12881, 8463, 1338, 5477, 877, 1576, 11661, 936, 14121, 3788, 1576, 11661, 936, 14121, 5477, 877, 16107, 379, 547, 414, 22459, 3788, 16107, 379, 547, 414, 22459, 5477, 877, 29925, 7202, 1287, 322, 4522, 6765, 3788, 29925, 7202, 1287, 322, 4522, 6765, 5477, 877, 29924, 275, 3729, 23584, 3788, 29924, 275, 3729, 23584, 1495, 2314, 13, 13, 29992, 932, 29889, 13134, 11219, 5444, 29939, 29879, 29914, 3258, 29914, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 13, 1753, 2258, 29939, 29918, 3258, 7295, 13, 12, 689, 353, 7748, 29939, 6422, 2500, 580, 13, 13, 12, 361, 883, 29889, 15480, 29918, 265, 29918, 7892, 7295, 13, 12, 12, 5444, 29939, 29918, 2585, 353, 1904, 29889, 14206, 29939, 29898, 13, 12, 12, 12, 1792, 29918, 1989, 29922, 5150, 29889, 3784, 29918, 1792, 29918, 1989, 3285, 13, 12, 12, 12, 12470, 29922, 689, 29889, 12470, 29889, 1272, 29892, 13, 12, 12, 12, 12011, 29922, 689, 29889, 12011, 29889, 1272, 29892, 13, 12, 12, 12, 7320, 29922, 689, 29889, 7320, 29889, 1272, 29892, 13, 12, 12, 29897, 13, 12, 12, 5444, 29939, 29918, 2585, 29889, 649, 580, 13, 12, 12, 2457, 29784, 29889, 17886, 29898, 1579, 1278, 29889, 2271, 29918, 1454, 877, 20466, 2763, 8785, 13, 13, 259, 13, 13, 12, 2457, 29784, 29889, 9482, 29918, 6886, 29898, 13, 12, 12, 29915, 5444, 29939, 29918, 3258, 29889, 1420, 742, 13, 12, 12, 1420, 29918, 1990, 2433, 5444, 29939, 29899, 3258, 742, 13, 12, 12, 3257, 2433, 4391, 13515, 29984, 742, 13, 12, 12, 689, 29922, 689, 29892, 13, 12, 29897, 13, 13, 29992, 932, 29889, 13134, 11219, 5444, 29939, 29879, 29914, 1495, 13, 1753, 2258, 29939, 29879, 29918, 1761, 7295, 13, 29871, 2258, 29939, 29918, 2585, 29879, 29892, 2258, 29939, 29918, 18127, 353, 1904, 29889, 14206, 29939, 29889, 657, 29918, 2585, 29879, 580, 13, 13, 29871, 736, 29784, 29889, 9482, 29918, 6886, 29898, 13, 418, 525, 5444, 29939, 29879, 29918, 1761, 29889, 1420, 742, 13, 418, 3472, 29918, 1990, 2433, 5444, 29939, 29879, 29899, 1761, 742, 13, 418, 3611, 2433, 23923, 339, 2705, 26579, 287, 894, 29879, 742, 13, 418, 2258, 29939, 29918, 2585, 29879, 29922, 5444, 29939, 29918, 2585, 29879, 29892, 13, 418, 2446, 29918, 2271, 29922, 4422, 29889, 17158, 29918, 4622, 29918, 2271, 29898, 5444, 29939, 29918, 18127, 511, 13, 1678, 1723, 13, 13, 29992, 932, 29889, 13134, 11219, 5444, 29939, 29879, 29914, 16202, 1495, 13, 1753, 13964, 7295, 13, 29871, 2258, 29939, 29918, 2585, 29879, 29892, 2258, 29939, 29918, 18127, 353, 1904, 29889, 14206, 29939, 29889, 657, 29918, 2585, 29879, 580, 13, 13, 29871, 736, 29784, 29889, 9482, 29918, 6886, 29898, 13, 418, 525, 6112, 6765, 29889, 1420, 742, 13, 418, 3472, 29918, 1990, 2433, 6112, 6765, 742, 13, 418, 3611, 2433, 9513, 6765, 742, 13, 418, 2258, 29939, 29918, 2585, 29879, 29922, 5444, 29939, 29918, 2585, 29879, 29892, 13, 418, 2446, 29918, 2271, 29922, 4422, 29889, 17158, 29918, 4622, 29918, 2271, 29898, 5444, 29939, 29918, 18127, 511, 13, 1678, 1723, 13, 13, 29992, 932, 29889, 13134, 11219, 5444, 29939, 29879, 29914, 29966, 524, 29901, 5444, 29939, 29918, 333, 20690, 5504, 29914, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 13, 1753, 2258, 29939, 29918, 5504, 29898, 5444, 29939, 29918, 333, 1125, 13, 29871, 2258, 29939, 29918, 2585, 353, 1904, 29889, 14206, 29939, 29889, 657, 29918, 1609, 29918, 333, 29898, 5444, 29939, 29918, 333, 29897, 13, 29871, 565, 451, 2258, 29939, 29918, 2585, 29901, 29871, 13, 1678, 396, 470, 2258, 29939, 29918, 2585, 29889, 1792, 29918, 1989, 2804, 4817, 29889, 3784, 29918, 1792, 29918, 1989, 580, 13, 1678, 29784, 29889, 370, 441, 29898, 29946, 29900, 29946, 29897, 13, 29871, 883, 353, 7748, 29939, 6422, 2500, 29898, 5415, 29922, 5444, 29939, 29918, 2585, 29897, 13, 29871, 565, 883, 29889, 15480, 29918, 265, 29918, 7892, 7295, 13, 1678, 883, 29889, 7323, 5987, 29918, 5415, 29898, 5444, 29939, 29918, 2585, 29897, 13, 1678, 2258, 29939, 29918, 2585, 29889, 649, 580, 13, 1678, 736, 29784, 29889, 17886, 29898, 1579, 1278, 29889, 2271, 29918, 1454, 877, 5444, 29939, 29879, 29918, 1761, 8785, 13, 29871, 736, 29784, 29889, 9482, 29918, 6886, 29898, 13, 418, 525, 5444, 29939, 29918, 5504, 29889, 1420, 742, 13, 418, 3472, 29918, 1990, 2433, 5444, 29939, 29899, 5504, 742, 13, 418, 3611, 29922, 5444, 29939, 29918, 2585, 29889, 12470, 29892, 13, 418, 883, 29922, 689, 29892, 13, 418, 2258, 29939, 29918, 2585, 29922, 5444, 29939, 29918, 2585, 29892, 13, 418, 2258, 29939, 29918, 333, 29922, 5444, 29939, 29918, 333, 13, 1678, 1723, 13, 13, 29992, 932, 29889, 13134, 11219, 5444, 29939, 29879, 29914, 29966, 524, 29901, 5444, 29939, 29918, 333, 20690, 8143, 29914, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 13, 1753, 2258, 29939, 29918, 8143, 29898, 5444, 29939, 29918, 333, 1125, 13, 29871, 2258, 29939, 29918, 1989, 353, 29871, 299, 29890, 29889, 2558, 703, 14206, 29939, 613, 5444, 29939, 29918, 333, 29897, 13, 29871, 2258, 29939, 29918, 1989, 29889, 8143, 580, 13, 29871, 2258, 29939, 29918, 2585, 29879, 353, 1904, 29889, 14206, 29939, 29889, 657, 29918, 2585, 29879, 580, 13, 29871, 736, 29784, 29889, 17886, 29898, 1579, 1278, 29889, 2271, 29918, 1454, 877, 5444, 29939, 29879, 29918, 1761, 8785, 13, 259, 13, 13, 29992, 932, 29889, 13134, 11219, 5444, 29939, 29879, 29914, 29966, 524, 29901, 5444, 29939, 29918, 333, 20690, 2798, 29914, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 1753, 2258, 29939, 29918, 2798, 29898, 5444, 29939, 29918, 333, 1125, 13, 1678, 1002, 29918, 2585, 353, 1904, 29889, 9513, 29898, 13, 418, 2258, 29939, 29918, 1989, 29922, 299, 29890, 29889, 2558, 703, 14206, 29939, 613, 5444, 29939, 29918, 333, 511, 13, 1678, 1723, 13, 1678, 1002, 29918, 2585, 29889, 649, 580, 13, 13, 1678, 2258, 29939, 29918, 2585, 353, 1904, 29889, 14206, 29939, 29889, 657, 29918, 1609, 29918, 333, 29898, 5444, 29939, 29918, 333, 29897, 13, 1678, 2258, 29939, 29918, 2585, 29889, 2798, 353, 2258, 29939, 29918, 2585, 29889, 2798, 718, 29871, 29896, 13, 1678, 2258, 29939, 29918, 2585, 29889, 649, 580, 13, 1678, 736, 525, 15091, 29915, 13, 1678, 396, 736, 2933, 29892, 29871, 29906, 29900, 29900, 29892, 11117, 3916, 29899, 1542, 2396, 525, 726, 29914, 24595, 10827, 2 ]
morsecodetoolkit/data/__init__.py
1-800-BAD-CODE/MorseCodeToolkit
2
95666
<filename>morsecodetoolkit/data/__init__.py from morsecodetoolkit.data.synthetic_dataset import SyntheticMorseDataset __all__ = [ "SyntheticMorseDataset" ]
[ 1, 529, 9507, 29958, 12257, 3471, 397, 300, 1507, 7354, 29914, 1272, 29914, 1649, 2344, 26914, 2272, 13, 13, 3166, 3036, 3471, 397, 300, 1507, 7354, 29889, 1272, 29889, 19274, 386, 7492, 29918, 24713, 1053, 10829, 386, 7492, 28581, 344, 16390, 24541, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 376, 29216, 386, 7492, 28581, 344, 16390, 24541, 29908, 13, 29962, 13, 2 ]
my_studyguide/math1.py
worldwidekatie/study_guide
0
135999
<filename>my_studyguide/math1.py class Math1(): def __init__(self): self.my_num1 = 10 self.my_num2 = 20 def addition(self): return self.my_num1 + self.my_num2 def subtraction(self): return self.my_num1 - self.my_num2 class Math_Plus(Math1): def __init__(self, my_num1=40, my_num2=90): self.my_num1 = my_num1 self.my_num2 = my_num2 def multiplication(self): return self.my_num1 * self.my_num2 def division(self): return self.my_num1 / self.my_num2 if __name__ == "__main__": math1 = Math1() print(math1.addition()) #30 print(math1.subtraction()) #-10 math_plus = Math_Plus() print(math_plus.addition()) #130 print(math_plus.subtraction()) #-50 print(math_plus.multiplication()) #3600 print(math_plus.division()) #0.-44444444
[ 1, 529, 9507, 29958, 1357, 29918, 18082, 29891, 13075, 29914, 755, 29896, 29889, 2272, 13, 13, 13, 1990, 5792, 29896, 7295, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 1357, 29918, 1949, 29896, 353, 29871, 29896, 29900, 13, 4706, 1583, 29889, 1357, 29918, 1949, 29906, 353, 29871, 29906, 29900, 13, 13, 1678, 822, 6124, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1357, 29918, 1949, 29896, 718, 1583, 29889, 1357, 29918, 1949, 29906, 13, 13, 1678, 822, 1014, 3018, 428, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1357, 29918, 1949, 29896, 448, 1583, 29889, 1357, 29918, 1949, 29906, 13, 13, 13, 1990, 5792, 29918, 29575, 29898, 11309, 29896, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 590, 29918, 1949, 29896, 29922, 29946, 29900, 29892, 590, 29918, 1949, 29906, 29922, 29929, 29900, 1125, 13, 4706, 1583, 29889, 1357, 29918, 1949, 29896, 353, 590, 29918, 1949, 29896, 13, 4706, 1583, 29889, 1357, 29918, 1949, 29906, 353, 590, 29918, 1949, 29906, 13, 13, 1678, 822, 21666, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1357, 29918, 1949, 29896, 334, 1583, 29889, 1357, 29918, 1949, 29906, 13, 13, 1678, 822, 8542, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1357, 29918, 1949, 29896, 847, 1583, 29889, 1357, 29918, 1949, 29906, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 5844, 29896, 353, 5792, 29896, 580, 13, 1678, 1596, 29898, 755, 29896, 29889, 1202, 654, 3101, 396, 29941, 29900, 13, 1678, 1596, 29898, 755, 29896, 29889, 1491, 3018, 428, 3101, 396, 29899, 29896, 29900, 13, 268, 13, 1678, 5844, 29918, 11242, 353, 5792, 29918, 29575, 580, 13, 1678, 1596, 29898, 755, 29918, 11242, 29889, 1202, 654, 3101, 396, 29896, 29941, 29900, 13, 1678, 1596, 29898, 755, 29918, 11242, 29889, 1491, 3018, 428, 3101, 396, 29899, 29945, 29900, 13, 1678, 1596, 29898, 755, 29918, 11242, 29889, 18056, 1414, 3101, 396, 29941, 29953, 29900, 29900, 13, 1678, 1596, 29898, 755, 29918, 11242, 29889, 4563, 2459, 3101, 396, 29900, 9229, 29946, 29946, 29946, 29946, 29946, 29946, 29946, 29946, 2 ]
txnintegration/stats_utils.py
ajenie/sawtooth-validator
4
1611745
<filename>txnintegration/stats_utils.py # Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ------------------------------------------------------------------------------ import time import csv import collections class CsvManager(object): def __init__(self): self.csvdata = [] self.file = None self.writer = None def open_csv_file(self, filename, filepath=""): self.file = open(filename, 'wt') self.writer = csv.writer(self.file) def close_csv_file(self): self.file.close() def csv_newline(self): self.csvdata = [] def csv_append(self, datalist): self.csvdata.extend(datalist) def csv_write_header(self, headerlist=None, add_time=True): if headerlist is not None: self.csvdata.extend(headerlist) if add_time: self.csvdata.insert(0, "time") self._csv_write() def csv_write_data(self, datalist=None, add_time=True): if datalist is not None: self.csvdata.extend(datalist) if add_time: self.csvdata.insert(0, time.time()) self._csv_write() def _csv_write(self): self.writer.writerow(self.csvdata) self.csvdata = [] class SummaryStatsCsvManager(object): def __init__(self, system_stats, platform_stats): self.csv_enabled = False self.csv_mgr = CsvManager() self.ss = system_stats self.ps = platform_stats def initialize(self): self.csv_enabled = True filename = "summary_stats_" + str(int(time.time())) + ".csv" self.csv_mgr.open_csv_file(filename) header = self.ss.get_names() self.csv_mgr.csv_append(header) header = self.ps.get_names() self.csv_mgr.csv_write_header(header) def write_stats(self): if self.csv_enabled: data = self.ss.get_data() self.csv_mgr.csv_append(data) data = self.ps.get_data() self.csv_mgr.csv_write_data(data) def stop(self): if self.csv_enabled: self.csv_mgr.close_csv_file() class ValidatorStatsCsvManager(object): def __init__(self, client_list): self.csv_enabled = False self.csv_mgr = CsvManager() self.get_header = False self.csv_stats = CsvManager() self.clients = client_list self.stat_names = [] self.dw = DictWalker() def initialize(self): self.csv_enabled = True filename = "validator_stats_" + str(int(time.time())) + ".csv" self.csv_mgr.open_csv_file(filename) # defer writing header until first instance of data dictionary # is available self.get_header = True def write_stats(self): current_time = time.time() if self.csv_enabled: for client in self.clients: if client.responding: self.dw.walk(client.vsm.val_stats) if self.get_header: names = self.dw.get_names() names.insert(0, "validator_name") names.insert(0, "time") self.csv_mgr.csv_write_header(names, add_time=False) self.get_header = False data = self.dw.get_data() data.insert(0, client.name) data.insert(0, current_time) self.csv_mgr.csv_write_data(data, add_time=False) def stop(self): if self.csv_enabled: self.csv_mgr.close_csv_file() class DictWalker(object): def __init__(self): self.name_list = [] self.unique_name_list = [] self.unique_name_with_comma_list = [] # generates a new set of key/value pairs # each time walk() is called self.data = dict() # contains a set of keys ordered by entry order # that persists across calls to walk() - this lets you discover # (and remember) new keys as the appear in the data stream self.names = collections.OrderedDict() self.value_type_error_count = 0 self.name_has_comma_error_count = 0 def walk(self, data_dict): self.data = dict() return self._traverse_dict(data_dict) def _traverse_dict(self, data_dict): for key, value in data_dict.iteritems(): self.name_list.append(key) if isinstance(value, dict): self._traverse_dict(value) else: if isinstance(value, (list, tuple)): self.value_type_error_count += 1 value = "value_type_error" if isinstance(value, str): if value.find(",") is not -1: self.value_has_comma_error += 1 value = "value_comma_error" unique_name = self._unique_name(self.name_list) if unique_name.find(",") is not -1: self.name_has_comma_error_count += 1 self.unique_name_with_comma_list.append(unique_name) else: self.unique_name_list.append(unique_name) self.data[unique_name] = value self.names[unique_name] = None self.name_list.pop() if len(self.name_list) > 0: self.name_list.pop() def get_data(self): # retrieve data using names so it is always reported in the same order # this is important when using get_data() and get_names() # to write header and data to csv file to ensure headers and data # are written in the same order even if the source dictionary changes # size (which it will - at minimum validators do not all process # the same messages data_list = [] for name, value in self.names.items(): value = self.data.get(name, "no_val") data_list.append(value) return data_list def get_names(self): name_list = [] for name in self.names: name_list.append(name) return name_list def _unique_name(self, name_list): s = "" for name in name_list: if len(s) == 0: s = name else: s = "{}-{}".format(s, name) return s class TransactionRate(object): def __init__(self): self.txn_history = collections.deque() self.previous_block_count = 0 self.avg_txn_rate = 0.0 self.avg_block_time = 0.0 self.window_time = 0.0 self.window_txn_count = 0 def calculate_txn_rate(self, current_block_count, current_txn_count, window_size=10): """ Args: current_block_count: current number of committed blocks current_txn_count: current number of committed transactions window_size: number of blocks to average over Synopsis: Each time the block count changes, a snapshot of the current number of committed txns and current time is placed in the queue. If there are two or more entries in the queue, the average txn rate and average block commit time is calculated. If there are more than window_size transactions in the queue, the oldest entry is popped from the queue. Returns: avg_txn_rate: average number of transactions per second avg_block_time: average block commit time """ if not current_block_count == self.previous_block_count: self.previous_block_count = current_block_count current_block_time = time.time() self.txn_history.append([current_txn_count, current_block_time]) # if less than 2 samples, can't do anything if len(self.txn_history) < 2: self.avg_txn_rate = 0.0 self.avg_block_time = 0.0 return self.avg_txn_rate, self.avg_block_time # otherwise calculate from tip to tail; current is tip, [0] is tail past_txn_count, past_block_time = self.txn_history[0] self.window_time = current_block_time - past_block_time self.window_txn_count = current_txn_count - past_txn_count self.avg_txn_rate = \ float(self.window_txn_count) / self.window_time self.avg_block_time = \ (self.window_time) / (len(self.txn_history) - 1) # if more than "window_size" samples, discard oldest if len(self.txn_history) > window_size: self.txn_history.popleft() return self.avg_txn_rate, self.avg_block_time class PlatformIntervalStats(object): def __init__(self): self.intv_net_bytes_sent = 0 self.intv_net_bytes_recv = 0 self.last_net_bytes_sent = 0 self.last_net_bytes_recv = 0 self.intv_disk_bytes_read = 0 self.intv_disk_bytes_write = 0 self.last_disk_bytes_read = 0 self.last_disk_bytes_write = 0 self.intv_disk_count_read = 0 self.intv_disk_count_write = 0 self.last_disk_count_read = 0 self.last_disk_count_write = 0 def calculate_interval_stats(self, val_stats): net_stats = val_stats["platform"]["snetio"] self.intv_net_bytes_sent = \ net_stats["bytes_sent"] - self.last_net_bytes_sent self.intv_net_bytes_recv = \ net_stats["bytes_recv"] - self.last_net_bytes_recv self.last_net_bytes_sent = net_stats["bytes_sent"] self.last_net_bytes_recv = net_stats["bytes_recv"] disk_stats = val_stats["platform"]["sdiskio"] self.intv_disk_bytes_write = \ disk_stats["write_bytes"] - self.last_disk_bytes_write self.intv_disk_bytes_read = \ disk_stats["read_bytes"] - self.last_disk_bytes_read self.last_disk_bytes_write = disk_stats["write_bytes"] self.last_disk_bytes_read = disk_stats["read_bytes"] self.intv_disk_count_write = \ disk_stats["write_count"] - self.last_disk_count_write self.intv_disk_count_read = \ disk_stats["read_count"] - self.last_disk_count_read self.last_disk_count_write = disk_stats["write_count"] self.last_disk_count_read = disk_stats["read_count"]
[ 1, 529, 9507, 29958, 7508, 29876, 27925, 29914, 16202, 29918, 13239, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29953, 18555, 15025, 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, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 5215, 931, 13, 5215, 11799, 13, 5215, 16250, 13, 13, 13, 1990, 315, 4501, 3260, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 7638, 1272, 353, 5159, 13, 4706, 1583, 29889, 1445, 353, 6213, 13, 4706, 1583, 29889, 13236, 353, 6213, 13, 13, 1678, 822, 1722, 29918, 7638, 29918, 1445, 29898, 1311, 29892, 10422, 29892, 934, 2084, 13776, 1125, 13, 4706, 1583, 29889, 1445, 353, 1722, 29898, 9507, 29892, 525, 14554, 1495, 13, 4706, 1583, 29889, 13236, 353, 11799, 29889, 13236, 29898, 1311, 29889, 1445, 29897, 13, 13, 1678, 822, 3802, 29918, 7638, 29918, 1445, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1445, 29889, 5358, 580, 13, 13, 1678, 822, 11799, 29918, 1482, 1220, 29898, 1311, 1125, 13, 4706, 1583, 29889, 7638, 1272, 353, 5159, 13, 13, 1678, 822, 11799, 29918, 4397, 29898, 1311, 29892, 1418, 284, 391, 1125, 13, 4706, 1583, 29889, 7638, 1272, 29889, 21843, 29898, 29881, 2075, 391, 29897, 13, 13, 1678, 822, 11799, 29918, 3539, 29918, 6672, 29898, 1311, 29892, 4839, 1761, 29922, 8516, 29892, 788, 29918, 2230, 29922, 5574, 1125, 13, 4706, 565, 4839, 1761, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 7638, 1272, 29889, 21843, 29898, 6672, 1761, 29897, 13, 4706, 565, 788, 29918, 2230, 29901, 13, 9651, 1583, 29889, 7638, 1272, 29889, 7851, 29898, 29900, 29892, 376, 2230, 1159, 13, 4706, 1583, 3032, 7638, 29918, 3539, 580, 13, 13, 1678, 822, 11799, 29918, 3539, 29918, 1272, 29898, 1311, 29892, 1418, 284, 391, 29922, 8516, 29892, 788, 29918, 2230, 29922, 5574, 1125, 13, 4706, 565, 1418, 284, 391, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 7638, 1272, 29889, 21843, 29898, 29881, 2075, 391, 29897, 13, 4706, 565, 788, 29918, 2230, 29901, 13, 9651, 1583, 29889, 7638, 1272, 29889, 7851, 29898, 29900, 29892, 931, 29889, 2230, 3101, 13, 4706, 1583, 3032, 7638, 29918, 3539, 580, 13, 13, 1678, 822, 903, 7638, 29918, 3539, 29898, 1311, 1125, 13, 4706, 1583, 29889, 13236, 29889, 13236, 340, 29898, 1311, 29889, 7638, 1272, 29897, 13, 4706, 1583, 29889, 7638, 1272, 353, 5159, 13, 13, 13, 1990, 6991, 5219, 25060, 29907, 4501, 3260, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1788, 29918, 16202, 29892, 7481, 29918, 16202, 1125, 13, 4706, 1583, 29889, 7638, 29918, 17590, 353, 7700, 13, 4706, 1583, 29889, 7638, 29918, 29885, 629, 353, 315, 4501, 3260, 580, 13, 13, 4706, 1583, 29889, 893, 353, 1788, 29918, 16202, 13, 4706, 1583, 29889, 567, 353, 7481, 29918, 16202, 13, 13, 1678, 822, 11905, 29898, 1311, 1125, 13, 4706, 1583, 29889, 7638, 29918, 17590, 353, 5852, 13, 13, 4706, 10422, 353, 376, 7727, 29918, 16202, 27508, 718, 851, 29898, 524, 29898, 2230, 29889, 2230, 22130, 718, 11393, 7638, 29908, 13, 4706, 1583, 29889, 7638, 29918, 29885, 629, 29889, 3150, 29918, 7638, 29918, 1445, 29898, 9507, 29897, 13, 13, 4706, 4839, 353, 1583, 29889, 893, 29889, 657, 29918, 7039, 580, 13, 4706, 1583, 29889, 7638, 29918, 29885, 629, 29889, 7638, 29918, 4397, 29898, 6672, 29897, 13, 4706, 4839, 353, 1583, 29889, 567, 29889, 657, 29918, 7039, 580, 13, 4706, 1583, 29889, 7638, 29918, 29885, 629, 29889, 7638, 29918, 3539, 29918, 6672, 29898, 6672, 29897, 13, 13, 1678, 822, 2436, 29918, 16202, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 7638, 29918, 17590, 29901, 13, 9651, 848, 353, 1583, 29889, 893, 29889, 657, 29918, 1272, 580, 13, 9651, 1583, 29889, 7638, 29918, 29885, 629, 29889, 7638, 29918, 4397, 29898, 1272, 29897, 13, 9651, 848, 353, 1583, 29889, 567, 29889, 657, 29918, 1272, 580, 13, 9651, 1583, 29889, 7638, 29918, 29885, 629, 29889, 7638, 29918, 3539, 29918, 1272, 29898, 1272, 29897, 13, 13, 1678, 822, 5040, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 7638, 29918, 17590, 29901, 13, 9651, 1583, 29889, 7638, 29918, 29885, 629, 29889, 5358, 29918, 7638, 29918, 1445, 580, 13, 13, 13, 1990, 15758, 1061, 25060, 29907, 4501, 3260, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3132, 29918, 1761, 1125, 13, 4706, 1583, 29889, 7638, 29918, 17590, 353, 7700, 13, 4706, 1583, 29889, 7638, 29918, 29885, 629, 353, 315, 4501, 3260, 580, 13, 13, 4706, 1583, 29889, 657, 29918, 6672, 353, 7700, 13, 4706, 1583, 29889, 7638, 29918, 16202, 353, 315, 4501, 3260, 580, 13, 4706, 1583, 29889, 11303, 1237, 353, 3132, 29918, 1761, 13, 4706, 1583, 29889, 6112, 29918, 7039, 353, 5159, 13, 13, 4706, 1583, 29889, 28012, 353, 360, 919, 29956, 2235, 261, 580, 13, 13, 1678, 822, 11905, 29898, 1311, 1125, 13, 4706, 1583, 29889, 7638, 29918, 17590, 353, 5852, 13, 13, 4706, 10422, 353, 376, 3084, 1061, 29918, 16202, 27508, 718, 851, 29898, 524, 29898, 2230, 29889, 2230, 22130, 718, 11393, 7638, 29908, 13, 4706, 1583, 29889, 7638, 29918, 29885, 629, 29889, 3150, 29918, 7638, 29918, 1445, 29898, 9507, 29897, 13, 13, 4706, 396, 316, 571, 5007, 4839, 2745, 937, 2777, 310, 848, 8600, 13, 4706, 396, 338, 3625, 13, 4706, 1583, 29889, 657, 29918, 6672, 353, 5852, 13, 13, 1678, 822, 2436, 29918, 16202, 29898, 1311, 1125, 13, 4706, 1857, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 4706, 565, 1583, 29889, 7638, 29918, 17590, 29901, 13, 9651, 363, 3132, 297, 1583, 29889, 11303, 1237, 29901, 13, 18884, 565, 3132, 29889, 3636, 292, 29901, 13, 462, 1678, 1583, 29889, 28012, 29889, 20919, 29898, 4645, 29889, 29894, 3844, 29889, 791, 29918, 16202, 29897, 13, 462, 1678, 565, 1583, 29889, 657, 29918, 6672, 29901, 13, 462, 4706, 2983, 353, 1583, 29889, 28012, 29889, 657, 29918, 7039, 580, 13, 462, 4706, 2983, 29889, 7851, 29898, 29900, 29892, 376, 3084, 1061, 29918, 978, 1159, 13, 462, 4706, 2983, 29889, 7851, 29898, 29900, 29892, 376, 2230, 1159, 13, 462, 4706, 1583, 29889, 7638, 29918, 29885, 629, 29889, 7638, 29918, 3539, 29918, 6672, 29898, 7039, 29892, 788, 29918, 2230, 29922, 8824, 29897, 13, 462, 4706, 1583, 29889, 657, 29918, 6672, 353, 7700, 13, 462, 1678, 848, 353, 1583, 29889, 28012, 29889, 657, 29918, 1272, 580, 13, 462, 1678, 848, 29889, 7851, 29898, 29900, 29892, 3132, 29889, 978, 29897, 13, 462, 1678, 848, 29889, 7851, 29898, 29900, 29892, 1857, 29918, 2230, 29897, 13, 462, 1678, 1583, 29889, 7638, 29918, 29885, 629, 29889, 7638, 29918, 3539, 29918, 1272, 29898, 1272, 29892, 788, 29918, 2230, 29922, 8824, 29897, 13, 13, 1678, 822, 5040, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 7638, 29918, 17590, 29901, 13, 9651, 1583, 29889, 7638, 29918, 29885, 629, 29889, 5358, 29918, 7638, 29918, 1445, 580, 13, 13, 13, 1990, 360, 919, 29956, 2235, 261, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 978, 29918, 1761, 353, 5159, 13, 4706, 1583, 29889, 13092, 29918, 978, 29918, 1761, 353, 5159, 13, 4706, 1583, 29889, 13092, 29918, 978, 29918, 2541, 29918, 510, 655, 29918, 1761, 353, 5159, 13, 13, 4706, 396, 16785, 263, 716, 731, 310, 1820, 29914, 1767, 11000, 13, 4706, 396, 1269, 931, 6686, 580, 338, 2000, 13, 4706, 1583, 29889, 1272, 353, 9657, 580, 13, 4706, 396, 3743, 263, 731, 310, 6611, 10372, 491, 6251, 1797, 13, 4706, 396, 393, 3736, 2879, 4822, 5717, 304, 6686, 580, 448, 445, 16869, 366, 6523, 13, 4706, 396, 313, 392, 6456, 29897, 716, 6611, 408, 278, 2615, 297, 278, 848, 4840, 13, 4706, 1583, 29889, 7039, 353, 16250, 29889, 7514, 287, 21533, 580, 13, 13, 4706, 1583, 29889, 1767, 29918, 1853, 29918, 2704, 29918, 2798, 353, 29871, 29900, 13, 4706, 1583, 29889, 978, 29918, 5349, 29918, 510, 655, 29918, 2704, 29918, 2798, 353, 29871, 29900, 13, 13, 1678, 822, 6686, 29898, 1311, 29892, 848, 29918, 8977, 1125, 13, 4706, 1583, 29889, 1272, 353, 9657, 580, 13, 4706, 736, 1583, 3032, 3018, 3901, 29918, 8977, 29898, 1272, 29918, 8977, 29897, 13, 13, 1678, 822, 903, 3018, 3901, 29918, 8977, 29898, 1311, 29892, 848, 29918, 8977, 1125, 13, 4706, 363, 1820, 29892, 995, 297, 848, 29918, 8977, 29889, 1524, 7076, 7295, 13, 9651, 1583, 29889, 978, 29918, 1761, 29889, 4397, 29898, 1989, 29897, 13, 9651, 565, 338, 8758, 29898, 1767, 29892, 9657, 1125, 13, 18884, 1583, 3032, 3018, 3901, 29918, 8977, 29898, 1767, 29897, 13, 9651, 1683, 29901, 13, 18884, 565, 338, 8758, 29898, 1767, 29892, 313, 1761, 29892, 18761, 22164, 13, 462, 1678, 1583, 29889, 1767, 29918, 1853, 29918, 2704, 29918, 2798, 4619, 29871, 29896, 13, 462, 1678, 995, 353, 376, 1767, 29918, 1853, 29918, 2704, 29908, 13, 18884, 565, 338, 8758, 29898, 1767, 29892, 851, 1125, 13, 462, 1678, 565, 995, 29889, 2886, 28165, 1159, 338, 451, 448, 29896, 29901, 13, 462, 4706, 1583, 29889, 1767, 29918, 5349, 29918, 510, 655, 29918, 2704, 4619, 29871, 29896, 13, 462, 4706, 995, 353, 376, 1767, 29918, 510, 655, 29918, 2704, 29908, 13, 13, 18884, 5412, 29918, 978, 353, 1583, 3032, 13092, 29918, 978, 29898, 1311, 29889, 978, 29918, 1761, 29897, 13, 18884, 565, 5412, 29918, 978, 29889, 2886, 28165, 1159, 338, 451, 448, 29896, 29901, 13, 462, 1678, 1583, 29889, 978, 29918, 5349, 29918, 510, 655, 29918, 2704, 29918, 2798, 4619, 29871, 29896, 13, 462, 1678, 1583, 29889, 13092, 29918, 978, 29918, 2541, 29918, 510, 655, 29918, 1761, 29889, 4397, 29898, 13092, 29918, 978, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 13092, 29918, 978, 29918, 1761, 29889, 4397, 29898, 13092, 29918, 978, 29897, 13, 462, 1678, 1583, 29889, 1272, 29961, 13092, 29918, 978, 29962, 353, 995, 13, 462, 1678, 1583, 29889, 7039, 29961, 13092, 29918, 978, 29962, 353, 6213, 13, 13, 18884, 1583, 29889, 978, 29918, 1761, 29889, 7323, 580, 13, 4706, 565, 7431, 29898, 1311, 29889, 978, 29918, 1761, 29897, 1405, 29871, 29900, 29901, 13, 9651, 1583, 29889, 978, 29918, 1761, 29889, 7323, 580, 13, 13, 1678, 822, 679, 29918, 1272, 29898, 1311, 1125, 13, 4706, 396, 10563, 848, 773, 2983, 577, 372, 338, 2337, 8967, 297, 278, 1021, 1797, 13, 4706, 396, 445, 338, 4100, 746, 773, 679, 29918, 1272, 580, 322, 679, 29918, 7039, 580, 13, 4706, 396, 304, 2436, 4839, 322, 848, 304, 11799, 934, 304, 9801, 9066, 322, 848, 13, 4706, 396, 526, 3971, 297, 278, 1021, 1797, 1584, 565, 278, 2752, 8600, 3620, 13, 4706, 396, 2159, 313, 4716, 372, 674, 448, 472, 9212, 2854, 4097, 437, 451, 599, 1889, 13, 4706, 396, 278, 1021, 7191, 13, 4706, 848, 29918, 1761, 353, 5159, 13, 4706, 363, 1024, 29892, 995, 297, 1583, 29889, 7039, 29889, 7076, 7295, 13, 9651, 995, 353, 1583, 29889, 1272, 29889, 657, 29898, 978, 29892, 376, 1217, 29918, 791, 1159, 13, 9651, 848, 29918, 1761, 29889, 4397, 29898, 1767, 29897, 13, 4706, 736, 848, 29918, 1761, 13, 13, 1678, 822, 679, 29918, 7039, 29898, 1311, 1125, 13, 4706, 1024, 29918, 1761, 353, 5159, 13, 4706, 363, 1024, 297, 1583, 29889, 7039, 29901, 13, 9651, 1024, 29918, 1761, 29889, 4397, 29898, 978, 29897, 13, 4706, 736, 1024, 29918, 1761, 13, 13, 1678, 822, 903, 13092, 29918, 978, 29898, 1311, 29892, 1024, 29918, 1761, 1125, 13, 4706, 269, 353, 5124, 13, 4706, 363, 1024, 297, 1024, 29918, 1761, 29901, 13, 9651, 565, 7431, 29898, 29879, 29897, 1275, 29871, 29900, 29901, 13, 18884, 269, 353, 1024, 13, 9651, 1683, 29901, 13, 18884, 269, 353, 29850, 7402, 8875, 1642, 4830, 29898, 29879, 29892, 1024, 29897, 13, 4706, 736, 269, 13, 13, 13, 1990, 4103, 2467, 19907, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 7508, 29876, 29918, 18434, 353, 16250, 29889, 311, 802, 580, 13, 4706, 1583, 29889, 24957, 29918, 1271, 29918, 2798, 353, 29871, 29900, 13, 4706, 1583, 29889, 485, 29887, 29918, 7508, 29876, 29918, 10492, 353, 29871, 29900, 29889, 29900, 13, 4706, 1583, 29889, 485, 29887, 29918, 1271, 29918, 2230, 353, 29871, 29900, 29889, 29900, 13, 4706, 1583, 29889, 7165, 29918, 2230, 353, 29871, 29900, 29889, 29900, 13, 4706, 1583, 29889, 7165, 29918, 7508, 29876, 29918, 2798, 353, 29871, 29900, 13, 13, 1678, 822, 8147, 29918, 7508, 29876, 29918, 10492, 29898, 1311, 29892, 1857, 29918, 1271, 29918, 2798, 29892, 1857, 29918, 7508, 29876, 29918, 2798, 29892, 13, 462, 965, 3474, 29918, 2311, 29922, 29896, 29900, 1125, 13, 4706, 9995, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 1857, 29918, 1271, 29918, 2798, 29901, 1857, 1353, 310, 19355, 10930, 13, 9651, 1857, 29918, 7508, 29876, 29918, 2798, 29901, 1857, 1353, 310, 19355, 22160, 13, 9651, 3474, 29918, 2311, 29901, 1353, 310, 10930, 304, 6588, 975, 13, 13, 4706, 10829, 15368, 29901, 13, 9651, 7806, 931, 278, 2908, 2302, 3620, 29892, 263, 22395, 310, 278, 13, 9651, 1857, 1353, 310, 19355, 25568, 1983, 322, 1857, 931, 338, 7180, 297, 13, 9651, 278, 9521, 29889, 29871, 960, 727, 526, 1023, 470, 901, 9976, 297, 278, 9521, 29892, 278, 13, 9651, 6588, 25568, 29876, 6554, 322, 6588, 2908, 9063, 931, 338, 12833, 29889, 13, 9651, 960, 727, 526, 901, 1135, 3474, 29918, 2311, 22160, 297, 278, 9521, 29892, 13, 9651, 278, 23947, 6251, 338, 772, 2986, 515, 278, 9521, 29889, 13, 13, 4706, 16969, 29901, 13, 9651, 1029, 29887, 29918, 7508, 29876, 29918, 10492, 29901, 6588, 1353, 310, 22160, 639, 1473, 13, 9651, 1029, 29887, 29918, 1271, 29918, 2230, 29901, 6588, 2908, 9063, 931, 13, 13, 4706, 9995, 13, 4706, 565, 451, 1857, 29918, 1271, 29918, 2798, 1275, 1583, 29889, 24957, 29918, 1271, 29918, 2798, 29901, 13, 9651, 1583, 29889, 24957, 29918, 1271, 29918, 2798, 353, 1857, 29918, 1271, 29918, 2798, 13, 9651, 1857, 29918, 1271, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 9651, 1583, 29889, 7508, 29876, 29918, 18434, 29889, 4397, 4197, 3784, 29918, 7508, 29876, 29918, 2798, 29892, 1857, 29918, 1271, 29918, 2230, 2314, 13, 9651, 396, 565, 3109, 1135, 29871, 29906, 11916, 29892, 508, 29915, 29873, 437, 3099, 13, 9651, 565, 7431, 29898, 1311, 29889, 7508, 29876, 29918, 18434, 29897, 529, 29871, 29906, 29901, 13, 18884, 1583, 29889, 485, 29887, 29918, 7508, 29876, 29918, 10492, 353, 29871, 29900, 29889, 29900, 13, 18884, 1583, 29889, 485, 29887, 29918, 1271, 29918, 2230, 353, 29871, 29900, 29889, 29900, 13, 18884, 736, 1583, 29889, 485, 29887, 29918, 7508, 29876, 29918, 10492, 29892, 1583, 29889, 485, 29887, 29918, 1271, 29918, 2230, 13, 9651, 396, 6467, 8147, 515, 6872, 304, 12464, 29936, 1857, 338, 6872, 29892, 518, 29900, 29962, 338, 12464, 13, 9651, 4940, 29918, 7508, 29876, 29918, 2798, 29892, 4940, 29918, 1271, 29918, 2230, 353, 1583, 29889, 7508, 29876, 29918, 18434, 29961, 29900, 29962, 13, 9651, 1583, 29889, 7165, 29918, 2230, 353, 1857, 29918, 1271, 29918, 2230, 448, 4940, 29918, 1271, 29918, 2230, 13, 9651, 1583, 29889, 7165, 29918, 7508, 29876, 29918, 2798, 353, 1857, 29918, 7508, 29876, 29918, 2798, 448, 4940, 29918, 7508, 29876, 29918, 2798, 13, 9651, 1583, 29889, 485, 29887, 29918, 7508, 29876, 29918, 10492, 353, 320, 13, 18884, 5785, 29898, 1311, 29889, 7165, 29918, 7508, 29876, 29918, 2798, 29897, 847, 1583, 29889, 7165, 29918, 2230, 13, 9651, 1583, 29889, 485, 29887, 29918, 1271, 29918, 2230, 353, 320, 13, 18884, 313, 1311, 29889, 7165, 29918, 2230, 29897, 847, 313, 2435, 29898, 1311, 29889, 7508, 29876, 29918, 18434, 29897, 448, 29871, 29896, 29897, 13, 9651, 396, 565, 901, 1135, 376, 7165, 29918, 2311, 29908, 11916, 29892, 2313, 538, 23947, 13, 9651, 565, 7431, 29898, 1311, 29889, 7508, 29876, 29918, 18434, 29897, 1405, 3474, 29918, 2311, 29901, 13, 18884, 1583, 29889, 7508, 29876, 29918, 18434, 29889, 7323, 1563, 580, 13, 13, 9651, 736, 1583, 29889, 485, 29887, 29918, 7508, 29876, 29918, 10492, 29892, 1583, 29889, 485, 29887, 29918, 1271, 29918, 2230, 13, 13, 13, 1990, 28096, 12506, 25060, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 524, 29894, 29918, 1212, 29918, 13193, 29918, 18616, 353, 29871, 29900, 13, 4706, 1583, 29889, 524, 29894, 29918, 1212, 29918, 13193, 29918, 3757, 29894, 353, 29871, 29900, 13, 4706, 1583, 29889, 4230, 29918, 1212, 29918, 13193, 29918, 18616, 353, 29871, 29900, 13, 4706, 1583, 29889, 4230, 29918, 1212, 29918, 13193, 29918, 3757, 29894, 353, 29871, 29900, 13, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 13193, 29918, 949, 353, 29871, 29900, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 13193, 29918, 3539, 353, 29871, 29900, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 13193, 29918, 949, 353, 29871, 29900, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 13193, 29918, 3539, 353, 29871, 29900, 13, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 2798, 29918, 949, 353, 29871, 29900, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 2798, 29918, 3539, 353, 29871, 29900, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 2798, 29918, 949, 353, 29871, 29900, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 2798, 29918, 3539, 353, 29871, 29900, 13, 13, 1678, 822, 8147, 29918, 19207, 29918, 16202, 29898, 1311, 29892, 659, 29918, 16202, 1125, 13, 13, 4706, 7787, 29918, 16202, 353, 659, 29918, 16202, 3366, 12120, 3108, 3366, 29879, 1212, 601, 3108, 13, 13, 4706, 1583, 29889, 524, 29894, 29918, 1212, 29918, 13193, 29918, 18616, 353, 320, 13, 9651, 7787, 29918, 16202, 3366, 13193, 29918, 18616, 3108, 448, 1583, 29889, 4230, 29918, 1212, 29918, 13193, 29918, 18616, 13, 4706, 1583, 29889, 524, 29894, 29918, 1212, 29918, 13193, 29918, 3757, 29894, 353, 320, 13, 9651, 7787, 29918, 16202, 3366, 13193, 29918, 3757, 29894, 3108, 448, 1583, 29889, 4230, 29918, 1212, 29918, 13193, 29918, 3757, 29894, 13, 4706, 1583, 29889, 4230, 29918, 1212, 29918, 13193, 29918, 18616, 353, 7787, 29918, 16202, 3366, 13193, 29918, 18616, 3108, 13, 4706, 1583, 29889, 4230, 29918, 1212, 29918, 13193, 29918, 3757, 29894, 353, 7787, 29918, 16202, 3366, 13193, 29918, 3757, 29894, 3108, 13, 13, 4706, 8086, 29918, 16202, 353, 659, 29918, 16202, 3366, 12120, 3108, 3366, 29879, 20960, 601, 3108, 13, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 13193, 29918, 3539, 353, 320, 13, 9651, 8086, 29918, 16202, 3366, 3539, 29918, 13193, 3108, 448, 1583, 29889, 4230, 29918, 20960, 29918, 13193, 29918, 3539, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 13193, 29918, 949, 353, 320, 13, 9651, 8086, 29918, 16202, 3366, 949, 29918, 13193, 3108, 448, 1583, 29889, 4230, 29918, 20960, 29918, 13193, 29918, 949, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 13193, 29918, 3539, 353, 8086, 29918, 16202, 3366, 3539, 29918, 13193, 3108, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 13193, 29918, 949, 353, 8086, 29918, 16202, 3366, 949, 29918, 13193, 3108, 13, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 2798, 29918, 3539, 353, 320, 13, 9651, 8086, 29918, 16202, 3366, 3539, 29918, 2798, 3108, 448, 1583, 29889, 4230, 29918, 20960, 29918, 2798, 29918, 3539, 13, 4706, 1583, 29889, 524, 29894, 29918, 20960, 29918, 2798, 29918, 949, 353, 320, 13, 9651, 8086, 29918, 16202, 3366, 949, 29918, 2798, 3108, 448, 1583, 29889, 4230, 29918, 20960, 29918, 2798, 29918, 949, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 2798, 29918, 3539, 353, 8086, 29918, 16202, 3366, 3539, 29918, 2798, 3108, 13, 4706, 1583, 29889, 4230, 29918, 20960, 29918, 2798, 29918, 949, 353, 8086, 29918, 16202, 3366, 949, 29918, 2798, 3108, 13, 2 ]
25/02/getattr.py
pylangstudy/201707
0
100962
<filename>25/02/getattr.py # getattr(object, name[, default]) class C: def A(self): pass print(getattr(C, 'A'))
[ 1, 529, 9507, 29958, 29906, 29945, 29914, 29900, 29906, 29914, 657, 5552, 29889, 2272, 13, 29937, 679, 5552, 29898, 3318, 29892, 1024, 21939, 2322, 2314, 13, 1990, 315, 29901, 13, 1678, 822, 319, 29898, 1311, 1125, 1209, 13, 2158, 29898, 657, 5552, 29898, 29907, 29892, 525, 29909, 8785, 13, 2 ]
handybelt/latex2img/__main__.py
charleskawczynski/handybelt
0
101608
<gh_stars>0 import argparse import os import subprocess def main(**kwargs): filename = kwargs['filename'] dpi = kwargs['dpi'] filename = filename.replace('/',os.sep) if '\\'==os.sep else filename.replace('\\',os.sep) path = os.path.dirname(filename) path = '.' if path=='' else path p, ext = os.path.splitext(filename) subprocess.run('python -m buildlatex '+filename) subprocess.run('python -m pdf2img '+filename.replace(ext,'.pdf')) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Make an image from a pdf file.') parser.add_argument('filename', type=str, help='Filename of image to convert') parser.add_argument('--dpi', type=int, default=300, help='dpi for generated image') args = parser.parse_args() main(**vars(args))
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 13, 1753, 1667, 29898, 1068, 19290, 1125, 13, 29871, 10422, 353, 9049, 5085, 1839, 9507, 2033, 13, 29871, 270, 1631, 418, 353, 9049, 5085, 1839, 29881, 1631, 2033, 13, 29871, 10422, 353, 10422, 29889, 6506, 11219, 742, 359, 29889, 19570, 29897, 565, 525, 1966, 29915, 1360, 359, 29889, 19570, 1683, 10422, 29889, 6506, 877, 1966, 742, 359, 29889, 19570, 29897, 13, 29871, 2224, 353, 2897, 29889, 2084, 29889, 25721, 29898, 9507, 29897, 13, 29871, 2224, 353, 525, 6169, 565, 2224, 1360, 4907, 1683, 2224, 13, 29871, 282, 29892, 1294, 353, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 9507, 29897, 13, 29871, 1014, 5014, 29889, 3389, 877, 4691, 448, 29885, 2048, 25694, 525, 29974, 9507, 29897, 13, 29871, 1014, 5014, 29889, 3389, 877, 4691, 448, 29885, 13552, 29906, 2492, 525, 29974, 9507, 29889, 6506, 29898, 1062, 29892, 4286, 5140, 8785, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 29871, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 9984, 385, 1967, 515, 263, 13552, 934, 29889, 1495, 13, 29871, 13812, 29889, 1202, 29918, 23516, 877, 9507, 742, 13, 1678, 1134, 29922, 710, 29892, 13, 1678, 1371, 2433, 3434, 3871, 310, 1967, 304, 3588, 1495, 13, 29871, 13812, 29889, 1202, 29918, 23516, 877, 489, 29881, 1631, 742, 13, 1678, 1134, 29922, 524, 29892, 13, 1678, 2322, 29922, 29941, 29900, 29900, 29892, 13, 1678, 1371, 2433, 29881, 1631, 363, 5759, 1967, 1495, 13, 29871, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 29871, 1667, 29898, 1068, 16908, 29898, 5085, 876, 13, 2 ]
securitybot/loader.py
gyrospectre/securitybot
3
125881
import yaml import logging from importlib import import_module from securitybot.auth.auth import BaseAuthClient from securitybot.chat.chat import BaseChatClient from securitybot.db.database import BaseDbClient from securitybot.secretsmgmt.secretsmgmt import BaseSecretsClient from securitybot.tasker import Tasker from securitybot.exceptions import ( InvalidAuthProvider, InvalidChatProvider, InvalidDatabaseProvider, InvalidSecretsProvider ) def load_secrets_client(secrets_provider): try: sanitized_provider = secrets_provider.lower() module_name = 'securitybot.secretsmgmt.{}'.format( sanitized_provider ) module = import_module(module_name) client = getattr(module, 'SecretsClient') if not issubclass(client, BaseSecretsClient): raise AttributeError( '{}.Client is not an SecretsClient Provider'.format( module_name ) ) return client except (ModuleNotFoundError, AttributeError) as e: raise InvalidSecretsProvider( 'Secrets Management Provider for "{}" is not available: {}'.format( secrets_provider, e ) ) def build_secrets_client(secrets_provider, connection_config): secrets_class = load_secrets_client(secrets_provider) return secrets_class( connection_config ) def add_secrets_to_config(smclient, secrets, config): for client_type, clients in secrets.items(): client = config[client_type]['provider'] if client in clients: logging.debug( "About to fetch secret 'securitybot/{}/{}'".format( client_type, client ) ) scrt_raw = smclient.get_secret( 'securitybot/{}/{}'.format( client_type, client ) ) for scrt_name in secrets[client_type][client]: config[client_type][client][scrt_name] = scrt_raw[scrt_name] else: logging.debug( 'No secrets for {} provider {}'.format( client_type, client ) ) return True def load_auth_client(auth_provider): try: sanitized_provider = auth_provider.lower() module_name = 'securitybot.auth.{}'.format( sanitized_provider ) module = import_module(module_name) client = getattr(module, 'AuthClient') if not issubclass(client, BaseAuthClient): raise AttributeError( '{}.Client is not an Auth Provider'.format(module_name) ) return client except (ModuleNotFoundError, AttributeError) as e: raise InvalidAuthProvider( 'Auth Provider for "{}" is not available: {}'.format( auth_provider, e ) ) def build_auth_client(auth_provider, connection_config, reauth_time, auth_attrib): auth_class = load_auth_client(auth_provider) return auth_class( connection_config, reauth_time, auth_attrib ) def load_chat_client(chat_provider): try: sanitized_provider = chat_provider.lower() module_name = 'securitybot.chat.{}'.format( sanitized_provider ) module = import_module(module_name) client = getattr(module, 'ChatClient') if not issubclass(client, BaseChatClient): raise AttributeError( '{}.Client is not a Chat Provider'.format(module_name) ) return client except (ModuleNotFoundError, AttributeError) as e: raise InvalidChatProvider( 'Chat Provider for "{}" is not available: {}'.format( chat_provider, e ) ) def build_chat_client(chat_provider, connection_config): chat_class = load_chat_client(chat_provider) return chat_class( connection_config ) def build_tasker(dbclient): return Tasker(dbclient) def load_db_client(db_provider): try: sanitized_provider = db_provider.lower() module_name = 'securitybot.db.{}'.format( sanitized_provider ) module = import_module(module_name) client = getattr(module, 'DbClient') if not issubclass(client, BaseDbClient): raise AttributeError( '{} is not a Db Provider'.format(module_name) ) return client except (ModuleNotFoundError, AttributeError) as e: raise InvalidDatabaseProvider( 'DB Provider for "{}" is not available: {}'.format( db_provider, e ) ) def build_db_client(db_provider, connection_config, tables): db_class = load_db_client(db_provider) connection_config['tables'] = tables return db_class( config=connection_config, queries=load_yaml(connection_config.get('queries_path', None)) ) def load_yaml(path): if path: return yaml.safe_load(open(path)) else: return None
[ 1, 1053, 343, 8807, 13, 5215, 12183, 13, 13, 3166, 1053, 1982, 1053, 1053, 29918, 5453, 13, 13, 3166, 6993, 7451, 29889, 5150, 29889, 5150, 1053, 7399, 6444, 4032, 13, 13, 3166, 6993, 7451, 29889, 13496, 29889, 13496, 1053, 7399, 1451, 271, 4032, 13, 13, 3166, 6993, 7451, 29889, 2585, 29889, 9803, 1053, 7399, 10234, 4032, 13, 13, 3166, 6993, 7451, 29889, 344, 1037, 1372, 29885, 29887, 4378, 29889, 344, 1037, 1372, 29885, 29887, 4378, 1053, 7399, 7898, 27487, 4032, 13, 13, 3166, 6993, 7451, 29889, 7662, 261, 1053, 9330, 261, 13, 13, 3166, 6993, 7451, 29889, 11739, 29879, 1053, 313, 13, 1678, 21403, 6444, 6980, 29892, 21403, 1451, 271, 6980, 29892, 29871, 13, 1678, 21403, 9112, 6980, 29892, 21403, 7898, 27487, 6980, 13, 29897, 13, 13, 13, 1753, 2254, 29918, 344, 1037, 1372, 29918, 4645, 29898, 344, 1037, 1372, 29918, 18121, 1125, 13, 1678, 1018, 29901, 13, 4706, 9753, 277, 1891, 29918, 18121, 353, 22183, 1372, 29918, 18121, 29889, 13609, 580, 13, 4706, 3883, 29918, 978, 353, 525, 8926, 7451, 29889, 344, 1037, 1372, 29885, 29887, 4378, 29889, 8875, 4286, 4830, 29898, 13, 9651, 9753, 277, 1891, 29918, 18121, 13, 4706, 1723, 13, 4706, 3883, 353, 1053, 29918, 5453, 29898, 5453, 29918, 978, 29897, 13, 4706, 3132, 353, 679, 5552, 29898, 5453, 29892, 525, 7898, 27487, 4032, 1495, 13, 13, 4706, 565, 451, 338, 1491, 1990, 29898, 4645, 29892, 7399, 7898, 27487, 4032, 1125, 13, 9651, 12020, 23833, 2392, 29898, 13, 18884, 22372, 1836, 4032, 338, 451, 385, 5356, 27487, 4032, 1019, 5489, 4286, 4830, 29898, 13, 462, 1678, 3883, 29918, 978, 13, 18884, 1723, 13, 9651, 1723, 13, 13, 4706, 736, 3132, 13, 1678, 5174, 313, 7355, 17413, 2392, 29892, 23833, 2392, 29897, 408, 321, 29901, 13, 4706, 12020, 21403, 7898, 27487, 6980, 29898, 13, 9651, 525, 7898, 27487, 15057, 1019, 5489, 363, 29850, 5038, 338, 451, 3625, 29901, 6571, 4286, 4830, 29898, 13, 18884, 22183, 1372, 29918, 18121, 29892, 321, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 13, 1753, 2048, 29918, 344, 1037, 1372, 29918, 4645, 29898, 344, 1037, 1372, 29918, 18121, 29892, 3957, 29918, 2917, 1125, 13, 1678, 22183, 1372, 29918, 1990, 353, 2254, 29918, 344, 1037, 1372, 29918, 4645, 29898, 344, 1037, 1372, 29918, 18121, 29897, 13, 13, 1678, 736, 22183, 1372, 29918, 1990, 29898, 13, 4706, 3957, 29918, 2917, 13, 1678, 1723, 13, 13, 13, 1753, 788, 29918, 344, 1037, 1372, 29918, 517, 29918, 2917, 29898, 3844, 4645, 29892, 22183, 1372, 29892, 2295, 1125, 13, 1678, 363, 3132, 29918, 1853, 29892, 13154, 297, 22183, 1372, 29889, 7076, 7295, 13, 4706, 3132, 353, 2295, 29961, 4645, 29918, 1853, 22322, 18121, 2033, 13, 13, 4706, 565, 3132, 297, 13154, 29901, 13, 9651, 12183, 29889, 8382, 29898, 13, 18884, 376, 28173, 304, 6699, 7035, 525, 8926, 7451, 19248, 6822, 8875, 29915, 1642, 4830, 29898, 13, 462, 1678, 3132, 29918, 1853, 29892, 13, 462, 1678, 3132, 13, 18884, 1723, 13, 9651, 1723, 13, 9651, 885, 2273, 29918, 1610, 353, 1560, 4645, 29889, 657, 29918, 19024, 29898, 13, 18884, 525, 8926, 7451, 19248, 6822, 8875, 4286, 4830, 29898, 13, 462, 1678, 3132, 29918, 1853, 29892, 13, 462, 1678, 3132, 13, 18884, 1723, 13, 9651, 1723, 13, 9651, 363, 885, 2273, 29918, 978, 297, 22183, 1372, 29961, 4645, 29918, 1853, 3816, 4645, 5387, 13, 18884, 2295, 29961, 4645, 29918, 1853, 3816, 4645, 3816, 1557, 2273, 29918, 978, 29962, 353, 885, 2273, 29918, 1610, 29961, 1557, 2273, 29918, 978, 29962, 13, 4706, 1683, 29901, 13, 9651, 12183, 29889, 8382, 29898, 13, 18884, 525, 3782, 22183, 1372, 363, 6571, 13113, 6571, 4286, 4830, 29898, 13, 462, 1678, 3132, 29918, 1853, 29892, 3132, 13, 18884, 1723, 13, 9651, 1723, 13, 13, 1678, 736, 5852, 13, 13, 13, 1753, 2254, 29918, 5150, 29918, 4645, 29898, 5150, 29918, 18121, 1125, 13, 1678, 1018, 29901, 13, 4706, 9753, 277, 1891, 29918, 18121, 353, 4817, 29918, 18121, 29889, 13609, 580, 13, 4706, 3883, 29918, 978, 353, 525, 8926, 7451, 29889, 5150, 29889, 8875, 4286, 4830, 29898, 13, 9651, 9753, 277, 1891, 29918, 18121, 13, 4706, 1723, 13, 4706, 3883, 353, 1053, 29918, 5453, 29898, 5453, 29918, 978, 29897, 13, 4706, 3132, 353, 679, 5552, 29898, 5453, 29892, 525, 6444, 4032, 1495, 13, 13, 4706, 565, 451, 338, 1491, 1990, 29898, 4645, 29892, 7399, 6444, 4032, 1125, 13, 9651, 12020, 23833, 2392, 29898, 13, 18884, 22372, 1836, 4032, 338, 451, 385, 13189, 1019, 5489, 4286, 4830, 29898, 5453, 29918, 978, 29897, 13, 9651, 1723, 13, 13, 4706, 736, 3132, 13, 1678, 5174, 313, 7355, 17413, 2392, 29892, 23833, 2392, 29897, 408, 321, 29901, 13, 4706, 12020, 21403, 6444, 6980, 29898, 13, 9651, 525, 6444, 1019, 5489, 363, 29850, 5038, 338, 451, 3625, 29901, 6571, 4286, 4830, 29898, 13, 18884, 4817, 29918, 18121, 29892, 321, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 13, 1753, 2048, 29918, 5150, 29918, 4645, 29898, 5150, 29918, 18121, 29892, 3957, 29918, 2917, 29892, 13, 462, 418, 337, 5150, 29918, 2230, 29892, 4817, 29918, 1131, 1091, 1125, 13, 1678, 4817, 29918, 1990, 353, 2254, 29918, 5150, 29918, 4645, 29898, 5150, 29918, 18121, 29897, 13, 13, 1678, 736, 4817, 29918, 1990, 29898, 13, 4706, 3957, 29918, 2917, 29892, 13, 4706, 337, 5150, 29918, 2230, 29892, 13, 4706, 4817, 29918, 1131, 1091, 13, 1678, 1723, 13, 13, 13, 1753, 2254, 29918, 13496, 29918, 4645, 29898, 13496, 29918, 18121, 1125, 13, 1678, 1018, 29901, 13, 4706, 9753, 277, 1891, 29918, 18121, 353, 13563, 29918, 18121, 29889, 13609, 580, 13, 4706, 3883, 29918, 978, 353, 525, 8926, 7451, 29889, 13496, 29889, 8875, 4286, 4830, 29898, 13, 9651, 9753, 277, 1891, 29918, 18121, 13, 4706, 1723, 13, 4706, 3883, 353, 1053, 29918, 5453, 29898, 5453, 29918, 978, 29897, 13, 4706, 3132, 353, 679, 5552, 29898, 5453, 29892, 525, 1451, 271, 4032, 1495, 13, 13, 4706, 565, 451, 338, 1491, 1990, 29898, 4645, 29892, 7399, 1451, 271, 4032, 1125, 13, 9651, 12020, 23833, 2392, 29898, 13, 18884, 22372, 1836, 4032, 338, 451, 263, 678, 271, 1019, 5489, 4286, 4830, 29898, 5453, 29918, 978, 29897, 13, 9651, 1723, 13, 13, 4706, 736, 3132, 13, 1678, 5174, 313, 7355, 17413, 2392, 29892, 23833, 2392, 29897, 408, 321, 29901, 13, 4706, 12020, 21403, 1451, 271, 6980, 29898, 13, 9651, 525, 1451, 271, 1019, 5489, 363, 29850, 5038, 338, 451, 3625, 29901, 6571, 4286, 4830, 29898, 13, 18884, 13563, 29918, 18121, 29892, 321, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 13, 1753, 2048, 29918, 13496, 29918, 4645, 29898, 13496, 29918, 18121, 29892, 3957, 29918, 2917, 1125, 13, 1678, 13563, 29918, 1990, 353, 2254, 29918, 13496, 29918, 4645, 29898, 13496, 29918, 18121, 29897, 13, 13, 1678, 736, 13563, 29918, 1990, 29898, 13, 4706, 3957, 29918, 2917, 13, 1678, 1723, 13, 13, 13, 1753, 2048, 29918, 7662, 261, 29898, 2585, 4645, 1125, 13, 1678, 736, 9330, 261, 29898, 2585, 4645, 29897, 13, 13, 13, 1753, 2254, 29918, 2585, 29918, 4645, 29898, 2585, 29918, 18121, 1125, 13, 1678, 1018, 29901, 13, 4706, 9753, 277, 1891, 29918, 18121, 353, 4833, 29918, 18121, 29889, 13609, 580, 13, 4706, 3883, 29918, 978, 353, 525, 8926, 7451, 29889, 2585, 29889, 8875, 4286, 4830, 29898, 13, 9651, 9753, 277, 1891, 29918, 18121, 13, 4706, 1723, 13, 4706, 3883, 353, 1053, 29918, 5453, 29898, 5453, 29918, 978, 29897, 13, 4706, 3132, 353, 679, 5552, 29898, 5453, 29892, 525, 10234, 4032, 1495, 13, 13, 4706, 565, 451, 338, 1491, 1990, 29898, 4645, 29892, 7399, 10234, 4032, 1125, 13, 9651, 12020, 23833, 2392, 29898, 13, 18884, 525, 8875, 338, 451, 263, 24331, 1019, 5489, 4286, 4830, 29898, 5453, 29918, 978, 29897, 13, 9651, 1723, 13, 13, 4706, 736, 3132, 13, 1678, 5174, 313, 7355, 17413, 2392, 29892, 23833, 2392, 29897, 408, 321, 29901, 13, 4706, 12020, 21403, 9112, 6980, 29898, 13, 9651, 525, 4051, 1019, 5489, 363, 29850, 5038, 338, 451, 3625, 29901, 6571, 4286, 4830, 29898, 13, 18884, 4833, 29918, 18121, 29892, 321, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 13, 1753, 2048, 29918, 2585, 29918, 4645, 29898, 2585, 29918, 18121, 29892, 3957, 29918, 2917, 29892, 6131, 1125, 13, 1678, 4833, 29918, 1990, 353, 2254, 29918, 2585, 29918, 4645, 29898, 2585, 29918, 18121, 29897, 13, 1678, 3957, 29918, 2917, 1839, 24051, 2033, 353, 6131, 13, 13, 1678, 736, 4833, 29918, 1990, 29898, 13, 4706, 2295, 29922, 9965, 29918, 2917, 29892, 13, 4706, 9365, 29922, 1359, 29918, 25162, 29898, 9965, 29918, 2917, 29889, 657, 877, 339, 6358, 29918, 2084, 742, 6213, 876, 13, 1678, 1723, 13, 13, 13, 1753, 2254, 29918, 25162, 29898, 2084, 1125, 13, 1678, 565, 2224, 29901, 13, 4706, 736, 343, 8807, 29889, 11177, 29918, 1359, 29898, 3150, 29898, 2084, 876, 13, 1678, 1683, 29901, 13, 4706, 736, 6213, 13, 2 ]
project/test.py
Lucklyric/hydra-pytorch-lightning-seed
4
157194
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : test.py # Author: Alvin(<NAME> <<EMAIL>> # Date : 02.05.2021 import json import logging import hydra import pytorch_lightning as pl import torch from omegaconf import DictConfig, OmegaConf log = logging.getLogger(__name__) @hydra.main(config_path='config', config_name='test_config') def main(cfg: DictConfig): print(OmegaConf.to_yaml(cfg)) pl.seed_everything(cfg.seed) # ------------ # data # ------------ data_module = hydra.utils.instantiate(cfg.data) test_dataloader = data_module.test_dataloader() # ------------ # model # ------------ model = hydra.utils.instantiate(cfg.model) # model.load_from_checkpoint(cfg.checkpoint) model.load_state_dict(torch.load(cfg.checkpoint_path)['state_dict']) trainer = pl.Trainer(**(cfg.pl_trainer)) # ------------ # testing # ------------ result = trainer.test(model, test_dataloaders=test_dataloader) log.info(result) with open(f'{trainer.log_dir}/out', 'w') as f: f.write(json.dumps(str(result), indent=4)) if __name__ == '__main__': try: main() except Exception as e: log.error(e) exit(1)
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 3497, 29871, 584, 1243, 29889, 2272, 13, 29937, 13361, 29901, 838, 3845, 29898, 29966, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 4712, 29871, 584, 29871, 29900, 29906, 29889, 29900, 29945, 29889, 29906, 29900, 29906, 29896, 13, 13, 5215, 4390, 13, 5215, 12183, 13, 13, 5215, 27246, 336, 13, 5215, 282, 3637, 25350, 29918, 4366, 1076, 408, 715, 13, 5215, 4842, 305, 13, 3166, 2703, 2442, 5527, 1053, 360, 919, 3991, 29892, 13352, 2442, 16376, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 29992, 29882, 2941, 336, 29889, 3396, 29898, 2917, 29918, 2084, 2433, 2917, 742, 2295, 29918, 978, 2433, 1688, 29918, 2917, 1495, 13, 1753, 1667, 29898, 16859, 29901, 360, 919, 3991, 1125, 13, 1678, 1596, 29898, 5981, 16376, 29889, 517, 29918, 25162, 29898, 16859, 876, 13, 1678, 715, 29889, 26776, 29918, 17991, 1918, 29898, 16859, 29889, 26776, 29897, 13, 13, 1678, 396, 448, 1378, 5634, 13, 1678, 396, 848, 13, 1678, 396, 448, 1378, 5634, 13, 1678, 848, 29918, 5453, 353, 27246, 336, 29889, 13239, 29889, 2611, 3656, 403, 29898, 16859, 29889, 1272, 29897, 13, 1678, 1243, 29918, 29881, 2075, 29877, 1664, 353, 848, 29918, 5453, 29889, 1688, 29918, 29881, 2075, 29877, 1664, 580, 13, 13, 1678, 396, 448, 1378, 5634, 13, 1678, 396, 1904, 13, 1678, 396, 448, 1378, 5634, 13, 1678, 1904, 353, 27246, 336, 29889, 13239, 29889, 2611, 3656, 403, 29898, 16859, 29889, 4299, 29897, 13, 1678, 396, 1904, 29889, 1359, 29918, 3166, 29918, 3198, 3149, 29898, 16859, 29889, 3198, 3149, 29897, 13, 1678, 1904, 29889, 1359, 29918, 3859, 29918, 8977, 29898, 7345, 305, 29889, 1359, 29898, 16859, 29889, 3198, 3149, 29918, 2084, 29897, 1839, 3859, 29918, 8977, 11287, 13, 13, 1678, 1020, 4983, 353, 715, 29889, 5323, 4983, 29898, 1068, 29898, 16859, 29889, 572, 29918, 3018, 4983, 876, 13, 13, 1678, 396, 448, 1378, 5634, 13, 1678, 396, 6724, 13, 1678, 396, 448, 1378, 5634, 13, 1678, 1121, 353, 1020, 4983, 29889, 1688, 29898, 4299, 29892, 1243, 29918, 29881, 2075, 29877, 24574, 29922, 1688, 29918, 29881, 2075, 29877, 1664, 29897, 13, 1678, 1480, 29889, 3888, 29898, 2914, 29897, 13, 1678, 411, 1722, 29898, 29888, 29915, 29912, 3018, 4983, 29889, 1188, 29918, 3972, 6822, 449, 742, 525, 29893, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 3126, 29889, 29881, 17204, 29898, 710, 29898, 2914, 511, 29536, 29922, 29946, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1018, 29901, 13, 4706, 1667, 580, 13, 1678, 5174, 8960, 408, 321, 29901, 13, 4706, 1480, 29889, 2704, 29898, 29872, 29897, 13, 4706, 6876, 29898, 29896, 29897, 13, 2 ]
app/models.py
pitrho/motorsports-historic-data-api
5
60144
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.dialects.postgresql import HSTORE from sqlalchemy.ext.mutable import MutableDict db = SQLAlchemy() PersonType = db.Enum('driver', 'team-owner', 'crew-chief', 'vehicle-owner', 'team-principal', 'technical-chief', 'race-engineer', name='person_types') class Person(db.Model): __tablename__ = 'people' id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(100), nullable=False) country = db.Column(db.String(50), nullable=False) class Series(db.Model): __tablename__ = 'series' id = db.Column(db.String(5), primary_key=True) description = db.Column(db.String(50), nullable=True) class Team(db.Model): __tablename__ = 'teams' id = db.Column(db.String(50), primary_key=True) name = db.Column(db.String(50), nullable=False) alias = db.Column(db.String(50), nullable=False) owner_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=False) races = db.relationship('Race', secondary='race_results') owner = db.relationship('Person', primaryjoin=owner_id == Person.id) class Vehicle(db.Model): __tablename__ = 'vehicles' id = db.Column(db.Integer, primary_key=True, autoincrement=True) number = db.Column(db.Integer, nullable=False) owner_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=True) vehicle_metadata = db.Column(MutableDict.as_mutable(HSTORE), nullable=False) races = db.relationship('Race', secondary='race_results') owner = db.relationship('Person', primaryjoin=owner_id == Person.id) class DriverStanding(db.Model): __tablename__ = 'driver_standings' id = db.Column(db.Integer, primary_key=True, autoincrement=True) driver_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=False) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) series = db.Column(db.String(5), db.ForeignKey('series.id'), nullable=False) season = db.Column(db.Integer, nullable=False) position = db.Column(db.Integer, nullable=False) points = db.Column(db.Integer, nullable=False) poles = db.Column(db.Integer, nullable=False) wins = db.Column(db.Integer, nullable=False) starts = db.Column(db.Integer, nullable=False) dnfs = db.Column(db.Integer, nullable=False) top5 = db.Column(db.Integer, nullable=False) top10 = db.Column(db.Integer, nullable=False) driver = db.relationship('Person') vehicle = db.relationship('Vehicle') class TeamStanding(db.Model): __tablename__ = 'team_standings' id = db.Column(db.Integer, primary_key=True, autoincrement=True) team_id = db.Column(db.String(50), db.ForeignKey('teams.id'), nullable=False) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) series = db.Column(db.String(5), db.ForeignKey('series.id'), nullable=False) season = db.Column(db.Integer, nullable=False) position = db.Column(db.Integer, nullable=False) points = db.Column(db.Integer, nullable=False) poles = db.Column(db.Integer, nullable=False) team = db.relationship('Team') vehicle = db.relationship('Vehicle') class OwnerStanding(db.Model): __tablename__ = 'owner_standings' id = db.Column(db.Integer, primary_key=True, autoincrement=True) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) series = db.Column(db.String(5), db.ForeignKey('series.id'), nullable=False) season = db.Column(db.Integer, nullable=False) position = db.Column(db.Integer, nullable=False) points = db.Column(db.Integer, nullable=False) vehicle = db.relationship('Vehicle') class RaceTrack(db.Model): __tablename__ = 'race_tracks' id = db.Column(db.Integer, primary_key=True, autoincrement=True) site = db.Column(db.String(50), nullable=False) circuit_name = db.Column(db.String(100), nullable=False) city = db.Column(db.String(50), nullable=False) state = db.Column(db.String(2), nullable=True) country = db.Column(db.String(50), nullable=False) class Race(db.Model): __tablename__ = 'races' id = db.Column(db.String(50), primary_key=True) round = db.Column(db.Integer, nullable=False) name = db.Column(db.String(100), nullable=False) season = db.Column(db.Integer, nullable=False) race_track_id = db.Column(db.Integer, db.ForeignKey('race_tracks.id'), nullable=False) date = db.Column(db.DateTime, nullable=False) laps = db.Column(db.Integer, nullable=False) length = db.Column(db.Numeric(5, 3), nullable=False) distance = db.Column(db.Numeric(5, 1), nullable=False) series = db.Column(db.String(5), db.ForeignKey('series.id'), nullable=False) race_types = db.relationship('RaceType', secondary='races_types') race_track = db.relationship('RaceTrack') class RaceType(db.Model): __tablename__ = 'race_types' id = db.Column(db.String(5), primary_key=True) description = db.Column(db.String(50), nullable=True) class RacesTypes(db.Model): __tablename__ = 'races_types' race_id = db.Column(db.String(50), db.ForeignKey('races.id'), primary_key=True) race_type = db.Column(db.String(5), db.ForeignKey('race_types.id'), primary_key=True) class RaceStanding(db.Model): __tablename__ = 'race_standings' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_id = db.Column(db.String(50), db.ForeignKey('races.id'), nullable=False) race_time = db.Column(db.Time, nullable=False) caution_flags = db.Column(db.Integer, nullable=False) caution_flag_laps = db.Column(db.Integer, nullable=False) lead_changes = db.Column(db.Integer, nullable=False) pole_speed = db.Column(db.Numeric(6, 3), nullable=False) avg_speed = db.Column(db.Numeric(6, 3), nullable=False) victory_margin = db.Column(db.Numeric(6, 3), nullable=False) class RaceEntryType(db.Model): __tablename__ = 'race_entry_types' id = db.Column(db.Integer, primary_key=True, autoincrement=True) entry_type = db.Column(db.String(50), nullable=False) class RaceEntry(db.Model): __tablename__ = 'race_entries' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_id = db.Column(db.String(50), db.ForeignKey('races.id'), nullable=False) team_id = db.Column(db.String(50), db.ForeignKey('teams.id'), nullable=False) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) entry_type_id = db.Column(db.Integer, db.ForeignKey('race_entry_types.id'), nullable=False) race = db.relationship('Race') team = db.relationship('Team') vehicle = db.relationship('Vehicle') entry_type = db.relationship('RaceEntryType') people = db.relationship('RaceEntryPerson') class RaceEntryPerson(db.Model): __tablename__ = 'race_entries_people' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_entry_id = db.Column(db.Integer, db.ForeignKey('race_entries.id'), nullable=False) person_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=False) type = db.Column(PersonType, nullable=False) person = db.relationship('Person') race_entry = db.relationship('RaceEntry') class RaceResult(db.Model): __tablename__ = 'race_results' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_id = db.Column(db.String(50), db.ForeignKey('races.id'), nullable=False) team_id = db.Column(db.String(50), db.ForeignKey('teams.id'), nullable=False) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) sponsor = db.Column(db.String(100), nullable=False) grid = db.Column(db.Integer, nullable=False) position = db.Column(db.Integer, nullable=False) laps = db.Column(db.Integer, nullable=False) status = db.Column(db.String(50), nullable=False) laps_led = db.Column(db.Integer, nullable=False) points = db.Column(db.Integer, nullable=False) money = db.Column(db.Numeric(10, 2), nullable=False) race = db.relationship('Race') team = db.relationship('Team') vehicle = db.relationship('Vehicle') people = db.relationship('RaceResultPerson') class RaceResultPerson(db.Model): __tablename__ = 'race_results_people' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_result_id = db.Column(db.Integer, db.ForeignKey('race_results.id'), nullable=False) person_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=False) type = db.Column(PersonType, nullable=False) person = db.relationship('Person') race_result = db.relationship('RaceResult') class QualifyingResult(db.Model): __tablename__ = 'qualifying_results' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_id = db.Column(db.String(50), db.ForeignKey('races.id'), nullable=False) team_id = db.Column(db.String(50), db.ForeignKey('teams.id'), nullable=False) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) session = db.Column(db.Integer, nullable=False) position = db.Column(db.Integer, nullable=False) lap_time = db.Column(db.Numeric(6, 3), nullable=False) race = db.relationship('Race') team = db.relationship('Team') vehicle = db.relationship('Vehicle') people = db.relationship('QualifyingResultPerson') class QualifyingResultPerson(db.Model): __tablename__ = 'qualifying_results_people' id = db.Column(db.Integer, primary_key=True, autoincrement=True) qualifying_result_id = db.Column(db.Integer, db.ForeignKey('qualifying_results.id'), nullable=False) person_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=False) type = db.Column(PersonType, nullable=False) person = db.relationship('Person') qualifying_result = db.relationship('QualifyingResult') class PracticeResult(db.Model): ___tablename__ = 'practice_results' id = db.Column(db.Integer, primary_key=True, autoincrement=True) race_id = db.Column(db.String(50), db.ForeignKey('races.id'), nullable=False) team_id = db.Column(db.String(50), db.ForeignKey('teams.id'), nullable=False) vehicle_id = db.Column(db.Integer, db.ForeignKey('vehicles.id'), nullable=False) session = db.Column(db.Integer, nullable=False) position = db.Column(db.Integer, nullable=False) lap_time = db.Column(db.Numeric(6, 3), nullable=False) race = db.relationship('Race') team = db.relationship('Team') vehicle = db.relationship('Vehicle') people = db.relationship('PracticeResultPerson') class PracticeResultPerson(db.Model): __tablename__ = 'practice_results_people' id = db.Column(db.Integer, primary_key=True, autoincrement=True) practice_result_id = db.Column(db.Integer, db.ForeignKey(PracticeResult.id), nullable=False) person_id = db.Column(db.Integer, db.ForeignKey('people.id'), nullable=False) type = db.Column(PersonType, nullable=False) person = db.relationship('Person') practice_result = db.relationship('PracticeResult')
[ 1, 515, 29784, 29889, 1062, 29889, 2850, 284, 305, 6764, 1053, 3758, 2499, 305, 6764, 13, 3166, 4576, 284, 305, 6764, 29889, 15321, 781, 29879, 29889, 29272, 1053, 379, 1254, 29949, 1525, 13, 3166, 4576, 284, 305, 6764, 29889, 1062, 29889, 23975, 1053, 341, 9246, 21533, 13, 13, 2585, 353, 3758, 2499, 305, 6764, 580, 13, 13, 13, 7435, 1542, 353, 4833, 29889, 16854, 877, 9465, 742, 525, 14318, 29899, 20348, 742, 525, 1037, 29893, 29899, 305, 2575, 742, 525, 345, 29882, 2512, 29899, 20348, 742, 525, 14318, 29899, 558, 26706, 742, 13, 462, 268, 525, 21695, 936, 29899, 305, 2575, 742, 525, 25525, 29899, 10599, 261, 742, 1024, 2433, 10532, 29918, 8768, 1495, 13, 13, 13, 1990, 5196, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25719, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 1024, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29896, 29900, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 4234, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 13, 1990, 10488, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 13757, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 6139, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 5574, 29897, 13, 13, 13, 1990, 8583, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 371, 2232, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 1024, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 13995, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 12271, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 19830, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 742, 16723, 2433, 25525, 29918, 9902, 1495, 13, 1678, 12271, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 742, 7601, 7122, 29922, 20348, 29918, 333, 1275, 5196, 29889, 333, 29897, 13, 13, 13, 1990, 8980, 29882, 2512, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 345, 29882, 4027, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 1353, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 12271, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 5574, 29897, 13, 1678, 19716, 29918, 19635, 353, 4833, 29889, 4409, 29898, 15211, 21533, 29889, 294, 29918, 23975, 29898, 29950, 1254, 29949, 1525, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 19830, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 742, 16723, 2433, 25525, 29918, 9902, 1495, 13, 1678, 12271, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 742, 7601, 7122, 29922, 20348, 29918, 333, 1275, 5196, 29889, 333, 29897, 13, 13, 13, 1990, 26391, 11042, 292, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 9465, 29918, 1689, 886, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 7156, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3652, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 4833, 29889, 27755, 2558, 877, 13757, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 4259, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2602, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 3291, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 1248, 267, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 21614, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 8665, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 270, 29876, 5847, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2246, 29945, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2246, 29896, 29900, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 7156, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 1495, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 13, 13, 1990, 8583, 11042, 292, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 14318, 29918, 1689, 886, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 3815, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 371, 2232, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3652, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 4833, 29889, 27755, 2558, 877, 13757, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 4259, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2602, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 3291, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 1248, 267, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 3815, 353, 4833, 29889, 2674, 800, 4034, 877, 19409, 1495, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 13, 13, 1990, 438, 23007, 11042, 292, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 20348, 29918, 1689, 886, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3652, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 4833, 29889, 27755, 2558, 877, 13757, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 4259, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2602, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 3291, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 13, 13, 1990, 23613, 17936, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 3018, 4684, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 3268, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 11369, 29918, 978, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29896, 29900, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 4272, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 2106, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29906, 511, 1870, 519, 29922, 5574, 29897, 13, 1678, 4234, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 13, 1990, 23613, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 336, 778, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 4513, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 1024, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29896, 29900, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 4259, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 8175, 29918, 11294, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25525, 29918, 3018, 4684, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 2635, 353, 4833, 29889, 4409, 29898, 2585, 29889, 11384, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 425, 567, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 3309, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29945, 29892, 29871, 29941, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 5418, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29945, 29892, 29871, 29896, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 3652, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 4833, 29889, 27755, 2558, 877, 13757, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 8175, 29918, 8768, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 1542, 742, 16723, 2433, 336, 778, 29918, 8768, 1495, 13, 1678, 8175, 29918, 11294, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 17936, 1495, 13, 13, 13, 1990, 23613, 1542, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 8768, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 6139, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 5574, 29897, 13, 13, 13, 1990, 390, 3302, 10562, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 336, 778, 29918, 8768, 29915, 13, 13, 1678, 8175, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 336, 778, 29889, 333, 5477, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 8175, 29918, 1853, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 511, 4833, 29889, 27755, 2558, 877, 25525, 29918, 8768, 29889, 333, 5477, 7601, 29918, 1989, 29922, 5574, 29897, 13, 13, 13, 1990, 23613, 11042, 292, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 1689, 886, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 336, 778, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 8175, 29918, 2230, 353, 4833, 29889, 4409, 29898, 2585, 29889, 2481, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 5777, 918, 29918, 15764, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 5777, 918, 29918, 15581, 29918, 14128, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 3275, 29918, 25990, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 22775, 29918, 19322, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29953, 29892, 29871, 29941, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 1029, 29887, 29918, 19322, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29953, 29892, 29871, 29941, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 15354, 29918, 9264, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29953, 29892, 29871, 29941, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 13, 1990, 23613, 9634, 1542, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 8269, 29918, 8768, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 6251, 29918, 1853, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 13, 1990, 23613, 9634, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 26586, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 336, 778, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3815, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 371, 2232, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 6251, 29918, 1853, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25525, 29918, 8269, 29918, 8768, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 8175, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 1495, 13, 1678, 3815, 353, 4833, 29889, 2674, 800, 4034, 877, 19409, 1495, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 1678, 6251, 29918, 1853, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 9634, 1542, 1495, 13, 1678, 2305, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 9634, 7435, 1495, 13, 13, 13, 1990, 23613, 9634, 7435, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 26586, 29918, 25719, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 8269, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25525, 29918, 26586, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 2022, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 1134, 353, 4833, 29889, 4409, 29898, 7435, 1542, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 2022, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 1495, 13, 1678, 8175, 29918, 8269, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 9634, 1495, 13, 13, 13, 1990, 23613, 3591, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 9902, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 336, 778, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3815, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 371, 2232, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 21955, 272, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29896, 29900, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 6856, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2602, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 425, 567, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 4660, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 425, 567, 29918, 839, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 3291, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 6909, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29896, 29900, 29892, 29871, 29906, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 8175, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 1495, 13, 1678, 3815, 353, 4833, 29889, 2674, 800, 4034, 877, 19409, 1495, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 1678, 2305, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 3591, 7435, 1495, 13, 13, 13, 1990, 23613, 3591, 7435, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 25525, 29918, 9902, 29918, 25719, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 2914, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25525, 29918, 9902, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 2022, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 1134, 353, 4833, 29889, 4409, 29898, 7435, 1542, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 2022, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 1495, 13, 1678, 8175, 29918, 2914, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 3591, 1495, 13, 13, 13, 1990, 15146, 9215, 3591, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 15380, 9215, 29918, 9902, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 336, 778, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3815, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 371, 2232, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 4867, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2602, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 23012, 29918, 2230, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29953, 29892, 29871, 29941, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 8175, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 1495, 13, 1678, 3815, 353, 4833, 29889, 2674, 800, 4034, 877, 19409, 1495, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 1678, 2305, 353, 4833, 29889, 2674, 800, 4034, 877, 24399, 9215, 3591, 7435, 1495, 13, 13, 13, 1990, 15146, 9215, 3591, 7435, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 15380, 9215, 29918, 9902, 29918, 25719, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 4021, 9215, 29918, 2914, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 15380, 9215, 29918, 9902, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 2022, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 1134, 353, 4833, 29889, 4409, 29898, 7435, 1542, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 2022, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 1495, 13, 1678, 4021, 9215, 29918, 2914, 353, 4833, 29889, 2674, 800, 4034, 877, 24399, 9215, 3591, 1495, 13, 13, 13, 1990, 29124, 625, 3591, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 903, 1649, 3891, 2435, 420, 1649, 353, 525, 29886, 1461, 625, 29918, 9902, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 8175, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 336, 778, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 3815, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 1231, 29898, 29945, 29900, 511, 4833, 29889, 27755, 2558, 877, 371, 2232, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 19716, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 345, 29882, 4027, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 4867, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 2602, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 1870, 519, 29922, 8824, 29897, 13, 1678, 23012, 29918, 2230, 353, 4833, 29889, 4409, 29898, 2585, 29889, 29940, 25099, 29898, 29953, 29892, 29871, 29941, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 8175, 353, 4833, 29889, 2674, 800, 4034, 877, 29934, 815, 1495, 13, 1678, 3815, 353, 4833, 29889, 2674, 800, 4034, 877, 19409, 1495, 13, 1678, 19716, 353, 4833, 29889, 2674, 800, 4034, 877, 29963, 14797, 2512, 1495, 13, 1678, 2305, 353, 4833, 29889, 2674, 800, 4034, 877, 29925, 1461, 625, 3591, 7435, 1495, 13, 13, 13, 1990, 29124, 625, 3591, 7435, 29898, 2585, 29889, 3195, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 29886, 1461, 625, 29918, 9902, 29918, 25719, 29915, 13, 13, 1678, 1178, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 4469, 25629, 29922, 5574, 29897, 13, 1678, 6944, 29918, 2914, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 29898, 29925, 1461, 625, 3591, 29889, 333, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 2022, 29918, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 4833, 29889, 27755, 2558, 877, 25719, 29889, 333, 5477, 1870, 519, 29922, 8824, 29897, 13, 1678, 1134, 353, 4833, 29889, 4409, 29898, 7435, 1542, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 2022, 353, 4833, 29889, 2674, 800, 4034, 877, 7435, 1495, 13, 1678, 6944, 29918, 2914, 353, 4833, 29889, 2674, 800, 4034, 877, 29925, 1461, 625, 3591, 1495, 13, 2 ]
lib/harm_plot.py
pnlbwh/multi-shell-dMRIharmonization
4
33402
#!/usr/bin/env python import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd from conversion import read_imgs_masks from os.path import isfile, basename XERR=0.1 ELINEWIDTH=3 CAPSIZE=5 CAPTHICK=3 FMT='cD' def harm_plot(ydata, labels, outPrefix, bshell_b): ''' :param ydata: list of [y1, y2, y3, ...] where each yi is a list :param labels: list of strings :param outPrefix: :return: ''' outPrefix += f'_b{bshell_b}' labels= list(labels) num_series, num_sub= np.shape(ydata) iter_obj= [i for i in range(num_series)] # errorbar plot plt.figure(1) plt.grid(True) for i in iter_obj: x= list(i*np.ones((num_sub,))) y= ydata[i] plt.plot(x, y, 'r*') plt.errorbar([i], np.mean(y), xerr=XERR, yerr=np.std(y), ecolor='k', capsize=CAPSIZE, capthick=CAPTHICK, elinewidth=ELINEWIDTH, fmt=FMT) plt.xticks(iter_obj, labels) plt.title('Comparison of meanFA before and after harmonization') plt.ylabel('meanFA over IIT_mean_FA_skeleton') plt.savefig(outPrefix+'_ebarplot.png') # plt.show() # box plot # plt.figure(2) # plt.grid(True) # for i in iter_obj: # x = list(i * np.ones((num_sub,))) # y = ydata[i] # plt.plot(x, y, 'r*') # # plt.boxplot(ydata, labels=labels, positions=iter_obj, # boxprops=dict(linewidth=4), # medianprops=dict(linewidth=4), # whiskerprops=dict(linewidth=2)) # # # plt.title(f'Comparison of boxplot before and after harmonization for b{bshell_b}') # plt.ylabel('meanFA over IIT_mean_FA_skeleton') # plt.savefig(outPrefix+'_boxplot.png') # plt.show() # return (outPrefix+'_ebarplot.png', outPrefix+'_boxplot.png') return outPrefix+'_ebarplot.png' def generate_csv(imgs, site_means, outPrefix, bshell_b): try: imgs, _= read_imgs_masks(imgs) except: pass statFile = outPrefix + '_stat.csv' if isfile(statFile): df= pd.read_csv(statFile) df= df.assign(**{f'meanFA b{bshell_b}':site_means}) else: stat = {'subject': [basename(f) for f in imgs], f'meanFA b{bshell_b}': site_means} df = pd.DataFrame(stat) df.to_csv(statFile, index=False) if __name__=='__main__': sub=['hi','hello','go','come'] ref_mean= [0.46, 0.49, 0.44, 0.40] target_mean_before= [0.42, 0.58, 0.43, 0.66] target_mean_after= [0.5 , 0.45, 0.40, 0.55] labels=['Reference','Target before','Target after'] bshell_b= 2000 harm_plot([ref_mean, target_mean_before, target_mean_after], labels, '/tmp/abc', bshell_b) # harm_plot([ref_mean], ['Reference'], '/tmp/abc', bshell_b) generate_csv(sub, ref_mean, '/tmp/abc', bshell_b)
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 13, 2922, 17357, 29889, 1509, 877, 29909, 1505, 1495, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 11701, 408, 10518, 13, 3166, 11301, 1053, 1303, 29918, 2492, 29879, 29918, 13168, 29879, 13, 3166, 2897, 29889, 2084, 1053, 338, 1445, 29892, 2362, 3871, 13, 13, 29990, 21662, 29922, 29900, 29889, 29896, 13, 6670, 8895, 22574, 29922, 29941, 13, 29907, 3301, 14226, 29922, 29945, 13, 29907, 3301, 4690, 2965, 29968, 29922, 29941, 13, 29943, 11490, 2433, 29883, 29928, 29915, 13, 13, 1753, 10311, 29918, 5317, 29898, 29891, 1272, 29892, 11073, 29892, 714, 23095, 29892, 289, 15903, 29918, 29890, 1125, 13, 1678, 14550, 13, 1678, 584, 3207, 343, 1272, 29901, 1051, 310, 518, 29891, 29896, 29892, 343, 29906, 29892, 343, 29941, 29892, 2023, 29962, 988, 1269, 343, 29875, 338, 263, 1051, 13, 1678, 584, 3207, 11073, 29901, 1051, 310, 6031, 13, 1678, 584, 3207, 714, 23095, 29901, 13, 1678, 584, 2457, 29901, 13, 1678, 14550, 13, 1678, 714, 23095, 4619, 285, 15972, 29890, 29912, 29890, 15903, 29918, 29890, 10162, 13, 1678, 11073, 29922, 1051, 29898, 21134, 29897, 13, 13, 1678, 954, 29918, 13757, 29892, 954, 29918, 1491, 29922, 7442, 29889, 12181, 29898, 29891, 1272, 29897, 13, 13, 1678, 4256, 29918, 5415, 29922, 518, 29875, 363, 474, 297, 3464, 29898, 1949, 29918, 13757, 4638, 13, 13, 1678, 396, 1059, 1646, 6492, 13, 1678, 14770, 29889, 4532, 29898, 29896, 29897, 13, 1678, 14770, 29889, 7720, 29898, 5574, 29897, 13, 1678, 363, 474, 297, 4256, 29918, 5415, 29901, 13, 4706, 921, 29922, 1051, 29898, 29875, 29930, 9302, 29889, 2873, 3552, 1949, 29918, 1491, 29892, 4961, 13, 4706, 343, 29922, 343, 1272, 29961, 29875, 29962, 13, 4706, 14770, 29889, 5317, 29898, 29916, 29892, 343, 29892, 525, 29878, 29930, 1495, 13, 13, 4706, 14770, 29889, 2704, 1646, 4197, 29875, 1402, 7442, 29889, 12676, 29898, 29891, 511, 921, 3127, 29922, 29990, 21662, 29892, 343, 3127, 29922, 9302, 29889, 4172, 29898, 29891, 511, 13, 462, 268, 321, 2780, 2433, 29895, 742, 2117, 2311, 29922, 29907, 3301, 14226, 29892, 2117, 27996, 29922, 29907, 3301, 4690, 2965, 29968, 29892, 560, 457, 2103, 29922, 6670, 8895, 22574, 29892, 19200, 29922, 29943, 11490, 29897, 13, 13, 1678, 14770, 29889, 486, 7358, 29898, 1524, 29918, 5415, 29892, 11073, 29897, 13, 1678, 14770, 29889, 3257, 877, 1523, 20941, 310, 2099, 4519, 1434, 322, 1156, 10311, 265, 2133, 1495, 13, 1678, 14770, 29889, 29891, 1643, 877, 12676, 4519, 975, 306, 1806, 29918, 12676, 29918, 4519, 29918, 26050, 11285, 1495, 13, 1678, 14770, 29889, 7620, 1003, 29898, 449, 23095, 29974, 15972, 774, 279, 5317, 29889, 2732, 1495, 13, 1678, 396, 14770, 29889, 4294, 580, 13, 13, 1678, 396, 3800, 6492, 13, 1678, 396, 14770, 29889, 4532, 29898, 29906, 29897, 13, 1678, 396, 14770, 29889, 7720, 29898, 5574, 29897, 13, 1678, 396, 363, 474, 297, 4256, 29918, 5415, 29901, 13, 1678, 396, 268, 921, 353, 1051, 29898, 29875, 334, 7442, 29889, 2873, 3552, 1949, 29918, 1491, 29892, 4961, 13, 1678, 396, 268, 343, 353, 343, 1272, 29961, 29875, 29962, 13, 1678, 396, 268, 14770, 29889, 5317, 29898, 29916, 29892, 343, 29892, 525, 29878, 29930, 1495, 13, 1678, 396, 13, 1678, 396, 14770, 29889, 1884, 5317, 29898, 29891, 1272, 29892, 11073, 29922, 21134, 29892, 11909, 29922, 1524, 29918, 5415, 29892, 13, 1678, 396, 632, 3800, 11030, 29922, 8977, 29898, 16292, 29922, 29946, 511, 13, 1678, 396, 632, 19194, 11030, 29922, 8977, 29898, 16292, 29922, 29946, 511, 13, 1678, 396, 632, 377, 3873, 261, 11030, 29922, 8977, 29898, 16292, 29922, 29906, 876, 13, 1678, 396, 13, 1678, 396, 13, 1678, 396, 14770, 29889, 3257, 29898, 29888, 29915, 1523, 20941, 310, 3800, 5317, 1434, 322, 1156, 10311, 265, 2133, 363, 289, 29912, 29890, 15903, 29918, 29890, 29913, 1495, 13, 1678, 396, 14770, 29889, 29891, 1643, 877, 12676, 4519, 975, 306, 1806, 29918, 12676, 29918, 4519, 29918, 26050, 11285, 1495, 13, 1678, 396, 14770, 29889, 7620, 1003, 29898, 449, 23095, 29974, 15972, 1884, 5317, 29889, 2732, 1495, 13, 1678, 396, 14770, 29889, 4294, 580, 13, 1678, 396, 736, 313, 449, 23095, 29974, 15972, 774, 279, 5317, 29889, 2732, 742, 714, 23095, 29974, 15972, 1884, 5317, 29889, 2732, 1495, 13, 13, 1678, 736, 714, 23095, 29974, 15972, 774, 279, 5317, 29889, 2732, 29915, 13, 13, 13, 1753, 5706, 29918, 7638, 29898, 2492, 29879, 29892, 3268, 29918, 1004, 550, 29892, 714, 23095, 29892, 289, 15903, 29918, 29890, 1125, 13, 13, 1678, 1018, 29901, 13, 4706, 527, 3174, 29892, 903, 29922, 1303, 29918, 2492, 29879, 29918, 13168, 29879, 29898, 2492, 29879, 29897, 13, 1678, 5174, 29901, 13, 4706, 1209, 13, 13, 1678, 1002, 2283, 353, 714, 23095, 718, 22868, 6112, 29889, 7638, 29915, 13, 268, 13, 1678, 565, 338, 1445, 29898, 6112, 2283, 1125, 13, 4706, 4489, 29922, 10518, 29889, 949, 29918, 7638, 29898, 6112, 2283, 29897, 13, 4706, 4489, 29922, 4489, 29889, 16645, 29898, 1068, 29912, 29888, 29915, 12676, 4519, 289, 29912, 29890, 15903, 29918, 29890, 29913, 2396, 2746, 29918, 1004, 550, 1800, 13, 1678, 1683, 29901, 13, 4706, 1002, 353, 11117, 16009, 2396, 518, 6500, 3871, 29898, 29888, 29897, 363, 285, 297, 527, 3174, 1402, 285, 29915, 12676, 4519, 289, 29912, 29890, 15903, 29918, 29890, 29913, 2396, 3268, 29918, 1004, 550, 29913, 13, 4706, 4489, 353, 10518, 29889, 17271, 29898, 6112, 29897, 13, 268, 13, 1678, 4489, 29889, 517, 29918, 7638, 29898, 6112, 2283, 29892, 2380, 29922, 8824, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1360, 29915, 1649, 3396, 1649, 2396, 13, 13, 1678, 1014, 29922, 1839, 2918, 3788, 12199, 3788, 1484, 3788, 2763, 2033, 13, 1678, 2143, 29918, 12676, 29922, 518, 29900, 29889, 29946, 29953, 29892, 29871, 29900, 29889, 29946, 29929, 29892, 29871, 29900, 29889, 29946, 29946, 29892, 29871, 29900, 29889, 29946, 29900, 29962, 13, 1678, 3646, 29918, 12676, 29918, 11083, 29922, 518, 29900, 29889, 29946, 29906, 29892, 29871, 29900, 29889, 29945, 29947, 29892, 29871, 29900, 29889, 29946, 29941, 29892, 29871, 29900, 29889, 29953, 29953, 29962, 13, 1678, 3646, 29918, 12676, 29918, 7045, 29922, 518, 29900, 29889, 29945, 1919, 29871, 29900, 29889, 29946, 29945, 29892, 29871, 29900, 29889, 29946, 29900, 29892, 29871, 29900, 29889, 29945, 29945, 29962, 13, 1678, 11073, 29922, 1839, 7422, 3788, 8667, 1434, 3788, 8667, 1156, 2033, 13, 1678, 289, 15903, 29918, 29890, 29922, 29871, 29906, 29900, 29900, 29900, 13, 268, 13, 1678, 10311, 29918, 5317, 4197, 999, 29918, 12676, 29892, 3646, 29918, 12676, 29918, 11083, 29892, 3646, 29918, 12676, 29918, 7045, 1402, 11073, 29892, 8207, 7050, 29914, 10736, 742, 289, 15903, 29918, 29890, 29897, 13, 1678, 396, 10311, 29918, 5317, 4197, 999, 29918, 12676, 1402, 6024, 7422, 7464, 8207, 7050, 29914, 10736, 742, 289, 15903, 29918, 29890, 29897, 13, 268, 13, 1678, 5706, 29918, 7638, 29898, 1491, 29892, 2143, 29918, 12676, 29892, 8207, 7050, 29914, 10736, 742, 289, 15903, 29918, 29890, 29897, 13, 268, 13, 268, 13, 2 ]
sparse_decomposition/decomposition/decomposition.py
bdpedigo/sparse_matrix_analysis
2
44909
# Some of the implementation inspired by: # REF: https://github.com/fchen365/epca import time from abc import abstractmethod import numpy as np from factor_analyzer import Rotator from sklearn.base import BaseEstimator from sklearn.preprocessing import StandardScaler from sklearn.utils import check_array from graspologic.embed import selectSVD from ..utils import calculate_explained_variance_ratio, soft_threshold from scipy.linalg import orthogonal_procrustes def _varimax(X): return Rotator(normalize=False).fit_transform(X) def _polar(X): # REF: https://en.wikipedia.org/wiki/Polar_decomposition#Relation_to_the_SVD U, D, Vt = selectSVD(X, n_components=X.shape[1], algorithm="full") return U @ Vt def _polar_rotate_shrink(X, gamma=0.1): # Algorithm 1 from the paper U, _, _ = selectSVD(X, n_components=X.shape[1], algorithm="full") # U = _polar(X) # R, _ = orthogonal_procrustes(U_old, U) # print(np.linalg.norm(U_old @ R - U)) U_rot = _varimax(U) U_thresh = soft_threshold(U_rot, gamma) return U_thresh def _reorder_components(X, Z_hat, Y_hat): score_norms = np.linalg.norm(X @ Y_hat, axis=0) sort_inds = np.argsort(-score_norms) return Z_hat[:, sort_inds], Y_hat[:, sort_inds] # import abc # class SuperclassMeta(type): # def __new__(mcls, classname, bases, cls_dict): # cls = super().__new__(mcls, classname, bases, cls_dict) # for name, member in cls_dict.items(): # if not getattr(member, "__doc__"): # member.__doc__ = getattr(bases[-1], name).__doc__ # return cls class BaseSparseDecomposition(BaseEstimator): def __init__( self, n_components=2, gamma=None, max_iter=10, scale=False, center=False, tol=1e-4, verbose=0, ): """Sparse matrix decomposition model. Parameters ---------- n_components : int, optional (default=2) Number of components or embedding dimensions. gamma : float, int or None, optional (default=None) Sparsity parameter, must be nonnegative. Lower values lead to more sparsity in the estimated components. If ``None``, will be set to ``sqrt(n_components * X.shape[1])`` where ``X`` is the matrix passed to ``fit``. max_iter : int, optional (default=10) Maximum number of iterations allowed, must be nonnegative. scale : bool, optional [description], by default False center : bool, optional [description], by default False tol : float or int, optional (default=1e-4) Tolerance for stopping iterative optimization. If the relative difference in score is less than this amount the algorithm will terminate. verbose : int, optional (default=0) Verbosity level. Higher values will result in more messages. """ self.n_components = n_components self.gamma = gamma self.max_iter = max_iter self.scale = scale self.center = center self.tol = tol self.verbose = verbose # TODO add random state def _initialize(self, X): """[summary] Parameters ---------- X : [type] [description] Returns ------- [type] [description] """ U, D, Vt = selectSVD(X, n_components=self.n_components) score = np.linalg.norm(D) return U, Vt.T, score def _validate_parameters(self, X): """[summary] Parameters ---------- X : [type] [description] """ if not self.gamma: gamma = np.sqrt(self.n_components * X.shape[1]) else: gamma = self.gamma self.gamma_ = gamma def _preprocess_data(self, X): """[summary] Parameters ---------- X : [type] [description] Returns ------- [type] [description] """ if self.scale or self.center: X = StandardScaler( with_mean=self.center, with_std=self.scale ).fit_transform(X) return X # def _compute_matrix_difference(X, metric='max'): # TODO better convergence criteria def fit_transform(self, X, y=None): """[summary] Parameters ---------- X : [type] [description] y : [type], optional [description], by default None Returns ------- [type] [description] """ self._validate_parameters(X) self._validate_data(X, copy=True, ensure_2d=True) # from sklearn BaseEstimator Z_hat, Y_hat, score = self._initialize(X) if self.gamma == np.inf: max_iter = 0 else: max_iter = self.max_iter # for keeping track of progress over iteration Z_diff = np.inf Y_diff = np.inf norm_score_diff = np.inf last_score = 0 # main loop i = 0 while (i < max_iter) and (norm_score_diff > self.tol): if self.verbose > 0: print(f"Iteration: {i}") iter_time = time.time() Z_hat_new, Y_hat_new = self._update_estimates(X, Z_hat, Y_hat) # Z_hat_new, Y_hat_new = _reorder_components(X, Z_hat_new, Y_hat_new) Z_diff = np.linalg.norm(Z_hat_new - Z_hat) Y_diff = np.linalg.norm(Y_hat_new - Y_hat) norm_Z_diff = Z_diff / np.linalg.norm(Z_hat_new) norm_Y_diff = Y_diff / np.linalg.norm(Y_hat_new) Z_hat = Z_hat_new Y_hat = Y_hat_new B_hat = Z_hat.T @ X @ Y_hat score = np.linalg.norm(B_hat) norm_score_diff = np.abs(score - last_score) / score last_score = score if self.verbose > 1: print(f"{time.time() - iter_time:.3f} seconds elapsed for iteration.") if self.verbose > 0: print(f"Difference in Z_hat: {Z_diff}") print(f"Difference in Y_hat: {Z_diff}") print(f"Normalized difference in Z_hat: {norm_Z_diff}") print(f"Normalized difference in Y_hat: {norm_Y_diff}") print(f"Total score: {score}") print(f"Normalized difference in score: {norm_score_diff}") print() i += 1 Z_hat, Y_hat = _reorder_components(X, Z_hat, Y_hat) # save attributes self.n_iter_ = i self.components_ = Y_hat.T # TODO this should not be cumulative by the sklearn definition self.explained_variance_ratio_ = calculate_explained_variance_ratio(X, Y_hat) self.score_ = score return Z_hat def fit(self, X): """[summary] Parameters ---------- X : [type] [description] Returns ------- [type] [description] """ self.fit_transform(X) return self def transform(self, X): """[summary] Parameters ---------- X : [type] [description] Returns ------- [type] [description] """ # TODO input checking return X @ self.components_.T @abstractmethod def _update_estimates(self, X, Z_hat, Y_hat): """[summary] Parameters ---------- X : [type] [description] Z_hat : [type] [description] Y_hat : [type] [description] """ pass class SparseComponentAnalysis(BaseSparseDecomposition): def _update_estimates(self, X, Z_hat, Y_hat): """[summary] Parameters ---------- X : [type] [description] Z_hat : [type] [description] Y_hat : [type] [description] Returns ------- [type] [description] """ Y_hat = _polar_rotate_shrink(X.T @ Z_hat, gamma=self.gamma) Z_hat = _polar(X @ Y_hat) return Z_hat, Y_hat def _save_attributes(self, X, Z_hat, Y_hat): """[summary] Parameters ---------- X : [type] [description] Z_hat : [type] [description] Y_hat : [type] [description] """ pass class SparseMatrixApproximation(BaseSparseDecomposition): def _update_estimates(self, X, Z_hat, Y_hat): """[summary] Parameters ---------- X : [type] [description] Z_hat : [type] [description] Y_hat : [type] [description] Returns ------- [type] [description] """ Z_hat = _polar_rotate_shrink(X @ Y_hat) Y_hat = _polar_rotate_shrink(X.T @ Z_hat) return Z_hat, Y_hat def _save_attributes(self, X, Z_hat, Y_hat): """[summary] Parameters ---------- X : [type] [description] Z_hat : [type] [description] Y_hat : [type] [description] """ B = Z_hat.T @ X @ Y_hat self.score_ = B self.right_latent_ = Y_hat self.left_latent_ = Z_hat
[ 1, 396, 3834, 310, 278, 5314, 20603, 491, 29901, 13, 29937, 5195, 29943, 29901, 2045, 597, 3292, 29889, 510, 29914, 29888, 2724, 29941, 29953, 29945, 29914, 1022, 1113, 13, 13, 5215, 931, 13, 3166, 25638, 1053, 9846, 5696, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 7329, 29918, 24209, 3298, 1053, 9664, 1061, 13, 3166, 2071, 19668, 29889, 3188, 1053, 7399, 12787, 326, 1061, 13, 3166, 2071, 19668, 29889, 1457, 19170, 1053, 10117, 29636, 261, 13, 3166, 2071, 19668, 29889, 13239, 1053, 1423, 29918, 2378, 13, 13, 3166, 25274, 1189, 293, 29889, 17987, 1053, 1831, 7597, 29928, 13, 13, 3166, 6317, 13239, 1053, 8147, 29918, 4548, 433, 1312, 29918, 1707, 8837, 29918, 3605, 601, 29892, 4964, 29918, 386, 12268, 13, 13, 3166, 4560, 2272, 29889, 29880, 979, 29887, 1053, 28143, 29918, 771, 7283, 504, 267, 13, 13, 13, 1753, 903, 1707, 326, 1165, 29898, 29990, 1125, 13, 1678, 736, 9664, 1061, 29898, 8945, 675, 29922, 8824, 467, 9202, 29918, 9067, 29898, 29990, 29897, 13, 13, 13, 1753, 903, 3733, 279, 29898, 29990, 1125, 13, 1678, 396, 5195, 29943, 29901, 2045, 597, 264, 29889, 6011, 29889, 990, 29914, 4594, 29914, 7713, 279, 29918, 311, 510, 3283, 29937, 9662, 362, 29918, 517, 29918, 1552, 29918, 7597, 29928, 13, 1678, 501, 29892, 360, 29892, 478, 29873, 353, 1831, 7597, 29928, 29898, 29990, 29892, 302, 29918, 14036, 29922, 29990, 29889, 12181, 29961, 29896, 1402, 5687, 543, 8159, 1159, 13, 1678, 736, 501, 732, 478, 29873, 13, 13, 13, 1753, 903, 3733, 279, 29918, 23361, 29918, 845, 29878, 682, 29898, 29990, 29892, 330, 2735, 29922, 29900, 29889, 29896, 1125, 13, 1678, 396, 29068, 29871, 29896, 515, 278, 5650, 13, 1678, 501, 29892, 17117, 903, 353, 1831, 7597, 29928, 29898, 29990, 29892, 302, 29918, 14036, 29922, 29990, 29889, 12181, 29961, 29896, 1402, 5687, 543, 8159, 1159, 13, 1678, 396, 501, 353, 903, 3733, 279, 29898, 29990, 29897, 13, 1678, 396, 390, 29892, 903, 353, 28143, 29918, 771, 7283, 504, 267, 29898, 29965, 29918, 1025, 29892, 501, 29897, 13, 1678, 396, 1596, 29898, 9302, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29965, 29918, 1025, 732, 390, 448, 501, 876, 13, 1678, 501, 29918, 5450, 353, 903, 1707, 326, 1165, 29898, 29965, 29897, 13, 1678, 501, 29918, 386, 3781, 353, 4964, 29918, 386, 12268, 29898, 29965, 29918, 5450, 29892, 330, 2735, 29897, 13, 1678, 736, 501, 29918, 386, 3781, 13, 13, 13, 1753, 903, 276, 2098, 29918, 14036, 29898, 29990, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 1125, 13, 1678, 8158, 29918, 12324, 29879, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29990, 732, 612, 29918, 2455, 29892, 9685, 29922, 29900, 29897, 13, 1678, 2656, 29918, 12772, 353, 7442, 29889, 5085, 441, 6278, 13628, 29918, 12324, 29879, 29897, 13, 1678, 736, 796, 29918, 2455, 7503, 29892, 2656, 29918, 12772, 1402, 612, 29918, 2455, 7503, 29892, 2656, 29918, 12772, 29962, 13, 13, 13, 29937, 1053, 25638, 13, 13, 13, 29937, 770, 5670, 1990, 19346, 29898, 1853, 1125, 13, 29937, 268, 822, 4770, 1482, 12035, 29885, 25932, 29892, 770, 978, 29892, 22561, 29892, 1067, 29879, 29918, 8977, 1125, 13, 29937, 308, 1067, 29879, 353, 2428, 2141, 1649, 1482, 12035, 29885, 25932, 29892, 770, 978, 29892, 22561, 29892, 1067, 29879, 29918, 8977, 29897, 13, 29937, 308, 363, 1024, 29892, 4509, 297, 1067, 29879, 29918, 8977, 29889, 7076, 7295, 13, 29937, 632, 565, 451, 679, 5552, 29898, 14242, 29892, 376, 1649, 1514, 1649, 29908, 1125, 13, 29937, 462, 4509, 17255, 1514, 1649, 353, 679, 5552, 29898, 29890, 2129, 14352, 29896, 1402, 1024, 467, 1649, 1514, 1649, 13, 29937, 308, 736, 1067, 29879, 13, 13, 13, 1990, 7399, 29903, 5510, 2772, 510, 3283, 29898, 5160, 12787, 326, 1061, 1125, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 302, 29918, 14036, 29922, 29906, 29892, 13, 4706, 330, 2735, 29922, 8516, 29892, 13, 4706, 4236, 29918, 1524, 29922, 29896, 29900, 29892, 13, 4706, 6287, 29922, 8824, 29892, 13, 4706, 4818, 29922, 8824, 29892, 13, 4706, 304, 29880, 29922, 29896, 29872, 29899, 29946, 29892, 13, 4706, 26952, 29922, 29900, 29892, 13, 268, 1125, 13, 4706, 9995, 29903, 5510, 4636, 26227, 1904, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 302, 29918, 14036, 584, 938, 29892, 13136, 313, 4381, 29922, 29906, 29897, 13, 9651, 9681, 310, 7117, 470, 23655, 13391, 29889, 13, 4706, 330, 2735, 584, 5785, 29892, 938, 470, 6213, 29892, 13136, 313, 4381, 29922, 8516, 29897, 13, 9651, 317, 862, 29879, 537, 3443, 29892, 1818, 367, 1661, 22198, 29889, 27723, 1819, 3275, 304, 901, 805, 1503, 537, 13, 9651, 297, 278, 15899, 7117, 29889, 960, 4954, 8516, 29952, 1673, 674, 367, 731, 304, 29871, 13, 9651, 4954, 3676, 29898, 29876, 29918, 14036, 334, 1060, 29889, 12181, 29961, 29896, 2314, 16159, 988, 4954, 29990, 16159, 338, 278, 4636, 4502, 304, 29871, 13, 9651, 4954, 9202, 29952, 1412, 13, 4706, 4236, 29918, 1524, 584, 938, 29892, 13136, 313, 4381, 29922, 29896, 29900, 29897, 13, 9651, 5918, 12539, 1353, 310, 24372, 6068, 29892, 1818, 367, 1661, 22198, 29889, 13, 4706, 6287, 584, 6120, 29892, 13136, 13, 9651, 518, 8216, 1402, 491, 2322, 7700, 13, 4706, 4818, 584, 6120, 29892, 13136, 13, 9651, 518, 8216, 1402, 491, 2322, 7700, 13, 4706, 304, 29880, 584, 5785, 470, 938, 29892, 13136, 313, 4381, 29922, 29896, 29872, 29899, 29946, 29897, 13, 9651, 16977, 261, 749, 363, 25480, 4256, 1230, 13883, 29889, 960, 278, 6198, 4328, 297, 13, 9651, 8158, 338, 3109, 1135, 445, 5253, 278, 5687, 674, 29504, 29889, 13, 4706, 26952, 584, 938, 29892, 13136, 313, 4381, 29922, 29900, 29897, 13, 9651, 26646, 359, 537, 3233, 29889, 5057, 261, 1819, 674, 1121, 297, 901, 7191, 29889, 29871, 13, 4706, 9995, 13, 4706, 1583, 29889, 29876, 29918, 14036, 353, 302, 29918, 14036, 13, 4706, 1583, 29889, 4283, 353, 330, 2735, 13, 4706, 1583, 29889, 3317, 29918, 1524, 353, 4236, 29918, 1524, 13, 4706, 1583, 29889, 7052, 353, 6287, 13, 4706, 1583, 29889, 5064, 353, 4818, 13, 4706, 1583, 29889, 25027, 353, 304, 29880, 13, 4706, 1583, 29889, 369, 15828, 353, 26952, 13, 4706, 396, 14402, 788, 4036, 2106, 13, 13, 1678, 822, 903, 24926, 29898, 1311, 29892, 1060, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 501, 29892, 360, 29892, 478, 29873, 353, 1831, 7597, 29928, 29898, 29990, 29892, 302, 29918, 14036, 29922, 1311, 29889, 29876, 29918, 14036, 29897, 13, 4706, 8158, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29928, 29897, 13, 4706, 736, 501, 29892, 478, 29873, 29889, 29911, 29892, 8158, 13, 13, 1678, 822, 903, 15480, 29918, 16744, 29898, 1311, 29892, 1060, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 565, 451, 1583, 29889, 4283, 29901, 13, 9651, 330, 2735, 353, 7442, 29889, 3676, 29898, 1311, 29889, 29876, 29918, 14036, 334, 1060, 29889, 12181, 29961, 29896, 2314, 13, 4706, 1683, 29901, 13, 9651, 330, 2735, 353, 1583, 29889, 4283, 13, 4706, 1583, 29889, 4283, 29918, 353, 330, 2735, 13, 13, 1678, 822, 903, 1457, 5014, 29918, 1272, 29898, 1311, 29892, 1060, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 7052, 470, 1583, 29889, 5064, 29901, 13, 9651, 1060, 353, 10117, 29636, 261, 29898, 13, 18884, 411, 29918, 12676, 29922, 1311, 29889, 5064, 29892, 411, 29918, 4172, 29922, 1311, 29889, 7052, 13, 9651, 13742, 9202, 29918, 9067, 29898, 29990, 29897, 13, 4706, 736, 1060, 13, 13, 1678, 396, 822, 903, 26017, 29918, 5344, 29918, 29881, 17678, 29898, 29990, 29892, 12714, 2433, 3317, 29374, 13, 1678, 396, 14402, 2253, 17221, 16614, 13, 13, 1678, 822, 6216, 29918, 9067, 29898, 1311, 29892, 1060, 29892, 343, 29922, 8516, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 343, 584, 518, 1853, 1402, 13136, 13, 9651, 518, 8216, 1402, 491, 2322, 6213, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 1583, 3032, 15480, 29918, 16744, 29898, 29990, 29897, 13, 13, 4706, 1583, 3032, 15480, 29918, 1272, 29898, 29990, 29892, 3509, 29922, 5574, 29892, 9801, 29918, 29906, 29881, 29922, 5574, 29897, 29871, 396, 515, 2071, 19668, 7399, 12787, 326, 1061, 13, 13, 4706, 796, 29918, 2455, 29892, 612, 29918, 2455, 29892, 8158, 353, 1583, 3032, 24926, 29898, 29990, 29897, 13, 13, 4706, 565, 1583, 29889, 4283, 1275, 7442, 29889, 7192, 29901, 13, 9651, 4236, 29918, 1524, 353, 29871, 29900, 13, 4706, 1683, 29901, 13, 9651, 4236, 29918, 1524, 353, 1583, 29889, 3317, 29918, 1524, 13, 13, 4706, 396, 363, 12515, 5702, 310, 6728, 975, 12541, 13, 4706, 796, 29918, 12765, 353, 7442, 29889, 7192, 13, 4706, 612, 29918, 12765, 353, 7442, 29889, 7192, 13, 4706, 6056, 29918, 13628, 29918, 12765, 353, 7442, 29889, 7192, 13, 4706, 1833, 29918, 13628, 353, 29871, 29900, 13, 13, 4706, 396, 1667, 2425, 13, 4706, 474, 353, 29871, 29900, 13, 4706, 1550, 313, 29875, 529, 4236, 29918, 1524, 29897, 322, 313, 12324, 29918, 13628, 29918, 12765, 1405, 1583, 29889, 25027, 1125, 13, 9651, 565, 1583, 29889, 369, 15828, 1405, 29871, 29900, 29901, 13, 18884, 1596, 29898, 29888, 29908, 13463, 362, 29901, 426, 29875, 27195, 13, 13, 9651, 4256, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 13, 9651, 796, 29918, 2455, 29918, 1482, 29892, 612, 29918, 2455, 29918, 1482, 353, 1583, 3032, 5504, 29918, 342, 326, 1078, 29898, 29990, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 29897, 13, 13, 9651, 396, 796, 29918, 2455, 29918, 1482, 29892, 612, 29918, 2455, 29918, 1482, 353, 903, 276, 2098, 29918, 14036, 29898, 29990, 29892, 796, 29918, 2455, 29918, 1482, 29892, 612, 29918, 2455, 29918, 1482, 29897, 13, 9651, 796, 29918, 12765, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29999, 29918, 2455, 29918, 1482, 448, 796, 29918, 2455, 29897, 13, 9651, 612, 29918, 12765, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29979, 29918, 2455, 29918, 1482, 448, 612, 29918, 2455, 29897, 13, 9651, 6056, 29918, 29999, 29918, 12765, 353, 796, 29918, 12765, 847, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29999, 29918, 2455, 29918, 1482, 29897, 13, 9651, 6056, 29918, 29979, 29918, 12765, 353, 612, 29918, 12765, 847, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29979, 29918, 2455, 29918, 1482, 29897, 13, 13, 9651, 796, 29918, 2455, 353, 796, 29918, 2455, 29918, 1482, 13, 9651, 612, 29918, 2455, 353, 612, 29918, 2455, 29918, 1482, 13, 13, 9651, 350, 29918, 2455, 353, 796, 29918, 2455, 29889, 29911, 732, 1060, 732, 612, 29918, 2455, 13, 9651, 8158, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 29933, 29918, 2455, 29897, 13, 9651, 6056, 29918, 13628, 29918, 12765, 353, 7442, 29889, 6897, 29898, 13628, 448, 1833, 29918, 13628, 29897, 847, 8158, 13, 9651, 1833, 29918, 13628, 353, 8158, 13, 13, 9651, 565, 1583, 29889, 369, 15828, 1405, 29871, 29896, 29901, 13, 18884, 1596, 29898, 29888, 29908, 29912, 2230, 29889, 2230, 580, 448, 4256, 29918, 2230, 29901, 29889, 29941, 29888, 29913, 6923, 560, 28170, 363, 12541, 23157, 13, 13, 9651, 565, 1583, 29889, 369, 15828, 1405, 29871, 29900, 29901, 13, 18884, 1596, 29898, 29888, 29908, 29928, 17678, 297, 796, 29918, 2455, 29901, 426, 29999, 29918, 12765, 27195, 13, 18884, 1596, 29898, 29888, 29908, 29928, 17678, 297, 612, 29918, 2455, 29901, 426, 29999, 29918, 12765, 27195, 13, 18884, 1596, 29898, 29888, 29908, 19077, 1891, 4328, 297, 796, 29918, 2455, 29901, 426, 12324, 29918, 29999, 29918, 12765, 27195, 13, 18884, 1596, 29898, 29888, 29908, 19077, 1891, 4328, 297, 612, 29918, 2455, 29901, 426, 12324, 29918, 29979, 29918, 12765, 27195, 13, 18884, 1596, 29898, 29888, 29908, 11536, 8158, 29901, 426, 13628, 27195, 13, 18884, 1596, 29898, 29888, 29908, 19077, 1891, 4328, 297, 8158, 29901, 426, 12324, 29918, 13628, 29918, 12765, 27195, 13, 18884, 1596, 580, 13, 13, 9651, 474, 4619, 29871, 29896, 13, 13, 4706, 796, 29918, 2455, 29892, 612, 29918, 2455, 353, 903, 276, 2098, 29918, 14036, 29898, 29990, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 29897, 13, 13, 4706, 396, 4078, 8393, 13, 4706, 1583, 29889, 29876, 29918, 1524, 29918, 353, 474, 13, 4706, 1583, 29889, 14036, 29918, 353, 612, 29918, 2455, 29889, 29911, 13, 4706, 396, 14402, 445, 881, 451, 367, 13299, 28524, 491, 278, 2071, 19668, 5023, 13, 4706, 1583, 29889, 4548, 433, 1312, 29918, 1707, 8837, 29918, 3605, 601, 29918, 353, 8147, 29918, 4548, 433, 1312, 29918, 1707, 8837, 29918, 3605, 601, 29898, 29990, 29892, 612, 29918, 2455, 29897, 13, 4706, 1583, 29889, 13628, 29918, 353, 8158, 13, 13, 4706, 736, 796, 29918, 2455, 13, 13, 1678, 822, 6216, 29898, 1311, 29892, 1060, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 1583, 29889, 9202, 29918, 9067, 29898, 29990, 29897, 13, 4706, 736, 1583, 13, 13, 1678, 822, 4327, 29898, 1311, 29892, 1060, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 396, 14402, 1881, 8454, 13, 4706, 736, 1060, 732, 1583, 29889, 14036, 5396, 29911, 13, 13, 1678, 732, 16595, 5696, 13, 1678, 822, 903, 5504, 29918, 342, 326, 1078, 29898, 1311, 29892, 1060, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 796, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 612, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 1209, 13, 13, 13, 1990, 317, 5510, 5308, 21067, 4848, 29898, 5160, 29903, 5510, 2772, 510, 3283, 1125, 13, 1678, 822, 903, 5504, 29918, 342, 326, 1078, 29898, 1311, 29892, 1060, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 796, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 612, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 612, 29918, 2455, 353, 903, 3733, 279, 29918, 23361, 29918, 845, 29878, 682, 29898, 29990, 29889, 29911, 732, 796, 29918, 2455, 29892, 330, 2735, 29922, 1311, 29889, 4283, 29897, 13, 4706, 796, 29918, 2455, 353, 903, 3733, 279, 29898, 29990, 732, 612, 29918, 2455, 29897, 13, 4706, 736, 796, 29918, 2455, 29892, 612, 29918, 2455, 13, 13, 1678, 822, 903, 7620, 29918, 15697, 29898, 1311, 29892, 1060, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 796, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 612, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 1209, 13, 13, 13, 1990, 317, 5510, 14609, 2052, 307, 2657, 362, 29898, 5160, 29903, 5510, 2772, 510, 3283, 1125, 13, 1678, 822, 903, 5504, 29918, 342, 326, 1078, 29898, 1311, 29892, 1060, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 796, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 612, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 796, 29918, 2455, 353, 903, 3733, 279, 29918, 23361, 29918, 845, 29878, 682, 29898, 29990, 732, 612, 29918, 2455, 29897, 13, 4706, 612, 29918, 2455, 353, 903, 3733, 279, 29918, 23361, 29918, 845, 29878, 682, 29898, 29990, 29889, 29911, 732, 796, 29918, 2455, 29897, 13, 4706, 736, 796, 29918, 2455, 29892, 612, 29918, 2455, 13, 13, 1678, 822, 903, 7620, 29918, 15697, 29898, 1311, 29892, 1060, 29892, 796, 29918, 2455, 29892, 612, 29918, 2455, 1125, 13, 4706, 9995, 29961, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1060, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 796, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 612, 29918, 2455, 584, 518, 1853, 29962, 13, 9651, 518, 8216, 29962, 13, 4706, 9995, 13, 4706, 350, 353, 796, 29918, 2455, 29889, 29911, 732, 1060, 732, 612, 29918, 2455, 13, 4706, 1583, 29889, 13628, 29918, 353, 350, 13, 4706, 1583, 29889, 1266, 29918, 5066, 296, 29918, 353, 612, 29918, 2455, 13, 4706, 1583, 29889, 1563, 29918, 5066, 296, 29918, 353, 796, 29918, 2455, 13, 2 ]
PyUdemy/Day17/Start.py/quiz-game/main.py
JoseArtur/phyton-exercices
0
161139
<gh_stars>0 from question_model import Question from data import question_data from quiz_brain import QuizBrain question_bank = [] for i in question_data: question = Question(i["text"], i["answer"]) question_bank.append(question) quiz = QuizBrain(question_bank) while quiz.still_has_question() : quiz.next_question() print("You have completed the quiz") print(f"Your final score is {quiz.score}/{quiz.question_number}.")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 1139, 29918, 4299, 1053, 894, 13, 3166, 848, 1053, 1139, 29918, 1272, 13, 3166, 439, 466, 29918, 2634, 262, 1053, 751, 466, 22097, 13, 12470, 29918, 9157, 353, 5159, 13, 1454, 474, 297, 1139, 29918, 1272, 29901, 13, 1678, 1139, 353, 894, 29898, 29875, 3366, 726, 12436, 474, 3366, 12011, 20068, 13, 1678, 1139, 29918, 9157, 29889, 4397, 29898, 12470, 29897, 13, 13, 13, 339, 466, 353, 751, 466, 22097, 29898, 12470, 29918, 9157, 29897, 13, 8000, 439, 466, 29889, 303, 453, 29918, 5349, 29918, 12470, 580, 584, 13, 1678, 439, 466, 29889, 4622, 29918, 12470, 580, 13, 2158, 703, 3492, 505, 8676, 278, 439, 466, 1159, 13, 2158, 29898, 29888, 29908, 10858, 2186, 8158, 338, 426, 339, 466, 29889, 13628, 6822, 29912, 339, 466, 29889, 12470, 29918, 4537, 1836, 1159, 13, 2 ]
tools/find-broken-edition-parm.py
ctheune/assembly-cms
0
24023
# Copyright (c) 2010 gocept gmbh & co. kg # See also LICENSE.txt import zope.traversing.api stack = [root['summer10']] while stack: page = stack.pop() for edition in page.editions: for tag in edition.parameters: if not ':' in tag: print zope.traversing.api.getPath(edition) stack.extend(page.subpages)
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29900, 748, 1547, 330, 8337, 29882, 669, 1302, 29889, 12118, 13, 29937, 2823, 884, 365, 2965, 1430, 1660, 29889, 3945, 13, 13, 5215, 503, 2300, 29889, 3018, 874, 292, 29889, 2754, 13, 13, 1429, 353, 518, 4632, 1839, 2083, 1050, 29896, 29900, 2033, 29962, 13, 13, 8000, 5096, 29901, 13, 1678, 1813, 353, 5096, 29889, 7323, 580, 13, 1678, 363, 12203, 297, 1813, 29889, 287, 2187, 29901, 13, 4706, 363, 4055, 297, 12203, 29889, 16744, 29901, 13, 9651, 565, 451, 525, 11283, 297, 4055, 29901, 13, 18884, 1596, 503, 2300, 29889, 3018, 874, 292, 29889, 2754, 29889, 657, 2605, 29898, 287, 654, 29897, 13, 1678, 5096, 29889, 21843, 29898, 3488, 29889, 1491, 12292, 29897, 13, 2 ]
src/extract_bcs_crops.py
pmh47/textured-mesh-gen
30
113420
<reponame>pmh47/textured-mesh-gen<filename>src/extract_bcs_crops.py import os import sys from itertools import islice, count from collections import deque import skvideo.io import cv2 from crop_extraction_common import * from bcs_common import * step = 10 median_count = 25 # should be odd; number of stepped-frames to include in median (half either side of current frame) crops_per_file = 256 score_threshold = 0.7 edge_distance = 20 min_box_area = 1500 # square raw-pixels crop_border_fraction = 0.075 # per side dataset_name = sys.argv[1] masks_path = './bcs_masks' def main(): crops_path = bcs_preprocessed_path + '/dataset/' + dataset_name + '/crops_{}x{}_{}-per-file'.format(crop_width, crop_height, crops_per_file) if not os.path.exists(crops_path): os.makedirs(crops_path) occluder_mask = cv2.imread(masks_path + '/' + dataset_name + '_occluders.png') occluder_mask = cv2.resize(occluder_mask, (raw_width, raw_height), interpolation=cv2.INTER_NEAREST) occluder_mask = np.max(occluder_mask, axis=2) rotations = cv2.imread(masks_path + '/' + dataset_name + '_rotations.png')[:, :, 1] # i.e. take just G channel, which is rotation rotations = cv2.resize(rotations, (raw_width, raw_height), interpolation=cv2.INTER_NEAREST) rotations = rotations.astype(np.float32) * 2. * np.pi / 255 projection_matrix, view_rotation_matrix = load_calibration_matrices(dataset_name) detectron = DetectronWrapper(score_threshold) def stepped_indices_and_frames(): reader = skvideo.io.vreader(bcs_raw_path + '/dataset/' + dataset_name + '/video.avi') buffer = deque() indices_and_frames = zip(count(), reader) for index, frame in islice(indices_and_frames, 0, None, step): buffer.append(frame[:, :, ::-1]) # convert BGR to RGB if len(buffer) == median_count: # i.e. start considering frames only when we have enough to compute a median yield ( index - median_count // 2 * step, buffer[median_count // 2], lambda box: np.median(np.asarray([extract_crop(other_frame, raw_width, raw_height, crop_width, crop_border_fraction, *box[:-1])[0] for other_frame in buffer]), axis=0), ) buffer.popleft() with ShardedRecordWriter(crops_path + '/{:04d}_l.tfrecords', crops_per_file) as left_writer: with ShardedRecordWriter(crops_path + '/{:04d}_r.tfrecords', crops_per_file) as right_writer: left_crop_count = right_crop_count = 0 for frame_index, frame, get_median_crop in stepped_indices_and_frames(): # Note that boxes are indexed by x1/y1/x2/y2/score class_to_boxes_and_masks = detectron(frame) def touches_edge(box, mask): if box[0] < edge_distance or box[2] > frame.shape[1] - edge_distance: return True if box[1] < edge_distance or box[3] > frame.shape[0] - edge_distance: return True return False def touches_occluder(box, mask): dilated_mask = cv2.dilate(mask, np.ones([3, 3])) if np.count_nonzero(dilated_mask * occluder_mask) > 0: return True return False def touches_other_instance(box, mask): dilated_mask = cv2.dilate(mask, np.ones([3, 3])) for boxes_and_masks in class_to_boxes_and_masks.values(): for _, other_mask in boxes_and_masks: if other_mask is mask: continue if np.count_nonzero(dilated_mask * other_mask) > 0: return True return False def is_large_enough(box, mask): return box_area(box) > min_box_area car_boxes_and_masks = list(filter( lambda box_and_mask: not touches_edge(*box_and_mask) and not touches_occluder(*box_and_mask) and not touches_other_instance(*box_and_mask) and is_large_enough(*box_and_mask), class_to_boxes_and_masks['car'] )) for box, mask in car_boxes_and_masks: assert crop_width == crop_height crop, crop_raw_size = extract_crop(frame, raw_width, raw_height, crop_width, crop_border_fraction, *box[:-1]) cropped_mask, _ = extract_crop(mask, raw_width, raw_height, crop_width, crop_border_fraction, *box[:-1]) median = get_median_crop(box) centre_x = int((box[0] + box[2]) // 2 + 0.5) centre_y = int((box[1] + box[3]) // 2 + 0.5) rotation = rotations[centre_y, centre_x] offset_x = centre_x - raw_width / 2. offset_y = raw_height / 2. - centre_y crop_offset_matrix = [ [1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [-offset_x, -offset_y, 0., 1.], ] xy_ndc_matrix = np.diag([2. / crop_raw_size, 2. / crop_raw_size, 1., 1.]) crop_projection_matrix = np.dot(np.dot(projection_matrix, crop_offset_matrix), xy_ndc_matrix) example = tf.train.Example( features=tf.train.Features( feature={ 'pixels': jpeg_feature(crop), 'background': jpeg_feature(median), 'mask': png_feature(cropped_mask), 'rotation': float32_feature(rotation), 'projection_matrix': float32_feature(crop_projection_matrix), 'view_rotation_matrix': float32_feature(view_rotation_matrix), 'dataset_name': string_feature(dataset_name) } ) ) if abs(rotation - np.pi) < 0.1: writer = right_writer right_crop_count += 1 else: writer = left_writer left_crop_count += 1 writer.write(example.SerializeToString()) if len(car_boxes_and_masks) > 0: print('{} left-lane / {} right-lane crops written at frame {}'.format(left_crop_count, right_crop_count, frame_index)) if __name__ == '__main__': main()
[ 1, 529, 276, 1112, 420, 29958, 3358, 29882, 29946, 29955, 29914, 726, 2955, 29899, 4467, 29882, 29899, 1885, 29966, 9507, 29958, 4351, 29914, 21111, 29918, 29890, 2395, 29918, 24077, 567, 29889, 2272, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 3166, 4256, 8504, 1053, 338, 5897, 29892, 2302, 13, 3166, 16250, 1053, 316, 802, 13, 5215, 2071, 9641, 29889, 601, 13, 5215, 13850, 29906, 13, 13, 3166, 274, 1336, 29918, 1062, 13857, 29918, 9435, 1053, 334, 13, 3166, 289, 2395, 29918, 9435, 1053, 334, 13, 13, 13, 10568, 353, 29871, 29896, 29900, 13, 2168, 713, 29918, 2798, 353, 29871, 29906, 29945, 29871, 396, 881, 367, 7736, 29936, 1353, 310, 28996, 29899, 19935, 304, 3160, 297, 19194, 313, 24498, 2845, 2625, 310, 1857, 3515, 29897, 13, 13, 24077, 567, 29918, 546, 29918, 1445, 353, 29871, 29906, 29945, 29953, 13, 13, 13628, 29918, 386, 12268, 353, 29871, 29900, 29889, 29955, 13, 12864, 29918, 19244, 353, 29871, 29906, 29900, 13, 1195, 29918, 1884, 29918, 6203, 353, 29871, 29896, 29945, 29900, 29900, 29871, 396, 6862, 10650, 29899, 29886, 861, 1379, 13, 13, 29883, 1336, 29918, 11466, 29918, 29888, 13857, 353, 29871, 29900, 29889, 29900, 29955, 29945, 29871, 396, 639, 2625, 13, 13, 24713, 29918, 978, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 13168, 29879, 29918, 2084, 353, 19283, 29890, 2395, 29918, 13168, 29879, 29915, 13, 13, 13, 1753, 1667, 7295, 13, 13, 1678, 8182, 567, 29918, 2084, 353, 289, 2395, 29918, 1457, 5014, 287, 29918, 2084, 718, 8207, 24713, 22208, 718, 8783, 29918, 978, 718, 8207, 24077, 567, 648, 29913, 29916, 29912, 3227, 7402, 546, 29899, 1445, 4286, 4830, 29898, 29883, 1336, 29918, 2103, 29892, 274, 1336, 29918, 3545, 29892, 8182, 567, 29918, 546, 29918, 1445, 29897, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 24077, 567, 29918, 2084, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 24077, 567, 29918, 2084, 29897, 13, 13, 1678, 2179, 29880, 18309, 29918, 13168, 353, 13850, 29906, 29889, 326, 949, 29898, 13168, 29879, 29918, 2084, 718, 8207, 29915, 718, 8783, 29918, 978, 718, 22868, 542, 5762, 414, 29889, 2732, 1495, 13, 1678, 2179, 29880, 18309, 29918, 13168, 353, 13850, 29906, 29889, 21476, 29898, 542, 5762, 261, 29918, 13168, 29892, 313, 1610, 29918, 2103, 29892, 10650, 29918, 3545, 511, 29694, 29922, 11023, 29906, 29889, 23845, 29918, 8186, 29909, 1525, 1254, 29897, 13, 1678, 2179, 29880, 18309, 29918, 13168, 353, 7442, 29889, 3317, 29898, 542, 5762, 261, 29918, 13168, 29892, 9685, 29922, 29906, 29897, 13, 13, 1678, 5731, 800, 353, 13850, 29906, 29889, 326, 949, 29898, 13168, 29879, 29918, 2084, 718, 8207, 29915, 718, 8783, 29918, 978, 718, 22868, 5450, 800, 29889, 2732, 1495, 7503, 29892, 584, 29892, 29871, 29896, 29962, 29871, 396, 474, 29889, 29872, 29889, 2125, 925, 402, 8242, 29892, 607, 338, 13733, 13, 1678, 5731, 800, 353, 13850, 29906, 29889, 21476, 29898, 5450, 800, 29892, 313, 1610, 29918, 2103, 29892, 10650, 29918, 3545, 511, 29694, 29922, 11023, 29906, 29889, 23845, 29918, 8186, 29909, 1525, 1254, 29897, 13, 1678, 5731, 800, 353, 5731, 800, 29889, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 334, 29871, 29906, 29889, 334, 7442, 29889, 1631, 847, 29871, 29906, 29945, 29945, 13, 13, 1678, 18246, 29918, 5344, 29892, 1776, 29918, 5450, 362, 29918, 5344, 353, 2254, 29918, 1052, 26218, 29918, 2922, 11669, 29898, 24713, 29918, 978, 29897, 13, 13, 1678, 6459, 1617, 353, 5953, 522, 1617, 15646, 29898, 13628, 29918, 386, 12268, 29897, 13, 13, 1678, 822, 28996, 29918, 513, 1575, 29918, 392, 29918, 19935, 7295, 13, 13, 4706, 9591, 353, 2071, 9641, 29889, 601, 29889, 29894, 16950, 29898, 29890, 2395, 29918, 1610, 29918, 2084, 718, 8207, 24713, 22208, 718, 8783, 29918, 978, 718, 8207, 9641, 29889, 17345, 1495, 13, 4706, 6835, 353, 316, 802, 580, 13, 13, 4706, 16285, 29918, 392, 29918, 19935, 353, 14319, 29898, 2798, 3285, 9591, 29897, 13, 4706, 363, 2380, 29892, 3515, 297, 338, 5897, 29898, 513, 1575, 29918, 392, 29918, 19935, 29892, 29871, 29900, 29892, 6213, 29892, 4331, 1125, 13, 9651, 6835, 29889, 4397, 29898, 2557, 7503, 29892, 584, 29892, 4761, 29899, 29896, 2314, 29871, 396, 3588, 350, 14345, 304, 390, 7210, 13, 9651, 565, 7431, 29898, 9040, 29897, 1275, 19194, 29918, 2798, 29901, 29871, 396, 474, 29889, 29872, 29889, 1369, 13858, 16608, 871, 746, 591, 505, 3307, 304, 10272, 263, 19194, 13, 18884, 7709, 313, 13, 462, 1678, 2380, 448, 19194, 29918, 2798, 849, 29871, 29906, 334, 4331, 29892, 13, 462, 1678, 6835, 29961, 2168, 713, 29918, 2798, 849, 29871, 29906, 1402, 13, 462, 1678, 14013, 3800, 29901, 7442, 29889, 2168, 713, 29898, 9302, 29889, 294, 2378, 4197, 21111, 29918, 29883, 1336, 29898, 1228, 29918, 2557, 29892, 10650, 29918, 2103, 29892, 10650, 29918, 3545, 29892, 274, 1336, 29918, 2103, 29892, 274, 1336, 29918, 11466, 29918, 29888, 13857, 29892, 334, 1884, 7503, 29899, 29896, 2314, 29961, 29900, 29962, 363, 916, 29918, 2557, 297, 6835, 11724, 9685, 29922, 29900, 511, 13, 18884, 1723, 13, 18884, 6835, 29889, 7323, 1563, 580, 13, 13, 1678, 411, 1383, 25600, 9182, 10507, 29898, 24077, 567, 29918, 2084, 718, 8207, 25641, 29900, 29946, 29881, 2403, 29880, 29889, 13264, 3757, 4339, 742, 8182, 567, 29918, 546, 29918, 1445, 29897, 408, 2175, 29918, 13236, 29901, 13, 4706, 411, 1383, 25600, 9182, 10507, 29898, 24077, 567, 29918, 2084, 718, 8207, 25641, 29900, 29946, 29881, 2403, 29878, 29889, 13264, 3757, 4339, 742, 8182, 567, 29918, 546, 29918, 1445, 29897, 408, 1492, 29918, 13236, 29901, 13, 13, 9651, 2175, 29918, 29883, 1336, 29918, 2798, 353, 1492, 29918, 29883, 1336, 29918, 2798, 353, 29871, 29900, 13, 9651, 363, 3515, 29918, 2248, 29892, 3515, 29892, 679, 29918, 2168, 713, 29918, 29883, 1336, 297, 28996, 29918, 513, 1575, 29918, 392, 29918, 19935, 7295, 13, 13, 18884, 396, 3940, 393, 16273, 526, 27541, 491, 921, 29896, 29914, 29891, 29896, 29914, 29916, 29906, 29914, 29891, 29906, 29914, 13628, 13, 13, 18884, 770, 29918, 517, 29918, 1884, 267, 29918, 392, 29918, 13168, 29879, 353, 6459, 1617, 29898, 2557, 29897, 13, 13, 18884, 822, 6023, 267, 29918, 12864, 29898, 1884, 29892, 11105, 1125, 13, 462, 1678, 565, 3800, 29961, 29900, 29962, 529, 7636, 29918, 19244, 470, 3800, 29961, 29906, 29962, 1405, 3515, 29889, 12181, 29961, 29896, 29962, 448, 7636, 29918, 19244, 29901, 13, 462, 4706, 736, 5852, 13, 462, 1678, 565, 3800, 29961, 29896, 29962, 529, 7636, 29918, 19244, 470, 3800, 29961, 29941, 29962, 1405, 3515, 29889, 12181, 29961, 29900, 29962, 448, 7636, 29918, 19244, 29901, 13, 462, 4706, 736, 5852, 13, 462, 1678, 736, 7700, 13, 13, 18884, 822, 6023, 267, 29918, 542, 5762, 261, 29898, 1884, 29892, 11105, 1125, 13, 462, 1678, 21749, 630, 29918, 13168, 353, 13850, 29906, 29889, 29881, 309, 403, 29898, 13168, 29892, 7442, 29889, 2873, 4197, 29941, 29892, 29871, 29941, 12622, 13, 462, 1678, 565, 7442, 29889, 2798, 29918, 5464, 9171, 29898, 29881, 309, 630, 29918, 13168, 334, 2179, 29880, 18309, 29918, 13168, 29897, 1405, 29871, 29900, 29901, 13, 462, 4706, 736, 5852, 13, 462, 1678, 736, 7700, 13, 13, 18884, 822, 6023, 267, 29918, 1228, 29918, 8758, 29898, 1884, 29892, 11105, 1125, 13, 462, 1678, 21749, 630, 29918, 13168, 353, 13850, 29906, 29889, 29881, 309, 403, 29898, 13168, 29892, 7442, 29889, 2873, 4197, 29941, 29892, 29871, 29941, 12622, 13, 462, 1678, 363, 16273, 29918, 392, 29918, 13168, 29879, 297, 770, 29918, 517, 29918, 1884, 267, 29918, 392, 29918, 13168, 29879, 29889, 5975, 7295, 13, 462, 4706, 363, 17117, 916, 29918, 13168, 297, 16273, 29918, 392, 29918, 13168, 29879, 29901, 13, 462, 9651, 565, 916, 29918, 13168, 338, 11105, 29901, 13, 462, 18884, 6773, 13, 462, 9651, 565, 7442, 29889, 2798, 29918, 5464, 9171, 29898, 29881, 309, 630, 29918, 13168, 334, 916, 29918, 13168, 29897, 1405, 29871, 29900, 29901, 13, 462, 18884, 736, 5852, 13, 462, 1678, 736, 7700, 13, 13, 18884, 822, 338, 29918, 16961, 29918, 264, 820, 29898, 1884, 29892, 11105, 1125, 13, 462, 1678, 736, 3800, 29918, 6203, 29898, 1884, 29897, 1405, 1375, 29918, 1884, 29918, 6203, 13, 13, 18884, 1559, 29918, 1884, 267, 29918, 392, 29918, 13168, 29879, 353, 1051, 29898, 4572, 29898, 13, 462, 1678, 14013, 3800, 29918, 392, 29918, 13168, 29901, 13, 462, 4706, 451, 6023, 267, 29918, 12864, 10456, 1884, 29918, 392, 29918, 13168, 29897, 322, 451, 6023, 267, 29918, 542, 5762, 261, 10456, 1884, 29918, 392, 29918, 13168, 29897, 322, 451, 6023, 267, 29918, 1228, 29918, 8758, 10456, 1884, 29918, 392, 29918, 13168, 29897, 322, 338, 29918, 16961, 29918, 264, 820, 10456, 1884, 29918, 392, 29918, 13168, 511, 13, 462, 1678, 770, 29918, 517, 29918, 1884, 267, 29918, 392, 29918, 13168, 29879, 1839, 4287, 2033, 13, 462, 876, 13, 13, 18884, 363, 3800, 29892, 11105, 297, 1559, 29918, 1884, 267, 29918, 392, 29918, 13168, 29879, 29901, 13, 462, 1678, 4974, 274, 1336, 29918, 2103, 1275, 274, 1336, 29918, 3545, 13, 462, 1678, 274, 1336, 29892, 274, 1336, 29918, 1610, 29918, 2311, 353, 6597, 29918, 29883, 1336, 29898, 2557, 29892, 10650, 29918, 2103, 29892, 10650, 29918, 3545, 29892, 274, 1336, 29918, 2103, 29892, 274, 1336, 29918, 11466, 29918, 29888, 13857, 29892, 334, 1884, 7503, 29899, 29896, 2314, 13, 462, 1678, 8182, 2986, 29918, 13168, 29892, 903, 353, 6597, 29918, 29883, 1336, 29898, 13168, 29892, 10650, 29918, 2103, 29892, 10650, 29918, 3545, 29892, 274, 1336, 29918, 2103, 29892, 274, 1336, 29918, 11466, 29918, 29888, 13857, 29892, 334, 1884, 7503, 29899, 29896, 2314, 13, 462, 1678, 19194, 353, 679, 29918, 2168, 713, 29918, 29883, 1336, 29898, 1884, 29897, 13, 462, 1678, 8442, 29918, 29916, 353, 938, 3552, 1884, 29961, 29900, 29962, 718, 3800, 29961, 29906, 2314, 849, 29871, 29906, 718, 29871, 29900, 29889, 29945, 29897, 13, 462, 1678, 8442, 29918, 29891, 353, 938, 3552, 1884, 29961, 29896, 29962, 718, 3800, 29961, 29941, 2314, 849, 29871, 29906, 718, 29871, 29900, 29889, 29945, 29897, 13, 462, 1678, 13733, 353, 5731, 800, 29961, 1760, 276, 29918, 29891, 29892, 8442, 29918, 29916, 29962, 13, 462, 1678, 9210, 29918, 29916, 353, 8442, 29918, 29916, 448, 10650, 29918, 2103, 847, 29871, 29906, 29889, 13, 462, 1678, 9210, 29918, 29891, 353, 10650, 29918, 3545, 847, 29871, 29906, 29889, 448, 8442, 29918, 29891, 13, 462, 1678, 274, 1336, 29918, 10289, 29918, 5344, 353, 518, 13, 462, 4706, 518, 29896, 1696, 29871, 29900, 1696, 29871, 29900, 1696, 29871, 29900, 29889, 1402, 13, 462, 4706, 518, 29900, 1696, 29871, 29896, 1696, 29871, 29900, 1696, 29871, 29900, 29889, 1402, 13, 462, 4706, 518, 29900, 1696, 29871, 29900, 1696, 29871, 29896, 1696, 29871, 29900, 29889, 1402, 13, 462, 4706, 21069, 10289, 29918, 29916, 29892, 448, 10289, 29918, 29891, 29892, 29871, 29900, 1696, 29871, 29896, 29889, 1402, 13, 462, 1678, 4514, 13, 462, 1678, 921, 29891, 29918, 299, 29883, 29918, 5344, 353, 7442, 29889, 6051, 351, 4197, 29906, 29889, 847, 274, 1336, 29918, 1610, 29918, 2311, 29892, 29871, 29906, 29889, 847, 274, 1336, 29918, 1610, 29918, 2311, 29892, 29871, 29896, 1696, 29871, 29896, 29889, 2314, 13, 462, 1678, 274, 1336, 29918, 771, 6929, 29918, 5344, 353, 7442, 29889, 6333, 29898, 9302, 29889, 6333, 29898, 771, 6929, 29918, 5344, 29892, 274, 1336, 29918, 10289, 29918, 5344, 511, 921, 29891, 29918, 299, 29883, 29918, 5344, 29897, 13, 462, 1678, 1342, 353, 15886, 29889, 14968, 29889, 14023, 29898, 13, 462, 4706, 5680, 29922, 13264, 29889, 14968, 29889, 8263, 3698, 29898, 13, 462, 9651, 4682, 3790, 13, 462, 18884, 525, 29886, 861, 1379, 2396, 432, 29886, 387, 29918, 14394, 29898, 29883, 1336, 511, 13, 462, 18884, 525, 7042, 2396, 432, 29886, 387, 29918, 14394, 29898, 2168, 713, 511, 13, 462, 18884, 525, 13168, 2396, 282, 865, 29918, 14394, 29898, 24077, 2986, 29918, 13168, 511, 13, 462, 18884, 525, 5450, 362, 2396, 5785, 29941, 29906, 29918, 14394, 29898, 5450, 362, 511, 13, 462, 18884, 525, 771, 6929, 29918, 5344, 2396, 5785, 29941, 29906, 29918, 14394, 29898, 29883, 1336, 29918, 771, 6929, 29918, 5344, 511, 13, 462, 18884, 525, 1493, 29918, 5450, 362, 29918, 5344, 2396, 5785, 29941, 29906, 29918, 14394, 29898, 1493, 29918, 5450, 362, 29918, 5344, 511, 13, 462, 18884, 525, 24713, 29918, 978, 2396, 1347, 29918, 14394, 29898, 24713, 29918, 978, 29897, 13, 462, 9651, 500, 13, 462, 4706, 1723, 13, 462, 1678, 1723, 13, 462, 1678, 565, 6425, 29898, 5450, 362, 448, 7442, 29889, 1631, 29897, 529, 29871, 29900, 29889, 29896, 29901, 13, 462, 4706, 9227, 353, 1492, 29918, 13236, 13, 462, 4706, 1492, 29918, 29883, 1336, 29918, 2798, 4619, 29871, 29896, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 9227, 353, 2175, 29918, 13236, 13, 462, 4706, 2175, 29918, 29883, 1336, 29918, 2798, 4619, 29871, 29896, 13, 462, 1678, 9227, 29889, 3539, 29898, 4773, 29889, 1748, 6646, 8246, 3101, 13, 13, 18884, 565, 7431, 29898, 4287, 29918, 1884, 267, 29918, 392, 29918, 13168, 29879, 29897, 1405, 29871, 29900, 29901, 13, 462, 1678, 1596, 877, 8875, 2175, 29899, 25821, 847, 6571, 1492, 29899, 25821, 8182, 567, 3971, 472, 3515, 6571, 4286, 4830, 29898, 1563, 29918, 29883, 1336, 29918, 2798, 29892, 1492, 29918, 29883, 1336, 29918, 2798, 29892, 3515, 29918, 2248, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 13, 2 ]
api/recomend/urls.py
JCTec/Recomender
0
1617604
from django.urls import path from django.conf.urls import url from .views import * urlpatterns = [ path('questions/', QuestionAPI.as_view()), path('answers/', AnswersAPI.as_view()), ]
[ 1, 515, 9557, 29889, 26045, 1053, 2224, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 869, 7406, 1053, 334, 13, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 2224, 877, 2619, 29914, 742, 894, 8787, 29889, 294, 29918, 1493, 25739, 13, 1678, 2224, 877, 550, 17538, 29914, 742, 530, 5956, 8787, 29889, 294, 29918, 1493, 25739, 13, 29962, 13, 13, 2 ]
acoustic_scene_classification/test.py
GT-KIM/specmix
2
65361
import numpy as np import matplotlib.pyplot as plt augment_method = "Specaugment" d = np.load("result_{}/curve.npz".format(augment_method)) loss = d['loss'] acc = d['acc'] best_acc = d['best_acc'] print(best_acc) plt.plot(loss) plt.show() plt.clf() plt.plot(acc) plt.show() plt.clf()
[ 1, 1053, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 2987, 358, 29918, 5696, 353, 376, 10299, 2987, 358, 29908, 13, 13, 29881, 353, 7442, 29889, 1359, 703, 2914, 648, 6822, 2764, 345, 29889, 9302, 29920, 1642, 4830, 29898, 2987, 358, 29918, 5696, 876, 13, 6758, 353, 270, 1839, 6758, 2033, 13, 5753, 353, 270, 1839, 5753, 2033, 13, 13318, 29918, 5753, 353, 270, 1839, 13318, 29918, 5753, 2033, 13, 13, 2158, 29898, 13318, 29918, 5753, 29897, 13, 13, 572, 29873, 29889, 5317, 29898, 6758, 29897, 13, 572, 29873, 29889, 4294, 580, 13, 572, 29873, 29889, 695, 29888, 580, 13, 13, 572, 29873, 29889, 5317, 29898, 5753, 29897, 13, 572, 29873, 29889, 4294, 580, 13, 572, 29873, 29889, 695, 29888, 580, 2 ]
pyhmy/rpc/request.py
difengJ/pyhmy
37
12180
import json import requests from .exceptions import ( RequestsError, RequestsTimeoutError, RPCError ) _default_endpoint = 'http://localhost:9500' _default_timeout = 30 def base_request(method, params=None, endpoint=_default_endpoint, timeout=_default_timeout) -> str: """ Basic RPC request Parameters --------- method: str RPC Method to call params: :obj:`list`, optional Parameters for the RPC method endpoint: :obj:`str`, optional Endpoint to send request to timeout: :obj:`int`, optional Timeout in seconds Returns ------- str Raw output from the request Raises ------ TypeError If params is not a list or None RequestsTimeoutError If request timed out RequestsError If other request error occured """ if params is None: params = [] elif not isinstance(params, list): raise TypeError(f'invalid type {params.__class__}') try: payload = { "id": "1", "jsonrpc": "2.0", "method": method, "params": params } headers = { 'Content-Type': 'application/json' } resp = requests.request('POST', endpoint, headers=headers, data=json.dumps(payload), timeout=timeout, allow_redirects=True) return resp.content except requests.exceptions.Timeout as err: raise RequestsTimeoutError(endpoint) from err except requests.exceptions.RequestException as err: raise RequestsError(endpoint) from err def rpc_request(method, params=None, endpoint=_default_endpoint, timeout=_default_timeout) -> dict: """ RPC request Parameters --------- method: str RPC Method to call params: :obj:`list`, optional Parameters for the RPC method endpoint: :obj:`str`, optional Endpoint to send request to timeout: :obj:`int`, optional Timeout in seconds Returns ------- dict Returns dictionary representation of RPC response Example format: { "jsonrpc": "2.0", "id": 1, "result": ... } Raises ------ RPCError If RPC response returned a blockchain error See Also -------- base_request """ raw_resp = base_request(method, params, endpoint, timeout) try: resp = json.loads(raw_resp) if 'error' in resp: raise RPCError(method, endpoint, str(resp['error'])) return resp except json.decoder.JSONDecodeError as err: raise RPCError(method, endpoint, raw_resp) from err # TODO: Add GET requests
[ 1, 1053, 4390, 13, 13, 5215, 7274, 13, 13, 3166, 869, 11739, 29879, 1053, 313, 13, 1678, 10729, 29879, 2392, 29892, 13, 1678, 10729, 29879, 10851, 2392, 29892, 13, 1678, 390, 9026, 2392, 13, 29897, 13, 13, 13, 29918, 4381, 29918, 29734, 353, 525, 1124, 597, 7640, 29901, 29929, 29945, 29900, 29900, 29915, 13, 29918, 4381, 29918, 15619, 353, 29871, 29941, 29900, 13, 13, 13, 1753, 2967, 29918, 3827, 29898, 5696, 29892, 8636, 29922, 8516, 29892, 16248, 29922, 29918, 4381, 29918, 29734, 29892, 11815, 29922, 29918, 4381, 29918, 15619, 29897, 1599, 851, 29901, 13, 1678, 9995, 13, 1678, 19219, 390, 9026, 2009, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 13, 1678, 1158, 29901, 851, 13, 4706, 390, 9026, 8108, 304, 1246, 13, 1678, 8636, 29901, 584, 5415, 18078, 1761, 1673, 13136, 13, 4706, 12662, 2699, 363, 278, 390, 9026, 1158, 13, 1678, 16248, 29901, 584, 5415, 18078, 710, 1673, 13136, 13, 4706, 2796, 3149, 304, 3638, 2009, 304, 13, 1678, 11815, 29901, 584, 5415, 18078, 524, 1673, 13136, 13, 4706, 5974, 449, 297, 6923, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 851, 13, 4706, 22038, 1962, 515, 278, 2009, 13, 13, 1678, 390, 1759, 267, 13, 1678, 448, 23648, 13, 1678, 20948, 13, 4706, 960, 8636, 338, 451, 263, 1051, 470, 6213, 13, 1678, 10729, 29879, 10851, 2392, 13, 4706, 960, 2009, 5335, 287, 714, 13, 1678, 10729, 29879, 2392, 13, 4706, 960, 916, 2009, 1059, 2179, 2955, 13, 1678, 9995, 13, 1678, 565, 8636, 338, 6213, 29901, 13, 4706, 8636, 353, 5159, 13, 1678, 25342, 451, 338, 8758, 29898, 7529, 29892, 1051, 1125, 13, 4706, 12020, 20948, 29898, 29888, 29915, 20965, 1134, 426, 7529, 17255, 1990, 1649, 29913, 1495, 13, 13, 1678, 1018, 29901, 13, 4706, 20092, 353, 426, 13, 9651, 376, 333, 1115, 376, 29896, 613, 13, 9651, 376, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 13, 9651, 376, 5696, 1115, 1158, 29892, 13, 9651, 376, 7529, 1115, 8636, 13, 4706, 500, 13, 4706, 9066, 353, 426, 13, 9651, 525, 3916, 29899, 1542, 2396, 525, 6214, 29914, 3126, 29915, 13, 4706, 500, 13, 13, 4706, 4613, 353, 7274, 29889, 3827, 877, 5438, 742, 16248, 29892, 9066, 29922, 13662, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 511, 13, 462, 18884, 11815, 29922, 15619, 29892, 2758, 29918, 17886, 29879, 29922, 5574, 29897, 13, 4706, 736, 4613, 29889, 3051, 13, 1678, 5174, 7274, 29889, 11739, 29879, 29889, 10851, 408, 4589, 29901, 13, 4706, 12020, 10729, 29879, 10851, 2392, 29898, 29734, 29897, 515, 4589, 13, 1678, 5174, 7274, 29889, 11739, 29879, 29889, 3089, 2451, 408, 4589, 29901, 13, 4706, 12020, 10729, 29879, 2392, 29898, 29734, 29897, 515, 4589, 13, 13, 13, 1753, 364, 6739, 29918, 3827, 29898, 5696, 29892, 8636, 29922, 8516, 29892, 16248, 29922, 29918, 4381, 29918, 29734, 29892, 11815, 29922, 29918, 4381, 29918, 15619, 29897, 1599, 9657, 29901, 13, 1678, 9995, 13, 1678, 390, 9026, 2009, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 13, 1678, 1158, 29901, 851, 13, 4706, 390, 9026, 8108, 304, 1246, 13, 1678, 8636, 29901, 584, 5415, 18078, 1761, 1673, 13136, 13, 4706, 12662, 2699, 363, 278, 390, 9026, 1158, 13, 1678, 16248, 29901, 584, 5415, 18078, 710, 1673, 13136, 13, 4706, 2796, 3149, 304, 3638, 2009, 304, 13, 1678, 11815, 29901, 584, 5415, 18078, 524, 1673, 13136, 13, 4706, 5974, 449, 297, 6923, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 9657, 13, 4706, 16969, 8600, 8954, 310, 390, 9026, 2933, 13, 4706, 8741, 3402, 29901, 13, 4706, 426, 13, 9651, 376, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 13, 9651, 376, 333, 1115, 29871, 29896, 29892, 13, 9651, 376, 2914, 1115, 2023, 13, 4706, 500, 13, 13, 1678, 390, 1759, 267, 13, 1678, 448, 23648, 13, 1678, 390, 9026, 2392, 13, 4706, 960, 390, 9026, 2933, 4133, 263, 2908, 14153, 1059, 13, 13, 1678, 2823, 3115, 13, 1678, 448, 26589, 13, 1678, 2967, 29918, 3827, 13, 1678, 9995, 13, 1678, 10650, 29918, 13713, 353, 2967, 29918, 3827, 29898, 5696, 29892, 8636, 29892, 16248, 29892, 11815, 29897, 13, 13, 1678, 1018, 29901, 13, 4706, 4613, 353, 4390, 29889, 18132, 29898, 1610, 29918, 13713, 29897, 13, 4706, 565, 525, 2704, 29915, 297, 4613, 29901, 13, 9651, 12020, 390, 9026, 2392, 29898, 5696, 29892, 16248, 29892, 851, 29898, 13713, 1839, 2704, 25901, 13, 4706, 736, 4613, 13, 1678, 5174, 4390, 29889, 7099, 6119, 29889, 7249, 2772, 401, 2392, 408, 4589, 29901, 13, 4706, 12020, 390, 9026, 2392, 29898, 5696, 29892, 16248, 29892, 10650, 29918, 13713, 29897, 515, 4589, 13, 13, 13, 29937, 14402, 29901, 3462, 12354, 7274, 13, 2 ]
Solutions/gigasecond.py
matthijskrul/PythonExercism
0
120728
<reponame>matthijskrul/PythonExercism<filename>Solutions/gigasecond.py import datetime def add(moment): return moment + datetime.timedelta(seconds=10**9)
[ 1, 529, 276, 1112, 420, 29958, 2922, 386, 823, 808, 29878, 352, 29914, 11980, 1252, 6269, 1608, 29966, 9507, 29958, 13296, 17925, 29914, 29887, 335, 559, 1116, 29889, 2272, 13, 5215, 12865, 13, 13, 13, 1753, 788, 29898, 29885, 2932, 1125, 13, 1678, 736, 3256, 718, 12865, 29889, 9346, 287, 2554, 29898, 23128, 29922, 29896, 29900, 1068, 29929, 29897, 13, 2 ]
lib/send_file.py
collinahn/file_name_changer
1
150898
import requests import json from requests.exceptions import ( ConnectionError, Timeout, HTTPError, ) from lib.json_parser import TextParser from lib.log_gongik import Logger from .__PRIVATE import IP, PORT_API, DOWNLOAD_KEY class LogFileSender(object): def __init__(self, target_file_dir: str) -> None: self.log = Logger() host = IP port = PORT_API self.key = DOWNLOAD_KEY self.server_url: str = f'http://{host}:{port}/api/v1/log-report' self.target_dir: str = target_file_dir def _send_server(self) -> requests.Response or None: try: self.log.INFO(f'putting {self.target_dir} to memory') whole_log_file: str = TextParser(self.target_dir).value self.log.INFO(f'sending {self.target_dir} to server, size = {len(whole_log_file)}') post_data = json.dumps({ 'pw': self.key, 'log': whole_log_file }) return requests.post(self.server_url, data=post_data) except (requests.exceptions.ChunkedEncodingError, ConnectionError, Timeout, HTTPError) as networkerror: self.log.ERROR(f'network error occurred {networkerror}') return None def report(self) -> bool: res = self._send_server() if res.status_code != 200: self.log.ERROR(f'{res.content = }') return False self.log.INFO('log report complete') return True
[ 1, 1053, 7274, 13, 5215, 4390, 13, 3166, 7274, 29889, 11739, 29879, 1053, 313, 13, 1678, 15160, 2392, 29892, 13, 1678, 5974, 449, 29892, 13, 1678, 7331, 2392, 29892, 13, 29897, 13, 13, 3166, 4303, 29889, 3126, 29918, 16680, 1053, 3992, 11726, 13, 3166, 4303, 29889, 1188, 29918, 29887, 549, 638, 1053, 28468, 13, 3166, 869, 1649, 29829, 29963, 3040, 1053, 5641, 29892, 349, 8476, 29918, 8787, 29892, 360, 9806, 29940, 29428, 29918, 10818, 13, 13, 1990, 4522, 2283, 29615, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3646, 29918, 1445, 29918, 3972, 29901, 851, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 1188, 353, 28468, 580, 13, 13, 4706, 3495, 353, 5641, 13, 4706, 2011, 353, 349, 8476, 29918, 8787, 13, 4706, 1583, 29889, 1989, 353, 360, 9806, 29940, 29428, 29918, 10818, 13, 13, 4706, 1583, 29889, 2974, 29918, 2271, 29901, 851, 353, 285, 29915, 1124, 597, 29912, 3069, 6177, 29912, 637, 6822, 2754, 29914, 29894, 29896, 29914, 1188, 29899, 12276, 29915, 13, 4706, 1583, 29889, 5182, 29918, 3972, 29901, 851, 353, 3646, 29918, 1445, 29918, 3972, 13, 13, 1678, 822, 903, 6717, 29918, 2974, 29898, 1311, 29897, 1599, 7274, 29889, 5103, 470, 6213, 29901, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 1188, 29889, 11690, 29898, 29888, 29915, 649, 1259, 426, 1311, 29889, 5182, 29918, 3972, 29913, 304, 3370, 1495, 13, 9651, 3353, 29918, 1188, 29918, 1445, 29901, 851, 353, 3992, 11726, 29898, 1311, 29889, 5182, 29918, 3972, 467, 1767, 13, 9651, 1583, 29889, 1188, 29889, 11690, 29898, 29888, 29915, 29879, 2548, 426, 1311, 29889, 5182, 29918, 3972, 29913, 304, 1923, 29892, 2159, 353, 426, 2435, 29898, 15970, 280, 29918, 1188, 29918, 1445, 2915, 1495, 13, 13, 9651, 1400, 29918, 1272, 353, 4390, 29889, 29881, 17204, 3319, 13, 18884, 525, 29886, 29893, 2396, 1583, 29889, 1989, 29892, 13, 18884, 525, 1188, 2396, 3353, 29918, 1188, 29918, 1445, 13, 9651, 5615, 13, 13, 9651, 736, 7274, 29889, 2490, 29898, 1311, 29889, 2974, 29918, 2271, 29892, 848, 29922, 2490, 29918, 1272, 29897, 13, 4706, 5174, 313, 24830, 29889, 11739, 29879, 29889, 1451, 2960, 287, 14934, 2392, 29892, 15160, 2392, 29892, 5974, 449, 29892, 7331, 2392, 29897, 408, 3564, 2704, 29901, 13, 9651, 1583, 29889, 1188, 29889, 11432, 29898, 29888, 29915, 11618, 1059, 10761, 426, 11618, 2704, 29913, 1495, 13, 9651, 736, 6213, 13, 13, 1678, 822, 3461, 29898, 1311, 29897, 1599, 6120, 29901, 13, 4706, 620, 353, 1583, 3032, 6717, 29918, 2974, 580, 13, 4706, 565, 620, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1583, 29889, 1188, 29889, 11432, 29898, 29888, 29915, 29912, 690, 29889, 3051, 353, 500, 1495, 13, 9651, 736, 7700, 13, 13, 4706, 1583, 29889, 1188, 29889, 11690, 877, 1188, 3461, 4866, 1495, 13, 4706, 736, 5852, 2 ]
temparature.py
Shrijan21/hacktoberfest2021-2
0
164989
<reponame>Shrijan21/hacktoberfest2021-2 print("Choose from below options:") print("1.Celsius to Fahrenheit.") print("2.Fahrenheit to Celsius.") o=int(input("option(1/2):")) if(o==1): c=float(input("Temperature in Celsius:")) f=1.8*(c)+32.0 f=round(f,1) #temperature in fahrenheit precise to 1 decimal place print("Temperature in Fahrenheit:",f) elif(o==2): f=float(input("Temperature in Fahrenheit:")) c=(f-32)/1.8 c=round(c,1) #temperature in celsius precise to 1 decimal place print("Temperature in Celsius:",c) else: print("Choose 1 or 2.")
[ 1, 529, 276, 1112, 420, 29958, 2713, 4927, 273, 29906, 29896, 29914, 29882, 547, 6264, 29613, 29906, 29900, 29906, 29896, 29899, 29906, 13, 2158, 703, 15954, 852, 515, 2400, 3987, 29901, 1159, 13, 2158, 703, 29896, 29889, 29907, 295, 1039, 375, 304, 383, 21446, 6884, 23157, 13, 2158, 703, 29906, 29889, 29943, 21446, 6884, 304, 14227, 1039, 375, 23157, 13, 29877, 29922, 524, 29898, 2080, 703, 3385, 29898, 29896, 29914, 29906, 1125, 5783, 13, 361, 29898, 29877, 1360, 29896, 1125, 13, 1678, 274, 29922, 7411, 29898, 2080, 703, 5776, 546, 1535, 297, 14227, 1039, 375, 29901, 5783, 13, 1678, 285, 29922, 29896, 29889, 29947, 16395, 29883, 7240, 29941, 29906, 29889, 29900, 13, 1678, 285, 29922, 14486, 29898, 29888, 29892, 29896, 29897, 396, 12863, 1535, 297, 285, 21446, 6884, 18378, 304, 29871, 29896, 13677, 2058, 13, 1678, 1596, 703, 5776, 546, 1535, 297, 383, 21446, 6884, 29901, 613, 29888, 29897, 13, 23681, 29898, 29877, 1360, 29906, 1125, 13, 1678, 285, 29922, 7411, 29898, 2080, 703, 5776, 546, 1535, 297, 383, 21446, 6884, 29901, 5783, 13, 1678, 274, 7607, 29888, 29899, 29941, 29906, 6802, 29896, 29889, 29947, 13, 1678, 274, 29922, 14486, 29898, 29883, 29892, 29896, 29897, 396, 12863, 1535, 297, 6432, 1039, 375, 18378, 304, 29871, 29896, 13677, 2058, 13, 1678, 1596, 703, 5776, 546, 1535, 297, 14227, 1039, 375, 29901, 613, 29883, 29897, 13, 2870, 29901, 13, 1678, 1596, 703, 15954, 852, 29871, 29896, 470, 29871, 29906, 23157, 2 ]
old_playground/minimal_induction.py
sterin/pyzz
0
143713
from pyzz import * def not_equal( N, ws1, ws2 ): return disjunction( N, ( w1 ^ w2 for w1, w2 in zip(ws1, ws2) ) ) def not_equal_states(U, i, j): return not_equal( U.F, U[U.N.get_Flops(), i], U[U.N.get_Flops(), j] ) def unique(U): return conjunction( U.F, ( not_equal_states(U, i, j) for i,j in i_lt_j(U.frames) ) ) def induction(N, max): po = disjunction( N, N.get_POs() ) UB = unroll(N, init=True) SB = solver(UB.F) US = unroll(N, unroll=1, init=False) SS = solver(US.F) SS.clause( [ US[~po,0] ] ) for frame in xrange(max): print "Base %5d: "%frame, UB.unroll(1) fbpo = UB[po, frame] rc = SB.solve( [ fbpo ] ) if rc == solver.l_True: print "SAT" return rc elif rc == solver.l_False: print "UNSAT" SB.clause( [ ~fbpo ] ) print "Step %5d: "%frame, US.unroll(1) fspo = US[ po, frame+1 ] rc = SS.solve( [ fspo, unique(US) ] ) if rc == solver.l_True: SS.clause( [~fspo] ) print "SAT" elif rc == solver.l_False: print "UNSAT" return rc return solver.l_Undef print induction( arg_netlist() , 50)
[ 1, 515, 11451, 5617, 1053, 334, 13, 13, 1753, 451, 29918, 11745, 29898, 405, 29892, 16904, 29896, 29892, 16904, 29906, 29871, 1125, 13, 1678, 736, 766, 29926, 651, 29898, 405, 29892, 313, 281, 29896, 6228, 281, 29906, 363, 281, 29896, 29892, 281, 29906, 297, 14319, 29898, 5652, 29896, 29892, 16904, 29906, 29897, 1723, 1723, 13, 13, 1753, 451, 29918, 11745, 29918, 28631, 29898, 29965, 29892, 474, 29892, 432, 1125, 13, 1678, 736, 451, 29918, 11745, 29898, 501, 29889, 29943, 29892, 501, 29961, 29965, 29889, 29940, 29889, 657, 29918, 29943, 417, 567, 3285, 474, 1402, 501, 29961, 29965, 29889, 29940, 29889, 657, 29918, 29943, 417, 567, 3285, 432, 29962, 1723, 13, 13, 1753, 5412, 29898, 29965, 1125, 13, 1678, 736, 9589, 651, 29898, 501, 29889, 29943, 29892, 313, 451, 29918, 11745, 29918, 28631, 29898, 29965, 29892, 474, 29892, 432, 29897, 363, 474, 29892, 29926, 297, 474, 29918, 1896, 29918, 29926, 29898, 29965, 29889, 19935, 29897, 1723, 1723, 13, 13, 1753, 21445, 29898, 29940, 29892, 4236, 1125, 13, 13, 1678, 772, 353, 766, 29926, 651, 29898, 405, 29892, 405, 29889, 657, 29918, 13152, 29879, 580, 1723, 13, 29871, 13, 1678, 501, 29933, 353, 443, 1245, 29898, 29940, 29892, 2069, 29922, 5574, 29897, 13, 1678, 317, 29933, 353, 899, 369, 29898, 7466, 29889, 29943, 29897, 13, 268, 13, 1678, 3148, 353, 443, 1245, 29898, 29940, 29892, 443, 1245, 29922, 29896, 29892, 2069, 29922, 8824, 29897, 13, 1678, 5886, 353, 899, 369, 29898, 3308, 29889, 29943, 29897, 13, 13, 1678, 5886, 29889, 16398, 1509, 29898, 518, 3148, 29961, 30022, 1129, 29892, 29900, 29962, 4514, 1723, 13, 268, 13, 1678, 363, 3515, 297, 921, 3881, 29898, 3317, 1125, 13, 308, 13, 4706, 1596, 376, 5160, 1273, 29945, 29881, 29901, 11860, 2557, 29892, 13, 308, 13, 4706, 501, 29933, 29889, 348, 1245, 29898, 29896, 29897, 13, 268, 13, 4706, 285, 29890, 1129, 353, 501, 29933, 29961, 1129, 29892, 3515, 29962, 13, 268, 13, 4706, 364, 29883, 353, 317, 29933, 29889, 2929, 345, 29898, 518, 285, 29890, 1129, 4514, 1723, 13, 308, 13, 4706, 565, 364, 29883, 1275, 899, 369, 29889, 29880, 29918, 5574, 29901, 13, 9651, 1596, 376, 29903, 1299, 29908, 13, 9651, 736, 364, 29883, 13, 632, 13, 4706, 25342, 364, 29883, 1275, 899, 369, 29889, 29880, 29918, 8824, 29901, 13, 9651, 1596, 376, 29965, 3059, 1299, 29908, 13, 9651, 317, 29933, 29889, 16398, 1509, 29898, 518, 3695, 14943, 1129, 4514, 1723, 13, 13, 4706, 1596, 376, 14448, 1273, 29945, 29881, 29901, 11860, 2557, 29892, 13, 308, 13, 4706, 3148, 29889, 348, 1245, 29898, 29896, 29897, 13, 308, 13, 4706, 285, 1028, 29877, 353, 3148, 29961, 772, 29892, 3515, 29974, 29896, 4514, 13, 268, 13, 4706, 364, 29883, 353, 5886, 29889, 2929, 345, 29898, 518, 285, 1028, 29877, 29892, 5412, 29898, 3308, 29897, 4514, 1723, 13, 308, 13, 4706, 565, 364, 29883, 1275, 899, 369, 29889, 29880, 29918, 5574, 29901, 13, 9651, 5886, 29889, 16398, 1509, 29898, 518, 30022, 29888, 1028, 29877, 29962, 1723, 13, 9651, 1596, 376, 29903, 1299, 29908, 13, 632, 13, 4706, 25342, 364, 29883, 1275, 899, 369, 29889, 29880, 29918, 8824, 29901, 13, 9651, 1596, 376, 29965, 3059, 1299, 29908, 13, 9651, 736, 364, 29883, 13, 13, 1678, 736, 899, 369, 29889, 29880, 29918, 25263, 1389, 13, 268, 13, 13, 2158, 21445, 29898, 1852, 29918, 1212, 1761, 580, 1919, 29871, 29945, 29900, 29897, 13, 2 ]
valida/errors.py
hpcflow/valida
0
1614863
class RuleValidationFailure: def __init__( self, rule, ): pass class DuplicateRule(Exception): pass class IncompatibleRules(Exception): pass class ValidationError(Exception): pass class InvalidCallable(Exception): pass class MalformedConditionLikeSpec(Exception): pass class MalformedContainerItemSpec(Exception): pass class MalformedDataPathSpec(Exception): pass class MalformedRuleSpec(Exception): pass
[ 1, 770, 27308, 19448, 24155, 29901, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 5751, 29892, 13, 268, 1125, 13, 4706, 1209, 13, 13, 13, 1990, 18733, 5926, 10740, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 512, 23712, 29934, 2540, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 15758, 362, 2392, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 21403, 5594, 519, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 3792, 15628, 25255, 27552, 10299, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 3792, 15628, 7895, 2001, 10299, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 3792, 15628, 1469, 2605, 10299, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 13, 1990, 3792, 15628, 10740, 10299, 29898, 2451, 1125, 13, 1678, 1209, 13, 2 ]
jupyter/password.py
panchohumeres/state-of-open-data
4
170265
from notebook.auth import passwd import os PASSWORD=os.environ['PASSWORD'] with open('/tmp/sha1-psswd', 'w') as f: f.write(passwd(PASSWORD))
[ 1, 515, 451, 19273, 29889, 5150, 1053, 1209, 9970, 13, 5215, 2897, 13, 13, 25711, 17013, 29922, 359, 29889, 21813, 1839, 25711, 17013, 2033, 13, 13, 2541, 1722, 11219, 7050, 29914, 17051, 29896, 29899, 567, 2774, 29881, 742, 525, 29893, 1495, 408, 285, 29901, 13, 1678, 285, 29889, 3539, 29898, 3364, 9970, 29898, 25711, 17013, 876, 2 ]
modeling/src/load_data.py
alyildiz/covid_19_xray
0
41043
<reponame>alyildiz/covid_19_xray from sklearn.model_selection import train_test_split from src.utils import load_dataset def get_data(): train_list_file, train_list_class = load_dataset(data_part="train") test_x, test_y = load_dataset(data_part="test") train_x, val_x, train_y, val_y = train_test_split( train_list_file, train_list_class, stratify=train_list_class, test_size=0.3 ) return train_x, val_x, test_x, train_y, val_y, test_y
[ 1, 529, 276, 1112, 420, 29958, 14997, 789, 466, 29914, 24542, 333, 29918, 29896, 29929, 29918, 29916, 764, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 7945, 29918, 1688, 29918, 5451, 13, 3166, 4765, 29889, 13239, 1053, 2254, 29918, 24713, 13, 13, 13, 1753, 679, 29918, 1272, 7295, 13, 1678, 7945, 29918, 1761, 29918, 1445, 29892, 7945, 29918, 1761, 29918, 1990, 353, 2254, 29918, 24713, 29898, 1272, 29918, 1595, 543, 14968, 1159, 13, 1678, 1243, 29918, 29916, 29892, 1243, 29918, 29891, 353, 2254, 29918, 24713, 29898, 1272, 29918, 1595, 543, 1688, 1159, 13, 13, 1678, 7945, 29918, 29916, 29892, 659, 29918, 29916, 29892, 7945, 29918, 29891, 29892, 659, 29918, 29891, 353, 7945, 29918, 1688, 29918, 5451, 29898, 13, 4706, 7945, 29918, 1761, 29918, 1445, 29892, 7945, 29918, 1761, 29918, 1990, 29892, 26742, 1598, 29922, 14968, 29918, 1761, 29918, 1990, 29892, 1243, 29918, 2311, 29922, 29900, 29889, 29941, 13, 1678, 1723, 13, 13, 1678, 736, 7945, 29918, 29916, 29892, 659, 29918, 29916, 29892, 1243, 29918, 29916, 29892, 7945, 29918, 29891, 29892, 659, 29918, 29891, 29892, 1243, 29918, 29891, 13, 2 ]
Exercicios - Mundo1/Ex023.py
BrianMath/ExerciciosPythonCeV
0
57794
# Ex. 023 num = str(input("Digite um número: ")) # .zfill(4) -> preenche com 0 até completar 4 casas while len(num) < 4: num = "0" + num print("Unidade: ", num[3]) print("Dezena: ", num[2]) print("Centena: ", num[1]) print("Unidade de milhar: ", num[0])
[ 1, 396, 1222, 29889, 29871, 29900, 29906, 29941, 13, 13, 1949, 353, 851, 29898, 2080, 703, 14991, 568, 1922, 13831, 29901, 376, 876, 29871, 396, 869, 29920, 5589, 29898, 29946, 29897, 1599, 758, 264, 1173, 419, 29871, 29900, 16659, 3315, 279, 29871, 29946, 3209, 294, 13, 8000, 7431, 29898, 1949, 29897, 529, 29871, 29946, 29901, 13, 1678, 954, 353, 376, 29900, 29908, 718, 954, 13, 2158, 703, 2525, 5558, 29901, 9162, 954, 29961, 29941, 2314, 13, 2158, 703, 2772, 2256, 29874, 29901, 9162, 954, 29961, 29906, 2314, 13, 2158, 703, 23369, 2386, 29901, 9162, 954, 29961, 29896, 2314, 13, 2158, 703, 2525, 5558, 316, 2316, 8222, 29901, 9162, 954, 29961, 29900, 2314, 13, 2 ]
dotnet.py
rrezartbuzhala/ca-cloner
0
111293
import os import sys import shutil import constants from os import path from helpers import read_config app_name = sys.argv[1] #Copying the template try: src = 'templates/'+ sys.argv[2] except: src = 'templates/' + read_config(constants.default_template) dir_dest = read_config("DESTINATION_OUTPUT") + "\\" dest = dir_dest + app_name+'/' shutil.copytree(src, dest) project_dir = dest project_dir_src = project_dir + 'src/' os.chdir(project_dir) file_ext = lambda file : os.path.splitext(file)[1] def change_keywords_in_file(filepath): file = open(filepath,'r') filedata = file.read() file.close() newdata = filedata.replace(constants.keyword,app_name) file = open(filepath,'w') file.write(newdata) file.close() def change_files_rec(current_path): for i in os.listdir(current_path): new_name = i if constants.keyword in i: new_name = i.replace(constants.keyword,app_name) os.rename(current_path+i,current_path+new_name) if path.isfile(current_path+new_name): change_keywords_in_file(current_path+new_name) else: change_files_rec(current_path+new_name+'/') #Recuresively changing all solution name references for all files change_files_rec(project_dir) print('Application created at: '+dest) print("Enjoy codeing")
[ 1, 1053, 2897, 13, 5215, 10876, 13, 5215, 528, 4422, 13, 5215, 17727, 13, 3166, 2897, 1053, 2224, 13, 3166, 1371, 414, 1053, 1303, 29918, 2917, 13, 13, 932, 29918, 978, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 13, 13, 29937, 11882, 292, 278, 4472, 13, 2202, 29901, 13, 259, 4765, 353, 525, 20943, 29914, 18717, 10876, 29889, 19218, 29961, 29906, 29962, 13, 19499, 29901, 13, 1678, 4765, 353, 525, 20943, 22208, 718, 1303, 29918, 2917, 29898, 3075, 1934, 29889, 4381, 29918, 6886, 29897, 13, 268, 13, 3972, 29918, 7854, 353, 1303, 29918, 2917, 703, 2287, 1254, 1177, 8098, 29918, 12015, 12336, 1159, 718, 376, 1966, 29908, 13, 7854, 353, 4516, 29918, 7854, 718, 623, 29918, 978, 23097, 22208, 13, 845, 4422, 29889, 8552, 8336, 29898, 4351, 29892, 2731, 29897, 29871, 13, 13, 13, 4836, 29918, 3972, 353, 2731, 13, 4836, 29918, 3972, 29918, 4351, 353, 2060, 29918, 3972, 718, 525, 4351, 22208, 13, 359, 29889, 305, 3972, 29898, 4836, 29918, 3972, 29897, 13, 13, 1445, 29918, 1062, 353, 14013, 934, 584, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 1445, 9601, 29896, 29962, 13, 13, 13, 1753, 1735, 29918, 1989, 9303, 29918, 262, 29918, 1445, 29898, 1445, 2084, 1125, 13, 1678, 934, 353, 1722, 29898, 1445, 2084, 5501, 29878, 1495, 13, 1678, 934, 1272, 353, 934, 29889, 949, 580, 13, 1678, 934, 29889, 5358, 580, 13, 13, 1678, 716, 1272, 353, 934, 1272, 29889, 6506, 29898, 3075, 1934, 29889, 26766, 29892, 932, 29918, 978, 29897, 13, 13, 1678, 934, 353, 1722, 29898, 1445, 2084, 5501, 29893, 1495, 13, 1678, 934, 29889, 3539, 29898, 1482, 1272, 29897, 13, 1678, 934, 29889, 5358, 580, 13, 13, 1753, 1735, 29918, 5325, 29918, 3757, 29898, 3784, 29918, 2084, 1125, 13, 1678, 363, 474, 297, 2897, 29889, 1761, 3972, 29898, 3784, 29918, 2084, 1125, 13, 4706, 716, 29918, 978, 353, 474, 13, 4706, 565, 17727, 29889, 26766, 297, 474, 29901, 13, 9651, 716, 29918, 978, 353, 474, 29889, 6506, 29898, 3075, 1934, 29889, 26766, 29892, 932, 29918, 978, 29897, 13, 9651, 2897, 29889, 1267, 420, 29898, 3784, 29918, 2084, 29974, 29875, 29892, 3784, 29918, 2084, 29974, 1482, 29918, 978, 29897, 13, 4706, 565, 2224, 29889, 275, 1445, 29898, 3784, 29918, 2084, 29974, 1482, 29918, 978, 1125, 13, 9651, 1735, 29918, 1989, 9303, 29918, 262, 29918, 1445, 29898, 3784, 29918, 2084, 29974, 1482, 29918, 978, 29897, 13, 4706, 1683, 29901, 13, 9651, 1735, 29918, 5325, 29918, 3757, 29898, 3784, 29918, 2084, 29974, 1482, 29918, 978, 23097, 29914, 1495, 13, 13, 13, 29937, 4789, 1973, 3598, 6480, 599, 1650, 1024, 9282, 363, 599, 2066, 13, 3167, 29918, 5325, 29918, 3757, 29898, 4836, 29918, 3972, 29897, 13, 13, 2158, 877, 4873, 2825, 472, 29901, 525, 29974, 7854, 29897, 13, 2158, 703, 2369, 2212, 29891, 775, 292, 1159, 13, 2 ]
buzzmobile/tools/image_const/image_const.py
gtagency/buzzmobile
25
138176
<gh_stars>10-100 #!/usr/bin/env python """image_const: node that continuously publishes a given image from file. Publishes: image_filename Image with topic name same as file name """ from __future__ import print_function # TODO(irapha): remove this when #126 is fixed. import sys import rospy import cv2 from cv_bridge import CvBridge from sensor_msgs.msg import Image bridge = CvBridge() def continuously_publish_image(image_filename): """Publishes the image given at a constant rate.""" cv2_img = cv2.imread(image_filename) gray_im = cv2.cvtColor(cv2_img, cv2.COLOR_BGR2GRAY) img_msg = bridge.cv2_to_imgmsg(gray_im, encoding="mono8") topic_name = sys.argv[1].split('/')[-1][:-4] pub = rospy.Publisher(topic_name, Image, queue_size=1) rospy.init_node('image_const', anonymous=True) rate = rospy.Rate(1) # 1hz while not rospy.is_shutdown(): pub.publish(img_msg) rate.sleep() if __name__ == '__main__': if len(sys.argv) < 2: print("Please provide a image filename") else: continuously_publish_image(sys.argv[1])
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 3027, 29918, 3075, 29901, 2943, 393, 3133, 5794, 9805, 267, 263, 2183, 1967, 515, 934, 29889, 13, 13, 21076, 1674, 267, 29901, 13, 1678, 1967, 29918, 9507, 7084, 411, 11261, 1024, 1021, 408, 934, 1024, 13, 15945, 29908, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 29937, 14402, 29898, 29875, 1140, 29874, 1125, 3349, 445, 746, 396, 29896, 29906, 29953, 338, 4343, 29889, 13, 13, 5215, 10876, 13, 5215, 696, 1028, 29891, 13, 5215, 13850, 29906, 13, 13, 3166, 13850, 29918, 18419, 1053, 315, 29894, 29933, 8605, 13, 3166, 23530, 29918, 1516, 3174, 29889, 7645, 1053, 7084, 13, 13, 13, 18419, 353, 315, 29894, 29933, 8605, 580, 13, 13, 13, 1753, 3133, 5794, 29918, 23679, 29918, 3027, 29898, 3027, 29918, 9507, 1125, 13, 1678, 9995, 21076, 1674, 267, 278, 1967, 2183, 472, 263, 4868, 6554, 1213, 15945, 13, 1678, 13850, 29906, 29918, 2492, 353, 13850, 29906, 29889, 326, 949, 29898, 3027, 29918, 9507, 29897, 13, 1678, 16749, 29918, 326, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 11023, 29906, 29918, 2492, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 1678, 10153, 29918, 7645, 353, 12945, 29889, 11023, 29906, 29918, 517, 29918, 2492, 7645, 29898, 21012, 29918, 326, 29892, 8025, 543, 29885, 3231, 29947, 1159, 13, 13, 1678, 11261, 29918, 978, 353, 10876, 29889, 19218, 29961, 29896, 1822, 5451, 11219, 1495, 14352, 29896, 3816, 13018, 29946, 29962, 13, 1678, 2529, 353, 696, 1028, 29891, 29889, 21076, 1674, 261, 29898, 13010, 29918, 978, 29892, 7084, 29892, 9521, 29918, 2311, 29922, 29896, 29897, 13, 13, 1678, 696, 1028, 29891, 29889, 2344, 29918, 3177, 877, 3027, 29918, 3075, 742, 21560, 29922, 5574, 29897, 13, 13, 1678, 6554, 353, 696, 1028, 29891, 29889, 19907, 29898, 29896, 29897, 396, 29871, 29896, 29882, 29920, 13, 13, 1678, 1550, 451, 696, 1028, 29891, 29889, 275, 29918, 845, 329, 3204, 7295, 13, 4706, 2529, 29889, 23679, 29898, 2492, 29918, 7645, 29897, 13, 4706, 6554, 29889, 17059, 580, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 565, 7431, 29898, 9675, 29889, 19218, 29897, 529, 29871, 29906, 29901, 13, 4706, 1596, 703, 12148, 3867, 263, 1967, 10422, 1159, 13, 1678, 1683, 29901, 13, 4706, 3133, 5794, 29918, 23679, 29918, 3027, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 2 ]
test/test_examples.py
VDBWRAIR/pyjip
18
151065
#!/usr/bin/env python """Test some of the examples pipelines and tools""" import os import jip import unittest import jip.tools class BWAPipelineTest(unittest.TestCase): def testPipelineStructure(self): # load the pipeline tool = jip.find("examples/bwa/pileup.jip") assert tool is not None # create a pipeline p = jip.Pipeline() # create a new pipeline node and configure id p.run(tool, input="setup.py", reference="Makefile", output="out.txt") # expand the pipeline such that the internal pipeline is resolved p.expand(validate=False) # after expansion with this setuo, the pipeline should have 7 nodes assert len(p) == 7 # the graph should consist of 6 edges assert len(p.edges) == 6 # get out the nodes. we have to use indexes here # because the names might have changed after expansion ref = p.get("ref") align = p.get("align") sam = p.get("sam") bam = p.get("bam") dups = p.get("dups") index = p.get("index") pileup = p.get("pileup") # check the connections assert not ref.has_incoming() assert align.has_incoming(ref) assert sam.has_incoming(align) assert bam.has_incoming(sam) assert dups.has_incoming(bam) assert index.has_incoming(dups) assert pileup.has_incoming(index) assert not pileup.has_outgoing() def testPipelineStructureMultiplexed(self): # load the pipeline tool = jip.find("examples/bwa/pileup.jip") assert tool is not None # create a pipeline p = jip.Pipeline() # create a new pipeline node and configure id p.run(tool, input=["setup.py", "README.rst"], reference="Makefile", output="${input|ext}_out.txt") # expand the pipeline such that the internal pipeline is resolved # this will also validate all nodes and raise an exception # if one of the nodes validations failed p.expand(validate=False) # after expansion with this setuo, the pipeline should have 7 nodes assert len(p) == 13 # the graph should consist of 6 edges assert len(p.edges) == 12 # get out the nodes. we have to use indexes here # because the names might have changed after expansion ref = p.get("ref") align = p.get("align.0") sam = p.get("sam.0") bam = p.get("bam.0") dups = p.get("dups.0") index = p.get("index.0") pileup = p.get("pileup.0") # check the connections assert not ref.has_incoming() assert align.has_incoming(ref) assert sam.has_incoming(align) assert bam.has_incoming(sam) assert dups.has_incoming(bam) assert index.has_incoming(dups) assert pileup.has_incoming(index) assert not pileup.has_outgoing() # test second set ref = p.get("ref") align = p.get("align.1") sam = p.get("sam.1") bam = p.get("bam.1") dups = p.get("dups.1") index = p.get("index.1") pileup = p.get("pileup.1") # check the connections assert not ref.has_incoming() assert align.has_incoming(ref) assert sam.has_incoming(align) assert bam.has_incoming(sam) assert dups.has_incoming(bam) assert index.has_incoming(dups) assert pileup.has_incoming(index) assert not pileup.has_outgoing() @jip.tool('gem_index') class GemIndex(object): """ The GEM Indexer tool Usage: gem_index -i <genome> [-o <genome_index>] [-t <threads>] [--no-hash] Options: --help Show this help message -o, --output-dir <output_dir> The folder where the output GEM index is created -t, --threads <threads> The number of execution threads [default: 1] --no-hash Do not produce the hash file [default: false] Inputs: -i, --input <genome> The fasta file for the genome """ def init(self): self.add_output('output', "${input|name|ext}.gem") def setup(self): out = "${input|name|ext}.gem" if self.options['output_dir']: out = "${output_dir}/" + out self.options['output'].set(out) def get_command(self): return "gemtools index -i ${input} -o ${output} -t ${threads} "\ "${no_hash|arg}" @jip.tool('gem_t_index') class GemTranscriptomeIndex(object): """ The GEM Transcrptome Indexer tool Usage: gem_t_index -i <genome_index> -a <annotation> [-m <max_read_length>] [-o <output_folder>] [-p <output_prefix>] [-t <threads>] Options: --help Show this help message -o, --output-dir <output_dir> The folder where the output files are created [default: ${annotation|parent}] -p, --prefix <output_prefix> The name to be used for the output files [default: ${annotation|name}] -t, --threads <threads> The number of execution threads [default: 1] -m, --max-length <max_read_length> Maximum read length [default: 150] Inputs: -i, --index <genome_index> The GEM index file for the genome -a, --annotation <annotation> The reference annotation in GTF format """ def init(self): #if not self.options['output_dir']: # self.options['output_dir'] = "." #if not self.options['prefix']: # self.options['prefix'] = "${annotation}" self.add_output('gem', "${output_dir}/${prefix}.junctions.gem") self.add_output('keys', "${output_dir}/${prefix}.junctions.keys") def get_command(self): return 'bash', 'gemtools t-index -i ${index} -a ${annotation} ' \ '-o ${output_dir|abs}/${prefix} -t ${threads} ' \ '-m ${max_length}' def test_gemtools_index_command_rendering_for_options(): p = jip.Pipeline() p.run('gem_index', input="Makefile", output_dir='test') p.expand(validate=True) node = p.get('gem_index') print node._tool.options job = jip.create_jobs(p)[0] infile = os.path.abspath("Makefile") base = os.path.dirname(infile) print ">>>", job.command assert job.command == 'gemtools index -i %s -o %s.gem -t 1 ' % ( infile, os.path.join(base, "test/Makefile")) outfiles = list(job.get_output_files()) assert len(outfiles) == 1 assert outfiles[0] == os.path.join(base, "test/Makefile.gem") def test_gemtools_t_index_inputs(): p = jip.Pipeline() p.run('gem_t_index', index="Makefile", annotation='setup.py', output_dir='test') p.expand(validate=False) job = jip.create_jobs(p)[0] infile = os.path.abspath("Makefile") annotation = os.path.abspath("setup.py") base = os.path.dirname(infile) print ">>>", job.command assert job.command == 'gemtools t-index -i %s -a %s -o %s -t 1 -m 150' % ( infile, annotation, os.path.join(base, "test/setup.py")) outfiles = list(job.get_output_files()) assert len(outfiles) == 2 assert outfiles[0] == os.path.join(base, "test/setup.py.junctions.gem") assert outfiles[1] == os.path.join(base, "test/setup.py.junctions.keys") @jip.tool('grape_gem_rnatool') class gem(object): """ The GEMTools RNAseq Mapping Pipeline Usage: gem -f <fastq_file>... -i <genome_index> -a <annotation> -q <quality> [-n <name>] [-o <output_dir>] [-t <threads>] Options: --help Show this help message -q, --quality <quality> The fastq offset quality -n, --name <name> The output prefix name [default: ${fastq.raw()[0]|name|ext|ext|re("_[12]","")}] -o, --output-dir <output_dir> The output folder -t, --threads <threads> The number of execution threads [default: 1] Inputs: -f, --fastq <fastq_file>... The input fastq -i, --index <genome_index> The GEM index file for the genome -a, --annotation <annotation> The reference annotation in GTF format """ def init(self): self.add_output('map', "${output_dir}/${name}.map.gz") self.add_output('bam', "${output_dir}/${name}.bam") self.add_output('bai', "${output_dir}/${name}.bam.bai") self.add_option('single_end', False, long="--single-end", hidden=False) def setup(self): if len(self.fastq) == 1: self.options['single_end'].set(True) def get_command(self): return 'bash', 'gemtools rna-pipeline ${options()}' @jip.tool('grape_flux') class flux(object): """ The Flux Capacitor Usage: flux -i <input> -a <annotation> [-o <output_dir>] Options: --help Show this help message -o, --output-dir <output_dir> The output folder Inputs: -i, --input <input> The input file with mappings -a, --annotation <annotation> The reference annotation in GTF format """ def init(self): self.add_option('name', "${input|name|ext}") self.add_output('gtf', "${output_dir}/${name}.gtf") def get_command(self): return 'bash', 'flux-capacitor ${options()}' @jip.pipeline('grape_gem_rnapipeline') class GrapePipeline(object): """ Run the default RNAseq pipeline usage: rnaseq -f <fastq_file>... -q <quality> -i <genome_index> -a <annotation> [-o <output_dir>] Inputs: -f, --fastq <fastq_file>... The input reference genome -i, --index <genome_index> The input reference genome -a, --annotation <annotation The input reference annotation Options: -q, --quality <quality> The fatq offset quality [default: 33] -o, --output-dir <output_dir> The output prefix [default: ${fastq.raw()[0]|abs|parent}] """ def pipeline(self): p = jip.Pipeline() gem = p.run( 'grape_gem_rnatool', index=self.index, annotation=self.annotation, fastq=self.fastq, quality=self.quality, output_dir=self.output_dir ) p.run( 'grape_flux', input=gem.bam, annotation=self.annotation, output_dir=self.output_dir ) p.context(locals()) return p def test_gem_name_option_delegation(): p = jip.Pipeline() p.run('grape_gem_rnapipeline', fastq='reads_1.fastq.gz', index='index.gem', annotation='gencode.gtf') jobs = jip.create_jobs(p, validate=False) ldir = os.getcwd() j = os.path.join assert len(jobs) == 2 assert jobs[0].configuration['index'].get() == j(ldir, 'index.gem') assert jobs[0].configuration['fastq'].get() == j(ldir, 'reads_1.fastq.gz') assert jobs[0].configuration['annotation'].get() == j(ldir, 'gencode.gtf') assert jobs[0].configuration['quality'].get() == '33' assert jobs[0].configuration['output_dir'].get() == ldir assert jobs[0].configuration['name'].get() == 'reads' assert jobs[0].configuration['bam'].get() == j(ldir, 'reads.bam') assert jobs[0].configuration['bai'].get() == j(ldir, 'reads.bam.bai') assert jobs[0].configuration['map'].get() == j(ldir, 'reads.map.gz') assert jobs[1].configuration['input'].get() == j(ldir, 'reads.bam') assert jobs[1].configuration['name'].get() == 'reads' assert jobs[1].configuration['annotation'].get() == j(ldir, 'gencode.gtf') assert jobs[1].configuration['output_dir'].get() == ldir assert jobs[1].configuration['gtf'].get() == j(ldir, 'reads.gtf') assert len(jobs[0].children) == 1 assert len(jobs[1].dependencies) == 1 assert jobs[0].children[0] == jobs[1] def test_gem_name_option_delegation_with_output_dir(): p = jip.Pipeline() p.run('grape_gem_rnapipeline', fastq='reads_1.fastq.gz', index='index.gem', annotation='gencode.gtf', output_dir="mydir") jobs = jip.create_jobs(p, validate=False) ldir = os.getcwd() j = os.path.join assert len(jobs) == 2 assert jobs[0].configuration['index'].get() == j(ldir, 'index.gem') assert jobs[0].configuration['fastq'].get() == j(ldir, 'reads_1.fastq.gz') assert jobs[0].configuration['annotation'].get() == j(ldir, 'gencode.gtf') assert jobs[0].configuration['quality'].get() == '33' assert jobs[0].configuration['output_dir'].get() == "mydir" assert jobs[0].configuration['name'].get() == 'reads' assert jobs[0].configuration['bam'].get() == j(ldir, 'mydir/reads.bam') assert jobs[0].configuration['bai'].get() == j(ldir, 'mydir/reads.bam.bai') assert jobs[0].configuration['map'].get() == j(ldir, 'mydir/reads.map.gz') assert jobs[1].configuration['input'].get() == j(ldir, 'mydir/reads.bam') assert jobs[1].configuration['name'].get() == 'reads' assert jobs[1].configuration['annotation'].get() == j(ldir, 'gencode.gtf') assert jobs[1].configuration['output_dir'].get() == "mydir" assert jobs[1].configuration['gtf'].get() == j(ldir, 'mydir/reads.gtf') assert len(jobs[0].children) == 1 assert len(jobs[1].dependencies) == 1 assert jobs[0].children[0] == jobs[1] def test_multiple_pipelines_with_delegated_outputs(): @jip.tool('grape_gem_index') class GemIndex(object): """\ The GEM Indexer tool Usage: gem_index -i <genome> [-o <genome_index>] Options: -o, --output <genome_index> The output GEM index file [default: ${input|ext}.gem] -i, --input <genome> The fasta file for the genome """ def get_command(self): return "bash", "gemtools index ${options()}" @jip.tool('grape_gem_rnatool') class gem(object): """\ The GEMtools RNAseq Mapping Pipeline Usage: gem -f <fastq_file> -i <genome_index> Inputs: -f, --fastq <fastq_file> The input fastq -i, --index <genome_index> The GEM index file for the genome """ def get_command(self): return 'bash', 'gemtools rna-pipeline ${options()}' @jip.pipeline('grape_gem_setup') class SetupPipeline(object): """\ The GEM indexes setup pipeline usage: setup -i <genome> Options: -i, --input <genome> The input reference genome """ def init(self): self.add_output('index', '${input|ext}.gem') def pipeline(self): p = jip.Pipeline() index = p.run('grape_gem_index', input=self.input, output=self.index) p.context(locals()) return p @jip.pipeline('grape_gem_rnapipeline') class GrapePipeline(object): """\ The default GRAPE RNAseq pipeline usage: rnaseq -f <fastq_file> -g <genome> Inputs: -f, --fastq <fastq_file> The input reference genome -g, --genome <genome_index> The input reference genome """ def pipeline(self): p = jip.Pipeline() gem_setup = p.run('grape_gem_setup', input=self.genome) gem = p.run('grape_gem_rnatool', index=gem_setup.index, fastq=self.fastq) p.context(locals()) return p p = jip.Pipeline() node = p.run('grape_gem_rnapipeline') node.fastq = 'reads_1.fastq.gz' node.genome = 'genome.fa' jobs = jip.create_jobs(p, validate=False) assert len(jobs) == 2 gem_job = filter(lambda x: x.name == 'gem', jobs)[0] assert gem_job is not None assert gem_job.configuration['index'].get().endswith('genome.gem') def test_embedded_pipelines_stage_one(tmpdir): tmpdir = str(tmpdir) # laod teh embedded example jip.scanner.add_module('examples/embedded_submission/embedded.py') jip.scanner.scan_modules() p = jip.Pipeline() p.job(dir=tmpdir).run('example_embedded') jobs = jip.create_jobs(p) assert jobs[0].configuration['prefix'] == 'test' assert jobs[0].configuration['output'] == [ os.path.join(tmpdir, 'test.*') ] assert len(jobs) == 1 def test_embedded_pipelines_stage_two(tmpdir): tmpdir = str(tmpdir) # create stage one output open(os.path.join(tmpdir, 'test.1'), 'a').close() open(os.path.join(tmpdir, 'test.2'), 'a').close() open(os.path.join(tmpdir, 'test.3'), 'a').close() open(os.path.join(tmpdir, 'test.4'), 'a').close() open(os.path.join(tmpdir, 'test.5'), 'a').close() # laod teh embedded example jip.scanner.add_module('examples/embedded_submission/embedded.py') jip.scanner.scan_modules() p = jip.Pipeline() p.job(dir=tmpdir).run('example_embedded') jobs = jip.create_jobs(p) assert len(jobs) == 8 assert jobs[0].configuration['prefix'] == 'test' print ">>>OUTPUT", jobs[0].configuration['output'].raw() print ">>>TMPDIR", tmpdir assert jobs[0].configuration['output'] == [ os.path.join(tmpdir, 'test.1'), os.path.join(tmpdir, 'test.2'), os.path.join(tmpdir, 'test.3'), os.path.join(tmpdir, 'test.4'), os.path.join(tmpdir, 'test.5'), ] assert jobs[1].configuration['input'] == os.path.join(tmpdir, 'test.1') assert jobs[2].configuration['input'] == os.path.join(tmpdir, 'test.2') assert jobs[3].configuration['input'] == os.path.join(tmpdir, 'test.3') assert jobs[4].configuration['input'] == os.path.join(tmpdir, 'test.4') assert jobs[5].configuration['input'] == os.path.join(tmpdir, 'test.5') print jobs[6].configuration['input'].raw() assert jobs[6].configuration['input'] == [ os.path.join(tmpdir, 'consumed_test.1'), os.path.join(tmpdir, 'consumed_test.2'), os.path.join(tmpdir, 'consumed_test.3'), os.path.join(tmpdir, 'consumed_test.4'), os.path.join(tmpdir, 'consumed_test.5'), ] def test_dynamic_options(): script = '''#!/usr/bin/env jip # Touch a number of files with a common prefix # # usage: # touch --prefix <prefix> --count <count> #%begin init add_output('output') #%end #%begin setup options['output'].set(["%s_%s" % (prefix, i) for i in range(1, count.get(int) + 1)]) #%end #%begin command for x in ${output}; do touch $x done ''' tool = jip.tools.ScriptTool.from_string(script) tool.init() assert tool is not None p = jip.Pipeline() node = p.job('test').run(tool, prefix='test', count=5) assert node is not None p.expand() assert len(p) == 1 node = p.get('test') assert node.prefix == 'test' cwd = os.getcwd() assert node.output == [os.path.join(cwd, x) for x in ['test_1', 'test_2', 'test_3', 'test_4', 'test_5']] def test_dynamic_options_multiplex(): script = '''#!/usr/bin/env jip # Touch a number of files with a common prefix # # usage: # touch --prefix <prefix> --count <count> #%begin init add_output('output') #%end #%begin setup options['output'].set(["%s_%s" % (prefix, i) for i in range(1, count.get(int) + 1)]) #%end #%begin command for x in ${output}; do touch $x done ''' tool = jip.tools.ScriptTool.from_string(script) tool.init() assert tool is not None p = jip.Pipeline() node = p.job('test').run(tool, prefix='test', count=[1, 2]) assert node is not None p.expand() cwd = os.getcwd() assert len(p) == 2 node_1 = p.get('test.0') node_2 = p.get('test.1') assert node_1.output == os.path.join(cwd, 'test_1') assert node_2.output == [os.path.join(cwd, x) for x in ['test_1', 'test_2']] def test_hello_world_py_fun(tmpdir): tmpdir = str(tmpdir) jip.scanner.add_module('examples/hello_world/hello_world.py') jip.scanner.scan_modules() p = jip.Pipeline() p.job(dir=tmpdir).run('fun_hello_world_py') jobs = jip.create_jobs(p) assert len(jobs) == 1 def test_hello_world_py_cls(tmpdir): tmpdir = str(tmpdir) jip.scanner.add_module('examples/hello_world/hello_world.py') jip.scanner.scan_modules() p = jip.Pipeline() p.job(dir=tmpdir).run('cls_hello_world_py') jobs = jip.create_jobs(p) assert len(jobs) == 1 def test_file_touch(): p = jip.Pipeline() node = p.run('examples/file_touch.jip', p='test', c=5) p.expand() cwd = os.getcwd() j = os.path.join assert node.output == [ j(cwd, 'test_' + x) for x in ['1', '2', '3', '4', '5'] ] def test_pipeline_to_pipeline_edge_delegation(): @jip.tool('grape_gem_index') class GemIndex(object): """\ The GEM Indexer tool Usage: gem_index -i <genome> [-o <genome_index>] Options: -o, --output <genome_index> The output GEM index file [default: ${input|ext}.gem] -i, --input <genome> The fasta file for the genome """ def get_command(self): return "bash", "gemtools index ${options()}" @jip.tool('grape_gem_rnatool') class gem(object): """\ The GEMtools RNAseq Mapping Pipeline Usage: gem -f <fastq_file> -i <genome_index> Inputs: -f, --fastq <fastq_file> The input fastq -i, --index <genome_index> The GEM index file for the genome """ def get_command(self): return 'bash', 'gemtools rna-pipeline ${options()}' @jip.pipeline('grape_gem_setup') class SetupPipeline(object): """\ The GEM indexes setup pipeline usage: setup -i <genome> Options: -i, --input <genome> The input reference genome """ def init(self): self.add_output('index', '${input|ext}.gem') def pipeline(self): p = jip.Pipeline() index = p.run('grape_gem_index', input=self.input, output=self.index) p.context(locals()) return p @jip.pipeline('grape_gem_rnapipeline') class GrapePipeline(object): """\ The default GRAPE RNAseq pipeline usage: rnaseq -f <fastq_file> -g <genome> Inputs: -f, --fastq <fastq_file> The input reference genome -g, --genome <genome_index> The input reference genome """ def pipeline(self): p = jip.Pipeline() gem_setup = p.run('grape_gem_setup', input=self.genome) gem = p.run('grape_gem_rnatool', index=gem_setup.index, fastq=self.fastq) p.context(locals()) return p p = jip.Pipeline() node = p.run('grape_gem_rnapipeline') node.fastq = 'reads_1.fastq.gz' node.genome = 'genome.fa' p.expand(validate=False) index = p.get('index') gem_node = p.get('gem') cwd = os.getcwd() j = os.path.join assert index.has_outgoing(gem_node, link=('output', 'index'), value=j(cwd, 'genome.gem')) def test_subpipe_incoming_edge_resolve(): @jip.pipeline() def subedge_pipe(tool): """Subedge usage: subedge --input <input> """ p = jip.Pipeline() p.job('ls').bash('ls ${input}', input=tool.input) return p p = jip.Pipeline() produce = p.job('touch').bash('touch ${outfile}', outfile='out.dat') p.run('subedge_pipe', input=produce.outfile) p.expand(validate=False) touch = p.get('touch') ls = p.get('ls') cwd = os.getcwd() j = os.path.join assert touch.has_outgoing(ls, link=('outfile', 'input'), value=j(cwd, 'out.dat')) def test_subpipe_incoming_edge_resolve_pipe_to_pipe(): @jip.pipeline() def subedge_pipe_1(tool): """Subedge usage: subedge --input <input> --output <output> """ p = jip.Pipeline() p.job('p1').bash('touch', input=tool.input, output=tool.output) return p @jip.pipeline() def subedge_pipe_2(tool): """Subedge usage: subedge --input <input> --output <output> """ p = jip.Pipeline() p.job('p2').bash('touch', input=tool.input, output=tool.output) return p @jip.pipeline() def subedge_pipe_combine(tool): """Subedge usage: subedge --input <input> --output <output> """ p = jip.Pipeline() p1 = p.run('subedge_pipe_1', input=tool.input, output='p1.out') p.run('subedge_pipe_2', input=p1, output=tool.output) return p p = jip.Pipeline() p.run('subedge_pipe_combine', input='a.txt', output="out.dat") p.expand(validate=False) assert len(p) == 2 p1 = p.get('p1') p2 = p.get('p2') cwd = os.getcwd() j = os.path.join assert p1.has_outgoing(p2) assert p1.has_outgoing(p2, value=j(cwd, 'out.dat')) assert p1.has_outgoing(p2, link=('output', 'input'), value=j(cwd, 'p1.out')) if __name__ == '__main__': unittest.main()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 3057, 777, 310, 278, 6455, 8450, 24210, 322, 8492, 15945, 29908, 13, 5215, 2897, 13, 5215, 432, 666, 13, 5215, 443, 27958, 13, 5215, 432, 666, 29889, 8504, 13, 13, 13, 1990, 350, 29956, 3301, 23828, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29925, 23828, 5015, 12425, 29898, 1311, 1125, 13, 4706, 396, 2254, 278, 16439, 13, 4706, 5780, 353, 432, 666, 29889, 2886, 703, 19057, 29914, 29890, 2766, 29914, 29886, 488, 786, 29889, 29926, 666, 1159, 13, 4706, 4974, 5780, 338, 451, 6213, 13, 13, 4706, 396, 1653, 263, 16439, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 396, 1653, 263, 716, 16439, 2943, 322, 10822, 1178, 13, 4706, 282, 29889, 3389, 29898, 10154, 29892, 1881, 543, 14669, 29889, 2272, 613, 3407, 543, 9984, 1445, 613, 1962, 543, 449, 29889, 3945, 1159, 13, 13, 4706, 396, 7985, 278, 16439, 1316, 393, 278, 7463, 16439, 338, 11527, 13, 4706, 282, 29889, 18837, 29898, 15480, 29922, 8824, 29897, 13, 13, 4706, 396, 1156, 13184, 411, 445, 731, 25608, 29892, 278, 16439, 881, 505, 29871, 29955, 7573, 13, 4706, 4974, 7431, 29898, 29886, 29897, 1275, 29871, 29955, 13, 4706, 396, 278, 3983, 881, 5718, 310, 29871, 29953, 12770, 13, 4706, 4974, 7431, 29898, 29886, 29889, 287, 2710, 29897, 1275, 29871, 29953, 13, 4706, 396, 679, 714, 278, 7573, 29889, 591, 505, 304, 671, 18111, 1244, 13, 4706, 396, 1363, 278, 2983, 1795, 505, 3939, 1156, 13184, 13, 4706, 2143, 353, 282, 29889, 657, 703, 999, 1159, 13, 4706, 7595, 353, 282, 29889, 657, 703, 2520, 1159, 13, 4706, 3514, 353, 282, 29889, 657, 703, 13445, 1159, 13, 4706, 289, 314, 353, 282, 29889, 657, 703, 29890, 314, 1159, 13, 4706, 868, 567, 353, 282, 29889, 657, 703, 700, 567, 1159, 13, 4706, 2380, 353, 282, 29889, 657, 703, 2248, 1159, 13, 4706, 282, 488, 786, 353, 282, 29889, 657, 703, 29886, 488, 786, 1159, 13, 4706, 396, 1423, 278, 12368, 13, 4706, 4974, 451, 2143, 29889, 5349, 29918, 262, 11506, 580, 13, 4706, 4974, 7595, 29889, 5349, 29918, 262, 11506, 29898, 999, 29897, 13, 4706, 4974, 3514, 29889, 5349, 29918, 262, 11506, 29898, 2520, 29897, 13, 4706, 4974, 289, 314, 29889, 5349, 29918, 262, 11506, 29898, 13445, 29897, 13, 4706, 4974, 868, 567, 29889, 5349, 29918, 262, 11506, 29898, 29890, 314, 29897, 13, 4706, 4974, 2380, 29889, 5349, 29918, 262, 11506, 29898, 700, 567, 29897, 13, 4706, 4974, 282, 488, 786, 29889, 5349, 29918, 262, 11506, 29898, 2248, 29897, 13, 4706, 4974, 451, 282, 488, 786, 29889, 5349, 29918, 449, 17696, 580, 13, 13, 1678, 822, 1243, 29925, 23828, 5015, 12425, 15329, 10709, 287, 29898, 1311, 1125, 13, 4706, 396, 2254, 278, 16439, 13, 4706, 5780, 353, 432, 666, 29889, 2886, 703, 19057, 29914, 29890, 2766, 29914, 29886, 488, 786, 29889, 29926, 666, 1159, 13, 4706, 4974, 5780, 338, 451, 6213, 13, 13, 4706, 396, 1653, 263, 16439, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 396, 1653, 263, 716, 16439, 2943, 322, 10822, 1178, 13, 4706, 282, 29889, 3389, 29898, 10154, 29892, 1881, 29922, 3366, 14669, 29889, 2272, 613, 376, 16310, 2303, 29889, 29878, 303, 12436, 13, 795, 3407, 543, 9984, 1445, 613, 13, 795, 1962, 19070, 2080, 29989, 1062, 2403, 449, 29889, 3945, 1159, 13, 13, 4706, 396, 7985, 278, 16439, 1316, 393, 278, 7463, 16439, 338, 11527, 13, 4706, 396, 445, 674, 884, 12725, 599, 7573, 322, 12020, 385, 3682, 13, 4706, 396, 565, 697, 310, 278, 7573, 2854, 800, 5229, 13, 4706, 282, 29889, 18837, 29898, 15480, 29922, 8824, 29897, 13, 13, 4706, 396, 1156, 13184, 411, 445, 731, 25608, 29892, 278, 16439, 881, 505, 29871, 29955, 7573, 13, 4706, 4974, 7431, 29898, 29886, 29897, 1275, 29871, 29896, 29941, 13, 4706, 396, 278, 3983, 881, 5718, 310, 29871, 29953, 12770, 13, 4706, 4974, 7431, 29898, 29886, 29889, 287, 2710, 29897, 1275, 29871, 29896, 29906, 13, 4706, 396, 679, 714, 278, 7573, 29889, 591, 505, 304, 671, 18111, 1244, 13, 4706, 396, 1363, 278, 2983, 1795, 505, 3939, 1156, 13184, 13, 4706, 2143, 353, 282, 29889, 657, 703, 999, 1159, 13, 4706, 7595, 353, 282, 29889, 657, 703, 2520, 29889, 29900, 1159, 13, 4706, 3514, 353, 282, 29889, 657, 703, 13445, 29889, 29900, 1159, 13, 4706, 289, 314, 353, 282, 29889, 657, 703, 29890, 314, 29889, 29900, 1159, 13, 4706, 868, 567, 353, 282, 29889, 657, 703, 700, 567, 29889, 29900, 1159, 13, 4706, 2380, 353, 282, 29889, 657, 703, 2248, 29889, 29900, 1159, 13, 4706, 282, 488, 786, 353, 282, 29889, 657, 703, 29886, 488, 786, 29889, 29900, 1159, 13, 4706, 396, 1423, 278, 12368, 13, 4706, 4974, 451, 2143, 29889, 5349, 29918, 262, 11506, 580, 13, 4706, 4974, 7595, 29889, 5349, 29918, 262, 11506, 29898, 999, 29897, 13, 4706, 4974, 3514, 29889, 5349, 29918, 262, 11506, 29898, 2520, 29897, 13, 4706, 4974, 289, 314, 29889, 5349, 29918, 262, 11506, 29898, 13445, 29897, 13, 4706, 4974, 868, 567, 29889, 5349, 29918, 262, 11506, 29898, 29890, 314, 29897, 13, 4706, 4974, 2380, 29889, 5349, 29918, 262, 11506, 29898, 700, 567, 29897, 13, 4706, 4974, 282, 488, 786, 29889, 5349, 29918, 262, 11506, 29898, 2248, 29897, 13, 4706, 4974, 451, 282, 488, 786, 29889, 5349, 29918, 449, 17696, 580, 13, 4706, 396, 1243, 1473, 731, 13, 4706, 2143, 353, 282, 29889, 657, 703, 999, 1159, 13, 4706, 7595, 353, 282, 29889, 657, 703, 2520, 29889, 29896, 1159, 13, 4706, 3514, 353, 282, 29889, 657, 703, 13445, 29889, 29896, 1159, 13, 4706, 289, 314, 353, 282, 29889, 657, 703, 29890, 314, 29889, 29896, 1159, 13, 4706, 868, 567, 353, 282, 29889, 657, 703, 700, 567, 29889, 29896, 1159, 13, 4706, 2380, 353, 282, 29889, 657, 703, 2248, 29889, 29896, 1159, 13, 4706, 282, 488, 786, 353, 282, 29889, 657, 703, 29886, 488, 786, 29889, 29896, 1159, 13, 4706, 396, 1423, 278, 12368, 13, 4706, 4974, 451, 2143, 29889, 5349, 29918, 262, 11506, 580, 13, 4706, 4974, 7595, 29889, 5349, 29918, 262, 11506, 29898, 999, 29897, 13, 4706, 4974, 3514, 29889, 5349, 29918, 262, 11506, 29898, 2520, 29897, 13, 4706, 4974, 289, 314, 29889, 5349, 29918, 262, 11506, 29898, 13445, 29897, 13, 4706, 4974, 868, 567, 29889, 5349, 29918, 262, 11506, 29898, 29890, 314, 29897, 13, 4706, 4974, 2380, 29889, 5349, 29918, 262, 11506, 29898, 700, 567, 29897, 13, 4706, 4974, 282, 488, 786, 29889, 5349, 29918, 262, 11506, 29898, 2248, 29897, 13, 4706, 4974, 451, 282, 488, 786, 29889, 5349, 29918, 449, 17696, 580, 13, 13, 13, 29992, 29926, 666, 29889, 10154, 877, 17797, 29918, 2248, 1495, 13, 1990, 15170, 3220, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 450, 402, 12665, 11374, 261, 5780, 13, 13, 1678, 10783, 482, 29901, 13, 4706, 7055, 29918, 2248, 448, 29875, 529, 1885, 608, 29958, 21069, 29877, 529, 1885, 608, 29918, 2248, 29958, 29962, 21069, 29873, 529, 28993, 29958, 29962, 518, 489, 1217, 29899, 8568, 29962, 13, 13, 1678, 25186, 29901, 13, 4706, 1192, 8477, 29871, 7704, 445, 1371, 2643, 13, 4706, 448, 29877, 29892, 1192, 4905, 29899, 3972, 529, 4905, 29918, 3972, 29958, 29871, 450, 4138, 988, 278, 1962, 402, 12665, 13, 462, 462, 539, 2380, 338, 2825, 13, 4706, 448, 29873, 29892, 1192, 28993, 529, 28993, 29958, 4706, 450, 1353, 310, 8225, 9717, 13, 462, 462, 539, 518, 4381, 29901, 29871, 29896, 29962, 13, 4706, 1192, 1217, 29899, 8568, 462, 418, 1938, 451, 7738, 278, 6608, 934, 13, 462, 462, 539, 518, 4381, 29901, 2089, 29962, 13, 13, 1678, 10567, 29879, 29901, 13, 4706, 448, 29875, 29892, 1192, 2080, 529, 1885, 608, 29958, 29871, 450, 5172, 29874, 934, 363, 278, 2531, 608, 13, 1678, 9995, 13, 1678, 822, 2069, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 4905, 742, 11568, 2080, 29989, 978, 29989, 1062, 1836, 17797, 1159, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 714, 353, 11568, 2080, 29989, 978, 29989, 1062, 1836, 17797, 29908, 13, 4706, 565, 1583, 29889, 6768, 1839, 4905, 29918, 3972, 2033, 29901, 13, 9651, 714, 353, 11568, 4905, 29918, 3972, 6822, 29908, 718, 714, 13, 4706, 1583, 29889, 6768, 1839, 4905, 13359, 842, 29898, 449, 29897, 13, 13, 1678, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 4706, 736, 376, 17797, 8504, 2380, 448, 29875, 6435, 2080, 29913, 448, 29877, 6435, 4905, 29913, 448, 29873, 6435, 28993, 29913, 6634, 13, 1669, 11568, 1217, 29918, 8568, 29989, 1191, 5038, 13, 13, 13, 29992, 29926, 666, 29889, 10154, 877, 17797, 29918, 29873, 29918, 2248, 1495, 13, 1990, 15170, 4300, 924, 608, 3220, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 450, 402, 12665, 4103, 7283, 415, 608, 11374, 261, 5780, 13, 13, 1678, 10783, 482, 29901, 13, 4706, 7055, 29918, 29873, 29918, 2248, 448, 29875, 529, 1885, 608, 29918, 2248, 29958, 448, 29874, 529, 18317, 29958, 21069, 29885, 529, 3317, 29918, 949, 29918, 2848, 29958, 29962, 13, 462, 259, 21069, 29877, 529, 4905, 29918, 12083, 29958, 29962, 21069, 29886, 529, 4905, 29918, 13506, 29958, 29962, 21069, 29873, 529, 28993, 29958, 29962, 13, 13, 1678, 25186, 29901, 13, 4706, 1192, 8477, 29871, 7704, 445, 1371, 2643, 13, 4706, 448, 29877, 29892, 1192, 4905, 29899, 3972, 529, 4905, 29918, 3972, 29958, 539, 450, 4138, 988, 278, 1962, 2066, 13, 462, 462, 9651, 526, 2825, 13, 462, 462, 9651, 518, 4381, 29901, 6435, 18317, 29989, 3560, 6525, 13, 4706, 448, 29886, 29892, 1192, 13506, 529, 4905, 29918, 13506, 29958, 4706, 450, 1024, 304, 367, 1304, 363, 278, 1962, 13, 462, 462, 9651, 2066, 518, 4381, 29901, 6435, 18317, 29989, 978, 6525, 13, 4706, 448, 29873, 29892, 1192, 28993, 529, 28993, 29958, 632, 450, 1353, 310, 8225, 9717, 13, 462, 462, 9651, 518, 4381, 29901, 29871, 29896, 29962, 13, 4706, 448, 29885, 29892, 1192, 3317, 29899, 2848, 529, 3317, 29918, 949, 29918, 2848, 29958, 29871, 5918, 12539, 1303, 3309, 518, 4381, 29901, 29871, 29896, 29945, 29900, 29962, 13, 13, 1678, 10567, 29879, 29901, 13, 4706, 448, 29875, 29892, 1192, 2248, 529, 1885, 608, 29918, 2248, 29958, 3986, 450, 402, 12665, 2380, 934, 363, 278, 2531, 608, 13, 4706, 448, 29874, 29892, 1192, 18317, 529, 18317, 29958, 539, 450, 3407, 17195, 297, 402, 8969, 13, 462, 462, 9651, 3402, 13, 1678, 9995, 13, 1678, 822, 2069, 29898, 1311, 1125, 13, 4706, 396, 361, 451, 1583, 29889, 6768, 1839, 4905, 29918, 3972, 2033, 29901, 13, 4706, 396, 1678, 1583, 29889, 6768, 1839, 4905, 29918, 3972, 2033, 353, 376, 1213, 13, 4706, 396, 361, 451, 1583, 29889, 6768, 1839, 13506, 2033, 29901, 13, 4706, 396, 1678, 1583, 29889, 6768, 1839, 13506, 2033, 353, 11568, 18317, 5038, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 17797, 742, 11568, 4905, 29918, 3972, 6822, 5303, 13506, 1836, 29926, 651, 29879, 29889, 17797, 1159, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 8149, 742, 11568, 4905, 29918, 3972, 6822, 5303, 13506, 1836, 29926, 651, 29879, 29889, 8149, 1159, 13, 13, 1678, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 4706, 736, 525, 13067, 742, 525, 17797, 8504, 260, 29899, 2248, 448, 29875, 6435, 2248, 29913, 448, 29874, 6435, 18317, 29913, 525, 320, 13, 462, 539, 17411, 29877, 6435, 4905, 29918, 3972, 29989, 6897, 6822, 5303, 13506, 29913, 448, 29873, 6435, 28993, 29913, 525, 320, 13, 462, 539, 17411, 29885, 6435, 3317, 29918, 2848, 10162, 13, 13, 13, 1753, 1243, 29918, 17797, 8504, 29918, 2248, 29918, 6519, 29918, 9482, 292, 29918, 1454, 29918, 6768, 7295, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 3389, 877, 17797, 29918, 2248, 742, 1881, 543, 9984, 1445, 613, 1962, 29918, 3972, 2433, 1688, 1495, 13, 1678, 282, 29889, 18837, 29898, 15480, 29922, 5574, 29897, 13, 1678, 2943, 353, 282, 29889, 657, 877, 17797, 29918, 2248, 1495, 13, 1678, 1596, 2943, 3032, 10154, 29889, 6768, 13, 1678, 4982, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 9601, 29900, 29962, 13, 1678, 297, 1445, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 703, 9984, 1445, 1159, 13, 1678, 2967, 353, 2897, 29889, 2084, 29889, 25721, 29898, 262, 1445, 29897, 13, 1678, 1596, 376, 6778, 28341, 4982, 29889, 6519, 13, 1678, 4974, 4982, 29889, 6519, 1275, 525, 17797, 8504, 2380, 448, 29875, 1273, 29879, 448, 29877, 1273, 29879, 29889, 17797, 448, 29873, 29871, 29896, 525, 1273, 313, 13, 4706, 297, 1445, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29892, 376, 1688, 29914, 9984, 1445, 5783, 13, 13, 1678, 714, 5325, 353, 1051, 29898, 9057, 29889, 657, 29918, 4905, 29918, 5325, 3101, 13, 1678, 4974, 7431, 29898, 449, 5325, 29897, 1275, 29871, 29896, 13, 1678, 4974, 714, 5325, 29961, 29900, 29962, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29892, 376, 1688, 29914, 9984, 1445, 29889, 17797, 1159, 13, 13, 13, 1753, 1243, 29918, 17797, 8504, 29918, 29873, 29918, 2248, 29918, 2080, 29879, 7295, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 3389, 877, 17797, 29918, 29873, 29918, 2248, 742, 2380, 543, 9984, 1445, 613, 17195, 2433, 14669, 29889, 2272, 742, 13, 3986, 1962, 29918, 3972, 2433, 1688, 1495, 13, 1678, 282, 29889, 18837, 29898, 15480, 29922, 8824, 29897, 13, 1678, 4982, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 9601, 29900, 29962, 13, 1678, 297, 1445, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 703, 9984, 1445, 1159, 13, 1678, 17195, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 703, 14669, 29889, 2272, 1159, 13, 1678, 2967, 353, 2897, 29889, 2084, 29889, 25721, 29898, 262, 1445, 29897, 13, 1678, 1596, 376, 6778, 28341, 4982, 29889, 6519, 13, 1678, 4974, 4982, 29889, 6519, 1275, 525, 17797, 8504, 260, 29899, 2248, 448, 29875, 1273, 29879, 448, 29874, 1273, 29879, 448, 29877, 1273, 29879, 448, 29873, 29871, 29896, 448, 29885, 29871, 29896, 29945, 29900, 29915, 1273, 313, 13, 4706, 297, 1445, 29892, 17195, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29892, 376, 1688, 29914, 14669, 29889, 2272, 5783, 13, 13, 1678, 714, 5325, 353, 1051, 29898, 9057, 29889, 657, 29918, 4905, 29918, 5325, 3101, 13, 1678, 4974, 7431, 29898, 449, 5325, 29897, 1275, 29871, 29906, 13, 1678, 4974, 714, 5325, 29961, 29900, 29962, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29892, 376, 1688, 29914, 14669, 29889, 2272, 29889, 29926, 651, 29879, 29889, 17797, 1159, 13, 1678, 4974, 714, 5325, 29961, 29896, 29962, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29892, 376, 1688, 29914, 14669, 29889, 2272, 29889, 29926, 651, 29879, 29889, 8149, 1159, 13, 13, 13, 29992, 29926, 666, 29889, 10154, 877, 3874, 412, 29918, 17797, 29918, 27539, 1219, 324, 1495, 13, 1990, 7055, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 450, 402, 29923, 11490, 8789, 390, 3521, 11762, 341, 20304, 349, 23828, 13, 13, 1678, 10783, 482, 29901, 13, 4706, 7055, 448, 29888, 529, 11255, 29939, 29918, 1445, 29958, 856, 448, 29875, 529, 1885, 608, 29918, 2248, 29958, 448, 29874, 529, 18317, 29958, 448, 29939, 529, 29567, 29958, 13, 9651, 21069, 29876, 529, 978, 29958, 29962, 21069, 29877, 529, 4905, 29918, 3972, 29958, 29962, 21069, 29873, 529, 28993, 29958, 29962, 13, 13, 1678, 25186, 29901, 13, 4706, 1192, 8477, 29871, 7704, 445, 1371, 2643, 13, 4706, 448, 29939, 29892, 1192, 29567, 529, 29567, 29958, 29871, 450, 5172, 29939, 9210, 11029, 13, 4706, 448, 29876, 29892, 1192, 978, 529, 978, 29958, 29871, 450, 1962, 10944, 1024, 13, 462, 965, 518, 4381, 29901, 6435, 11255, 29939, 29889, 1610, 580, 29961, 29900, 29962, 29989, 978, 29989, 1062, 29989, 1062, 29989, 276, 703, 29918, 29961, 29896, 29906, 29962, 3284, 1159, 6525, 13, 4706, 448, 29877, 29892, 1192, 4905, 29899, 3972, 529, 4905, 29918, 3972, 29958, 29871, 450, 1962, 4138, 13, 4706, 448, 29873, 29892, 1192, 28993, 529, 28993, 29958, 29871, 450, 1353, 310, 8225, 9717, 518, 4381, 29901, 29871, 29896, 29962, 13, 13, 1678, 10567, 29879, 29901, 13, 4706, 448, 29888, 29892, 1192, 11255, 29939, 529, 11255, 29939, 29918, 1445, 29958, 856, 29871, 450, 1881, 5172, 29939, 13, 4706, 448, 29875, 29892, 1192, 2248, 529, 1885, 608, 29918, 2248, 29958, 29871, 450, 402, 12665, 2380, 934, 363, 278, 2531, 608, 13, 4706, 448, 29874, 29892, 1192, 18317, 529, 18317, 29958, 29871, 450, 3407, 17195, 297, 402, 8969, 3402, 13, 1678, 9995, 13, 1678, 822, 2069, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 1958, 742, 11568, 4905, 29918, 3972, 6822, 5303, 978, 1836, 1958, 29889, 18828, 1159, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 29890, 314, 742, 11568, 4905, 29918, 3972, 6822, 5303, 978, 1836, 29890, 314, 1159, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 29890, 1794, 742, 11568, 4905, 29918, 3972, 6822, 5303, 978, 1836, 29890, 314, 29889, 29890, 1794, 1159, 13, 4706, 1583, 29889, 1202, 29918, 3385, 877, 14369, 29918, 355, 742, 7700, 29892, 1472, 543, 489, 14369, 29899, 355, 613, 13, 462, 4706, 7934, 29922, 8824, 29897, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 565, 7431, 29898, 1311, 29889, 11255, 29939, 29897, 1275, 29871, 29896, 29901, 13, 9651, 1583, 29889, 6768, 1839, 14369, 29918, 355, 13359, 842, 29898, 5574, 29897, 13, 13, 1678, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 4706, 736, 525, 13067, 742, 525, 17797, 8504, 364, 1056, 29899, 13096, 5570, 6435, 6768, 580, 10162, 13, 13, 13, 29992, 29926, 666, 29889, 10154, 877, 3874, 412, 29918, 1579, 1314, 1495, 13, 1990, 19389, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 450, 2379, 1314, 5915, 562, 2105, 13, 13, 1678, 10783, 482, 29901, 13, 4706, 19389, 448, 29875, 529, 2080, 29958, 448, 29874, 529, 18317, 29958, 21069, 29877, 529, 4905, 29918, 3972, 29958, 29962, 13, 13, 1678, 25186, 29901, 13, 4706, 1192, 8477, 29871, 7704, 445, 1371, 2643, 13, 4706, 448, 29877, 29892, 1192, 4905, 29899, 3972, 529, 4905, 29918, 3972, 29958, 29871, 450, 1962, 4138, 13, 13, 1678, 10567, 29879, 29901, 13, 4706, 448, 29875, 29892, 1192, 2080, 529, 2080, 29958, 29871, 450, 1881, 934, 411, 611, 27775, 13, 4706, 448, 29874, 29892, 1192, 18317, 529, 18317, 29958, 29871, 450, 3407, 17195, 297, 402, 8969, 3402, 13, 1678, 9995, 13, 1678, 822, 2069, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1202, 29918, 3385, 877, 978, 742, 11568, 2080, 29989, 978, 29989, 1062, 27195, 13, 4706, 1583, 29889, 1202, 29918, 4905, 877, 4141, 29888, 742, 11568, 4905, 29918, 3972, 6822, 5303, 978, 1836, 4141, 29888, 1159, 13, 13, 1678, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 4706, 736, 525, 13067, 742, 525, 1579, 1314, 29899, 5030, 562, 2105, 6435, 6768, 580, 10162, 13, 13, 13, 29992, 29926, 666, 29889, 13096, 5570, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 1495, 13, 1990, 4989, 412, 29925, 23828, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 7525, 278, 2322, 390, 3521, 11762, 16439, 13, 13, 1678, 8744, 29901, 13, 4706, 364, 29876, 559, 29939, 448, 29888, 529, 11255, 29939, 29918, 1445, 29958, 856, 448, 29939, 529, 29567, 29958, 448, 29875, 529, 1885, 608, 29918, 2248, 29958, 13, 1669, 448, 29874, 529, 18317, 29958, 21069, 29877, 529, 4905, 29918, 3972, 29958, 29962, 13, 13, 1678, 10567, 29879, 29901, 13, 4706, 448, 29888, 29892, 1192, 11255, 29939, 529, 11255, 29939, 29918, 1445, 29958, 856, 259, 450, 1881, 3407, 2531, 608, 13, 4706, 448, 29875, 29892, 1192, 2248, 529, 1885, 608, 29918, 2248, 29958, 1678, 450, 1881, 3407, 2531, 608, 13, 4706, 448, 29874, 29892, 1192, 18317, 529, 18317, 29871, 450, 1881, 3407, 17195, 13, 13, 1678, 25186, 29901, 13, 4706, 448, 29939, 29892, 1192, 29567, 529, 29567, 29958, 4706, 450, 9950, 29939, 9210, 11029, 13, 462, 462, 539, 518, 4381, 29901, 29871, 29941, 29941, 29962, 13, 4706, 448, 29877, 29892, 1192, 4905, 29899, 3972, 529, 4905, 29918, 3972, 29958, 29871, 450, 1962, 10944, 13, 462, 462, 539, 518, 4381, 29901, 6435, 11255, 29939, 29889, 1610, 580, 29961, 29900, 29962, 29989, 6897, 29989, 3560, 6525, 13, 13, 1678, 9995, 13, 1678, 822, 16439, 29898, 1311, 1125, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 7055, 353, 282, 29889, 3389, 29898, 13, 9651, 525, 3874, 412, 29918, 17797, 29918, 27539, 1219, 324, 742, 13, 9651, 2380, 29922, 1311, 29889, 2248, 29892, 17195, 29922, 1311, 29889, 18317, 29892, 13, 9651, 5172, 29939, 29922, 1311, 29889, 11255, 29939, 29892, 11029, 29922, 1311, 29889, 29567, 29892, 13, 9651, 1962, 29918, 3972, 29922, 1311, 29889, 4905, 29918, 3972, 13, 4706, 1723, 13, 4706, 282, 29889, 3389, 29898, 13, 9651, 525, 3874, 412, 29918, 1579, 1314, 742, 1881, 29922, 17797, 29889, 29890, 314, 29892, 17195, 29922, 1311, 29889, 18317, 29892, 13, 9651, 1962, 29918, 3972, 29922, 1311, 29889, 4905, 29918, 3972, 13, 4706, 1723, 13, 4706, 282, 29889, 4703, 29898, 2997, 29879, 3101, 13, 4706, 736, 282, 13, 13, 13, 1753, 1243, 29918, 17797, 29918, 978, 29918, 3385, 29918, 311, 1397, 362, 7295, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 742, 5172, 29939, 2433, 949, 29879, 29918, 29896, 29889, 11255, 29939, 29889, 18828, 742, 2380, 2433, 2248, 29889, 17797, 742, 13, 3986, 17195, 2433, 1885, 401, 29889, 4141, 29888, 1495, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29892, 12725, 29922, 8824, 29897, 13, 1678, 301, 3972, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 432, 353, 2897, 29889, 2084, 29889, 7122, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29906, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 2248, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 2248, 29889, 17797, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 11255, 29939, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29918, 29896, 29889, 11255, 29939, 29889, 18828, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 18317, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1885, 401, 29889, 4141, 29888, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 29567, 13359, 657, 580, 1275, 525, 29941, 29941, 29915, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 4905, 29918, 3972, 13359, 657, 580, 1275, 301, 3972, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 978, 13359, 657, 580, 1275, 525, 949, 29879, 29915, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 29890, 314, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29889, 29890, 314, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 29890, 1794, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29889, 29890, 314, 29889, 29890, 1794, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 1958, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29889, 1958, 29889, 18828, 1495, 13, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 2080, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29889, 29890, 314, 1495, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 978, 13359, 657, 580, 1275, 525, 949, 29879, 29915, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 18317, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1885, 401, 29889, 4141, 29888, 1495, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 4905, 29918, 3972, 13359, 657, 580, 1275, 301, 3972, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 4141, 29888, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29889, 4141, 29888, 1495, 13, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29961, 29900, 1822, 11991, 29897, 1275, 29871, 29896, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29961, 29896, 1822, 22594, 29897, 1275, 29871, 29896, 13, 1678, 4974, 17643, 29961, 29900, 1822, 11991, 29961, 29900, 29962, 1275, 17643, 29961, 29896, 29962, 13, 13, 13, 1753, 1243, 29918, 17797, 29918, 978, 29918, 3385, 29918, 311, 1397, 362, 29918, 2541, 29918, 4905, 29918, 3972, 7295, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 742, 5172, 29939, 2433, 949, 29879, 29918, 29896, 29889, 11255, 29939, 29889, 18828, 742, 2380, 2433, 2248, 29889, 17797, 742, 13, 3986, 17195, 2433, 1885, 401, 29889, 4141, 29888, 742, 1962, 29918, 3972, 543, 1357, 3972, 1159, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29892, 12725, 29922, 8824, 29897, 13, 1678, 301, 3972, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 432, 353, 2897, 29889, 2084, 29889, 7122, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29906, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 2248, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 2248, 29889, 17797, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 11255, 29939, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 949, 29879, 29918, 29896, 29889, 11255, 29939, 29889, 18828, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 18317, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1885, 401, 29889, 4141, 29888, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 29567, 13359, 657, 580, 1275, 525, 29941, 29941, 29915, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 4905, 29918, 3972, 13359, 657, 580, 1275, 376, 1357, 3972, 29908, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 978, 13359, 657, 580, 1275, 525, 949, 29879, 29915, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 29890, 314, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1357, 3972, 29914, 949, 29879, 29889, 29890, 314, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 29890, 1794, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1357, 3972, 29914, 949, 29879, 29889, 29890, 314, 29889, 29890, 1794, 1495, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 1958, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1357, 3972, 29914, 949, 29879, 29889, 1958, 29889, 18828, 1495, 13, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 2080, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1357, 3972, 29914, 949, 29879, 29889, 29890, 314, 1495, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 978, 13359, 657, 580, 1275, 525, 949, 29879, 29915, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 18317, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1885, 401, 29889, 4141, 29888, 1495, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 4905, 29918, 3972, 13359, 657, 580, 1275, 376, 1357, 3972, 29908, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 4141, 29888, 13359, 657, 580, 1275, 432, 29898, 430, 381, 29892, 525, 1357, 3972, 29914, 949, 29879, 29889, 4141, 29888, 1495, 13, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29961, 29900, 1822, 11991, 29897, 1275, 29871, 29896, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29961, 29896, 1822, 22594, 29897, 1275, 29871, 29896, 13, 1678, 4974, 17643, 29961, 29900, 1822, 11991, 29961, 29900, 29962, 1275, 17643, 29961, 29896, 29962, 13, 13, 13, 1753, 1243, 29918, 20787, 29918, 13096, 24210, 29918, 2541, 29918, 311, 1397, 630, 29918, 4905, 29879, 7295, 13, 1678, 732, 29926, 666, 29889, 10154, 877, 3874, 412, 29918, 17797, 29918, 2248, 1495, 13, 1678, 770, 15170, 3220, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 402, 12665, 11374, 261, 5780, 13, 13, 4706, 10783, 482, 29901, 13, 9651, 7055, 29918, 2248, 448, 29875, 529, 1885, 608, 29958, 21069, 29877, 529, 1885, 608, 29918, 2248, 29958, 29962, 13, 13, 4706, 25186, 29901, 13, 9651, 448, 29877, 29892, 1192, 4905, 529, 1885, 608, 29918, 2248, 29958, 29871, 450, 1962, 402, 12665, 2380, 934, 13, 462, 462, 308, 518, 4381, 29901, 6435, 2080, 29989, 1062, 1836, 17797, 29962, 13, 9651, 448, 29875, 29892, 1192, 2080, 529, 1885, 608, 29958, 308, 450, 5172, 29874, 934, 363, 278, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 9651, 736, 376, 13067, 613, 376, 17797, 8504, 2380, 6435, 6768, 580, 5038, 13, 13, 1678, 732, 29926, 666, 29889, 10154, 877, 3874, 412, 29918, 17797, 29918, 27539, 1219, 324, 1495, 13, 1678, 770, 7055, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 402, 12665, 8504, 390, 3521, 11762, 341, 20304, 349, 23828, 13, 13, 4706, 10783, 482, 29901, 13, 9651, 7055, 448, 29888, 529, 11255, 29939, 29918, 1445, 29958, 448, 29875, 529, 1885, 608, 29918, 2248, 29958, 13, 13, 4706, 10567, 29879, 29901, 13, 9651, 448, 29888, 29892, 1192, 11255, 29939, 529, 11255, 29939, 29918, 1445, 29958, 29871, 450, 1881, 5172, 29939, 13, 9651, 448, 29875, 29892, 1192, 2248, 529, 1885, 608, 29918, 2248, 29958, 29871, 450, 402, 12665, 2380, 934, 363, 278, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 9651, 736, 525, 13067, 742, 525, 17797, 8504, 364, 1056, 29899, 13096, 5570, 6435, 6768, 580, 10162, 13, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 877, 3874, 412, 29918, 17797, 29918, 14669, 1495, 13, 1678, 770, 3789, 786, 29925, 23828, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 402, 12665, 18111, 6230, 16439, 13, 13, 4706, 8744, 29901, 13, 9651, 6230, 448, 29875, 529, 1885, 608, 29958, 13, 13, 4706, 25186, 29901, 13, 9651, 448, 29875, 29892, 1192, 2080, 529, 1885, 608, 29958, 29871, 450, 1881, 3407, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 2069, 29898, 1311, 1125, 13, 9651, 1583, 29889, 1202, 29918, 4905, 877, 2248, 742, 525, 5303, 2080, 29989, 1062, 1836, 17797, 1495, 13, 13, 4706, 822, 16439, 29898, 1311, 1125, 13, 9651, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 9651, 2380, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 2248, 742, 13, 462, 3986, 1881, 29922, 1311, 29889, 2080, 29892, 1962, 29922, 1311, 29889, 2248, 29897, 13, 9651, 282, 29889, 4703, 29898, 2997, 29879, 3101, 13, 9651, 736, 282, 13, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 1495, 13, 1678, 770, 4989, 412, 29925, 23828, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 2322, 18016, 3301, 29923, 390, 3521, 11762, 16439, 13, 13, 4706, 8744, 29901, 13, 9651, 364, 29876, 559, 29939, 448, 29888, 529, 11255, 29939, 29918, 1445, 29958, 448, 29887, 529, 1885, 608, 29958, 13, 13, 4706, 10567, 29879, 29901, 13, 9651, 448, 29888, 29892, 1192, 11255, 29939, 529, 11255, 29939, 29918, 1445, 29958, 4706, 450, 1881, 3407, 2531, 608, 13, 9651, 448, 29887, 29892, 1192, 1885, 608, 529, 1885, 608, 29918, 2248, 29958, 418, 450, 1881, 3407, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 16439, 29898, 1311, 1125, 13, 9651, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 9651, 7055, 29918, 14669, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 14669, 742, 1881, 29922, 1311, 29889, 1885, 608, 29897, 13, 9651, 7055, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 27539, 1219, 324, 742, 2380, 29922, 17797, 29918, 14669, 29889, 2248, 29892, 13, 462, 4706, 5172, 29939, 29922, 1311, 29889, 11255, 29939, 29897, 13, 9651, 282, 29889, 4703, 29898, 2997, 29879, 3101, 13, 9651, 736, 282, 13, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 2943, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 1495, 13, 1678, 2943, 29889, 11255, 29939, 353, 525, 949, 29879, 29918, 29896, 29889, 11255, 29939, 29889, 18828, 29915, 13, 1678, 2943, 29889, 1885, 608, 353, 525, 1885, 608, 29889, 5444, 29915, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29892, 12725, 29922, 8824, 29897, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29906, 13, 1678, 7055, 29918, 9057, 353, 4175, 29898, 2892, 921, 29901, 921, 29889, 978, 1275, 525, 17797, 742, 17643, 9601, 29900, 29962, 13, 1678, 4974, 7055, 29918, 9057, 338, 451, 6213, 13, 1678, 4974, 7055, 29918, 9057, 29889, 13305, 1839, 2248, 13359, 657, 2141, 1975, 2541, 877, 1885, 608, 29889, 17797, 1495, 13, 13, 13, 1753, 1243, 29918, 17987, 7176, 29918, 13096, 24210, 29918, 19190, 29918, 650, 29898, 7050, 3972, 1125, 13, 1678, 13128, 3972, 353, 851, 29898, 7050, 3972, 29897, 13, 1678, 396, 425, 397, 734, 29882, 15685, 1342, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 1202, 29918, 5453, 877, 19057, 29914, 17987, 7176, 29918, 1491, 6737, 29914, 17987, 7176, 29889, 2272, 1495, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 16192, 29918, 7576, 580, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 9057, 29898, 3972, 29922, 7050, 3972, 467, 3389, 877, 4773, 29918, 17987, 7176, 1495, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29897, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 13506, 2033, 1275, 525, 1688, 29915, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 4905, 2033, 1275, 518, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 5575, 1495, 13, 1678, 4514, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29896, 13, 13, 13, 1753, 1243, 29918, 17987, 7176, 29918, 13096, 24210, 29918, 19190, 29918, 10184, 29898, 7050, 3972, 1125, 13, 1678, 13128, 3972, 353, 851, 29898, 7050, 3972, 29897, 13, 1678, 396, 1653, 7408, 697, 1962, 13, 1678, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29896, 5477, 525, 29874, 2824, 5358, 580, 13, 1678, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29906, 5477, 525, 29874, 2824, 5358, 580, 13, 1678, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29941, 5477, 525, 29874, 2824, 5358, 580, 13, 1678, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29946, 5477, 525, 29874, 2824, 5358, 580, 13, 1678, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29945, 5477, 525, 29874, 2824, 5358, 580, 13, 1678, 396, 425, 397, 734, 29882, 15685, 1342, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 1202, 29918, 5453, 877, 19057, 29914, 17987, 7176, 29918, 1491, 6737, 29914, 17987, 7176, 29889, 2272, 1495, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 16192, 29918, 7576, 580, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 9057, 29898, 3972, 29922, 7050, 3972, 467, 3389, 877, 4773, 29918, 17987, 7176, 1495, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29897, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29947, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 13506, 2033, 1275, 525, 1688, 29915, 13, 1678, 1596, 376, 6778, 29958, 12015, 12336, 613, 17643, 29961, 29900, 1822, 13305, 1839, 4905, 13359, 1610, 580, 13, 1678, 1596, 376, 6778, 29958, 29911, 3580, 9464, 613, 13128, 3972, 13, 1678, 4974, 17643, 29961, 29900, 1822, 13305, 1839, 4905, 2033, 1275, 518, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29896, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29906, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29941, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29946, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29945, 5477, 13, 1678, 4514, 13, 1678, 4974, 17643, 29961, 29896, 1822, 13305, 1839, 2080, 2033, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29896, 1495, 13, 1678, 4974, 17643, 29961, 29906, 1822, 13305, 1839, 2080, 2033, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29906, 1495, 13, 1678, 4974, 17643, 29961, 29941, 1822, 13305, 1839, 2080, 2033, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29941, 1495, 13, 1678, 4974, 17643, 29961, 29946, 1822, 13305, 1839, 2080, 2033, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29946, 1495, 13, 1678, 4974, 17643, 29961, 29945, 1822, 13305, 1839, 2080, 2033, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 1688, 29889, 29945, 1495, 13, 1678, 1596, 17643, 29961, 29953, 1822, 13305, 1839, 2080, 13359, 1610, 580, 13, 1678, 4974, 17643, 29961, 29953, 1822, 13305, 1839, 2080, 2033, 1275, 518, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 25978, 287, 29918, 1688, 29889, 29896, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 25978, 287, 29918, 1688, 29889, 29906, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 25978, 287, 29918, 1688, 29889, 29941, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 25978, 287, 29918, 1688, 29889, 29946, 5477, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7050, 3972, 29892, 525, 25978, 287, 29918, 1688, 29889, 29945, 5477, 13, 1678, 4514, 13, 13, 13, 1753, 1243, 29918, 16626, 29918, 6768, 7295, 13, 1678, 2471, 353, 14550, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 432, 666, 13, 29937, 28675, 263, 1353, 310, 2066, 411, 263, 3619, 10944, 13, 29937, 13, 29937, 8744, 29901, 13, 29937, 259, 6023, 1192, 13506, 529, 13506, 29958, 1192, 2798, 529, 2798, 29958, 13, 13, 29937, 29995, 463, 2069, 13, 1202, 29918, 4905, 877, 4905, 1495, 13, 29937, 29995, 355, 13, 13, 29937, 29995, 463, 6230, 13, 6768, 1839, 4905, 13359, 842, 29898, 3366, 29995, 29879, 29918, 29995, 29879, 29908, 1273, 313, 13506, 29892, 474, 29897, 363, 474, 297, 3464, 29898, 29896, 29892, 2302, 29889, 657, 29898, 524, 29897, 718, 29871, 29896, 29897, 2314, 13, 29937, 29995, 355, 13, 13, 29937, 29995, 463, 1899, 13, 1454, 921, 297, 6435, 4905, 3400, 437, 13, 1678, 6023, 395, 29916, 13, 15091, 13, 1678, 14550, 13, 1678, 5780, 353, 432, 666, 29889, 8504, 29889, 4081, 12229, 29889, 3166, 29918, 1807, 29898, 2154, 29897, 13, 1678, 5780, 29889, 2344, 580, 13, 1678, 4974, 5780, 338, 451, 6213, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 2943, 353, 282, 29889, 9057, 877, 1688, 2824, 3389, 29898, 10154, 29892, 10944, 2433, 1688, 742, 2302, 29922, 29945, 29897, 13, 1678, 4974, 2943, 338, 451, 6213, 13, 1678, 282, 29889, 18837, 580, 13, 1678, 4974, 7431, 29898, 29886, 29897, 1275, 29871, 29896, 13, 1678, 2943, 353, 282, 29889, 657, 877, 1688, 1495, 13, 1678, 4974, 2943, 29889, 13506, 1275, 525, 1688, 29915, 13, 1678, 274, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 4974, 2943, 29889, 4905, 1275, 518, 359, 29889, 2084, 29889, 7122, 29898, 29883, 9970, 29892, 921, 29897, 363, 921, 297, 13, 462, 965, 6024, 1688, 29918, 29896, 742, 525, 1688, 29918, 29906, 742, 525, 1688, 29918, 29941, 742, 525, 1688, 29918, 29946, 742, 525, 1688, 29918, 29945, 2033, 29962, 13, 13, 1753, 1243, 29918, 16626, 29918, 6768, 29918, 9910, 10709, 7295, 13, 1678, 2471, 353, 14550, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 432, 666, 13, 29937, 28675, 263, 1353, 310, 2066, 411, 263, 3619, 10944, 13, 29937, 13, 29937, 8744, 29901, 13, 29937, 259, 6023, 1192, 13506, 529, 13506, 29958, 1192, 2798, 529, 2798, 29958, 13, 13, 29937, 29995, 463, 2069, 13, 1202, 29918, 4905, 877, 4905, 1495, 13, 29937, 29995, 355, 13, 13, 29937, 29995, 463, 6230, 13, 6768, 1839, 4905, 13359, 842, 29898, 3366, 29995, 29879, 29918, 29995, 29879, 29908, 1273, 313, 13506, 29892, 474, 29897, 363, 474, 297, 3464, 29898, 29896, 29892, 2302, 29889, 657, 29898, 524, 29897, 718, 29871, 29896, 29897, 2314, 13, 29937, 29995, 355, 13, 13, 29937, 29995, 463, 1899, 13, 1454, 921, 297, 6435, 4905, 3400, 437, 13, 1678, 6023, 395, 29916, 13, 15091, 13, 1678, 14550, 13, 1678, 5780, 353, 432, 666, 29889, 8504, 29889, 4081, 12229, 29889, 3166, 29918, 1807, 29898, 2154, 29897, 13, 1678, 5780, 29889, 2344, 580, 13, 1678, 4974, 5780, 338, 451, 6213, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 2943, 353, 282, 29889, 9057, 877, 1688, 2824, 3389, 29898, 10154, 29892, 10944, 2433, 1688, 742, 2302, 11759, 29896, 29892, 29871, 29906, 2314, 13, 1678, 4974, 2943, 338, 451, 6213, 13, 1678, 282, 29889, 18837, 580, 13, 1678, 274, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 13, 1678, 4974, 7431, 29898, 29886, 29897, 1275, 29871, 29906, 13, 1678, 2943, 29918, 29896, 353, 282, 29889, 657, 877, 1688, 29889, 29900, 1495, 13, 1678, 2943, 29918, 29906, 353, 282, 29889, 657, 877, 1688, 29889, 29896, 1495, 13, 1678, 4974, 2943, 29918, 29896, 29889, 4905, 1275, 2897, 29889, 2084, 29889, 7122, 29898, 29883, 9970, 29892, 525, 1688, 29918, 29896, 1495, 13, 1678, 4974, 2943, 29918, 29906, 29889, 4905, 1275, 518, 359, 29889, 2084, 29889, 7122, 29898, 29883, 9970, 29892, 921, 29897, 363, 921, 297, 13, 462, 632, 6024, 1688, 29918, 29896, 742, 525, 1688, 29918, 29906, 2033, 29962, 13, 13, 13, 1753, 1243, 29918, 12199, 29918, 11526, 29918, 2272, 29918, 7692, 29898, 7050, 3972, 1125, 13, 1678, 13128, 3972, 353, 851, 29898, 7050, 3972, 29897, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 1202, 29918, 5453, 877, 19057, 29914, 12199, 29918, 11526, 29914, 12199, 29918, 11526, 29889, 2272, 1495, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 16192, 29918, 7576, 580, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 9057, 29898, 3972, 29922, 7050, 3972, 467, 3389, 877, 7692, 29918, 12199, 29918, 11526, 29918, 2272, 1495, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29897, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29896, 13, 13, 13, 1753, 1243, 29918, 12199, 29918, 11526, 29918, 2272, 29918, 25932, 29898, 7050, 3972, 1125, 13, 1678, 13128, 3972, 353, 851, 29898, 7050, 3972, 29897, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 1202, 29918, 5453, 877, 19057, 29914, 12199, 29918, 11526, 29914, 12199, 29918, 11526, 29889, 2272, 1495, 13, 1678, 432, 666, 29889, 1557, 7310, 29889, 16192, 29918, 7576, 580, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 9057, 29898, 3972, 29922, 7050, 3972, 467, 3389, 877, 25932, 29918, 12199, 29918, 11526, 29918, 2272, 1495, 13, 1678, 17643, 353, 432, 666, 29889, 3258, 29918, 9057, 29879, 29898, 29886, 29897, 13, 1678, 4974, 7431, 29898, 9057, 29879, 29897, 1275, 29871, 29896, 13, 13, 13, 1753, 1243, 29918, 1445, 29918, 16747, 7295, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 2943, 353, 282, 29889, 3389, 877, 19057, 29914, 1445, 29918, 16747, 29889, 29926, 666, 742, 282, 2433, 1688, 742, 274, 29922, 29945, 29897, 13, 1678, 282, 29889, 18837, 580, 13, 1678, 274, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 432, 353, 2897, 29889, 2084, 29889, 7122, 13, 1678, 4974, 2943, 29889, 4905, 1275, 518, 13, 4706, 432, 29898, 29883, 9970, 29892, 525, 1688, 29918, 29915, 718, 921, 29897, 363, 921, 297, 6024, 29896, 742, 525, 29906, 742, 525, 29941, 742, 525, 29946, 742, 525, 29945, 2033, 13, 1678, 4514, 13, 13, 13, 1753, 1243, 29918, 13096, 5570, 29918, 517, 29918, 13096, 5570, 29918, 12864, 29918, 311, 1397, 362, 7295, 13, 1678, 732, 29926, 666, 29889, 10154, 877, 3874, 412, 29918, 17797, 29918, 2248, 1495, 13, 1678, 770, 15170, 3220, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 402, 12665, 11374, 261, 5780, 13, 13, 4706, 10783, 482, 29901, 13, 9651, 7055, 29918, 2248, 448, 29875, 529, 1885, 608, 29958, 21069, 29877, 529, 1885, 608, 29918, 2248, 29958, 29962, 13, 13, 4706, 25186, 29901, 13, 9651, 448, 29877, 29892, 1192, 4905, 529, 1885, 608, 29918, 2248, 29958, 29871, 450, 1962, 402, 12665, 2380, 934, 13, 462, 462, 308, 518, 4381, 29901, 6435, 2080, 29989, 1062, 1836, 17797, 29962, 13, 9651, 448, 29875, 29892, 1192, 2080, 529, 1885, 608, 29958, 308, 450, 5172, 29874, 934, 363, 278, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 9651, 736, 376, 13067, 613, 376, 17797, 8504, 2380, 6435, 6768, 580, 5038, 13, 13, 1678, 732, 29926, 666, 29889, 10154, 877, 3874, 412, 29918, 17797, 29918, 27539, 1219, 324, 1495, 13, 1678, 770, 7055, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 402, 12665, 8504, 390, 3521, 11762, 341, 20304, 349, 23828, 13, 13, 4706, 10783, 482, 29901, 13, 9651, 7055, 448, 29888, 529, 11255, 29939, 29918, 1445, 29958, 448, 29875, 529, 1885, 608, 29918, 2248, 29958, 13, 13, 4706, 10567, 29879, 29901, 13, 9651, 448, 29888, 29892, 1192, 11255, 29939, 529, 11255, 29939, 29918, 1445, 29958, 29871, 450, 1881, 5172, 29939, 13, 9651, 448, 29875, 29892, 1192, 2248, 529, 1885, 608, 29918, 2248, 29958, 29871, 450, 402, 12665, 2380, 934, 363, 278, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 679, 29918, 6519, 29898, 1311, 1125, 13, 9651, 736, 525, 13067, 742, 525, 17797, 8504, 364, 1056, 29899, 13096, 5570, 6435, 6768, 580, 10162, 13, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 877, 3874, 412, 29918, 17797, 29918, 14669, 1495, 13, 1678, 770, 3789, 786, 29925, 23828, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 402, 12665, 18111, 6230, 16439, 13, 13, 4706, 8744, 29901, 13, 9651, 6230, 448, 29875, 529, 1885, 608, 29958, 13, 13, 4706, 25186, 29901, 13, 9651, 448, 29875, 29892, 1192, 2080, 529, 1885, 608, 29958, 29871, 450, 1881, 3407, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 2069, 29898, 1311, 1125, 13, 9651, 1583, 29889, 1202, 29918, 4905, 877, 2248, 742, 525, 5303, 2080, 29989, 1062, 1836, 17797, 1495, 13, 13, 4706, 822, 16439, 29898, 1311, 1125, 13, 9651, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 9651, 2380, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 2248, 742, 13, 462, 3986, 1881, 29922, 1311, 29889, 2080, 29892, 1962, 29922, 1311, 29889, 2248, 29897, 13, 9651, 282, 29889, 4703, 29898, 2997, 29879, 3101, 13, 9651, 736, 282, 13, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 1495, 13, 1678, 770, 4989, 412, 29925, 23828, 29898, 3318, 1125, 13, 4706, 9995, 29905, 13, 4706, 450, 2322, 18016, 3301, 29923, 390, 3521, 11762, 16439, 13, 13, 4706, 8744, 29901, 13, 9651, 364, 29876, 559, 29939, 448, 29888, 529, 11255, 29939, 29918, 1445, 29958, 448, 29887, 529, 1885, 608, 29958, 13, 13, 4706, 10567, 29879, 29901, 13, 9651, 448, 29888, 29892, 1192, 11255, 29939, 529, 11255, 29939, 29918, 1445, 29958, 4706, 450, 1881, 3407, 2531, 608, 13, 9651, 448, 29887, 29892, 1192, 1885, 608, 529, 1885, 608, 29918, 2248, 29958, 418, 450, 1881, 3407, 2531, 608, 13, 4706, 9995, 13, 4706, 822, 16439, 29898, 1311, 1125, 13, 9651, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 9651, 7055, 29918, 14669, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 14669, 742, 1881, 29922, 1311, 29889, 1885, 608, 29897, 13, 9651, 7055, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 27539, 1219, 324, 742, 2380, 29922, 17797, 29918, 14669, 29889, 2248, 29892, 13, 462, 4706, 5172, 29939, 29922, 1311, 29889, 11255, 29939, 29897, 13, 9651, 282, 29889, 4703, 29898, 2997, 29879, 3101, 13, 9651, 736, 282, 13, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 2943, 353, 282, 29889, 3389, 877, 3874, 412, 29918, 17797, 29918, 29878, 8971, 23828, 1495, 13, 1678, 2943, 29889, 11255, 29939, 353, 525, 949, 29879, 29918, 29896, 29889, 11255, 29939, 29889, 18828, 29915, 13, 1678, 2943, 29889, 1885, 608, 353, 525, 1885, 608, 29889, 5444, 29915, 13, 1678, 282, 29889, 18837, 29898, 15480, 29922, 8824, 29897, 13, 13, 1678, 2380, 353, 282, 29889, 657, 877, 2248, 1495, 13, 1678, 7055, 29918, 3177, 353, 282, 29889, 657, 877, 17797, 1495, 13, 1678, 274, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 432, 353, 2897, 29889, 2084, 29889, 7122, 13, 1678, 4974, 2380, 29889, 5349, 29918, 449, 17696, 29898, 17797, 29918, 3177, 29892, 1544, 29922, 877, 4905, 742, 525, 2248, 5477, 13, 462, 795, 995, 29922, 29926, 29898, 29883, 9970, 29892, 525, 1885, 608, 29889, 17797, 8785, 13, 13, 13, 1753, 1243, 29918, 1491, 17760, 29918, 262, 11506, 29918, 12864, 29918, 17863, 7295, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 580, 13, 1678, 822, 1014, 12864, 29918, 17760, 29898, 10154, 1125, 13, 4706, 9995, 4035, 12864, 13, 13, 4706, 8744, 29901, 13, 9651, 1014, 12864, 1192, 2080, 529, 2080, 29958, 13, 4706, 9995, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 282, 29889, 9057, 877, 3137, 2824, 13067, 877, 3137, 6435, 2080, 29913, 742, 1881, 29922, 10154, 29889, 2080, 29897, 13, 4706, 736, 282, 13, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 7738, 353, 282, 29889, 9057, 877, 16747, 2824, 13067, 877, 16747, 6435, 449, 1445, 29913, 742, 714, 1445, 2433, 449, 29889, 4130, 1495, 13, 1678, 282, 29889, 3389, 877, 1491, 12864, 29918, 17760, 742, 1881, 29922, 5498, 346, 29889, 449, 1445, 29897, 13, 1678, 282, 29889, 18837, 29898, 15480, 29922, 8824, 29897, 13, 1678, 6023, 353, 282, 29889, 657, 877, 16747, 1495, 13, 1678, 19375, 353, 282, 29889, 657, 877, 3137, 1495, 13, 1678, 274, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 432, 353, 2897, 29889, 2084, 29889, 7122, 13, 1678, 4974, 6023, 29889, 5349, 29918, 449, 17696, 29898, 3137, 29892, 1544, 29922, 877, 449, 1445, 742, 525, 2080, 5477, 13, 462, 795, 995, 29922, 29926, 29898, 29883, 9970, 29892, 525, 449, 29889, 4130, 8785, 13, 13, 13, 1753, 1243, 29918, 1491, 17760, 29918, 262, 11506, 29918, 12864, 29918, 17863, 29918, 17760, 29918, 517, 29918, 17760, 7295, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 580, 13, 1678, 822, 1014, 12864, 29918, 17760, 29918, 29896, 29898, 10154, 1125, 13, 4706, 9995, 4035, 12864, 13, 13, 4706, 8744, 29901, 13, 9651, 1014, 12864, 1192, 2080, 529, 2080, 29958, 1192, 4905, 529, 4905, 29958, 13, 4706, 9995, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 282, 29889, 9057, 877, 29886, 29896, 2824, 13067, 877, 16747, 742, 1881, 29922, 10154, 29889, 2080, 29892, 1962, 29922, 10154, 29889, 4905, 29897, 13, 4706, 736, 282, 13, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 580, 13, 1678, 822, 1014, 12864, 29918, 17760, 29918, 29906, 29898, 10154, 1125, 13, 4706, 9995, 4035, 12864, 13, 13, 4706, 8744, 29901, 13, 9651, 1014, 12864, 1192, 2080, 529, 2080, 29958, 1192, 4905, 529, 4905, 29958, 13, 4706, 9995, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 282, 29889, 9057, 877, 29886, 29906, 2824, 13067, 877, 16747, 742, 1881, 29922, 10154, 29889, 2080, 29892, 1962, 29922, 10154, 29889, 4905, 29897, 13, 4706, 736, 282, 13, 13, 1678, 732, 29926, 666, 29889, 13096, 5570, 580, 13, 1678, 822, 1014, 12864, 29918, 17760, 29918, 17743, 457, 29898, 10154, 1125, 13, 4706, 9995, 4035, 12864, 13, 13, 4706, 8744, 29901, 13, 9651, 1014, 12864, 1192, 2080, 529, 2080, 29958, 1192, 4905, 529, 4905, 29958, 13, 4706, 9995, 13, 4706, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 4706, 282, 29896, 353, 282, 29889, 3389, 877, 1491, 12864, 29918, 17760, 29918, 29896, 742, 1881, 29922, 10154, 29889, 2080, 29892, 1962, 2433, 29886, 29896, 29889, 449, 1495, 13, 4706, 282, 29889, 3389, 877, 1491, 12864, 29918, 17760, 29918, 29906, 742, 1881, 29922, 29886, 29896, 29892, 1962, 29922, 10154, 29889, 4905, 29897, 13, 4706, 736, 282, 13, 13, 1678, 282, 353, 432, 666, 29889, 29925, 23828, 580, 13, 1678, 282, 29889, 3389, 877, 1491, 12864, 29918, 17760, 29918, 17743, 457, 742, 1881, 2433, 29874, 29889, 3945, 742, 1962, 543, 449, 29889, 4130, 1159, 13, 1678, 282, 29889, 18837, 29898, 15480, 29922, 8824, 29897, 13, 1678, 4974, 7431, 29898, 29886, 29897, 1275, 29871, 29906, 13, 1678, 282, 29896, 353, 282, 29889, 657, 877, 29886, 29896, 1495, 13, 1678, 282, 29906, 353, 282, 29889, 657, 877, 29886, 29906, 1495, 13, 1678, 274, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 432, 353, 2897, 29889, 2084, 29889, 7122, 13, 1678, 4974, 282, 29896, 29889, 5349, 29918, 449, 17696, 29898, 29886, 29906, 29897, 13, 1678, 4974, 282, 29896, 29889, 5349, 29918, 449, 17696, 29898, 29886, 29906, 29892, 995, 29922, 29926, 29898, 29883, 9970, 29892, 525, 449, 29889, 4130, 8785, 13, 1678, 4974, 282, 29896, 29889, 5349, 29918, 449, 17696, 29898, 29886, 29906, 29892, 1544, 29922, 877, 4905, 742, 525, 2080, 5477, 13, 462, 965, 995, 29922, 29926, 29898, 29883, 9970, 29892, 525, 29886, 29896, 29889, 449, 8785, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
freecodecamp/brownie/brownie_simple/scripts/deploy.py
People-Help-People/contract-collection
0
192094
from brownie import accounts, config, SimpleStorage, network import os def get_account(): if network.show_active() =="developement": account = accounts[0] else: # account = accounts.add(os.getenv("PRIVATE_KEY")) account = accounts.add(config["wallets"]["from_key"]) # account = accounts.load("test") return account def deploy_simple_storage(): account=get_account() simple_storage = SimpleStorage.deploy({"from": account}) transaction = simple_storage.store(1, {"from": account}) transaction.wait(1) print(simple_storage.retrieve()) def main(): deploy_simple_storage()
[ 1, 515, 3347, 2786, 1053, 15303, 29892, 2295, 29892, 12545, 10486, 29892, 3564, 30004, 13, 30004, 13, 5215, 2897, 30004, 13, 30004, 13, 30004, 13, 1753, 679, 29918, 10149, 7295, 1678, 6756, 13, 1678, 565, 3564, 29889, 4294, 29918, 4925, 580, 353, 543, 4888, 882, 1115, 30004, 13, 4706, 3633, 353, 15303, 29961, 29900, 29962, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 396, 3633, 353, 15303, 29889, 1202, 29898, 359, 29889, 657, 6272, 703, 29829, 29963, 3040, 29918, 10818, 5783, 30004, 13, 4706, 3633, 353, 15303, 29889, 1202, 29898, 2917, 3366, 14625, 10376, 3108, 3366, 3166, 29918, 1989, 20068, 30004, 13, 4706, 396, 3633, 353, 15303, 29889, 1359, 703, 1688, 1159, 30004, 13, 1678, 736, 3633, 30004, 13, 30004, 13, 30004, 13, 1753, 7246, 29918, 12857, 29918, 12925, 7295, 30004, 13, 1678, 3633, 29922, 657, 29918, 10149, 26471, 13, 1678, 2560, 29918, 12925, 353, 12545, 10486, 29889, 16519, 3319, 29908, 3166, 1115, 3633, 1800, 30004, 13, 1678, 10804, 353, 2560, 29918, 12925, 29889, 8899, 29898, 29896, 29892, 8853, 3166, 1115, 3633, 1800, 30004, 13, 1678, 10804, 29889, 10685, 29898, 29896, 8443, 13, 1678, 1596, 29898, 12857, 29918, 12925, 29889, 276, 509, 2418, 3101, 30004, 13, 30004, 13, 30004, 13, 1753, 1667, 7295, 30004, 13, 1678, 7246, 29918, 12857, 29918, 12925, 26471, 13, 2 ]
Data_Sending_raspberrypi/pl1.py
rsk97/Web-GIS-smart-irrigation
0
94463
<gh_stars>0 #/usr/bin/python import serial import requests from selenium import webdriver import urllib mail = 0 def sendmail(SM1,SM2,WL): import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText fromaddr = "<EMAIL>" toaddr = "<EMAIL>" msg = MIMEMultipart() msg['From'] = fromaddr msg['To'] = toaddr msg['Subject'] = "Farm details" body="" m1="PLANT 1 IS DYING!!!" m2="PLANT 2 IS DYING!!!" m3="PLANT 1 IS HEALTHY" m4="PLANT 2 IS HEALTHY" if mail==1: body=m1+m4 elif mail==2: body=m2+m3 elif mail==3: body=m1+m2 elif mail==0: body=m3+m4 msg.attach(MIMEText(body, 'plain')) server = smtplib.SMTP('smtp.gmail.com', 587) server.starttls() server.login(fromaddr, "arshad9991") text = msg.as_string() server.sendmail(fromaddr, toaddr, text) server.quit() ser=serial.Serial('/dev/ttyACM0', 9600) while(1): data=ser.readline() f = open("/home/pi/Desktop/check","a") f.write(data+"\n") x=data.split(" ") print(x) print(data) sm1=int(x[3]) sm2=int(x[4]) wlev=float(x[5]) status = 0 if(sm1<0 and sm2 >0): status = 1 if(sm1>0 and sm2<0): status = 2 if(sm1<0 and sm2<0): status =3 if(status != mail): mail=status sendmail(int(x[3]),int(x[4]),int(x[2])) if(len(x)==6): mark=0 for i in range(6): try: d=float(x[i]) except: print(i) mark=1 break if(mark==1): print("ERROR") continue print("SENT") try: urllib.urlopen("http://ad07.pythonanywhere.com/plants/getWaterLevel?level="+x[5]+"&rain="+x[4]); urllib.urlopen("http://ad07.pythonanywhere.com/plants/getdata?t="+str(x[1])+"&plantID=1&h="+x[0]+"&s="+x[2]); urllib.urlopen("http://ad07.pythonanywhere.com/plants/getdata?t="+str(x[1])+"&plantID=2&h="+x[0]+"&s="+x[3]); except: pass #browser.get("http://10.0.3.23:9090/plants/getdata?t="+str(x[1])+"&plantID=2&h="+x[0]+"&s="+x[-2] ); #print("http://10.0.3.23:9090/plants/getdata?t="+str(x[1])+"&plantID=2&h="+x[0]+"&s="+x[-2]); #browser.get("http://10.0.3.23:9090/plants/getdata?t="+str(x[1])+"&plantID=1&h="+x[0]+"&s="+x[2]); #browser.get("http://10.0.3.23:9090/plants/getdata?t="+str(x[1])+"&plantID=2&h="+x[0]+"&s="+x[-2]); #browser.get("http://10.0.3.23:9090/plants/getWaterLevel?level="+x[5]+"&rain="+x[4]); print(x[-1])
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 29914, 4855, 29914, 2109, 29914, 4691, 13, 5215, 7797, 13, 5215, 7274, 13, 13, 3166, 18866, 1053, 1856, 9465, 13, 5215, 3142, 1982, 13, 13, 2549, 353, 29871, 29900, 13, 13, 13, 1753, 3638, 2549, 29898, 17061, 29896, 29892, 17061, 29906, 29892, 29956, 29931, 1125, 13, 13, 12, 5215, 1560, 9392, 1982, 12, 13, 12, 3166, 4876, 29889, 29885, 603, 29889, 18056, 442, 1053, 341, 8890, 6857, 27494, 13, 12, 3166, 4876, 29889, 29885, 603, 29889, 726, 1053, 341, 8890, 1626, 13, 12, 3166, 10030, 353, 9872, 26862, 6227, 11903, 13, 12, 517, 10030, 353, 9872, 26862, 6227, 11903, 13, 12, 7645, 353, 341, 8890, 6857, 27494, 580, 13, 12, 7645, 1839, 4591, 2033, 353, 515, 10030, 13, 12, 7645, 1839, 1762, 2033, 353, 304, 10030, 13, 12, 7645, 1839, 20622, 2033, 353, 376, 29943, 2817, 4902, 29908, 13, 12, 2587, 13776, 13, 13, 12, 29885, 29896, 543, 7390, 13566, 29871, 29896, 8519, 360, 29979, 4214, 6824, 3850, 13, 12, 29885, 29906, 543, 7390, 13566, 29871, 29906, 8519, 360, 29979, 4214, 6824, 3850, 13, 12, 29885, 29941, 543, 7390, 13566, 29871, 29896, 8519, 17714, 1964, 4690, 29979, 29908, 13, 12, 29885, 29946, 543, 7390, 13566, 29871, 29906, 8519, 17714, 1964, 4690, 29979, 29908, 268, 13, 13, 12, 361, 10524, 1360, 29896, 29901, 13, 12, 12, 2587, 29922, 29885, 29896, 29974, 29885, 29946, 13, 12, 23681, 10524, 1360, 29906, 29901, 13, 12, 12, 2587, 29922, 29885, 29906, 29974, 29885, 29941, 13, 12, 23681, 10524, 1360, 29941, 29901, 13, 12, 12, 2587, 29922, 29885, 29896, 29974, 29885, 29906, 13, 12, 23681, 10524, 1360, 29900, 29901, 13, 12, 12, 2587, 29922, 29885, 29941, 29974, 29885, 29946, 13, 13, 12, 7645, 29889, 14930, 29898, 29924, 8890, 1626, 29898, 2587, 29892, 525, 24595, 8785, 13, 12, 2974, 353, 1560, 9392, 1982, 29889, 17061, 3557, 877, 3844, 9392, 29889, 21980, 29889, 510, 742, 29871, 29945, 29947, 29955, 29897, 13, 12, 2974, 29889, 2962, 29873, 3137, 580, 13, 12, 2974, 29889, 7507, 29898, 3166, 10030, 29892, 376, 279, 845, 328, 29929, 29929, 29929, 29896, 1159, 13, 12, 726, 353, 10191, 29889, 294, 29918, 1807, 580, 13, 12, 2974, 29889, 6717, 2549, 29898, 3166, 10030, 29892, 304, 10030, 29892, 1426, 29897, 13, 12, 2974, 29889, 28358, 580, 13, 13, 643, 29922, 15550, 29889, 9125, 11219, 3359, 29914, 4349, 2477, 29924, 29900, 742, 29871, 29929, 29953, 29900, 29900, 29897, 13, 13, 13, 13, 8000, 29898, 29896, 1125, 13, 12, 1272, 29922, 643, 29889, 949, 1220, 580, 13, 12, 29888, 353, 1722, 11974, 5184, 29914, 1631, 29914, 17600, 29914, 3198, 3284, 29874, 1159, 13, 12, 29888, 29889, 3539, 29898, 1272, 13578, 29905, 29876, 1159, 13, 12, 29916, 29922, 1272, 29889, 5451, 703, 16521, 13, 12, 2158, 29898, 29916, 29897, 13, 12, 2158, 29898, 1272, 29897, 13, 12, 3844, 29896, 29922, 524, 29898, 29916, 29961, 29941, 2314, 13, 12, 3844, 29906, 29922, 524, 29898, 29916, 29961, 29946, 2314, 13, 12, 29893, 2608, 29922, 7411, 29898, 29916, 29961, 29945, 2314, 13, 12, 4882, 353, 29871, 29900, 13, 12, 361, 29898, 3844, 29896, 29966, 29900, 322, 1560, 29906, 1405, 29900, 1125, 13, 12, 12, 4882, 353, 29871, 29896, 13, 12, 361, 29898, 3844, 29896, 29958, 29900, 322, 1560, 29906, 29966, 29900, 1125, 13, 12, 12, 4882, 353, 29871, 29906, 13, 12, 361, 29898, 3844, 29896, 29966, 29900, 322, 1560, 29906, 29966, 29900, 1125, 13, 12, 12, 4882, 353, 29941, 13, 12, 361, 29898, 4882, 2804, 10524, 1125, 13, 12, 12, 2549, 29922, 4882, 13, 12, 12, 6717, 2549, 29898, 524, 29898, 29916, 29961, 29941, 11724, 524, 29898, 29916, 29961, 29946, 11724, 524, 29898, 29916, 29961, 29906, 12622, 13, 12, 361, 29898, 2435, 29898, 29916, 29897, 1360, 29953, 1125, 13, 12, 12, 3502, 29922, 29900, 13, 12, 12, 1454, 474, 297, 3464, 29898, 29953, 1125, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 29881, 29922, 7411, 29898, 29916, 29961, 29875, 2314, 13, 12, 12, 12, 19499, 29901, 13, 12, 12, 12, 12, 2158, 29898, 29875, 29897, 13, 12, 12, 12, 12, 3502, 29922, 29896, 13, 12, 12, 12, 12, 8690, 13, 12, 12, 361, 29898, 3502, 1360, 29896, 1125, 13, 12, 12, 12, 2158, 703, 11432, 1159, 13, 12, 12, 12, 19878, 13, 12, 12, 2158, 703, 29903, 3919, 1159, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 2271, 1982, 29889, 332, 417, 2238, 703, 1124, 597, 328, 29900, 29955, 29889, 4691, 1384, 3062, 29889, 510, 29914, 572, 1934, 29914, 657, 29956, 1008, 10108, 29973, 5563, 543, 29974, 29916, 29961, 29945, 10062, 29908, 29987, 6038, 543, 29974, 29916, 29961, 29946, 5691, 13, 12, 12, 12, 2271, 1982, 29889, 332, 417, 2238, 703, 1124, 597, 328, 29900, 29955, 29889, 4691, 1384, 3062, 29889, 510, 29914, 572, 1934, 29914, 657, 1272, 29973, 29873, 543, 29974, 710, 29898, 29916, 29961, 29896, 2314, 13578, 29987, 24389, 1367, 29922, 29896, 29987, 29882, 543, 29974, 29916, 29961, 29900, 10062, 29908, 29987, 29879, 543, 29974, 29916, 29961, 29906, 5691, 13, 12, 12, 12, 2271, 1982, 29889, 332, 417, 2238, 703, 1124, 597, 328, 29900, 29955, 29889, 4691, 1384, 3062, 29889, 510, 29914, 572, 1934, 29914, 657, 1272, 29973, 29873, 543, 29974, 710, 29898, 29916, 29961, 29896, 2314, 13578, 29987, 24389, 1367, 29922, 29906, 29987, 29882, 543, 29974, 29916, 29961, 29900, 10062, 29908, 29987, 29879, 543, 29974, 29916, 29961, 29941, 5691, 13, 12, 12, 19499, 29901, 13, 12, 12, 12, 3364, 13, 12, 12, 29937, 15965, 29889, 657, 703, 1124, 597, 29896, 29900, 29889, 29900, 29889, 29941, 29889, 29906, 29941, 29901, 29929, 29900, 29929, 29900, 29914, 572, 1934, 29914, 657, 1272, 29973, 29873, 543, 29974, 710, 29898, 29916, 29961, 29896, 2314, 13578, 29987, 24389, 1367, 29922, 29906, 29987, 29882, 543, 29974, 29916, 29961, 29900, 10062, 29908, 29987, 29879, 543, 29974, 29916, 14352, 29906, 29962, 3482, 13, 12, 12, 29937, 2158, 703, 1124, 597, 29896, 29900, 29889, 29900, 29889, 29941, 29889, 29906, 29941, 29901, 29929, 29900, 29929, 29900, 29914, 572, 1934, 29914, 657, 1272, 29973, 29873, 543, 29974, 710, 29898, 29916, 29961, 29896, 2314, 13578, 29987, 24389, 1367, 29922, 29906, 29987, 29882, 543, 29974, 29916, 29961, 29900, 10062, 29908, 29987, 29879, 543, 29974, 29916, 14352, 29906, 5691, 13, 12, 12, 29937, 15965, 29889, 657, 703, 1124, 597, 29896, 29900, 29889, 29900, 29889, 29941, 29889, 29906, 29941, 29901, 29929, 29900, 29929, 29900, 29914, 572, 1934, 29914, 657, 1272, 29973, 29873, 543, 29974, 710, 29898, 29916, 29961, 29896, 2314, 13578, 29987, 24389, 1367, 29922, 29896, 29987, 29882, 543, 29974, 29916, 29961, 29900, 10062, 29908, 29987, 29879, 543, 29974, 29916, 29961, 29906, 5691, 13, 12, 12, 29937, 15965, 29889, 657, 703, 1124, 597, 29896, 29900, 29889, 29900, 29889, 29941, 29889, 29906, 29941, 29901, 29929, 29900, 29929, 29900, 29914, 572, 1934, 29914, 657, 1272, 29973, 29873, 543, 29974, 710, 29898, 29916, 29961, 29896, 2314, 13578, 29987, 24389, 1367, 29922, 29906, 29987, 29882, 543, 29974, 29916, 29961, 29900, 10062, 29908, 29987, 29879, 543, 29974, 29916, 14352, 29906, 5691, 13, 12, 12, 29937, 15965, 29889, 657, 703, 1124, 597, 29896, 29900, 29889, 29900, 29889, 29941, 29889, 29906, 29941, 29901, 29929, 29900, 29929, 29900, 29914, 572, 1934, 29914, 657, 29956, 1008, 10108, 29973, 5563, 543, 29974, 29916, 29961, 29945, 10062, 29908, 29987, 6038, 543, 29974, 29916, 29961, 29946, 5691, 13, 12, 12, 2158, 29898, 29916, 14352, 29896, 2314, 13, 2 ]
main.py
ARCJ137442/makeFolderTenser
0
54508
<gh_stars>0 ''' README: 本程序用于创建一系列的「索引文件夹」, 其相当于一个索引矩阵(可能是「张量」),其包含的值(本质上是集合,但一般是文件)使用一个特定的序列(等价于一个向量)进行访问; 原理/作用/用途:通过增大其他用户逐一检索文件夹之难度以「隐藏」部分文件夹或文件 待补 ''' import os #此函数来源于网络 def mkdir(path): # 引入模块 import os # 去除首尾空格 path=path.strip() # 去除尾部 \ 符号 path=path.rstrip("\\") # 判断路径是否存在 # 存在 True # 不存在 False isExists=os.path.exists(path) # 判断结果 if not isExists: # 如果不存在则创建目录 # 创建目录操作函数 os.makedirs(path) print(path+' 创建成功') return True else: # 如果目录存在则不创建,并提示目录已存在 print(path+'目录已存在') return False #此函数用于按字符批量生成文件夹,根目录末尾可以不带「/」 #示例:path='C:\dir\',nums='gbv^4%faw1' def makeDirsByChar(path,chars): root=path.strip().rstrip("\\") for i in chars: mkdir(root+'\\'+str(i)) #此函数用于按照整数序列生成n个文件夹 #示例:path='C:\',num=9 def makeDirVector(path,num): root=path.strip().rstrip("\\") for i in range(num): mkdir(root+'\\'+str(i)) #此函数用于按照0~9的整数序列生成文件夹「张量」,使用递归以支持任意长度(多起来仍然很恐怖,建议少于5层) #示例:path='C:\',nums='1321' def makeDirTenser(path,nums): root=path.strip().rstrip("\\") #print("正在尝试用%s生成%s"%(nums,root)) if len(nums)>1: for i in range(int(nums[0])): makeDirTenser(path+'\\%s\\'%i,nums[1:]) else: makeDirVector(path,int(nums)) #直接打开程序的预设功能(分别对应前面三个函数:字串、向量、张量) if __name__ == "__main__": # 字串 print("切换到字串模式。。。") root=input("输入根路径(默认为chars):") if root=='':root=r"chars" value=input("输入字串参数(留空以跳过):") if value!='': makeDirsByChar(root,value) # 向量 print("切换到向量模式。。。") root=input("输入根路径(默认为vecter):") if root=='':root=r"vecter" value=input("输入文件夹数量(留空以跳过):") if value!='': makeDirVector(root,int(value)) # 张量 print("切换到张量模式。。。") root=input("输入根路径(默认为tenser):") if root=='':root=r"tenser" value=input("输入张量阶数序列(留空以跳过):") if value!='': makeDirTenser(root,value) ''' -并没有什么用的末尾注释- '''
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 12008, 13, 16310, 2303, 29901, 13, 30346, 31101, 31463, 30406, 30909, 31441, 30886, 30287, 31185, 31025, 30210, 30481, 31836, 31674, 30333, 30631, 232, 167, 188, 30482, 30214, 13, 31149, 30990, 30948, 30909, 30287, 30502, 31836, 31674, 234, 162, 172, 236, 155, 184, 30419, 30682, 30815, 30392, 30481, 31328, 31180, 30482, 30409, 30214, 31149, 31473, 232, 147, 174, 30210, 30959, 30419, 30346, 235, 183, 171, 30429, 30392, 30893, 30733, 30214, 231, 192, 137, 30287, 235, 139, 175, 30392, 30333, 30631, 30409, 30785, 30406, 30287, 30502, 31141, 30495, 30210, 31463, 31025, 30419, 31184, 231, 190, 186, 30909, 30287, 30502, 31331, 31180, 30409, 31174, 30448, 235, 177, 194, 31658, 31608, 13, 30667, 30687, 29914, 30732, 30406, 29914, 30406, 236, 131, 151, 30383, 30768, 31138, 232, 165, 161, 30257, 31149, 31221, 30406, 31229, 236, 131, 147, 30287, 233, 166, 131, 31836, 30333, 30631, 232, 167, 188, 30577, 236, 157, 193, 30898, 30651, 30481, 236, 157, 147, 31707, 30482, 30636, 30748, 30333, 30631, 232, 167, 188, 31391, 30333, 30631, 13, 13, 232, 193, 136, 235, 164, 168, 13, 12008, 13, 13, 5215, 2897, 13, 13, 29937, 31389, 31629, 30354, 30805, 31193, 30909, 31222, 234, 190, 159, 13, 1753, 29356, 29898, 2084, 1125, 13, 1678, 396, 29871, 31674, 30752, 31382, 232, 160, 154, 13, 1678, 1053, 2897, 13, 29871, 13, 1678, 396, 29871, 31475, 31152, 31688, 31631, 30816, 31168, 13, 1678, 2224, 29922, 2084, 29889, 17010, 580, 13, 1678, 396, 29871, 31475, 31152, 31631, 30636, 320, 29871, 31277, 30850, 13, 1678, 2224, 29922, 2084, 29889, 29878, 17010, 703, 1966, 1159, 13, 29871, 13, 1678, 396, 29871, 31791, 31683, 30874, 232, 193, 135, 30392, 31191, 30946, 30505, 13, 1678, 396, 29871, 30946, 30505, 268, 5852, 13, 1678, 396, 29871, 30413, 30946, 30505, 259, 7700, 13, 1678, 338, 24217, 29922, 359, 29889, 2084, 29889, 9933, 29898, 2084, 29897, 13, 29871, 13, 1678, 396, 29871, 31791, 31683, 31320, 30801, 13, 1678, 565, 451, 338, 24217, 29901, 13, 4706, 396, 29871, 30847, 30801, 30413, 30946, 30505, 31403, 31441, 30886, 30895, 31283, 13, 4706, 396, 29871, 31441, 30886, 30895, 31283, 31904, 30732, 31629, 30354, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 2084, 29897, 29871, 13, 29871, 13, 4706, 1596, 29898, 2084, 23097, 29871, 31441, 30886, 30494, 31134, 1495, 13, 4706, 736, 5852, 13, 1678, 1683, 29901, 13, 4706, 396, 29871, 30847, 30801, 30895, 31283, 30946, 30505, 31403, 30413, 31441, 30886, 30214, 31666, 31302, 30858, 30895, 31283, 31290, 30946, 30505, 13, 4706, 1596, 29898, 2084, 23097, 30895, 31283, 31290, 30946, 30505, 1495, 13, 4706, 736, 7700, 13, 13, 29937, 31389, 31629, 30354, 30406, 30909, 31590, 30578, 31277, 233, 140, 188, 31180, 30486, 30494, 30333, 30631, 232, 167, 188, 30214, 31393, 30895, 31283, 233, 159, 174, 31631, 30682, 30651, 30413, 232, 187, 169, 30481, 29914, 30482, 13, 29937, 30858, 31507, 30383, 2084, 2433, 29907, 3583, 3972, 29905, 742, 1949, 29879, 2433, 26300, 29894, 29985, 29946, 29995, 29888, 1450, 29896, 29915, 13, 1753, 1207, 9170, 20966, 5914, 29898, 2084, 29892, 305, 1503, 1125, 13, 1678, 3876, 29922, 2084, 29889, 17010, 2141, 29878, 17010, 703, 1966, 1159, 13, 1678, 363, 474, 297, 22524, 29901, 13, 4706, 29356, 29898, 4632, 23097, 1966, 18717, 710, 29898, 29875, 876, 13, 13, 29937, 31389, 31629, 30354, 30406, 30909, 31590, 234, 136, 170, 233, 152, 183, 30354, 31463, 31025, 30486, 30494, 29876, 30502, 30333, 30631, 232, 167, 188, 13, 29937, 30858, 31507, 30383, 2084, 2433, 29907, 3583, 742, 1949, 29922, 29929, 13, 1753, 1207, 9170, 12877, 29898, 2084, 29892, 1949, 1125, 13, 1678, 3876, 29922, 2084, 29889, 17010, 2141, 29878, 17010, 703, 1966, 1159, 13, 1678, 363, 474, 297, 3464, 29898, 1949, 1125, 13, 4706, 29356, 29898, 4632, 23097, 1966, 18717, 710, 29898, 29875, 876, 13, 13, 29937, 31389, 31629, 30354, 30406, 30909, 31590, 234, 136, 170, 29900, 30022, 29929, 30210, 233, 152, 183, 30354, 31463, 31025, 30486, 30494, 30333, 30631, 232, 167, 188, 30481, 31328, 31180, 30482, 30214, 30785, 30406, 236, 131, 149, 232, 192, 149, 30651, 31541, 31695, 31450, 31474, 31143, 30898, 30419, 30923, 31558, 30805, 231, 190, 144, 31516, 232, 193, 139, 233, 132, 147, 233, 131, 153, 30214, 30886, 235, 177, 177, 31022, 30909, 29945, 232, 180, 133, 30409, 13, 29937, 30858, 31507, 30383, 2084, 2433, 29907, 3583, 742, 1949, 29879, 2433, 29896, 29941, 29906, 29896, 29915, 13, 1753, 1207, 9170, 29911, 25594, 29898, 2084, 29892, 1949, 29879, 1125, 13, 1678, 3876, 29922, 2084, 29889, 17010, 2141, 29878, 17010, 703, 1966, 1159, 13, 1678, 396, 2158, 703, 30724, 30505, 232, 179, 160, 31787, 30406, 29995, 29879, 30486, 30494, 29995, 29879, 29908, 29995, 29898, 1949, 29879, 29892, 4632, 876, 13, 1678, 565, 7431, 29898, 1949, 29879, 15410, 29896, 29901, 13, 4706, 363, 474, 297, 3464, 29898, 524, 29898, 1949, 29879, 29961, 29900, 12622, 29901, 13, 9651, 1207, 9170, 29911, 25594, 29898, 2084, 23097, 1966, 29995, 29879, 1966, 29915, 29995, 29875, 29892, 1949, 29879, 29961, 29896, 29901, 2314, 13, 1678, 1683, 29901, 13, 4706, 1207, 9170, 12877, 29898, 2084, 29892, 524, 29898, 1949, 29879, 876, 13, 13, 29937, 31157, 31092, 31656, 31026, 31101, 31463, 30210, 236, 165, 135, 30872, 31134, 30815, 30419, 30748, 232, 139, 174, 30783, 31370, 30658, 30806, 30457, 30502, 31629, 30354, 30383, 30578, 31767, 30330, 31331, 31180, 30330, 31328, 31180, 30409, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 396, 29871, 30578, 31767, 13, 1678, 1596, 703, 31757, 31640, 30780, 30578, 31767, 31382, 30607, 30267, 30267, 30267, 1159, 13, 1678, 3876, 29922, 2080, 703, 31573, 30752, 31393, 30874, 232, 193, 135, 30419, 31735, 31439, 30573, 305, 1503, 30409, 30383, 1159, 13, 1678, 565, 3876, 1360, 29915, 2396, 4632, 29922, 29878, 29908, 305, 1503, 29908, 13, 1678, 995, 29922, 2080, 703, 31573, 30752, 30578, 31767, 31125, 30354, 30419, 234, 152, 156, 30816, 30651, 235, 186, 182, 31138, 30409, 30383, 1159, 13, 1678, 565, 995, 29991, 2433, 2396, 1207, 9170, 20966, 5914, 29898, 4632, 29892, 1767, 29897, 13, 1678, 396, 29871, 31331, 31180, 13, 1678, 1596, 703, 31757, 31640, 30780, 31331, 31180, 31382, 30607, 30267, 30267, 30267, 1159, 13, 1678, 3876, 29922, 2080, 703, 31573, 30752, 31393, 30874, 232, 193, 135, 30419, 31735, 31439, 30573, 345, 312, 261, 30409, 30383, 1159, 13, 1678, 565, 3876, 1360, 29915, 2396, 4632, 29922, 29878, 29908, 345, 312, 261, 29908, 13, 1678, 995, 29922, 2080, 703, 31573, 30752, 30333, 30631, 232, 167, 188, 30354, 31180, 30419, 234, 152, 156, 30816, 30651, 235, 186, 182, 31138, 30409, 30383, 1159, 13, 1678, 565, 995, 29991, 2433, 2396, 1207, 9170, 12877, 29898, 4632, 29892, 524, 29898, 1767, 876, 13, 1678, 396, 29871, 31328, 31180, 13, 1678, 1596, 703, 31757, 31640, 30780, 31328, 31180, 31382, 30607, 30267, 30267, 30267, 1159, 13, 1678, 3876, 29922, 2080, 703, 31573, 30752, 31393, 30874, 232, 193, 135, 30419, 31735, 31439, 30573, 29873, 25594, 30409, 30383, 1159, 13, 1678, 565, 3876, 1360, 29915, 2396, 4632, 29922, 29878, 29908, 29873, 25594, 29908, 13, 1678, 995, 29922, 2080, 703, 31573, 30752, 31328, 31180, 236, 155, 185, 30354, 31463, 31025, 30419, 234, 152, 156, 30816, 30651, 235, 186, 182, 31138, 30409, 30383, 1159, 13, 1678, 565, 995, 29991, 2433, 2396, 1207, 9170, 29911, 25594, 29898, 4632, 29892, 1767, 29897, 13, 13, 12008, 13, 29899, 31666, 31423, 30417, 231, 190, 131, 31882, 30406, 30210, 233, 159, 174, 31631, 31368, 236, 138, 141, 29899, 13, 12008, 13, 2 ]
var/spack/repos/builtin/packages/ferret/package.py
padamson/spack
2
74594
<reponame>padamson/spack<filename>var/spack/repos/builtin/packages/ferret/package.py # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * class Ferret(Package): """Ferret is an interactive computer visualization and analysis environment designed to meet the needs of oceanographers and meteorologists analyzing large and complex gridded data sets.""" homepage = "http://ferret.pmel.noaa.gov/Ferret/home" url = "https://github.com/NOAA-PMEL/Ferret/archive/v7.6.0.tar.gz" maintainers = ['RemiLacroix-IDRIS'] version('7.6.0', sha256='69832d740bd44c9eadd198a5de4d96c4c01ae90ae28c2c3414c1bb9f43e475d1') version('7.5.0', sha256='2a038c547e6e80e6bd0645a374c3247360cf8c94ea56f6f3444b533257eb16db') version('7.4', sha256='5167bb9e6ef441ae9cf90da555203d2155e3fcf929e7b8dddb237de0d58c5e5f') version('7.3', sha256='ae80a732c34156b5287a23696cf4ae4faf4de1dd705ff43cbb4168b05c6faaf4') version('7.2', sha256='21c339b1bafa6939fc869428d906451f130f7e77e828c532ab9488d51cf43095') version('6.96', sha256='7eb87156aa586cfe838ab83f08b2102598f9ab62062d540a5da8c9123816331a') variant('datasets', default=False, description="Install Ferret standard datasets") depends_on("hdf5+hl") depends_on("netcdf-c") depends_on("netcdf-fortran") depends_on("readline") depends_on("zlib") depends_on("libx11") depends_on("curl") # Make Java dependency optional with older versions of Ferret patch('https://github.com/NOAA-PMEL/Ferret/commit/c7eb70a0b17045c8ca7207d586bfea77a5340668.patch', sha256='5bd581db4578c013faed375844b206fbe71f93fe9ce60f8f9f41d64abc6a5972', level=1, working_dir='FERRET', when='@:6.99') resource(name='datasets', url='https://github.com/NOAA-PMEL/FerretDatasets/archive/v7.6.tar.gz', sha256='b2fef758ec1817c1c19e6225857ca3a82c727d209ed7fd4697d45c5533bb2c72', placement='fer_dsets', when='+datasets') def url_for_version(self, version): if version <= Version('7.2'): return 'ftp://ftp.pmel.noaa.gov/ferret/pub/source/fer_source.v{0}.tar.gz'.format( version.joined) else: return 'https://github.com/NOAA-PMEL/Ferret/archive/v{0}.tar.gz'.format(version) def patch(self): spec = self.spec hdf5_prefix = spec['hdf5'].prefix netcdff_prefix = spec['netcdf-fortran'].prefix readline_prefix = spec['readline'].prefix libz_prefix = spec['zlib'].prefix work_dir = 'FERRET' if '@:7.2' in spec else '.' with working_dir(work_dir, create=False): if '@7.3:' in spec: copy('site_specific.mk.in', 'site_specific.mk') copy('external_functions/ef_utility/site_specific.mk.in', 'external_functions/ef_utility/site_specific.mk') filter_file(r'^DIR_PREFIX.+', 'DIR_PREFIX = %s' % self.stage.source_path, 'site_specific.mk') # Setting this to blank not to force # using the static version of readline filter_file(r'^(READLINE_(LIB)?DIR).+', '\\1 = ', 'site_specific.mk') else: filter_file(r'^LIBZ_DIR.+', 'LIBZ_DIR = %s' % libz_prefix, 'site_specific.mk') filter_file(r'^JAVA_HOME.+', ' ', 'site_specific.mk') filter_file(r'^READLINE_DIR.+', 'READLINE_DIR = %s' % readline_prefix, 'site_specific.mk') filter_file(r'^BUILDTYPE.+', 'BUILDTYPE = x86_64-linux', 'site_specific.mk') filter_file(r'^INSTALL_FER_DIR.+', 'INSTALL_FER_DIR = %s' % spec.prefix, 'site_specific.mk') filter_file(r'^(HDF5_(LIB)?DIR).+', '\\1 = %s' % hdf5_prefix, 'site_specific.mk') filter_file(r'^(NETCDF4?_(LIB)?DIR).+', '\\1 = %s' % netcdff_prefix, 'site_specific.mk') if '@:7.3' in spec: # Don't force using the static version of libz filter_file(r'\$\(LIBZ_DIR\)/lib64/libz.a', '-lz', 'platform_specific.mk.x86_64-linux') # Don't force using the static version of libgfortran filter_file(r'-Wl,-Bstatic -lgfortran -Wl,-Bdynamic', '-lgfortran', 'platform_specific.mk.x86_64-linux') # This prevents the rpaths to be properly set # by Spack's compiler wrappers filter_file(r'-v --verbose', '', 'platform_specific.mk.x86_64-linux') filter_file(r'^[ \t]*LD[ \t]*=.+', 'LD = %s' % spack_cc, 'platform_specific.mk.x86_64-linux') else: # Don't force using the static version of libgfortran filter_file(r'-static-libgfortran', '', 'platform_specific.mk.x86_64-linux') if '@:7.4' in spec: compilers_spec_file = 'platform_specific.mk.x86_64-linux' else: compilers_spec_file = 'site_specific.mk' # Make sure Ferret uses Spack's compiler wrappers filter_file(r'^[ \t]*CC[ \t]*=.+', 'CC = %s' % spack_cc, compilers_spec_file) filter_file(r'^[ \t]*CXX[ \t]*=.+', 'CXX = %s' % spack_cxx, compilers_spec_file) filter_file(r'^[ \t]*FC[ \t]*=.+', 'FC = %s' % spack_fc, compilers_spec_file) filter_file(r'^[ \t]*F77[ \t]*=.+', 'F77 = %s' % spack_f77, compilers_spec_file) filter_file(r'\$\(NETCDF4?_(LIB)?DIR\).*/libnetcdff.a', "-L%s -lnetcdff" % spec['netcdf-fortran'].prefix.lib, 'platform_specific.mk.x86_64-linux') filter_file(r'\$\(NETCDF4?_(LIB)?DIR\).*/libnetcdf.a', "-L%s -lnetcdf" % spec['netcdf-c'].prefix.lib, 'platform_specific.mk.x86_64-linux') filter_file(r'\$\(HDF5_(LIB)?DIR\).*/libhdf5_hl.a', "-L%s -lhdf5_hl" % spec['hdf5'].prefix.lib, 'platform_specific.mk.x86_64-linux') filter_file(r'\$\(HDF5_(LIB)?DIR\).*/libhdf5.a', "-L%s -lhdf5" % spec['hdf5'].prefix.lib, 'platform_specific.mk.x86_64-linux') def install(self, spec, prefix): if 'LDFLAGS' in env and env['LDFLAGS']: env['LDFLAGS'] += ' ' + '-lquadmath' else: env['LDFLAGS'] = '-lquadmath' work_dir = 'FERRET' if '@:7.2' in self.spec else '.' with working_dir(work_dir, create=False): os.environ['LD_X11'] = '-L%s -lX11' % spec['libx11'].prefix.lib os.environ['HOSTTYPE'] = 'x86_64-linux' make(parallel=False) make("install") if '+datasets' in self.spec: mkdir(self.prefix.fer_dsets) install_tree('fer_dsets', self.prefix.fer_dsets) def setup_run_environment(self, env): env.set('FER_DIR', self.prefix) env.set('FER_GO', ' '.join(['.', self.prefix.go, self.prefix.examples, self.prefix.contrib])) env.set('FER_EXTERNAL_FUNCTIONS', self.prefix.ext_func.libs) env.set('FER_PALETTE', ' '.join(['.', self.prefix.ppl])) env.set('FER_FONTS', self.prefix.ppl.fonts) fer_data = ['.'] fer_descr = ['.'] fer_grids = ['.'] if '+datasets' in self.spec: env.set('FER_DSETS', self.prefix.fer_dsets) fer_data.append(self.prefix.fer_dsets.data) fer_descr.append(self.prefix.fer_dsets.descr) fer_grids.append(self.prefix.fer_dsets.grids) fer_data.extend([self.prefix.go, self.prefix.examples]) env.set('FER_DATA', ' '.join(fer_data)) env.set('FER_DESCR', ' '.join(fer_descr)) env.set('FER_GRIDS', ' '.join(fer_grids))
[ 1, 529, 276, 1112, 420, 29958, 8305, 314, 1100, 29914, 1028, 547, 29966, 9507, 29958, 1707, 29914, 1028, 547, 29914, 276, 1066, 29914, 16145, 262, 29914, 8318, 29914, 571, 2267, 29914, 5113, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29941, 29899, 29906, 29900, 29906, 29896, 19520, 22469, 5514, 3086, 14223, 29892, 365, 12182, 322, 916, 13, 29937, 1706, 547, 8010, 10682, 414, 29889, 2823, 278, 2246, 29899, 5563, 315, 4590, 29979, 22789, 3912, 934, 363, 4902, 29889, 13, 29937, 13, 29937, 10937, 29928, 29990, 29899, 29931, 293, 1947, 29899, 12889, 29901, 313, 17396, 1829, 29899, 29906, 29889, 29900, 6323, 341, 1806, 29897, 13, 13, 13, 5215, 2897, 13, 13, 3166, 805, 547, 1053, 334, 13, 13, 13, 1990, 7756, 2267, 29898, 14459, 1125, 13, 1678, 9995, 29943, 261, 2267, 338, 385, 28923, 6601, 7604, 2133, 322, 7418, 5177, 13, 539, 8688, 304, 5870, 278, 4225, 310, 23474, 1946, 414, 322, 27647, 1189, 2879, 13, 539, 29537, 292, 2919, 322, 4280, 867, 2205, 287, 848, 6166, 1213, 15945, 13, 1678, 3271, 3488, 353, 376, 1124, 597, 571, 2267, 29889, 3358, 295, 29889, 1217, 7340, 29889, 13513, 29914, 29943, 261, 2267, 29914, 5184, 29908, 13, 1678, 3142, 418, 353, 376, 991, 597, 3292, 29889, 510, 29914, 6632, 6344, 29899, 29925, 2303, 29931, 29914, 29943, 261, 2267, 29914, 10867, 29914, 29894, 29955, 29889, 29953, 29889, 29900, 29889, 12637, 29889, 18828, 29908, 13, 13, 1678, 7344, 414, 353, 6024, 7301, 29875, 29931, 562, 307, 861, 29899, 1367, 29934, 3235, 2033, 13, 13, 1678, 1873, 877, 29955, 29889, 29953, 29889, 29900, 742, 528, 29874, 29906, 29945, 29953, 2433, 29953, 29929, 29947, 29941, 29906, 29881, 29955, 29946, 29900, 6448, 29946, 29946, 29883, 29929, 29872, 1202, 29896, 29929, 29947, 29874, 29945, 311, 29946, 29881, 29929, 29953, 29883, 29946, 29883, 29900, 29896, 3660, 29929, 29900, 3660, 29906, 29947, 29883, 29906, 29883, 29941, 29946, 29896, 29946, 29883, 29896, 1327, 29929, 29888, 29946, 29941, 29872, 29946, 29955, 29945, 29881, 29896, 1495, 13, 1678, 1873, 877, 29955, 29889, 29945, 29889, 29900, 742, 528, 29874, 29906, 29945, 29953, 2433, 29906, 29874, 29900, 29941, 29947, 29883, 29945, 29946, 29955, 29872, 29953, 29872, 29947, 29900, 29872, 29953, 6448, 29900, 29953, 29946, 29945, 29874, 29941, 29955, 29946, 29883, 29941, 29906, 29946, 29955, 29941, 29953, 29900, 6854, 29947, 29883, 29929, 29946, 11248, 29945, 29953, 29888, 29953, 29888, 29941, 29946, 29946, 29946, 29890, 29945, 29941, 29941, 29906, 29945, 29955, 774, 29896, 29953, 2585, 1495, 13, 1678, 1873, 877, 29955, 29889, 29946, 742, 259, 528, 29874, 29906, 29945, 29953, 2433, 29945, 29896, 29953, 29955, 1327, 29929, 29872, 29953, 1389, 29946, 29946, 29896, 3660, 29929, 6854, 29929, 29900, 1388, 29945, 29945, 29945, 29906, 29900, 29941, 29881, 29906, 29896, 29945, 29945, 29872, 29941, 29888, 6854, 29929, 29906, 29929, 29872, 29955, 29890, 29947, 1289, 2585, 29906, 29941, 29955, 311, 29900, 29881, 29945, 29947, 29883, 29945, 29872, 29945, 29888, 1495, 13, 1678, 1873, 877, 29955, 29889, 29941, 742, 259, 528, 29874, 29906, 29945, 29953, 2433, 3660, 29947, 29900, 29874, 29955, 29941, 29906, 29883, 29941, 29946, 29896, 29945, 29953, 29890, 29945, 29906, 29947, 29955, 29874, 29906, 29941, 29953, 29929, 29953, 6854, 29946, 3660, 29946, 29888, 2142, 29946, 311, 29896, 1289, 29955, 29900, 29945, 600, 29946, 29941, 29883, 1327, 29946, 29896, 29953, 29947, 29890, 29900, 29945, 29883, 29953, 5444, 2142, 29946, 1495, 13, 1678, 1873, 877, 29955, 29889, 29906, 742, 259, 528, 29874, 29906, 29945, 29953, 2433, 29906, 29896, 29883, 29941, 29941, 29929, 29890, 29896, 29890, 2142, 29874, 29953, 29929, 29941, 29929, 13801, 29947, 29953, 29929, 29946, 29906, 29947, 29881, 29929, 29900, 29953, 29946, 29945, 29896, 29888, 29896, 29941, 29900, 29888, 29955, 29872, 29955, 29955, 29872, 29947, 29906, 29947, 29883, 29945, 29941, 29906, 370, 29929, 29946, 29947, 29947, 29881, 29945, 29896, 6854, 29946, 29941, 29900, 29929, 29945, 1495, 13, 1678, 1873, 877, 29953, 29889, 29929, 29953, 742, 29871, 528, 29874, 29906, 29945, 29953, 2433, 29955, 774, 29947, 29955, 29896, 29945, 29953, 7340, 29945, 29947, 29953, 29883, 1725, 29947, 29941, 29947, 370, 29947, 29941, 29888, 29900, 29947, 29890, 29906, 29896, 29900, 29906, 29945, 29929, 29947, 29888, 29929, 370, 29953, 29906, 29900, 29953, 29906, 29881, 29945, 29946, 29900, 29874, 29945, 1388, 29947, 29883, 29929, 29896, 29906, 29941, 29947, 29896, 29953, 29941, 29941, 29896, 29874, 1495, 13, 13, 1678, 17305, 877, 14538, 1691, 742, 2322, 29922, 8824, 29892, 6139, 543, 23271, 7756, 2267, 3918, 20035, 1159, 13, 13, 1678, 7111, 29918, 265, 703, 29882, 2176, 29945, 29974, 4415, 1159, 13, 1678, 7111, 29918, 265, 703, 1212, 29883, 2176, 29899, 29883, 1159, 13, 1678, 7111, 29918, 265, 703, 1212, 29883, 2176, 29899, 3921, 661, 1159, 13, 1678, 7111, 29918, 265, 703, 949, 1220, 1159, 13, 1678, 7111, 29918, 265, 703, 29920, 1982, 1159, 13, 1678, 7111, 29918, 265, 703, 1982, 29916, 29896, 29896, 1159, 13, 1678, 7111, 29918, 265, 703, 18963, 1159, 13, 13, 1678, 396, 8561, 3355, 10609, 13136, 411, 9642, 6910, 310, 7756, 2267, 13, 1678, 13261, 877, 991, 597, 3292, 29889, 510, 29914, 6632, 6344, 29899, 29925, 2303, 29931, 29914, 29943, 261, 2267, 29914, 15060, 29914, 29883, 29955, 774, 29955, 29900, 29874, 29900, 29890, 29896, 29955, 29900, 29946, 29945, 29883, 29947, 1113, 29955, 29906, 29900, 29955, 29881, 29945, 29947, 29953, 1635, 11248, 29955, 29955, 29874, 29945, 29941, 29946, 29900, 29953, 29953, 29947, 29889, 5041, 742, 13, 3986, 528, 29874, 29906, 29945, 29953, 2433, 29945, 6448, 29945, 29947, 29896, 2585, 29946, 29945, 29955, 29947, 29883, 29900, 29896, 29941, 5444, 287, 29941, 29955, 29945, 29947, 29946, 29946, 29890, 29906, 29900, 29953, 29888, 915, 29955, 29896, 29888, 29929, 29941, 1725, 29929, 346, 29953, 29900, 29888, 29947, 29888, 29929, 29888, 29946, 29896, 29881, 29953, 29946, 10736, 29953, 29874, 29945, 29929, 29955, 29906, 742, 13, 3986, 3233, 29922, 29896, 29892, 1985, 29918, 3972, 2433, 29943, 1001, 1525, 29911, 742, 746, 2433, 29992, 29901, 29953, 29889, 29929, 29929, 1495, 13, 13, 1678, 6503, 29898, 978, 2433, 14538, 1691, 742, 13, 632, 3142, 2433, 991, 597, 3292, 29889, 510, 29914, 6632, 6344, 29899, 29925, 2303, 29931, 29914, 29943, 261, 2267, 16390, 294, 1691, 29914, 10867, 29914, 29894, 29955, 29889, 29953, 29889, 12637, 29889, 18828, 742, 13, 632, 528, 29874, 29906, 29945, 29953, 2433, 29890, 29906, 29888, 1389, 29955, 29945, 29947, 687, 29896, 29947, 29896, 29955, 29883, 29896, 29883, 29896, 29929, 29872, 29953, 29906, 29906, 29945, 29947, 29945, 29955, 1113, 29941, 29874, 29947, 29906, 29883, 29955, 29906, 29955, 29881, 29906, 29900, 29929, 287, 29955, 11512, 29946, 29953, 29929, 29955, 29881, 29946, 29945, 29883, 29945, 29945, 29941, 29941, 1327, 29906, 29883, 29955, 29906, 742, 13, 632, 2174, 13561, 2433, 571, 29918, 29881, 7224, 742, 746, 2433, 29974, 14538, 1691, 1495, 13, 13, 1678, 822, 3142, 29918, 1454, 29918, 3259, 29898, 1311, 29892, 1873, 1125, 13, 4706, 565, 1873, 5277, 10079, 877, 29955, 29889, 29906, 29374, 13, 9651, 736, 525, 23102, 597, 23102, 29889, 3358, 295, 29889, 1217, 7340, 29889, 13513, 29914, 571, 2267, 29914, 5467, 29914, 4993, 29914, 571, 29918, 4993, 29889, 29894, 29912, 29900, 1836, 12637, 29889, 18828, 4286, 4830, 29898, 13, 18884, 1873, 29889, 2212, 1312, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 525, 991, 597, 3292, 29889, 510, 29914, 6632, 6344, 29899, 29925, 2303, 29931, 29914, 29943, 261, 2267, 29914, 10867, 29914, 29894, 29912, 29900, 1836, 12637, 29889, 18828, 4286, 4830, 29898, 3259, 29897, 13, 13, 1678, 822, 13261, 29898, 1311, 1125, 13, 4706, 1580, 353, 1583, 29889, 6550, 13, 4706, 298, 2176, 29945, 29918, 13506, 353, 1580, 1839, 29882, 2176, 29945, 13359, 13506, 13, 4706, 7787, 2252, 600, 29918, 13506, 353, 1580, 1839, 1212, 29883, 2176, 29899, 3921, 661, 13359, 13506, 13, 4706, 1303, 1220, 29918, 13506, 353, 1580, 1839, 949, 1220, 13359, 13506, 13, 4706, 4303, 29920, 29918, 13506, 353, 1580, 1839, 29920, 1982, 13359, 13506, 13, 13, 4706, 664, 29918, 3972, 353, 525, 29943, 1001, 1525, 29911, 29915, 565, 18803, 29901, 29955, 29889, 29906, 29915, 297, 1580, 1683, 525, 6169, 13, 4706, 411, 1985, 29918, 3972, 29898, 1287, 29918, 3972, 29892, 1653, 29922, 8824, 1125, 13, 9651, 565, 18803, 29955, 29889, 29941, 11283, 297, 1580, 29901, 13, 18884, 3509, 877, 2746, 29918, 14940, 29889, 11256, 29889, 262, 742, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 18884, 3509, 877, 23176, 29918, 12171, 29914, 1389, 29918, 329, 1793, 29914, 2746, 29918, 14940, 29889, 11256, 29889, 262, 742, 13, 462, 268, 525, 23176, 29918, 12171, 29914, 1389, 29918, 329, 1793, 29914, 2746, 29918, 14940, 29889, 11256, 1495, 13, 13, 18884, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 9464, 29918, 15094, 25634, 29889, 29974, 742, 13, 462, 9651, 525, 9464, 29918, 15094, 25634, 353, 1273, 29879, 29915, 1273, 1583, 29889, 19190, 29889, 4993, 29918, 2084, 29892, 13, 462, 9651, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 18884, 396, 21605, 445, 304, 9654, 451, 304, 4889, 13, 18884, 396, 773, 278, 2294, 1873, 310, 1303, 1220, 13, 18884, 4175, 29918, 1445, 29898, 29878, 29915, 23733, 16310, 18521, 23538, 5265, 29933, 6877, 9464, 467, 29974, 742, 13, 462, 9651, 525, 1966, 29896, 353, 13420, 13, 462, 9651, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 9651, 1683, 29901, 13, 18884, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 5265, 29933, 29999, 29918, 9464, 29889, 29974, 742, 13, 462, 9651, 525, 5265, 29933, 29999, 29918, 9464, 353, 1273, 29879, 29915, 1273, 4303, 29920, 29918, 13506, 29892, 13, 462, 9651, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 18884, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29967, 26612, 29918, 17353, 29889, 29974, 742, 13, 462, 9651, 525, 13420, 13, 462, 9651, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 18884, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 16310, 18521, 29918, 9464, 29889, 29974, 742, 13, 462, 9651, 525, 16310, 18521, 29918, 9464, 353, 1273, 29879, 29915, 1273, 1303, 1220, 29918, 13506, 29892, 13, 462, 9651, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29933, 25282, 11116, 29889, 29974, 742, 13, 462, 4706, 525, 29933, 25282, 11116, 353, 921, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 742, 13, 462, 4706, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 25580, 9818, 29918, 29943, 1001, 29918, 9464, 29889, 29974, 742, 13, 462, 4706, 525, 25580, 9818, 29918, 29943, 1001, 29918, 9464, 353, 1273, 29879, 29915, 1273, 1580, 29889, 13506, 29892, 13, 462, 4706, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 23733, 29950, 4037, 29945, 23538, 5265, 29933, 6877, 9464, 467, 29974, 742, 13, 462, 4706, 525, 1966, 29896, 353, 1273, 29879, 29915, 1273, 298, 2176, 29945, 29918, 13506, 29892, 13, 462, 4706, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 23733, 6006, 29907, 4037, 29946, 29973, 23538, 5265, 29933, 6877, 9464, 467, 29974, 742, 13, 462, 4706, 525, 1966, 29896, 353, 1273, 29879, 29915, 1273, 7787, 2252, 600, 29918, 13506, 29892, 13, 462, 4706, 525, 2746, 29918, 14940, 29889, 11256, 1495, 13, 13, 9651, 565, 18803, 29901, 29955, 29889, 29941, 29915, 297, 1580, 29901, 13, 18884, 396, 3872, 29915, 29873, 4889, 773, 278, 2294, 1873, 310, 4303, 29920, 13, 18884, 4175, 29918, 1445, 29898, 29878, 12764, 4535, 29898, 5265, 29933, 29999, 29918, 9464, 29905, 6802, 1982, 29953, 29946, 29914, 1982, 29920, 29889, 29874, 742, 13, 462, 9651, 17411, 29880, 29920, 742, 13, 462, 9651, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 13, 18884, 396, 3872, 29915, 29873, 4889, 773, 278, 2294, 1873, 310, 4303, 29887, 3921, 661, 13, 18884, 4175, 29918, 1445, 29898, 29878, 28560, 29956, 29880, 6653, 29933, 7959, 448, 19920, 3921, 661, 448, 29956, 29880, 6653, 29933, 16626, 742, 13, 462, 9651, 17411, 19920, 3921, 661, 742, 13, 462, 9651, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 13, 18884, 396, 910, 28057, 278, 364, 24772, 304, 367, 6284, 731, 13, 18884, 396, 491, 1706, 547, 29915, 29879, 6516, 11463, 22437, 13, 18884, 4175, 29918, 1445, 29898, 29878, 28560, 29894, 1192, 369, 15828, 742, 13, 462, 9651, 15516, 13, 462, 9651, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 13, 18884, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29961, 320, 29873, 14178, 10249, 29961, 320, 29873, 14178, 21098, 29974, 742, 13, 462, 9651, 525, 10249, 353, 1273, 29879, 29915, 1273, 805, 547, 29918, 617, 29892, 13, 462, 9651, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 9651, 1683, 29901, 13, 18884, 396, 3872, 29915, 29873, 4889, 773, 278, 2294, 1873, 310, 4303, 29887, 3921, 661, 13, 18884, 4175, 29918, 1445, 29898, 29878, 28560, 7959, 29899, 1982, 29887, 3921, 661, 742, 13, 462, 9651, 15516, 13, 462, 9651, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 13, 9651, 565, 18803, 29901, 29955, 29889, 29946, 29915, 297, 1580, 29901, 13, 18884, 752, 22058, 29918, 6550, 29918, 1445, 353, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 29915, 13, 9651, 1683, 29901, 13, 18884, 752, 22058, 29918, 6550, 29918, 1445, 353, 525, 2746, 29918, 14940, 29889, 11256, 29915, 13, 13, 9651, 396, 8561, 1854, 7756, 2267, 3913, 1706, 547, 29915, 29879, 6516, 11463, 22437, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29961, 320, 29873, 14178, 4174, 29961, 320, 29873, 14178, 21098, 29974, 742, 13, 462, 4706, 525, 4174, 353, 1273, 29879, 29915, 1273, 805, 547, 29918, 617, 29892, 13, 462, 4706, 752, 22058, 29918, 6550, 29918, 1445, 29897, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29961, 320, 29873, 14178, 29907, 6247, 29961, 320, 29873, 14178, 21098, 29974, 742, 13, 462, 4706, 525, 29907, 6247, 353, 1273, 29879, 29915, 1273, 805, 547, 29918, 29883, 4419, 29892, 13, 462, 4706, 752, 22058, 29918, 6550, 29918, 1445, 29897, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29961, 320, 29873, 14178, 8610, 29961, 320, 29873, 14178, 21098, 29974, 742, 13, 462, 4706, 525, 8610, 353, 1273, 29879, 29915, 1273, 805, 547, 29918, 13801, 29892, 13, 462, 4706, 752, 22058, 29918, 6550, 29918, 1445, 29897, 13, 9651, 4175, 29918, 1445, 29898, 29878, 29915, 29985, 29961, 320, 29873, 14178, 29943, 29955, 29955, 29961, 320, 29873, 14178, 21098, 29974, 742, 13, 462, 4706, 525, 29943, 29955, 29955, 353, 1273, 29879, 29915, 1273, 805, 547, 29918, 29888, 29955, 29955, 29892, 13, 462, 4706, 752, 22058, 29918, 6550, 29918, 1445, 29897, 13, 13, 9651, 4175, 29918, 1445, 29898, 29878, 12764, 4535, 29898, 6006, 29907, 4037, 29946, 29973, 23538, 5265, 29933, 6877, 9464, 29800, 3877, 1982, 1212, 2252, 600, 29889, 29874, 742, 13, 462, 4706, 11663, 29931, 29995, 29879, 448, 29880, 1212, 2252, 600, 29908, 1273, 1580, 1839, 1212, 29883, 2176, 29899, 3921, 661, 13359, 13506, 29889, 1982, 29892, 13, 462, 4706, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 9651, 4175, 29918, 1445, 29898, 29878, 12764, 4535, 29898, 6006, 29907, 4037, 29946, 29973, 23538, 5265, 29933, 6877, 9464, 29800, 3877, 1982, 1212, 29883, 2176, 29889, 29874, 742, 13, 462, 4706, 11663, 29931, 29995, 29879, 448, 29880, 1212, 29883, 2176, 29908, 1273, 1580, 1839, 1212, 29883, 2176, 29899, 29883, 13359, 13506, 29889, 1982, 29892, 13, 462, 4706, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 9651, 4175, 29918, 1445, 29898, 29878, 12764, 4535, 29898, 29950, 4037, 29945, 23538, 5265, 29933, 6877, 9464, 29800, 3877, 1982, 29882, 2176, 29945, 29918, 4415, 29889, 29874, 742, 13, 462, 4706, 11663, 29931, 29995, 29879, 448, 29880, 29882, 2176, 29945, 29918, 4415, 29908, 1273, 1580, 1839, 29882, 2176, 29945, 13359, 13506, 29889, 1982, 29892, 13, 462, 4706, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 9651, 4175, 29918, 1445, 29898, 29878, 12764, 4535, 29898, 29950, 4037, 29945, 23538, 5265, 29933, 6877, 9464, 29800, 3877, 1982, 29882, 2176, 29945, 29889, 29874, 742, 13, 462, 4706, 11663, 29931, 29995, 29879, 448, 29880, 29882, 2176, 29945, 29908, 1273, 1580, 1839, 29882, 2176, 29945, 13359, 13506, 29889, 1982, 29892, 13, 462, 4706, 525, 12120, 29918, 14940, 29889, 11256, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 1495, 13, 13, 1678, 822, 2601, 29898, 1311, 29892, 1580, 29892, 10944, 1125, 13, 4706, 565, 525, 29931, 4037, 4375, 10749, 29915, 297, 8829, 322, 8829, 1839, 29931, 4037, 4375, 10749, 2033, 29901, 13, 9651, 8829, 1839, 29931, 4037, 4375, 10749, 2033, 4619, 525, 525, 718, 17411, 29880, 3425, 755, 29915, 13, 4706, 1683, 29901, 13, 9651, 8829, 1839, 29931, 4037, 4375, 10749, 2033, 353, 17411, 29880, 3425, 755, 29915, 13, 13, 4706, 664, 29918, 3972, 353, 525, 29943, 1001, 1525, 29911, 29915, 565, 18803, 29901, 29955, 29889, 29906, 29915, 297, 1583, 29889, 6550, 1683, 525, 6169, 13, 4706, 411, 1985, 29918, 3972, 29898, 1287, 29918, 3972, 29892, 1653, 29922, 8824, 1125, 13, 9651, 2897, 29889, 21813, 1839, 10249, 29918, 29990, 29896, 29896, 2033, 353, 17411, 29931, 29995, 29879, 448, 29880, 29990, 29896, 29896, 29915, 1273, 1580, 1839, 1982, 29916, 29896, 29896, 13359, 13506, 29889, 1982, 13, 9651, 2897, 29889, 21813, 1839, 20832, 11116, 2033, 353, 525, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 9389, 29915, 13, 9651, 1207, 29898, 23482, 29922, 8824, 29897, 13, 9651, 1207, 703, 6252, 1159, 13, 13, 4706, 565, 525, 29974, 14538, 1691, 29915, 297, 1583, 29889, 6550, 29901, 13, 9651, 29356, 29898, 1311, 29889, 13506, 29889, 571, 29918, 29881, 7224, 29897, 13, 9651, 2601, 29918, 8336, 877, 571, 29918, 29881, 7224, 742, 1583, 29889, 13506, 29889, 571, 29918, 29881, 7224, 29897, 13, 13, 1678, 822, 6230, 29918, 3389, 29918, 20944, 29898, 1311, 29892, 8829, 1125, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 9464, 742, 1583, 29889, 13506, 29897, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 17080, 742, 525, 15300, 7122, 18959, 29889, 742, 1583, 29889, 13506, 29889, 1484, 29892, 1583, 29889, 13506, 29889, 19057, 29892, 13, 462, 462, 1678, 1583, 29889, 13506, 29889, 21570, 12622, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 5746, 4945, 29940, 1964, 29918, 29943, 28700, 29903, 742, 1583, 29889, 13506, 29889, 1062, 29918, 9891, 29889, 10254, 29897, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 7228, 1307, 29911, 4330, 742, 525, 15300, 7122, 18959, 29889, 742, 1583, 29889, 13506, 29889, 407, 29880, 12622, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 29943, 1164, 9375, 742, 1583, 29889, 13506, 29889, 407, 29880, 29889, 28586, 29897, 13, 13, 4706, 6013, 29918, 1272, 353, 518, 4286, 2033, 13, 4706, 6013, 29918, 2783, 7283, 353, 518, 4286, 2033, 13, 4706, 6013, 29918, 629, 4841, 353, 518, 4286, 2033, 13, 13, 4706, 565, 525, 29974, 14538, 1691, 29915, 297, 1583, 29889, 6550, 29901, 13, 9651, 8829, 29889, 842, 877, 29943, 1001, 29918, 29928, 1660, 9375, 742, 1583, 29889, 13506, 29889, 571, 29918, 29881, 7224, 29897, 13, 13, 9651, 6013, 29918, 1272, 29889, 4397, 29898, 1311, 29889, 13506, 29889, 571, 29918, 29881, 7224, 29889, 1272, 29897, 13, 9651, 6013, 29918, 2783, 7283, 29889, 4397, 29898, 1311, 29889, 13506, 29889, 571, 29918, 29881, 7224, 29889, 2783, 7283, 29897, 13, 9651, 6013, 29918, 629, 4841, 29889, 4397, 29898, 1311, 29889, 13506, 29889, 571, 29918, 29881, 7224, 29889, 629, 4841, 29897, 13, 13, 4706, 6013, 29918, 1272, 29889, 21843, 4197, 1311, 29889, 13506, 29889, 1484, 29892, 1583, 29889, 13506, 29889, 19057, 2314, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 14573, 742, 525, 15300, 7122, 29898, 571, 29918, 1272, 876, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 2287, 7187, 29934, 742, 525, 15300, 7122, 29898, 571, 29918, 2783, 7283, 876, 13, 4706, 8829, 29889, 842, 877, 29943, 1001, 29918, 14345, 1367, 29903, 742, 525, 15300, 7122, 29898, 571, 29918, 629, 4841, 876, 13, 2 ]
style_transfer/layer.py
haonguyen1107/style_transfer
0
159688
import numpy as np import tensorflow as tf def upsample_nearest(inputs, scale): shape = tf.shape(input=inputs) n, h, w, c = shape[0], shape[1], shape[2], shape[3] return tf.image.resize(inputs, tf.stack([h*scale, w*scale]), method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
[ 1, 1053, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 13, 13, 1753, 24081, 981, 29918, 28502, 342, 29898, 2080, 29879, 29892, 6287, 1125, 13, 1678, 8267, 353, 15886, 29889, 12181, 29898, 2080, 29922, 2080, 29879, 29897, 13, 1678, 302, 29892, 298, 29892, 281, 29892, 274, 353, 8267, 29961, 29900, 1402, 8267, 29961, 29896, 1402, 8267, 29961, 29906, 1402, 8267, 29961, 29941, 29962, 13, 1678, 736, 15886, 29889, 3027, 29889, 21476, 29898, 2080, 29879, 29892, 15886, 29889, 1429, 4197, 29882, 29930, 7052, 29892, 281, 29930, 7052, 11724, 1158, 29922, 13264, 29889, 3027, 29889, 1666, 675, 4062, 29889, 8186, 29909, 1525, 1254, 29918, 8186, 6259, 29950, 29933, 1955, 29897, 2 ]
src/visions/lib/relations/string_to_datetime.py
sweersr/visions
0
36897
import pandas as pd from visions import visions_string, visions_datetime from visions.core.model import TypeRelation from visions.core.model.relations import InferenceRelation from visions.utils.coercion import test_utils def to_datetime_year_week(series): """Convert a series of the format YYYY/UU (year, week) to datetime. A '0' is added as day dummy value, as pandas requires a day value to parse. Args: series: the Series to parse Returns: A datetime series Examples: >>> series = pd.Series(['2018/47', '2018/12', '2018/03']) >>> parsed_series = to_datetime_year_week(series) >>> print(parsed_series.dt.week) 0 47 1 12 2 3 dtype: int64 """ return pd.to_datetime(series + "0", format="%Y/%U%w") def to_datetime_year_month_day(series): """Convert a series of the format YYYYMMDD (year, month, day) to datetime. Args: series: the Series to parse Returns: A datetime series Examples: >>> series = pd.Series(['20181201', '20181202', '20181203']) >>> parsed_series = to_datetime_year_week(series) >>> print(parsed_series.dt.day) 0 1 1 2 2 3 dtype: int64 """ return pd.to_datetime(series, format="%Y%m%d") def get_string_datetime_type_relation(func): return InferenceRelation( relationship=test_utils.coercion_test(func), transformer=func, related_type=visions_string, type=visions_datetime, ) def string_to_datetime_year_week(): return get_string_datetime_type_relation(to_datetime_year_week) def string_to_datetime_year_month_day(): return get_string_datetime_type_relation(to_datetime_year_month_day)
[ 1, 1053, 11701, 408, 10518, 13, 3166, 1998, 1080, 1053, 1998, 1080, 29918, 1807, 29892, 1998, 1080, 29918, 12673, 13, 13, 3166, 1998, 1080, 29889, 3221, 29889, 4299, 1053, 5167, 9662, 362, 13, 3166, 1998, 1080, 29889, 3221, 29889, 4299, 29889, 2674, 800, 1053, 512, 1659, 9662, 362, 13, 3166, 1998, 1080, 29889, 13239, 29889, 1111, 6269, 291, 1053, 1243, 29918, 13239, 13, 13, 13, 1753, 304, 29918, 12673, 29918, 6360, 29918, 18448, 29898, 13757, 1125, 13, 1678, 9995, 18455, 263, 3652, 310, 278, 3402, 612, 14995, 29979, 29914, 29965, 29965, 313, 6360, 29892, 4723, 29897, 304, 12865, 29889, 13, 1678, 319, 525, 29900, 29915, 338, 2715, 408, 2462, 20254, 995, 29892, 408, 11701, 6858, 263, 2462, 995, 304, 6088, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 3652, 29901, 278, 10488, 304, 6088, 13, 13, 1678, 16969, 29901, 13, 4706, 319, 12865, 3652, 13, 13, 1678, 1222, 9422, 29901, 13, 4706, 8653, 3652, 353, 10518, 29889, 19204, 18959, 29906, 29900, 29896, 29947, 29914, 29946, 29955, 742, 525, 29906, 29900, 29896, 29947, 29914, 29896, 29906, 742, 525, 29906, 29900, 29896, 29947, 29914, 29900, 29941, 11287, 13, 4706, 8653, 21213, 29918, 13757, 353, 304, 29918, 12673, 29918, 6360, 29918, 18448, 29898, 13757, 29897, 13, 4706, 8653, 1596, 29898, 862, 8485, 29918, 13757, 29889, 6008, 29889, 18448, 29897, 13, 308, 29900, 268, 29946, 29955, 13, 308, 29896, 268, 29896, 29906, 13, 308, 29906, 418, 29941, 13, 4706, 26688, 29901, 938, 29953, 29946, 13, 1678, 9995, 13, 1678, 736, 10518, 29889, 517, 29918, 12673, 29898, 13757, 718, 376, 29900, 613, 3402, 543, 29995, 29979, 22584, 29965, 29995, 29893, 1159, 13, 13, 13, 1753, 304, 29918, 12673, 29918, 6360, 29918, 10874, 29918, 3250, 29898, 13757, 1125, 13, 1678, 9995, 18455, 263, 3652, 310, 278, 3402, 612, 14995, 29979, 29924, 5773, 29928, 313, 6360, 29892, 4098, 29892, 2462, 29897, 304, 12865, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 3652, 29901, 278, 10488, 304, 6088, 13, 13, 1678, 16969, 29901, 13, 4706, 319, 12865, 3652, 13, 13, 1678, 1222, 9422, 29901, 13, 4706, 8653, 3652, 353, 10518, 29889, 19204, 18959, 29906, 29900, 29896, 29947, 29896, 29906, 29900, 29896, 742, 525, 29906, 29900, 29896, 29947, 29896, 29906, 29900, 29906, 742, 525, 29906, 29900, 29896, 29947, 29896, 29906, 29900, 29941, 11287, 13, 4706, 8653, 21213, 29918, 13757, 353, 304, 29918, 12673, 29918, 6360, 29918, 18448, 29898, 13757, 29897, 13, 4706, 8653, 1596, 29898, 862, 8485, 29918, 13757, 29889, 6008, 29889, 3250, 29897, 13, 308, 29900, 268, 29896, 13, 308, 29896, 268, 29906, 13, 308, 29906, 268, 29941, 13, 4706, 26688, 29901, 938, 29953, 29946, 13, 1678, 9995, 13, 1678, 736, 10518, 29889, 517, 29918, 12673, 29898, 13757, 29892, 3402, 543, 29995, 29979, 29995, 29885, 29995, 29881, 1159, 13, 13, 13, 1753, 679, 29918, 1807, 29918, 12673, 29918, 1853, 29918, 23445, 29898, 9891, 1125, 13, 1678, 736, 512, 1659, 9662, 362, 29898, 13, 4706, 9443, 29922, 1688, 29918, 13239, 29889, 1111, 6269, 291, 29918, 1688, 29898, 9891, 511, 13, 4706, 4327, 261, 29922, 9891, 29892, 13, 4706, 4475, 29918, 1853, 29922, 1730, 1080, 29918, 1807, 29892, 13, 4706, 1134, 29922, 1730, 1080, 29918, 12673, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1347, 29918, 517, 29918, 12673, 29918, 6360, 29918, 18448, 7295, 13, 1678, 736, 679, 29918, 1807, 29918, 12673, 29918, 1853, 29918, 23445, 29898, 517, 29918, 12673, 29918, 6360, 29918, 18448, 29897, 13, 13, 13, 1753, 1347, 29918, 517, 29918, 12673, 29918, 6360, 29918, 10874, 29918, 3250, 7295, 13, 1678, 736, 679, 29918, 1807, 29918, 12673, 29918, 1853, 29918, 23445, 29898, 517, 29918, 12673, 29918, 6360, 29918, 10874, 29918, 3250, 29897, 13, 2 ]
minder_lastreview.py
hodea/hodea-review-minder
0
37407
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Mon Feb 26 19:38:29 2018 @author: Daniel """ import argparse import os from minder_config import minder_cfg from minder_database import minder_db from minder_htmlreport import minder_report import time import hashlib import uuid class get_lastreview: def __init__(self, minder_dict, topdir, cfg_exclude, cfg_type): print(topdir) print(cfg_exclude) print(cfg_type) print(minder_dict) filecnt = 0 for root, dirs, files in os.walk(topdir): for name in files: find = False for i in range(0,len(cfg_exclude)): if os.path.join(root, name).startswith(os.path.dirname(cfg_exclude[i])): find = True if find is True: continue for j in range(0,len(cfg_type)): if name.lower().endswith(cfg_type[j]): try: flog = open(os.path.join(root, name), "rb") flog.close() flog = open(os.path.join(root, name), 'r+') flog.close() filecnt+=1 except: print("ERROR: No Access to: " + os.path.join(root, name)) raise Exception print(filecnt)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 20399, 373, 2598, 26319, 29871, 29906, 29953, 29871, 29896, 29929, 29901, 29941, 29947, 29901, 29906, 29929, 29871, 29906, 29900, 29896, 29947, 13, 13, 29992, 8921, 29901, 8432, 13, 15945, 29908, 13, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 3166, 3458, 261, 29918, 2917, 1053, 3458, 261, 29918, 16859, 259, 13, 3166, 3458, 261, 29918, 9803, 1053, 3458, 261, 29918, 2585, 13, 3166, 3458, 261, 29918, 1420, 12276, 1053, 3458, 261, 29918, 12276, 13, 5215, 931, 13, 5215, 6608, 1982, 13, 5215, 318, 5416, 13, 13, 13, 1990, 679, 29918, 4230, 27828, 29901, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3458, 261, 29918, 8977, 29892, 2246, 3972, 29892, 274, 16434, 29918, 735, 2325, 29892, 274, 16434, 29918, 1853, 1125, 13, 308, 13, 308, 13, 4706, 1596, 29898, 3332, 3972, 29897, 13, 4706, 1596, 29898, 16859, 29918, 735, 2325, 29897, 13, 4706, 1596, 29898, 16859, 29918, 1853, 29897, 13, 4706, 1596, 29898, 29885, 4995, 29918, 8977, 29897, 13, 4706, 934, 20047, 353, 29871, 29900, 13, 4706, 363, 3876, 29892, 4516, 29879, 29892, 2066, 297, 2897, 29889, 20919, 29898, 3332, 3972, 1125, 13, 9651, 363, 1024, 297, 2066, 29901, 13, 18884, 1284, 353, 7700, 13, 18884, 363, 474, 297, 3464, 29898, 29900, 29892, 2435, 29898, 16859, 29918, 735, 2325, 22164, 13, 13, 462, 1678, 565, 2897, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 1024, 467, 27382, 2541, 29898, 359, 29889, 2084, 29889, 25721, 29898, 16859, 29918, 735, 2325, 29961, 29875, 12622, 29901, 13, 462, 4706, 1284, 353, 5852, 13, 18884, 565, 1284, 338, 5852, 29901, 13, 462, 1678, 6773, 13, 18884, 363, 432, 297, 3464, 29898, 29900, 29892, 2435, 29898, 16859, 29918, 1853, 22164, 29871, 13, 462, 1678, 565, 1024, 29889, 13609, 2141, 1975, 2541, 29898, 16859, 29918, 1853, 29961, 29926, 29962, 1125, 13, 462, 4706, 1018, 29901, 13, 462, 9651, 285, 1188, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 1024, 511, 376, 6050, 1159, 13, 462, 9651, 285, 1188, 29889, 5358, 580, 259, 13, 462, 9651, 285, 1188, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 1024, 511, 525, 29878, 29974, 1495, 259, 13, 462, 9651, 285, 1188, 29889, 5358, 580, 29871, 13, 462, 9651, 934, 20047, 23661, 29896, 13, 462, 4706, 5174, 29901, 13, 462, 9651, 1596, 703, 11432, 29901, 1939, 11028, 304, 29901, 376, 718, 2897, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 1024, 876, 13, 462, 9651, 12020, 8960, 13, 4706, 1596, 29898, 1445, 20047, 29897, 13, 308, 2 ]
networkx/classes/tests/test_filters.py
jmmcd/networkx
3
134079
import pytest import networkx as nx class TestFilterFactory(object): def test_no_filter(self): nf = nx.filters.no_filter assert nf() assert nf(1) assert nf(2, 1) def test_hide_nodes(self): f = nx.classes.filters.hide_nodes([1, 2, 3]) assert not f(1) assert not f(2) assert not f(3) assert f(4) assert f(0) assert f('a') pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f) def test_show_nodes(self): f = nx.classes.filters.show_nodes([1, 2, 3]) assert f(1) assert f(2) assert f(3) assert not f(4) assert not f(0) assert not f('a') pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f) def test_hide_edges(self): factory = nx.classes.filters.hide_edges f = factory([(1, 2), (3, 4)]) assert not f(1, 2) assert not f(3, 4) assert not f(4, 3) assert f(2, 3) assert f(0, -1) assert f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_show_edges(self): factory = nx.classes.filters.show_edges f = factory([(1, 2), (3, 4)]) assert f(1, 2) assert f(3, 4) assert f(4, 3) assert not f(2, 3) assert not f(0, -1) assert not f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_hide_diedges(self): factory = nx.classes.filters.hide_diedges f = factory([(1, 2), (3, 4)]) assert not f(1, 2) assert not f(3, 4) assert f(4, 3) assert f(2, 3) assert f(0, -1) assert f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_show_diedges(self): factory = nx.classes.filters.show_diedges f = factory([(1, 2), (3, 4)]) assert f(1, 2) assert f(3, 4) assert not f(4, 3) assert not f(2, 3) assert not f(0, -1) assert not f('a', 'b') pytest.raises(TypeError, f, 1, 2, 3) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2, 3)]) def test_hide_multiedges(self): factory = nx.classes.filters.hide_multiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert not f(1, 2, 0) assert not f(1, 2, 1) assert f(1, 2, 2) assert f(3, 4, 0) assert not f(3, 4, 1) assert not f(4, 3, 1) assert f(4, 3, 0) assert f(2, 3, 0) assert f(0, -1, 0) assert f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) def test_show_multiedges(self): factory = nx.classes.filters.show_multiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert f(1, 2, 0) assert f(1, 2, 1) assert not f(1, 2, 2) assert not f(3, 4, 0) assert f(3, 4, 1) assert f(4, 3, 1) assert not f(4, 3, 0) assert not f(2, 3, 0) assert not f(0, -1, 0) assert not f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) def test_hide_multidiedges(self): factory = nx.classes.filters.hide_multidiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert not f(1, 2, 0) assert not f(1, 2, 1) assert f(1, 2, 2) assert f(3, 4, 0) assert not f(3, 4, 1) assert f(4, 3, 1) assert f(4, 3, 0) assert f(2, 3, 0) assert f(0, -1, 0) assert f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) def test_show_multidiedges(self): factory = nx.classes.filters.show_multidiedges f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) assert f(1, 2, 0) assert f(1, 2, 1) assert not f(1, 2, 2) assert not f(3, 4, 0) assert f(3, 4, 1) assert not f(4, 3, 1) assert not f(4, 3, 0) assert not f(2, 3, 0) assert not f(0, -1, 0) assert not f('a', 'b', 0) pytest.raises(TypeError, f, 1, 2, 3, 4) pytest.raises(TypeError, f, 1, 2) pytest.raises(TypeError, f, 1) pytest.raises(TypeError, f) pytest.raises(TypeError, factory, [1, 2, 3]) pytest.raises(ValueError, factory, [(1, 2)]) pytest.raises(ValueError, factory, [(1, 2, 3, 4)])
[ 1, 1053, 11451, 1688, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 13, 13, 1990, 4321, 5072, 5126, 29898, 3318, 1125, 13, 1678, 822, 1243, 29918, 1217, 29918, 4572, 29898, 1311, 1125, 13, 4706, 302, 29888, 353, 302, 29916, 29889, 26705, 29889, 1217, 29918, 4572, 13, 4706, 4974, 302, 29888, 580, 13, 4706, 4974, 302, 29888, 29898, 29896, 29897, 13, 4706, 4974, 302, 29888, 29898, 29906, 29892, 29871, 29896, 29897, 13, 13, 1678, 822, 1243, 29918, 11458, 29918, 18010, 29898, 1311, 1125, 13, 4706, 285, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 11458, 29918, 18010, 4197, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 4974, 451, 285, 29898, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29906, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29897, 13, 4706, 4974, 285, 29898, 29946, 29897, 13, 4706, 4974, 285, 29898, 29900, 29897, 13, 4706, 4974, 285, 877, 29874, 1495, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 13, 1678, 822, 1243, 29918, 4294, 29918, 18010, 29898, 1311, 1125, 13, 4706, 285, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 4294, 29918, 18010, 4197, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 4974, 285, 29898, 29896, 29897, 13, 4706, 4974, 285, 29898, 29906, 29897, 13, 4706, 4974, 285, 29898, 29941, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29897, 13, 4706, 4974, 451, 285, 29898, 29900, 29897, 13, 4706, 4974, 451, 285, 877, 29874, 1495, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 13, 1678, 822, 1243, 29918, 11458, 29918, 287, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 11458, 29918, 287, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 511, 313, 29941, 29892, 29871, 29946, 29897, 2314, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29892, 29871, 29946, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29892, 29871, 29941, 29897, 13, 4706, 4974, 285, 29898, 29906, 29892, 29871, 29941, 29897, 13, 4706, 4974, 285, 29898, 29900, 29892, 448, 29896, 29897, 13, 4706, 4974, 285, 877, 29874, 742, 525, 29890, 1495, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 4294, 29918, 287, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 4294, 29918, 287, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 511, 313, 29941, 29892, 29871, 29946, 29897, 2314, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29897, 13, 4706, 4974, 285, 29898, 29941, 29892, 29871, 29946, 29897, 13, 4706, 4974, 285, 29898, 29946, 29892, 29871, 29941, 29897, 13, 4706, 4974, 451, 285, 29898, 29906, 29892, 29871, 29941, 29897, 13, 4706, 4974, 451, 285, 29898, 29900, 29892, 448, 29896, 29897, 13, 4706, 4974, 451, 285, 877, 29874, 742, 525, 29890, 1495, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 11458, 29918, 29881, 1000, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 11458, 29918, 29881, 1000, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 511, 313, 29941, 29892, 29871, 29946, 29897, 2314, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29892, 29871, 29946, 29897, 13, 4706, 4974, 285, 29898, 29946, 29892, 29871, 29941, 29897, 13, 4706, 4974, 285, 29898, 29906, 29892, 29871, 29941, 29897, 13, 4706, 4974, 285, 29898, 29900, 29892, 448, 29896, 29897, 13, 4706, 4974, 285, 877, 29874, 742, 525, 29890, 1495, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 4294, 29918, 29881, 1000, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 4294, 29918, 29881, 1000, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 511, 313, 29941, 29892, 29871, 29946, 29897, 2314, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29897, 13, 4706, 4974, 285, 29898, 29941, 29892, 29871, 29946, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29892, 29871, 29941, 29897, 13, 4706, 4974, 451, 285, 29898, 29906, 29892, 29871, 29941, 29897, 13, 4706, 4974, 451, 285, 29898, 29900, 29892, 448, 29896, 29897, 13, 4706, 4974, 451, 285, 877, 29874, 742, 525, 29890, 1495, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 11458, 29918, 4713, 1000, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 11458, 29918, 4713, 1000, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 511, 313, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 511, 313, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 2314, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29906, 29897, 13, 4706, 4974, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 4974, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29906, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29900, 29892, 448, 29896, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 877, 29874, 742, 525, 29890, 742, 29871, 29900, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29897, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 4294, 29918, 4713, 1000, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 4294, 29918, 4713, 1000, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 511, 313, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 511, 313, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 2314, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29906, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 29897, 13, 4706, 4974, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29906, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29900, 29892, 448, 29896, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 877, 29874, 742, 525, 29890, 742, 29871, 29900, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29897, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 11458, 29918, 4713, 333, 1000, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 11458, 29918, 4713, 333, 1000, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 511, 313, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 511, 313, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 2314, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29906, 29897, 13, 4706, 4974, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 29897, 13, 4706, 4974, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 4974, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29906, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29900, 29892, 448, 29896, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 877, 29874, 742, 525, 29890, 742, 29871, 29900, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29897, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 2314, 13, 13, 1678, 822, 1243, 29918, 4294, 29918, 4713, 333, 1000, 2710, 29898, 1311, 1125, 13, 4706, 12529, 353, 302, 29916, 29889, 13203, 29889, 26705, 29889, 4294, 29918, 4713, 333, 1000, 2710, 13, 4706, 285, 353, 12529, 4197, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 511, 313, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 511, 313, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 2314, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29906, 29897, 13, 4706, 4974, 451, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29900, 29897, 13, 4706, 4974, 285, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 4974, 451, 285, 29898, 29946, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29906, 29892, 29871, 29941, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 29898, 29900, 29892, 448, 29896, 29892, 29871, 29900, 29897, 13, 4706, 4974, 451, 285, 877, 29874, 742, 525, 29890, 742, 29871, 29900, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29892, 29871, 29896, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 285, 29897, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 29892, 12529, 29892, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29897, 2314, 13, 4706, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 29892, 12529, 29892, 17288, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29897, 2314, 13, 2 ]
scripts/CNN_Unet_cluster0.py
kevinshen56714/NucleiTracker
2
95103
<gh_stars>1-10 import numpy as np import pandas as pd import matplotlib.pyplot as plt import cv2 import os from os.path import join import glob import sys import random import warnings from tqdm import tqdm import itertools from itertools import chain from skimage.io import imread, imshow, imread_collection, concatenate_images from skimage.transform import resize from skimage.morphology import label from sklearn.model_selection import train_test_split import tensorflow as tf import keras from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D, BatchNormalization, Conv2D, UpSampling2D, Lambda from keras.models import Model, load_model from keras.layers import Input from keras.layers.core import Dropout, Lambda from keras.layers.convolutional import Conv2D, Conv2DTranspose from keras.layers.pooling import MaxPooling2D from keras.layers.merge import concatenate from keras import backend as K from keras.callbacks import Callback, EarlyStopping, ReduceLROnPlateau, ModelCheckpoint from keras import initializers, layers, models from keras.utils import to_categorical from keras.utils.vis_utils import plot_model from keras.preprocessing.image import ImageDataGenerator from keras import callbacks IMG_WIDTH = 128 IMG_HEIGHT = 128 IMG_CHANNELS = 3 TRAIN_PATH = 'stage1_train/' TEST_PATH = 'stage1_test/' warnings.filterwarnings('ignore', category=UserWarning, module='skimage') seed = 42 random.seed = seed np.random.seed = seed df = pd.read_csv('C:\\Users\\liukevin\\Desktop\\project_DM\\clustered_stage1_train.csv',sep=',') df1 = pd.read_csv('C:\\Users\\liukevin\\Desktop\\project_DM\\clustered_stage1_test.csv',sep=',') cluster=[[],[],[],[]] for i in range(len(df)): if df['cluster-id'][i]==0: cluster[0].append(df['ImageId'][i]) elif df['cluster-id'][i]==1: cluster[1].append(df['ImageId'][i]) elif df['cluster-id'][i]==2: cluster[2].append(df['ImageId'][i]) elif df['cluster-id'][i]==3: cluster[3].append(df['ImageId'][i]) cluster_test=[[],[],[],[]] for i in range(len(df1)): if df1['cluster-id'][i]==0: cluster_test[0].append(df1['ImageId'][i]) elif df1['cluster-id'][i]==1: cluster_test[1].append(df1['ImageId'][i]) elif df1['cluster-id'][i]==2: cluster_test[2].append(df1['ImageId'][i]) IdInCluster=0 # Get train and test IDs train_ids = cluster[IdInCluster] test_ids = cluster_test[IdInCluster] # Get and resize train images and masks X_train = np.zeros((len(train_ids), IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS), dtype=np.uint8) Y_train = np.zeros((len(train_ids), IMG_HEIGHT, IMG_WIDTH, 1), dtype=np.bool) print('Getting and resizing train images and masks ... ') sys.stdout.flush() for n, id_ in tqdm(enumerate(train_ids), total=len(train_ids)): path = TRAIN_PATH + id_ img = imread(path + '/images/' + id_ + '.png')[:,:,:IMG_CHANNELS] img = resize(img, (IMG_HEIGHT, IMG_WIDTH), mode='constant', preserve_range=True) X_train[n] = img mask = np.zeros((IMG_HEIGHT, IMG_WIDTH, 1), dtype=np.bool) for mask_file in next(os.walk(path + '/masks/'))[2]: mask_ = imread(path + '/masks/' + mask_file) mask_ = np.expand_dims(resize(mask_, (IMG_HEIGHT, IMG_WIDTH), mode='constant', preserve_range=True), axis=-1) mask = np.maximum(mask, mask_) Y_train[n] = mask # Get and resize test images X_test = np.zeros((len(test_ids), IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS), dtype=np.uint8) sizes_test = [] print('Getting and resizing test images ... ') sys.stdout.flush() for n, id_ in tqdm(enumerate(test_ids), total=len(test_ids)): path = TEST_PATH + id_ img = imread(path + '/images/' + id_ + '.png')[:,:,:IMG_CHANNELS] sizes_test.append([img.shape[0], img.shape[1]]) img = resize(img, (IMG_HEIGHT, IMG_WIDTH), mode='constant', preserve_range=True) X_test[n] = img print('Done!') x_train, x_test, y_train, y_test = train_test_split(X_train, Y_train, test_size=0.2) print('\nx_train',x_train.shape) print('x_test',x_test.shape) print('y_train',y_train.shape) print('y_test',y_test.shape) def plotTrainData(a,b): for i in range(5): ix = random.randint(0, len(train_ids)) plt.subplot(1,2,1) plt.title("X_train") imshow(a[ix]) plt.axis('off') plt.subplot(1,2,2) plt.title("Y_train") imshow(np.squeeze(b[ix])) plt.axis('off') plt.show() plotTrainData(X_train,Y_train) class MetricsCheckpoint(Callback): """Callback that saves metrics after each epoch""" def __init__(self, savepath): super(MetricsCheckpoint, self).__init__() self.savepath = savepath self.history = {} def on_epoch_end(self, epoch, logs=None): for k, v in logs.items(): self.history.setdefault(k, []).append(v) np.save(self.savepath, self.history) def plotKerasLearningCurve(): plt.figure(figsize=(10,5)) metrics = np.load('logs.npy')[()] filt = ['acc'] # try to add 'loss' to see the loss learning curve for k in filter(lambda x : np.any([kk in x for kk in filt]), metrics.keys()): l = np.array(metrics[k]) plt.plot(l, c= 'r' if 'val' not in k else 'b', label='val' if 'val' in k else 'train') x = np.argmin(l) if 'loss' in k else np.argmax(l) y = l[x] plt.scatter(x,y, lw=0, alpha=0.25, s=100, c='r' if 'val' not in k else 'b') plt.text(x, y, '{} = {:.4f}'.format(x,y), size='15', color= 'r' if 'val' not in k else 'b') plt.legend(loc=4) plt.axis([0, None, None, None]); plt.grid() plt.xlabel('Number of epochs') def plot_learning_curve(history): plt.figure(figsize=(8,8)) plt.subplot(1,2,1) plt.plot(history.history['acc']) plt.plot(history.history['val_acc']) plt.title('model accuracy') plt.ylabel('accuracy') plt.xlabel('epoch') plt.legend(['train', 'test'], loc='upper left') plt.savefig('./accuracy_curve.png') #plt.clf() # summarize history for loss plt.subplot(1,2,2) plt.plot(history.history['loss']) plt.plot(history.history['val_loss']) plt.title('model loss') plt.ylabel('loss') plt.xlabel('epoch') plt.legend(['train', 'test'], loc='upper left') plt.savefig('./loss_curve.png') # Define IoU metric def mean_iou(y_true, y_pred): prec = [] for t in np.arange(0.5, 1.0, 0.05): y_pred_ = tf.to_int32(y_pred > t) score, up_opt = tf.metrics.mean_iou(y_true, y_pred_, 2) K.get_session().run(tf.local_variables_initializer()) with tf.control_dependencies([up_opt]): score = tf.identity(score) prec.append(score) return K.mean(K.stack(prec), axis=0) #RLE encoding for submission def rle_encoding(x): dots = np.where(x.T.flatten() == 1)[0] run_lengths = [] prev = -2 for b in dots: if (b>prev+1): run_lengths.extend((b + 1, 0)) run_lengths[-1] += 1 prev = b return run_lengths def prob_to_rles(x, cutoff=0.5): lab_img = label(x > cutoff) for i in range(1, lab_img.max() + 1): yield rle_encoding(lab_img == i) def SIMPLE(a,b,c,d): smooth = 1. def dice_coef(y_true, y_pred): y_true_f = K.flatten(y_true) y_pred_f = K.flatten(y_pred) intersection = K.sum(y_true_f * y_pred_f) return (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth) def dice_coef_loss(y_true, y_pred): return -dice_coef(y_true, y_pred) simple_cnn = Sequential() simple_cnn.add(BatchNormalization(input_shape = (None, None, IMG_CHANNELS),name = 'NormalizeInput')) simple_cnn.add(Conv2D(8, kernel_size = (3,3), padding = 'same')) simple_cnn.add(Conv2D(8, kernel_size = (3,3), padding = 'same')) # use dilations to get a slightly larger field of view simple_cnn.add(Conv2D(16, kernel_size = (3,3), dilation_rate = 2, padding = 'same')) simple_cnn.add(Conv2D(16, kernel_size = (3,3), dilation_rate = 2, padding = 'same')) simple_cnn.add(Conv2D(32, kernel_size = (3,3), dilation_rate = 3, padding = 'same')) # the final processing simple_cnn.add(Conv2D(16, kernel_size = (1,1), padding = 'same')) simple_cnn.add(Conv2D(1, kernel_size = (1,1), padding = 'same', activation = 'sigmoid')) simple_cnn.summary() earlystopper = EarlyStopping(patience=5, verbose=1) checkpointer = ModelCheckpoint('model-dsbowl2018-1.h5', verbose=1, save_best_only=True) simple_cnn.compile(optimizer = 'adam', loss = dice_coef_loss, metrics = [dice_coef, 'acc', 'mse']) history = simple_cnn.fit(x_train,y_train, validation_data=(x_test,y_test),callbacks = [earlystopper, checkpointer, MetricsCheckpoint('logs')],epochs = 30) plot_learning_curve(history) plt.show() plotKerasLearningCurve() plt.show() global modelY modelY = simple_cnn return modelY SIMPLE(x_train, y_train,x_test,y_test) def UNET(a,b,c,d): # Build U-Net model inputs = Input((IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS)) s = Lambda(lambda x: x / 255) (inputs) c1 = Conv2D(16, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (s) c1 = Dropout(0.1) (c1) c1 = Conv2D(16, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c1) p1 = MaxPooling2D((2, 2)) (c1) c2 = Conv2D(32, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (p1) c2 = Dropout(0.1) (c2) c2 = Conv2D(32, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c2) p2 = MaxPooling2D((2, 2)) (c2) c3 = Conv2D(64, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (p2) c3 = Dropout(0.2) (c3) c3 = Conv2D(64, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c3) p3 = MaxPooling2D((2, 2)) (c3) c4 = Conv2D(128, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (p3) c4 = Dropout(0.2) (c4) c4 = Conv2D(128, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c4) p4 = MaxPooling2D(pool_size=(2, 2)) (c4) c5 = Conv2D(256, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (p4) c5 = Dropout(0.3) (c5) c5 = Conv2D(256, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c5) u6 = Conv2DTranspose(128, (2, 2), strides=(2, 2), padding='same') (c5) u6 = concatenate([u6, c4]) c6 = Conv2D(128, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (u6) c6 = Dropout(0.2) (c6) c6 = Conv2D(128, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c6) u7 = Conv2DTranspose(64, (2, 2), strides=(2, 2), padding='same') (c6) u7 = concatenate([u7, c3]) c7 = Conv2D(64, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (u7) c7 = Dropout(0.2) (c7) c7 = Conv2D(64, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c7) u8 = Conv2DTranspose(32, (2, 2), strides=(2, 2), padding='same') (c7) u8 = concatenate([u8, c2]) c8 = Conv2D(32, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (u8) c8 = Dropout(0.1) (c8) c8 = Conv2D(32, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c8) u9 = Conv2DTranspose(16, (2, 2), strides=(2, 2), padding='same') (c8) u9 = concatenate([u9, c1], axis=3) c9 = Conv2D(16, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (u9) c9 = Dropout(0.1) (c9) c9 = Conv2D(16, (3, 3), activation='elu', kernel_initializer='he_normal', padding='same') (c9) outputs = Conv2D(1, (1, 1), activation='sigmoid') (c9) model = Model(inputs=[inputs], outputs=[outputs]) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=[mean_iou,'accuracy']) #model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['acc']) model.summary() # Fit model earlystopper = EarlyStopping(patience=5, verbose=1) checkpointer = ModelCheckpoint('model-dsbowl2018-2.h5', verbose=1, save_best_only=True) results = model.fit(a,b,batch_size=16,verbose=1,epochs=30,validation_data=(c,d),callbacks = [earlystopper, checkpointer, MetricsCheckpoint('logs')]) plot_learning_curve(results) plt.show() plotKerasLearningCurve() plt.show() global modelZ modelZ = model return modelZ UNET(x_train, y_train,x_test,y_test) def plotPredictions(a,b,c,d,e): model = e # Threshold predictions preds_train = model.predict(a[:int(a.shape[0]*0.9)], verbose=1) preds_val = model.predict(a[int(a.shape[0]*0.9):], verbose=1) preds_test = model.predict(c, verbose=1) preds_train_t = (preds_train > 0.5).astype(np.uint8) preds_val_t = (preds_val > 0.5).astype(np.uint8) preds_test_t = (preds_test > 0.5).astype(np.uint8) # Perform a sanity check on some random training samples ix = random.randint(0, len(preds_train_t)) plt.subplot(1,3,1) plt.title("X_train") plt.axis('off') imshow(a[ix]) plt.subplot(1,3,2) plt.title("Y_train") plt.axis('off') imshow(np.squeeze(b[ix])) plt.subplot(1,3,3) plt.title("Prediction") plt.axis('off') imshow(np.squeeze(preds_train_t[ix])) plt.show() # Perform a sanity check on some random validation samples ix = random.randint(0, len(preds_val_t)) plt.subplot(1,3,1) plt.title("X_test") plt.axis('off') imshow(a[int(a.shape[0]*0.9):][ix]) plt.subplot(1,3,2) plt.title("Y_test") plt.axis('off') imshow(np.squeeze(b[int(b.shape[0]*0.9):][ix])) plt.subplot(1,3,3) plt.title("Prediction") plt.axis('off') imshow(np.squeeze(preds_val_t[ix])) plt.show() plotPredictions(x_train,y_train,x_test,y_test,modelZ) test_image_paths = [glob.glob(join(TEST_PATH, test_id, "images", "*"))[0] for test_id in test_ids] def threshold(image_gray): image_gray = cv2.GaussianBlur(image_gray, (7, 7), 1) ret, thresh = cv2.threshold(image_gray, 0, 255, cv2.THRESH_OTSU) _, cnts, _ = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) cnts = sorted(cnts, key=cv2.contourArea, reverse=True) max_cnt_area = cv2.contourArea(cnts[0]) if max_cnt_area > 50000: ret, thresh = cv2.threshold(image_gray, 0, 255, cv2.THRESH_OTSU | cv2.THRESH_BINARY_INV) return thresh def apply_morphology(thresh): mask = cv2.dilate(thresh, cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5,5))) mask = cv2.erode(mask, cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5,5))) return mask segmented = [] for test_image_path in tqdm(test_image_paths): tmp_image = cv2.imread(test_image_path, cv2.IMREAD_GRAYSCALE) thresh = threshold(tmp_image) mask = apply_morphology(thresh) segmented.append(mask) def saveResults(a,b): preds_test = a.predict(b, verbose=1) # Create list of upsampled test masks preds_test_upsampled = [] for i in range(len(preds_test)): preds_test_upsampled.append(resize(np.squeeze(preds_test[i]), (sizes_test[i][0], sizes_test[i][1]), mode='constant', preserve_range=True)) new_test_ids = [] rles = [] for n, id_ in enumerate(test_ids): rle = list(prob_to_rles(preds_test_upsampled[n])) rles.extend(rle) new_test_ids.extend([id_] * len(rle)) # Create submission DataFrame sub = pd.DataFrame() sub['ImageId'] = new_test_ids sub['EncodedPixels'] = pd.Series(rles).apply(lambda x: ' '.join(str(y) for y in x)) sub.to_csv(a.name+'.csv', index=False) print("Results Saved") print("\nMethod 1: Simple CNN") saveResults(modelY,X_test) print("\nMethod 2: Unet CNN") saveResults(modelZ,X_test)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 11701, 408, 10518, 30004, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 30004, 13, 5215, 13850, 29906, 30004, 13, 5215, 2897, 30004, 13, 3166, 2897, 29889, 2084, 1053, 5988, 30004, 13, 5215, 13149, 30004, 13, 5215, 10876, 30004, 13, 5215, 4036, 30004, 13, 5215, 18116, 30004, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 30004, 13, 5215, 4256, 8504, 30004, 13, 3166, 4256, 8504, 1053, 9704, 30004, 13, 3166, 2071, 3027, 29889, 601, 1053, 527, 949, 29892, 527, 4294, 29892, 527, 949, 29918, 10855, 29892, 16125, 403, 29918, 8346, 30004, 13, 3166, 2071, 3027, 29889, 9067, 1053, 19490, 30004, 13, 3166, 2071, 3027, 29889, 29885, 5676, 3002, 1053, 3858, 30004, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 7945, 29918, 1688, 29918, 5451, 30004, 13, 5215, 26110, 408, 15886, 30004, 13, 5215, 13023, 294, 30004, 13, 3166, 13023, 294, 29889, 9794, 1053, 922, 339, 2556, 30004, 13, 3166, 13023, 294, 29889, 29277, 1053, 360, 1947, 29892, 20724, 449, 29892, 21775, 362, 29892, 2379, 8606, 29892, 1281, 29894, 29906, 29928, 29892, 5918, 11426, 292, 29906, 29928, 29892, 350, 905, 19077, 2133, 29892, 1281, 29894, 29906, 29928, 29892, 5020, 22966, 10335, 29906, 29928, 29892, 365, 2269, 30004, 13, 3166, 13023, 294, 29889, 9794, 1053, 8125, 29892, 2254, 29918, 4299, 30004, 13, 3166, 13023, 294, 29889, 29277, 1053, 10567, 30004, 13, 3166, 13023, 294, 29889, 29277, 29889, 3221, 1053, 20724, 449, 29892, 365, 2269, 30004, 13, 3166, 13023, 294, 29889, 29277, 29889, 535, 4068, 284, 1053, 1281, 29894, 29906, 29928, 29892, 1281, 29894, 29906, 29928, 4300, 4220, 30004, 13, 3166, 13023, 294, 29889, 29277, 29889, 10109, 292, 1053, 5918, 11426, 292, 29906, 29928, 30004, 13, 3166, 13023, 294, 29889, 29277, 29889, 14634, 1053, 16125, 403, 30004, 13, 3166, 13023, 294, 1053, 14998, 408, 476, 30004, 13, 3166, 13023, 294, 29889, 14035, 29879, 1053, 8251, 1627, 29892, 11095, 20754, 3262, 29892, 4367, 24551, 29931, 1672, 29876, 3247, 403, 585, 29892, 8125, 5596, 3149, 30004, 13, 3166, 13023, 294, 1053, 2847, 19427, 29892, 15359, 29892, 4733, 30004, 13, 3166, 13023, 294, 29889, 13239, 1053, 304, 29918, 29883, 20440, 936, 30004, 13, 3166, 13023, 294, 29889, 13239, 29889, 1730, 29918, 13239, 1053, 6492, 29918, 4299, 30004, 13, 3166, 13023, 294, 29889, 1457, 19170, 29889, 3027, 1053, 7084, 1469, 21575, 30004, 13, 3166, 13023, 294, 1053, 6939, 29879, 30004, 13, 30004, 13, 7833, 29954, 29918, 22574, 353, 29871, 29896, 29906, 29947, 30004, 13, 7833, 29954, 29918, 9606, 22530, 353, 29871, 29896, 29906, 29947, 30004, 13, 7833, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 353, 29871, 29941, 30004, 13, 29911, 4717, 1177, 29918, 10145, 353, 525, 19190, 29896, 29918, 14968, 22208, 30004, 13, 18267, 29918, 10145, 353, 525, 19190, 29896, 29918, 1688, 22208, 30004, 13, 30004, 13, 25442, 886, 29889, 4572, 25442, 886, 877, 17281, 742, 7663, 29922, 2659, 22709, 29892, 3883, 2433, 808, 3027, 1495, 30004, 13, 26776, 353, 29871, 29946, 29906, 30004, 13, 8172, 29889, 26776, 353, 16717, 30004, 13, 9302, 29889, 8172, 29889, 26776, 353, 16717, 30004, 13, 30004, 13, 30004, 13, 2176, 353, 10518, 29889, 949, 29918, 7638, 877, 29907, 22298, 5959, 1966, 492, 29884, 446, 3845, 1966, 17600, 1966, 4836, 29918, 23560, 1966, 19594, 287, 29918, 19190, 29896, 29918, 14968, 29889, 7638, 742, 19570, 29922, 742, 1495, 30004, 13, 2176, 29896, 353, 10518, 29889, 949, 29918, 7638, 877, 29907, 22298, 5959, 1966, 492, 29884, 446, 3845, 1966, 17600, 1966, 4836, 29918, 23560, 1966, 19594, 287, 29918, 19190, 29896, 29918, 1688, 29889, 7638, 742, 19570, 29922, 742, 1495, 30004, 13, 19594, 29922, 8999, 16272, 16272, 1402, 2636, 29962, 30004, 13, 1454, 474, 297, 3464, 29898, 2435, 29898, 2176, 22164, 30004, 13, 12, 361, 4489, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29900, 29901, 30004, 13, 12, 12, 19594, 29961, 29900, 1822, 4397, 29898, 2176, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 12, 23681, 4489, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29896, 29901, 30004, 13, 12, 12, 19594, 29961, 29896, 1822, 4397, 29898, 2176, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 12, 23681, 4489, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29906, 29901, 30004, 13, 12, 12, 19594, 29961, 29906, 1822, 4397, 29898, 2176, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 12, 23681, 4489, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29941, 29901, 30004, 13, 12, 12, 19594, 29961, 29941, 1822, 4397, 29898, 2176, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 30004, 13, 12, 12, 30004, 13, 12, 12, 30004, 13, 19594, 29918, 1688, 29922, 8999, 16272, 16272, 1402, 2636, 29962, 30004, 13, 1454, 474, 297, 3464, 29898, 2435, 29898, 2176, 29896, 22164, 30004, 13, 12, 361, 4489, 29896, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29900, 29901, 30004, 13, 12, 12, 19594, 29918, 1688, 29961, 29900, 1822, 4397, 29898, 2176, 29896, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 12, 23681, 4489, 29896, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29896, 29901, 30004, 13, 12, 12, 19594, 29918, 1688, 29961, 29896, 1822, 4397, 29898, 2176, 29896, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 12, 23681, 4489, 29896, 1839, 19594, 29899, 333, 2033, 29961, 29875, 29962, 1360, 29906, 29901, 30004, 13, 12, 12, 19594, 29918, 1688, 29961, 29906, 1822, 4397, 29898, 2176, 29896, 1839, 2940, 1204, 2033, 29961, 29875, 2314, 30004, 13, 30004, 13, 1204, 797, 6821, 5402, 29922, 29900, 30004, 13, 29937, 3617, 7945, 322, 1243, 23481, 30004, 13, 14968, 29918, 4841, 353, 9867, 29961, 1204, 797, 6821, 5402, 29962, 30004, 13, 1688, 29918, 4841, 353, 9867, 29918, 1688, 29961, 1204, 797, 6821, 5402, 29962, 30004, 13, 30004, 13, 29937, 3617, 322, 19490, 7945, 4558, 322, 11105, 29879, 30004, 13, 29990, 29918, 14968, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 14968, 29918, 4841, 511, 22313, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 29892, 22313, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 511, 26688, 29922, 9302, 29889, 13470, 29947, 8443, 13, 29979, 29918, 14968, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 14968, 29918, 4841, 511, 22313, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 29892, 29871, 29896, 511, 26688, 29922, 9302, 29889, 11227, 8443, 13, 2158, 877, 2577, 1259, 322, 620, 5281, 7945, 4558, 322, 11105, 29879, 2023, 525, 8443, 13, 9675, 29889, 25393, 29889, 23126, 26471, 13, 1454, 302, 29892, 1178, 29918, 297, 260, 29939, 18933, 29898, 15172, 29898, 14968, 29918, 4841, 511, 3001, 29922, 2435, 29898, 14968, 29918, 4841, 22164, 30004, 13, 12, 2084, 353, 323, 4717, 1177, 29918, 10145, 718, 1178, 29918, 30004, 13, 12, 2492, 353, 527, 949, 29898, 2084, 718, 8207, 8346, 22208, 718, 1178, 29918, 718, 15300, 2732, 1495, 7503, 29892, 29901, 29892, 29901, 7833, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 29962, 30004, 13, 12, 2492, 353, 19490, 29898, 2492, 29892, 313, 7833, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 511, 4464, 2433, 23362, 742, 19905, 29918, 3881, 29922, 5574, 8443, 13, 12, 29990, 29918, 14968, 29961, 29876, 29962, 353, 10153, 30004, 13, 12, 13168, 353, 7442, 29889, 3298, 359, 3552, 7833, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 29892, 29871, 29896, 511, 26688, 29922, 9302, 29889, 11227, 8443, 13, 12, 1454, 11105, 29918, 1445, 297, 2446, 29898, 359, 29889, 20919, 29898, 2084, 718, 8207, 13168, 29879, 29914, 8785, 29961, 29906, 5387, 30004, 13, 12, 12, 13168, 29918, 353, 527, 949, 29898, 2084, 718, 8207, 13168, 29879, 22208, 718, 11105, 29918, 1445, 8443, 13, 12, 12, 13168, 29918, 353, 7442, 29889, 18837, 29918, 6229, 29879, 29898, 21476, 29898, 13168, 3383, 313, 7833, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 511, 4464, 2433, 23362, 742, 6756, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29871, 19905, 29918, 3881, 29922, 5574, 511, 9685, 10457, 29896, 8443, 13, 12, 12, 13168, 353, 7442, 29889, 27525, 398, 29898, 13168, 29892, 11105, 29918, 8443, 13, 12, 29979, 29918, 14968, 29961, 29876, 29962, 353, 11105, 30004, 13, 30004, 13, 29937, 3617, 322, 19490, 1243, 4558, 30004, 13, 29990, 29918, 1688, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 1688, 29918, 4841, 511, 22313, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 29892, 22313, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 511, 26688, 29922, 9302, 29889, 13470, 29947, 8443, 13, 29879, 7093, 29918, 1688, 353, 5159, 30004, 13, 2158, 877, 2577, 1259, 322, 620, 5281, 1243, 4558, 2023, 525, 8443, 13, 9675, 29889, 25393, 29889, 23126, 26471, 13, 1454, 302, 29892, 1178, 29918, 297, 260, 29939, 18933, 29898, 15172, 29898, 1688, 29918, 4841, 511, 3001, 29922, 2435, 29898, 1688, 29918, 4841, 22164, 30004, 13, 12, 2084, 353, 17067, 1254, 29918, 10145, 718, 1178, 29918, 30004, 13, 12, 2492, 353, 527, 949, 29898, 2084, 718, 8207, 8346, 22208, 718, 1178, 29918, 718, 15300, 2732, 1495, 7503, 29892, 29901, 29892, 29901, 7833, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 29962, 30004, 13, 12, 29879, 7093, 29918, 1688, 29889, 4397, 4197, 2492, 29889, 12181, 29961, 29900, 1402, 10153, 29889, 12181, 29961, 29896, 24960, 30004, 13, 12, 2492, 353, 19490, 29898, 2492, 29892, 313, 7833, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 511, 4464, 2433, 23362, 742, 19905, 29918, 3881, 29922, 5574, 8443, 13, 12, 29990, 29918, 1688, 29961, 29876, 29962, 353, 10153, 30004, 13, 2158, 877, 25632, 29991, 1495, 30004, 13, 30004, 13, 29916, 29918, 14968, 29892, 921, 29918, 1688, 29892, 343, 29918, 14968, 29892, 343, 29918, 1688, 353, 7945, 29918, 1688, 29918, 5451, 29898, 29990, 29918, 14968, 29892, 612, 29918, 14968, 29892, 1243, 29918, 2311, 29922, 29900, 29889, 29906, 8443, 13, 2158, 28909, 23818, 29918, 14968, 742, 29916, 29918, 14968, 29889, 12181, 8443, 13, 2158, 877, 29916, 29918, 1688, 742, 29916, 29918, 1688, 29889, 12181, 8443, 13, 2158, 877, 29891, 29918, 14968, 742, 29891, 29918, 14968, 29889, 12181, 8443, 13, 2158, 877, 29891, 29918, 1688, 742, 29891, 29918, 1688, 29889, 12181, 8443, 13, 30004, 13, 1753, 6492, 5323, 262, 1469, 29898, 29874, 29892, 29890, 1125, 30004, 13, 12, 1454, 474, 297, 3464, 29898, 29945, 1125, 30004, 13, 12, 12, 861, 353, 4036, 29889, 9502, 524, 29898, 29900, 29892, 7431, 29898, 14968, 29918, 4841, 876, 30004, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29892, 29906, 29892, 29896, 8443, 13, 12, 12, 572, 29873, 29889, 3257, 703, 29990, 29918, 14968, 1159, 30004, 13, 12, 12, 326, 4294, 29898, 29874, 29961, 861, 2314, 30004, 13, 12, 12, 572, 29873, 29889, 8990, 877, 2696, 1495, 30004, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29892, 29906, 29892, 29906, 8443, 13, 12, 12, 572, 29873, 29889, 3257, 703, 29979, 29918, 14968, 1159, 30004, 13, 12, 12, 326, 4294, 29898, 9302, 29889, 29879, 802, 29872, 911, 29898, 29890, 29961, 861, 12622, 30004, 13, 12, 12, 572, 29873, 29889, 8990, 877, 2696, 1495, 30004, 13, 12, 12, 572, 29873, 29889, 4294, 26471, 13, 5317, 5323, 262, 1469, 29898, 29990, 29918, 14968, 29892, 29979, 29918, 14968, 8443, 13, 30004, 13, 1990, 4737, 10817, 5596, 3149, 29898, 10717, 1125, 30004, 13, 1678, 9995, 10717, 393, 27401, 21556, 1156, 1269, 21502, 305, 15945, 19451, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4078, 2084, 1125, 30004, 13, 4706, 2428, 29898, 10095, 10817, 5596, 3149, 29892, 1583, 467, 1649, 2344, 1649, 26471, 13, 4706, 1583, 29889, 7620, 2084, 353, 4078, 2084, 30004, 13, 4706, 1583, 29889, 18434, 353, 6571, 30004, 13, 1678, 822, 373, 29918, 1022, 2878, 29918, 355, 29898, 1311, 29892, 21502, 305, 29892, 10748, 29922, 8516, 1125, 30004, 13, 4706, 363, 413, 29892, 325, 297, 10748, 29889, 7076, 7295, 30004, 13, 9651, 1583, 29889, 18434, 29889, 842, 4381, 29898, 29895, 29892, 5159, 467, 4397, 29898, 29894, 8443, 13, 4706, 7442, 29889, 7620, 29898, 1311, 29889, 7620, 2084, 29892, 1583, 29889, 18434, 8443, 13, 30004, 13, 1753, 6492, 29968, 18464, 29931, 799, 1076, 23902, 345, 7295, 30004, 13, 1678, 14770, 29889, 4532, 29898, 1003, 2311, 7607, 29896, 29900, 29892, 29945, 876, 30004, 13, 1678, 21556, 353, 7442, 29889, 1359, 877, 20756, 29889, 29876, 2272, 29861, 580, 29962, 30004, 13, 1678, 977, 29873, 353, 6024, 5753, 2033, 396, 1018, 304, 788, 525, 6758, 29915, 304, 1074, 278, 6410, 6509, 11672, 30004, 13, 1678, 363, 413, 297, 4175, 29898, 2892, 921, 584, 7442, 29889, 1384, 4197, 6859, 297, 921, 363, 413, 29895, 297, 977, 29873, 11724, 21556, 29889, 8149, 580, 1125, 30004, 13, 4706, 301, 353, 7442, 29889, 2378, 29898, 2527, 10817, 29961, 29895, 2314, 30004, 13, 4706, 14770, 29889, 5317, 29898, 29880, 29892, 274, 29922, 525, 29878, 29915, 565, 525, 791, 29915, 451, 297, 413, 1683, 525, 29890, 742, 3858, 2433, 791, 29915, 565, 525, 791, 29915, 297, 413, 1683, 525, 14968, 1495, 30004, 13, 4706, 921, 353, 7442, 29889, 1191, 1195, 29898, 29880, 29897, 565, 525, 6758, 29915, 297, 413, 1683, 7442, 29889, 1191, 3317, 29898, 29880, 8443, 13, 4706, 343, 353, 301, 29961, 29916, 29962, 30004, 13, 4706, 14770, 29889, 1557, 2620, 29898, 29916, 29892, 29891, 29892, 301, 29893, 29922, 29900, 29892, 15595, 29922, 29900, 29889, 29906, 29945, 29892, 269, 29922, 29896, 29900, 29900, 29892, 274, 2433, 29878, 29915, 565, 525, 791, 29915, 451, 297, 413, 1683, 525, 29890, 1495, 30004, 13, 4706, 14770, 29889, 726, 29898, 29916, 29892, 343, 29892, 525, 8875, 353, 12365, 29889, 29946, 29888, 29913, 4286, 4830, 29898, 29916, 29892, 29891, 511, 2159, 2433, 29896, 29945, 742, 2927, 29922, 525, 29878, 29915, 565, 525, 791, 29915, 451, 297, 413, 1683, 525, 29890, 1495, 259, 6756, 13, 1678, 14770, 29889, 26172, 29898, 2029, 29922, 29946, 8443, 13, 1678, 14770, 29889, 8990, 4197, 29900, 29892, 6213, 29892, 6213, 29892, 6213, 5691, 30004, 13, 1678, 14770, 29889, 7720, 26471, 13, 1678, 14770, 29889, 29916, 1643, 877, 4557, 310, 21502, 12168, 1495, 30004, 13, 12, 30004, 13, 1753, 6492, 29918, 21891, 29918, 2764, 345, 29898, 18434, 1125, 30004, 13, 12, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29947, 876, 30004, 13, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29892, 29906, 29892, 29896, 8443, 13, 12, 572, 29873, 29889, 5317, 29898, 18434, 29889, 18434, 1839, 5753, 2033, 8443, 13, 12, 572, 29873, 29889, 5317, 29898, 18434, 29889, 18434, 1839, 791, 29918, 5753, 2033, 8443, 13, 12, 572, 29873, 29889, 3257, 877, 4299, 13600, 1495, 30004, 13, 12, 572, 29873, 29889, 29891, 1643, 877, 562, 2764, 4135, 1495, 30004, 13, 12, 572, 29873, 29889, 29916, 1643, 877, 1022, 2878, 1495, 30004, 13, 12, 572, 29873, 29889, 26172, 18959, 14968, 742, 525, 1688, 7464, 1180, 2433, 21064, 2175, 1495, 30004, 13, 12, 572, 29873, 29889, 7620, 1003, 877, 6904, 562, 2764, 4135, 29918, 2764, 345, 29889, 2732, 1495, 30004, 13, 12, 29937, 572, 29873, 29889, 695, 29888, 26471, 13, 12, 29937, 19138, 675, 4955, 363, 6410, 30004, 13, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29892, 29906, 29892, 29906, 8443, 13, 12, 572, 29873, 29889, 5317, 29898, 18434, 29889, 18434, 1839, 6758, 2033, 8443, 13, 12, 572, 29873, 29889, 5317, 29898, 18434, 29889, 18434, 1839, 791, 29918, 6758, 2033, 8443, 13, 12, 572, 29873, 29889, 3257, 877, 4299, 6410, 1495, 30004, 13, 12, 572, 29873, 29889, 29891, 1643, 877, 6758, 1495, 30004, 13, 12, 572, 29873, 29889, 29916, 1643, 877, 1022, 2878, 1495, 30004, 13, 12, 572, 29873, 29889, 26172, 18959, 14968, 742, 525, 1688, 7464, 1180, 2433, 21064, 2175, 1495, 30004, 13, 12, 572, 29873, 29889, 7620, 1003, 877, 6904, 6758, 29918, 2764, 345, 29889, 2732, 1495, 30004, 13, 30004, 13, 29937, 22402, 22244, 29965, 12714, 30004, 13, 1753, 2099, 29918, 29875, 283, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 1125, 30004, 13, 12, 17990, 353, 5159, 30004, 13, 12, 1454, 260, 297, 7442, 29889, 279, 927, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29945, 1125, 30004, 13, 12, 12, 29891, 29918, 11965, 29918, 353, 15886, 29889, 517, 29918, 524, 29941, 29906, 29898, 29891, 29918, 11965, 1405, 260, 8443, 13, 12, 12, 13628, 29892, 701, 29918, 3670, 353, 15886, 29889, 2527, 10817, 29889, 12676, 29918, 29875, 283, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 3383, 29871, 29906, 8443, 13, 12, 12, 29968, 29889, 657, 29918, 7924, 2141, 3389, 29898, 13264, 29889, 2997, 29918, 20897, 29918, 11228, 3950, 3101, 30004, 13, 12, 12, 2541, 15886, 29889, 6451, 29918, 22594, 4197, 786, 29918, 3670, 29962, 1125, 30004, 13, 12, 12, 12, 13628, 353, 15886, 29889, 22350, 29898, 13628, 8443, 13, 12, 12, 17990, 29889, 4397, 29898, 13628, 8443, 13, 12, 2457, 476, 29889, 12676, 29898, 29968, 29889, 1429, 29898, 17990, 511, 9685, 29922, 29900, 8443, 13, 30004, 13, 29937, 29934, 1307, 8025, 363, 29240, 30004, 13, 1753, 364, 280, 29918, 22331, 29898, 29916, 1125, 30004, 13, 12, 7778, 353, 7442, 29889, 3062, 29898, 29916, 29889, 29911, 29889, 1579, 8606, 580, 1275, 29871, 29896, 9601, 29900, 29962, 30004, 13, 12, 3389, 29918, 2848, 29879, 353, 5159, 30004, 13, 12, 16304, 353, 448, 29906, 30004, 13, 12, 1454, 289, 297, 270, 1862, 29901, 30004, 13, 12, 12, 361, 313, 29890, 29958, 16304, 29974, 29896, 1125, 1065, 29918, 2848, 29879, 29889, 21843, 3552, 29890, 718, 29871, 29896, 29892, 29871, 29900, 876, 30004, 13, 12, 12, 3389, 29918, 2848, 29879, 14352, 29896, 29962, 4619, 29871, 29896, 30004, 13, 12, 12, 16304, 353, 289, 30004, 13, 12, 2457, 1065, 29918, 2848, 29879, 30004, 13, 30004, 13, 1753, 2070, 29918, 517, 29918, 29878, 793, 29898, 29916, 29892, 5700, 2696, 29922, 29900, 29889, 29945, 1125, 30004, 13, 12, 8205, 29918, 2492, 353, 3858, 29898, 29916, 1405, 5700, 2696, 8443, 13, 12, 1454, 474, 297, 3464, 29898, 29896, 29892, 9775, 29918, 2492, 29889, 3317, 580, 718, 29871, 29896, 1125, 30004, 13, 12, 12, 29891, 969, 364, 280, 29918, 22331, 29898, 8205, 29918, 2492, 1275, 474, 8443, 13, 12, 12, 30004, 13, 1753, 22717, 3580, 1307, 29898, 29874, 29892, 29890, 29892, 29883, 29892, 29881, 1125, 30004, 13, 12, 3844, 6983, 353, 29871, 29896, 22993, 13, 12, 1753, 17629, 29918, 1111, 1389, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 1125, 30004, 13, 12, 12, 29891, 29918, 3009, 29918, 29888, 353, 476, 29889, 1579, 8606, 29898, 29891, 29918, 3009, 8443, 13, 12, 12, 29891, 29918, 11965, 29918, 29888, 353, 476, 29889, 1579, 8606, 29898, 29891, 29918, 11965, 8443, 13, 12, 12, 1639, 2042, 353, 476, 29889, 2083, 29898, 29891, 29918, 3009, 29918, 29888, 334, 343, 29918, 11965, 29918, 29888, 8443, 13, 12, 12, 2457, 313, 29906, 29889, 334, 17686, 718, 10597, 29897, 847, 313, 29968, 29889, 2083, 29898, 29891, 29918, 3009, 29918, 29888, 29897, 718, 476, 29889, 2083, 29898, 29891, 29918, 11965, 29918, 29888, 29897, 718, 10597, 8443, 13, 12, 1753, 17629, 29918, 1111, 1389, 29918, 6758, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 1125, 30004, 13, 12, 12, 2457, 448, 29881, 625, 29918, 1111, 1389, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 8443, 13, 12, 12857, 29918, 29883, 15755, 353, 922, 339, 2556, 26471, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 23145, 19077, 2133, 29898, 2080, 29918, 12181, 353, 313, 8516, 29892, 6213, 29892, 22313, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 511, 978, 353, 525, 19077, 675, 4290, 8785, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29947, 29892, 8466, 29918, 2311, 353, 313, 29941, 29892, 29941, 511, 7164, 353, 525, 17642, 8785, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29947, 29892, 8466, 29918, 2311, 353, 313, 29941, 29892, 29941, 511, 7164, 353, 525, 17642, 8785, 30004, 13, 12, 29937, 671, 21749, 800, 304, 679, 263, 10029, 7200, 1746, 310, 1776, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 8466, 29918, 2311, 353, 313, 29941, 29892, 29941, 511, 270, 8634, 29918, 10492, 353, 29871, 29906, 29892, 7164, 353, 525, 17642, 8785, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 8466, 29918, 2311, 353, 313, 29941, 29892, 29941, 511, 270, 8634, 29918, 10492, 353, 29871, 29906, 29892, 7164, 353, 525, 17642, 8785, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29941, 29906, 29892, 8466, 29918, 2311, 353, 313, 29941, 29892, 29941, 511, 270, 8634, 29918, 10492, 353, 29871, 29941, 29892, 7164, 353, 525, 17642, 8785, 30004, 13, 12, 29937, 278, 2186, 9068, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 8466, 29918, 2311, 353, 313, 29896, 29892, 29896, 511, 7164, 353, 525, 17642, 8785, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 1202, 29898, 1168, 29894, 29906, 29928, 29898, 29896, 29892, 8466, 29918, 2311, 353, 313, 29896, 29892, 29896, 511, 7164, 353, 525, 17642, 742, 26229, 353, 525, 18816, 29885, 3398, 8785, 30004, 13, 12, 12857, 29918, 29883, 15755, 29889, 7727, 26471, 13, 12, 799, 368, 7864, 2496, 353, 11095, 20754, 3262, 29898, 29886, 24701, 29922, 29945, 29892, 26952, 29922, 29896, 8443, 13, 12, 3198, 17226, 353, 8125, 5596, 3149, 877, 4299, 29899, 6289, 17729, 29880, 29906, 29900, 29896, 29947, 29899, 29896, 29889, 29882, 29945, 742, 26952, 29922, 29896, 29892, 4078, 29918, 13318, 29918, 6194, 29922, 5574, 8443, 13, 12, 12857, 29918, 29883, 15755, 29889, 12198, 29898, 20640, 3950, 353, 525, 328, 314, 742, 6756, 13, 12, 12, 12, 12, 12, 259, 6410, 353, 17629, 29918, 1111, 1389, 29918, 6758, 29892, 6756, 13, 12, 12, 12, 12, 12, 259, 21556, 353, 518, 29881, 625, 29918, 1111, 1389, 29892, 525, 5753, 742, 525, 29885, 344, 2033, 8443, 13, 12, 18434, 353, 2560, 29918, 29883, 15755, 29889, 9202, 29898, 29916, 29918, 14968, 29892, 29891, 29918, 14968, 29892, 8845, 29918, 1272, 7607, 29916, 29918, 1688, 29892, 29891, 29918, 1688, 511, 14035, 29879, 353, 518, 799, 368, 7864, 2496, 29892, 1423, 17226, 29892, 4737, 10817, 5596, 3149, 877, 20756, 1495, 1402, 1022, 2878, 29879, 353, 29871, 29941, 29900, 8443, 13, 12, 5317, 29918, 21891, 29918, 2764, 345, 29898, 18434, 8443, 13, 12, 572, 29873, 29889, 4294, 26471, 13, 12, 5317, 29968, 18464, 29931, 799, 1076, 23902, 345, 26471, 13, 12, 572, 29873, 29889, 4294, 26471, 13, 12, 10945, 1904, 29979, 30004, 13, 12, 4299, 29979, 353, 2560, 29918, 29883, 15755, 30004, 13, 12, 2457, 1904, 29979, 30004, 13, 5425, 3580, 1307, 29898, 29916, 29918, 14968, 29892, 343, 29918, 14968, 29892, 29916, 29918, 1688, 29892, 29891, 29918, 1688, 8443, 13, 30004, 13, 1753, 501, 6006, 29898, 29874, 29892, 29890, 29892, 29883, 29892, 29881, 1125, 30004, 13, 12, 29937, 8878, 501, 29899, 6779, 1904, 30004, 13, 12, 2080, 29879, 353, 10567, 3552, 7833, 29954, 29918, 9606, 22530, 29892, 22313, 29954, 29918, 22574, 29892, 22313, 29954, 29918, 3210, 2190, 29940, 6670, 29903, 876, 30004, 13, 12, 29879, 353, 365, 2269, 29898, 2892, 921, 29901, 921, 847, 29871, 29906, 29945, 29945, 29897, 313, 2080, 29879, 8443, 13, 12, 29883, 29896, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29879, 8443, 13, 12, 29883, 29896, 353, 20724, 449, 29898, 29900, 29889, 29896, 29897, 313, 29883, 29896, 8443, 13, 12, 29883, 29896, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29896, 8443, 13, 12, 29886, 29896, 353, 5918, 11426, 292, 29906, 29928, 3552, 29906, 29892, 29871, 29906, 876, 313, 29883, 29896, 8443, 13, 12, 29883, 29906, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29906, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29886, 29896, 8443, 13, 12, 29883, 29906, 353, 20724, 449, 29898, 29900, 29889, 29896, 29897, 313, 29883, 29906, 8443, 13, 12, 29883, 29906, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29906, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29906, 8443, 13, 12, 29886, 29906, 353, 5918, 11426, 292, 29906, 29928, 3552, 29906, 29892, 29871, 29906, 876, 313, 29883, 29906, 8443, 13, 12, 29883, 29941, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29886, 29906, 8443, 13, 12, 29883, 29941, 353, 20724, 449, 29898, 29900, 29889, 29906, 29897, 313, 29883, 29941, 8443, 13, 12, 29883, 29941, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29941, 8443, 13, 12, 29886, 29941, 353, 5918, 11426, 292, 29906, 29928, 3552, 29906, 29892, 29871, 29906, 876, 313, 29883, 29941, 8443, 13, 12, 29883, 29946, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29906, 29947, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29886, 29941, 8443, 13, 12, 29883, 29946, 353, 20724, 449, 29898, 29900, 29889, 29906, 29897, 313, 29883, 29946, 8443, 13, 12, 29883, 29946, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29906, 29947, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29946, 8443, 13, 12, 29886, 29946, 353, 5918, 11426, 292, 29906, 29928, 29898, 10109, 29918, 2311, 7607, 29906, 29892, 29871, 29906, 876, 313, 29883, 29946, 8443, 13, 12, 29883, 29945, 353, 1281, 29894, 29906, 29928, 29898, 29906, 29945, 29953, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29886, 29946, 8443, 13, 12, 29883, 29945, 353, 20724, 449, 29898, 29900, 29889, 29941, 29897, 313, 29883, 29945, 8443, 13, 12, 29883, 29945, 353, 1281, 29894, 29906, 29928, 29898, 29906, 29945, 29953, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29945, 8443, 13, 12, 29884, 29953, 353, 1281, 29894, 29906, 29928, 4300, 4220, 29898, 29896, 29906, 29947, 29892, 313, 29906, 29892, 29871, 29906, 511, 851, 2247, 7607, 29906, 29892, 29871, 29906, 511, 7164, 2433, 17642, 1495, 313, 29883, 29945, 8443, 13, 12, 29884, 29953, 353, 16125, 403, 4197, 29884, 29953, 29892, 274, 29946, 2314, 30004, 13, 12, 29883, 29953, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29906, 29947, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29884, 29953, 8443, 13, 12, 29883, 29953, 353, 20724, 449, 29898, 29900, 29889, 29906, 29897, 313, 29883, 29953, 8443, 13, 12, 29883, 29953, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29906, 29947, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29953, 8443, 13, 12, 29884, 29955, 353, 1281, 29894, 29906, 29928, 4300, 4220, 29898, 29953, 29946, 29892, 313, 29906, 29892, 29871, 29906, 511, 851, 2247, 7607, 29906, 29892, 29871, 29906, 511, 7164, 2433, 17642, 1495, 313, 29883, 29953, 8443, 13, 12, 29884, 29955, 353, 16125, 403, 4197, 29884, 29955, 29892, 274, 29941, 2314, 30004, 13, 12, 29883, 29955, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29884, 29955, 8443, 13, 12, 29883, 29955, 353, 20724, 449, 29898, 29900, 29889, 29906, 29897, 313, 29883, 29955, 8443, 13, 12, 29883, 29955, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29955, 8443, 13, 12, 29884, 29947, 353, 1281, 29894, 29906, 29928, 4300, 4220, 29898, 29941, 29906, 29892, 313, 29906, 29892, 29871, 29906, 511, 851, 2247, 7607, 29906, 29892, 29871, 29906, 511, 7164, 2433, 17642, 1495, 313, 29883, 29955, 8443, 13, 12, 29884, 29947, 353, 16125, 403, 4197, 29884, 29947, 29892, 274, 29906, 2314, 30004, 13, 12, 29883, 29947, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29906, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29884, 29947, 8443, 13, 12, 29883, 29947, 353, 20724, 449, 29898, 29900, 29889, 29896, 29897, 313, 29883, 29947, 8443, 13, 12, 29883, 29947, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29906, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29947, 8443, 13, 12, 29884, 29929, 353, 1281, 29894, 29906, 29928, 4300, 4220, 29898, 29896, 29953, 29892, 313, 29906, 29892, 29871, 29906, 511, 851, 2247, 7607, 29906, 29892, 29871, 29906, 511, 7164, 2433, 17642, 1495, 313, 29883, 29947, 8443, 13, 12, 29884, 29929, 353, 16125, 403, 4197, 29884, 29929, 29892, 274, 29896, 1402, 9685, 29922, 29941, 8443, 13, 12, 29883, 29929, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29884, 29929, 8443, 13, 12, 29883, 29929, 353, 20724, 449, 29898, 29900, 29889, 29896, 29897, 313, 29883, 29929, 8443, 13, 12, 29883, 29929, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29953, 29892, 313, 29941, 29892, 29871, 29941, 511, 26229, 2433, 295, 29884, 742, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 7164, 2433, 17642, 1495, 313, 29883, 29929, 8443, 13, 12, 4905, 29879, 353, 1281, 29894, 29906, 29928, 29898, 29896, 29892, 313, 29896, 29892, 29871, 29896, 511, 26229, 2433, 18816, 29885, 3398, 1495, 313, 29883, 29929, 8443, 13, 12, 4299, 353, 8125, 29898, 2080, 29879, 11759, 2080, 29879, 1402, 14391, 11759, 4905, 29879, 2314, 30004, 13, 12, 4299, 29889, 12198, 29898, 20640, 3950, 2433, 328, 314, 742, 6410, 2433, 19541, 29918, 19128, 296, 14441, 742, 21556, 11759, 12676, 29918, 29875, 283, 5501, 562, 2764, 4135, 2033, 8443, 13, 12, 29937, 4299, 29889, 12198, 29898, 20640, 3950, 2433, 328, 314, 742, 6410, 2433, 19541, 29918, 19128, 296, 14441, 742, 21556, 29922, 1839, 5753, 2033, 8443, 13, 12, 4299, 29889, 7727, 26471, 13, 12, 29937, 383, 277, 1904, 30004, 13, 12, 799, 368, 7864, 2496, 353, 11095, 20754, 3262, 29898, 29886, 24701, 29922, 29945, 29892, 26952, 29922, 29896, 8443, 13, 12, 3198, 17226, 353, 8125, 5596, 3149, 877, 4299, 29899, 6289, 17729, 29880, 29906, 29900, 29896, 29947, 29899, 29906, 29889, 29882, 29945, 742, 26952, 29922, 29896, 29892, 4078, 29918, 13318, 29918, 6194, 29922, 5574, 8443, 13, 12, 9902, 353, 1904, 29889, 9202, 29898, 29874, 29892, 29890, 29892, 16175, 29918, 2311, 29922, 29896, 29953, 29892, 369, 15828, 29922, 29896, 29892, 1022, 2878, 29879, 29922, 29941, 29900, 29892, 18157, 29918, 1272, 7607, 29883, 29892, 29881, 511, 14035, 29879, 353, 518, 799, 368, 7864, 2496, 29892, 1423, 17226, 29892, 4737, 10817, 5596, 3149, 877, 20756, 1495, 2314, 30004, 13, 12, 5317, 29918, 21891, 29918, 2764, 345, 29898, 9902, 8443, 13, 12, 572, 29873, 29889, 4294, 26471, 13, 12, 5317, 29968, 18464, 29931, 799, 1076, 23902, 345, 26471, 13, 12, 572, 29873, 29889, 4294, 26471, 13, 12, 10945, 1904, 29999, 30004, 13, 12, 4299, 29999, 353, 1904, 30004, 13, 12, 2457, 1904, 29999, 30004, 13, 3904, 2544, 29898, 29916, 29918, 14968, 29892, 343, 29918, 14968, 29892, 29916, 29918, 1688, 29892, 29891, 29918, 1688, 8443, 13, 30004, 13, 1753, 6492, 23084, 919, 1080, 29898, 29874, 29892, 29890, 29892, 29883, 29892, 29881, 29892, 29872, 1125, 30004, 13, 1678, 1904, 353, 321, 30004, 13, 1678, 396, 498, 12268, 27303, 30004, 13, 1678, 4450, 29879, 29918, 14968, 353, 1904, 29889, 27711, 29898, 29874, 7503, 524, 29898, 29874, 29889, 12181, 29961, 29900, 14178, 29900, 29889, 29929, 29897, 1402, 26952, 29922, 29896, 8443, 13, 1678, 4450, 29879, 29918, 791, 353, 1904, 29889, 27711, 29898, 29874, 29961, 524, 29898, 29874, 29889, 12181, 29961, 29900, 14178, 29900, 29889, 29929, 1125, 1402, 26952, 29922, 29896, 8443, 13, 1678, 4450, 29879, 29918, 1688, 353, 1904, 29889, 27711, 29898, 29883, 29892, 26952, 29922, 29896, 8443, 13, 1678, 4450, 29879, 29918, 14968, 29918, 29873, 353, 313, 11965, 29879, 29918, 14968, 1405, 29871, 29900, 29889, 29945, 467, 579, 668, 29898, 9302, 29889, 13470, 29947, 8443, 13, 1678, 4450, 29879, 29918, 791, 29918, 29873, 353, 313, 11965, 29879, 29918, 791, 1405, 29871, 29900, 29889, 29945, 467, 579, 668, 29898, 9302, 29889, 13470, 29947, 8443, 13, 1678, 4450, 29879, 29918, 1688, 29918, 29873, 353, 313, 11965, 29879, 29918, 1688, 1405, 29871, 29900, 29889, 29945, 467, 579, 668, 29898, 9302, 29889, 13470, 29947, 8443, 13, 1678, 396, 27313, 263, 9753, 537, 1423, 373, 777, 4036, 6694, 11916, 30004, 13, 1678, 474, 29916, 353, 4036, 29889, 9502, 524, 29898, 29900, 29892, 7431, 29898, 11965, 29879, 29918, 14968, 29918, 29873, 876, 30004, 13, 1678, 14770, 29889, 1491, 5317, 29898, 29896, 29892, 29941, 29892, 29896, 8443, 13, 1678, 14770, 29889, 3257, 703, 29990, 29918, 14968, 1159, 30004, 13, 1678, 14770, 29889, 8990, 877, 2696, 1495, 30004, 13, 1678, 527, 4294, 29898, 29874, 29961, 861, 2314, 30004, 13, 1678, 14770, 29889, 1491, 5317, 29898, 29896, 29892, 29941, 29892, 29906, 8443, 13, 1678, 14770, 29889, 3257, 703, 29979, 29918, 14968, 1159, 30004, 13, 1678, 14770, 29889, 8990, 877, 2696, 1495, 30004, 13, 1678, 527, 4294, 29898, 9302, 29889, 29879, 802, 29872, 911, 29898, 29890, 29961, 861, 12622, 30004, 13, 1678, 14770, 29889, 1491, 5317, 29898, 29896, 29892, 29941, 29892, 29941, 8443, 13, 1678, 14770, 29889, 3257, 703, 23084, 2463, 1159, 30004, 13, 1678, 14770, 29889, 8990, 877, 2696, 1495, 30004, 13, 1678, 527, 4294, 29898, 9302, 29889, 29879, 802, 29872, 911, 29898, 11965, 29879, 29918, 14968, 29918, 29873, 29961, 861, 12622, 30004, 13, 1678, 14770, 29889, 4294, 26471, 13, 1678, 396, 27313, 263, 9753, 537, 1423, 373, 777, 4036, 8845, 11916, 30004, 13, 1678, 474, 29916, 353, 4036, 29889, 9502, 524, 29898, 29900, 29892, 7431, 29898, 11965, 29879, 29918, 791, 29918, 29873, 876, 30004, 13, 1678, 14770, 29889, 1491, 5317, 29898, 29896, 29892, 29941, 29892, 29896, 8443, 13, 1678, 14770, 29889, 3257, 703, 29990, 29918, 1688, 1159, 30004, 13, 1678, 14770, 29889, 8990, 877, 2696, 1495, 30004, 13, 1678, 527, 4294, 29898, 29874, 29961, 524, 29898, 29874, 29889, 12181, 29961, 29900, 14178, 29900, 29889, 29929, 1125, 3816, 861, 2314, 30004, 13, 1678, 14770, 29889, 1491, 5317, 29898, 29896, 29892, 29941, 29892, 29906, 8443, 13, 1678, 14770, 29889, 3257, 703, 29979, 29918, 1688, 1159, 30004, 13, 1678, 14770, 29889, 8990, 877, 2696, 1495, 30004, 13, 1678, 527, 4294, 29898, 9302, 29889, 29879, 802, 29872, 911, 29898, 29890, 29961, 524, 29898, 29890, 29889, 12181, 29961, 29900, 14178, 29900, 29889, 29929, 1125, 3816, 861, 12622, 30004, 13, 1678, 14770, 29889, 1491, 5317, 29898, 29896, 29892, 29941, 29892, 29941, 8443, 13, 1678, 14770, 29889, 3257, 703, 23084, 2463, 1159, 30004, 13, 1678, 14770, 29889, 8990, 877, 2696, 1495, 30004, 13, 1678, 527, 4294, 29898, 9302, 29889, 29879, 802, 29872, 911, 29898, 11965, 29879, 29918, 791, 29918, 29873, 29961, 861, 12622, 30004, 13, 1678, 14770, 29889, 4294, 26471, 13, 5317, 23084, 919, 1080, 29898, 29916, 29918, 14968, 29892, 29891, 29918, 14968, 29892, 29916, 29918, 1688, 29892, 29891, 29918, 1688, 29892, 4299, 29999, 8443, 13, 30004, 13, 30004, 13, 1688, 29918, 3027, 29918, 24772, 353, 518, 23705, 29889, 23705, 29898, 7122, 29898, 18267, 29918, 10145, 29892, 1243, 29918, 333, 29892, 376, 8346, 613, 26345, 5783, 29961, 29900, 29962, 363, 1243, 29918, 333, 297, 1243, 29918, 4841, 29962, 30004, 13, 30004, 13, 1753, 16897, 29898, 3027, 29918, 21012, 1125, 30004, 13, 12, 3027, 29918, 21012, 353, 13850, 29906, 29889, 29954, 17019, 10358, 332, 29898, 3027, 29918, 21012, 29892, 313, 29955, 29892, 29871, 29955, 511, 29871, 29896, 8443, 13, 12, 2267, 29892, 266, 3781, 353, 13850, 29906, 29889, 386, 12268, 29898, 3027, 29918, 21012, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29906, 29889, 4690, 1525, 7068, 29918, 2891, 14605, 8443, 13, 12, 30004, 13, 12, 3383, 274, 593, 29879, 29892, 903, 353, 13850, 29906, 29889, 2886, 1323, 2470, 29898, 386, 3781, 29892, 13850, 29906, 29889, 1525, 5659, 29918, 29911, 21661, 29892, 13850, 29906, 29889, 3210, 29909, 1177, 29918, 3301, 8618, 29990, 29918, 5425, 3580, 1307, 8443, 13, 12, 20047, 29879, 353, 12705, 29898, 20047, 29879, 29892, 1820, 29922, 11023, 29906, 29889, 1285, 473, 13799, 29892, 11837, 29922, 5574, 8443, 13, 12, 3317, 29918, 20047, 29918, 6203, 353, 13850, 29906, 29889, 1285, 473, 13799, 29898, 20047, 29879, 29961, 29900, 2314, 30004, 13, 12, 30004, 13, 12, 361, 4236, 29918, 20047, 29918, 6203, 1405, 29871, 29945, 29900, 29900, 29900, 29900, 29901, 30004, 13, 12, 12, 2267, 29892, 266, 3781, 353, 13850, 29906, 29889, 386, 12268, 29898, 3027, 29918, 21012, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29906, 29889, 4690, 1525, 7068, 29918, 2891, 14605, 891, 13850, 29906, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29918, 1177, 29963, 8443, 13, 12, 30004, 13, 12, 2457, 266, 3781, 30004, 13, 30004, 13, 1753, 3394, 29918, 29885, 5676, 3002, 29898, 386, 3781, 1125, 30004, 13, 12, 13168, 353, 13850, 29906, 29889, 29881, 309, 403, 29898, 386, 3781, 29892, 13850, 29906, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29906, 29889, 29924, 1955, 19689, 29918, 29923, 2208, 5690, 1660, 29892, 313, 29945, 29892, 29945, 4961, 30004, 13, 12, 13168, 353, 13850, 29906, 29889, 261, 356, 29898, 13168, 29892, 13850, 29906, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29906, 29889, 29924, 1955, 19689, 29918, 29923, 2208, 5690, 1660, 29892, 313, 29945, 29892, 29945, 4961, 30004, 13, 12, 2457, 11105, 30004, 13, 30004, 13, 28192, 287, 353, 5159, 30004, 13, 1454, 1243, 29918, 3027, 29918, 2084, 297, 260, 29939, 18933, 29898, 1688, 29918, 3027, 29918, 24772, 1125, 30004, 13, 12, 7050, 29918, 3027, 353, 13850, 29906, 29889, 326, 949, 29898, 1688, 29918, 3027, 29918, 2084, 29892, 13850, 29906, 29889, 7833, 16310, 29918, 29954, 4717, 21554, 5454, 1307, 8443, 13, 12, 386, 3781, 353, 16897, 29898, 7050, 29918, 3027, 8443, 13, 12, 13168, 353, 3394, 29918, 29885, 5676, 3002, 29898, 386, 3781, 8443, 13, 12, 28192, 287, 29889, 4397, 29898, 13168, 8443, 13, 30004, 13, 1753, 4078, 12191, 29898, 29874, 29892, 29890, 1125, 4706, 6756, 13, 1678, 4450, 29879, 29918, 1688, 353, 263, 29889, 27711, 29898, 29890, 29892, 26952, 29922, 29896, 8443, 13, 1678, 396, 6204, 1051, 310, 24081, 981, 29881, 1243, 11105, 29879, 30004, 13, 1678, 4450, 29879, 29918, 1688, 29918, 14340, 981, 29881, 353, 5159, 30004, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 11965, 29879, 29918, 1688, 22164, 30004, 13, 4706, 4450, 29879, 29918, 1688, 29918, 14340, 981, 29881, 29889, 4397, 29898, 21476, 29898, 9302, 29889, 29879, 802, 29872, 911, 29898, 11965, 29879, 29918, 1688, 29961, 29875, 11724, 6756, 13, 462, 462, 965, 313, 29879, 7093, 29918, 1688, 29961, 29875, 3816, 29900, 1402, 15786, 29918, 1688, 29961, 29875, 3816, 29896, 11724, 6756, 13, 462, 462, 965, 4464, 2433, 23362, 742, 19905, 29918, 3881, 29922, 5574, 876, 30004, 13, 1678, 716, 29918, 1688, 29918, 4841, 353, 5159, 30004, 13, 1678, 364, 793, 353, 5159, 30004, 13, 1678, 363, 302, 29892, 1178, 29918, 297, 26985, 29898, 1688, 29918, 4841, 1125, 30004, 13, 4706, 364, 280, 353, 1051, 29898, 22795, 29918, 517, 29918, 29878, 793, 29898, 11965, 29879, 29918, 1688, 29918, 14340, 981, 29881, 29961, 29876, 12622, 30004, 13, 4706, 364, 793, 29889, 21843, 29898, 29878, 280, 8443, 13, 4706, 716, 29918, 1688, 29918, 4841, 29889, 21843, 4197, 333, 29918, 29962, 334, 7431, 29898, 29878, 280, 876, 30004, 13, 1678, 396, 6204, 29240, 3630, 4308, 30004, 13, 1678, 1014, 353, 10518, 29889, 17271, 26471, 13, 1678, 1014, 1839, 2940, 1204, 2033, 353, 716, 29918, 1688, 29918, 4841, 30004, 13, 1678, 1014, 1839, 8566, 6797, 29925, 861, 1379, 2033, 353, 10518, 29889, 19204, 29898, 29878, 793, 467, 7302, 29898, 2892, 921, 29901, 525, 15300, 7122, 29898, 710, 29898, 29891, 29897, 363, 343, 297, 921, 876, 30004, 13, 1678, 1014, 29889, 517, 29918, 7638, 29898, 29874, 29889, 978, 29974, 4286, 7638, 742, 2380, 29922, 8824, 8443, 13, 1678, 1596, 703, 12191, 9583, 287, 1159, 30004, 13, 30004, 13, 12, 30004, 13, 2158, 14182, 29876, 4062, 29871, 29896, 29901, 12545, 29696, 1159, 30004, 13, 7620, 12191, 29898, 4299, 29979, 29892, 29990, 29918, 1688, 8443, 13, 2158, 14182, 29876, 4062, 29871, 29906, 29901, 853, 300, 29696, 1159, 30004, 13, 7620, 12191, 29898, 4299, 29999, 29892, 29990, 29918, 1688, 8443, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 2 ]
test/login.py
hongren798911/haha
0
26645
<reponame>hongren798911/haha num1 = 100 num2 = 200 num3 = 300 num4 = 400 num5 = 500 mum6 = 600 num7 = 700 num8 = 800
[ 1, 529, 276, 1112, 420, 29958, 29882, 549, 1267, 29955, 29929, 29947, 29929, 29896, 29896, 29914, 29882, 25613, 13, 1949, 29896, 353, 29871, 29896, 29900, 29900, 13, 1949, 29906, 353, 29871, 29906, 29900, 29900, 13, 1949, 29941, 353, 29871, 29941, 29900, 29900, 13, 1949, 29946, 353, 29871, 29946, 29900, 29900, 13, 13, 13, 1949, 29945, 353, 29871, 29945, 29900, 29900, 13, 13, 29885, 398, 29953, 353, 29871, 29953, 29900, 29900, 13, 13, 1949, 29955, 353, 29871, 29955, 29900, 29900, 13, 13, 1949, 29947, 353, 29871, 29947, 29900, 29900, 13, 2 ]
pytype/tests/py2/test_stdlib.py
souravbadami/pytype
1
3896
<reponame>souravbadami/pytype """Tests of selected stdlib functions.""" from pytype.tests import test_base class StdlibTests(test_base.TargetPython27FeatureTest): """Tests for files in typeshed/stdlib.""" def testPosix(self): ty = self.Infer(""" import posix x = posix.urandom(10) """) self.assertTypesMatchPytd(ty, """ posix = ... # type: module x = ... # type: str """) def testXRange(self): self.Check(""" import random random.sample(xrange(10), 5) """) def testStringTypes(self): ty = self.Infer(""" import types if isinstance("", types.StringTypes): x = 42 if isinstance(False, types.StringTypes): y = 42 if isinstance(u"", types.StringTypes): z = 42 """, deep=False) self.assertTypesMatchPytd(ty, """ types = ... # type: module x = ... # type: int z = ... # type: int """) def testDefaultDict(self): self.Check(""" import collections import itertools ids = collections.defaultdict(itertools.count(17).next) """) def testSysVersionInfoLt(self): ty = self.Infer(""" import sys if sys.version_info[0] < 3: v = 42 else: v = "hello world" """) self.assertTypesMatchPytd(ty, """ sys = ... # type: module v = ... # type: int """) def testSysVersionInfoLe(self): ty = self.Infer(""" import sys if sys.version_info[0] <= 2: v = 42 else: v = "hello world" """) self.assertTypesMatchPytd(ty, """ sys = ... # type: module v = ... # type: int """) def testSysVersionInfoEq(self): ty = self.Infer(""" import sys if sys.version_info[0] == 2: v = 42 elif sys.version_info[0] == 3: v = "hello world" else: v = None """) self.assertTypesMatchPytd(ty, """ sys = ... # type: module v = ... # type: int """) def testSysVersionInfoGe(self): ty = self.Infer(""" import sys if sys.version_info[0] >= 3: v = 42 else: v = "hello world" """) self.assertTypesMatchPytd(ty, """ sys = ... # type: module v = ... # type: str """) def testSysVersionInfoGt(self): ty = self.Infer(""" import sys if sys.version_info[0] > 2: v = 42 else: v = "hello world" """) self.assertTypesMatchPytd(ty, """ sys = ... # type: module v = ... # type: str """) def testSysVersionInfoNamedAttribute(self): ty = self.Infer(""" import sys if sys.version_info.major == 2: v = 42 else: v = "hello world" """) self.assertTypesMatchPytd(ty, """ sys: module v: int """) test_base.main(globals(), __name__ == "__main__")
[ 1, 529, 276, 1112, 420, 29958, 29879, 283, 5705, 12313, 4479, 29914, 2272, 1853, 13, 15945, 29908, 24376, 310, 4629, 3659, 1982, 3168, 1213, 15945, 13, 13, 3166, 11451, 1853, 29889, 21150, 1053, 1243, 29918, 3188, 13, 13, 13, 1990, 624, 29881, 1982, 24376, 29898, 1688, 29918, 3188, 29889, 8667, 11980, 29906, 29955, 19132, 3057, 1125, 13, 29871, 9995, 24376, 363, 2066, 297, 4072, 17143, 29914, 4172, 1982, 1213, 15945, 13, 13, 29871, 822, 1243, 9135, 861, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 926, 861, 13, 418, 921, 353, 926, 861, 29889, 332, 2685, 29898, 29896, 29900, 29897, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 926, 861, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 921, 353, 2023, 29871, 396, 1134, 29901, 851, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29990, 6069, 29898, 1311, 1125, 13, 1678, 1583, 29889, 5596, 703, 15945, 13, 418, 1053, 4036, 13, 418, 4036, 29889, 11249, 29898, 29916, 3881, 29898, 29896, 29900, 511, 29871, 29945, 29897, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 1231, 10562, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 4072, 13, 418, 565, 338, 8758, 703, 613, 4072, 29889, 1231, 10562, 1125, 13, 4706, 921, 353, 29871, 29946, 29906, 13, 418, 565, 338, 8758, 29898, 8824, 29892, 4072, 29889, 1231, 10562, 1125, 13, 4706, 343, 353, 29871, 29946, 29906, 13, 418, 565, 338, 8758, 29898, 29884, 29908, 613, 4072, 29889, 1231, 10562, 1125, 13, 4706, 503, 353, 29871, 29946, 29906, 13, 1678, 5124, 613, 6483, 29922, 8824, 29897, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 4072, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 921, 353, 2023, 29871, 396, 1134, 29901, 938, 13, 418, 503, 353, 2023, 29871, 396, 1134, 29901, 938, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 4592, 21533, 29898, 1311, 1125, 13, 1678, 1583, 29889, 5596, 703, 15945, 13, 418, 1053, 16250, 13, 418, 1053, 4256, 8504, 13, 418, 18999, 353, 16250, 29889, 4381, 8977, 29898, 1524, 8504, 29889, 2798, 29898, 29896, 29955, 467, 4622, 29897, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29903, 952, 6594, 3401, 29931, 29873, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 10876, 13, 418, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 529, 29871, 29941, 29901, 13, 4706, 325, 353, 29871, 29946, 29906, 13, 418, 1683, 29901, 13, 4706, 325, 353, 376, 12199, 3186, 29908, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 10876, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 325, 353, 2023, 29871, 396, 1134, 29901, 938, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29903, 952, 6594, 3401, 3226, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 10876, 13, 418, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 5277, 29871, 29906, 29901, 13, 4706, 325, 353, 29871, 29946, 29906, 13, 418, 1683, 29901, 13, 4706, 325, 353, 376, 12199, 3186, 29908, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 10876, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 325, 353, 2023, 29871, 396, 1134, 29901, 938, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29903, 952, 6594, 3401, 18630, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 10876, 13, 418, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 1275, 29871, 29906, 29901, 13, 4706, 325, 353, 29871, 29946, 29906, 13, 418, 25342, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 1275, 29871, 29941, 29901, 13, 4706, 325, 353, 376, 12199, 3186, 29908, 13, 418, 1683, 29901, 13, 4706, 325, 353, 6213, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 10876, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 325, 353, 2023, 29871, 396, 1134, 29901, 938, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29903, 952, 6594, 3401, 7999, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 10876, 13, 418, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 6736, 29871, 29941, 29901, 13, 4706, 325, 353, 29871, 29946, 29906, 13, 418, 1683, 29901, 13, 4706, 325, 353, 376, 12199, 3186, 29908, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 10876, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 325, 353, 2023, 29871, 396, 1134, 29901, 851, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29903, 952, 6594, 3401, 29954, 29873, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 10876, 13, 418, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 1405, 29871, 29906, 29901, 13, 4706, 325, 353, 29871, 29946, 29906, 13, 418, 1683, 29901, 13, 4706, 325, 353, 376, 12199, 3186, 29908, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 10876, 353, 2023, 29871, 396, 1134, 29901, 3883, 13, 418, 325, 353, 2023, 29871, 396, 1134, 29901, 851, 13, 1678, 5124, 1159, 13, 13, 29871, 822, 1243, 29903, 952, 6594, 3401, 22175, 6708, 29898, 1311, 1125, 13, 1678, 7911, 353, 1583, 29889, 797, 571, 703, 15945, 13, 418, 1053, 10876, 13, 418, 565, 10876, 29889, 3259, 29918, 3888, 29889, 21355, 1275, 29871, 29906, 29901, 13, 4706, 325, 353, 29871, 29946, 29906, 13, 418, 1683, 29901, 13, 4706, 325, 353, 376, 12199, 3186, 29908, 13, 1678, 5124, 1159, 13, 1678, 1583, 29889, 9294, 10562, 9652, 19737, 1594, 29898, 1017, 29892, 9995, 13, 418, 10876, 29901, 3883, 13, 418, 325, 29901, 938, 13, 1678, 5124, 1159, 13, 13, 13, 1688, 29918, 3188, 29889, 3396, 29898, 23705, 1338, 3285, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1159, 13, 2 ]
server/test.py
marcosmuto/IBMCloudAppDevelopment_Capstone
0
111519
import requests import json from datetime import datetime from requests.auth import HTTPBasicAuth review = dict() review["id"] = int(datetime.now().timestamp()) review["name"] = "<NAME>" review["dealership"] = 1 review["review"] = "Good deal" review["purchase"] = True review["purchase_date"] = "02/16/2020" review["car_make"] = "Honda" review["car_model"] = "Fit" review["car_year"] = 2020 print(review) json_payload = dict() json_payload["review"] = review url="https://43bb4759.us-south.apigw.appdomain.cloud/api/review" response = requests.post(url, json=json_payload) print(response)
[ 1, 1053, 7274, 13, 5215, 4390, 13, 3166, 12865, 1053, 12865, 13, 3166, 7274, 29889, 5150, 1053, 7331, 16616, 6444, 13, 13, 27828, 353, 9657, 580, 13, 27828, 3366, 333, 3108, 353, 938, 29898, 12673, 29889, 3707, 2141, 16394, 3101, 13, 27828, 3366, 978, 3108, 353, 9872, 5813, 11903, 13, 27828, 3366, 311, 284, 10475, 3108, 353, 29871, 29896, 13, 27828, 3366, 27828, 3108, 353, 376, 18420, 5376, 29908, 13, 27828, 3366, 29886, 27574, 3108, 353, 5852, 13, 27828, 3366, 29886, 27574, 29918, 1256, 3108, 353, 376, 29900, 29906, 29914, 29896, 29953, 29914, 29906, 29900, 29906, 29900, 29908, 13, 27828, 3366, 4287, 29918, 5675, 3108, 353, 376, 29950, 14287, 29908, 13, 27828, 3366, 4287, 29918, 4299, 3108, 353, 376, 29943, 277, 29908, 13, 27828, 3366, 4287, 29918, 6360, 3108, 353, 29871, 29906, 29900, 29906, 29900, 13, 13, 2158, 29898, 27828, 29897, 13, 13, 3126, 29918, 23813, 353, 9657, 580, 13, 3126, 29918, 23813, 3366, 27828, 3108, 353, 9076, 13, 13, 2271, 543, 991, 597, 29946, 29941, 1327, 29946, 29955, 29945, 29929, 29889, 375, 29899, 29879, 2438, 29889, 481, 335, 29893, 29889, 932, 7247, 29889, 9274, 29914, 2754, 29914, 27828, 29908, 13, 268, 13, 5327, 353, 7274, 29889, 2490, 29898, 2271, 29892, 4390, 29922, 3126, 29918, 23813, 29897, 13, 2158, 29898, 5327, 29897, 2 ]
credit-bias/src/data/make_dataset.py
tteofili/benchmark-models
0
127034
# -*- coding: utf-8 -*- import click import colorlog import logging from pathlib import Path from dotenv import find_dotenv, load_dotenv import pandas as pd import numpy as np import os handler = colorlog.StreamHandler() handler.setFormatter( colorlog.ColoredFormatter("%(log_color)s%(levelname)s:%(name)s:%(message)s") ) logger = colorlog.getLogger(__name__) def filter_columns(df_: pd.DataFrame) -> pd.DataFrame: selected_columns = [ "LoanNumber", "ListedOnUTC", "UserName", "NewCreditCustomer", "LoanDate", "MaturityDate_Original", "MaturityDate_Last", "Age", "DateOfBirth", "Gender", "Country", "AppliedAmount", "Amount", "Interest", "LoanDuration", "MonthlyPayment", "UseOfLoan", "Education", "MaritalStatus", "NrOfDependants", "EmploymentStatus", "EmploymentDurationCurrentEmployer", "WorkExperience", "OccupationArea", "HomeOwnershipType", "IncomeFromPrincipalEmployer", "IncomeFromPension", "IncomeFromFamilyAllowance", "IncomeFromSocialWelfare", "IncomeFromLeavePay", "IncomeFromChildSupport", "IncomeOther", "IncomeTotal", "ExistingLiabilities", "RefinanceLiabilities", "DebtToIncome", "FreeCash", "DefaultDate", "Status", "CreditScoreEeMini", "NoOfPreviousLoansBeforeLoan", "AmountOfPreviousLoansBeforeLoan", "PreviousRepaymentsBeforeLoan", "PreviousEarlyRepaymentsBefoleLoan", "PreviousEarlyRepaymentsCountBeforeLoan", ] return df_[selected_columns] def filter_rows(df_: pd.DataFrame) -> pd.DataFrame: return df_[(df_["Country"] == "EE") & (df_["Status"] != "Current")] def rename_columns(df_: pd.DataFrame) -> pd.DataFrame: df_ = df_.replace(-1, np.nan) zero_replacements = [ "Age", "Education", "MaritalStatus", "EmploymentStatus", "OccupationArea", "CreditScoreEeMini", ] df_[zero_replacements] = df_[zero_replacements].replace(0.0, np.nan) value_replacements = { "UseOfLoan": { 0: "Loan_consolidation", 1: "Real_estate", 2: "Home_improvement", 3: "Business", 4: "Education", 5: "Travel", 6: "Vehicle", 7: "Other", 8: "Health", 101: "Working_capital_financing", 102: "Purchase_of_machinery_equipment", 103: "Renovation_of_real_estate", 104: "Accounts_receivable_financing ", 105: "Acquisition_of_means_of_transport", 106: "Construction_finance", 107: "Acquisition_of_stocks", 108: "Acquisition_of_real_estate", 109: "Guaranteeing_obligation ", 110: "Other_business", }, "Education": { 1: "Primary", 2: "Basic", 3: "Vocational", 4: "Secondary", 5: "Higher", }, "MaritalStatus": { 1: "Married", 2: "Cohabitant", 3: "Single", 4: "Divorced", 5: "Widow", }, "EmploymentStatus": { 1: "Unemployed", 2: "Partially", 3: "Fully", 4: "Self_employed", 5: "Entrepreneur", 6: "Retiree", }, "NewCreditCustomer": {0: "Existing_credit_customer", 1: "New_credit_Customer"}, "OccupationArea": { 1: "Other", 2: "Mining", 3: "Processing", 4: "Energy", 5: "Utilities", 6: "Construction", 7: "Retail_and_wholesale", 8: "Transport_and_warehousing", 9: "Hospitality_and_catering", 10: "Info_and_telecom", 11: "Finance_and_insurance", 12: "Real_estate", 13: "Research", 14: "Administrative", 15: "Civil_service_and_military", 16: "Education", 17: "Healthcare_and_social_help", 18: "Art_and_entertainment", 19: "Agriculture_forestry_and_fishing", }, "HomeOwnershipType": { 0: "Homeless", 1: "Owner", 2: "Living_with_parents", 3: "Tenant_pre_furnished_property", 4: "Tenant_unfurnished_property", 5: "Council_house", 6: "Joint_tenant", 7: "Joint_ownership", 8: "Mortgage", 9: "Owner_with_encumbrance", 10: "Other", }, "NrOfDependants": {"10Plus": 11}, "Gender": {0: "Male", 1: "Female", 2: "Unknown"}, } df_ = df_.replace(value_replacements) return df_ def add_new_columns(df_: pd.DataFrame) -> pd.DataFrame: df_["Defaulted"] = df_["DefaultDate"].apply(lambda x: 0 if pd.isnull(x) else 1) df_["PaidLoan"] = df_["Defaulted"].replace({0: 1, 1: 0}) df_["LoanStatus"] = df_["PaidLoan"].apply( lambda x: "Paid back" if x == 1 else "Defaulted" ) df_["AgeGroup"] = df_["Age"].apply(lambda x: "Under 40" if x < 40 else "Over 40") return df_ def reformat_columns(df_: pd.DataFrame) -> pd.DataFrame: df_["ListedOnUTC"] = pd.to_datetime(df_["ListedOnUTC"]) df_["LoanDate"] = pd.to_datetime(df_["LoanDate"]) df_["MaturityDate_Original"] = pd.to_datetime(df_["MaturityDate_Original"]) df_["MaturityDate_Last"] = pd.to_datetime(df_["MaturityDate_Last"]) df_["DateOfBirth"] = pd.to_datetime(df_["DateOfBirth"]) df_["DefaultDate"] = pd.to_datetime(df_["DefaultDate"]) df_["LoanDuration"] = pd.to_numeric(df_["LoanDuration"]) df_["NrOfDependants"] = pd.to_numeric(df_["NrOfDependants"]) df_["CreditScoreEeMini"] = df_["CreditScoreEeMini"].astype(str) df_["Defaulted"] = df_["Defaulted"].astype(bool) df_["PaidLoan"] = df_["PaidLoan"].astype(bool) return df_ @click.command() @click.argument("input_filepath", type=click.Path(exists=True)) @click.argument("output_filepath", type=click.Path()) def main(input_filepath, output_filepath): """Runs data processing scripts to turn raw data from (../raw) into cleaned data ready to be analyzed (saved in ../processed). """ logger.info("making interim data set from raw data") # load raw dataset _df = pd.read_csv(os.path.join(input_filepath, "LoanData.zip")) # Filter not used columns _df = filter_columns(_df) # Filter not used rows _df = filter_rows(_df) # Rename columns _df = rename_columns(_df) # Add new columns _df = add_new_columns(_df) # Reformat columns _df = reformat_columns(_df) _df.to_csv(os.path.join(output_filepath, "data.csv"), index=False) if __name__ == "__main__": log_fmt = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" logging.basicConfig(level=logging.INFO, format=log_fmt) # not used in this stub but often useful for finding various files project_dir = Path(__file__).resolve().parents[2] # find .env automagically by walking up directories until it's found, then # load up the .env entries as environment variables load_dotenv(find_dotenv()) main()
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 2828, 13, 5215, 2927, 1188, 13, 5215, 12183, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 8329, 6272, 1053, 1284, 29918, 6333, 6272, 29892, 2254, 29918, 6333, 6272, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 13, 13789, 353, 2927, 1188, 29889, 3835, 4598, 580, 13, 13789, 29889, 842, 18522, 29898, 13, 1678, 2927, 1188, 29889, 3306, 287, 18522, 11702, 29898, 1188, 29918, 2780, 29897, 29879, 29995, 29898, 5563, 978, 29897, 29879, 16664, 29898, 978, 29897, 29879, 16664, 29898, 4906, 29897, 29879, 1159, 13, 29897, 13, 21707, 353, 2927, 1188, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1753, 4175, 29918, 13099, 29898, 2176, 29918, 29901, 10518, 29889, 17271, 29897, 1599, 10518, 29889, 17271, 29901, 13, 1678, 4629, 29918, 13099, 353, 518, 13, 4706, 376, 3410, 273, 4557, 613, 13, 4706, 376, 1293, 287, 2951, 26913, 613, 13, 4706, 376, 28129, 613, 13, 4706, 376, 4373, 15507, 277, 15122, 613, 13, 4706, 376, 3410, 273, 2539, 613, 13, 4706, 376, 29924, 1337, 537, 2539, 29918, 26036, 613, 13, 4706, 376, 29924, 1337, 537, 2539, 29918, 8897, 613, 13, 4706, 376, 22406, 613, 13, 4706, 376, 2539, 2776, 29933, 7515, 613, 13, 4706, 376, 29954, 1581, 613, 13, 4706, 376, 20779, 613, 13, 4706, 376, 2052, 2957, 18087, 613, 13, 4706, 376, 18087, 613, 13, 4706, 376, 4074, 342, 613, 13, 4706, 376, 3410, 273, 18984, 613, 13, 4706, 376, 13953, 368, 15467, 358, 613, 13, 4706, 376, 11403, 2776, 3410, 273, 613, 13, 4706, 376, 29923, 29392, 613, 13, 4706, 376, 7083, 2410, 5709, 613, 13, 4706, 376, 29940, 29878, 2776, 8498, 355, 1934, 613, 13, 4706, 376, 10495, 22812, 5709, 613, 13, 4706, 376, 10495, 22812, 18984, 7583, 10495, 2376, 261, 613, 13, 4706, 376, 5531, 1252, 546, 5597, 613, 13, 4706, 376, 22034, 786, 362, 13799, 613, 13, 4706, 376, 11184, 29949, 1233, 10475, 1542, 613, 13, 4706, 376, 797, 2763, 4591, 4040, 26706, 10495, 2376, 261, 613, 13, 4706, 376, 797, 2763, 4591, 29925, 2673, 613, 13, 4706, 376, 797, 2763, 4591, 27104, 15930, 749, 613, 13, 4706, 376, 797, 2763, 4591, 6295, 1455, 29956, 761, 598, 613, 13, 4706, 376, 797, 2763, 4591, 3226, 1351, 15467, 613, 13, 4706, 376, 797, 2763, 4591, 5938, 14039, 613, 13, 4706, 376, 797, 2763, 16107, 613, 13, 4706, 376, 797, 2763, 11536, 613, 13, 4706, 376, 1252, 15423, 23410, 11614, 613, 13, 4706, 376, 1123, 4951, 749, 23410, 11614, 613, 13, 4706, 376, 10251, 29873, 1762, 797, 2763, 613, 13, 4706, 376, 20475, 29907, 1161, 613, 13, 4706, 376, 4592, 2539, 613, 13, 4706, 376, 5709, 613, 13, 4706, 376, 15507, 277, 20097, 29923, 29872, 29924, 2172, 613, 13, 4706, 376, 3782, 2776, 6572, 2366, 3410, 550, 18743, 3410, 273, 613, 13, 4706, 376, 18087, 2776, 6572, 2366, 3410, 550, 18743, 3410, 273, 613, 13, 4706, 376, 6572, 2366, 5612, 388, 1860, 18743, 3410, 273, 613, 13, 4706, 376, 6572, 2366, 29923, 279, 368, 5612, 388, 1860, 3629, 1181, 280, 3410, 273, 613, 13, 4706, 376, 6572, 2366, 29923, 279, 368, 5612, 388, 1860, 3981, 18743, 3410, 273, 613, 13, 1678, 4514, 13, 13, 1678, 736, 4489, 29918, 29961, 8391, 29918, 13099, 29962, 13, 13, 13, 1753, 4175, 29918, 5727, 29898, 2176, 29918, 29901, 10518, 29889, 17271, 29897, 1599, 10518, 29889, 17271, 29901, 13, 1678, 736, 4489, 29918, 15625, 2176, 29918, 3366, 20779, 3108, 1275, 376, 17896, 1159, 669, 313, 2176, 29918, 3366, 5709, 3108, 2804, 376, 7583, 13531, 13, 13, 13, 1753, 19508, 29918, 13099, 29898, 2176, 29918, 29901, 10518, 29889, 17271, 29897, 1599, 10518, 29889, 17271, 29901, 13, 1678, 4489, 29918, 353, 4489, 5396, 6506, 6278, 29896, 29892, 7442, 29889, 13707, 29897, 13, 13, 1678, 5225, 29918, 3445, 4620, 4110, 353, 518, 13, 4706, 376, 22406, 613, 13, 4706, 376, 29923, 29392, 613, 13, 4706, 376, 7083, 2410, 5709, 613, 13, 4706, 376, 10495, 22812, 5709, 613, 13, 4706, 376, 22034, 786, 362, 13799, 613, 13, 4706, 376, 15507, 277, 20097, 29923, 29872, 29924, 2172, 613, 13, 1678, 4514, 13, 1678, 4489, 29918, 29961, 9171, 29918, 3445, 4620, 4110, 29962, 353, 4489, 29918, 29961, 9171, 29918, 3445, 4620, 4110, 1822, 6506, 29898, 29900, 29889, 29900, 29892, 7442, 29889, 13707, 29897, 13, 13, 1678, 995, 29918, 3445, 4620, 4110, 353, 426, 13, 4706, 376, 11403, 2776, 3410, 273, 1115, 426, 13, 632, 29900, 29901, 376, 3410, 273, 29918, 535, 2929, 333, 362, 613, 13, 632, 29896, 29901, 376, 21713, 29918, 342, 403, 613, 13, 632, 29906, 29901, 376, 11184, 29918, 326, 16123, 882, 613, 13, 632, 29941, 29901, 376, 16890, 3335, 613, 13, 632, 29946, 29901, 376, 29923, 29392, 613, 13, 632, 29945, 29901, 376, 5323, 955, 613, 13, 632, 29953, 29901, 376, 29963, 14797, 2512, 613, 13, 632, 29955, 29901, 376, 16107, 613, 13, 632, 29947, 29901, 376, 3868, 4298, 613, 13, 632, 29896, 29900, 29896, 29901, 376, 5531, 292, 29918, 5030, 2410, 29918, 4951, 19985, 613, 13, 632, 29896, 29900, 29906, 29901, 376, 29925, 27574, 29918, 974, 29918, 29885, 496, 262, 708, 29918, 1686, 666, 358, 613, 13, 632, 29896, 29900, 29941, 29901, 376, 29934, 264, 586, 362, 29918, 974, 29918, 6370, 29918, 342, 403, 613, 13, 632, 29896, 29900, 29946, 29901, 376, 10601, 29879, 29918, 13556, 440, 519, 29918, 4951, 19985, 9162, 13, 632, 29896, 29900, 29945, 29901, 376, 10644, 23493, 29918, 974, 29918, 1004, 550, 29918, 974, 29918, 27882, 613, 13, 632, 29896, 29900, 29953, 29901, 376, 12075, 4080, 29918, 4951, 749, 613, 13, 632, 29896, 29900, 29955, 29901, 376, 10644, 23493, 29918, 974, 29918, 17712, 29879, 613, 13, 632, 29896, 29900, 29947, 29901, 376, 10644, 23493, 29918, 974, 29918, 6370, 29918, 342, 403, 613, 13, 632, 29896, 29900, 29929, 29901, 376, 9485, 9519, 22430, 29918, 711, 3473, 362, 9162, 13, 632, 29896, 29896, 29900, 29901, 376, 16107, 29918, 8262, 3335, 613, 13, 4706, 2981, 13, 4706, 376, 29923, 29392, 1115, 426, 13, 632, 29896, 29901, 376, 26666, 613, 13, 632, 29906, 29901, 376, 16616, 613, 13, 632, 29941, 29901, 376, 29963, 542, 1288, 613, 13, 632, 29946, 29901, 376, 11863, 653, 613, 13, 632, 29945, 29901, 376, 16382, 261, 613, 13, 4706, 2981, 13, 4706, 376, 7083, 2410, 5709, 1115, 426, 13, 632, 29896, 29901, 376, 7083, 1255, 613, 13, 632, 29906, 29901, 376, 29907, 1148, 370, 277, 424, 613, 13, 632, 29941, 29901, 376, 15771, 613, 13, 632, 29946, 29901, 376, 12596, 272, 1133, 613, 13, 632, 29945, 29901, 376, 29956, 333, 340, 613, 13, 4706, 2981, 13, 4706, 376, 10495, 22812, 5709, 1115, 426, 13, 632, 29896, 29901, 376, 2525, 3451, 2376, 287, 613, 13, 632, 29906, 29901, 376, 7439, 616, 368, 613, 13, 632, 29941, 29901, 376, 29943, 352, 368, 613, 13, 632, 29946, 29901, 376, 24313, 29918, 3451, 2376, 287, 613, 13, 632, 29945, 29901, 376, 5292, 276, 558, 1600, 332, 613, 13, 632, 29953, 29901, 376, 8015, 533, 29872, 613, 13, 4706, 2981, 13, 4706, 376, 4373, 15507, 277, 15122, 1115, 426, 29900, 29901, 376, 1252, 15423, 29918, 11944, 277, 29918, 15539, 613, 29871, 29896, 29901, 376, 4373, 29918, 11944, 277, 29918, 15122, 10758, 13, 4706, 376, 22034, 786, 362, 13799, 1115, 426, 13, 632, 29896, 29901, 376, 16107, 613, 13, 632, 29906, 29901, 376, 29924, 2827, 613, 13, 632, 29941, 29901, 376, 7032, 292, 613, 13, 632, 29946, 29901, 376, 29923, 1089, 1927, 613, 13, 632, 29945, 29901, 376, 7270, 1907, 613, 13, 632, 29953, 29901, 376, 12075, 4080, 613, 13, 632, 29955, 29901, 376, 8015, 737, 29918, 392, 29918, 1332, 6544, 744, 613, 13, 632, 29947, 29901, 376, 27395, 29918, 392, 29918, 2519, 29882, 681, 292, 613, 13, 632, 29929, 29901, 376, 29950, 8189, 537, 29918, 392, 29918, 29883, 1008, 292, 613, 13, 632, 29896, 29900, 29901, 376, 3401, 29918, 392, 29918, 15494, 510, 613, 13, 632, 29896, 29896, 29901, 376, 12881, 749, 29918, 392, 29918, 1144, 18541, 613, 13, 632, 29896, 29906, 29901, 376, 21713, 29918, 342, 403, 613, 13, 632, 29896, 29941, 29901, 376, 1666, 2842, 613, 13, 632, 29896, 29946, 29901, 376, 12754, 2132, 1230, 613, 13, 632, 29896, 29945, 29901, 376, 29907, 5341, 29918, 5509, 29918, 392, 29918, 23853, 277, 653, 613, 13, 632, 29896, 29953, 29901, 376, 29923, 29392, 613, 13, 632, 29896, 29955, 29901, 376, 3868, 4298, 18020, 29918, 392, 29918, 24911, 29918, 8477, 613, 13, 632, 29896, 29947, 29901, 376, 9986, 29918, 392, 29918, 296, 13946, 358, 613, 13, 632, 29896, 29929, 29901, 376, 29909, 629, 3953, 545, 29918, 1454, 342, 719, 29918, 392, 29918, 29888, 14424, 613, 13, 4706, 2981, 13, 4706, 376, 11184, 29949, 1233, 10475, 1542, 1115, 426, 13, 632, 29900, 29901, 376, 24259, 6393, 613, 13, 632, 29896, 29901, 376, 28213, 613, 13, 632, 29906, 29901, 376, 29931, 4357, 29918, 2541, 29918, 862, 1237, 613, 13, 632, 29941, 29901, 376, 29911, 27153, 29918, 1457, 29918, 29888, 595, 3276, 29918, 6799, 613, 13, 632, 29946, 29901, 376, 29911, 27153, 29918, 348, 29888, 595, 3276, 29918, 6799, 613, 13, 632, 29945, 29901, 376, 29907, 1309, 5553, 29918, 8697, 613, 13, 632, 29953, 29901, 376, 29967, 2461, 29918, 841, 424, 613, 13, 632, 29955, 29901, 376, 29967, 2461, 29918, 776, 10475, 613, 13, 632, 29947, 29901, 376, 29924, 441, 29887, 482, 613, 13, 632, 29929, 29901, 376, 28213, 29918, 2541, 29918, 3977, 3774, 11115, 613, 13, 632, 29896, 29900, 29901, 376, 16107, 613, 13, 4706, 2981, 13, 4706, 376, 29940, 29878, 2776, 8498, 355, 1934, 1115, 8853, 29896, 29900, 29575, 1115, 29871, 29896, 29896, 1118, 13, 4706, 376, 29954, 1581, 1115, 426, 29900, 29901, 376, 29924, 744, 613, 29871, 29896, 29901, 376, 29943, 331, 744, 613, 29871, 29906, 29901, 376, 14148, 10758, 13, 1678, 500, 13, 1678, 4489, 29918, 353, 4489, 5396, 6506, 29898, 1767, 29918, 3445, 4620, 4110, 29897, 13, 13, 1678, 736, 4489, 29918, 13, 13, 13, 1753, 788, 29918, 1482, 29918, 13099, 29898, 2176, 29918, 29901, 10518, 29889, 17271, 29897, 1599, 10518, 29889, 17271, 29901, 13, 1678, 4489, 29918, 3366, 4592, 287, 3108, 353, 4489, 29918, 3366, 4592, 2539, 16862, 7302, 29898, 2892, 921, 29901, 29871, 29900, 565, 10518, 29889, 275, 4304, 29898, 29916, 29897, 1683, 29871, 29896, 29897, 13, 1678, 4489, 29918, 3366, 11868, 333, 3410, 273, 3108, 353, 4489, 29918, 3366, 4592, 287, 16862, 6506, 3319, 29900, 29901, 29871, 29896, 29892, 29871, 29896, 29901, 29871, 29900, 1800, 13, 1678, 4489, 29918, 3366, 3410, 273, 5709, 3108, 353, 4489, 29918, 3366, 11868, 333, 3410, 273, 16862, 7302, 29898, 13, 4706, 14013, 921, 29901, 376, 11868, 333, 1250, 29908, 565, 921, 1275, 29871, 29896, 1683, 376, 4592, 287, 29908, 13, 1678, 1723, 13, 1678, 4489, 29918, 3366, 22406, 4782, 3108, 353, 4489, 29918, 3366, 22406, 16862, 7302, 29898, 2892, 921, 29901, 376, 29177, 29871, 29946, 29900, 29908, 565, 921, 529, 29871, 29946, 29900, 1683, 376, 3563, 29871, 29946, 29900, 1159, 13, 13, 1678, 736, 4489, 29918, 13, 13, 13, 1753, 337, 4830, 29918, 13099, 29898, 2176, 29918, 29901, 10518, 29889, 17271, 29897, 1599, 10518, 29889, 17271, 29901, 13, 1678, 4489, 29918, 3366, 1293, 287, 2951, 26913, 3108, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29918, 3366, 1293, 287, 2951, 26913, 20068, 13, 1678, 4489, 29918, 3366, 3410, 273, 2539, 3108, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29918, 3366, 3410, 273, 2539, 20068, 13, 1678, 4489, 29918, 3366, 29924, 1337, 537, 2539, 29918, 26036, 3108, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29918, 3366, 29924, 1337, 537, 2539, 29918, 26036, 20068, 13, 1678, 4489, 29918, 3366, 29924, 1337, 537, 2539, 29918, 8897, 3108, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29918, 3366, 29924, 1337, 537, 2539, 29918, 8897, 20068, 13, 1678, 4489, 29918, 3366, 2539, 2776, 29933, 7515, 3108, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29918, 3366, 2539, 2776, 29933, 7515, 20068, 13, 1678, 4489, 29918, 3366, 4592, 2539, 3108, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29918, 3366, 4592, 2539, 20068, 13, 13, 1678, 4489, 29918, 3366, 3410, 273, 18984, 3108, 353, 10518, 29889, 517, 29918, 21574, 29898, 2176, 29918, 3366, 3410, 273, 18984, 20068, 13, 1678, 4489, 29918, 3366, 29940, 29878, 2776, 8498, 355, 1934, 3108, 353, 10518, 29889, 517, 29918, 21574, 29898, 2176, 29918, 3366, 29940, 29878, 2776, 8498, 355, 1934, 20068, 13, 13, 1678, 4489, 29918, 3366, 15507, 277, 20097, 29923, 29872, 29924, 2172, 3108, 353, 4489, 29918, 3366, 15507, 277, 20097, 29923, 29872, 29924, 2172, 16862, 579, 668, 29898, 710, 29897, 13, 1678, 4489, 29918, 3366, 4592, 287, 3108, 353, 4489, 29918, 3366, 4592, 287, 16862, 579, 668, 29898, 11227, 29897, 13, 1678, 4489, 29918, 3366, 11868, 333, 3410, 273, 3108, 353, 4489, 29918, 3366, 11868, 333, 3410, 273, 16862, 579, 668, 29898, 11227, 29897, 13, 13, 1678, 736, 4489, 29918, 13, 13, 13, 29992, 3808, 29889, 6519, 580, 13, 29992, 3808, 29889, 23516, 703, 2080, 29918, 1445, 2084, 613, 1134, 29922, 3808, 29889, 2605, 29898, 9933, 29922, 5574, 876, 13, 29992, 3808, 29889, 23516, 703, 4905, 29918, 1445, 2084, 613, 1134, 29922, 3808, 29889, 2605, 3101, 13, 1753, 1667, 29898, 2080, 29918, 1445, 2084, 29892, 1962, 29918, 1445, 2084, 1125, 13, 1678, 9995, 6558, 29879, 848, 9068, 12078, 304, 2507, 10650, 848, 515, 313, 6995, 1610, 29897, 964, 13, 1678, 5941, 287, 848, 7960, 304, 367, 29537, 287, 313, 17314, 297, 29772, 5014, 287, 467, 13, 1678, 9995, 13, 1678, 17927, 29889, 3888, 703, 28990, 1006, 326, 848, 731, 515, 10650, 848, 1159, 13, 13, 1678, 396, 2254, 10650, 8783, 13, 1678, 903, 2176, 353, 10518, 29889, 949, 29918, 7638, 29898, 359, 29889, 2084, 29889, 7122, 29898, 2080, 29918, 1445, 2084, 29892, 376, 3410, 273, 1469, 29889, 7554, 5783, 13, 1678, 396, 19916, 451, 1304, 4341, 13, 1678, 903, 2176, 353, 4175, 29918, 13099, 7373, 2176, 29897, 13, 1678, 396, 19916, 451, 1304, 4206, 13, 1678, 903, 2176, 353, 4175, 29918, 5727, 7373, 2176, 29897, 13, 1678, 396, 390, 3871, 4341, 13, 1678, 903, 2176, 353, 19508, 29918, 13099, 7373, 2176, 29897, 13, 1678, 396, 3462, 716, 4341, 13, 1678, 903, 2176, 353, 788, 29918, 1482, 29918, 13099, 7373, 2176, 29897, 13, 1678, 396, 830, 4830, 4341, 13, 1678, 903, 2176, 353, 337, 4830, 29918, 13099, 7373, 2176, 29897, 13, 13, 1678, 903, 2176, 29889, 517, 29918, 7638, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 1445, 2084, 29892, 376, 1272, 29889, 7638, 4968, 2380, 29922, 8824, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1480, 29918, 23479, 353, 11860, 29898, 294, 312, 603, 29897, 29879, 448, 1273, 29898, 978, 29897, 29879, 448, 1273, 29898, 5563, 978, 29897, 29879, 448, 1273, 29898, 4906, 29897, 29879, 29908, 13, 1678, 12183, 29889, 16121, 3991, 29898, 5563, 29922, 21027, 29889, 11690, 29892, 3402, 29922, 1188, 29918, 23479, 29897, 13, 13, 1678, 396, 451, 1304, 297, 445, 19281, 541, 4049, 5407, 363, 9138, 5164, 2066, 13, 1678, 2060, 29918, 3972, 353, 10802, 22168, 1445, 1649, 467, 17863, 2141, 862, 1237, 29961, 29906, 29962, 13, 13, 1678, 396, 1284, 869, 6272, 3345, 351, 1711, 491, 22049, 701, 17525, 2745, 372, 29915, 29879, 1476, 29892, 769, 13, 1678, 396, 2254, 701, 278, 869, 6272, 9976, 408, 5177, 3651, 13, 1678, 2254, 29918, 6333, 6272, 29898, 2886, 29918, 6333, 6272, 3101, 13, 13, 1678, 1667, 580, 13, 2 ]
Code/VB/demo.py
CaptainE/Non-negative-latent-space-models
0
130024
<gh_stars>0 import numpy as np from scipy.stats import gamma,poisson from gnmf import nmf_vb import matplotlib.pyplot as plt if __name__ == '__main__': W=40 K=30 I=3 a_tm=np.ones((W,I))*10 b_tm=np.ones((W,I)) a_ve=np.ones((I,K))*0.1 b_ve=np.ones((I,K)) T = gamma.rvs(a_tm,b_tm) V = gamma.rvs(a_ve,b_ve) X = poisson.rvs(T@V) X = X + 1000*np.random.randn(*X.shape) (tie_a_tm, tie_b_tm, tie_a_ve, tie_b_ve)=('free','tie_all','free','tie_all') init_mat_factor = nmf_vb(a_tm, b_tm, a_ve, b_ve,tie_a_tm, tie_b_tm, tie_a_ve, tie_b_ve) g=init_mat_factor.VB_parm_calc(X,epoch=1000,update=10,print_period=500) (g_E_T,g_E_logT,g_E_V,g_E_logV,g_Bound,g_a_ve,g_b_ve,g_a_tm,g_b_tm)=g X_reconstruct=g_E_T@g_E_V #upper left plot is the reconstructed matrix plt.subplot(211) plt.imshow(X_reconstruct) #lower left plot is the original matrix plt.subplot(212) plt.imshow(X) #the right subplot is a colorbar plt.subplots_adjust(bottom=0.1,right=0.8,top=0.9) cax=plt.axes([0.6,0.1,0.075,0.8]) plt.colorbar(cax=cax) plt.show()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 408, 7442, 30004, 13, 3166, 4560, 2272, 29889, 16202, 1053, 330, 2735, 29892, 1129, 17387, 30004, 13, 3166, 330, 22882, 29888, 1053, 302, 29885, 29888, 29918, 24666, 30004, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 30004, 13, 30004, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 30004, 13, 12, 29956, 29922, 29946, 29900, 30004, 13, 12, 29968, 29922, 29941, 29900, 30004, 13, 12, 29902, 29922, 29941, 30004, 13, 12, 29874, 29918, 18276, 29922, 9302, 29889, 2873, 3552, 29956, 29892, 29902, 876, 29930, 29896, 29900, 30004, 13, 12, 29890, 29918, 18276, 29922, 9302, 29889, 2873, 3552, 29956, 29892, 29902, 876, 30004, 13, 12, 29874, 29918, 345, 29922, 9302, 29889, 2873, 3552, 29902, 29892, 29968, 876, 29930, 29900, 29889, 29896, 30004, 13, 12, 29890, 29918, 345, 29922, 9302, 29889, 2873, 3552, 29902, 29892, 29968, 876, 30004, 13, 12, 29911, 353, 330, 2735, 29889, 29878, 4270, 29898, 29874, 29918, 18276, 29892, 29890, 29918, 18276, 8443, 13, 12, 29963, 353, 330, 2735, 29889, 29878, 4270, 29898, 29874, 29918, 345, 29892, 29890, 29918, 345, 8443, 13, 12, 29990, 353, 772, 17387, 29889, 29878, 4270, 29898, 29911, 29992, 29963, 8443, 13, 12, 29990, 353, 1060, 718, 29871, 29896, 29900, 29900, 29900, 29930, 9302, 29889, 8172, 29889, 9502, 29876, 10456, 29990, 29889, 12181, 8443, 13, 12, 29898, 29873, 347, 29918, 29874, 29918, 18276, 29892, 22134, 29918, 29890, 29918, 18276, 29892, 22134, 29918, 29874, 29918, 345, 29892, 22134, 29918, 29890, 29918, 345, 3892, 877, 9021, 3788, 29873, 347, 29918, 497, 3788, 9021, 3788, 29873, 347, 29918, 497, 1495, 30004, 13, 12, 2344, 29918, 2922, 29918, 19790, 353, 302, 29885, 29888, 29918, 24666, 29898, 29874, 29918, 18276, 29892, 289, 29918, 18276, 29892, 263, 29918, 345, 29892, 289, 29918, 345, 29892, 29873, 347, 29918, 29874, 29918, 18276, 29892, 22134, 29918, 29890, 29918, 18276, 29892, 22134, 29918, 29874, 29918, 345, 29892, 22134, 29918, 29890, 29918, 345, 8443, 13, 12, 29887, 29922, 2344, 29918, 2922, 29918, 19790, 29889, 24281, 29918, 862, 29885, 29918, 28667, 29898, 29990, 29892, 1022, 2878, 29922, 29896, 29900, 29900, 29900, 29892, 5504, 29922, 29896, 29900, 29892, 2158, 29918, 19145, 29922, 29945, 29900, 29900, 8443, 13, 12, 29898, 29887, 29918, 29923, 29918, 29911, 29892, 29887, 29918, 29923, 29918, 1188, 29911, 29892, 29887, 29918, 29923, 29918, 29963, 29892, 29887, 29918, 29923, 29918, 1188, 29963, 29892, 29887, 29918, 17109, 29892, 29887, 29918, 29874, 29918, 345, 29892, 29887, 29918, 29890, 29918, 345, 29892, 29887, 29918, 29874, 29918, 18276, 29892, 29887, 29918, 29890, 29918, 18276, 3892, 29887, 30004, 13, 12, 29990, 29918, 276, 11433, 29922, 29887, 29918, 29923, 29918, 29911, 29992, 29887, 29918, 29923, 29918, 29963, 30004, 13, 12, 29937, 21064, 2175, 6492, 338, 278, 337, 11433, 287, 4636, 30004, 13, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29896, 29896, 8443, 13, 12, 572, 29873, 29889, 326, 4294, 29898, 29990, 29918, 276, 11433, 8443, 13, 12, 29937, 13609, 2175, 6492, 338, 278, 2441, 4636, 30004, 13, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29896, 29906, 8443, 13, 12, 572, 29873, 29889, 326, 4294, 29898, 29990, 8443, 13, 12, 29937, 1552, 1492, 1014, 5317, 338, 263, 2927, 1646, 30004, 13, 12, 572, 29873, 29889, 1491, 26762, 29918, 328, 5143, 29898, 8968, 29922, 29900, 29889, 29896, 29892, 1266, 29922, 29900, 29889, 29947, 29892, 3332, 29922, 29900, 29889, 29929, 8443, 13, 12, 1113, 29916, 29922, 572, 29873, 29889, 1165, 267, 4197, 29900, 29889, 29953, 29892, 29900, 29889, 29896, 29892, 29900, 29889, 29900, 29955, 29945, 29892, 29900, 29889, 29947, 2314, 30004, 13, 12, 572, 29873, 29889, 2780, 1646, 29898, 1113, 29916, 29922, 1113, 29916, 8443, 13, 12, 572, 29873, 29889, 4294, 580, 2 ]
second-sem/genPlotsBetweenCoverageAndFPKM.py
piyush-kansal/masters-project
1
159694
#!/usr/bin/env python # Main script for generating plots between coverage and FPKM values # <NAME> import sys import os import subprocess import csv import rpy2.robjects as robjects import pickle # Validate number of i/p arguments def validateNumberOfArguments(): if len(sys.argv) != 5: print "Invalid number of arguments" print "Usage:" print "genPlotsBetweenCoverageAndFPKM.py <number-of-experiments> <cufflinks-op-files-path-on-hdfs> <expression-matrix-path> <ref-ptt-file>" sys.exit(1) # Accepts user i/p, validate them and initialize required params def acceptUserInput(): validateNumberOfArguments() FNULL = open(os.devnull, 'w') # Declare params global global EXP_CONT, CUFF_PATH, EXPM_PATH, REF_FILE, PLOT_FILE global coverageVals, fpkmVals, ranges # Initialize i/p arguments EXP_CONT = int(sys.argv[1]) CUFF_PATH = sys.argv[2] cmd = 'hadoop dfs -ls %s' % (CUFF_PATH) try: subprocess.check_call(cmd.split(), stdout=FNULL, stderr=subprocess.STDOUT) except subprocess.CalledProcessError: print 'Directory %s does not exits on HDFS.' % (CUFF_PATH) sys.exit(1) FNULL.close() EXPM_PATH = sys.argv[3] if not os.path.isfile(EXPM_PATH): print 'File %s does not exits on file system.' % (EXPM_PATH) sys.exit(1) REF_FILE = sys.argv[4] if not os.path.isfile(REF_FILE): print 'File %s does not exits on file system.' % (REF_FILE) sys.exit(1) PLOT_FILE = 'XY.plot' def copyFilesInCurrentDir(): i = 1 while i <= EXP_CONT: cmd = 'hadoop dfs -copyToLocal %s/%d/genes.fpkm_tracking genes.fpkm_tracking.%d' % (CUFF_PATH, i, i) r = os.system(cmd) if r: print 'Some error occured while copying Cufflinks output on local file system for i=%d. Exiting ...' % (i) sys.exit(1) i += 1 cmd = 'cp %s .' % (EXPM_PATH) os.system(cmd) cmd = 'cp %s .' % (REF_FILE) os.system(cmd) def rangeExists(s, e): for index, r in enumerate(ranges): if s >= long(r[0]) and s < long(r[1]): return index if s < long(r[0]): return None return None def genValues(): coverageFile = open(EXPM_PATH, 'r') records = csv.reader(coverageFile, delimiter=' ') i = 0 coverageVals = [] while i < EXP_CONT: coverageVals.append(','.join([r[i] for r in records])) coverageFile.seek(0) i += 1 coverageFile.close() refFile = open(REF_FILE, 'r') records = csv.reader(refFile, delimiter='\t') ranges = [tuple(r[0].split('..')) for r in records] refFile.close() i = 1 fpkmVals = [] while i <= EXP_CONT: fpkmFileName = 'genes.fpkm_tracking.%d' % (i) fpkmFile = open(fpkmFileName, 'r') records = csv.reader(fpkmFile, delimiter='\t') j = 1 row = ['0']*len(ranges) for r in records: if j == 1: j = 2 continue else: s,e = r[6].split(':')[1].split('-') ret = rangeExists(long(s), e) if ret: row[ret] = r[9] fpkmVals.append(','.join(row)) fpkmFile.close() i += 1 def writeValsToFile(): oFile = open(PLOT_FILE, 'wb') pickle.dump(coverageVals, oFile) pickle.dump(fpkmVals, oFile) oFile.close() def genPlots(): iFile = open(PLOT_FILE, 'rb') coverageVals = pickle.load(iFile) fpkmVals = pickle.load(iFile) iFile.close() r = robjects.r i = 0 while i < EXP_CONT: x = robjects.IntVector([long(item) for item in coverageVals[i].split(',')]) y = robjects.FloatVector([float(item) for item in fpkmVals[i].split(',')]) r.jpeg('t%d.jpg' % (i+1)) r.plot(x, y, xlab="Coverage", ylab="FPKM") i += 1 def cleanup(): cmd = 'rm -f genes.fpkm_tracking*' os.system(cmd) # Main program if __name__ == "__main__": acceptUserInput() copyFilesInCurrentDir() genValues() writeValsToFile() cleanup() genPlots() print "Program finished successfully" sys.exit(0)
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 29937, 4241, 2471, 363, 14655, 24580, 1546, 23746, 322, 383, 21738, 29924, 1819, 13, 29937, 529, 5813, 29958, 13, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 5215, 11799, 13, 5215, 364, 2272, 29906, 29889, 307, 1675, 29879, 408, 696, 1675, 29879, 13, 5215, 5839, 280, 13, 13, 13, 29937, 15758, 403, 1353, 310, 474, 29914, 29886, 6273, 13, 1753, 12725, 4557, 2776, 26915, 7295, 13, 1678, 565, 7431, 29898, 9675, 29889, 19218, 29897, 2804, 29871, 29945, 29901, 13, 4706, 1596, 376, 13919, 1353, 310, 6273, 29908, 13, 4706, 1596, 376, 27573, 6160, 13, 4706, 1596, 376, 1885, 3247, 1862, 29933, 300, 1452, 29907, 957, 482, 2855, 29943, 21738, 29924, 29889, 2272, 529, 4537, 29899, 974, 29899, 735, 546, 7862, 29958, 529, 29883, 3096, 4965, 29899, 459, 29899, 5325, 29899, 2084, 29899, 265, 29899, 29882, 29069, 29958, 529, 17471, 29899, 5344, 29899, 2084, 29958, 529, 999, 29899, 415, 29873, 29899, 1445, 11903, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 13, 29937, 29848, 29879, 1404, 474, 29914, 29886, 29892, 12725, 963, 322, 11905, 3734, 8636, 13, 1753, 3544, 2659, 4290, 7295, 13, 1678, 12725, 4557, 2776, 26915, 580, 13, 1678, 383, 10074, 353, 1722, 29898, 359, 29889, 3359, 4304, 29892, 525, 29893, 1495, 13, 13, 1678, 396, 3826, 8663, 8636, 5534, 13, 1678, 5534, 8528, 29925, 29918, 22412, 29892, 315, 29965, 4198, 29918, 10145, 29892, 8528, 13427, 29918, 10145, 29892, 5195, 29943, 29918, 7724, 29892, 16507, 2891, 29918, 7724, 13, 1678, 5534, 23746, 29963, 1338, 29892, 285, 29886, 8848, 29963, 1338, 29892, 20238, 13, 13, 1678, 396, 25455, 474, 29914, 29886, 6273, 13, 1678, 8528, 29925, 29918, 22412, 353, 938, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 268, 13, 1678, 315, 29965, 4198, 29918, 10145, 353, 10876, 29889, 19218, 29961, 29906, 29962, 13, 1678, 9920, 353, 525, 22075, 4489, 29879, 448, 3137, 1273, 29879, 29915, 1273, 313, 29907, 29965, 4198, 29918, 10145, 29897, 13, 1678, 1018, 29901, 13, 4706, 1014, 5014, 29889, 3198, 29918, 4804, 29898, 9006, 29889, 5451, 3285, 27591, 29922, 29943, 10074, 29892, 380, 20405, 29922, 1491, 5014, 29889, 1254, 3970, 2692, 29897, 13, 1678, 5174, 1014, 5014, 29889, 29907, 4212, 7032, 2392, 29901, 13, 4706, 1596, 525, 9882, 1273, 29879, 947, 451, 429, 1169, 373, 379, 4037, 29903, 6169, 1273, 313, 29907, 29965, 4198, 29918, 10145, 29897, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 1678, 383, 10074, 29889, 5358, 580, 13, 13, 1678, 8528, 13427, 29918, 10145, 353, 10876, 29889, 19218, 29961, 29941, 29962, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 275, 1445, 29898, 5746, 13427, 29918, 10145, 1125, 13, 4706, 1596, 525, 2283, 1273, 29879, 947, 451, 429, 1169, 373, 934, 1788, 6169, 1273, 313, 5746, 13427, 29918, 10145, 29897, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 1678, 5195, 29943, 29918, 7724, 353, 10876, 29889, 19218, 29961, 29946, 29962, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 275, 1445, 29898, 25866, 29918, 7724, 1125, 13, 4706, 1596, 525, 2283, 1273, 29879, 947, 451, 429, 1169, 373, 934, 1788, 6169, 1273, 313, 25866, 29918, 7724, 29897, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 1678, 16507, 2891, 29918, 7724, 353, 525, 18454, 29889, 5317, 29915, 13, 13, 13, 1753, 3509, 10547, 797, 7583, 9170, 7295, 13, 1678, 474, 353, 29871, 29896, 13, 1678, 1550, 474, 5277, 8528, 29925, 29918, 22412, 29901, 13, 4706, 9920, 353, 525, 22075, 4489, 29879, 448, 8552, 1762, 7717, 1273, 29879, 22584, 29881, 29914, 1885, 267, 29889, 18091, 8848, 29918, 11294, 292, 2531, 267, 29889, 18091, 8848, 29918, 11294, 292, 29889, 29995, 29881, 29915, 1273, 313, 29907, 29965, 4198, 29918, 10145, 29892, 474, 29892, 474, 29897, 13, 4706, 364, 353, 2897, 29889, 5205, 29898, 9006, 29897, 13, 4706, 565, 364, 29901, 13, 9651, 1596, 525, 9526, 1059, 2179, 2955, 1550, 17596, 315, 3096, 4965, 1962, 373, 1887, 934, 1788, 363, 474, 16328, 29881, 29889, 1222, 11407, 2023, 29915, 1273, 313, 29875, 29897, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 4706, 474, 4619, 29871, 29896, 13, 13, 1678, 9920, 353, 525, 6814, 1273, 29879, 869, 29915, 1273, 313, 5746, 13427, 29918, 10145, 29897, 13, 1678, 2897, 29889, 5205, 29898, 9006, 29897, 13, 13, 1678, 9920, 353, 525, 6814, 1273, 29879, 869, 29915, 1273, 313, 25866, 29918, 7724, 29897, 13, 1678, 2897, 29889, 5205, 29898, 9006, 29897, 13, 13, 13, 1753, 3464, 24217, 29898, 29879, 29892, 321, 1125, 13, 1678, 363, 2380, 29892, 364, 297, 26985, 29898, 29878, 6916, 1125, 13, 4706, 565, 269, 6736, 1472, 29898, 29878, 29961, 29900, 2314, 322, 269, 529, 1472, 29898, 29878, 29961, 29896, 29962, 1125, 13, 9651, 736, 2380, 13, 13, 4706, 565, 269, 529, 1472, 29898, 29878, 29961, 29900, 29962, 1125, 13, 9651, 736, 6213, 13, 13, 1678, 736, 6213, 13, 13, 13, 1753, 2531, 9065, 7295, 13, 1678, 23746, 2283, 353, 1722, 29898, 5746, 13427, 29918, 10145, 29892, 525, 29878, 1495, 13, 1678, 6475, 353, 11799, 29889, 16950, 29898, 11911, 482, 2283, 29892, 28552, 2433, 25710, 13, 13, 1678, 474, 353, 29871, 29900, 13, 1678, 23746, 29963, 1338, 353, 5159, 13, 1678, 1550, 474, 529, 8528, 29925, 29918, 22412, 29901, 13, 4706, 23746, 29963, 1338, 29889, 4397, 29898, 3788, 29889, 7122, 4197, 29878, 29961, 29875, 29962, 363, 364, 297, 6475, 12622, 13, 4706, 23746, 2283, 29889, 344, 1416, 29898, 29900, 29897, 13, 4706, 474, 4619, 29871, 29896, 13, 13, 1678, 23746, 2283, 29889, 5358, 580, 13, 13, 1678, 2143, 2283, 353, 1722, 29898, 25866, 29918, 7724, 29892, 525, 29878, 1495, 13, 1678, 6475, 353, 11799, 29889, 16950, 29898, 999, 2283, 29892, 28552, 2433, 29905, 29873, 1495, 13, 1678, 20238, 353, 518, 23583, 29898, 29878, 29961, 29900, 1822, 5451, 877, 636, 8785, 363, 364, 297, 6475, 29962, 13, 1678, 2143, 2283, 29889, 5358, 580, 13, 13, 1678, 474, 353, 29871, 29896, 13, 1678, 285, 29886, 8848, 29963, 1338, 353, 5159, 13, 1678, 1550, 474, 5277, 8528, 29925, 29918, 22412, 29901, 13, 4706, 285, 29886, 8848, 17020, 353, 525, 1885, 267, 29889, 18091, 8848, 29918, 11294, 292, 29889, 29995, 29881, 29915, 1273, 313, 29875, 29897, 13, 4706, 285, 29886, 8848, 2283, 353, 1722, 29898, 18091, 8848, 17020, 29892, 525, 29878, 1495, 13, 4706, 6475, 353, 11799, 29889, 16950, 29898, 18091, 8848, 2283, 29892, 28552, 2433, 29905, 29873, 1495, 13, 13, 4706, 432, 353, 29871, 29896, 13, 4706, 1948, 353, 6024, 29900, 2033, 29930, 2435, 29898, 29878, 6916, 29897, 13, 4706, 363, 364, 297, 6475, 29901, 13, 9651, 565, 432, 1275, 29871, 29896, 29901, 13, 18884, 432, 353, 29871, 29906, 13, 18884, 6773, 13, 9651, 1683, 29901, 13, 18884, 269, 29892, 29872, 353, 364, 29961, 29953, 1822, 5451, 877, 29901, 29861, 29896, 1822, 5451, 877, 29899, 1495, 13, 18884, 3240, 353, 3464, 24217, 29898, 5426, 29898, 29879, 511, 321, 29897, 13, 18884, 565, 3240, 29901, 13, 462, 1678, 1948, 29961, 2267, 29962, 353, 364, 29961, 29929, 29962, 13, 13, 4706, 285, 29886, 8848, 29963, 1338, 29889, 4397, 29898, 3788, 29889, 7122, 29898, 798, 876, 13, 4706, 285, 29886, 8848, 2283, 29889, 5358, 580, 13, 4706, 474, 4619, 29871, 29896, 13, 13, 13, 1753, 2436, 29963, 1338, 1762, 2283, 7295, 13, 1678, 288, 2283, 353, 1722, 29898, 7390, 2891, 29918, 7724, 29892, 525, 29893, 29890, 1495, 13, 1678, 5839, 280, 29889, 15070, 29898, 11911, 482, 29963, 1338, 29892, 288, 2283, 29897, 13, 1678, 5839, 280, 29889, 15070, 29898, 18091, 8848, 29963, 1338, 29892, 288, 2283, 29897, 13, 1678, 288, 2283, 29889, 5358, 580, 13, 13, 13, 1753, 2531, 3247, 1862, 7295, 13, 1678, 474, 2283, 353, 1722, 29898, 7390, 2891, 29918, 7724, 29892, 525, 6050, 1495, 13, 1678, 23746, 29963, 1338, 353, 5839, 280, 29889, 1359, 29898, 29875, 2283, 29897, 13, 1678, 285, 29886, 8848, 29963, 1338, 353, 5839, 280, 29889, 1359, 29898, 29875, 2283, 29897, 13, 1678, 474, 2283, 29889, 5358, 580, 13, 13, 1678, 364, 353, 696, 1675, 29879, 29889, 29878, 13, 1678, 474, 353, 29871, 29900, 13, 1678, 1550, 474, 529, 8528, 29925, 29918, 22412, 29901, 13, 4706, 921, 353, 696, 1675, 29879, 29889, 2928, 12877, 4197, 5426, 29898, 667, 29897, 363, 2944, 297, 23746, 29963, 1338, 29961, 29875, 1822, 5451, 29317, 1495, 2314, 13, 4706, 343, 353, 696, 1675, 29879, 29889, 11031, 12877, 4197, 7411, 29898, 667, 29897, 363, 2944, 297, 285, 29886, 8848, 29963, 1338, 29961, 29875, 1822, 5451, 29317, 1495, 2314, 13, 4706, 364, 29889, 26568, 877, 29873, 29995, 29881, 29889, 6173, 29915, 1273, 313, 29875, 29974, 29896, 876, 13, 4706, 364, 29889, 5317, 29898, 29916, 29892, 343, 29892, 921, 8205, 543, 29907, 957, 482, 613, 343, 8205, 543, 29943, 21738, 29924, 1159, 13, 4706, 474, 4619, 29871, 29896, 13, 13, 13, 1753, 5941, 786, 7295, 13, 1678, 9920, 353, 525, 1758, 448, 29888, 2531, 267, 29889, 18091, 8848, 29918, 11294, 292, 29930, 29915, 13, 1678, 2897, 29889, 5205, 29898, 9006, 29897, 13, 13, 13, 29937, 4241, 1824, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 3544, 2659, 4290, 580, 13, 1678, 3509, 10547, 797, 7583, 9170, 580, 13, 1678, 2531, 9065, 580, 13, 1678, 2436, 29963, 1338, 1762, 2283, 580, 13, 1678, 5941, 786, 580, 13, 1678, 2531, 3247, 1862, 580, 13, 1678, 1596, 376, 9283, 7743, 8472, 29908, 13, 1678, 10876, 29889, 13322, 29898, 29900, 29897, 2 ]
nsst_translate_corpus.py
AlexanderJenke/nsst
0
2672
from argparse import ArgumentParser from tqdm import tqdm import NSST from nsst_translate import best_transition_sequence if __name__ == '__main__': parser = ArgumentParser() parser.add_argument("--nsst_file", default="output/nsst_tss20_th4_nSt100_Q0.pkl", help="nsst file") parser.add_argument("--src_lang", default="output/europarl-v7.de-en.de.clean") parser.add_argument("--tgt_lang", default="output/europarl-v7.de-en.en.clean") parser.add_argument("--enforce_n_reg", default=True) parser.add_argument("--output", default=f"output/nsst_stat_nreg_100Q0.csv") args = parser.parse_args() args.enforce_n_final_reg = False # load NSST nsst = NSST.NSST() nsst.load(args.nsst_file) args.nsst = nsst # open files src_file = open(args.src_lang, 'r') tgt_file = open(args.tgt_lang, 'r') output_file = open(args.output, 'w') # iterate over sentences, first 4096 -> test sentences for src, tgt, _ in tqdm(list(zip(src_file, tgt_file, range(4096))), desc="Processing sentences"): # remove line breaks src = src[:-1] tgt = tgt[:-1] # try to translate try: # prepare tokenisations token_src = [nsst.tokenization_src[word] if word in nsst.tokenization_src else 0 for word in src.split(" ") if len(word)] token_tgt = [nsst.tokenization_tgt[word] if word in nsst.tokenization_tgt else 0 for word in tgt.split(" ") if len(word)] # run nsst args.input = src args.token_src = token_src result = best_transition_sequence(args) # get best result pred = sorted((k for k in result if ('Qf' in args.nsst_file or not args.enforce_n_final_reg or len(k[1]) == 1) and ('Q0' in args.nsst_file or k[0] == -1) ), key=lambda x: x[2], reverse=True)[0] n_res = len(result) q, reg, prob = pred # write to csv if not len(reg): # catch empty registers continue token_pred = [w for w in reg[0].split(' ') if len(w)] pred_str = "" for t in token_pred: pred_str += f"{nsst.tokenization_tgt_lut[int(t)]} " token_src_str = "" for t in token_src: token_src_str += f"{t} " token_tgt_str = "" for t in token_tgt: token_tgt_str += f"{t} " token_pred_str = "" for t in token_pred: token_pred_str += f"{t} " print(f"{src};{token_src_str[:-1]};" f"{tgt};{token_tgt_str[:-1]};" f"{pred_str};{token_pred_str[:-1]};" f"{prob};{len(reg)};{n_res}", file=output_file) output_file.flush() except RuntimeError: pass # close files src_file.close() tgt_file.close() output_file.close()
[ 1, 515, 1852, 5510, 1053, 23125, 11726, 13, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 13, 5215, 3865, 1254, 13, 3166, 17534, 303, 29918, 21652, 1053, 1900, 29918, 20543, 29918, 16506, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 13812, 353, 23125, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 1983, 303, 29918, 1445, 613, 2322, 543, 4905, 29914, 1983, 303, 29918, 29873, 893, 29906, 29900, 29918, 386, 29946, 29918, 29876, 855, 29896, 29900, 29900, 29918, 29984, 29900, 29889, 29886, 6321, 613, 1371, 543, 1983, 303, 934, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 4351, 29918, 3893, 613, 2322, 543, 4905, 29914, 29872, 2192, 862, 29880, 29899, 29894, 29955, 29889, 311, 29899, 264, 29889, 311, 29889, 14941, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 29873, 4141, 29918, 3893, 613, 2322, 543, 4905, 29914, 29872, 2192, 862, 29880, 29899, 29894, 29955, 29889, 311, 29899, 264, 29889, 264, 29889, 14941, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 264, 10118, 29918, 29876, 29918, 1727, 613, 2322, 29922, 5574, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 4905, 613, 2322, 29922, 29888, 29908, 4905, 29914, 1983, 303, 29918, 6112, 29918, 29876, 1727, 29918, 29896, 29900, 29900, 29984, 29900, 29889, 7638, 1159, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 6389, 29889, 264, 10118, 29918, 29876, 29918, 8394, 29918, 1727, 353, 7700, 13, 13, 1678, 396, 2254, 3865, 1254, 13, 1678, 17534, 303, 353, 3865, 1254, 29889, 3059, 1254, 580, 13, 1678, 17534, 303, 29889, 1359, 29898, 5085, 29889, 1983, 303, 29918, 1445, 29897, 13, 1678, 6389, 29889, 1983, 303, 353, 17534, 303, 13, 13, 1678, 396, 1722, 2066, 13, 1678, 4765, 29918, 1445, 353, 1722, 29898, 5085, 29889, 4351, 29918, 3893, 29892, 525, 29878, 1495, 13, 1678, 260, 4141, 29918, 1445, 353, 1722, 29898, 5085, 29889, 29873, 4141, 29918, 3893, 29892, 525, 29878, 1495, 13, 1678, 1962, 29918, 1445, 353, 1722, 29898, 5085, 29889, 4905, 29892, 525, 29893, 1495, 13, 13, 1678, 396, 13649, 975, 25260, 29892, 937, 29871, 29946, 29900, 29929, 29953, 1599, 1243, 25260, 13, 1678, 363, 4765, 29892, 260, 4141, 29892, 903, 297, 260, 29939, 18933, 29898, 1761, 29898, 7554, 29898, 4351, 29918, 1445, 29892, 260, 4141, 29918, 1445, 29892, 3464, 29898, 29946, 29900, 29929, 29953, 876, 511, 5153, 543, 7032, 292, 25260, 29908, 1125, 13, 4706, 396, 3349, 1196, 16706, 13, 4706, 4765, 353, 4765, 7503, 29899, 29896, 29962, 13, 4706, 260, 4141, 353, 260, 4141, 7503, 29899, 29896, 29962, 13, 13, 4706, 396, 1018, 304, 14240, 13, 4706, 1018, 29901, 13, 9651, 396, 19012, 5993, 275, 800, 13, 9651, 5993, 29918, 4351, 353, 518, 1983, 303, 29889, 6979, 2133, 29918, 4351, 29961, 1742, 29962, 565, 1734, 297, 17534, 303, 29889, 6979, 2133, 29918, 4351, 1683, 29871, 29900, 13, 462, 308, 363, 1734, 297, 4765, 29889, 5451, 703, 16521, 565, 7431, 29898, 1742, 4638, 13, 13, 9651, 5993, 29918, 29873, 4141, 353, 518, 1983, 303, 29889, 6979, 2133, 29918, 29873, 4141, 29961, 1742, 29962, 565, 1734, 297, 17534, 303, 29889, 6979, 2133, 29918, 29873, 4141, 1683, 29871, 29900, 13, 462, 308, 363, 1734, 297, 260, 4141, 29889, 5451, 703, 16521, 565, 7431, 29898, 1742, 4638, 13, 13, 9651, 396, 1065, 17534, 303, 13, 9651, 6389, 29889, 2080, 353, 4765, 13, 9651, 6389, 29889, 6979, 29918, 4351, 353, 5993, 29918, 4351, 13, 9651, 1121, 353, 1900, 29918, 20543, 29918, 16506, 29898, 5085, 29897, 13, 13, 9651, 396, 679, 1900, 1121, 13, 9651, 4450, 353, 12705, 3552, 29895, 363, 413, 297, 1121, 13, 462, 965, 565, 6702, 29984, 29888, 29915, 297, 6389, 29889, 1983, 303, 29918, 1445, 470, 451, 6389, 29889, 264, 10118, 29918, 29876, 29918, 8394, 29918, 1727, 470, 7431, 29898, 29895, 29961, 29896, 2314, 1275, 29871, 29896, 29897, 13, 462, 965, 322, 6702, 29984, 29900, 29915, 297, 6389, 29889, 1983, 303, 29918, 1445, 470, 413, 29961, 29900, 29962, 1275, 448, 29896, 29897, 13, 462, 965, 10353, 13, 462, 3986, 1820, 29922, 2892, 921, 29901, 921, 29961, 29906, 1402, 13, 462, 3986, 11837, 29922, 5574, 9601, 29900, 29962, 13, 13, 9651, 302, 29918, 690, 353, 7431, 29898, 2914, 29897, 13, 9651, 3855, 29892, 1072, 29892, 2070, 353, 4450, 13, 13, 9651, 396, 2436, 304, 11799, 13, 9651, 565, 451, 7431, 29898, 1727, 1125, 29871, 396, 4380, 4069, 28975, 13, 18884, 6773, 13, 13, 9651, 5993, 29918, 11965, 353, 518, 29893, 363, 281, 297, 1072, 29961, 29900, 1822, 5451, 877, 25710, 565, 7431, 29898, 29893, 4638, 13, 13, 9651, 4450, 29918, 710, 353, 5124, 13, 9651, 363, 260, 297, 5993, 29918, 11965, 29901, 13, 18884, 4450, 29918, 710, 4619, 285, 29908, 29912, 1983, 303, 29889, 6979, 2133, 29918, 29873, 4141, 29918, 29880, 329, 29961, 524, 29898, 29873, 4638, 29913, 376, 13, 13, 9651, 5993, 29918, 4351, 29918, 710, 353, 5124, 13, 9651, 363, 260, 297, 5993, 29918, 4351, 29901, 13, 18884, 5993, 29918, 4351, 29918, 710, 4619, 285, 29908, 29912, 29873, 29913, 376, 13, 13, 9651, 5993, 29918, 29873, 4141, 29918, 710, 353, 5124, 13, 9651, 363, 260, 297, 5993, 29918, 29873, 4141, 29901, 13, 18884, 5993, 29918, 29873, 4141, 29918, 710, 4619, 285, 29908, 29912, 29873, 29913, 376, 13, 13, 9651, 5993, 29918, 11965, 29918, 710, 353, 5124, 13, 9651, 363, 260, 297, 5993, 29918, 11965, 29901, 13, 18884, 5993, 29918, 11965, 29918, 710, 4619, 285, 29908, 29912, 29873, 29913, 376, 13, 13, 9651, 1596, 29898, 29888, 29908, 29912, 4351, 3400, 29912, 6979, 29918, 4351, 29918, 710, 7503, 29899, 29896, 29962, 3400, 29908, 13, 462, 29871, 285, 29908, 29912, 29873, 4141, 3400, 29912, 6979, 29918, 29873, 4141, 29918, 710, 7503, 29899, 29896, 29962, 3400, 29908, 13, 462, 29871, 285, 29908, 29912, 11965, 29918, 710, 3400, 29912, 6979, 29918, 11965, 29918, 710, 7503, 29899, 29896, 29962, 3400, 29908, 13, 462, 29871, 285, 29908, 29912, 22795, 3400, 29912, 2435, 29898, 1727, 2915, 29936, 29912, 29876, 29918, 690, 17671, 13, 462, 29871, 934, 29922, 4905, 29918, 1445, 29897, 13, 13, 9651, 1962, 29918, 1445, 29889, 23126, 580, 13, 4706, 5174, 24875, 2392, 29901, 13, 9651, 1209, 13, 13, 1678, 396, 3802, 2066, 13, 1678, 4765, 29918, 1445, 29889, 5358, 580, 13, 1678, 260, 4141, 29918, 1445, 29889, 5358, 580, 13, 1678, 1962, 29918, 1445, 29889, 5358, 580, 13, 2 ]
src/example_package/additions.py
energyinpython/packaging_tutorial
0
156466
import numpy as np # reverse = True: descending order (TOPSIS, CODAS), False: ascending order (VIKOR, SPOTIS) def rank_preferences(pref, reverse = True): """ Rank alternatives according to MCDM preference function values. Parameters ---------- pref : ndarray vector with MCDM preference function values for alternatives reverse : bool Boolean variable which is True for MCDM methods which rank alternatives in descending order and False for MCDM methods which rank alternatives in ascending order Returns ------- ndarray vector with alternatives ranking. Alternative with 1 value is the best. """ rank = np.zeros(len(pref)) sorted_pref = sorted(pref, reverse = reverse) pos = 1 for i in range(len(sorted_pref) - 1): ind = np.where(sorted_pref[i] == pref)[0] rank[ind] = pos if sorted_pref[i] != sorted_pref[i + 1]: pos += 1 ind = np.where(sorted_pref[i + 1] == pref)[0] rank[ind] = pos return rank.astype(int)
[ 1, 1053, 12655, 408, 7442, 13, 13, 29937, 11837, 353, 5852, 29901, 5153, 2548, 1797, 313, 29911, 4590, 29903, 3235, 29892, 4810, 29928, 3289, 511, 7700, 29901, 12066, 2548, 1797, 313, 18118, 29968, 1955, 29892, 10937, 2891, 3235, 29897, 13, 1753, 7115, 29918, 1457, 10662, 29898, 29886, 999, 29892, 11837, 353, 5852, 1125, 13, 1678, 9995, 13, 1678, 22125, 27809, 5034, 304, 341, 6530, 29924, 24583, 740, 1819, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 4706, 758, 29888, 584, 29871, 299, 2378, 13, 9651, 4608, 411, 341, 6530, 29924, 24583, 740, 1819, 363, 27809, 13, 4706, 11837, 584, 6120, 13, 9651, 11185, 2286, 607, 338, 5852, 363, 341, 6530, 29924, 3519, 607, 7115, 27809, 297, 5153, 2548, 13, 9651, 1797, 322, 7700, 363, 341, 6530, 29924, 3519, 607, 7115, 27809, 297, 12066, 2548, 13, 9651, 1797, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 308, 299, 2378, 13, 9651, 4608, 411, 27809, 24034, 29889, 12440, 1230, 411, 29871, 29896, 995, 338, 278, 1900, 29889, 13, 1678, 9995, 13, 1678, 7115, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 29886, 999, 876, 13, 1678, 12705, 29918, 29886, 999, 353, 12705, 29898, 29886, 999, 29892, 11837, 353, 11837, 29897, 13, 1678, 926, 353, 29871, 29896, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 24582, 29918, 29886, 999, 29897, 448, 29871, 29896, 1125, 13, 4706, 1399, 353, 7442, 29889, 3062, 29898, 24582, 29918, 29886, 999, 29961, 29875, 29962, 1275, 758, 29888, 9601, 29900, 29962, 13, 4706, 7115, 29961, 513, 29962, 353, 926, 13, 4706, 565, 12705, 29918, 29886, 999, 29961, 29875, 29962, 2804, 12705, 29918, 29886, 999, 29961, 29875, 718, 29871, 29896, 5387, 13, 9651, 926, 4619, 29871, 29896, 13, 1678, 1399, 353, 7442, 29889, 3062, 29898, 24582, 29918, 29886, 999, 29961, 29875, 718, 29871, 29896, 29962, 1275, 758, 29888, 9601, 29900, 29962, 13, 1678, 7115, 29961, 513, 29962, 353, 926, 13, 1678, 736, 7115, 29889, 579, 668, 29898, 524, 29897, 13, 2 ]
cogandmem/writing.py
aemacdermid/cogandmem
0
94858
<gh_stars>0 """ Functions for writing to files. To the best of my knowledge, the functions in this module work. However, the module can be improved. At present, it does not take advantage of Python's csv module. Since data is usually written to csv files, this is a major oversight. This module contains the following functions (see the docstrings for more information): ready_file_for_writing: given a string, returns a file object ready for writing. list_or_tuple: write a list or tuple to a file. write_dict: write a dictionary to a file. study_phase: write a study phase to a file. paired_study: write a study phase with WordPair objects to a file. cued_recall_results: write the results of a cued-recall test to a file. """ import os def ready_file_for_writing(f): """Make sure a file is ready for writing. f should be a string or file.""" try: extant = os.path.isfile(f) except TypeError: # Presumably, this is already a file. return f if extant: # Don't overwrite the extant file. f = open(f, "a") else: f = open(f, "w") return f def list_or_tuple(f, w, sep = "\n", c = True, end_string = "\n"): """ Write a list or tuple to a file. Parameters: f: the file to which to write w; can be a file open for writing, a string pointing to an extant file, or a string pointing to a to-be-created file. w: the to-be-written list or tuple. Keyword Parameters: sep: the string separating each list element; defaults to "\n". c: Boolean indicating whether the file should be closed before the function ends; defaults to True. end_string: a string to write at the end; defaults to "\n". """ f = ready_file_for_writing(f) for i in range(len(w)): e = w[i] if isinstance(e, (list, tuple)): list_or_tuple(f, e, c = False, end_string = "") elif isinstance(e, dict): write_dict(e, f, False, end_string = "") else: f.write(str(e)) if i < len(w)-1: f.write(sep) elif end_string: f.write(end_string) if c: f.close() def write_dict(d, f, c = True, end_string = "\n"): """ Write a dictionary (d) to a file (f). f can be a file open for writing or a string pointing to an extant or to-be-created file. Entries in d are written one by one to f. Each key is written first, followed by the entry. Two blank lines separate keys. Dicts, lists, and tuples are written with each entry/element on a separate line. All other types are converted to strings and written on the same line as the key. If c is True, f is closed before the function ends. The end_string parameter defaults to "\n". It is written after d is written. """ f = ready_file_for_writing(f) for k in d: f.write(str(k)+": ") w = d[k] if isinstance(w, (list, tuple)): f.write("[\n") list_or_tuple(f, w, c = False) f.write("]\n") elif isinstance(w, dict): f.write("{\n") write_dict(w, f, False) f.write("}\n") else: f.write(str(w)+"\n") if end_string: f.write(end_string) if c: f.close() def study_phase(stimuli, f, sep = ",", close_when_finished = True): """ Write a study list to a file. If the Stimulus objects passed to the function contain information in their condition attribute, then a three-column table is written to f (serial position, word, condition). If no condition information is included, then the condition column is omitted. Parameters: stimuli: a list of Stimulus objects representing the study list. f: the file to which to write stimuli; this can be a file opened for writing, a string pointing to an extant file, or a string pointing to a to-be-created file. If f is a file, writing starts wherever the file is currently positioned for writing; if f is a string pointing to an extant file, stimuli are written to the end; and if f is a to-be-created file, stimuli are written in the file at the top. Keyword Parameters: sep: string denoting what separates the values; defaults to ",". close_when_finished: Boolean indicating whether f should be closed before ending the function; defaults to True. """ f = ready_file_for_writing(f) f.write("serial_position{:s}word".format(sep)) if stimuli[0].condition: write_condition = True f.write("{:s}condition\n".format(sep)) else: write_condition = False f.write("\n") for i in range(len(stimuli)): f.write("{:d}{:s}{:s}".format(i+1, sep, stimuli[i].word)) if write_condition: f.write("{:s}{:s}\n".format(sep, str(stimuli[i].condition))) else: f.write("\n") if close_when_finished: f.close() def paired_study(stimuli, f, sep = ",", close_when_finished = True): """ Write a paired study list to a file. If the WordPair objects passed to the function contain information in their condition attribute, then a four-column table is written to f (serial position, cue, target, condition). If no condition information is included, then the condition column is omitted. Parameters: stimuli: a list of WordPair objects representing the study list. f: the file to which to write stimuli; this can be a file opened for writing, a string pointing to an extant file, or a string pointing to a to-be-created file. If f is a file, writing starts wherever the file is currently positioned for writing; if f is a string pointing to an extant file, stimuli are written to the end; and if f is a to-be-created file, stimuli are written in the file at the top. Keyword Parameters: sep: string denoting what separates the values; defaults to ",". close_when_finished: Boolean indicating whether f should be closed before ending the function; defaults to True. """ f = ready_file_for_writing(f) f.write("serial_position"+sep+"cue"+sep+"target") if stimuli[0].condition: write_condition = True f.write(sep+"condition\n") else: write_condition = False f.write("\n") for i in range(len(stimuli)): pair = stimuli[i] f.write(str(i+1)+sep+pair.cue+sep+pair.target) if write_condition: f.write(sep+str(pair.condition)+"\n") else: f.write("\n") if close_when_finished: f.close() def cued_recall_results(word_pairs, f, sep = ",", close_when_finished = True): """ Write the results of a cued-recall test to a file. If the WordPair objects passed to the function contain information in their condition attribute, then a five-column table is written to f (test position, cue, target, response, condition). If no condition information is included, then the condition column is omitted. Parameters: word_pairs: the WordPair objects to write. f: the file to which to write stimuli; this can be a file opened for writing, a string pointing to an extant file, or a string pointing to a to-be-created file. If f is a file, writing starts wherever the file is currently positioned for writing; if f is a string pointing to an extant file, stimuli are written to the end; and if f is a to-be-created file, stimuli are written in the file at the top. Keyword Parameters: sep: string denoting what separates the values; defaults to ",". close_when_finished: Boolean indicating whether f should be closed before ending the function; defaults to True. """ f = ready_file_for_writing(f) f.write("test_position"+sep+"cue"+sep+"target"+sep+"response") if word_pairs[0].condition: write_condition = True f.write(sep+"condition"+sep+"\n") else: write_condition = False f.write("\n") for i in range(len(word_pairs)): pair = word_pairs[i] f.write(str(i+1)+sep+pair.cue+sep+pair.target+sep+pair.response) if write_condition: f.write(sep+str(pair.condition)+"\n") else: f.write("\n") if close_when_finished: f.close()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 6678, 29879, 363, 5007, 304, 2066, 29889, 13, 13, 1762, 278, 1900, 310, 590, 7134, 29892, 278, 3168, 297, 445, 3883, 664, 29889, 2398, 29892, 278, 13, 5453, 508, 367, 16710, 29889, 2180, 2198, 29892, 372, 947, 451, 2125, 10631, 310, 5132, 29915, 29879, 11799, 13, 5453, 29889, 4001, 848, 338, 5491, 3971, 304, 11799, 2066, 29892, 445, 338, 263, 4655, 288, 874, 523, 29889, 13, 13, 4013, 3883, 3743, 278, 1494, 3168, 313, 4149, 278, 1574, 19651, 363, 901, 13, 19678, 1125, 13, 1678, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29901, 2183, 263, 1347, 29892, 3639, 263, 934, 1203, 7960, 363, 13, 16554, 29889, 13, 1678, 1051, 29918, 272, 29918, 23583, 29901, 2436, 263, 1051, 470, 18761, 304, 263, 934, 29889, 13, 1678, 2436, 29918, 8977, 29901, 2436, 263, 8600, 304, 263, 934, 29889, 13, 1678, 6559, 29918, 21646, 29901, 2436, 263, 6559, 8576, 304, 263, 934, 29889, 13, 1678, 3300, 2859, 29918, 18082, 29891, 29901, 2436, 263, 6559, 8576, 411, 10803, 20547, 3618, 304, 263, 934, 29889, 13, 1678, 2723, 287, 29918, 3757, 497, 29918, 9902, 29901, 2436, 278, 2582, 310, 263, 2723, 287, 29899, 3757, 497, 1243, 304, 263, 934, 29889, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 13, 1753, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29898, 29888, 1125, 13, 1678, 9995, 9984, 1854, 263, 934, 338, 7960, 363, 5007, 29889, 285, 881, 367, 263, 1347, 470, 934, 1213, 15945, 13, 1678, 1018, 29901, 13, 4706, 1294, 424, 353, 2897, 29889, 2084, 29889, 275, 1445, 29898, 29888, 29897, 13, 1678, 5174, 20948, 29901, 13, 4706, 396, 4360, 24873, 29892, 445, 338, 2307, 263, 934, 29889, 13, 4706, 736, 285, 13, 1678, 565, 1294, 424, 29901, 13, 4706, 396, 3872, 29915, 29873, 26556, 278, 1294, 424, 934, 29889, 13, 4706, 285, 353, 1722, 29898, 29888, 29892, 376, 29874, 1159, 13, 1678, 1683, 29901, 13, 4706, 285, 353, 1722, 29898, 29888, 29892, 376, 29893, 1159, 13, 1678, 736, 285, 13, 13, 13, 1753, 1051, 29918, 272, 29918, 23583, 29898, 29888, 29892, 281, 29892, 16345, 353, 6634, 29876, 613, 274, 353, 5852, 29892, 1095, 29918, 1807, 353, 6634, 29876, 29908, 1125, 13, 1678, 9995, 13, 1678, 14350, 263, 1051, 470, 18761, 304, 263, 934, 29889, 13, 268, 13, 1678, 12662, 2699, 29901, 13, 4706, 285, 29901, 278, 934, 304, 607, 304, 2436, 281, 29936, 508, 367, 263, 934, 1722, 363, 5007, 29892, 263, 13, 9651, 1347, 13330, 304, 385, 1294, 424, 934, 29892, 470, 263, 1347, 13330, 304, 263, 13, 9651, 304, 29899, 915, 29899, 11600, 934, 29889, 13, 4706, 281, 29901, 278, 304, 29899, 915, 29899, 17625, 1051, 470, 18761, 29889, 13, 268, 13, 1678, 7670, 1742, 12662, 2699, 29901, 13, 4706, 16345, 29901, 278, 1347, 2903, 1218, 1269, 1051, 1543, 29936, 21274, 304, 6634, 29876, 1642, 13, 4706, 274, 29901, 11185, 23941, 3692, 278, 934, 881, 367, 5764, 1434, 278, 13, 9651, 740, 10614, 29936, 21274, 304, 5852, 29889, 13, 4706, 1095, 29918, 1807, 29901, 263, 1347, 304, 2436, 472, 278, 1095, 29936, 21274, 304, 6634, 29876, 1642, 13, 1678, 9995, 13, 1678, 285, 353, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29898, 29888, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 29893, 22164, 13, 4706, 321, 353, 281, 29961, 29875, 29962, 13, 4706, 565, 338, 8758, 29898, 29872, 29892, 313, 1761, 29892, 18761, 22164, 13, 9651, 1051, 29918, 272, 29918, 23583, 29898, 29888, 29892, 321, 29892, 274, 353, 7700, 29892, 1095, 29918, 1807, 353, 20569, 13, 4706, 25342, 338, 8758, 29898, 29872, 29892, 9657, 1125, 13, 9651, 2436, 29918, 8977, 29898, 29872, 29892, 285, 29892, 7700, 29892, 1095, 29918, 1807, 353, 20569, 13, 4706, 1683, 29901, 13, 9651, 285, 29889, 3539, 29898, 710, 29898, 29872, 876, 13, 4706, 565, 474, 529, 7431, 29898, 29893, 6817, 29896, 29901, 13, 9651, 285, 29889, 3539, 29898, 19570, 29897, 13, 4706, 25342, 1095, 29918, 1807, 29901, 13, 9651, 285, 29889, 3539, 29898, 355, 29918, 1807, 29897, 13, 1678, 565, 274, 29901, 13, 4706, 285, 29889, 5358, 580, 13, 13, 13, 1753, 2436, 29918, 8977, 29898, 29881, 29892, 285, 29892, 274, 353, 5852, 29892, 1095, 29918, 1807, 353, 6634, 29876, 29908, 1125, 13, 1678, 9995, 13, 1678, 14350, 263, 8600, 313, 29881, 29897, 304, 263, 934, 313, 29888, 467, 285, 508, 367, 263, 934, 1722, 363, 5007, 470, 13, 1678, 263, 1347, 13330, 304, 385, 1294, 424, 470, 304, 29899, 915, 29899, 11600, 934, 29889, 13, 268, 13, 1678, 4284, 2722, 297, 270, 526, 3971, 697, 491, 697, 304, 285, 29889, 7806, 1820, 338, 3971, 937, 29892, 13, 1678, 5643, 491, 278, 6251, 29889, 7803, 9654, 3454, 5004, 6611, 29889, 360, 919, 29879, 29892, 8857, 29892, 322, 13, 1678, 5291, 2701, 526, 3971, 411, 1269, 6251, 29914, 5029, 373, 263, 5004, 1196, 29889, 2178, 916, 13, 1678, 4072, 526, 11543, 304, 6031, 322, 3971, 373, 278, 1021, 1196, 408, 278, 1820, 29889, 13, 1678, 960, 274, 338, 5852, 29892, 285, 338, 5764, 1434, 278, 740, 10614, 29889, 450, 1095, 29918, 1807, 13, 1678, 3443, 21274, 304, 6634, 29876, 1642, 739, 338, 3971, 1156, 270, 338, 3971, 29889, 13, 1678, 9995, 13, 1678, 285, 353, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29898, 29888, 29897, 13, 1678, 363, 413, 297, 270, 29901, 13, 4706, 285, 29889, 3539, 29898, 710, 29898, 29895, 7240, 1115, 16521, 13, 4706, 281, 353, 270, 29961, 29895, 29962, 13, 4706, 565, 338, 8758, 29898, 29893, 29892, 313, 1761, 29892, 18761, 22164, 13, 9651, 285, 29889, 3539, 703, 7110, 29876, 1159, 13, 9651, 1051, 29918, 272, 29918, 23583, 29898, 29888, 29892, 281, 29892, 274, 353, 7700, 29897, 13, 9651, 285, 29889, 3539, 703, 10725, 29876, 1159, 13, 4706, 25342, 338, 8758, 29898, 29893, 29892, 9657, 1125, 13, 9651, 285, 29889, 3539, 703, 741, 29876, 1159, 13, 9651, 2436, 29918, 8977, 29898, 29893, 29892, 285, 29892, 7700, 29897, 13, 9651, 285, 29889, 3539, 703, 1012, 29876, 1159, 13, 4706, 1683, 29901, 13, 9651, 285, 29889, 3539, 29898, 710, 29898, 29893, 7240, 26732, 29876, 1159, 13, 1678, 565, 1095, 29918, 1807, 29901, 13, 4706, 285, 29889, 3539, 29898, 355, 29918, 1807, 29897, 13, 1678, 565, 274, 29901, 13, 4706, 285, 29889, 5358, 580, 13, 13, 13, 1753, 6559, 29918, 21646, 29898, 303, 326, 14549, 29892, 285, 29892, 16345, 353, 9162, 613, 3802, 29918, 8256, 29918, 4951, 3276, 353, 5852, 1125, 13, 1678, 9995, 13, 1678, 14350, 263, 6559, 1051, 304, 263, 934, 29889, 13, 268, 13, 1678, 960, 278, 26256, 14999, 3618, 4502, 304, 278, 740, 1712, 2472, 297, 13, 1678, 1009, 4195, 5352, 29892, 769, 263, 2211, 29899, 4914, 1591, 338, 3971, 304, 285, 13, 1678, 313, 15550, 2602, 29892, 1734, 29892, 4195, 467, 960, 694, 4195, 2472, 338, 13, 1678, 5134, 29892, 769, 278, 4195, 1897, 338, 25811, 29889, 13, 268, 13, 1678, 12662, 2699, 29901, 13, 4706, 20436, 14549, 29901, 263, 1051, 310, 26256, 14999, 3618, 15783, 278, 6559, 1051, 29889, 13, 4706, 285, 29901, 278, 934, 304, 607, 304, 2436, 20436, 14549, 29936, 445, 508, 367, 263, 934, 6496, 363, 13, 9651, 5007, 29892, 263, 1347, 13330, 304, 385, 1294, 424, 934, 29892, 470, 263, 1347, 13330, 13, 9651, 304, 263, 304, 29899, 915, 29899, 11600, 934, 29889, 960, 285, 338, 263, 934, 29892, 5007, 8665, 29693, 13, 9651, 278, 934, 338, 5279, 2602, 287, 363, 5007, 29936, 565, 285, 338, 263, 1347, 13, 9651, 13330, 304, 385, 1294, 424, 934, 29892, 20436, 14549, 526, 3971, 304, 278, 1095, 29936, 322, 565, 13, 9651, 285, 338, 263, 304, 29899, 915, 29899, 11600, 934, 29892, 20436, 14549, 526, 3971, 297, 278, 934, 472, 278, 13, 9651, 2246, 29889, 13, 268, 13, 1678, 7670, 1742, 12662, 2699, 29901, 13, 4706, 16345, 29901, 1347, 972, 11427, 825, 2903, 1078, 278, 1819, 29936, 21274, 304, 9162, 1642, 13, 4706, 3802, 29918, 8256, 29918, 4951, 3276, 29901, 11185, 23941, 3692, 285, 881, 367, 5764, 13, 9651, 1434, 17140, 278, 740, 29936, 21274, 304, 5852, 29889, 13, 1678, 9995, 13, 1678, 285, 353, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29898, 29888, 29897, 13, 1678, 285, 29889, 3539, 703, 15550, 29918, 3283, 25641, 29879, 29913, 1742, 1642, 4830, 29898, 19570, 876, 13, 1678, 565, 20436, 14549, 29961, 29900, 1822, 16122, 29901, 13, 4706, 2436, 29918, 16122, 353, 5852, 13, 4706, 285, 29889, 3539, 703, 25641, 29879, 29913, 16122, 29905, 29876, 1642, 4830, 29898, 19570, 876, 13, 1678, 1683, 29901, 13, 4706, 2436, 29918, 16122, 353, 7700, 13, 4706, 285, 29889, 3539, 14182, 29876, 1159, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 303, 326, 14549, 22164, 13, 4706, 285, 29889, 3539, 703, 25641, 29881, 1157, 29901, 29879, 1157, 29901, 29879, 29913, 1642, 4830, 29898, 29875, 29974, 29896, 29892, 16345, 29892, 20436, 14549, 29961, 29875, 1822, 1742, 876, 13, 4706, 565, 2436, 29918, 16122, 29901, 13, 9651, 285, 29889, 3539, 703, 25641, 29879, 1157, 29901, 29879, 1012, 29876, 1642, 4830, 29898, 19570, 29892, 851, 29898, 303, 326, 14549, 29961, 29875, 1822, 16122, 4961, 13, 4706, 1683, 29901, 13, 9651, 285, 29889, 3539, 14182, 29876, 1159, 13, 1678, 565, 3802, 29918, 8256, 29918, 4951, 3276, 29901, 13, 4706, 285, 29889, 5358, 580, 13, 13, 13, 1753, 3300, 2859, 29918, 18082, 29891, 29898, 303, 326, 14549, 29892, 285, 29892, 16345, 353, 9162, 613, 3802, 29918, 8256, 29918, 4951, 3276, 353, 5852, 1125, 13, 1678, 9995, 13, 1678, 14350, 263, 3300, 2859, 6559, 1051, 304, 263, 934, 29889, 13, 268, 13, 1678, 960, 278, 10803, 20547, 3618, 4502, 304, 278, 740, 1712, 2472, 297, 13, 1678, 1009, 4195, 5352, 29892, 769, 263, 3023, 29899, 4914, 1591, 338, 3971, 304, 285, 13, 1678, 313, 15550, 2602, 29892, 274, 434, 29892, 3646, 29892, 4195, 467, 960, 694, 4195, 2472, 338, 13, 1678, 5134, 29892, 769, 278, 4195, 1897, 338, 25811, 29889, 13, 268, 13, 1678, 12662, 2699, 29901, 13, 4706, 20436, 14549, 29901, 263, 1051, 310, 10803, 20547, 3618, 15783, 278, 6559, 1051, 29889, 13, 4706, 285, 29901, 278, 934, 304, 607, 304, 2436, 20436, 14549, 29936, 445, 508, 367, 263, 934, 6496, 363, 13, 9651, 5007, 29892, 263, 1347, 13330, 304, 385, 1294, 424, 934, 29892, 470, 263, 1347, 13330, 13, 9651, 304, 263, 304, 29899, 915, 29899, 11600, 934, 29889, 960, 285, 338, 263, 934, 29892, 5007, 8665, 29693, 13, 9651, 278, 934, 338, 5279, 2602, 287, 363, 5007, 29936, 565, 285, 338, 263, 1347, 13, 9651, 13330, 304, 385, 1294, 424, 934, 29892, 20436, 14549, 526, 3971, 304, 278, 1095, 29936, 322, 565, 13, 9651, 285, 338, 263, 304, 29899, 915, 29899, 11600, 934, 29892, 20436, 14549, 526, 3971, 297, 278, 934, 472, 278, 13, 9651, 2246, 29889, 13, 268, 13, 1678, 7670, 1742, 12662, 2699, 29901, 13, 4706, 16345, 29901, 1347, 972, 11427, 825, 2903, 1078, 278, 1819, 29936, 21274, 304, 9162, 1642, 13, 4706, 3802, 29918, 8256, 29918, 4951, 3276, 29901, 11185, 23941, 3692, 285, 881, 367, 5764, 13, 9651, 1434, 17140, 278, 740, 29936, 21274, 304, 5852, 29889, 13, 1678, 9995, 13, 1678, 285, 353, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29898, 29888, 29897, 13, 1678, 285, 29889, 3539, 703, 15550, 29918, 3283, 17969, 19570, 13578, 18376, 17969, 19570, 13578, 5182, 1159, 13, 1678, 565, 20436, 14549, 29961, 29900, 1822, 16122, 29901, 13, 4706, 2436, 29918, 16122, 353, 5852, 13, 4706, 285, 29889, 3539, 29898, 19570, 13578, 16122, 29905, 29876, 1159, 13, 1678, 1683, 29901, 13, 4706, 2436, 29918, 16122, 353, 7700, 13, 4706, 285, 29889, 3539, 14182, 29876, 1159, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 303, 326, 14549, 22164, 13, 4706, 5101, 353, 20436, 14549, 29961, 29875, 29962, 13, 4706, 285, 29889, 3539, 29898, 710, 29898, 29875, 29974, 29896, 7240, 19570, 29974, 18784, 29889, 18376, 29974, 19570, 29974, 18784, 29889, 5182, 29897, 13, 4706, 565, 2436, 29918, 16122, 29901, 13, 9651, 285, 29889, 3539, 29898, 19570, 29974, 710, 29898, 18784, 29889, 16122, 7240, 26732, 29876, 1159, 13, 4706, 1683, 29901, 13, 9651, 285, 29889, 3539, 14182, 29876, 1159, 13, 1678, 565, 3802, 29918, 8256, 29918, 4951, 3276, 29901, 13, 4706, 285, 29889, 5358, 580, 13, 13, 13, 1753, 2723, 287, 29918, 3757, 497, 29918, 9902, 29898, 1742, 29918, 29886, 7121, 29892, 285, 29892, 16345, 353, 9162, 613, 3802, 29918, 8256, 29918, 4951, 3276, 353, 5852, 1125, 13, 1678, 9995, 13, 1678, 14350, 278, 2582, 310, 263, 2723, 287, 29899, 3757, 497, 1243, 304, 263, 934, 29889, 13, 268, 13, 1678, 960, 278, 10803, 20547, 3618, 4502, 304, 278, 740, 1712, 2472, 297, 13, 1678, 1009, 4195, 5352, 29892, 769, 263, 5320, 29899, 4914, 1591, 338, 3971, 304, 285, 13, 1678, 313, 1688, 2602, 29892, 274, 434, 29892, 3646, 29892, 2933, 29892, 4195, 467, 960, 694, 4195, 13, 1678, 2472, 338, 5134, 29892, 769, 278, 4195, 1897, 338, 25811, 29889, 13, 268, 13, 1678, 12662, 2699, 29901, 13, 539, 1734, 29918, 29886, 7121, 29901, 278, 10803, 20547, 3618, 304, 2436, 29889, 13, 4706, 285, 29901, 278, 934, 304, 607, 304, 2436, 20436, 14549, 29936, 445, 508, 367, 263, 934, 6496, 363, 13, 9651, 5007, 29892, 263, 1347, 13330, 304, 385, 1294, 424, 934, 29892, 470, 263, 1347, 13330, 13, 9651, 304, 263, 304, 29899, 915, 29899, 11600, 934, 29889, 960, 285, 338, 263, 934, 29892, 5007, 8665, 29693, 13, 9651, 278, 934, 338, 5279, 2602, 287, 363, 5007, 29936, 565, 285, 338, 263, 1347, 13, 9651, 13330, 304, 385, 1294, 424, 934, 29892, 20436, 14549, 526, 3971, 304, 278, 1095, 29936, 322, 565, 13, 9651, 285, 338, 263, 304, 29899, 915, 29899, 11600, 934, 29892, 20436, 14549, 526, 3971, 297, 278, 934, 472, 278, 13, 9651, 2246, 29889, 13, 268, 13, 1678, 7670, 1742, 12662, 2699, 29901, 13, 4706, 16345, 29901, 1347, 972, 11427, 825, 2903, 1078, 278, 1819, 29936, 21274, 304, 9162, 1642, 13, 4706, 3802, 29918, 8256, 29918, 4951, 3276, 29901, 11185, 23941, 3692, 285, 881, 367, 5764, 13, 9651, 1434, 17140, 278, 740, 29936, 21274, 304, 5852, 29889, 13, 1678, 9995, 13, 1678, 285, 353, 7960, 29918, 1445, 29918, 1454, 29918, 16554, 29898, 29888, 29897, 13, 1678, 285, 29889, 3539, 703, 1688, 29918, 3283, 17969, 19570, 13578, 18376, 17969, 19570, 13578, 5182, 17969, 19570, 13578, 5327, 1159, 13, 1678, 565, 1734, 29918, 29886, 7121, 29961, 29900, 1822, 16122, 29901, 13, 4706, 2436, 29918, 16122, 353, 5852, 13, 4706, 285, 29889, 3539, 29898, 19570, 13578, 16122, 17969, 19570, 13578, 29905, 29876, 1159, 13, 1678, 1683, 29901, 13, 4706, 2436, 29918, 16122, 353, 7700, 13, 4706, 285, 29889, 3539, 14182, 29876, 1159, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 1742, 29918, 29886, 7121, 22164, 13, 4706, 5101, 353, 1734, 29918, 29886, 7121, 29961, 29875, 29962, 13, 4706, 285, 29889, 3539, 29898, 710, 29898, 29875, 29974, 29896, 7240, 19570, 29974, 18784, 29889, 18376, 29974, 19570, 29974, 18784, 29889, 5182, 29974, 19570, 29974, 18784, 29889, 5327, 29897, 13, 4706, 565, 2436, 29918, 16122, 29901, 13, 9651, 285, 29889, 3539, 29898, 19570, 29974, 710, 29898, 18784, 29889, 16122, 7240, 26732, 29876, 1159, 13, 4706, 1683, 29901, 13, 9651, 285, 29889, 3539, 14182, 29876, 1159, 13, 1678, 565, 3802, 29918, 8256, 29918, 4951, 3276, 29901, 13, 4706, 285, 29889, 5358, 580, 13, 2 ]
interview-preparation-kit/minimum-time-required.py
gajubadge11/HackerRank-1
340
117103
<filename>interview-preparation-kit/minimum-time-required.py #!/bin/python3 import math import os import random import re import sys from collections import Counter def calculate_days(day, cnt): res = 0 for el in cnt.items(): res += el[1] * (day // el[0]) return res # Complete the minTime function below. def minTime(machines, goal): cnt = Counter(machines) day_limit = 10**13 curgoal = 0 curday = 0 res = 0 prev_big = day_limit prev_low = 0 curday = day_limit // 2 while True: # detect if we are bouncing around in a loop if curday == prev_big or curday == prev_low: #print("curday = {} prev_low = {} prev_big = {}".format(curday, prev_low, prev_big)) prev_low_res = calculate_days(prev_low, cnt) prev_big_res = calculate_days(prev_big, cnt) if prev_low_res >= goal: return prev_low else: return prev_big curgoal = calculate_days(curday, cnt) if curgoal < goal: prev_low = curday #print("micro curday = {} curgoal = {} < {}, diff = {}".format(curday, curgoal, goal, abs(curgoal - goal))) curday = curday + (1 + day_limit - curday)//2 res = curday else: #print("micro curday = {} curgoal = {} > {}, diff = {}".format(curday, curgoal, goal, abs(curgoal - goal))) prev_big = curday day_limit = curday curday = curday // 2 res = curday return res if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') nGoal = input().split() n = int(nGoal[0]) goal = int(nGoal[1]) machines = list(map(int, input().rstrip().split())) ans = minTime(machines, goal) fptr.write(str(ans) + '\n') fptr.close()
[ 1, 529, 9507, 29958, 1639, 1493, 29899, 1457, 862, 362, 29899, 7354, 29914, 1195, 12539, 29899, 2230, 29899, 12403, 29889, 2272, 13, 29937, 14708, 2109, 29914, 4691, 29941, 13, 13, 5215, 5844, 13, 5215, 2897, 13, 5215, 4036, 13, 5215, 337, 13, 5215, 10876, 13, 3166, 16250, 1053, 315, 5336, 13, 13, 1753, 8147, 29918, 16700, 29898, 3250, 29892, 274, 593, 1125, 13, 1678, 620, 353, 29871, 29900, 13, 13, 1678, 363, 560, 297, 274, 593, 29889, 7076, 7295, 13, 4706, 620, 4619, 560, 29961, 29896, 29962, 334, 313, 3250, 849, 560, 29961, 29900, 2314, 13, 13, 1678, 736, 620, 13, 13, 13, 29937, 25034, 278, 1375, 2481, 740, 2400, 29889, 13, 1753, 1375, 2481, 29898, 29885, 496, 1475, 29892, 7306, 1125, 13, 1678, 274, 593, 353, 315, 5336, 29898, 29885, 496, 1475, 29897, 13, 1678, 2462, 29918, 13400, 353, 29871, 29896, 29900, 1068, 29896, 29941, 13, 1678, 3151, 28111, 353, 29871, 29900, 13, 1678, 3151, 3250, 353, 29871, 29900, 13, 1678, 620, 353, 29871, 29900, 13, 1678, 12379, 29918, 3752, 353, 2462, 29918, 13400, 13, 1678, 12379, 29918, 677, 353, 29871, 29900, 13, 13, 1678, 3151, 3250, 353, 2462, 29918, 13400, 849, 29871, 29906, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 396, 6459, 565, 591, 526, 289, 1309, 3277, 2820, 297, 263, 2425, 13, 4706, 565, 3151, 3250, 1275, 12379, 29918, 3752, 470, 3151, 3250, 1275, 12379, 29918, 677, 29901, 13, 9651, 396, 2158, 703, 2764, 3250, 353, 6571, 12379, 29918, 677, 353, 6571, 12379, 29918, 3752, 353, 6571, 1642, 4830, 29898, 2764, 3250, 29892, 12379, 29918, 677, 29892, 12379, 29918, 3752, 876, 13, 9651, 12379, 29918, 677, 29918, 690, 353, 8147, 29918, 16700, 29898, 16304, 29918, 677, 29892, 274, 593, 29897, 13, 9651, 12379, 29918, 3752, 29918, 690, 353, 8147, 29918, 16700, 29898, 16304, 29918, 3752, 29892, 274, 593, 29897, 13, 9651, 565, 12379, 29918, 677, 29918, 690, 6736, 7306, 29901, 13, 18884, 736, 12379, 29918, 677, 13, 9651, 1683, 29901, 13, 18884, 736, 12379, 29918, 3752, 13, 13, 4706, 3151, 28111, 353, 8147, 29918, 16700, 29898, 2764, 3250, 29892, 274, 593, 29897, 13, 13, 4706, 565, 3151, 28111, 529, 7306, 29901, 13, 9651, 12379, 29918, 677, 353, 3151, 3250, 13, 9651, 396, 2158, 703, 29885, 2357, 3151, 3250, 353, 6571, 3151, 28111, 353, 6571, 529, 24335, 2923, 353, 6571, 1642, 4830, 29898, 2764, 3250, 29892, 3151, 28111, 29892, 7306, 29892, 6425, 29898, 2764, 28111, 448, 7306, 4961, 13, 9651, 3151, 3250, 353, 3151, 3250, 718, 313, 29896, 718, 2462, 29918, 13400, 448, 3151, 3250, 29897, 458, 29906, 13, 9651, 620, 353, 3151, 3250, 13, 4706, 1683, 29901, 13, 9651, 396, 2158, 703, 29885, 2357, 3151, 3250, 353, 6571, 3151, 28111, 353, 6571, 1405, 24335, 2923, 353, 6571, 1642, 4830, 29898, 2764, 3250, 29892, 3151, 28111, 29892, 7306, 29892, 6425, 29898, 2764, 28111, 448, 7306, 4961, 13, 9651, 12379, 29918, 3752, 353, 3151, 3250, 13, 9651, 2462, 29918, 13400, 353, 3151, 3250, 13, 9651, 3151, 3250, 353, 3151, 3250, 849, 29871, 29906, 13, 9651, 620, 353, 3151, 3250, 13, 13, 1678, 736, 620, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 285, 7414, 353, 1722, 29898, 359, 29889, 21813, 1839, 12015, 12336, 29918, 10145, 7464, 525, 29893, 1495, 13, 13, 1678, 302, 8120, 284, 353, 1881, 2141, 5451, 580, 13, 13, 1678, 302, 353, 938, 29898, 29876, 8120, 284, 29961, 29900, 2314, 13, 13, 1678, 7306, 353, 938, 29898, 29876, 8120, 284, 29961, 29896, 2314, 13, 13, 1678, 14884, 353, 1051, 29898, 1958, 29898, 524, 29892, 1881, 2141, 29878, 17010, 2141, 5451, 22130, 13, 13, 1678, 6063, 353, 1375, 2481, 29898, 29885, 496, 1475, 29892, 7306, 29897, 13, 13, 1678, 285, 7414, 29889, 3539, 29898, 710, 29898, 550, 29897, 718, 11297, 29876, 1495, 13, 13, 1678, 285, 7414, 29889, 5358, 580, 13, 2 ]
tarea2c/mod/game_over.py
camilo-nb/CC3501-tareas
0
29869
<gh_stars>0 import os from collections import deque import numpy as np from OpenGL.GL import * import lib.basic_shapes as bs import lib.easy_shaders as es import lib.transformations as tr class GameOver: def __init__(self): self.GPU = deque([ es.toGPUShape(bs.createTextureCube(os.path.join('mod', 'tex', 'game_over_1.png')), GL_REPEAT, GL_NEAREST), es.toGPUShape(bs.createTextureCube(os.path.join('mod', 'tex', 'game_over_2.png')), GL_REPEAT, GL_NEAREST), es.toGPUShape(bs.createTextureCube(os.path.join('mod', 'tex', 'game_over_3.png')), GL_REPEAT, GL_NEAREST), es.toGPUShape(bs.createTextureCube(os.path.join('mod', 'tex', 'game_over_4.png')), GL_REPEAT, GL_NEAREST) ]) self.x, self.y, self.z = 0, 310, 100 self.phi = 0 self.tick = 0 self.s = 10 self.transform = tr.matmul([tr.translate(self.x, self.y, self.z), tr.scale(self.s, self.s, 0.0001)]) def draw(self, pipeline, projection, view): glUseProgram(pipeline.shaderProgram) glUniformMatrix4fv(glGetUniformLocation(pipeline.shaderProgram, "model"), 1, GL_TRUE, self.transform) glUniformMatrix4fv(glGetUniformLocation(pipeline.shaderProgram, "projection"), 1, GL_TRUE, projection) glUniformMatrix4fv(glGetUniformLocation(pipeline.shaderProgram, "view"), 1, GL_TRUE, view) pipeline.drawShape(self.GPU[0]) def update(self): self.GPU.append(self.GPU.popleft()) self.tick -= 0.1 * np.exp(self.tick/10) self.phi = np.exp(self.tick) self.transform = tr.matmul([tr.translate(self.x, self.y, self.z), tr.rotationX(2 * self.phi), tr.rotationZ(self.phi), tr.scale(self.s, self.s, 0.0001)])
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 3166, 16250, 1053, 316, 802, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 29508, 29889, 7239, 1053, 334, 13, 13, 5215, 4303, 29889, 16121, 29918, 845, 11603, 408, 24512, 13, 5215, 4303, 29889, 29872, 8995, 29918, 845, 24574, 408, 831, 13, 5215, 4303, 29889, 9067, 800, 408, 534, 13, 13, 1990, 8448, 3563, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 29954, 7056, 353, 316, 802, 4197, 13, 9651, 831, 29889, 517, 19903, 3308, 14443, 29898, 5824, 29889, 3258, 21898, 29907, 4003, 29898, 359, 29889, 2084, 29889, 7122, 877, 1545, 742, 525, 4776, 742, 525, 11802, 29918, 957, 29918, 29896, 29889, 2732, 1495, 511, 12729, 29918, 1525, 4162, 1299, 29892, 12729, 29918, 8186, 29909, 1525, 1254, 511, 13, 9651, 831, 29889, 517, 19903, 3308, 14443, 29898, 5824, 29889, 3258, 21898, 29907, 4003, 29898, 359, 29889, 2084, 29889, 7122, 877, 1545, 742, 525, 4776, 742, 525, 11802, 29918, 957, 29918, 29906, 29889, 2732, 1495, 511, 12729, 29918, 1525, 4162, 1299, 29892, 12729, 29918, 8186, 29909, 1525, 1254, 511, 13, 9651, 831, 29889, 517, 19903, 3308, 14443, 29898, 5824, 29889, 3258, 21898, 29907, 4003, 29898, 359, 29889, 2084, 29889, 7122, 877, 1545, 742, 525, 4776, 742, 525, 11802, 29918, 957, 29918, 29941, 29889, 2732, 1495, 511, 12729, 29918, 1525, 4162, 1299, 29892, 12729, 29918, 8186, 29909, 1525, 1254, 511, 13, 9651, 831, 29889, 517, 19903, 3308, 14443, 29898, 5824, 29889, 3258, 21898, 29907, 4003, 29898, 359, 29889, 2084, 29889, 7122, 877, 1545, 742, 525, 4776, 742, 525, 11802, 29918, 957, 29918, 29946, 29889, 2732, 1495, 511, 12729, 29918, 1525, 4162, 1299, 29892, 12729, 29918, 8186, 29909, 1525, 1254, 29897, 13, 308, 2314, 13, 4706, 1583, 29889, 29916, 29892, 1583, 29889, 29891, 29892, 1583, 29889, 29920, 353, 29871, 29900, 29892, 29871, 29941, 29896, 29900, 29892, 29871, 29896, 29900, 29900, 13, 4706, 1583, 29889, 2876, 353, 29871, 29900, 13, 4706, 1583, 29889, 24667, 353, 29871, 29900, 13, 4706, 1583, 29889, 29879, 353, 29871, 29896, 29900, 13, 4706, 1583, 29889, 9067, 353, 534, 29889, 2922, 16109, 4197, 509, 29889, 21652, 29898, 1311, 29889, 29916, 29892, 1583, 29889, 29891, 29892, 1583, 29889, 29920, 511, 534, 29889, 7052, 29898, 1311, 29889, 29879, 29892, 1583, 29889, 29879, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29896, 29897, 2314, 13, 308, 13, 1678, 822, 4216, 29898, 1311, 29892, 16439, 29892, 18246, 29892, 1776, 1125, 13, 4706, 3144, 11403, 9283, 29898, 13096, 5570, 29889, 845, 1664, 9283, 29897, 13, 4706, 3144, 2525, 5560, 14609, 29946, 29888, 29894, 29898, 3820, 2577, 2525, 5560, 6508, 29898, 13096, 5570, 29889, 845, 1664, 9283, 29892, 376, 4299, 4968, 29871, 29896, 29892, 12729, 29918, 20652, 29892, 1583, 29889, 9067, 29897, 13, 4706, 3144, 2525, 5560, 14609, 29946, 29888, 29894, 29898, 3820, 2577, 2525, 5560, 6508, 29898, 13096, 5570, 29889, 845, 1664, 9283, 29892, 376, 771, 6929, 4968, 29871, 29896, 29892, 12729, 29918, 20652, 29892, 18246, 29897, 13, 4706, 3144, 2525, 5560, 14609, 29946, 29888, 29894, 29898, 3820, 2577, 2525, 5560, 6508, 29898, 13096, 5570, 29889, 845, 1664, 9283, 29892, 376, 1493, 4968, 29871, 29896, 29892, 12729, 29918, 20652, 29892, 1776, 29897, 13, 4706, 16439, 29889, 4012, 24111, 29898, 1311, 29889, 29954, 7056, 29961, 29900, 2314, 13, 268, 13, 1678, 822, 2767, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29954, 7056, 29889, 4397, 29898, 1311, 29889, 29954, 7056, 29889, 7323, 1563, 3101, 13, 4706, 1583, 29889, 24667, 22361, 29871, 29900, 29889, 29896, 334, 7442, 29889, 4548, 29898, 1311, 29889, 24667, 29914, 29896, 29900, 29897, 13, 4706, 1583, 29889, 2876, 353, 7442, 29889, 4548, 29898, 1311, 29889, 24667, 29897, 13, 4706, 1583, 29889, 9067, 353, 534, 29889, 2922, 16109, 4197, 509, 29889, 21652, 29898, 1311, 29889, 29916, 29892, 1583, 29889, 29891, 29892, 1583, 29889, 29920, 511, 534, 29889, 5450, 362, 29990, 29898, 29906, 334, 1583, 29889, 2876, 511, 534, 29889, 5450, 362, 29999, 29898, 1311, 29889, 2876, 511, 29871, 534, 29889, 7052, 29898, 1311, 29889, 29879, 29892, 1583, 29889, 29879, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29896, 29897, 2314, 13, 2 ]
echr/steps/prepare_database.py
nlopuszynska/ECHR-OD_process
20
85441
import argparse import json import os from os import listdir from os.path import isfile import shutil from genson import SchemaBuilder from enum import Enum import copy import flatdict import pandas as pd import numpy as np from collections import OrderedDict from functools import reduce # forward compatibility for Python 3 import operator import sys from echr.utils.folders import make_build_folder from echr.utils.cli import TAB from echr.utils.logger import getlogger from rich.markdown import Markdown from rich.console import Console log = getlogger() __console = Console(record=True) DELIMITER = '.' type_priority = OrderedDict([ ('number', float), ('integer', int), ('string', str) ]) class COL_HINT(str, Enum): HOT_ONE = 'hot_one' POSITIONAL = 'positional' def format_structured_json(cases_list): res = [] representents = {} extractedapp = {} scl = {} decision_body = {} for name in cases_list: with open(name, 'r') as f: c = json.load(f) c['representedby'] = [r for r in c['representedby'] if r != 'N/A'] representents[c['appno']] = {'representedby': c['representedby']} extractedapp[c['appno']] = {'appnos': c['extractedappno']} decision_body[c['appno']] = { 'name': [e['name'] for e in c['decision_body']], 'role': {e['name']: e['role'] for e in c['decision_body'] if 'role' in e} } scl[c['appno']] = {'scl': c['scl']} c['respondent'] = c['respondent'].split(';') # c['applicability'] = c['applicability'].strip().split(';') c['appno'] = c['appno'].split(';')[0] c['decisiondate'] = c['decisiondate'].split(' ')[0] c['judgementdate'] = c['judgementdate'].split(' ')[0] c['introductiondate'] = c['introductiondate'].split(' ')[0] c['kpdate'] = c['kpdate'].split(' ')[0] c['separateopinion'] = True if c['separateopinion'] == 'TRUE' else False del c['representedby'] del c['extractedappno'] del c['decision_body'] del c['scl'] del c['documents'] del c['content'] del c['externalsources'] del c['kpthesaurus'] del c['__conclusion'] del c['__articles'] if not len(c['issue']): del c['issue'] else: c['issue'] = sorted(c['issue']) if not len(c['applicability']): del c['applicability'] res.append(c) return res, representents, extractedapp, scl, decision_body def get_by_path(root, items): return reduce(operator.getitem, items, root) def set_by_path(root, items, value): get_by_path(root, items[:-1])[items[-1]] = value def determine_schema(X): builder = SchemaBuilder() for x in X: builder.add_object(x) schema = builder return schema def get_flat_type_mapping(flat_schema): flat_type_mapping = {} for k in flat_schema.keys(): if k.endswith(DELIMITER + 'type'): key = k.replace('properties' + DELIMITER, '').replace(DELIMITER + 'type', '') flat_type_mapping[key] = flat_schema[k] return flat_type_mapping def get_flat_domain_mapping(X, flat_type_mapping): flat_domain_mapping = {} for x in X: flat = flatdict.FlatterDict(x, delimiter='.') for k in flat_type_mapping.keys(): v = flat.get(k) if v is not None: if k not in flat_domain_mapping: flat_domain_mapping[k] = set() type_ = flat_type_mapping[k] try: if type_ == 'array': flat_domain_mapping[k].update(get_by_path(x, k.split('.'))) else: flat_domain_mapping[k].add(get_by_path(x, k.split('.'))) except: if not flat_domain_mapping[k]: del flat_domain_mapping[k] for k in flat_domain_mapping: flat_domain_mapping[k] = list(flat_domain_mapping[k]) return flat_domain_mapping def flatten_dataset(X, flat_type_mapping, schema_hints=None): if schema_hints is None: schema_hints = {} flat_X = [] for x in X: flat = flatdict.FlatterDict(x, delimiter=DELIMITER) c_x = copy.deepcopy(x) for k in flat_type_mapping.keys(): col_type = schema_hints.get(k, {}).get('col_type') if col_type not in [None, COL_HINT.POSITIONAL]: continue v = flat.get(k) if v is not None: sort = schema_hints.get(k, {}).get('sort', False) if sort: type_ = flat_type_mapping[k] if type_ == 'array': item_types = flat_type_mapping.get(k + '.items') a = get_by_path(c_x, k.split('.')) if isinstance(item_types, list): try: a = sorted(a) except: print('# Warning: mix-type array with types: {}'.format(', '.join(item_types))) print('# Warning; no comparison operator provided. Try to assess the proper cast...') for t in type_priority: try: a = list(map(type_priority[t], a)) print('# Casting \'{}\' to {}'.format(k, t)) break except: log.error('Could not cast \'{}\' to {}'.format(k, t)) else: print('# Error: Could not find any way to sort {}'.format(k)) raise Exception('Could not find any way to sort {}'.format(k)) set_by_path(c_x, k.split('.'), sorted(a)) flat = flatdict.FlatterDict(c_x, delimiter=DELIMITER) flat_X.append(flat) return flat_X def hot_one_encoder_on_list(df, column): v = [x if isinstance(x, list) else [] for x in df[column].values] l = [len(x) for x in v] f, u = pd.factorize(np.concatenate(v)) n, m = len(v), u.size i = np.arange(n).repeat(l) dummies = pd.DataFrame( np.bincount(i * m + f, minlength=n * m).reshape(n, m), df.index, map(lambda x: str(column) + '=' + str(x), u) ) return df.drop(column, 1).join(dummies) def normalize(X, schema_hints=None): if schema_hints is None: schema_hints = {} def hot_one_encoder(df, columns): return pd.get_dummies(df, prefix_sep="=", columns=columns) schema = determine_schema(X) flat_schema = flatdict.FlatDict(schema.to_schema(), delimiter=DELIMITER) flat_type_mapping = get_flat_type_mapping(flat_schema) flat_domain_mapping = get_flat_domain_mapping(X, flat_type_mapping) flat_X = flatten_dataset(X, flat_type_mapping, schema_hints) columns_to_encode = [k for k, v in schema_hints.items() if v['col_type'] == COL_HINT.HOT_ONE] df = pd.DataFrame(flat_X) for c in df.columns: f = next((k for k in columns_to_encode if c.startswith(k)), None) if f: df = df.drop(c, 1) encoded = [] for c in columns_to_encode: type_ = flat_type_mapping[c] if type_ == 'array': if c == 'conclusion': articles = set() for x in X: for e in x[c]: if 'article' in e: articles.add(e['article']) articles = sorted(articles) df2 = [] for x in X: e = [] xart = {v['article']: v['type'] for v in x['conclusion'] if 'article' in v} for a in articles: v = 0 if a in xart: if xart[a] == 'violation': v = 1 else: v = -1 e.append(v) df2.append(e) df2 = pd.DataFrame(df2, columns=list(map(lambda x: 'ccl_article={}'.format(x), articles))) encoded.append(df2) else: df2 = pd.DataFrame(X)[[c]] e = hot_one_encoder_on_list(df2, c) encoded.append(e) else: df2 = pd.DataFrame(X)[c] e = hot_one_encoder(df2, [c]) encoded.append(e) df = pd.concat([df] + encoded, axis=1) return df, schema, flat_schema, flat_type_mapping, flat_domain_mapping def run(console, build, title, output_prefix='cases', force=False): __console = console global print print = __console.print print(Markdown("- **Step configuration**")) print(TAB + "> Prepare release folder structure") paths = ['unstructured', 'structured', 'raw'] for p in paths: make_build_folder(console, os.path.join(build, p), force, strict=False) print(Markdown("- **Normalize database**")) input_folder = os.path.join(build, 'raw', 'preprocessed_documents') cases_files = [os.path.join(input_folder, f) for f in listdir(input_folder) if isfile(os.path.join(input_folder, f)) and '.json' in f] print(TAB + "> Prepare unstructured cases [green][DONE]") # Unstructured with open(os.path.join(build, 'unstructured', 'cases.json'), 'w') as outfile: outfile.write('[\n') for i, f in enumerate(cases_files): with open(f) as json_file: data = json.load(json_file) json.dump(data, outfile, indent=4) if i != len(cases_files) - 1: outfile.write(',\n') outfile.write('\n]') # Structured print(TAB + "> Generate flat cases [green][DONE]") flat_cases , representatives, extractedapp, scl, decision_body = format_structured_json(cases_files) print(TAB + "> Flat cases size: {}MiB".format(sys.getsizeof(flat_cases) / 1000)) schema_hints = { 'article': { 'col_type': COL_HINT.HOT_ONE }, 'documentcollectionid': { 'col_type': COL_HINT.HOT_ONE }, 'applicability': { 'col_type': COL_HINT.HOT_ONE }, 'paragraphs': { 'col_type': COL_HINT.HOT_ONE }, 'conclusion': { 'col_type': COL_HINT.HOT_ONE, 'sub_element': 'flatten' } } output_path = os.path.join(build, 'structured') with open(os.path.join(output_path, 'flat_cases.json'), 'w') as outfile: json.dump(flat_cases, outfile, indent=4) with open(os.path.join(output_path, 'schema_hint.json'), 'w') as outfile: json.dump(schema_hints, outfile, indent=4) X = flat_cases df, schema, flat_schema, flat_type_mapping, flat_domain_mapping = normalize(X, schema_hints) df.to_json(os.path.join(output_path, '{}.json'.format(output_prefix)), orient='records') df.to_csv(os.path.join(output_path, '{}.csv'.format(output_prefix))) json_files = [ ('schema', schema.to_schema()), ('flat_schema', flat_schema.as_dict()), ('flat_type_mapping', flat_type_mapping), ('flat_domain_mapping', flat_domain_mapping) ] for f in json_files: with open(os.path.join(output_path, '{}_{}.json'.format(output_prefix, f[0])), 'w') as outfile: json.dump(f[1], outfile, indent=4) os.remove(os.path.join(output_path, 'flat_cases.json')) os.remove(os.path.join(output_path, 'cases_flat_schema.json')) os.remove(os.path.join(output_path, 'cases_flat_type_mapping.json')) print(TAB + '> Generate appnos matrice [green][DONE]') matrice_appnos = {} for k, v in extractedapp.items(): matrice_appnos[k] = {e:1 for e in v['appnos']} with open(os.path.join(output_path, 'matrice_appnos.json'), 'w') as outfile: json.dump(matrice_appnos, outfile, indent=4) print(TAB + '> Generate scl matrice [green][DONE]') matrice_scl = {} for k, v in scl.items(): matrice_scl[k] = {e: 1 for e in v['scl']} with open(os.path.join(output_path, 'matrice_scl.json'), 'w') as outfile: json.dump(matrice_scl, outfile, indent=4) print(TAB + '> Generate representatives matrice [green][DONE]') matrice_representedby = {} for k, v in representatives.items(): matrice_representedby[k] = {e: 1 for e in v['representedby']} with open(os.path.join(output_path, 'matrice_representatives.json'), 'w') as outfile: json.dump(matrice_representedby, outfile, indent=4) print(TAB + '> Generate decision body matrice [green][DONE]') matrice_decision_body = {} for k, v in decision_body.items(): matrice_decision_body[k] = {k:v for k,v in v['role'].items()} with open(os.path.join(output_path, 'matrice_decision_body.json'), 'w') as outfile: json.dump(matrice_decision_body, outfile, indent=4) print(TAB + '> Create archives [green][DONE]') # Raw shutil.make_archive(os.path.join(build, 'raw', 'judgments'), 'zip', os.path.join(build, 'raw', 'judgments')) # All from zipfile import ZipFile with ZipFile(os.path.join(build, 'all.zip'), 'w') as zipObj: # Iterate over all the files in directory folders = ['unstructured', 'raw', 'structured'] for f in folders: for folderName, _, filenames in os.walk(os.path.join(build, f)): for filename in filenames: if not filename.endswith('.zip'): filePath = os.path.join(folderName, filename) zipObj.write(filePath) def main(args): console = Console(record=True) run(console, build=args.build, title=args.title, force=args.f) def parse_args(parser): args = parser.parse_args() # Check path return args if __name__ == "__main__": parser = argparse.ArgumentParser(description='Normalize any databse of arbitrarily nested documents.') parser.add_argument('--build', type=str, default="./build/echr_database/") parser.add_argument('--title', type=str) parser.add_argument('--schema_hints', type=str) parser.add_argument('--output_prefix', type=str) parser.add_argument('-f', action='store_true') parser.add_argument('-u', action='store_true') args = parse_args(parser) main(args)
[ 1, 1053, 1852, 5510, 13, 5215, 4390, 13, 5215, 2897, 13, 3166, 2897, 1053, 1051, 3972, 13, 3166, 2897, 29889, 2084, 1053, 338, 1445, 13, 5215, 528, 4422, 13, 3166, 330, 25151, 1053, 1102, 2603, 5627, 13, 3166, 14115, 1053, 1174, 398, 13, 5215, 3509, 13, 5215, 12151, 8977, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 2090, 312, 8789, 1053, 10032, 29871, 396, 6375, 24521, 363, 5132, 29871, 29941, 13, 5215, 5455, 13, 5215, 10876, 13, 13, 3166, 321, 22495, 29889, 13239, 29889, 8771, 414, 1053, 1207, 29918, 4282, 29918, 12083, 13, 3166, 321, 22495, 29889, 13239, 29889, 11303, 1053, 323, 2882, 13, 3166, 321, 22495, 29889, 13239, 29889, 21707, 1053, 679, 21707, 13, 3166, 8261, 29889, 3502, 3204, 1053, 4485, 3204, 13, 3166, 8261, 29889, 11058, 1053, 9405, 13, 13, 1188, 353, 679, 21707, 580, 13, 13, 1649, 11058, 353, 9405, 29898, 11651, 29922, 5574, 29897, 13, 13, 2287, 5265, 26349, 1001, 353, 525, 6169, 13, 13, 1853, 29918, 29886, 21766, 353, 8170, 287, 21533, 4197, 13, 1678, 6702, 4537, 742, 5785, 511, 13, 1678, 6702, 16031, 742, 938, 511, 13, 1678, 6702, 1807, 742, 851, 29897, 13, 2314, 13, 13, 13, 1990, 23958, 29918, 29950, 10192, 29898, 710, 29892, 1174, 398, 1125, 13, 1678, 379, 2891, 29918, 12413, 353, 525, 8711, 29918, 650, 29915, 13, 1678, 349, 3267, 22122, 1964, 353, 525, 1066, 3245, 29915, 13, 13, 13, 1753, 3402, 29918, 4984, 2955, 29918, 3126, 29898, 11436, 29918, 1761, 1125, 13, 1678, 620, 353, 5159, 13, 1678, 2755, 1237, 353, 6571, 13, 1678, 23892, 932, 353, 6571, 13, 1678, 269, 695, 353, 6571, 13, 1678, 10608, 29918, 2587, 353, 6571, 13, 1678, 363, 1024, 297, 4251, 29918, 1761, 29901, 13, 4706, 411, 1722, 29898, 978, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 9651, 274, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 4706, 274, 1839, 276, 6338, 287, 1609, 2033, 353, 518, 29878, 363, 364, 297, 274, 1839, 276, 6338, 287, 1609, 2033, 565, 364, 2804, 525, 29940, 29914, 29909, 2033, 13, 4706, 2755, 1237, 29961, 29883, 1839, 932, 1217, 2033, 29962, 353, 11117, 276, 6338, 287, 1609, 2396, 274, 1839, 276, 6338, 287, 1609, 2033, 29913, 13, 4706, 23892, 932, 29961, 29883, 1839, 932, 1217, 2033, 29962, 353, 11117, 932, 17639, 2396, 274, 1839, 21111, 287, 932, 1217, 2033, 29913, 13, 4706, 10608, 29918, 2587, 29961, 29883, 1839, 932, 1217, 2033, 29962, 353, 426, 13, 9651, 525, 978, 2396, 518, 29872, 1839, 978, 2033, 363, 321, 297, 274, 1839, 7099, 2459, 29918, 2587, 2033, 1402, 13, 9651, 525, 12154, 2396, 426, 29872, 1839, 978, 2033, 29901, 321, 1839, 12154, 2033, 363, 321, 297, 274, 1839, 7099, 2459, 29918, 2587, 2033, 565, 525, 12154, 29915, 297, 321, 29913, 13, 4706, 500, 13, 4706, 269, 695, 29961, 29883, 1839, 932, 1217, 2033, 29962, 353, 11117, 29879, 695, 2396, 274, 1839, 29879, 695, 2033, 29913, 13, 13, 4706, 274, 1839, 3636, 296, 2033, 353, 274, 1839, 3636, 296, 13359, 5451, 877, 29936, 1495, 29871, 396, 13, 4706, 274, 1839, 932, 506, 3097, 2033, 353, 274, 1839, 932, 506, 3097, 13359, 17010, 2141, 5451, 877, 29936, 1495, 13, 4706, 274, 1839, 932, 1217, 2033, 353, 274, 1839, 932, 1217, 13359, 5451, 877, 29936, 29861, 29900, 29962, 13, 4706, 274, 1839, 7099, 2459, 1256, 2033, 353, 274, 1839, 7099, 2459, 1256, 13359, 5451, 877, 525, 9601, 29900, 29962, 13, 4706, 274, 1839, 17675, 29887, 882, 1256, 2033, 353, 274, 1839, 17675, 29887, 882, 1256, 13359, 5451, 877, 525, 9601, 29900, 29962, 13, 4706, 274, 1839, 524, 13210, 1256, 2033, 353, 274, 1839, 524, 13210, 1256, 13359, 5451, 877, 525, 9601, 29900, 29962, 13, 4706, 274, 1839, 29895, 29886, 1256, 2033, 353, 274, 1839, 29895, 29886, 1256, 13359, 5451, 877, 525, 9601, 29900, 29962, 13, 4706, 274, 1839, 25048, 403, 459, 262, 291, 2033, 353, 5852, 565, 274, 1839, 25048, 403, 459, 262, 291, 2033, 1275, 525, 20652, 29915, 1683, 7700, 13, 13, 4706, 628, 274, 1839, 276, 6338, 287, 1609, 2033, 13, 4706, 628, 274, 1839, 21111, 287, 932, 1217, 2033, 13, 4706, 628, 274, 1839, 7099, 2459, 29918, 2587, 2033, 13, 4706, 628, 274, 1839, 29879, 695, 2033, 13, 4706, 628, 274, 1839, 3225, 29879, 2033, 13, 4706, 628, 274, 1839, 3051, 2033, 13, 4706, 628, 274, 1839, 735, 725, 1338, 2863, 2033, 13, 4706, 628, 274, 1839, 29895, 29886, 26041, 6698, 375, 2033, 13, 4706, 628, 274, 1839, 1649, 535, 10085, 2033, 13, 4706, 628, 274, 1839, 1649, 18569, 2033, 13, 4706, 565, 451, 7431, 29898, 29883, 1839, 15118, 2033, 1125, 13, 9651, 628, 274, 1839, 15118, 2033, 13, 4706, 1683, 29901, 13, 9651, 274, 1839, 15118, 2033, 353, 12705, 29898, 29883, 1839, 15118, 11287, 13, 4706, 565, 451, 7431, 29898, 29883, 1839, 932, 506, 3097, 2033, 1125, 13, 9651, 628, 274, 1839, 932, 506, 3097, 2033, 13, 4706, 620, 29889, 4397, 29898, 29883, 29897, 13, 1678, 736, 620, 29892, 2755, 1237, 29892, 23892, 932, 29892, 269, 695, 29892, 10608, 29918, 2587, 13, 13, 13, 1753, 679, 29918, 1609, 29918, 2084, 29898, 4632, 29892, 4452, 1125, 13, 1678, 736, 10032, 29898, 6891, 29889, 657, 667, 29892, 4452, 29892, 3876, 29897, 13, 13, 13, 1753, 731, 29918, 1609, 29918, 2084, 29898, 4632, 29892, 4452, 29892, 995, 1125, 13, 1678, 679, 29918, 1609, 29918, 2084, 29898, 4632, 29892, 4452, 7503, 29899, 29896, 2314, 29961, 7076, 14352, 29896, 5262, 353, 995, 13, 13, 13, 1753, 8161, 29918, 11010, 29898, 29990, 1125, 13, 1678, 12856, 353, 1102, 2603, 5627, 580, 13, 1678, 363, 921, 297, 1060, 29901, 13, 4706, 12856, 29889, 1202, 29918, 3318, 29898, 29916, 29897, 13, 1678, 10938, 353, 12856, 13, 1678, 736, 10938, 13, 13, 13, 1753, 679, 29918, 20620, 29918, 1853, 29918, 20698, 29898, 20620, 29918, 11010, 1125, 13, 1678, 12151, 29918, 1853, 29918, 20698, 353, 6571, 13, 1678, 363, 413, 297, 12151, 29918, 11010, 29889, 8149, 7295, 13, 4706, 565, 413, 29889, 1975, 2541, 29898, 2287, 5265, 26349, 1001, 718, 525, 1853, 29374, 13, 9651, 1820, 353, 413, 29889, 6506, 877, 11330, 29915, 718, 5012, 5265, 26349, 1001, 29892, 525, 2824, 6506, 29898, 2287, 5265, 26349, 1001, 718, 525, 1853, 742, 27255, 13, 9651, 12151, 29918, 1853, 29918, 20698, 29961, 1989, 29962, 353, 12151, 29918, 11010, 29961, 29895, 29962, 13, 1678, 736, 12151, 29918, 1853, 29918, 20698, 13, 13, 13, 1753, 679, 29918, 20620, 29918, 7247, 29918, 20698, 29898, 29990, 29892, 12151, 29918, 1853, 29918, 20698, 1125, 13, 1678, 12151, 29918, 7247, 29918, 20698, 353, 6571, 13, 1678, 363, 921, 297, 1060, 29901, 13, 4706, 12151, 353, 12151, 8977, 29889, 8754, 2620, 21533, 29898, 29916, 29892, 28552, 2433, 29889, 1495, 13, 4706, 363, 413, 297, 12151, 29918, 1853, 29918, 20698, 29889, 8149, 7295, 13, 9651, 325, 353, 12151, 29889, 657, 29898, 29895, 29897, 13, 9651, 565, 325, 338, 451, 6213, 29901, 13, 18884, 565, 413, 451, 297, 12151, 29918, 7247, 29918, 20698, 29901, 13, 462, 1678, 12151, 29918, 7247, 29918, 20698, 29961, 29895, 29962, 353, 731, 580, 13, 18884, 1134, 29918, 353, 12151, 29918, 1853, 29918, 20698, 29961, 29895, 29962, 13, 18884, 1018, 29901, 13, 462, 1678, 565, 1134, 29918, 1275, 525, 2378, 2396, 13, 462, 4706, 12151, 29918, 7247, 29918, 20698, 29961, 29895, 1822, 5504, 29898, 657, 29918, 1609, 29918, 2084, 29898, 29916, 29892, 413, 29889, 5451, 877, 6169, 4961, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 12151, 29918, 7247, 29918, 20698, 29961, 29895, 1822, 1202, 29898, 657, 29918, 1609, 29918, 2084, 29898, 29916, 29892, 413, 29889, 5451, 877, 6169, 4961, 13, 18884, 5174, 29901, 13, 462, 1678, 565, 451, 12151, 29918, 7247, 29918, 20698, 29961, 29895, 5387, 13, 462, 4706, 628, 12151, 29918, 7247, 29918, 20698, 29961, 29895, 29962, 13, 1678, 363, 413, 297, 12151, 29918, 7247, 29918, 20698, 29901, 13, 4706, 12151, 29918, 7247, 29918, 20698, 29961, 29895, 29962, 353, 1051, 29898, 20620, 29918, 7247, 29918, 20698, 29961, 29895, 2314, 13, 1678, 736, 12151, 29918, 7247, 29918, 20698, 13, 13, 13, 1753, 1652, 8606, 29918, 24713, 29898, 29990, 29892, 12151, 29918, 1853, 29918, 20698, 29892, 10938, 29918, 29882, 9466, 29922, 8516, 1125, 13, 1678, 565, 10938, 29918, 29882, 9466, 338, 6213, 29901, 13, 4706, 10938, 29918, 29882, 9466, 353, 6571, 13, 1678, 12151, 29918, 29990, 353, 5159, 13, 1678, 363, 921, 297, 1060, 29901, 13, 4706, 12151, 353, 12151, 8977, 29889, 8754, 2620, 21533, 29898, 29916, 29892, 28552, 29922, 2287, 5265, 26349, 1001, 29897, 13, 4706, 274, 29918, 29916, 353, 3509, 29889, 24535, 8552, 29898, 29916, 29897, 13, 4706, 363, 413, 297, 12151, 29918, 1853, 29918, 20698, 29889, 8149, 7295, 13, 9651, 784, 29918, 1853, 353, 10938, 29918, 29882, 9466, 29889, 657, 29898, 29895, 29892, 6571, 467, 657, 877, 1054, 29918, 1853, 1495, 13, 9651, 565, 784, 29918, 1853, 451, 297, 518, 8516, 29892, 23958, 29918, 29950, 10192, 29889, 24815, 22122, 1964, 5387, 13, 18884, 6773, 13, 9651, 325, 353, 12151, 29889, 657, 29898, 29895, 29897, 13, 9651, 565, 325, 338, 451, 6213, 29901, 13, 18884, 2656, 353, 10938, 29918, 29882, 9466, 29889, 657, 29898, 29895, 29892, 6571, 467, 657, 877, 6605, 742, 7700, 29897, 13, 18884, 565, 2656, 29901, 13, 462, 1678, 1134, 29918, 353, 12151, 29918, 1853, 29918, 20698, 29961, 29895, 29962, 13, 462, 1678, 565, 1134, 29918, 1275, 525, 2378, 2396, 13, 462, 4706, 2944, 29918, 8768, 353, 12151, 29918, 1853, 29918, 20698, 29889, 657, 29898, 29895, 718, 15300, 7076, 1495, 13, 462, 4706, 263, 353, 679, 29918, 1609, 29918, 2084, 29898, 29883, 29918, 29916, 29892, 413, 29889, 5451, 877, 6169, 876, 13, 462, 4706, 565, 338, 8758, 29898, 667, 29918, 8768, 29892, 29871, 1051, 1125, 13, 462, 9651, 1018, 29901, 13, 462, 18884, 263, 353, 12705, 29898, 29874, 29897, 13, 462, 9651, 5174, 29901, 13, 462, 18884, 1596, 14237, 24412, 29901, 6837, 29899, 1853, 1409, 411, 4072, 29901, 6571, 4286, 4830, 29317, 15300, 7122, 29898, 667, 29918, 8768, 4961, 13, 462, 18884, 1596, 14237, 24412, 29936, 694, 10230, 5455, 4944, 29889, 3967, 304, 24809, 278, 1571, 4320, 856, 1495, 13, 462, 18884, 363, 260, 297, 1134, 29918, 29886, 21766, 29901, 13, 462, 462, 1678, 1018, 29901, 13, 462, 462, 4706, 263, 353, 1051, 29898, 1958, 29898, 1853, 29918, 29886, 21766, 29961, 29873, 1402, 263, 876, 13, 462, 462, 4706, 1596, 14237, 4834, 292, 320, 29915, 29912, 1012, 29915, 304, 6571, 4286, 4830, 29898, 29895, 29892, 260, 876, 13, 462, 462, 4706, 2867, 13, 462, 462, 1678, 5174, 29901, 13, 462, 462, 4706, 1480, 29889, 2704, 877, 23323, 451, 4320, 320, 29915, 29912, 1012, 29915, 304, 6571, 4286, 4830, 29898, 29895, 29892, 260, 876, 13, 462, 18884, 1683, 29901, 13, 462, 462, 1678, 1596, 14237, 4829, 29901, 6527, 451, 1284, 738, 982, 304, 2656, 6571, 4286, 4830, 29898, 29895, 876, 13, 462, 462, 1678, 12020, 8960, 877, 23323, 451, 1284, 738, 982, 304, 2656, 6571, 4286, 4830, 29898, 29895, 876, 13, 462, 9651, 731, 29918, 1609, 29918, 2084, 29898, 29883, 29918, 29916, 29892, 413, 29889, 5451, 12839, 5477, 12705, 29898, 29874, 876, 13, 18884, 12151, 353, 12151, 8977, 29889, 8754, 2620, 21533, 29898, 29883, 29918, 29916, 29892, 28552, 29922, 2287, 5265, 26349, 1001, 29897, 13, 4706, 12151, 29918, 29990, 29889, 4397, 29898, 20620, 29897, 13, 1678, 736, 12151, 29918, 29990, 13, 13, 13, 1753, 7375, 29918, 650, 29918, 3977, 6119, 29918, 265, 29918, 1761, 29898, 2176, 29892, 1897, 1125, 13, 1678, 325, 353, 518, 29916, 565, 338, 8758, 29898, 29916, 29892, 1051, 29897, 1683, 5159, 363, 921, 297, 4489, 29961, 4914, 1822, 5975, 29962, 13, 1678, 301, 353, 518, 2435, 29898, 29916, 29897, 363, 921, 297, 325, 29962, 13, 1678, 285, 29892, 318, 353, 10518, 29889, 19790, 675, 29898, 9302, 29889, 535, 29883, 2579, 403, 29898, 29894, 876, 13, 1678, 302, 29892, 286, 353, 7431, 29898, 29894, 511, 318, 29889, 2311, 13, 1678, 474, 353, 7442, 29889, 279, 927, 29898, 29876, 467, 14358, 29898, 29880, 29897, 13, 13, 1678, 270, 23824, 583, 353, 10518, 29889, 17271, 29898, 13, 4706, 7442, 29889, 2109, 2798, 29898, 29875, 334, 286, 718, 285, 29892, 1375, 2848, 29922, 29876, 334, 286, 467, 690, 14443, 29898, 29876, 29892, 286, 511, 13, 4706, 4489, 29889, 2248, 29892, 2910, 29898, 2892, 921, 29901, 851, 29898, 4914, 29897, 718, 525, 2433, 718, 851, 29898, 29916, 511, 318, 29897, 13, 1678, 1723, 13, 1678, 736, 4489, 29889, 8865, 29898, 4914, 29892, 29871, 29896, 467, 7122, 29898, 29881, 23824, 583, 29897, 13, 13, 13, 1753, 4226, 675, 29898, 29990, 29892, 10938, 29918, 29882, 9466, 29922, 8516, 1125, 13, 1678, 565, 10938, 29918, 29882, 9466, 338, 6213, 29901, 13, 4706, 10938, 29918, 29882, 9466, 353, 6571, 13, 13, 1678, 822, 7375, 29918, 650, 29918, 3977, 6119, 29898, 2176, 29892, 4341, 1125, 13, 4706, 736, 10518, 29889, 657, 29918, 29881, 23824, 583, 29898, 2176, 29892, 10944, 29918, 19570, 543, 543, 29892, 4341, 29922, 13099, 29897, 13, 13, 1678, 10938, 353, 8161, 29918, 11010, 29898, 29990, 29897, 13, 1678, 12151, 29918, 11010, 353, 12151, 8977, 29889, 29943, 5066, 21533, 29898, 11010, 29889, 517, 29918, 11010, 3285, 28552, 29922, 2287, 5265, 26349, 1001, 29897, 13, 1678, 12151, 29918, 1853, 29918, 20698, 353, 679, 29918, 20620, 29918, 1853, 29918, 20698, 29898, 20620, 29918, 11010, 29897, 13, 1678, 12151, 29918, 7247, 29918, 20698, 353, 679, 29918, 20620, 29918, 7247, 29918, 20698, 29898, 29990, 29892, 12151, 29918, 1853, 29918, 20698, 29897, 13, 1678, 12151, 29918, 29990, 353, 1652, 8606, 29918, 24713, 29898, 29990, 29892, 12151, 29918, 1853, 29918, 20698, 29892, 10938, 29918, 29882, 9466, 29897, 13, 1678, 4341, 29918, 517, 29918, 12508, 353, 518, 29895, 363, 413, 29892, 325, 297, 10938, 29918, 29882, 9466, 29889, 7076, 580, 565, 325, 1839, 1054, 29918, 1853, 2033, 1275, 23958, 29918, 29950, 10192, 29889, 29950, 2891, 29918, 12413, 29962, 13, 1678, 4489, 353, 10518, 29889, 17271, 29898, 20620, 29918, 29990, 29897, 13, 1678, 363, 274, 297, 4489, 29889, 13099, 29901, 13, 4706, 285, 353, 2446, 3552, 29895, 363, 413, 297, 4341, 29918, 517, 29918, 12508, 565, 274, 29889, 27382, 2541, 29898, 29895, 8243, 6213, 29897, 13, 4706, 565, 285, 29901, 13, 9651, 4489, 353, 4489, 29889, 8865, 29898, 29883, 29892, 29871, 29896, 29897, 13, 1678, 18511, 353, 5159, 13, 1678, 363, 274, 297, 4341, 29918, 517, 29918, 12508, 29901, 13, 4706, 1134, 29918, 353, 12151, 29918, 1853, 29918, 20698, 29961, 29883, 29962, 13, 4706, 565, 1134, 29918, 1275, 525, 2378, 2396, 13, 9651, 565, 274, 1275, 525, 535, 10085, 2396, 13, 18884, 7456, 353, 731, 580, 13, 18884, 363, 921, 297, 1060, 29901, 13, 462, 1678, 363, 321, 297, 921, 29961, 29883, 5387, 13, 462, 4706, 565, 525, 7914, 29915, 297, 321, 29901, 13, 462, 9651, 7456, 29889, 1202, 29898, 29872, 1839, 7914, 11287, 13, 18884, 7456, 353, 12705, 29898, 18569, 29897, 13, 18884, 4489, 29906, 353, 5159, 13, 18884, 363, 921, 297, 1060, 29901, 13, 462, 1678, 321, 353, 5159, 13, 462, 1678, 921, 442, 353, 426, 29894, 1839, 7914, 2033, 29901, 325, 1839, 1853, 2033, 363, 325, 297, 921, 1839, 535, 10085, 2033, 565, 525, 7914, 29915, 297, 325, 29913, 13, 462, 1678, 363, 263, 297, 7456, 29901, 13, 462, 4706, 325, 353, 29871, 29900, 13, 462, 4706, 565, 263, 297, 921, 442, 29901, 13, 462, 9651, 565, 921, 442, 29961, 29874, 29962, 1275, 525, 1403, 22671, 2396, 13, 462, 18884, 325, 353, 29871, 29896, 13, 462, 9651, 1683, 29901, 13, 462, 18884, 325, 353, 448, 29896, 13, 462, 4706, 321, 29889, 4397, 29898, 29894, 29897, 13, 462, 1678, 4489, 29906, 29889, 4397, 29898, 29872, 29897, 13, 18884, 4489, 29906, 353, 10518, 29889, 17271, 29898, 2176, 29906, 29892, 4341, 29922, 1761, 29898, 1958, 29898, 2892, 921, 29901, 525, 617, 29880, 29918, 7914, 3790, 29913, 4286, 4830, 29898, 29916, 511, 7456, 4961, 13, 18884, 18511, 29889, 4397, 29898, 2176, 29906, 29897, 13, 9651, 1683, 29901, 13, 18884, 4489, 29906, 353, 10518, 29889, 17271, 29898, 29990, 29897, 8999, 29883, 5262, 13, 18884, 321, 353, 7375, 29918, 650, 29918, 3977, 6119, 29918, 265, 29918, 1761, 29898, 2176, 29906, 29892, 274, 29897, 13, 18884, 18511, 29889, 4397, 29898, 29872, 29897, 13, 4706, 1683, 29901, 13, 9651, 4489, 29906, 353, 10518, 29889, 17271, 29898, 29990, 9601, 29883, 29962, 13, 9651, 321, 353, 7375, 29918, 650, 29918, 3977, 6119, 29898, 2176, 29906, 29892, 518, 29883, 2314, 13, 9651, 18511, 29889, 4397, 29898, 29872, 29897, 13, 1678, 4489, 353, 10518, 29889, 17685, 4197, 2176, 29962, 718, 18511, 29892, 9685, 29922, 29896, 29897, 13, 1678, 736, 4489, 29892, 10938, 29892, 12151, 29918, 11010, 29892, 12151, 29918, 1853, 29918, 20698, 29892, 12151, 29918, 7247, 29918, 20698, 13, 13, 13, 1753, 1065, 29898, 11058, 29892, 2048, 29892, 3611, 29892, 1962, 29918, 13506, 2433, 11436, 742, 4889, 29922, 8824, 1125, 13, 1678, 4770, 11058, 353, 2991, 13, 1678, 5534, 1596, 13, 1678, 1596, 353, 4770, 11058, 29889, 2158, 13, 13, 1678, 1596, 29898, 9802, 3204, 703, 29899, 3579, 14448, 5285, 1068, 5783, 13, 1678, 1596, 29898, 29911, 2882, 718, 376, 29958, 349, 3445, 598, 6507, 4138, 3829, 1159, 13, 1678, 10898, 353, 6024, 348, 4984, 2955, 742, 525, 4984, 2955, 742, 525, 1610, 2033, 13, 1678, 363, 282, 297, 10898, 29901, 13, 4706, 1207, 29918, 4282, 29918, 12083, 29898, 11058, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 282, 511, 4889, 29892, 9406, 29922, 8824, 29897, 13, 13, 1678, 1596, 29898, 9802, 3204, 703, 29899, 3579, 19077, 675, 2566, 1068, 5783, 13, 1678, 1881, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 525, 1610, 742, 525, 1457, 5014, 287, 29918, 3225, 29879, 1495, 13, 1678, 4251, 29918, 5325, 353, 518, 359, 29889, 2084, 29889, 7122, 29898, 2080, 29918, 12083, 29892, 285, 29897, 363, 285, 297, 1051, 3972, 29898, 2080, 29918, 12083, 29897, 13, 462, 259, 565, 338, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 2080, 29918, 12083, 29892, 285, 876, 322, 15300, 3126, 29915, 297, 285, 29962, 13, 13, 1678, 1596, 29898, 29911, 2882, 718, 376, 29958, 349, 3445, 598, 443, 4984, 2955, 4251, 518, 12692, 3816, 29928, 12413, 29962, 1159, 13, 1678, 396, 853, 4984, 2955, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 525, 348, 4984, 2955, 742, 525, 11436, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 714, 1445, 29889, 3539, 877, 7110, 29876, 1495, 13, 4706, 363, 474, 29892, 285, 297, 26985, 29898, 11436, 29918, 5325, 1125, 13, 9651, 411, 1722, 29898, 29888, 29897, 408, 4390, 29918, 1445, 29901, 13, 18884, 848, 353, 4390, 29889, 1359, 29898, 3126, 29918, 1445, 29897, 13, 18884, 4390, 29889, 15070, 29898, 1272, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 18884, 565, 474, 2804, 7431, 29898, 11436, 29918, 5325, 29897, 448, 29871, 29896, 29901, 13, 462, 1678, 714, 1445, 29889, 3539, 29317, 29905, 29876, 1495, 13, 4706, 714, 1445, 29889, 3539, 28909, 29876, 29962, 1495, 13, 13, 1678, 396, 28771, 2955, 13, 1678, 1596, 29898, 29911, 2882, 718, 376, 29958, 3251, 403, 12151, 4251, 518, 12692, 3816, 29928, 12413, 29962, 1159, 13, 1678, 12151, 29918, 11436, 1919, 2755, 5056, 29892, 23892, 932, 29892, 269, 695, 29892, 10608, 29918, 2587, 353, 3402, 29918, 4984, 2955, 29918, 3126, 29898, 11436, 29918, 5325, 29897, 13, 1678, 1596, 29898, 29911, 2882, 718, 376, 29958, 2379, 271, 4251, 2159, 29901, 6571, 29924, 29875, 29933, 1642, 4830, 29898, 9675, 29889, 657, 17921, 29898, 20620, 29918, 11436, 29897, 847, 29871, 29896, 29900, 29900, 29900, 876, 13, 1678, 10938, 29918, 29882, 9466, 353, 426, 13, 4706, 525, 7914, 2396, 426, 13, 9651, 525, 1054, 29918, 1853, 2396, 23958, 29918, 29950, 10192, 29889, 29950, 2891, 29918, 12413, 13, 4706, 2981, 13, 4706, 525, 3225, 10855, 333, 2396, 426, 13, 9651, 525, 1054, 29918, 1853, 2396, 23958, 29918, 29950, 10192, 29889, 29950, 2891, 29918, 12413, 13, 4706, 2981, 13, 4706, 525, 932, 506, 3097, 2396, 426, 13, 9651, 525, 1054, 29918, 1853, 2396, 23958, 29918, 29950, 10192, 29889, 29950, 2891, 29918, 12413, 13, 4706, 2981, 13, 4706, 525, 26956, 29879, 2396, 426, 13, 9651, 525, 1054, 29918, 1853, 2396, 23958, 29918, 29950, 10192, 29889, 29950, 2891, 29918, 12413, 13, 4706, 2981, 13, 4706, 525, 535, 10085, 2396, 426, 13, 9651, 525, 1054, 29918, 1853, 2396, 23958, 29918, 29950, 10192, 29889, 29950, 2891, 29918, 12413, 29892, 13, 9651, 525, 1491, 29918, 5029, 2396, 525, 1579, 8606, 29915, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 1962, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 525, 4984, 2955, 1495, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 20620, 29918, 11436, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 20620, 29918, 11436, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 11010, 29918, 29882, 524, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 11010, 29918, 29882, 9466, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 1060, 353, 12151, 29918, 11436, 13, 1678, 4489, 29892, 10938, 29892, 12151, 29918, 11010, 29892, 12151, 29918, 1853, 29918, 20698, 29892, 12151, 29918, 7247, 29918, 20698, 353, 4226, 675, 29898, 29990, 29892, 10938, 29918, 29882, 9466, 29897, 13, 1678, 4489, 29889, 517, 29918, 3126, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 22372, 1836, 3126, 4286, 4830, 29898, 4905, 29918, 13506, 8243, 7769, 2433, 3757, 4339, 1495, 13, 1678, 4489, 29889, 517, 29918, 7638, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 22372, 1836, 7638, 4286, 4830, 29898, 4905, 29918, 13506, 4961, 13, 13, 1678, 4390, 29918, 5325, 353, 518, 13, 4706, 6702, 11010, 742, 10938, 29889, 517, 29918, 11010, 25739, 13, 4706, 6702, 20620, 29918, 11010, 742, 12151, 29918, 11010, 29889, 294, 29918, 8977, 25739, 13, 4706, 6702, 20620, 29918, 1853, 29918, 20698, 742, 12151, 29918, 1853, 29918, 20698, 511, 13, 4706, 6702, 20620, 29918, 7247, 29918, 20698, 742, 12151, 29918, 7247, 29918, 20698, 29897, 13, 1678, 4514, 13, 1678, 363, 285, 297, 4390, 29918, 5325, 29901, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 22372, 3227, 1836, 3126, 4286, 4830, 29898, 4905, 29918, 13506, 29892, 285, 29961, 29900, 2314, 511, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 9651, 4390, 29889, 15070, 29898, 29888, 29961, 29896, 1402, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 2897, 29889, 5992, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 20620, 29918, 11436, 29889, 3126, 8785, 13, 1678, 2897, 29889, 5992, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 11436, 29918, 20620, 29918, 11010, 29889, 3126, 8785, 13, 1678, 2897, 29889, 5992, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 11436, 29918, 20620, 29918, 1853, 29918, 20698, 29889, 3126, 8785, 13, 13, 1678, 1596, 29898, 29911, 2882, 718, 525, 29958, 3251, 403, 623, 17639, 1775, 11674, 518, 12692, 3816, 29928, 12413, 29962, 1495, 13, 1678, 1775, 11674, 29918, 932, 17639, 353, 6571, 13, 1678, 363, 413, 29892, 325, 297, 23892, 932, 29889, 7076, 7295, 13, 4706, 1775, 11674, 29918, 932, 17639, 29961, 29895, 29962, 353, 426, 29872, 29901, 29896, 363, 321, 297, 325, 1839, 932, 17639, 2033, 29913, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 2922, 11674, 29918, 932, 17639, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 2922, 11674, 29918, 932, 17639, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 1596, 29898, 29911, 2882, 718, 525, 29958, 3251, 403, 269, 695, 1775, 11674, 518, 12692, 3816, 29928, 12413, 29962, 1495, 13, 1678, 1775, 11674, 29918, 29879, 695, 353, 6571, 13, 1678, 363, 413, 29892, 325, 297, 269, 695, 29889, 7076, 7295, 13, 4706, 1775, 11674, 29918, 29879, 695, 29961, 29895, 29962, 353, 426, 29872, 29901, 29871, 29896, 363, 321, 297, 325, 1839, 29879, 695, 2033, 29913, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 2922, 11674, 29918, 29879, 695, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 2922, 11674, 29918, 29879, 695, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 1596, 29898, 29911, 2882, 718, 525, 29958, 3251, 403, 2755, 5056, 1775, 11674, 518, 12692, 3816, 29928, 12413, 29962, 1495, 13, 1678, 1775, 11674, 29918, 276, 6338, 287, 1609, 353, 6571, 13, 1678, 363, 413, 29892, 325, 297, 2755, 5056, 29889, 7076, 7295, 13, 4706, 1775, 11674, 29918, 276, 6338, 287, 1609, 29961, 29895, 29962, 353, 426, 29872, 29901, 29871, 29896, 363, 321, 297, 325, 1839, 276, 6338, 287, 1609, 2033, 29913, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 2922, 11674, 29918, 276, 6338, 5056, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 2922, 11674, 29918, 276, 6338, 287, 1609, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 1596, 29898, 29911, 2882, 718, 525, 29958, 3251, 403, 10608, 3573, 1775, 11674, 518, 12692, 3816, 29928, 12413, 29962, 1495, 13, 1678, 1775, 11674, 29918, 7099, 2459, 29918, 2587, 353, 6571, 13, 1678, 363, 413, 29892, 325, 297, 10608, 29918, 2587, 29889, 7076, 7295, 13, 4706, 1775, 11674, 29918, 7099, 2459, 29918, 2587, 29961, 29895, 29962, 353, 426, 29895, 29901, 29894, 363, 413, 29892, 29894, 297, 325, 1839, 12154, 13359, 7076, 28296, 13, 1678, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 2084, 29892, 525, 2922, 11674, 29918, 7099, 2459, 29918, 2587, 29889, 3126, 5477, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 2922, 11674, 29918, 7099, 2459, 29918, 2587, 29892, 714, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 1596, 29898, 29911, 2882, 718, 525, 29958, 6204, 3190, 3145, 518, 12692, 3816, 29928, 12413, 29962, 1495, 13, 1678, 396, 22038, 13, 1678, 528, 4422, 29889, 5675, 29918, 10867, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 525, 1610, 742, 525, 17675, 29887, 1860, 5477, 525, 7554, 742, 13, 462, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 525, 1610, 742, 525, 17675, 29887, 1860, 8785, 13, 13, 1678, 396, 2178, 13, 1678, 515, 14319, 1445, 1053, 796, 666, 2283, 13, 1678, 411, 796, 666, 2283, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 525, 497, 29889, 7554, 5477, 525, 29893, 1495, 408, 14319, 9930, 29901, 13, 4706, 396, 20504, 403, 975, 599, 278, 2066, 297, 3884, 13, 4706, 16495, 353, 6024, 348, 4984, 2955, 742, 525, 1610, 742, 525, 4984, 2955, 2033, 13, 4706, 363, 285, 297, 16495, 29901, 13, 9651, 363, 4138, 1170, 29892, 17117, 977, 264, 1280, 297, 2897, 29889, 20919, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4282, 29892, 285, 22164, 13, 18884, 363, 10422, 297, 977, 264, 1280, 29901, 13, 462, 1678, 565, 451, 10422, 29889, 1975, 2541, 12839, 7554, 29374, 13, 462, 4706, 934, 2605, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 1170, 29892, 10422, 29897, 13, 462, 4706, 14319, 9930, 29889, 3539, 29898, 1445, 2605, 29897, 13, 13, 1753, 1667, 29898, 5085, 1125, 13, 1678, 2991, 353, 9405, 29898, 11651, 29922, 5574, 29897, 13, 1678, 1065, 29898, 11058, 29892, 13, 4706, 2048, 29922, 5085, 29889, 4282, 29892, 13, 4706, 3611, 29922, 5085, 29889, 3257, 29892, 13, 4706, 4889, 29922, 5085, 29889, 29888, 29897, 13, 13, 13, 1753, 6088, 29918, 5085, 29898, 16680, 1125, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 396, 5399, 2224, 13, 1678, 736, 6389, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 19077, 675, 738, 16236, 344, 310, 9727, 6275, 9322, 10701, 29889, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 4282, 742, 1134, 29922, 710, 29892, 2322, 543, 6904, 4282, 29914, 5309, 29878, 29918, 9803, 29914, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 3257, 742, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 11010, 29918, 29882, 9466, 742, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 4905, 29918, 13506, 742, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29888, 742, 3158, 2433, 8899, 29918, 3009, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29884, 742, 3158, 2433, 8899, 29918, 3009, 1495, 13, 1678, 6389, 353, 6088, 29918, 5085, 29898, 16680, 29897, 13, 13, 1678, 1667, 29898, 5085, 29897, 13, 13, 2 ]
vathos/trainer/tpu_trainer.py
satyajitghana/ProjektDepth
2
44250
from .base_trainer import BaseTrainer import torch import os class TPUTrainer(BaseTrainer): r"""TPUTrainer: Trains the vathos model on TPU """ def __init__(self, *args, **kwargs): super(TPUTrainer, self).__init__(*args, **kwargs) import torch_xla import torch_xla.core.xla_model as xm import torch_xla.distributed.parallel_loader as pl import torch_xla.distributed.xla_multiprocessing as xmp os.environ['XLA_USE_BF16'] = 1 @staticmethod def _xla_train(index): device = xm.xla_device() para_loader = pl.ParallelLoader(train_loader, [device]) model = MNIST().train().to(device) loss_fn = nn.NLLLoss() optimizer = optim.SGD(model.parameters(), lr=lr, momentum=momentum) for data, target in para_loader.per_device_loader(device): optimizer.zero_grad() output = model(data) loss = loss_fn(output, target) loss.backward() xm.optimizer_step(optimizer) def train_epoch(self, epoch): return 0 def test_epoch(self, epoch): device = xm.xla_device() xm.mark_step() return 0
[ 1, 515, 869, 3188, 29918, 3018, 4983, 1053, 7399, 5323, 4983, 13, 13, 5215, 4842, 305, 13, 5215, 2897, 13, 13, 13, 1990, 323, 12336, 336, 4983, 29898, 5160, 5323, 4983, 1125, 13, 1678, 364, 15945, 29908, 3557, 2692, 336, 4983, 29901, 3201, 1144, 278, 325, 493, 359, 1904, 373, 323, 7056, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 13, 4706, 2428, 29898, 3557, 2692, 336, 4983, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1053, 4842, 305, 29918, 29916, 433, 13, 4706, 1053, 4842, 305, 29918, 29916, 433, 29889, 3221, 29889, 29916, 433, 29918, 4299, 408, 921, 29885, 13, 4706, 1053, 4842, 305, 29918, 29916, 433, 29889, 5721, 7541, 29889, 23482, 29918, 12657, 408, 715, 13, 4706, 1053, 4842, 305, 29918, 29916, 433, 29889, 5721, 7541, 29889, 29916, 433, 29918, 18056, 307, 985, 292, 408, 921, 1526, 13, 13, 4706, 2897, 29889, 21813, 1839, 29990, 4375, 29918, 17171, 29918, 28062, 29896, 29953, 2033, 353, 29871, 29896, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 29916, 433, 29918, 14968, 29898, 2248, 1125, 13, 4706, 4742, 353, 921, 29885, 29889, 29916, 433, 29918, 10141, 580, 13, 4706, 1702, 29918, 12657, 353, 715, 29889, 2177, 6553, 10036, 29898, 14968, 29918, 12657, 29892, 518, 10141, 2314, 13, 13, 4706, 1904, 353, 341, 29940, 9047, 2141, 14968, 2141, 517, 29898, 10141, 29897, 13, 4706, 6410, 29918, 9144, 353, 302, 29876, 29889, 29940, 2208, 29931, 2209, 580, 13, 4706, 5994, 3950, 353, 5994, 29889, 26016, 29928, 29898, 4299, 29889, 16744, 3285, 301, 29878, 29922, 29212, 29892, 19399, 29922, 29885, 2932, 398, 29897, 13, 13, 4706, 363, 848, 29892, 3646, 297, 1702, 29918, 12657, 29889, 546, 29918, 10141, 29918, 12657, 29898, 10141, 1125, 13, 9651, 5994, 3950, 29889, 9171, 29918, 5105, 580, 13, 9651, 1962, 353, 1904, 29898, 1272, 29897, 13, 9651, 6410, 353, 6410, 29918, 9144, 29898, 4905, 29892, 3646, 29897, 13, 9651, 6410, 29889, 1627, 1328, 580, 13, 9651, 921, 29885, 29889, 20640, 3950, 29918, 10568, 29898, 20640, 3950, 29897, 13, 13, 1678, 822, 7945, 29918, 1022, 2878, 29898, 1311, 29892, 21502, 305, 1125, 13, 13, 4706, 736, 29871, 29900, 13, 13, 1678, 822, 1243, 29918, 1022, 2878, 29898, 1311, 29892, 21502, 305, 1125, 13, 13, 4706, 4742, 353, 921, 29885, 29889, 29916, 433, 29918, 10141, 580, 13, 13, 4706, 921, 29885, 29889, 3502, 29918, 10568, 580, 13, 13, 4706, 736, 29871, 29900, 13, 2 ]
examples/linear_wake/analysis.py
SaVicente/hipace
19
49538
<gh_stars>10-100 #! /usr/bin/env python3 # This Python analysis script is part of the code Hipace # # It compares the transverse field By with the theoretical value, plots both # the simulation result and the theory on the same plot, and asserts that the # difference is small. # # To use it, run the simulation and execute this script with # > ../../build/bin/hipace inputs_SI # > python analysis.py # Note: the simulation may take some time, as the box size must be high to have # decent agreement import matplotlib.pyplot as plt import scipy.constants as scc from scipy.stats import norm import matplotlib import sys import numpy as np import math import argparse from openpmd_viewer import OpenPMDTimeSeries parser = argparse.ArgumentParser(description='Script to analyze the correctness of the beam in vacuum') parser.add_argument('--normalized-units', dest='norm_units', action='store_true', default=False, help='Run the analysis in normalized units') parser.add_argument('--do-plot', dest='do_plot', action='store_true', default=False, help='Plot figures and save them to file') parser.add_argument('--gaussian-beam', dest='gaussian_beam', action='store_true', default=False, help='Run the analysis on the Gaussian beam') parser.add_argument('--output-dir', dest='output_dir', default='diags/hdf5', help='Path to the directory containing output files') args = parser.parse_args() ts = OpenPMDTimeSeries(args.output_dir) if args.norm_units: kp = 1. ne = 1. q_e = 1. else: kp = 1./10.e-6 ne = scc.c**2 / scc.e**2 * scc.m_e * scc.epsilon_0 * kp**2 q_e = scc.e rho_along_z, rho_meta = ts.get_field(field='rho', iteration=ts.iterations[-1], slice_across=['x','y'], slice_relative_position=[0,0]) zeta_array = rho_meta.z dzeta = rho_meta.dz nz = len(rho_meta.z) # generating the array with the beam density nb_array = np.zeros(nz) beam_starting_position = 1 / kp distance_to_start_pos = rho_meta.zmax - beam_starting_position index_beam_head = np.int(distance_to_start_pos / dzeta) beam_length = 2 / kp beam_length_i = np.int(beam_length / dzeta) if (args.gaussian_beam): sigma_z = 1.41 / kp peak_density = 0.01*ne nb_array = peak_density*np.sqrt(2*np.pi)*norm.pdf(np.linspace(-nz/2,nz/2,nz)*dzeta/sigma_z) else: nb_array[nz-index_beam_head-beam_length_i:nz-index_beam_head] = 0.01 * ne # calculating the second derivative of the beam density array nb_dzdz = np.zeros(nz) nb_dzdz[1:nz-1] = (nb_array[0:nz-2] - 2*nb_array[1:nz-1] + nb_array[2:nz])/dzeta**2 # calculating the theoretical plasma density (see Timon Mehrling's thesis page 41) n_th = np.zeros(nz) tmp = np.zeros([nz,nz],dtype=float) for i in np.arange(nz-1,-1,-1): for j in range(nz-i): tmp[i,j]= i-(nz-1-j) tmp = (dzeta/kp*np.sin(kp*dzeta*tmp) * np.full([nz,nz],1) * nb_dzdz[np.linspace(nz-1,0,nz,dtype=int)]) n_th = np.sum(tmp,axis = 1) + nb_array rho_th = n_th * q_e if args.do_plot: fig, ax = plt.subplots() ax.plot(zeta_array, rho_along_z) ax.plot(zeta_array, rho_th, linestyle='--') ax.set_xlabel('x') ax.set_ylabel('rho') plt.savefig('rho_z.png') # Assert that the simulation result is close enough to theory error_rho = np.sum((rho_along_z-rho_th)**2) / np.sum((rho_th)**2) print("total relative error rho: " + str(error_rho) + " (tolerance = 0.016)") assert(error_rho < .025)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 910, 5132, 7418, 2471, 338, 760, 310, 278, 775, 379, 666, 815, 13, 29937, 13, 29937, 739, 752, 5114, 278, 1301, 3901, 1746, 2648, 411, 278, 23399, 995, 29892, 24580, 1716, 13, 29937, 278, 17402, 1121, 322, 278, 6368, 373, 278, 1021, 6492, 29892, 322, 408, 643, 1372, 393, 278, 13, 29937, 4328, 338, 2319, 29889, 13, 29937, 13, 29937, 1763, 671, 372, 29892, 1065, 278, 17402, 322, 6222, 445, 2471, 411, 13, 29937, 1405, 29772, 6995, 4282, 29914, 2109, 29914, 4034, 815, 10970, 29918, 5425, 13, 29937, 1405, 3017, 7418, 29889, 2272, 13, 29937, 3940, 29901, 278, 17402, 1122, 2125, 777, 931, 29892, 408, 278, 3800, 2159, 1818, 367, 1880, 304, 505, 13, 29937, 27189, 17327, 13, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 4560, 2272, 29889, 3075, 1934, 408, 269, 617, 13, 3166, 4560, 2272, 29889, 16202, 1053, 6056, 13, 5215, 22889, 13, 5215, 10876, 13, 5215, 12655, 408, 7442, 13, 5215, 5844, 13, 5215, 1852, 5510, 13, 3166, 1722, 3358, 29881, 29918, 29894, 15580, 1053, 4673, 29925, 5773, 2481, 19204, 13, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 4081, 304, 27599, 278, 1959, 2264, 310, 278, 22913, 297, 11757, 29884, 398, 1495, 13, 16680, 29889, 1202, 29918, 23516, 877, 489, 8945, 1891, 29899, 348, 1169, 742, 13, 462, 1678, 2731, 2433, 12324, 29918, 348, 1169, 742, 13, 462, 1678, 3158, 2433, 8899, 29918, 3009, 742, 13, 462, 1678, 2322, 29922, 8824, 29892, 13, 462, 1678, 1371, 2433, 6558, 278, 7418, 297, 4226, 1891, 10340, 1495, 13, 16680, 29889, 1202, 29918, 23516, 877, 489, 1867, 29899, 5317, 742, 13, 462, 1678, 2731, 2433, 1867, 29918, 5317, 742, 13, 462, 1678, 3158, 2433, 8899, 29918, 3009, 742, 13, 462, 1678, 2322, 29922, 8824, 29892, 13, 462, 1678, 1371, 2433, 20867, 13994, 322, 4078, 963, 304, 934, 1495, 13, 16680, 29889, 1202, 29918, 23516, 877, 489, 29887, 17019, 29899, 915, 314, 742, 13, 462, 1678, 2731, 2433, 29887, 17019, 29918, 915, 314, 742, 13, 462, 1678, 3158, 2433, 8899, 29918, 3009, 742, 13, 462, 1678, 2322, 29922, 8824, 29892, 13, 462, 1678, 1371, 2433, 6558, 278, 7418, 373, 278, 22477, 22913, 1495, 13, 16680, 29889, 1202, 29918, 23516, 877, 489, 4905, 29899, 3972, 742, 13, 462, 1678, 2731, 2433, 4905, 29918, 3972, 742, 13, 462, 1678, 2322, 2433, 6051, 810, 29914, 29882, 2176, 29945, 742, 13, 462, 1678, 1371, 2433, 2605, 304, 278, 3884, 6943, 1962, 2066, 1495, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1372, 353, 4673, 29925, 5773, 2481, 19204, 29898, 5085, 29889, 4905, 29918, 3972, 29897, 13, 13, 361, 6389, 29889, 12324, 29918, 348, 1169, 29901, 13, 1678, 413, 29886, 353, 29871, 29896, 29889, 13, 1678, 452, 353, 29871, 29896, 29889, 13, 1678, 3855, 29918, 29872, 353, 29871, 29896, 29889, 13, 2870, 29901, 13, 1678, 413, 29886, 353, 29871, 29896, 6904, 29896, 29900, 29889, 29872, 29899, 29953, 13, 1678, 452, 353, 269, 617, 29889, 29883, 1068, 29906, 847, 269, 617, 29889, 29872, 1068, 29906, 334, 269, 617, 29889, 29885, 29918, 29872, 334, 269, 617, 29889, 5463, 29918, 29900, 334, 413, 29886, 1068, 29906, 13, 1678, 3855, 29918, 29872, 353, 269, 617, 29889, 29872, 13, 13, 4650, 29918, 284, 549, 29918, 29920, 29892, 364, 1251, 29918, 7299, 353, 18696, 29889, 657, 29918, 2671, 29898, 2671, 2433, 4650, 742, 12541, 29922, 1372, 29889, 1524, 800, 14352, 29896, 1402, 13, 462, 462, 268, 22780, 29918, 562, 2124, 29922, 1839, 29916, 3788, 29891, 7464, 22780, 29918, 22925, 29918, 3283, 11759, 29900, 29892, 29900, 2314, 13, 11327, 29918, 2378, 353, 364, 1251, 29918, 7299, 29889, 29920, 13, 5601, 1187, 353, 364, 1251, 29918, 7299, 29889, 5601, 13, 29876, 29920, 353, 7431, 29898, 4650, 29918, 7299, 29889, 29920, 29897, 13, 13, 29937, 14655, 278, 1409, 411, 278, 22913, 9027, 13, 9877, 29918, 2378, 353, 7442, 29889, 3298, 359, 29898, 29876, 29920, 29897, 13, 915, 314, 29918, 2962, 292, 29918, 3283, 353, 29871, 29896, 847, 413, 29886, 13, 19244, 29918, 517, 29918, 2962, 29918, 1066, 353, 29871, 364, 1251, 29918, 7299, 29889, 29920, 3317, 448, 22913, 29918, 2962, 292, 29918, 3283, 13, 2248, 29918, 915, 314, 29918, 2813, 353, 7442, 29889, 524, 29898, 19244, 29918, 517, 29918, 2962, 29918, 1066, 847, 9275, 1187, 29897, 13, 915, 314, 29918, 2848, 353, 29871, 29906, 847, 413, 29886, 13, 915, 314, 29918, 2848, 29918, 29875, 353, 7442, 29889, 524, 29898, 915, 314, 29918, 2848, 847, 9275, 1187, 29897, 13, 361, 313, 5085, 29889, 29887, 17019, 29918, 915, 314, 1125, 13, 1678, 269, 2934, 29918, 29920, 353, 29871, 29896, 29889, 29946, 29896, 847, 413, 29886, 13, 1678, 19224, 29918, 21518, 537, 353, 29871, 29900, 29889, 29900, 29896, 29930, 484, 13, 1678, 302, 29890, 29918, 2378, 353, 19224, 29918, 21518, 537, 29930, 9302, 29889, 3676, 29898, 29906, 29930, 9302, 29889, 1631, 11877, 12324, 29889, 5140, 29898, 9302, 29889, 1915, 3493, 6278, 29876, 29920, 29914, 29906, 29892, 29876, 29920, 29914, 29906, 29892, 29876, 29920, 11877, 5601, 1187, 29914, 3754, 29918, 29920, 29897, 13, 2870, 29901, 13, 1678, 302, 29890, 29918, 2378, 29961, 29876, 29920, 29899, 2248, 29918, 915, 314, 29918, 2813, 29899, 915, 314, 29918, 2848, 29918, 29875, 29901, 29876, 29920, 29899, 2248, 29918, 915, 314, 29918, 2813, 29962, 353, 29871, 29900, 29889, 29900, 29896, 334, 452, 13, 13, 29937, 25202, 278, 1473, 16291, 310, 278, 22913, 9027, 1409, 13, 9877, 29918, 5601, 5601, 353, 7442, 29889, 3298, 359, 29898, 29876, 29920, 29897, 13, 9877, 29918, 5601, 5601, 29961, 29896, 29901, 29876, 29920, 29899, 29896, 29962, 353, 313, 9877, 29918, 2378, 29961, 29900, 29901, 29876, 29920, 29899, 29906, 29962, 448, 29871, 29906, 29930, 9877, 29918, 2378, 29961, 29896, 29901, 29876, 29920, 29899, 29896, 29962, 718, 302, 29890, 29918, 2378, 29961, 29906, 29901, 29876, 29920, 2314, 29914, 5601, 1187, 1068, 29906, 13, 13, 29937, 25202, 278, 23399, 715, 25392, 9027, 313, 4149, 7870, 265, 2191, 1092, 1847, 29915, 29879, 266, 6656, 1813, 29871, 29946, 29896, 29897, 13, 29876, 29918, 386, 353, 7442, 29889, 3298, 359, 29898, 29876, 29920, 29897, 13, 7050, 29871, 353, 7442, 29889, 3298, 359, 4197, 29876, 29920, 29892, 29876, 29920, 1402, 29881, 1853, 29922, 7411, 29897, 13, 1454, 474, 297, 7442, 29889, 279, 927, 29898, 29876, 29920, 29899, 29896, 6653, 29896, 6653, 29896, 1125, 13, 1678, 363, 432, 297, 3464, 29898, 29876, 29920, 29899, 29875, 1125, 13, 4706, 13128, 29961, 29875, 29892, 29926, 13192, 474, 17722, 29876, 29920, 29899, 29896, 29899, 29926, 29897, 13, 7050, 353, 313, 5601, 1187, 29914, 29895, 29886, 29930, 9302, 29889, 5223, 29898, 29895, 29886, 29930, 5601, 1187, 29930, 7050, 29897, 334, 7442, 29889, 8159, 4197, 29876, 29920, 29892, 29876, 29920, 1402, 29896, 29897, 334, 302, 29890, 29918, 5601, 5601, 29961, 9302, 29889, 1915, 3493, 29898, 29876, 29920, 29899, 29896, 29892, 29900, 29892, 29876, 29920, 29892, 29881, 1853, 29922, 524, 29897, 2314, 13, 29876, 29918, 386, 353, 7442, 29889, 2083, 29898, 7050, 29892, 8990, 353, 29871, 29896, 29897, 718, 302, 29890, 29918, 2378, 13, 4650, 29918, 386, 353, 302, 29918, 386, 334, 3855, 29918, 29872, 13, 13, 361, 6389, 29889, 1867, 29918, 5317, 29901, 13, 1678, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 580, 13, 1678, 4853, 29889, 5317, 29898, 11327, 29918, 2378, 29892, 364, 1251, 29918, 284, 549, 29918, 29920, 29897, 13, 1678, 4853, 29889, 5317, 29898, 11327, 29918, 2378, 29892, 364, 1251, 29918, 386, 29892, 6276, 342, 1508, 2433, 489, 1495, 13, 1678, 4853, 29889, 842, 29918, 29916, 1643, 877, 29916, 1495, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 877, 4650, 1495, 13, 1678, 14770, 29889, 7620, 1003, 877, 4650, 29918, 29920, 29889, 2732, 1495, 13, 13, 29937, 16499, 393, 278, 17402, 1121, 338, 3802, 3307, 304, 6368, 13, 2704, 29918, 4650, 353, 7442, 29889, 2083, 3552, 4650, 29918, 284, 549, 29918, 29920, 29899, 4650, 29918, 386, 29897, 1068, 29906, 29897, 847, 7442, 29889, 2083, 3552, 4650, 29918, 386, 29897, 1068, 29906, 29897, 13, 2158, 703, 7827, 6198, 1059, 364, 1251, 29901, 376, 718, 851, 29898, 2704, 29918, 4650, 29897, 718, 376, 313, 25027, 261, 749, 353, 29871, 29900, 29889, 29900, 29896, 29953, 25760, 13, 9294, 29898, 2704, 29918, 4650, 529, 869, 29900, 29906, 29945, 29897, 13, 2 ]
flatlib/chart.py
D-Vaillant/flatlib
196
72486
<reponame>D-Vaillant/flatlib """ This file is part of flatlib - (C) FlatAngle Author: <NAME> (<EMAIL>) This module implements a class to represent an astrology Chart. It provides methods to handle the chart, as well as three relevant properties: - objects: a list with the chart's objects - houses: a list with the chart's houses - angles: a list with the chart's angles Since houses 1 and 10 may not match the Asc and MC in some house systems, the Chart class includes the list of angles. The angles should be used when you want to deal with angle's longitudes. There are also methods to access fixed stars. """ from . import angle from . import const from . import utils from .ephem import ephem from .datetime import Datetime # ------------------ # # Chart Class # # ------------------ # class Chart: """ This class represents an astrology chart. """ def __init__(self, date, pos, **kwargs): """ Creates an astrology chart for a given date and location. Optional arguments are: - hsys: house system - IDs: list of objects to include """ # Handle optional arguments hsys = kwargs.get('hsys', const.HOUSES_DEFAULT) IDs = kwargs.get('IDs', const.LIST_OBJECTS_TRADITIONAL) self.date = date self.pos = pos self.hsys = hsys self.objects = ephem.getObjectList(IDs, date, pos) self.houses, self.angles = ephem.getHouses(date, pos, hsys) def copy(self): """ Returns a deep copy of this chart. """ chart = Chart.__new__(Chart) chart.date = self.date chart.pos = self.pos chart.hsys = self.hsys chart.objects = self.objects.copy() chart.houses = self.houses.copy() chart.angles = self.angles.copy() return chart # === Properties === # def getObject(self, ID): """ Returns an object from the chart. """ return self.objects.get(ID) def getHouse(self, ID): """ Returns an house from the chart. """ return self.houses.get(ID) def getAngle(self, ID): """ Returns an angle from the chart. """ return self.angles.get(ID) def get(self, ID): """ Returns an object, house or angle from the chart. """ if ID.startswith('House'): return self.getHouse(ID) elif ID in const.LIST_ANGLES: return self.getAngle(ID) else: return self.getObject(ID) # === Fixed stars === # # The computation of fixed stars is inefficient, # so the access must be made directly to the # ephemeris only when needed. def getFixedStar(self, ID): """ Returns a fixed star from the ephemeris. """ return ephem.getFixedStar(ID, self.date) def getFixedStars(self): """ Returns a list with all fixed stars. """ IDs = const.LIST_FIXED_STARS return ephem.getFixedStarList(IDs, self.date) # === Houses and angles === # def isHouse1Asc(self): """ Returns true if House1 is the same as the Asc. """ house1 = self.getHouse(const.HOUSE1) asc = self.getAngle(const.ASC) dist = angle.closestdistance(house1.lon, asc.lon) return abs(dist) < 0.0003 # 1 arc-second def isHouse10MC(self): """ Returns true if House10 is the same as the MC. """ house10 = self.getHouse(const.HOUSE10) mc = self.getAngle(const.MC) dist = angle.closestdistance(house10.lon, mc.lon) return abs(dist) < 0.0003 # 1 arc-second # === Other properties === # def isDiurnal(self): """ Returns true if this chart is diurnal. """ sun = self.getObject(const.SUN) mc = self.getAngle(const.MC) # Get ecliptical positions and check if the # sun is above the horizon. lat = self.pos.lat sunRA, sunDecl = utils.eqCoords(sun.lon, sun.lat) mcRA, mcDecl = utils.eqCoords(mc.lon, 0) return utils.isAboveHorizon(sunRA, sunDecl, mcRA, lat) def getMoonPhase(self): """ Returns the phase of the moon. """ sun = self.getObject(const.SUN) moon = self.getObject(const.MOON) dist = angle.distance(sun.lon, moon.lon) if dist < 90: return const.MOON_FIRST_QUARTER elif dist < 180: return const.MOON_SECOND_QUARTER elif dist < 270: return const.MOON_THIRD_QUARTER else: return const.MOON_LAST_QUARTER # === Solar returns === # def solarReturn(self, year): """ Returns this chart's solar return for a given year. """ sun = self.getObject(const.SUN) date = Datetime('{0}/01/01'.format(year), '00:00', self.date.utcoffset) srDate = ephem.nextSolarReturn(date, sun.lon) return Chart(srDate, self.pos, hsys=self.hsys)
[ 1, 529, 276, 1112, 420, 29958, 29928, 29899, 29963, 29874, 453, 424, 29914, 20620, 1982, 13, 15945, 29908, 13, 1678, 910, 934, 338, 760, 310, 12151, 1982, 448, 313, 29907, 29897, 2379, 271, 19582, 13, 1678, 13361, 29901, 529, 5813, 29958, 313, 29966, 26862, 6227, 12948, 13, 268, 13, 13, 1678, 910, 3883, 10703, 263, 770, 304, 2755, 385, 29871, 13, 1678, 8717, 307, 1188, 29891, 14477, 29889, 739, 8128, 3519, 304, 4386, 13, 1678, 278, 8727, 29892, 408, 1532, 408, 2211, 8018, 4426, 29901, 13, 268, 13, 1678, 448, 3618, 29901, 263, 1051, 411, 278, 8727, 29915, 29879, 3618, 13, 1678, 448, 12955, 29901, 263, 1051, 411, 278, 8727, 29915, 29879, 12955, 13, 1678, 448, 23619, 29901, 263, 1051, 411, 278, 8727, 29915, 29879, 23619, 13, 13, 1678, 4001, 12955, 29871, 29896, 322, 29871, 29896, 29900, 1122, 451, 1993, 278, 1094, 29883, 322, 13, 1678, 21271, 297, 777, 3699, 6757, 29892, 278, 14477, 770, 29871, 13, 1678, 7805, 278, 1051, 310, 23619, 29889, 450, 23619, 881, 367, 13, 1678, 1304, 746, 366, 864, 304, 5376, 411, 10696, 29915, 29879, 1472, 20816, 29889, 13, 268, 13, 1678, 1670, 526, 884, 3519, 304, 2130, 4343, 10819, 29889, 13, 268, 13, 15945, 29908, 13, 13, 3166, 869, 1053, 10696, 13, 3166, 869, 1053, 1040, 13, 3166, 869, 1053, 3667, 29879, 13, 3166, 869, 29872, 561, 331, 1053, 321, 561, 331, 13, 3166, 869, 12673, 1053, 13373, 5410, 13, 13, 13, 29937, 448, 2683, 29899, 396, 13, 29937, 1678, 14477, 4134, 268, 396, 13, 29937, 448, 2683, 29899, 396, 13, 13, 1990, 14477, 29901, 13, 1678, 9995, 910, 770, 11524, 385, 8717, 307, 1188, 29891, 8727, 29889, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2635, 29892, 926, 29892, 3579, 19290, 1125, 13, 4706, 9995, 6760, 1078, 385, 8717, 307, 1188, 29891, 8727, 363, 263, 2183, 13, 4706, 2635, 322, 4423, 29889, 29871, 13, 308, 13, 4706, 28379, 6273, 526, 29901, 13, 4706, 448, 298, 9675, 29901, 3699, 1788, 13, 4706, 448, 23481, 29901, 1051, 310, 3618, 304, 3160, 13, 308, 13, 4706, 9995, 13, 4706, 396, 29273, 13136, 6273, 13, 4706, 298, 9675, 353, 9049, 5085, 29889, 657, 877, 9499, 952, 742, 1040, 29889, 8187, 17171, 29903, 29918, 23397, 29897, 13, 4706, 23481, 353, 9049, 5085, 29889, 657, 877, 1367, 29879, 742, 1040, 29889, 24360, 29918, 14824, 17637, 29903, 29918, 5659, 3035, 22122, 1964, 29897, 13, 13, 4706, 1583, 29889, 1256, 353, 2635, 13, 4706, 1583, 29889, 1066, 353, 926, 13, 4706, 1583, 29889, 9499, 952, 353, 298, 9675, 13, 4706, 1583, 29889, 12650, 353, 321, 561, 331, 29889, 657, 2061, 1293, 29898, 1367, 29879, 29892, 2635, 29892, 926, 29897, 13, 4706, 1583, 29889, 29882, 23676, 29892, 1583, 29889, 19536, 353, 321, 561, 331, 29889, 657, 29950, 23676, 29898, 1256, 29892, 926, 29892, 298, 9675, 29897, 13, 13, 1678, 822, 3509, 29898, 1311, 1125, 13, 4706, 9995, 16969, 263, 6483, 3509, 310, 445, 8727, 29889, 9995, 13, 4706, 8727, 353, 14477, 17255, 1482, 12035, 14732, 29897, 13, 4706, 8727, 29889, 1256, 353, 1583, 29889, 1256, 13, 4706, 8727, 29889, 1066, 353, 1583, 29889, 1066, 13, 4706, 8727, 29889, 9499, 952, 353, 1583, 29889, 9499, 952, 13, 4706, 8727, 29889, 12650, 353, 1583, 29889, 12650, 29889, 8552, 580, 13, 4706, 8727, 29889, 29882, 23676, 353, 1583, 29889, 29882, 23676, 29889, 8552, 580, 13, 4706, 8727, 29889, 19536, 353, 1583, 29889, 19536, 29889, 8552, 580, 13, 4706, 736, 8727, 13, 13, 1678, 396, 6805, 21582, 6805, 396, 13, 13, 1678, 822, 679, 2061, 29898, 1311, 29892, 3553, 1125, 13, 4706, 9995, 16969, 385, 1203, 515, 278, 8727, 29889, 9995, 13, 4706, 736, 1583, 29889, 12650, 29889, 657, 29898, 1367, 29897, 13, 13, 1678, 822, 679, 29950, 1709, 29898, 1311, 29892, 3553, 1125, 13, 4706, 9995, 16969, 385, 3699, 515, 278, 8727, 29889, 9995, 13, 4706, 736, 1583, 29889, 29882, 23676, 29889, 657, 29898, 1367, 29897, 13, 13, 1678, 822, 679, 19582, 29898, 1311, 29892, 3553, 1125, 13, 4706, 9995, 16969, 385, 10696, 515, 278, 8727, 29889, 9995, 13, 4706, 736, 1583, 29889, 19536, 29889, 657, 29898, 1367, 29897, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 3553, 1125, 13, 4706, 9995, 16969, 385, 1203, 29892, 3699, 470, 10696, 29871, 13, 4706, 515, 278, 8727, 29889, 13, 308, 13, 4706, 9995, 13, 4706, 565, 3553, 29889, 27382, 2541, 877, 29950, 1709, 29374, 13, 9651, 736, 1583, 29889, 657, 29950, 1709, 29898, 1367, 29897, 13, 4706, 25342, 3553, 297, 1040, 29889, 24360, 29918, 19453, 17101, 29901, 13, 9651, 736, 1583, 29889, 657, 19582, 29898, 1367, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 1583, 29889, 657, 2061, 29898, 1367, 29897, 13, 13, 1678, 396, 6805, 383, 11925, 10819, 6805, 396, 13, 13, 1678, 396, 450, 16287, 310, 4343, 10819, 338, 297, 8462, 29892, 13, 1678, 396, 577, 278, 2130, 1818, 367, 1754, 4153, 304, 278, 13, 1678, 396, 321, 561, 25154, 275, 871, 746, 4312, 29889, 13, 13, 1678, 822, 679, 26262, 16213, 29898, 1311, 29892, 3553, 1125, 13, 4706, 9995, 16969, 263, 4343, 5810, 515, 278, 321, 561, 25154, 275, 29889, 9995, 13, 4706, 736, 321, 561, 331, 29889, 657, 26262, 16213, 29898, 1367, 29892, 1583, 29889, 1256, 29897, 13, 13, 1678, 822, 679, 26262, 855, 1503, 29898, 1311, 1125, 13, 4706, 9995, 16969, 263, 1051, 411, 599, 4343, 10819, 29889, 9995, 13, 4706, 23481, 353, 1040, 29889, 24360, 29918, 25634, 3352, 29918, 1254, 1718, 29903, 13, 4706, 736, 321, 561, 331, 29889, 657, 26262, 16213, 1293, 29898, 1367, 29879, 29892, 1583, 29889, 1256, 29897, 13, 13, 1678, 396, 6805, 379, 23676, 322, 23619, 6805, 396, 13, 13, 1678, 822, 338, 29950, 1709, 29896, 29909, 1557, 29898, 1311, 1125, 13, 4706, 9995, 16969, 1565, 565, 5619, 29896, 338, 278, 1021, 408, 278, 1094, 29883, 29889, 9995, 13, 4706, 3699, 29896, 353, 1583, 29889, 657, 29950, 1709, 29898, 3075, 29889, 8187, 17171, 29896, 29897, 13, 4706, 12066, 353, 1583, 29889, 657, 19582, 29898, 3075, 29889, 28599, 29897, 13, 4706, 1320, 353, 10696, 29889, 11291, 342, 19244, 29898, 8697, 29896, 29889, 12957, 29892, 12066, 29889, 12957, 29897, 13, 4706, 736, 6425, 29898, 5721, 29897, 529, 29871, 29900, 29889, 29900, 29900, 29900, 29941, 29871, 396, 29871, 29896, 15232, 29899, 7496, 13, 13, 1678, 822, 338, 29950, 1709, 29896, 29900, 12513, 29898, 1311, 1125, 13, 4706, 9995, 16969, 1565, 565, 5619, 29896, 29900, 338, 278, 1021, 408, 278, 21271, 29889, 9995, 13, 4706, 3699, 29896, 29900, 353, 1583, 29889, 657, 29950, 1709, 29898, 3075, 29889, 8187, 17171, 29896, 29900, 29897, 13, 4706, 286, 29883, 353, 1583, 29889, 657, 19582, 29898, 3075, 29889, 12513, 29897, 13, 4706, 1320, 353, 10696, 29889, 11291, 342, 19244, 29898, 8697, 29896, 29900, 29889, 12957, 29892, 286, 29883, 29889, 12957, 29897, 13, 4706, 736, 6425, 29898, 5721, 29897, 529, 29871, 29900, 29889, 29900, 29900, 29900, 29941, 29871, 396, 29871, 29896, 15232, 29899, 7496, 13, 13, 1678, 396, 6805, 5901, 4426, 6805, 396, 13, 13, 1678, 822, 338, 12130, 595, 284, 29898, 1311, 1125, 13, 4706, 9995, 16969, 1565, 565, 445, 8727, 338, 652, 595, 284, 29889, 9995, 13, 4706, 6575, 353, 1583, 29889, 657, 2061, 29898, 3075, 29889, 29903, 3904, 29897, 13, 4706, 286, 29883, 353, 1583, 29889, 657, 19582, 29898, 3075, 29889, 12513, 29897, 13, 13, 4706, 396, 3617, 321, 11303, 415, 936, 11909, 322, 1423, 565, 278, 13, 4706, 396, 6575, 338, 2038, 278, 28205, 29889, 13, 4706, 3405, 353, 1583, 29889, 1066, 29889, 5066, 13, 4706, 6575, 4717, 29892, 6575, 6185, 29880, 353, 3667, 29879, 29889, 1837, 7967, 4339, 29898, 11445, 29889, 12957, 29892, 6575, 29889, 5066, 29897, 13, 4706, 286, 29883, 4717, 29892, 286, 29883, 6185, 29880, 353, 3667, 29879, 29889, 1837, 7967, 4339, 29898, 14047, 29889, 12957, 29892, 29871, 29900, 29897, 13, 4706, 736, 3667, 29879, 29889, 275, 29909, 29205, 17241, 18162, 29898, 11445, 4717, 29892, 6575, 6185, 29880, 29892, 286, 29883, 4717, 29892, 3405, 29897, 13, 13, 1678, 822, 679, 29924, 6150, 4819, 559, 29898, 1311, 1125, 13, 4706, 9995, 16969, 278, 8576, 310, 278, 18786, 29889, 9995, 13, 4706, 6575, 353, 1583, 29889, 657, 2061, 29898, 3075, 29889, 29903, 3904, 29897, 13, 4706, 18786, 353, 1583, 29889, 657, 2061, 29898, 3075, 29889, 6720, 1164, 29897, 13, 4706, 1320, 353, 10696, 29889, 19244, 29898, 11445, 29889, 12957, 29892, 18786, 29889, 12957, 29897, 13, 4706, 565, 1320, 529, 29871, 29929, 29900, 29901, 13, 9651, 736, 1040, 29889, 6720, 1164, 29918, 3738, 29934, 1254, 29918, 13356, 1718, 4945, 13, 4706, 25342, 1320, 529, 29871, 29896, 29947, 29900, 29901, 13, 9651, 736, 1040, 29889, 6720, 1164, 29918, 1660, 6007, 29928, 29918, 13356, 1718, 4945, 13, 4706, 25342, 1320, 529, 29871, 29906, 29955, 29900, 29901, 13, 9651, 736, 1040, 29889, 6720, 1164, 29918, 4690, 8193, 29928, 29918, 13356, 1718, 4945, 13, 4706, 1683, 29901, 13, 9651, 736, 1040, 29889, 6720, 1164, 29918, 4375, 1254, 29918, 13356, 1718, 4945, 13, 13, 1678, 396, 6805, 4956, 279, 3639, 6805, 396, 13, 13, 1678, 822, 21635, 11609, 29898, 1311, 29892, 1629, 1125, 13, 4706, 9995, 16969, 445, 8727, 29915, 29879, 21635, 736, 363, 263, 29871, 13, 4706, 2183, 1629, 29889, 29871, 13, 308, 13, 4706, 9995, 13, 4706, 6575, 353, 1583, 29889, 657, 2061, 29898, 3075, 29889, 29903, 3904, 29897, 13, 4706, 2635, 353, 13373, 5410, 877, 29912, 29900, 6822, 29900, 29896, 29914, 29900, 29896, 4286, 4830, 29898, 6360, 511, 13, 462, 4706, 525, 29900, 29900, 29901, 29900, 29900, 742, 13, 462, 4706, 1583, 29889, 1256, 29889, 329, 1111, 600, 842, 29897, 13, 4706, 27236, 2539, 353, 321, 561, 331, 29889, 4622, 29903, 10170, 11609, 29898, 1256, 29892, 6575, 29889, 12957, 29897, 13, 4706, 736, 14477, 29898, 21935, 2539, 29892, 1583, 29889, 1066, 29892, 298, 9675, 29922, 1311, 29889, 9499, 952, 29897, 13, 2 ]
app/fedgraphnn/recsys_subgraph_link_pred/torch_subgraph_link_prediction.py
ray-ruisun/FedML
0
75942
<reponame>ray-ruisun/FedML import fedml from data.data_loader import * from model.gcn_link import GCNLinkPred from model.gat_link import GATLinkPred from model.sage_link import SAGELinkPred from trainer.fed_subgraph_lp_trainer import FedSubgraphLPTrainer from fedml.simulation import SimulatorMPI def load_data(args): if args.dataset not in ["ciao", "epinions"]: raise Exception("no such dataset!") args.pred_task = "link_prediction" args.metric = "MAE" if args.model == "gcn": args.normalize_features = True args.normalize_adjacency = True ( train_data_num, val_data_num, test_data_num, train_data_global, val_data_global, test_data_global, data_local_num_dict, train_data_local_dict, val_data_local_dict, test_data_local_dict, feature_dim, ) = load_partition_data(args, args.data_cache_dir, args.client_num_in_total) dataset = [ train_data_num, test_data_num, train_data_global, test_data_global, data_local_num_dict, train_data_local_dict, test_data_local_dict, feature_dim, ] return dataset def create_model(args, model_name, feature_dim): logging.info("create_model. model_name = %s" % (model_name)) if model_name == "gcn": model = GCNLinkPred(feature_dim, args.hidden_size, args.node_embedding_dim) elif model_name == "gat": model = GATLinkPred( feature_dim, args.hidden_size, args.node_embedding_dim, args.num_heads ) elif model_name == "sage": model = SAGELinkPred(feature_dim, args.hidden_size, args.node_embedding_dim) else: raise Exception("such model does not exist !") trainer = FedSubgraphLPTrainer(model) logging.info("Model and Trainer - done") return model, if __name__ == "__main__": # init FedML framework args = fedml.init() # init device device = fedml.device.get_device(args) # load data dataset, output_dim = load_data(args) # load model model, trainer = create_model(args, args.model_name) # start training simulator = SimulatorMPI(args, device, dataset, model, trainer) simulator.run()
[ 1, 529, 276, 1112, 420, 29958, 764, 29899, 582, 275, 348, 29914, 29943, 287, 1988, 13, 5215, 21242, 828, 13, 3166, 848, 29889, 1272, 29918, 12657, 1053, 334, 13, 3166, 1904, 29889, 29887, 18038, 29918, 2324, 1053, 402, 13778, 6595, 23084, 13, 3166, 1904, 29889, 28818, 29918, 2324, 1053, 402, 1299, 6595, 23084, 13, 3166, 1904, 29889, 29879, 482, 29918, 2324, 1053, 317, 10461, 6595, 23084, 13, 13, 3166, 1020, 4983, 29889, 29888, 287, 29918, 1491, 4262, 29918, 22833, 29918, 3018, 4983, 1053, 17972, 4035, 4262, 13208, 5323, 4983, 13, 3166, 21242, 828, 29889, 3601, 2785, 1053, 3439, 9183, 29924, 2227, 13, 13, 13, 1753, 2254, 29918, 1272, 29898, 5085, 1125, 13, 1678, 565, 6389, 29889, 24713, 451, 297, 6796, 1512, 29877, 613, 376, 1022, 262, 1080, 3108, 29901, 13, 4706, 12020, 8960, 703, 1217, 1316, 8783, 29991, 1159, 13, 13, 1678, 6389, 29889, 11965, 29918, 7662, 353, 376, 2324, 29918, 11965, 2463, 29908, 13, 13, 1678, 6389, 29889, 16414, 353, 376, 1529, 29923, 29908, 13, 13, 1678, 565, 6389, 29889, 4299, 1275, 376, 29887, 18038, 1115, 13, 4706, 6389, 29889, 8945, 675, 29918, 22100, 353, 5852, 13, 4706, 6389, 29889, 8945, 675, 29918, 26859, 562, 3819, 353, 5852, 13, 13, 1678, 313, 13, 4706, 7945, 29918, 1272, 29918, 1949, 29892, 13, 4706, 659, 29918, 1272, 29918, 1949, 29892, 13, 4706, 1243, 29918, 1272, 29918, 1949, 29892, 13, 4706, 7945, 29918, 1272, 29918, 10945, 29892, 13, 4706, 659, 29918, 1272, 29918, 10945, 29892, 13, 4706, 1243, 29918, 1272, 29918, 10945, 29892, 13, 4706, 848, 29918, 2997, 29918, 1949, 29918, 8977, 29892, 13, 4706, 7945, 29918, 1272, 29918, 2997, 29918, 8977, 29892, 13, 4706, 659, 29918, 1272, 29918, 2997, 29918, 8977, 29892, 13, 4706, 1243, 29918, 1272, 29918, 2997, 29918, 8977, 29892, 13, 4706, 4682, 29918, 6229, 29892, 13, 1678, 1723, 353, 2254, 29918, 16707, 29918, 1272, 29898, 5085, 29892, 6389, 29889, 1272, 29918, 8173, 29918, 3972, 29892, 6389, 29889, 4645, 29918, 1949, 29918, 262, 29918, 7827, 29897, 13, 13, 1678, 8783, 353, 518, 13, 4706, 7945, 29918, 1272, 29918, 1949, 29892, 13, 4706, 1243, 29918, 1272, 29918, 1949, 29892, 13, 4706, 7945, 29918, 1272, 29918, 10945, 29892, 13, 4706, 1243, 29918, 1272, 29918, 10945, 29892, 13, 4706, 848, 29918, 2997, 29918, 1949, 29918, 8977, 29892, 13, 4706, 7945, 29918, 1272, 29918, 2997, 29918, 8977, 29892, 13, 4706, 1243, 29918, 1272, 29918, 2997, 29918, 8977, 29892, 13, 4706, 4682, 29918, 6229, 29892, 13, 1678, 4514, 13, 13, 1678, 736, 8783, 29871, 13, 13, 13, 1753, 1653, 29918, 4299, 29898, 5085, 29892, 1904, 29918, 978, 29892, 4682, 29918, 6229, 1125, 13, 1678, 12183, 29889, 3888, 703, 3258, 29918, 4299, 29889, 1904, 29918, 978, 353, 1273, 29879, 29908, 1273, 313, 4299, 29918, 978, 876, 13, 1678, 565, 1904, 29918, 978, 1275, 376, 29887, 18038, 1115, 13, 4706, 1904, 353, 402, 13778, 6595, 23084, 29898, 14394, 29918, 6229, 29892, 6389, 29889, 10892, 29918, 2311, 29892, 6389, 29889, 3177, 29918, 17987, 8497, 29918, 6229, 29897, 13, 1678, 25342, 1904, 29918, 978, 1275, 376, 28818, 1115, 13, 4706, 1904, 353, 402, 1299, 6595, 23084, 29898, 13, 9651, 4682, 29918, 6229, 29892, 6389, 29889, 10892, 29918, 2311, 29892, 6389, 29889, 3177, 29918, 17987, 8497, 29918, 6229, 29892, 6389, 29889, 1949, 29918, 2813, 29879, 13, 4706, 1723, 13, 1678, 25342, 1904, 29918, 978, 1275, 376, 29879, 482, 1115, 13, 4706, 1904, 353, 317, 10461, 6595, 23084, 29898, 14394, 29918, 6229, 29892, 6389, 29889, 10892, 29918, 2311, 29892, 6389, 29889, 3177, 29918, 17987, 8497, 29918, 6229, 29897, 13, 1678, 1683, 29901, 13, 4706, 12020, 8960, 703, 14565, 1904, 947, 451, 1863, 1738, 1159, 13, 1678, 1020, 4983, 353, 17972, 4035, 4262, 13208, 5323, 4983, 29898, 4299, 29897, 13, 1678, 12183, 29889, 3888, 703, 3195, 322, 3201, 4983, 29871, 448, 2309, 1159, 13, 1678, 736, 1904, 29892, 29871, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 396, 2069, 17972, 1988, 6890, 13, 1678, 6389, 353, 21242, 828, 29889, 2344, 580, 13, 13, 1678, 396, 2069, 4742, 13, 1678, 4742, 353, 21242, 828, 29889, 10141, 29889, 657, 29918, 10141, 29898, 5085, 29897, 13, 13, 1678, 396, 2254, 848, 13, 1678, 8783, 29892, 1962, 29918, 6229, 353, 2254, 29918, 1272, 29898, 5085, 29897, 13, 13, 1678, 396, 2254, 1904, 13, 1678, 1904, 29892, 1020, 4983, 353, 1653, 29918, 4299, 29898, 5085, 29892, 6389, 29889, 4299, 29918, 978, 29897, 13, 13, 1678, 396, 1369, 6694, 13, 1678, 1027, 9183, 353, 3439, 9183, 29924, 2227, 29898, 5085, 29892, 4742, 29892, 8783, 29892, 1904, 29892, 1020, 4983, 29897, 13, 1678, 1027, 9183, 29889, 3389, 580, 2 ]
chapter_06/03_line_numbers.py
SergeHall/Tony-Gaddis-Python-4th
2
44752
<reponame>SergeHall/Tony-Gaddis-Python-4th # 3. Номера строк. Напишите программу, которая запрашивает у пользователя # имя файла. Программа должна вывести на экран содержимое файла, при этом # каждая строка должна предваряться ее номером и двоеточием. Нумерация строк # должна начинаться с 1. number_list.txt def main(): try: name_file = input('Name file + .file extension: ') open_file = open(str(name_file), 'r') count = 1 for content in open_file: content = content.rstrip('\n') print(count, ': ', content, sep='') count += 1 open_file.close() except ValueError: print('ValueError') except FileNotFoundError: print('FileNotFoundError') main()
[ 1, 529, 276, 1112, 420, 29958, 1748, 479, 29950, 497, 29914, 29911, 2592, 29899, 29954, 1202, 275, 29899, 11980, 29899, 29946, 386, 13, 29937, 259, 29941, 29889, 16571, 1488, 494, 2091, 16635, 29889, 2372, 1668, 1911, 730, 20796, 1805, 29892, 21105, 1077, 8821, 1911, 20120, 863, 18636, 9718, 11146, 13, 29937, 29871, 606, 5010, 6725, 29977, 684, 29889, 6807, 2194, 29959, 1155, 19611, 477, 2771, 1521, 1415, 665, 18796, 3048, 1778, 6620, 1969, 1630, 29919, 6725, 29977, 684, 29892, 1695, 17045, 13, 29937, 29871, 1787, 12393, 29970, 2091, 576, 642, 19611, 477, 4570, 846, 2359, 4199, 1694, 29919, 4228, 1488, 4416, 606, 10332, 25930, 1499, 3098, 29889, 1392, 29960, 1488, 494, 5274, 2091, 16635, 13, 29937, 29871, 19611, 477, 665, 14005, 4199, 531, 29871, 29896, 29889, 1353, 29918, 1761, 29889, 3945, 13, 13, 1753, 1667, 7295, 13, 1678, 1018, 29901, 13, 4706, 1024, 29918, 1445, 353, 1881, 877, 1170, 934, 718, 869, 1445, 6081, 29901, 25710, 13, 4706, 1722, 29918, 1445, 353, 1722, 29898, 710, 29898, 978, 29918, 1445, 511, 525, 29878, 1495, 13, 4706, 2302, 353, 29871, 29896, 13, 4706, 363, 2793, 297, 1722, 29918, 1445, 29901, 13, 9651, 2793, 353, 2793, 29889, 29878, 17010, 28909, 29876, 1495, 13, 9651, 1596, 29898, 2798, 29892, 525, 29901, 13420, 2793, 29892, 16345, 2433, 1495, 13, 9651, 2302, 4619, 29871, 29896, 13, 4706, 1722, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 1596, 877, 1917, 2392, 1495, 13, 1678, 5174, 3497, 17413, 2392, 29901, 13, 4706, 1596, 877, 2283, 17413, 2392, 1495, 13, 13, 13, 3396, 580, 13, 2 ]
kde/cudakde.py
atfienberg/kde
0
161768
# pylint: disable=invalid-name from __future__ import absolute_import, division __license__ = """MIT License Copyright (c) 2014-2019 <NAME> and <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import warnings import numpy as n from .classes import KDE class gaussian_kde(KDE): def __init__(self, data, weights=None, kde_values=None, use_cuda=True, adaptive=False, weight_adaptive_bw=False, alpha=0.3, bw_method='silverman'): if kde_values != None: raise NotImplementedError("`kde_values` is not supported for" " cudakde.") KDE.__init__(self, data, use_cuda, weights=weights, alpha=alpha, method=bw_method) self.weighted = False if weights is None or len(weights) == 0 else True if adaptive: if not self.weighted and weight_adaptive_bw: warnings.warn("Since `weights` aren't given" " `weight_adaptive_bw` will have no effect!") self.calcLambdas(weights=weight_adaptive_bw, weightedCov=weight_adaptive_bw) else: self.lambdas = n.ones(self.n) def __call__(self, points): points = n.atleast_2d(points) self.kde(points, weights=self.weighted, weightedCov=self.weighted) return n.array(self.values) class bootstrap_kde(object): def __init__(self, data, niter=10, weights=None, **kwargs): assert int(niter) == float(niter) niter = int(niter) self.kernels = [] self.bootstrap_indices = [] self.data = n.atleast_2d(data) self.d, self.n = self.data.shape self.weighted = False if weights is None or len(weights) == 0 else True for _ in xrange(niter): indices = n.array(self.get_bootstrap_indices()) self.bootstrap_indices.append(indices) if self.weighted: kernel = gaussian_kde(data[..., indices], weights=weights[indices], **kwargs) else: kernel = gaussian_kde(data[..., indices], **kwargs) self.kernels.append(kernel) def __call__(self, points): return self.evaluate(points) def evaluate(self, points): points = n.atleast_2d(points) _, m = points.shape means, sqmeans = n.zeros(m), n.zeros(m) for kernel in self.kernels: values = kernel(points) means += values sqmeans += values**2 means /= len(self.kernels) sqmeans /= len(self.kernels) errors = n.sqrt(sqmeans - means**2) return means, errors def get_bootstrap_indices(self): bootstrap_indices = n.random.choice(self.n, size=self.n, replace=True) return bootstrap_indices
[ 1, 396, 282, 2904, 524, 29901, 11262, 29922, 20965, 29899, 978, 13, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 29892, 8542, 13, 13, 1649, 506, 1947, 1649, 353, 9995, 26349, 19245, 13, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29946, 29899, 29906, 29900, 29896, 29929, 529, 5813, 29958, 322, 529, 5813, 29958, 13, 13, 27293, 338, 1244, 1609, 16896, 29892, 3889, 310, 8323, 29892, 304, 738, 2022, 4017, 292, 263, 3509, 13, 974, 445, 7047, 322, 6942, 5106, 2066, 313, 1552, 376, 6295, 14093, 4968, 304, 5376, 13, 262, 278, 18540, 1728, 24345, 29892, 3704, 1728, 29485, 278, 10462, 13, 517, 671, 29892, 3509, 29892, 6623, 29892, 10366, 29892, 9805, 29892, 1320, 2666, 29892, 269, 803, 1947, 29892, 322, 29914, 272, 19417, 13, 9708, 583, 310, 278, 18540, 29892, 322, 304, 14257, 12407, 304, 6029, 278, 18540, 338, 13, 29888, 595, 3276, 304, 437, 577, 29892, 4967, 304, 278, 1494, 5855, 29901, 13, 13, 1576, 2038, 3509, 1266, 8369, 322, 445, 10751, 8369, 4091, 367, 5134, 297, 599, 13, 9708, 583, 470, 23228, 2011, 1080, 310, 278, 18540, 29889, 13, 13, 28350, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 376, 3289, 8519, 613, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29979, 8079, 13764, 29979, 476, 22255, 29892, 8528, 15094, 1799, 6323, 13, 29902, 3580, 5265, 3352, 29892, 2672, 6154, 15789, 4214, 350, 2692, 6058, 27848, 3352, 7495, 6093, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 29892, 13, 29943, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 5300, 405, 1164, 1177, 15860, 1177, 1692, 13780, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 13, 20656, 29950, 24125, 6323, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 20700, 17705, 6181, 15842, 13764, 29979, 315, 4375, 7833, 29892, 21330, 1529, 1692, 29903, 6323, 438, 29911, 4448, 13, 5265, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 13764, 319, 9838, 8079, 8707, 29911, 4717, 1783, 29892, 323, 8476, 6323, 438, 29911, 4448, 22119, 1660, 29892, 9033, 3235, 4214, 3895, 29892, 13, 12015, 8079, 6323, 2672, 8707, 8186, 9838, 22659, 6093, 7791, 7818, 12982, 1525, 6323, 6093, 501, 1660, 6323, 438, 29911, 4448, 5012, 1964, 4214, 29903, 2672, 6093, 13, 6156, 7818, 12982, 1525, 29889, 13, 15945, 29908, 13, 13, 5215, 18116, 13, 5215, 12655, 408, 302, 13, 3166, 869, 13203, 1053, 476, 2287, 13, 13, 13, 1990, 330, 17019, 29918, 29895, 311, 29898, 29968, 2287, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 848, 29892, 18177, 29922, 8516, 29892, 26109, 29918, 5975, 29922, 8516, 29892, 671, 29918, 29883, 6191, 29922, 5574, 29892, 13, 462, 7744, 573, 29922, 8824, 29892, 7688, 29918, 1114, 415, 573, 29918, 29890, 29893, 29922, 8824, 29892, 15595, 29922, 29900, 29889, 29941, 29892, 13, 462, 289, 29893, 29918, 5696, 2433, 25590, 369, 1171, 29374, 13, 4706, 565, 26109, 29918, 5975, 2804, 6213, 29901, 13, 9651, 12020, 2216, 1888, 2037, 287, 2392, 703, 29952, 29895, 311, 29918, 5975, 29952, 338, 451, 6969, 363, 29908, 13, 462, 462, 418, 376, 274, 566, 557, 311, 23157, 13, 4706, 476, 2287, 17255, 2344, 12035, 1311, 29892, 848, 29892, 671, 29918, 29883, 6191, 29892, 18177, 29922, 705, 5861, 29892, 15595, 29922, 2312, 29892, 13, 462, 268, 1158, 29922, 29890, 29893, 29918, 5696, 29897, 13, 13, 4706, 1583, 29889, 7915, 287, 353, 7700, 565, 18177, 338, 6213, 470, 7431, 29898, 705, 5861, 29897, 1275, 29871, 29900, 1683, 5852, 13, 13, 4706, 565, 7744, 573, 29901, 13, 9651, 565, 451, 1583, 29889, 7915, 287, 322, 7688, 29918, 1114, 415, 573, 29918, 29890, 29893, 29901, 13, 18884, 18116, 29889, 25442, 703, 23036, 421, 705, 5861, 29952, 9455, 29915, 29873, 2183, 29908, 13, 462, 795, 376, 421, 7915, 29918, 1114, 415, 573, 29918, 29890, 29893, 29952, 674, 505, 694, 2779, 29991, 1159, 13, 9651, 1583, 29889, 28667, 29931, 1117, 17370, 29898, 705, 5861, 29922, 7915, 29918, 1114, 415, 573, 29918, 29890, 29893, 29892, 13, 462, 632, 7688, 287, 29907, 586, 29922, 7915, 29918, 1114, 415, 573, 29918, 29890, 29893, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 29880, 1117, 17370, 353, 302, 29889, 2873, 29898, 1311, 29889, 29876, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 3291, 1125, 13, 4706, 3291, 353, 302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 9748, 29897, 13, 4706, 1583, 29889, 29895, 311, 29898, 9748, 29892, 18177, 29922, 1311, 29889, 7915, 287, 29892, 7688, 287, 29907, 586, 29922, 1311, 29889, 7915, 287, 29897, 13, 4706, 736, 302, 29889, 2378, 29898, 1311, 29889, 5975, 29897, 13, 13, 13, 1990, 16087, 29918, 29895, 311, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 848, 29892, 302, 1524, 29922, 29896, 29900, 29892, 18177, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 4974, 938, 29898, 29876, 1524, 29897, 1275, 5785, 29898, 29876, 1524, 29897, 13, 4706, 302, 1524, 353, 938, 29898, 29876, 1524, 29897, 13, 13, 4706, 1583, 29889, 22178, 1379, 353, 5159, 13, 4706, 1583, 29889, 8704, 29918, 513, 1575, 353, 5159, 13, 13, 4706, 1583, 29889, 1272, 353, 302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 1272, 29897, 13, 4706, 1583, 29889, 29881, 29892, 1583, 29889, 29876, 353, 1583, 29889, 1272, 29889, 12181, 13, 4706, 1583, 29889, 7915, 287, 353, 7700, 565, 18177, 338, 6213, 470, 7431, 29898, 705, 5861, 29897, 1275, 29871, 29900, 1683, 5852, 13, 13, 4706, 363, 903, 297, 921, 3881, 29898, 29876, 1524, 1125, 13, 9651, 16285, 353, 302, 29889, 2378, 29898, 1311, 29889, 657, 29918, 8704, 29918, 513, 1575, 3101, 13, 9651, 1583, 29889, 8704, 29918, 513, 1575, 29889, 4397, 29898, 513, 1575, 29897, 13, 9651, 565, 1583, 29889, 7915, 287, 29901, 13, 18884, 8466, 353, 330, 17019, 29918, 29895, 311, 29898, 1272, 29961, 16361, 16285, 1402, 13, 462, 462, 418, 18177, 29922, 705, 5861, 29961, 513, 1575, 1402, 13, 462, 462, 418, 3579, 19290, 29897, 13, 9651, 1683, 29901, 13, 18884, 8466, 353, 330, 17019, 29918, 29895, 311, 29898, 1272, 29961, 16361, 16285, 1402, 3579, 19290, 29897, 13, 9651, 1583, 29889, 22178, 1379, 29889, 4397, 29898, 17460, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 3291, 1125, 13, 4706, 736, 1583, 29889, 24219, 403, 29898, 9748, 29897, 13, 13, 1678, 822, 14707, 29898, 1311, 29892, 3291, 1125, 13, 4706, 3291, 353, 302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 9748, 29897, 13, 4706, 17117, 286, 353, 3291, 29889, 12181, 13, 4706, 2794, 29892, 18074, 1004, 550, 353, 302, 29889, 3298, 359, 29898, 29885, 511, 302, 29889, 3298, 359, 29898, 29885, 29897, 13, 4706, 363, 8466, 297, 1583, 29889, 22178, 1379, 29901, 13, 9651, 1819, 353, 8466, 29898, 9748, 29897, 13, 9651, 2794, 4619, 1819, 13, 9651, 18074, 1004, 550, 4619, 1819, 1068, 29906, 13, 4706, 2794, 847, 29922, 7431, 29898, 1311, 29889, 22178, 1379, 29897, 13, 4706, 18074, 1004, 550, 847, 29922, 7431, 29898, 1311, 29889, 22178, 1379, 29897, 13, 4706, 4436, 353, 302, 29889, 3676, 29898, 3044, 1004, 550, 448, 2794, 1068, 29906, 29897, 13, 4706, 736, 2794, 29892, 4436, 13, 13, 1678, 822, 679, 29918, 8704, 29918, 513, 1575, 29898, 1311, 1125, 13, 4706, 16087, 29918, 513, 1575, 353, 302, 29889, 8172, 29889, 16957, 29898, 1311, 29889, 29876, 29892, 2159, 29922, 1311, 29889, 29876, 29892, 5191, 29922, 5574, 29897, 13, 4706, 736, 16087, 29918, 513, 1575, 13, 2 ]
alipay/aop/api/domain/SsdataDataserviceRiskAudioVerifyModel.py
articuly/alipay-sdk-python-all
0
196028
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * class SsdataDataserviceRiskAudioVerifyModel(object): def __init__(self): self._audio_content = None self._audio_type = None self._checker = None self._risk_type = None self._sample_rate = None @property def audio_content(self): return self._audio_content @audio_content.setter def audio_content(self, value): self._audio_content = value @property def audio_type(self): return self._audio_type @audio_type.setter def audio_type(self, value): self._audio_type = value @property def checker(self): return self._checker @checker.setter def checker(self, value): self._checker = value @property def risk_type(self): return self._risk_type @risk_type.setter def risk_type(self, value): if isinstance(value, list): self._risk_type = list() for i in value: self._risk_type.append(i) @property def sample_rate(self): return self._sample_rate @sample_rate.setter def sample_rate(self, value): self._sample_rate = value def to_alipay_dict(self): params = dict() if self.audio_content: if hasattr(self.audio_content, 'to_alipay_dict'): params['audio_content'] = self.audio_content.to_alipay_dict() else: params['audio_content'] = self.audio_content if self.audio_type: if hasattr(self.audio_type, 'to_alipay_dict'): params['audio_type'] = self.audio_type.to_alipay_dict() else: params['audio_type'] = self.audio_type if self.checker: if hasattr(self.checker, 'to_alipay_dict'): params['checker'] = self.checker.to_alipay_dict() else: params['checker'] = self.checker if self.risk_type: if isinstance(self.risk_type, list): for i in range(0, len(self.risk_type)): element = self.risk_type[i] if hasattr(element, 'to_alipay_dict'): self.risk_type[i] = element.to_alipay_dict() if hasattr(self.risk_type, 'to_alipay_dict'): params['risk_type'] = self.risk_type.to_alipay_dict() else: params['risk_type'] = self.risk_type if self.sample_rate: if hasattr(self.sample_rate, 'to_alipay_dict'): params['sample_rate'] = self.sample_rate.to_alipay_dict() else: params['sample_rate'] = self.sample_rate return params @staticmethod def from_alipay_dict(d): if not d: return None o = SsdataDataserviceRiskAudioVerifyModel() if 'audio_content' in d: o.audio_content = d['audio_content'] if 'audio_type' in d: o.audio_type = d['audio_type'] if 'checker' in d: o.checker = d['checker'] if 'risk_type' in d: o.risk_type = d['risk_type'] if 'sample_rate' in d: o.sample_rate = d['sample_rate'] return o
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 2560, 3126, 408, 4390, 13, 13, 3166, 394, 666, 388, 29889, 29874, 459, 29889, 2754, 29889, 23362, 29889, 4736, 26570, 1053, 334, 13, 13, 13, 1990, 317, 29879, 1272, 16390, 29440, 1087, 29934, 3873, 17111, 6565, 1598, 3195, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 3032, 18494, 29918, 3051, 353, 6213, 13, 4706, 1583, 3032, 18494, 29918, 1853, 353, 6213, 13, 4706, 1583, 3032, 3198, 261, 353, 6213, 13, 4706, 1583, 3032, 3780, 29895, 29918, 1853, 353, 6213, 13, 4706, 1583, 3032, 11249, 29918, 10492, 353, 6213, 13, 13, 1678, 732, 6799, 13, 1678, 822, 10348, 29918, 3051, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 18494, 29918, 3051, 13, 13, 1678, 732, 18494, 29918, 3051, 29889, 842, 357, 13, 1678, 822, 10348, 29918, 3051, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 18494, 29918, 3051, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 10348, 29918, 1853, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 18494, 29918, 1853, 13, 13, 1678, 732, 18494, 29918, 1853, 29889, 842, 357, 13, 1678, 822, 10348, 29918, 1853, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 18494, 29918, 1853, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 1423, 261, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 3198, 261, 13, 13, 1678, 732, 3198, 261, 29889, 842, 357, 13, 1678, 822, 1423, 261, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 3198, 261, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 12045, 29918, 1853, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 3780, 29895, 29918, 1853, 13, 13, 1678, 732, 3780, 29895, 29918, 1853, 29889, 842, 357, 13, 1678, 822, 12045, 29918, 1853, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 338, 8758, 29898, 1767, 29892, 1051, 1125, 13, 9651, 1583, 3032, 3780, 29895, 29918, 1853, 353, 1051, 580, 13, 9651, 363, 474, 297, 995, 29901, 13, 18884, 1583, 3032, 3780, 29895, 29918, 1853, 29889, 4397, 29898, 29875, 29897, 13, 1678, 732, 6799, 13, 1678, 822, 4559, 29918, 10492, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 11249, 29918, 10492, 13, 13, 1678, 732, 11249, 29918, 10492, 29889, 842, 357, 13, 1678, 822, 4559, 29918, 10492, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 11249, 29918, 10492, 353, 995, 13, 13, 13, 1678, 822, 304, 29918, 284, 666, 388, 29918, 8977, 29898, 1311, 1125, 13, 4706, 8636, 353, 9657, 580, 13, 4706, 565, 1583, 29889, 18494, 29918, 3051, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 18494, 29918, 3051, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 18494, 29918, 3051, 2033, 353, 1583, 29889, 18494, 29918, 3051, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 18494, 29918, 3051, 2033, 353, 1583, 29889, 18494, 29918, 3051, 13, 4706, 565, 1583, 29889, 18494, 29918, 1853, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 18494, 29918, 1853, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 18494, 29918, 1853, 2033, 353, 1583, 29889, 18494, 29918, 1853, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 18494, 29918, 1853, 2033, 353, 1583, 29889, 18494, 29918, 1853, 13, 4706, 565, 1583, 29889, 3198, 261, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 3198, 261, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 3198, 261, 2033, 353, 1583, 29889, 3198, 261, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 3198, 261, 2033, 353, 1583, 29889, 3198, 261, 13, 4706, 565, 1583, 29889, 3780, 29895, 29918, 1853, 29901, 13, 9651, 565, 338, 8758, 29898, 1311, 29889, 3780, 29895, 29918, 1853, 29892, 1051, 1125, 13, 18884, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 1311, 29889, 3780, 29895, 29918, 1853, 22164, 13, 462, 1678, 1543, 353, 1583, 29889, 3780, 29895, 29918, 1853, 29961, 29875, 29962, 13, 462, 1678, 565, 756, 5552, 29898, 5029, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 462, 4706, 1583, 29889, 3780, 29895, 29918, 1853, 29961, 29875, 29962, 353, 1543, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 3780, 29895, 29918, 1853, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 3780, 29895, 29918, 1853, 2033, 353, 1583, 29889, 3780, 29895, 29918, 1853, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 3780, 29895, 29918, 1853, 2033, 353, 1583, 29889, 3780, 29895, 29918, 1853, 13, 4706, 565, 1583, 29889, 11249, 29918, 10492, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 11249, 29918, 10492, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 11249, 29918, 10492, 2033, 353, 1583, 29889, 11249, 29918, 10492, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 11249, 29918, 10492, 2033, 353, 1583, 29889, 11249, 29918, 10492, 13, 4706, 736, 8636, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 515, 29918, 284, 666, 388, 29918, 8977, 29898, 29881, 1125, 13, 4706, 565, 451, 270, 29901, 13, 9651, 736, 6213, 13, 4706, 288, 353, 317, 29879, 1272, 16390, 29440, 1087, 29934, 3873, 17111, 6565, 1598, 3195, 580, 13, 4706, 565, 525, 18494, 29918, 3051, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 18494, 29918, 3051, 353, 270, 1839, 18494, 29918, 3051, 2033, 13, 4706, 565, 525, 18494, 29918, 1853, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 18494, 29918, 1853, 353, 270, 1839, 18494, 29918, 1853, 2033, 13, 4706, 565, 525, 3198, 261, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 3198, 261, 353, 270, 1839, 3198, 261, 2033, 13, 4706, 565, 525, 3780, 29895, 29918, 1853, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 3780, 29895, 29918, 1853, 353, 270, 1839, 3780, 29895, 29918, 1853, 2033, 13, 4706, 565, 525, 11249, 29918, 10492, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 11249, 29918, 10492, 353, 270, 1839, 11249, 29918, 10492, 2033, 13, 4706, 736, 288, 13, 13, 13, 2 ]
bp_data.py
basf/bscience-backend
1
192186
#from pprint import pprint import json from unidecode import unidecode from flask import Blueprint, current_app, request, Response from i_structures.struct_utils import detect_format, poscar_to_ase, optimade_to_ase, refine, get_formula from i_structures.cif_utils import cif_to_ase from i_data import Data_type from utils import get_data_storage, fmt_msg, key_auth, is_plain_text, html_formula, is_valid_uuid, ase_serialize bp_data = Blueprint('data', __name__, url_prefix='/data') @bp_data.route("/create", methods=['POST']) @key_auth def create(): """ Data item recognition and saving logics Expects content: string Returns JSON->error: string or confirmation object {object->uuid, object->type, object->name} """ content = request.values.get('content') if not content: return fmt_msg('Empty request') if not 0 < len(content) < 200000: return fmt_msg('Request size is invalid') if not is_plain_text(content): #return fmt_msg('Request contains unsupported (non-latin) characters') content = unidecode(content) fmt = detect_format(content) if fmt == 'cif': ase_obj, error = cif_to_ase(content) elif fmt == 'poscar': ase_obj, error = poscar_to_ase(content) elif fmt == 'optimade': ase_obj, error = optimade_to_ase(content) else: return fmt_msg('Provided data format unsuitable or not recognized') if error: return fmt_msg(error) if 'disordered' in ase_obj.info: return fmt_msg('Structural disorder is currently not supported') ase_obj, error = refine(ase_obj, conventional_cell=True) if error: return fmt_msg(error) formula = get_formula(ase_obj) content = ase_serialize(ase_obj) db = get_data_storage() uuid = db.put_item(formula, content, Data_type.structure) db.close() return Response(json.dumps(dict( uuid=uuid, type=Data_type.structure, name=html_formula(formula), ), indent=4), content_type='application/json', status=200) @bp_data.route("/listing", methods=['POST']) @key_auth def listing(): """ Expects uuid: uuid or uuid[] Returns JSON->error: string or listing [ {object->uuid, object->type, object->name}, ... ] """ uuid = request.values.get('uuid') #current_app.logger.warning(uuid) if not uuid: return fmt_msg('Empty request') db = get_data_storage() if ':' in uuid: uuids = set( uuid.split(':') ) for uuid in uuids: if not is_valid_uuid(uuid): return fmt_msg('Invalid request') items = db.get_items(list(uuids)) #found_uuids = set( [item['uuid'] for item in items] ) #if found_uuids != uuids: # return fmt_msg('No such content', 204) else: if not is_valid_uuid(uuid): return fmt_msg('Invalid request') item = db.get_item(uuid) items = [item] if item else [] if not items: return fmt_msg('No such content', 204) db.close() items = [ dict( uuid=item['uuid'], name=html_formula(item['name']), type=item['type']) for item in items ] return Response(json.dumps(items, indent=4), content_type='application/json', status=200) @bp_data.route("/delete", methods=['POST']) @key_auth def delete(): """ Expects uuid: uuid Returns JSON->error: string or JSON empty dict """ uuid = request.values.get('uuid') if not uuid or not is_valid_uuid(uuid): return fmt_msg('Empty or invalid request') db = get_data_storage() result = db.drop_item(uuid) db.close() if result: return Response('{}', content_type='application/json', status=200) return fmt_msg('No such content', 204)
[ 1, 29871, 13, 29937, 3166, 282, 2158, 1053, 282, 2158, 13, 5215, 4390, 13, 3166, 443, 680, 401, 1053, 443, 680, 401, 13, 13, 3166, 29784, 1053, 10924, 2158, 29892, 1857, 29918, 932, 29892, 2009, 29892, 13291, 13, 13, 3166, 474, 29918, 4984, 1973, 29889, 4984, 29918, 13239, 1053, 6459, 29918, 4830, 29892, 926, 4287, 29918, 517, 29918, 559, 29892, 5994, 1943, 29918, 517, 29918, 559, 29892, 2143, 457, 29892, 679, 29918, 689, 2497, 13, 3166, 474, 29918, 4984, 1973, 29889, 29883, 361, 29918, 13239, 1053, 274, 361, 29918, 517, 29918, 559, 13, 3166, 474, 29918, 1272, 1053, 3630, 29918, 1853, 13, 13, 3166, 3667, 29879, 1053, 679, 29918, 1272, 29918, 12925, 29892, 19200, 29918, 7645, 29892, 1820, 29918, 5150, 29892, 338, 29918, 24595, 29918, 726, 29892, 3472, 29918, 689, 2497, 29892, 338, 29918, 3084, 29918, 25118, 29892, 263, 344, 29918, 643, 6646, 13, 13, 13, 25288, 29918, 1272, 353, 10924, 2158, 877, 1272, 742, 4770, 978, 1649, 29892, 3142, 29918, 13506, 2433, 29914, 1272, 1495, 13, 13, 13, 29992, 25288, 29918, 1272, 29889, 13134, 11974, 3258, 613, 3519, 29922, 1839, 5438, 11287, 13, 29992, 1989, 29918, 5150, 13, 1753, 1653, 7295, 13, 1678, 9995, 13, 1678, 3630, 2944, 19679, 322, 14238, 1480, 1199, 13, 1678, 1222, 1103, 29879, 13, 4706, 2793, 29901, 1347, 13, 1678, 16969, 13, 4706, 4663, 976, 2704, 29901, 1347, 13, 4706, 470, 9659, 362, 1203, 13, 4706, 426, 3318, 976, 25118, 29892, 1203, 976, 1853, 29892, 1203, 976, 978, 29913, 13, 1678, 9995, 13, 1678, 2793, 353, 2009, 29889, 5975, 29889, 657, 877, 3051, 1495, 13, 1678, 565, 451, 2793, 29901, 13, 4706, 736, 19200, 29918, 7645, 877, 8915, 2009, 1495, 13, 13, 1678, 565, 451, 29871, 29900, 529, 7431, 29898, 3051, 29897, 529, 29871, 29906, 29900, 29900, 29900, 29900, 29900, 29901, 13, 4706, 736, 19200, 29918, 7645, 877, 3089, 2159, 338, 8340, 1495, 13, 13, 1678, 565, 451, 338, 29918, 24595, 29918, 726, 29898, 3051, 1125, 13, 4706, 396, 2457, 19200, 29918, 7645, 877, 3089, 3743, 443, 23765, 313, 5464, 29899, 5066, 262, 29897, 4890, 1495, 13, 4706, 2793, 353, 443, 680, 401, 29898, 3051, 29897, 13, 13, 1678, 19200, 353, 6459, 29918, 4830, 29898, 3051, 29897, 13, 13, 1678, 565, 19200, 1275, 525, 29883, 361, 2396, 13, 4706, 263, 344, 29918, 5415, 29892, 1059, 353, 274, 361, 29918, 517, 29918, 559, 29898, 3051, 29897, 13, 13, 1678, 25342, 19200, 1275, 525, 1066, 4287, 2396, 13, 4706, 263, 344, 29918, 5415, 29892, 1059, 353, 926, 4287, 29918, 517, 29918, 559, 29898, 3051, 29897, 13, 13, 1678, 25342, 19200, 1275, 525, 20640, 1943, 2396, 13, 4706, 263, 344, 29918, 5415, 29892, 1059, 353, 5994, 1943, 29918, 517, 29918, 559, 29898, 3051, 29897, 13, 13, 1678, 1683, 29901, 736, 19200, 29918, 7645, 877, 1184, 29894, 2618, 848, 3402, 443, 2146, 8270, 470, 451, 14831, 1495, 13, 13, 1678, 565, 1059, 29901, 736, 19200, 29918, 7645, 29898, 2704, 29897, 13, 13, 1678, 565, 525, 2218, 21693, 29915, 297, 263, 344, 29918, 5415, 29889, 3888, 29901, 13, 4706, 736, 19200, 29918, 7645, 877, 19560, 3631, 766, 2098, 338, 5279, 451, 6969, 1495, 13, 13, 1678, 263, 344, 29918, 5415, 29892, 1059, 353, 2143, 457, 29898, 559, 29918, 5415, 29892, 28557, 29918, 3729, 29922, 5574, 29897, 13, 1678, 565, 1059, 29901, 13, 4706, 736, 19200, 29918, 7645, 29898, 2704, 29897, 13, 13, 1678, 7063, 353, 679, 29918, 689, 2497, 29898, 559, 29918, 5415, 29897, 13, 1678, 2793, 353, 263, 344, 29918, 643, 6646, 29898, 559, 29918, 5415, 29897, 13, 13, 1678, 4833, 353, 679, 29918, 1272, 29918, 12925, 580, 13, 1678, 318, 5416, 353, 4833, 29889, 649, 29918, 667, 29898, 689, 2497, 29892, 2793, 29892, 3630, 29918, 1853, 29889, 23905, 29897, 13, 1678, 4833, 29889, 5358, 580, 13, 13, 1678, 736, 13291, 29898, 3126, 29889, 29881, 17204, 29898, 8977, 29898, 13, 4706, 318, 5416, 29922, 25118, 29892, 13, 4706, 1134, 29922, 1469, 29918, 1853, 29889, 23905, 29892, 13, 4706, 1024, 29922, 1420, 29918, 689, 2497, 29898, 689, 2497, 511, 13, 1678, 10353, 29536, 29922, 29946, 511, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 4660, 29922, 29906, 29900, 29900, 29897, 13, 13, 13, 29992, 25288, 29918, 1272, 29889, 13134, 11974, 1761, 292, 613, 3519, 29922, 1839, 5438, 11287, 13, 29992, 1989, 29918, 5150, 13, 1753, 18028, 7295, 13, 1678, 9995, 13, 1678, 1222, 1103, 29879, 13, 4706, 318, 5416, 29901, 318, 5416, 470, 318, 5416, 2636, 13, 1678, 16969, 13, 4706, 4663, 976, 2704, 29901, 1347, 13, 4706, 470, 18028, 13, 4706, 518, 426, 3318, 976, 25118, 29892, 1203, 976, 1853, 29892, 1203, 976, 978, 1118, 2023, 4514, 13, 1678, 9995, 13, 1678, 318, 5416, 353, 2009, 29889, 5975, 29889, 657, 877, 25118, 1495, 13, 1678, 396, 3784, 29918, 932, 29889, 21707, 29889, 27392, 29898, 25118, 29897, 13, 1678, 565, 451, 318, 5416, 29901, 13, 4706, 736, 19200, 29918, 7645, 877, 8915, 2009, 1495, 13, 13, 1678, 4833, 353, 679, 29918, 1272, 29918, 12925, 580, 13, 13, 1678, 565, 525, 11283, 297, 318, 5416, 29901, 13, 4706, 318, 29884, 4841, 353, 731, 29898, 318, 5416, 29889, 5451, 877, 29901, 1495, 1723, 13, 4706, 363, 318, 5416, 297, 318, 29884, 4841, 29901, 13, 9651, 565, 451, 338, 29918, 3084, 29918, 25118, 29898, 25118, 1125, 736, 19200, 29918, 7645, 877, 13919, 2009, 1495, 13, 13, 4706, 4452, 353, 4833, 29889, 657, 29918, 7076, 29898, 1761, 29898, 29884, 29884, 4841, 876, 13, 13, 4706, 396, 11940, 29918, 29884, 29884, 4841, 353, 731, 29898, 518, 667, 1839, 25118, 2033, 363, 2944, 297, 4452, 29962, 1723, 13, 4706, 396, 361, 1476, 29918, 29884, 29884, 4841, 2804, 318, 29884, 4841, 29901, 13, 4706, 396, 1678, 736, 19200, 29918, 7645, 877, 3782, 1316, 2793, 742, 29871, 29906, 29900, 29946, 29897, 13, 13, 1678, 1683, 29901, 13, 4706, 565, 451, 338, 29918, 3084, 29918, 25118, 29898, 25118, 1125, 736, 19200, 29918, 7645, 877, 13919, 2009, 1495, 13, 13, 4706, 2944, 353, 4833, 29889, 657, 29918, 667, 29898, 25118, 29897, 13, 4706, 4452, 353, 518, 667, 29962, 565, 2944, 1683, 5159, 13, 13, 4706, 565, 451, 4452, 29901, 736, 19200, 29918, 7645, 877, 3782, 1316, 2793, 742, 29871, 29906, 29900, 29946, 29897, 13, 13, 1678, 4833, 29889, 5358, 580, 13, 13, 1678, 4452, 353, 518, 13, 4706, 9657, 29898, 13, 9651, 318, 5416, 29922, 667, 1839, 25118, 7464, 13, 9651, 1024, 29922, 1420, 29918, 689, 2497, 29898, 667, 1839, 978, 2033, 511, 13, 9651, 1134, 29922, 667, 1839, 1853, 11287, 13, 4706, 363, 2944, 297, 4452, 13, 1678, 4514, 13, 1678, 736, 13291, 29898, 3126, 29889, 29881, 17204, 29898, 7076, 29892, 29536, 29922, 29946, 511, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 4660, 29922, 29906, 29900, 29900, 29897, 13, 13, 13, 29992, 25288, 29918, 1272, 29889, 13134, 11974, 8143, 613, 3519, 29922, 1839, 5438, 11287, 13, 29992, 1989, 29918, 5150, 13, 1753, 5217, 7295, 13, 1678, 9995, 13, 1678, 1222, 1103, 29879, 13, 4706, 318, 5416, 29901, 318, 5416, 13, 1678, 16969, 13, 4706, 4663, 976, 2704, 29901, 1347, 13, 4706, 470, 4663, 4069, 9657, 13, 1678, 9995, 13, 1678, 318, 5416, 353, 2009, 29889, 5975, 29889, 657, 877, 25118, 1495, 13, 1678, 565, 451, 318, 5416, 470, 451, 338, 29918, 3084, 29918, 25118, 29898, 25118, 1125, 13, 4706, 736, 19200, 29918, 7645, 877, 8915, 470, 8340, 2009, 1495, 13, 13, 1678, 4833, 353, 679, 29918, 1272, 29918, 12925, 580, 13, 1678, 1121, 353, 4833, 29889, 8865, 29918, 667, 29898, 25118, 29897, 13, 1678, 4833, 29889, 5358, 580, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 13291, 877, 8875, 742, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 4660, 29922, 29906, 29900, 29900, 29897, 13, 1678, 736, 19200, 29918, 7645, 877, 3782, 1316, 2793, 742, 29871, 29906, 29900, 29946, 29897, 13, 2 ]
telluride_decoding/utils.py
RULCSoft/telluride_decoding
8
1610821
# Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Utility routines when decoding brain signals. More to come.. the CCA functions need to get the Pearson correlation too. """ import tensorflow.compat.v2 as tf # TODO Check to see if we can use (might need to get into core) # contrib/streaming_pearson_correlation def pearson_correlation_graph(x, y): """Use TF to compute the Pearson correlation between two sets of data. This works between two (multi-dimensional) feature arrays. Like np.corrcoef, x and y are 1-D or 2-D arrays containing multiple variables and observations. Each column of x represents a variable, and each row a single observation of all those variables. From: https://stackoverflow.com/questions/43834830/tensorflow-equivalent-of-np-corrcoef-on-a-specific-axis Args: x: First multidimensional array, n_observations x n_vars y: Second multidimensional array, n_observations x n_vars Returns: n_vars dimensional vector with the correlation of each pair of columns. """ def t(x): return tf.transpose(x) with tf.compat.v1.variable_scope('pearson'): if len(x.shape) == 1: x = tf.reshape(x, (-1, 1), name='pearson_x_reshape') if len(y.shape) == 1: y = tf.reshape(y, (-1, 1), name='pearson_y_reshape') xy_t = tf.concat([tf.cast(x, tf.float32), tf.cast(y, tf.float32)], axis=1) mean_t = tf.reduce_mean(xy_t, axis=0, keepdims=True) dsize = tf.cast(tf.shape(x)[0], tf.float32) cov_t = tf.matmul(t(xy_t - mean_t), (xy_t - mean_t) / (dsize - 1)) cov2_t = tf.linalg.tensor_diag(1/tf.sqrt(tf.linalg.tensor_diag_part(cov_t))) cor = tf.matmul(cov2_t, tf.matmul(cov_t, cov2_t)) return cor
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 5087, 9266, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 2751, 13, 13, 15945, 29908, 7270, 537, 6745, 1475, 746, 1602, 3689, 17294, 18470, 29889, 13, 13, 20761, 304, 2041, 636, 278, 315, 5454, 3168, 817, 304, 679, 278, 21265, 1100, 19869, 2086, 29889, 13, 15945, 29908, 13, 13, 5215, 26110, 29889, 12667, 29889, 29894, 29906, 408, 15886, 13, 13, 29937, 14402, 5399, 304, 1074, 565, 591, 508, 671, 313, 29885, 523, 817, 304, 679, 964, 7136, 29897, 13, 29937, 17737, 29914, 5461, 292, 29918, 412, 279, 1100, 29918, 2616, 23445, 13, 13, 13, 1753, 282, 799, 1100, 29918, 2616, 23445, 29918, 4262, 29898, 29916, 29892, 343, 1125, 13, 29871, 9995, 11403, 323, 29943, 304, 10272, 278, 21265, 1100, 19869, 1546, 1023, 6166, 310, 848, 29889, 13, 13, 29871, 910, 1736, 1546, 1023, 313, 9910, 29899, 12531, 29897, 4682, 7049, 29889, 29871, 8502, 7442, 29889, 29725, 1111, 1389, 29892, 13, 29871, 921, 322, 343, 526, 29871, 29896, 29899, 29928, 470, 29871, 29906, 29899, 29928, 7049, 6943, 2999, 3651, 322, 13917, 29889, 13, 29871, 7806, 1897, 310, 921, 11524, 263, 2286, 29892, 322, 1269, 1948, 263, 2323, 15500, 310, 13, 29871, 599, 1906, 3651, 29889, 13, 29871, 3645, 29901, 13, 29871, 2045, 597, 2417, 29889, 510, 29914, 2619, 29914, 29946, 29941, 29947, 29941, 29946, 29947, 29941, 29900, 29914, 29056, 29899, 1686, 27445, 29899, 974, 29899, 9302, 29899, 29725, 1111, 1389, 29899, 265, 29899, 29874, 29899, 14940, 29899, 8990, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 921, 29901, 3824, 1773, 333, 326, 8180, 1409, 29892, 302, 29918, 26739, 800, 921, 302, 29918, 16908, 13, 1678, 343, 29901, 6440, 1773, 333, 326, 8180, 1409, 29892, 302, 29918, 26739, 800, 921, 302, 29918, 16908, 13, 13, 29871, 16969, 29901, 13, 1678, 302, 29918, 16908, 22112, 4608, 411, 278, 19869, 310, 1269, 5101, 310, 4341, 29889, 13, 29871, 9995, 13, 29871, 822, 260, 29898, 29916, 1125, 13, 1678, 736, 15886, 29889, 3286, 4220, 29898, 29916, 29897, 13, 29871, 411, 15886, 29889, 12667, 29889, 29894, 29896, 29889, 11918, 29918, 6078, 877, 412, 279, 1100, 29374, 13, 1678, 565, 7431, 29898, 29916, 29889, 12181, 29897, 1275, 29871, 29896, 29901, 13, 418, 921, 353, 15886, 29889, 690, 14443, 29898, 29916, 29892, 8521, 29896, 29892, 29871, 29896, 511, 1024, 2433, 412, 279, 1100, 29918, 29916, 29918, 690, 14443, 1495, 13, 1678, 565, 7431, 29898, 29891, 29889, 12181, 29897, 1275, 29871, 29896, 29901, 13, 418, 343, 353, 15886, 29889, 690, 14443, 29898, 29891, 29892, 8521, 29896, 29892, 29871, 29896, 511, 1024, 2433, 412, 279, 1100, 29918, 29891, 29918, 690, 14443, 1495, 13, 1678, 921, 29891, 29918, 29873, 353, 15886, 29889, 17685, 4197, 13264, 29889, 4384, 29898, 29916, 29892, 15886, 29889, 7411, 29941, 29906, 511, 13, 462, 418, 15886, 29889, 4384, 29898, 29891, 29892, 15886, 29889, 7411, 29941, 29906, 29897, 1402, 9685, 29922, 29896, 29897, 13, 1678, 2099, 29918, 29873, 353, 15886, 29889, 17469, 29918, 12676, 29898, 3594, 29918, 29873, 29892, 9685, 29922, 29900, 29892, 3013, 6229, 29879, 29922, 5574, 29897, 13, 1678, 270, 2311, 353, 15886, 29889, 4384, 29898, 13264, 29889, 12181, 29898, 29916, 9601, 29900, 1402, 15886, 29889, 7411, 29941, 29906, 29897, 13, 1678, 18838, 29918, 29873, 353, 15886, 29889, 2922, 16109, 29898, 29873, 29898, 3594, 29918, 29873, 448, 2099, 29918, 29873, 511, 13, 462, 418, 313, 3594, 29918, 29873, 448, 2099, 29918, 29873, 29897, 847, 313, 29881, 2311, 448, 29871, 29896, 876, 13, 1678, 18838, 29906, 29918, 29873, 353, 15886, 29889, 29880, 979, 29887, 29889, 20158, 29918, 6051, 351, 29898, 29896, 29914, 13264, 29889, 3676, 29898, 13264, 29889, 29880, 979, 29887, 29889, 20158, 29918, 6051, 351, 29918, 1595, 29898, 24542, 29918, 29873, 4961, 13, 1678, 1034, 353, 15886, 29889, 2922, 16109, 29898, 24542, 29906, 29918, 29873, 29892, 15886, 29889, 2922, 16109, 29898, 24542, 29918, 29873, 29892, 18838, 29906, 29918, 29873, 876, 13, 29871, 736, 1034, 13, 2 ]
SectorGen.py
ShawnDriscoll/Traveller-RPG-SectorGen
5
142849
<reponame>ShawnDriscoll/Traveller-RPG-SectorGen # # Python 3.9.11 Sector Generator # ######################################################## """ SectorGen 0.4.0 Beta ----------------------------------------------------------------------- This program generates sectors using rules from Mongoose Traveller 2nd Edition, and a smidgen from Traveller 5.10 """ from colorama import init from colorama import Fore, Back, Style init() # initialize colorama #import win32com.client as win32 import sys #sys.path.append('C:\Users\Shonner\Documents\My Files\Python Programs\Mongoose Traveller') from random import randint from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * #import PyQt5.QtMultimedia as MM import time from mainwindow import Ui_MainWindow from aboutdialog import Ui_aboutDialog from completeddialog import Ui_completedDialog from rpg_tools.PyDiceroll import roll import os import logging import csv import json import datetime __author__ = '<NAME> <<EMAIL>>\n<EMAIL>' __app__ = 'SectorGen 0.4.0 (Beta)' __version__ = '0.4.0b' class aboutDialog(QDialog, Ui_aboutDialog): def __init__(self): super().__init__() log.info('PyQt5 aboutDialog initializing...') self.setWindowFlags(Qt.Drawer | Qt.WindowStaysOnTopHint) self.setupUi(self) self.aboutOKButton.clicked.connect(self.acceptOKButtonClicked) log.info('PyQt5 aboutDialog initialized.') def acceptOKButtonClicked(self): log.info('PyQt5 aboutDialog closing...') self.close() class completedDialog(QDialog, Ui_completedDialog): def __init__(self): ''' Open the Completed dialog window ''' super().__init__() log.info('PyQt5 completedDialog initializing...') self.setWindowFlags(Qt.Drawer | Qt.WindowStaysOnTopHint) self.setupUi(self) self.completedOKButton.clicked.connect(self.acceptOKButtonClicked) self.numworldsDisplay.setText('') log.info('PyQt5 completedDialog initialized.') def acceptOKButtonClicked(self): ''' Close the PyQt5 Completed dialog window ''' log.info('PyQt5 completedDialog closing...') self.close() def showNumworlds(self): ''' Show the number of worlds generated in the PyQt5 Completed dialog window ''' self.show() class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self): super().__init__() log.info('PyQt5 MainWindow initializing...') self.setupUi(self) self.genButton.clicked.connect(self.generateSector) self.actionGen.triggered.connect(self.generateSector) self.actionAbout_SectorGen.triggered.connect(self.actionAbout_triggered) self.actionQuitProg.triggered.connect(self.actionQuitProg_triggered) # Options self.hydro_calc_method = 'Based on Atmosphere' self.hydroBox.addItem('Based on Atmosphere') self.hydroBox.addItem('Based on Size') self.hydroBox.setCurrentIndex(0) self.hydroBox.currentIndexChanged.connect(self.hydroBox_changed) self.stellar_densityBox.addItem('Extra Galactic: 1%') self.stellar_densityBox.addItem('Rift: 3%') self.stellar_densityBox.addItem('Sparse: 17%') self.stellar_densityBox.addItem('Scattered: 33%') self.stellar_densityBox.addItem('Standard: 50%') self.stellar_densityBox.addItem('Dense: 66%') self.stellar_densityBox.addItem('Cluster: 83%') self.stellar_densityBox.addItem('Core: 91%') self.stellar_densityBox.setCurrentIndex(4) self.stellar_densityBox.currentIndexChanged.connect(self.stellar_densityBox_changed) self.stellar_density = 50 log.info('Default Stellar Density is Standard ' + str(self.stellar_density) + '%.') self.allegianceBox.addItem('As: Aslan Hierate') self.allegianceBox.addItem('Cs: Client State') self.allegianceBox.addItem('Im: Third Imperium') self.allegianceBox.addItem('Na: Non-Aligned, Human-dominated') self.allegianceBox.addItem('So: Solomani Confederation') self.allegianceBox.addItem('Va: Non-Aligned, Vargr-dominated') self.allegianceBox.addItem('Zh: Zhodani Consulate') self.allegianceBox.addItem('Random') self.allegianceBox.setCurrentIndex(2) self.allegiance = 'Im' log.info('Default Allegiance is Im: Third Imperium.') self.random_allegiance = False self.allegianceBox.currentIndexChanged.connect(self.allegianceBox_changed) self.super_earth_chance = False self.super_earth_checkBox.toggled.connect(self.super_earth_checkBox_changed) self.super_earth_checkBox.setChecked(self.super_earth_chance) self.popAboutDialog = aboutDialog() self.popCompletedDialog = completedDialog() # UPP Code Table self.hex_code = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] self.core_code = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'] # World Data Tables self.world_temperature_dm = [0, 0, -2, -2, -1, -1, 0, 0, 1, 1, 2, 6, 6, 2, -1, 2] self.size_value = [ 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] self.atmosphere_value = [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1] self.hydro_value = [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0] self.population_value = [ 0, 1, 1, 1, 1, 1, 0, 0, 1, 2, 4, 0, 0, 0, 0, 0] self.government_value = [ 1, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, -2, -2, 0] self.minimum_TL = [ 8, 8, 5, 5, 3, -1, -1, 3, -1, 3, 8, 9, 10, 5, 5, 8] self.world_starport_class = ['X', 'X', 'X', 'E', 'E', 'D', 'D', 'C', 'C', 'B', 'B', 'A', 'A', 'A', 'A'] self.starport_value = [ -4, -4, -4, 0, 0, 0, 0, 2, 2, 4, 4, 6, 6, 6, 6] self.gas_giant_quantity = [' ', ' ', '1', '1', '2', '2', '3', '3', '4', '4', '4', '5', '5'] self.planetoid_belt_quantity = [' ', ' ', '1', '1', '1', '1', '1', '1', '2', '2', '2', '2', '3'] self.sn = [0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3] self.primary_star_type = [' ', ' ', 'A', 'M', 'M', 'M', 'M', 'M', 'K', 'G', 'F', 'F', 'F'] self.companion_star_type = [' ', ' ', 'A', 'F', 'F', 'G', 'G', 'K', 'K', 'M', 'M', 'M', 'M'] self.star_size = [' ', ' ', 'II ', 'III', 'IV ', 'V ', 'V ', 'V ', 'V ', 'V ', 'V ', 'VI ', 'D '] # Sound Tables self.V = 1 self.CV = 2 self.VC = 3 self.CVC = 4 self.CC = 5 self.ic_sound = ['b','br','c','ch','d','g', 'h','j','k','l','m','p', 'r','s','st','sh', 't','v','w','z'] self.ic_freq = [28,12,20,16,27,9,20,20,13, 28,24,27,24,30,13,25, 20,6,16,4] self.v_sound = ['a','e','i','o','u'] self.v_freq = [16,20,10,7,3] self.mc_sound = ['g','lt','ns','nst','ls','ll','nn'] self.mc_freq = [20,3,18,16,18,4,3] self.fc_sound = ['ch','ck','d','dy','dyne', 'hl','li','la','le','ler', 'nn','m','man','ma','mer','ny', 'me','n','nas','ne','ng', 'ner','nor','nie', 'rie','rlie','rly','rie','rt', 'ry','sa','sha','nshi','nski','son', 'nson','th','ta','ti','t','v', 'za','ue','than', 'lam','lis','lus','ton','tis','tus', 'love','se','nter','ll'] self.fc_freq = [6,13,22,12,3,3,3,10,6,10,7, 25,10,4,13,12,5,27,11,4,14,13,17,7,6,5,5,6,3, 21,10,3,8,3,20,9,14,10,16,11,8,6,8,10,7,6,5,7,7,4, 4,12,5,4] for i in range(len(self.ic_sound)): log.debug(self.ic_sound[i] + ' ' + str(self.ic_freq[i])) for i in range(len(self.v_sound)): log.debug(self.v_sound[i] + ' ' + str(self.v_freq[i])) for i in range(len(self.mc_sound)): log.debug(self.mc_sound[i] + ' ' + str(self.mc_freq[i])) for i in range(len(self.fc_sound)): log.debug(self.fc_sound[i] + ' ' + str(self.fc_freq[i])) self.syllable_type = [self.V,self.V,self.V,self.V,self.V,self.V,self.V,self.V, self.VC,self.VC,self.VC,self.VC, self.CV,self.CV,self.CV,self.CV, self.CVC,self.CVC,self.CVC,self.CVC,self.CVC,self.CVC, self.CC,self.CC] #print self.syllable_type self.ic_sounds = [] for i in range(len(self.ic_freq)): for j in range(self.ic_freq[i]): self.ic_sounds.append(self.ic_sound[i]) self.v_sounds = [] for i in range(len(self.v_freq)): for j in range(self.v_freq[i]): self.v_sounds.append(self.v_sound[i]) self.mc_sounds = [] for i in range(len(self.mc_freq)): for j in range(self.mc_freq[i]): self.mc_sounds.append(self.mc_sound[i]) self.fc_sounds = [] for i in range(len(self.fc_freq)): for j in range(self.fc_freq[i]): self.fc_sounds.append(self.fc_sound[i]) log.info('PyQt5 MainWindow initialized.') def pick_sound(self): if self.s_type == self.V: self.sound = self.v_sounds[randint(1, len(self.v_sounds)) - 1] if self.s_type == self.CV: self.sound = self.ic_sounds[randint(1, len(self.ic_sounds)) - 1] + self.v_sounds[randint(1, len(self.v_sounds)) - 1] if self.s_type == self.VC: self.sound = self.v_sounds[randint(1, len(self.v_sounds)) - 1] + self.fc_sounds[randint(1, len(self.fc_sounds)) - 1] if self.s_type == self.CVC: self.sound = self.ic_sounds[randint(1, len(self.ic_sounds)) - 1] + self.v_sounds[randint(1, len(self.v_sounds)) - 1] \ + self.fc_sounds[randint(1, len(self.fc_sounds)) - 1] if self.s_type == self.CC: self.sound = self.mc_sounds[randint(1, len(self.mc_sounds)) - 1] def generateSector(self): if not os.path.exists('data'): os.mkdir('data') csv_file_out = open('data/raw_sector_data.csv', 'w', newline='') csv_writer = csv.writer(csv_file_out) csv_writer.writerow(['Location', 'World_Name', 'Starport', 'Size', 'Atmosphere', 'Hydrographics', 'Population', 'Government', 'Law_Level', 'Tech_Level', 'Trade_Codes', 'Travel_Code', 'Base', 'Pop_M', 'Belts', 'Gas_giants', 'Worlds', 'Allegiance', 'Stellar_Data', 'Temperature']) json_file_out = open('data/raw_sector_data.json', 'w') mapper_file_out = open('data/sec_p00_p00.dat', 'w', newline='') mapper_file_out.write('# Generated by https://github.com/ShawnDriscoll/Traveller-RPG-SectorGen') mapper_file_out.write('\n# ' + str(datetime.datetime.now())) world_list = [] self.main_world_tech_level = -1 self.main_world_travel_code = '' # Name the sector proper = False while not(proper): temp = self.CC while temp == self.CC: temp = self.syllable_type[randint(1, len(self.syllable_type)) - 1] self.s_type = temp self.pick_sound() self.word = self.sound building = True while building: syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.V and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CV and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.VC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CVC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] if temp == self.VC or temp == self.CVC: building = False else: self.s_type = syllable self.pick_sound() self.word += self.sound temp = syllable if len(self.word) > 3 and len(self.word) < 14: proper = True self.sector_name = chr(ord(self.word[0]) - 32) + self.word[1:len(self.word)] proper = False while not(proper): temp = self.CC while temp == self.CC: temp = self.syllable_type[randint(1, len(self.syllable_type)) - 1] self.s_type = temp self.pick_sound() self.word = self.sound building = True while building: syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.V and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CV and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.VC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CVC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] if temp == self.VC or temp == self.CVC: building = False else: self.s_type = syllable self.pick_sound() self.word += self.sound temp = syllable if len(self.word) > 3 and len(self.word) < 14: proper = True name_variance = roll('d100') #print(name_variance) if name_variance <= 60: if name_variance >= 45: self.sector_name += ' ' + chr(ord(self.word[0]) - 32) + self.word[1:len(self.word)] elif name_variance >= 35: self.sector_name += ' ' + 'Alpha' elif name_variance >= 25: self.sector_name += ' ' + 'Beta' elif name_variance >= 15: self.sector_name += ' ' + 'Gamma' elif name_variance >= 10: self.sector_name += ' ' + 'Reaches' elif name_variance >= 7: self.sector_name += ' ' + 'Sector' elif name_variance >= 6: self.sector_name += ' ' + 'Frontier' elif name_variance >= 4: self.sector_name += ' ' + 'UNEXPLORED' elif name_variance >= 2: self.sector_name += ' ' + 'UNKNOWN' #print(self.sector_name) mapper_file_out.write('\n\n# ' + self.sector_name) mapper_file_out.write('\n# 0,0') mapper_file_out.write('\n\n# Name: ' + self.sector_name) mapper_file_out.write('\n\n# Milieu: M1105') mapper_file_out.write('\n\n# Credits: ' + self.sector_name + ' sector was randomly generated by ' + __app__) mapper_file_out.write('\n\n# Author: <NAME> https://www.youtube.com/user/ShawnDriscollCG') mapper_file_out.write('\n# Source: Rules from Mongoose Traveller 2nd Edition, and a smidgen from Traveller 5.10\n') # Name the subsectors #self.subsect_name = [] for subs in range(16): proper = False while not(proper): temp = self.CC while temp == self.CC: temp = self.syllable_type[randint(1, len(self.syllable_type)) - 1] self.s_type = temp self.pick_sound() self.word = self.sound building = True while building: syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.V and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CV and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.VC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CVC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] if temp == self.VC or temp == self.CVC: building = False else: self.s_type = syllable self.pick_sound() self.word += self.sound temp = syllable if len(self.word) > 3 and len(self.word) < 14: proper = True mapper_file_out.write('\n# Subsector ' + self.core_code[subs] + ': ' + chr(ord(self.word[0]) - 32) + self.word[1:len(self.word)]) #self.subsect_name.append(chr(ord(self.word[0]) - 32) + self.word[1:len(self.word)]) #print(self.subsect_name) mapper_file_out.write('\n\n# Alleg: As: "<NAME>"') mapper_file_out.write('\n# Alleg: Cs: "Client State"') mapper_file_out.write('\n# Alleg: Im: "Third Imperium"') mapper_file_out.write('\n# Alleg: Na: "Non-Aligned, Human-dominated"') mapper_file_out.write('\n# Alleg: So: "Solomani Confederation"') mapper_file_out.write('\n# Alleg: Va: "Non-Aligned, Vargr-dominated"') mapper_file_out.write('\n# Alleg: Zh: "Zhodani Consulate"') mapper_file_out.write('\n\nHex Name UWP Remarks {Ix} (Ex) [Cx] N B Z PBG W A Stellar') mapper_file_out.write( '\n---- -------------------- --------- -------------------- ------ ------- ------ - -- - --- -- ---- --------------') self.worlds_rolled = 0 # Make the worlds for hex_grid_col in range(32): for hex_grid_row in range(40): if roll('d100') <= self.stellar_density: # Get World Name proper = False while not(proper): temp = self.CC while temp == self.CC: temp = self.syllable_type[randint(1, len(self.syllable_type)) - 1] self.s_type = temp self.pick_sound() self.word = self.sound building = True while building: syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.V and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CV and (syllable == self.V or syllable == self.VC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.VC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] while temp == self.CVC and (syllable == self.CV or syllable == self.CVC or syllable == self.CC): syllable = self.syllable_type[randint(1, len(self.syllable_type)) - 1] if temp == self.VC or temp == self.CVC: building = False else: self.s_type = syllable self.pick_sound() self.word += self.sound temp = syllable if len(self.word) > 3 and len(self.word) < 14: proper = True self.main_world_name = chr(ord(self.word[0]) - 32) + self.word[1:len(self.word)] # Find Location and Subsector for Main World self.main_world_location = self.core_code[(hex_grid_col) // 8 + ((hex_grid_row) // 10) * 4] #print(self.main_world_location) self.main_world_location = '' if hex_grid_col + 1 < 10: self.main_world_location += '0' + self.hex_code[hex_grid_col + 1] else: self.main_world_location += str(hex_grid_col + 1) if hex_grid_row + 1 < 10: self.main_world_location += '0' + self.hex_code[hex_grid_row + 1] else: self.main_world_location += str(hex_grid_row + 1) #print(self.main_world_location) # Roll for Main World Size self.main_world_size = roll('2D-2') # from Traveller5 if self.main_world_size == 10: if self.super_earth_chance: self.main_world_size = roll('1D+9') #print(self.main_world_size) # Roll for Main World Atmosphere self.main_world_atmosphere = roll('FLUX') + self.main_world_size # from Traveller5 if self.main_world_atmosphere < 0 or self.main_world_size == 0: self.main_world_atmosphere = 0 if self.main_world_atmosphere > 15: self.main_world_atmosphere = 15 # Roll for Main World Hydrographics if self.hydro_calc_method == 'Based on Atmosphere': # from Mongoose Traveller 2nd Edition and Traveller5 self.main_world_hydrographics = roll('FLUX') + self.main_world_atmosphere else: # from something else self.main_world_hydrographics = roll('FLUX') + self.main_world_size if self.main_world_hydrographics < 0: self.main_world_hydrographics = 0 if self.main_world_hydrographics > 10: self.main_world_hydrographics = 10 # Size and Atmosphere DMs added to Hydrographics if self.main_world_size < 2: self.main_world_hydrographics = 0 if self.main_world_atmosphere < 2 or \ self.main_world_atmosphere == 10 or \ self.main_world_atmosphere == 11 or \ self.main_world_atmosphere == 12: self.main_world_hydrographics += -4 # Main World Temperature? self.main_world_temperature = roll('2d6') + self.world_temperature_dm[self.main_world_atmosphere] # Temperature DMs added to Hydrographics if self.main_world_atmosphere != 13 and self.main_world_atmosphere != 15: if self.main_world_temperature >= 10 and self.main_world_temperature <= 11: self.main_world_hydrographics += -2 if self.main_world_temperature >= 12: self.main_world_hydrographics += -6 if self.main_world_hydrographics < 0: self.main_world_hydrographics = 0 # Roll for Main World Population #self.main_world_population = roll('2D6-2') #self.main_world_population = roll('4D4-4') self.main_world_population = roll('2d6-2') # Roll for Main World Government if self.main_world_population > 0: self.main_world_government = roll('FLUX') + self.main_world_population if self.main_world_government < 0: self.main_world_government = 0 if self.main_world_government > 15: self.main_world_government = 15 else: self.main_world_government = 0 # Roll for Law Level if self.main_world_population > 0: self.main_world_law_level = roll('FLUX') + self.main_world_government if self.main_world_law_level < 0: self.main_world_law_level = 0 if self.main_world_law_level > 15: self.main_world_law_level = 15 else: self.main_world_law_level = 0 # Roll for Starport self.main_world_starport = roll('2D6') if self.main_world_population >= 10: self.main_world_starport += 2 elif self.main_world_population >= 8: self.main_world_starport += 1 elif self.main_world_population <= 2: self.main_world_starport += -2 elif self.main_world_population <= 4: self.main_world_starport += -1 # Roll for Technology Level if self.main_world_population > 0: self.main_world_tech_level = roll('1D6') # Add DMs self.main_world_tech_level += self.starport_value[self.main_world_starport] self.main_world_tech_level += self.size_value[self.main_world_size] self.main_world_tech_level += self.atmosphere_value[self.main_world_atmosphere] self.main_world_tech_level += self.hydro_value[self.main_world_hydrographics] self.main_world_tech_level += self.population_value[self.main_world_population] self.main_world_tech_level += self.government_value[self.main_world_government] # Adjust Minimum TL for Environmental Limits if self.minimum_TL[self.main_world_atmosphere] != -1: if self.main_world_tech_level < self.minimum_TL[self.main_world_atmosphere]: self.main_world_tech_level = self.minimum_TL[self.main_world_atmosphere] if self.main_world_tech_level < 0: self.main_world_tech_level = 0 if self.main_world_tech_level > 15: self.main_world_tech_level = 15 else: self.main_world_tech_level = 0 # Calculate Travel Code self.main_world_travel_code = '' if (self.main_world_atmosphere >= 10 or (self.main_world_government == 0 or self.main_world_government == 7 \ or self.main_world_government == 10) or (self.main_world_law_level == 0 or self.main_world_law_level >= 9)) and roll('d6') == 6: self.main_world_travel_code = ' A' # Lookup Trade Code(s) self.trade_index = 0 self.main_world_trade_code = [' ',' ',' ',' ',' ',' ', ' ', ' ', ' ', ' '] self.main_world_trade_class = [' ',' ',' ',' ',' ',' ', ' ', ' ', ' ', ' '] if self.main_world_atmosphere >= 4 \ and self.main_world_atmosphere <= 9 \ and self.main_world_hydrographics >= 4 \ and self.main_world_hydrographics <= 8 \ and self.main_world_population >= 5 \ and self.main_world_population <= 7: self.main_world_trade_code[self.trade_index] = 'Ag' self.main_world_trade_class[self.trade_index] = 'Agricultural' self.trade_index += 1 if (self.main_world_atmosphere == 2 \ or self.main_world_atmosphere == 3 \ or self.main_world_atmosphere == 10 \ or self.main_world_atmosphere == 11) \ and self.main_world_hydrographics >= 1 \ and self.main_world_hydrographics <= 5 \ and self.main_world_population >= 3 \ and self.main_world_population <= 6 \ and self.main_world_law_level >= 6 \ and self.main_world_law_level <= 9: self.main_world_trade_code[self.trade_index] = 'Px' self.main_world_trade_class[self.trade_index] = 'Prison' self.main_world_travel_code = ' A' self.trade_index += 1 if self.main_world_size == 0 \ and self.main_world_atmosphere == 0 \ and self.main_world_hydrographics == 0: self.main_world_trade_code[self.trade_index] = 'As' self.main_world_trade_class[self.trade_index] = 'Asteroid' self.trade_index += 1 if self.main_world_population == 0 \ and self.main_world_government == 0 \ and self.main_world_law_level == 0: if self.world_starport_class[self.main_world_starport] == 'E' \ or self.world_starport_class[self.main_world_starport] == 'X': if roll('1D3') > 1: self.main_world_tech_level = 0 self.main_world_trade_code[self.trade_index] = 'Ba' self.main_world_trade_class[self.trade_index] = 'Barren' else: self.main_world_tech_level = roll('3D-3') self.main_world_trade_code[self.trade_index] = 'Di' self.main_world_trade_class[self.trade_index] = 'Dieback' self.main_world_travel_code = ' R' self.trade_index += 1 if self.world_starport_class[self.main_world_starport] == 'A': if roll('1D3') == 1: self.main_world_trade_code[self.trade_index] = 'Cp' self.main_world_trade_class[self.trade_index] = 'Subsector Capital' self.trade_index += 1 if self.main_world_population >=5 \ and self.main_world_population <= 10 \ and self.main_world_government == 6 \ and self.main_world_law_level >= 0 \ and self.main_world_law_level <= 3: self.main_world_trade_code[self.trade_index] = 'Cy' self.main_world_trade_class[self.trade_index] = 'Colony' self.trade_index += 1 if self.main_world_atmosphere >= 2 \ and self.main_world_hydrographics == 0: self.main_world_trade_code[self.trade_index] = 'De' self.main_world_trade_class[self.trade_index] = 'Desert' self.trade_index += 1 if self.main_world_atmosphere >= 10 \ and self.main_world_hydrographics >= 1: self.main_world_trade_code[self.trade_index] = 'Fl' self.main_world_trade_class[self.trade_index] = 'Fluid Oceans' self.trade_index += 1 if self.main_world_size >= 6 \ and self.main_world_size <= 8 \ and (self.main_world_atmosphere == 5 \ or self.main_world_atmosphere == 6 \ or self.main_world_atmosphere == 8) \ and self.main_world_hydrographics >= 5 \ and self.main_world_hydrographics <= 7: self.main_world_trade_code[self.trade_index] = 'Ga' self.main_world_trade_class[self.trade_index] = 'Garden' self.trade_index += 1 if self.main_world_population >= 9: self.main_world_trade_code[self.trade_index] = 'Hi' self.main_world_trade_class[self.trade_index] = 'High Population' self.trade_index += 1 if self.main_world_tech_level >= 12: self.main_world_trade_code[self.trade_index] = 'Ht' self.main_world_trade_class[self.trade_index] = 'High Tech' self.trade_index += 1 if self.main_world_atmosphere >= 0 \ and self.main_world_atmosphere <= 1 \ and self.main_world_hydrographics >= 1: self.main_world_trade_code[self.trade_index] = 'Ic' self.main_world_trade_class[self.trade_index] = 'Ice-Capped' self.trade_index += 1 if (self.main_world_atmosphere >= 0 \ and self.main_world_atmosphere <= 2 \ or self.main_world_atmosphere == 4 \ or self.main_world_atmosphere == 7 \ or self.main_world_atmosphere == 9) \ and self.main_world_population >= 9: self.main_world_trade_code[self.trade_index] = 'In' self.main_world_trade_class[self.trade_index] = 'Industrial' self.trade_index += 1 if self.main_world_population >= 1 \ and self.main_world_population <= 3: self.main_world_trade_code[self.trade_index] = 'Lo' self.main_world_trade_class[self.trade_index] = 'Low Population' self.trade_index += 1 if self.main_world_tech_level <= 5: self.main_world_trade_code[self.trade_index] = 'Lt' self.main_world_trade_class[self.trade_index] = 'Low Tech' self.trade_index += 1 if self.main_world_atmosphere >= 0 \ and self.main_world_atmosphere <= 3 \ and self.main_world_hydrographics >= 0 \ and self.main_world_hydrographics <= 3 \ and self.main_world_population >= 6: self.main_world_trade_code[self.trade_index] = 'Na' self.main_world_trade_class[self.trade_index] = 'Non-Agricultural' self.trade_index += 1 if self.main_world_population <= 6: self.main_world_trade_code[self.trade_index] = 'Ni' self.main_world_trade_class[self.trade_index] = 'Non-Industrial' self.trade_index += 1 if self.main_world_atmosphere >= 2 \ and self.main_world_atmosphere <= 5 \ and self.main_world_hydrographics >= 0 \ and self.main_world_hydrographics <= 3: self.main_world_trade_code[self.trade_index] = 'Po' self.main_world_trade_class[self.trade_index] = 'Poor' self.trade_index += 1 if (self.main_world_atmosphere == 6 \ or self.main_world_atmosphere == 8) \ and self.main_world_population >= 6 \ and self.main_world_population <= 8 \ and self.main_world_government >= 4 \ and self.main_world_government <= 9: self.main_world_trade_code[self.trade_index] = 'Ri' self.main_world_trade_class[self.trade_index] = 'Rich' self.trade_index += 1 if self.main_world_hydrographics == 10 \ and self.main_world_atmosphere >= 1 \ and self.main_world_atmosphere <= 9: self.main_world_trade_code[self.trade_index] = 'Wa' self.main_world_trade_class[self.trade_index] = 'Water World' self.trade_index += 1 if self.main_world_atmosphere == 0: self.main_world_trade_code[self.trade_index] = 'Va' self.main_world_trade_class[self.trade_index] = 'Vacuum' self.trade_index += 1 if self.main_world_government + self.main_world_law_level >= 30: self.main_world_trade_code[self.trade_index] = 'Fo' self.main_world_trade_class[self.trade_index] = 'Forbidden' self.trade_index += 1 self.main_world_travel_code = ' R' # Any bases? Naval? Research, etc? self.base = '' if self.world_starport_class[self.main_world_starport] == 'A': if roll('2D6') >= 8: self.base = 'N' elif roll('2D6') >= 10: self.base = 'S' elif roll('2D6') >= 8: self.base = 'R' elif roll('2D6') >= 6: self.base = 'I' if self.world_starport_class[self.main_world_starport] == 'B': if roll('2D6') >= 8: self.base = 'N' elif roll('2D6') >= 8: self.base = 'S' elif roll('2D6') >= 10: self.base = 'R' elif roll('2D6') >= 8: self.base = 'I' elif roll('2D6') >= 12: self.base = 'P' if self.world_starport_class[self.main_world_starport] == 'C': if roll('2D6') >= 8: self.base = 'S' elif roll('2D6') >= 10: self.base = 'R' elif roll('2D6') >= 8: self.base = 'W' elif roll('2D6') >= 10: self.base = 'I' elif roll('2D6') >= 10: self.base = 'P' if self.world_starport_class[self.main_world_starport] == 'D': if roll('2D6') >= 7: self.base = 'S' elif roll('2D6') >= 12: self.base = 'P' if self.world_starport_class[self.main_world_starport] == 'E': if roll('2D6') >= 12: self.base = 'P' # Population Multiplier? if roll('1D6') > 3: self.population_multiplier = roll('1D6-1') while self.population_multiplier == 5: self.population_multiplier = roll('1D6-1') else: self.population_multiplier = roll('1D6+4') while self.population_multiplier == 10: self.population_multiplier = roll('1D6+4') if self.population_multiplier < 1: self.population_multiplier = 1 # Planetoid Belts? self.planetoid_belts = '0' if roll('2D6') >= 8: self.planetoid_belts = self.planetoid_belt_quantity[roll('2D')] # Gas Giants? self.gas_giants = '0' if roll('2D6') >= 5: self.gas_giants = self.gas_giant_quantity[roll('2D')] # Worlds? self.worlds = str(1 + int(self.planetoid_belts) + int(self.gas_giants) + roll('2D')) # Allegiance? if self.random_allegiance is True: self.allegiance = 'Im' temp = roll('D100') if temp > 50: self.allegiance = 'Cs' if temp > 80: self.allegiance = 'Na' if temp > 90: self.allegiance = 'Va' if temp > 94: self.allegiance = 'So' if temp > 97: self.allegiance = 'As' if temp == 100: self.allegiance = 'Zh' # System Nature self.stellar_data = '' star_count = self.sn[roll('2D6')] if self.main_world_atmosphere >= 4 and self.main_world_atmosphere <= 9 \ or self.main_world_population >= 8: star_DM = 4 else: star_DM = 0 star_rolled = roll('2D6') + star_DM if star_rolled > 12: star_rolled = 12 previous_star_rolled = star_rolled self.stellar_data += self.primary_star_type[star_rolled] if roll('1D6') > 3: classification = roll('1D6-1') while classification == 5: classification = roll('1D6-1') else: classification = roll('1D6+4') while classification == 10: classification = roll('1D6+4') self.stellar_data += str(classification) star_rolled = roll('2D6') + star_DM if star_rolled > 12: star_rolled = 12 star_size_rolled = self.star_size[star_rolled] if (self.stellar_data == 'K5' or self.stellar_data == 'M9') \ and star_size_rolled == 'IV ': star_size_rolled = 'V ' if (self.stellar_data == 'B0' or self.stellar_data == 'F4') \ and star_size_rolled == 'IV ': star_size_rolled = 'V ' self.stellar_data += ' ' + star_size_rolled previous_star_size_rolled = star_rolled star_count += -1 if star_count > 1: star_rolled = roll('2D6') + previous_star_rolled if star_rolled > 12: star_rolled = 12 companion_data = self.companion_star_type[star_rolled] if roll('1D6') > 3: classification = roll('1D6-1') while classification == 5: classification = roll('1D6-1') else: classification = roll('1D6+4') while classification == 10: classification = roll('1D6+4') companion_data += str(classification) star_rolled = roll('2D6') + previous_star_size_rolled if star_rolled > 12: star_rolled = 12 star_size_rolled = self.star_size[star_rolled] if (companion_data == 'K5' or companion_data == 'M9') \ and star_size_rolled == 'IV ': star_size_rolled = 'V ' if (companion_data == 'B0' or companion_data == 'F4') \ and star_size_rolled == 'IV ': star_size_rolled = 'V ' self.stellar_data += ' ' + companion_data + ' ' + star_size_rolled # Maybe World has no name? Just a UWP. if roll('D100') > 95: self.main_world_name = self.world_starport_class[self.main_world_starport] + \ self.hex_code[self.main_world_size] + \ self.hex_code[self.main_world_atmosphere] + \ self.hex_code[self.main_world_hydrographics] + \ self.hex_code[self.main_world_population] + \ self.hex_code[self.main_world_government] + \ self.hex_code[self.main_world_law_level] + '-' + \ self.hex_code[self.main_world_tech_level] self.main_world_trade_codes = '' self.main_world_trade_classes = '' for i in range(self.trade_index): self.main_world_trade_codes += ' ' + self.main_world_trade_code[i] self.main_world_trade_classes += self.main_world_trade_class[i] + ', ' # Print Main World print(self.main_world_name + ' (%s %s%s%s%s%s%s%s-%s %s%s)' % (self.main_world_location, \ self.world_starport_class[self.main_world_starport], \ self.hex_code[self.main_world_size], self.hex_code[self.main_world_atmosphere], \ self.hex_code[self.main_world_hydrographics], self.hex_code[self.main_world_population], \ self.hex_code[self.main_world_government], self.hex_code[self.main_world_law_level], \ self.hex_code[self.main_world_tech_level], self.main_world_trade_codes, self.main_world_travel_code)) self.worlds_rolled += 1 csv_writer.writerow([self.main_world_location, self.main_world_name, self.world_starport_class[self.main_world_starport], self.hex_code[self.main_world_size], self.hex_code[self.main_world_atmosphere], self.hex_code[self.main_world_hydrographics], self.hex_code[self.main_world_population], self.hex_code[self.main_world_government], self.hex_code[self.main_world_law_level], self.hex_code[self.main_world_tech_level], self.main_world_trade_codes[1:], self.main_world_travel_code[len(self.main_world_travel_code) - 1:len(self.main_world_travel_code)], self.base, self.population_multiplier, self.planetoid_belts, self.gas_giants, self.worlds, self.allegiance, self.stellar_data, self.main_world_temperature]) trav_rec = {} trav_rec['Location'] = self.main_world_location trav_rec['World_Name'] = self.main_world_name trav_rec['Starport'] = self.world_starport_class[self.main_world_starport] trav_rec['Size'] = self.hex_code[self.main_world_size] trav_rec['Atmosphere'] = self.hex_code[self.main_world_atmosphere] trav_rec['Hydrographics'] = self.hex_code[self.main_world_hydrographics] trav_rec['Population'] = self.hex_code[self.main_world_population] trav_rec['Government'] = self.hex_code[self.main_world_government] trav_rec['Law_Level'] = self.hex_code[self.main_world_law_level] trav_rec['Tech_Level'] = self.hex_code[self.main_world_tech_level] trav_rec['Trade_Codes'] = self.main_world_trade_codes[1:] trav_rec['Travel_Code'] = self.main_world_travel_code[len(self.main_world_travel_code) - 1:len(self.main_world_travel_code)] trav_rec['Base'] = self.base trav_rec['Pop_M'] = self.population_multiplier trav_rec['Belts'] = self.planetoid_belts trav_rec['Gas_Giants'] = self.gas_giants trav_rec['Worlds'] = self.worlds trav_rec['Allegiance'] = self.allegiance trav_rec['Stellar_Data'] = self.stellar_data trav_rec['Temperature'] = self.main_world_temperature world_list.append(trav_rec) detail_line = self.main_world_location detail_line += ' ' + self.main_world_name while len(detail_line) < 26: detail_line += ' ' detail_line += self.world_starport_class[self.main_world_starport] + \ self.hex_code[self.main_world_size] + \ self.hex_code[self.main_world_atmosphere] + \ self.hex_code[self.main_world_hydrographics] + \ self.hex_code[self.main_world_population] + \ self.hex_code[self.main_world_government] + \ self.hex_code[self.main_world_law_level] + '-' + \ self.hex_code[self.main_world_tech_level] detail_line += ' ' + self.main_world_trade_codes[1:] while len(detail_line) < 81: detail_line += ' ' detail_line += self.base while len(detail_line) < 84: detail_line += ' ' detail_line += self.main_world_travel_code[len(self.main_world_travel_code) - 1:len(self.main_world_travel_code)] while len(detail_line) < 85: detail_line += ' ' detail_line += ' ' + str(self.population_multiplier) + str(self.planetoid_belts) + str(self.gas_giants) while len(detail_line) < 90: detail_line += ' ' detail_line += self.worlds while len(detail_line) < 93: detail_line += ' ' detail_line += self.allegiance while len(detail_line) < 98: detail_line += ' ' detail_line += self.stellar_data mapper_file_out.write('\n' + detail_line) #json.dump(world_list, json_file_out, indent=4, ensure_ascii=True) json.dump(world_list, json_file_out, ensure_ascii=True) csv_file_out.close() json_file_out.close() mapper_file_out.close() print('Worlds rolled:', self.worlds_rolled) self.passingNumworlds() def hydroBox_changed(self): self.hydro_calc_choices = ['Based on Atmosphere', 'Based on Size'] self.hydro_calc_method = self.hydro_calc_choices[self.hydroBox.currentIndex()] #print(self.hydro_calc_method) log.info("'" + self.hydro_calc_method + "'" + ' was selected.') def stellar_densityBox_changed(self): self.density_choices = [1, 3, 17, 33, 50, 66, 83, 91] self.stellar_density = self.density_choices[self.stellar_densityBox.currentIndex()] #print(self.stellar_density) log.info('A Stellar Density of ' + str(self.stellar_density) + '% was selected.') def allegianceBox_changed(self): self.allegiance_choices = ['As', 'Cs', 'Im', 'Na', 'So', 'Va', 'Zh'] if self.allegianceBox.currentIndex() == 7: self.random_allegiance = True log.info('Random Allegiance was selected.') else: self.allegiance = self.allegiance_choices[self.allegianceBox.currentIndex()] self.random_allegiance = False log.info('Allegiance "' + self.allegiance + '" was selected.') def super_earth_checkBox_changed(self): self.super_earth_chance = self.super_earth_checkBox.isChecked() #print(self.super_earth_chance) log.info('Chance for Super-Earth: ' + str(self.super_earth_chance)) def actionAbout_triggered(self): log.info(__app__ + ' show about...') self.popAboutDialog.show() def actionQuitProg_triggered(self): log.info(__app__ + ' quiting...') log.info(__app__ + ' DONE.') log.info('Logging ended.') self.close() def passingNumworlds(self): log.info('Number of worlds: ' + str(self.worlds_rolled)) self.popCompletedDialog.numworldsDisplay.setText('Number of worlds: ' + str(self.worlds_rolled)) self.popCompletedDialog.showNumworlds() if __name__ == '__main__': log = logging.getLogger('SectorGen') log.setLevel(logging.DEBUG) if not os.path.exists('Logs'): os.mkdir('Logs') fh = logging.FileHandler('Logs/SectorGen.log', 'w') formatter = logging.Formatter('%(asctime)s %(levelname)s %(name)s - %(message)s', datefmt = '%a, %d %b %Y %H:%M:%S') fh.setFormatter(formatter) log.addHandler(fh) log.info('Logging started.') log.info(__app__ + ' starting...') trange = time.localtime() creation_time = datetime.datetime.now() if trange[0] > 2022 or trange[1] > 11: log.warning('Beta time period has expired!') print() print(Fore.RED + Style.BRIGHT + __app__, 'EXPIRED.') print(Style.RESET_ALL) print() print(__author__) print() s = input('Press ENTER: ') log.info(__app__ + ' stopping...') print('OK') log.info(__app__ + ' stopped.') log.info('Logging ended.') else: print() print('Thank you for giving', __app__, 'a try.') log.info(__app__ + ' looking for PyDiceroll...') vernum, release = roll('info') print('This program uses', release) log.info(__app__ + ' found ' + release + '.') print() print('----------------------------') print(__author__) print() print('The Traveller game in all forms is owned by Far Future Enterprises.') print('Copyright 1977 - 2022 Far Future Enterprises.') print('Traveller is a registered trademark of Far Future Enterprises.') print() log.info(__app__ + ' started, and running...') app = QApplication(sys.argv) #Use print(QStyleFactory.keys()) to find a setStyle you like, instead of 'Fusion' app.setStyle('Fusion') darkPalette = QPalette() darkPalette.setColor(QPalette.Window, QColor(53, 53, 53)) darkPalette.setColor(QPalette.WindowText, Qt.white) darkPalette.setColor(QPalette.Disabled, QPalette.WindowText, QColor(127, 127, 127)) darkPalette.setColor(QPalette.Base, QColor(42, 42, 42)) darkPalette.setColor(QPalette.AlternateBase, QColor(66, 66, 66)) darkPalette.setColor(QPalette.ToolTipBase, Qt.white) darkPalette.setColor(QPalette.ToolTipText, Qt.white) darkPalette.setColor(QPalette.Text, Qt.white) darkPalette.setColor(QPalette.Disabled, QPalette.Text, QColor(127, 127, 127)) darkPalette.setColor(QPalette.Dark, QColor(35, 35, 35)) darkPalette.setColor(QPalette.Shadow, QColor(20, 20, 20)) darkPalette.setColor(QPalette.Button, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ButtonText, Qt.white) darkPalette.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(127, 127, 127)) darkPalette.setColor(QPalette.BrightText, Qt.red) darkPalette.setColor(QPalette.Link, QColor(42, 130, 218)) darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218)) darkPalette.setColor(QPalette.Disabled, QPalette.Highlight, QColor(80, 80, 80)) darkPalette.setColor(QPalette.HighlightedText, Qt.white) darkPalette.setColor(QPalette.Disabled, QPalette.HighlightedText, QColor(127, 127, 127)) mainApp = MainWindow() mainApp.show() app.setPalette(darkPalette) CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) #print(CURRENT_DIR) app.exec_()
[ 1, 529, 276, 1112, 420, 29958, 29903, 2350, 1233, 29928, 3780, 22017, 29914, 5323, 29894, 4539, 29899, 29934, 16903, 29899, 29903, 3019, 15462, 13, 29937, 13, 29937, 259, 5132, 29871, 29941, 29889, 29929, 29889, 29896, 29896, 317, 3019, 3251, 1061, 13, 29937, 13, 13383, 13383, 13383, 7346, 13, 13, 15945, 29908, 13, 29903, 3019, 15462, 29871, 29900, 29889, 29946, 29889, 29900, 350, 1187, 13, 2683, 2683, 2683, 2683, 26589, 13, 13, 4013, 1824, 16785, 409, 14359, 773, 6865, 515, 13, 29924, 7443, 852, 3201, 29894, 4539, 29871, 29906, 299, 17138, 29892, 322, 263, 1560, 333, 1885, 515, 3201, 29894, 4539, 29871, 29945, 29889, 29896, 29900, 13, 15945, 29908, 13, 13, 3166, 2927, 3304, 1053, 2069, 13, 3166, 2927, 3304, 1053, 28297, 29892, 7437, 29892, 22135, 13, 13, 2344, 580, 396, 11905, 2927, 3304, 13, 13, 29937, 5215, 5401, 29941, 29906, 510, 29889, 4645, 408, 5401, 29941, 29906, 13, 5215, 10876, 13, 29937, 9675, 29889, 2084, 29889, 4397, 877, 29907, 3583, 5959, 29905, 2713, 265, 1089, 29905, 20128, 29905, 3421, 12745, 29905, 11980, 7835, 29879, 29905, 29924, 7443, 852, 3201, 29894, 4539, 1495, 13, 3166, 4036, 1053, 20088, 524, 13, 3166, 10772, 17303, 29945, 29889, 17303, 9203, 1053, 334, 13, 3166, 10772, 17303, 29945, 29889, 17303, 28707, 1053, 334, 13, 3166, 10772, 17303, 29945, 29889, 17303, 8801, 29879, 1053, 334, 13, 29937, 5215, 10772, 17303, 29945, 29889, 17303, 11930, 408, 28880, 13, 5215, 931, 13, 3166, 1667, 7165, 1053, 501, 29875, 29918, 6330, 5907, 13, 3166, 1048, 15901, 1053, 501, 29875, 29918, 12717, 7647, 13, 3166, 8676, 15901, 1053, 501, 29875, 29918, 5729, 9446, 7647, 13, 3166, 364, 4061, 29918, 8504, 29889, 19737, 29928, 293, 261, 3028, 1053, 9679, 13, 5215, 2897, 13, 5215, 12183, 13, 5215, 11799, 13, 5215, 4390, 13, 5215, 12865, 13, 13, 1649, 8921, 1649, 353, 12801, 5813, 29958, 3532, 26862, 6227, 6778, 29905, 29876, 29966, 26862, 6227, 16299, 13, 1649, 932, 1649, 353, 525, 29903, 3019, 15462, 29871, 29900, 29889, 29946, 29889, 29900, 313, 29933, 1187, 16029, 13, 1649, 3259, 1649, 353, 525, 29900, 29889, 29946, 29889, 29900, 29890, 29915, 13, 13, 13, 1990, 1048, 7647, 29898, 29984, 7647, 29892, 501, 29875, 29918, 12717, 7647, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 1048, 7647, 2847, 5281, 856, 1495, 13, 4706, 1583, 29889, 842, 5907, 15675, 29898, 17303, 29889, 27528, 891, 14705, 29889, 5907, 855, 1036, 2951, 7031, 28016, 29897, 13, 4706, 1583, 29889, 14669, 29965, 29875, 29898, 1311, 29897, 13, 4706, 1583, 29889, 12717, 8949, 3125, 29889, 3808, 287, 29889, 6915, 29898, 1311, 29889, 16044, 8949, 3125, 4164, 287, 29897, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 1048, 7647, 16601, 29889, 1495, 13, 308, 13, 1678, 822, 3544, 8949, 3125, 4164, 287, 29898, 1311, 1125, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 1048, 7647, 14382, 856, 1495, 13, 4706, 1583, 29889, 5358, 580, 13, 13, 1990, 8676, 7647, 29898, 29984, 7647, 29892, 501, 29875, 29918, 5729, 9446, 7647, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 14550, 13, 4706, 4673, 278, 15642, 9446, 7928, 3474, 13, 4706, 14550, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 8676, 7647, 2847, 5281, 856, 1495, 13, 4706, 1583, 29889, 842, 5907, 15675, 29898, 17303, 29889, 27528, 891, 14705, 29889, 5907, 855, 1036, 2951, 7031, 28016, 29897, 13, 4706, 1583, 29889, 14669, 29965, 29875, 29898, 1311, 29897, 13, 4706, 1583, 29889, 5729, 9446, 8949, 3125, 29889, 3808, 287, 29889, 6915, 29898, 1311, 29889, 16044, 8949, 3125, 4164, 287, 29897, 13, 4706, 1583, 29889, 1949, 11526, 29879, 9323, 29889, 12038, 877, 1495, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 8676, 7647, 16601, 29889, 1495, 13, 13, 1678, 822, 3544, 8949, 3125, 4164, 287, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 23186, 278, 10772, 17303, 29945, 15642, 9446, 7928, 3474, 13, 4706, 14550, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 8676, 7647, 14382, 856, 1495, 13, 4706, 1583, 29889, 5358, 580, 13, 268, 13, 1678, 822, 1510, 8009, 11526, 29879, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 7704, 278, 1353, 310, 3186, 29879, 5759, 297, 278, 10772, 17303, 29945, 15642, 9446, 7928, 3474, 13, 4706, 14550, 13, 4706, 1583, 29889, 4294, 580, 13, 13, 1990, 4241, 5907, 29898, 29984, 6330, 5907, 29892, 501, 29875, 29918, 6330, 5907, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 4241, 5907, 2847, 5281, 856, 1495, 13, 4706, 1583, 29889, 14669, 29965, 29875, 29898, 1311, 29897, 13, 4706, 1583, 29889, 1885, 3125, 29889, 3808, 287, 29889, 6915, 29898, 1311, 29889, 17158, 29903, 3019, 29897, 13, 4706, 1583, 29889, 2467, 15462, 29889, 21001, 287, 29889, 6915, 29898, 1311, 29889, 17158, 29903, 3019, 29897, 13, 4706, 1583, 29889, 2467, 28173, 29918, 29903, 3019, 15462, 29889, 21001, 287, 29889, 6915, 29898, 1311, 29889, 2467, 28173, 29918, 21001, 287, 29897, 13, 4706, 1583, 29889, 2467, 2182, 277, 1184, 29887, 29889, 21001, 287, 29889, 6915, 29898, 1311, 29889, 2467, 2182, 277, 1184, 29887, 29918, 21001, 287, 29897, 13, 13, 4706, 396, 259, 25186, 13, 13, 4706, 1583, 29889, 29882, 11279, 29918, 28667, 29918, 5696, 353, 525, 29933, 1463, 373, 2180, 7681, 9085, 29915, 13, 4706, 1583, 29889, 29882, 11279, 3313, 29889, 1202, 2001, 877, 29933, 1463, 373, 2180, 7681, 9085, 1495, 13, 4706, 1583, 29889, 29882, 11279, 3313, 29889, 1202, 2001, 877, 29933, 1463, 373, 21179, 1495, 13, 4706, 1583, 29889, 29882, 11279, 3313, 29889, 842, 7583, 3220, 29898, 29900, 29897, 13, 4706, 1583, 29889, 29882, 11279, 3313, 29889, 3784, 3220, 7590, 29889, 6915, 29898, 1311, 29889, 29882, 11279, 3313, 29918, 15033, 29897, 13, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 18126, 5208, 17911, 29901, 29871, 29896, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 29934, 2027, 29901, 29871, 29941, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 29903, 5510, 29901, 29871, 29896, 29955, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 4421, 2620, 287, 29901, 29871, 29941, 29941, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 15449, 29901, 29871, 29945, 29900, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 29928, 1947, 29901, 29871, 29953, 29953, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 6821, 5402, 29901, 29871, 29947, 29941, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 1202, 2001, 877, 9203, 29901, 29871, 29929, 29896, 29995, 1495, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 842, 7583, 3220, 29898, 29946, 29897, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 3784, 3220, 7590, 29889, 6915, 29898, 1311, 29889, 6236, 279, 29918, 21518, 537, 3313, 29918, 15033, 29897, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 353, 29871, 29945, 29900, 13, 4706, 1480, 29889, 3888, 877, 4592, 624, 514, 279, 360, 575, 537, 338, 10117, 525, 718, 851, 29898, 1311, 29889, 6236, 279, 29918, 21518, 537, 29897, 718, 14210, 29889, 1495, 13, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 2887, 29901, 1094, 6468, 12433, 403, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 29907, 29879, 29901, 12477, 4306, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 1888, 29901, 18008, 12607, 1974, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 13695, 29901, 10050, 29899, 2499, 12961, 29892, 12968, 29899, 24130, 630, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 6295, 29901, 4956, 2480, 29875, 24606, 362, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 29963, 29874, 29901, 10050, 29899, 2499, 12961, 29892, 11681, 629, 29899, 24130, 630, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 29999, 29882, 29901, 796, 24008, 3270, 2138, 5987, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 1202, 2001, 877, 17875, 1495, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 842, 7583, 3220, 29898, 29906, 29897, 13, 4706, 1583, 29889, 284, 1397, 8837, 353, 525, 1888, 29915, 13, 4706, 1480, 29889, 3888, 877, 4592, 838, 1397, 8837, 338, 1954, 29901, 18008, 12607, 1974, 29889, 1495, 13, 4706, 1583, 29889, 8172, 29918, 284, 1397, 8837, 353, 7700, 13, 4706, 1583, 29889, 284, 1397, 8837, 3313, 29889, 3784, 3220, 7590, 29889, 6915, 29898, 1311, 29889, 284, 1397, 8837, 3313, 29918, 15033, 29897, 13, 308, 13, 4706, 1583, 29889, 9136, 29918, 799, 386, 29918, 305, 749, 353, 7700, 13, 4706, 1583, 29889, 9136, 29918, 799, 386, 29918, 3198, 3313, 29889, 29873, 468, 29887, 839, 29889, 6915, 29898, 1311, 29889, 9136, 29918, 799, 386, 29918, 3198, 3313, 29918, 15033, 29897, 13, 4706, 1583, 29889, 9136, 29918, 799, 386, 29918, 3198, 3313, 29889, 842, 17817, 29898, 1311, 29889, 9136, 29918, 799, 386, 29918, 305, 749, 29897, 13, 13, 4706, 1583, 29889, 7323, 28173, 7647, 353, 1048, 7647, 580, 13, 13, 4706, 1583, 29889, 7323, 26010, 7647, 353, 8676, 7647, 580, 13, 308, 13, 4706, 396, 259, 11901, 29925, 5920, 6137, 13, 13, 4706, 1583, 29889, 20970, 29918, 401, 353, 6024, 29900, 742, 525, 29896, 742, 525, 29906, 742, 525, 29941, 742, 525, 29946, 742, 525, 29945, 742, 525, 29953, 742, 13, 462, 308, 525, 29955, 742, 525, 29947, 742, 525, 29929, 742, 525, 29909, 742, 525, 29933, 742, 525, 29907, 742, 525, 29928, 742, 13, 462, 308, 525, 29923, 742, 525, 29943, 742, 525, 29954, 742, 525, 29950, 742, 525, 29967, 742, 525, 29968, 742, 13, 462, 308, 525, 29931, 742, 525, 29924, 742, 525, 29940, 742, 525, 29925, 742, 525, 29984, 742, 525, 29934, 742, 13, 462, 308, 525, 29903, 742, 525, 29911, 742, 525, 29965, 742, 525, 29963, 742, 525, 29956, 742, 525, 29990, 742, 525, 29979, 742, 525, 29999, 2033, 13, 13, 4706, 1583, 29889, 3221, 29918, 401, 353, 6024, 29909, 742, 525, 29933, 742, 525, 29907, 742, 525, 29928, 742, 13, 462, 3986, 525, 29923, 742, 525, 29943, 742, 525, 29954, 742, 525, 29950, 742, 13, 462, 3986, 525, 29902, 742, 525, 29967, 742, 525, 29968, 742, 525, 29931, 742, 13, 462, 3986, 525, 29924, 742, 525, 29940, 742, 525, 29949, 742, 525, 29925, 2033, 13, 268, 13, 1678, 396, 259, 2787, 3630, 323, 1849, 13, 13, 4706, 1583, 29889, 11526, 29918, 12863, 1535, 29918, 18933, 353, 518, 29900, 29892, 29871, 29900, 29892, 448, 29906, 29892, 448, 29906, 29892, 448, 29896, 29892, 448, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29953, 29892, 29871, 29953, 29892, 29871, 29906, 29892, 448, 29896, 29892, 29871, 29906, 29962, 13, 4706, 1583, 29889, 2311, 29918, 1767, 353, 965, 518, 259, 29906, 29892, 1678, 29906, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29962, 13, 4706, 1583, 29889, 271, 7681, 9085, 29918, 1767, 353, 268, 518, 259, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29962, 13, 4706, 1583, 29889, 29882, 11279, 29918, 1767, 353, 3986, 518, 259, 29896, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29896, 29892, 1678, 29906, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29962, 13, 4706, 1583, 29889, 7323, 2785, 29918, 1767, 353, 268, 518, 259, 29900, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29896, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29896, 29892, 1678, 29906, 29892, 1678, 29946, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29962, 13, 4706, 1583, 29889, 29887, 6170, 358, 29918, 1767, 353, 268, 518, 259, 29896, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29896, 29892, 1678, 29900, 29892, 1678, 29906, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 29871, 448, 29906, 29892, 29871, 448, 29906, 29892, 1678, 29900, 29962, 13, 4706, 1583, 29889, 1195, 12539, 29918, 14632, 353, 965, 518, 259, 29947, 29892, 1678, 29947, 29892, 1678, 29945, 29892, 1678, 29945, 29892, 1678, 29941, 29892, 29871, 448, 29896, 29892, 29871, 448, 29896, 29892, 1678, 29941, 29892, 29871, 448, 29896, 29892, 1678, 29941, 29892, 1678, 29947, 29892, 1678, 29929, 29892, 259, 29896, 29900, 29892, 1678, 29945, 29892, 1678, 29945, 29892, 1678, 29947, 29962, 13, 268, 13, 4706, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 353, 6024, 29990, 742, 525, 29990, 742, 525, 29990, 742, 525, 29923, 742, 525, 29923, 742, 525, 29928, 742, 525, 29928, 742, 525, 29907, 742, 525, 29907, 742, 525, 29933, 742, 525, 29933, 742, 525, 29909, 742, 525, 29909, 742, 525, 29909, 742, 525, 29909, 2033, 13, 4706, 1583, 29889, 8508, 637, 29918, 1767, 353, 539, 518, 448, 29946, 29892, 29871, 448, 29946, 29892, 29871, 448, 29946, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29900, 29892, 1678, 29906, 29892, 1678, 29906, 29892, 1678, 29946, 29892, 1678, 29946, 29892, 1678, 29953, 29892, 1678, 29953, 29892, 1678, 29953, 29892, 1678, 29953, 29962, 13, 308, 13, 4706, 1583, 29889, 25496, 29918, 3146, 424, 29918, 22640, 353, 418, 6024, 13420, 525, 13420, 525, 29896, 742, 525, 29896, 742, 525, 29906, 742, 525, 29906, 742, 525, 29941, 742, 525, 29941, 742, 525, 29946, 742, 525, 29946, 742, 525, 29946, 742, 525, 29945, 742, 525, 29945, 2033, 13, 4706, 1583, 29889, 9018, 300, 3398, 29918, 29890, 2152, 29918, 22640, 353, 6024, 13420, 525, 13420, 525, 29896, 742, 525, 29896, 742, 525, 29896, 742, 525, 29896, 742, 525, 29896, 742, 525, 29896, 742, 525, 29906, 742, 525, 29906, 742, 525, 29906, 742, 525, 29906, 742, 525, 29941, 2033, 13, 13, 4706, 1583, 29889, 16586, 353, 518, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29941, 29962, 13, 4706, 1583, 29889, 16072, 29918, 8508, 29918, 1853, 353, 259, 6024, 13420, 525, 13420, 525, 29909, 742, 525, 29924, 742, 525, 29924, 742, 525, 29924, 742, 525, 29924, 742, 525, 29924, 742, 525, 29968, 742, 525, 29954, 742, 525, 29943, 742, 525, 29943, 742, 525, 29943, 2033, 13, 4706, 1583, 29889, 2388, 273, 291, 29918, 8508, 29918, 1853, 353, 6024, 13420, 525, 13420, 525, 29909, 742, 525, 29943, 742, 525, 29943, 742, 525, 29954, 742, 525, 29954, 742, 525, 29968, 742, 525, 29968, 742, 525, 29924, 742, 525, 29924, 742, 525, 29924, 742, 525, 29924, 2033, 13, 4706, 1583, 29889, 8508, 29918, 2311, 353, 6024, 259, 13420, 525, 259, 13420, 525, 2687, 13420, 525, 5287, 742, 525, 5667, 13420, 525, 29963, 29871, 13420, 525, 29963, 29871, 13420, 525, 29963, 29871, 13420, 525, 29963, 29871, 13420, 525, 29963, 29871, 13420, 525, 29963, 29871, 13420, 525, 18118, 13420, 525, 29928, 29871, 525, 29962, 13, 13, 1678, 396, 259, 14976, 323, 1849, 13, 13, 4706, 1583, 29889, 29963, 259, 353, 29871, 29896, 13, 4706, 1583, 29889, 15633, 29871, 353, 29871, 29906, 13, 4706, 1583, 29889, 8257, 29871, 353, 29871, 29941, 13, 4706, 1583, 29889, 29907, 8257, 353, 29871, 29946, 13, 4706, 1583, 29889, 4174, 29871, 353, 29871, 29945, 13, 308, 13, 4706, 1583, 29889, 293, 29918, 29802, 353, 6024, 29890, 3788, 1182, 3788, 29883, 3788, 305, 3788, 29881, 3788, 29887, 742, 13, 462, 308, 525, 29882, 3788, 29926, 3788, 29895, 3788, 29880, 3788, 29885, 3788, 29886, 742, 13, 462, 308, 525, 29878, 3788, 29879, 3788, 303, 3788, 845, 742, 13, 462, 308, 525, 29873, 3788, 29894, 3788, 29893, 3788, 29920, 2033, 13, 4706, 1583, 29889, 293, 29918, 29888, 7971, 353, 518, 29906, 29947, 29892, 29896, 29906, 29892, 29906, 29900, 29892, 29896, 29953, 29892, 29906, 29955, 29892, 29929, 29892, 29906, 29900, 29892, 29906, 29900, 29892, 29896, 29941, 29892, 13, 462, 308, 29906, 29947, 29892, 29906, 29946, 29892, 29906, 29955, 29892, 29906, 29946, 29892, 29941, 29900, 29892, 29896, 29941, 29892, 29906, 29945, 29892, 13, 462, 308, 29906, 29900, 29892, 29953, 29892, 29896, 29953, 29892, 29946, 29962, 13, 308, 13, 4706, 1583, 29889, 29894, 29918, 29802, 353, 6024, 29874, 3788, 29872, 3788, 29875, 3788, 29877, 3788, 29884, 2033, 13, 4706, 1583, 29889, 29894, 29918, 29888, 7971, 353, 518, 29896, 29953, 29892, 29906, 29900, 29892, 29896, 29900, 29892, 29955, 29892, 29941, 29962, 13, 268, 13, 4706, 1583, 29889, 14047, 29918, 29802, 353, 6024, 29887, 3788, 1896, 3788, 1983, 3788, 29876, 303, 3788, 3137, 3788, 645, 3788, 15755, 2033, 13, 4706, 1583, 29889, 14047, 29918, 29888, 7971, 353, 518, 29906, 29900, 29892, 29941, 29892, 29896, 29947, 29892, 29896, 29953, 29892, 29896, 29947, 29892, 29946, 29892, 29941, 29962, 13, 268, 13, 4706, 1583, 29889, 13801, 29918, 29802, 353, 6024, 305, 3788, 384, 3788, 29881, 3788, 4518, 3788, 4518, 484, 742, 13, 462, 308, 525, 4415, 3788, 492, 3788, 433, 3788, 280, 3788, 1358, 742, 13, 462, 308, 525, 15755, 3788, 29885, 3788, 1171, 3788, 655, 3788, 1050, 3788, 1460, 742, 13, 462, 308, 525, 1004, 3788, 29876, 3788, 22911, 3788, 484, 3788, 865, 742, 13, 462, 308, 525, 1089, 3788, 15459, 3788, 2786, 742, 13, 462, 308, 525, 2546, 3788, 2096, 347, 3788, 29878, 368, 3788, 2546, 3788, 2273, 742, 13, 462, 308, 525, 719, 3788, 4977, 3788, 17051, 3788, 29876, 845, 29875, 3788, 29876, 2574, 3788, 1100, 742, 13, 462, 308, 525, 29876, 1100, 3788, 386, 3788, 941, 3788, 2034, 3788, 29873, 3788, 29894, 742, 13, 462, 308, 525, 1362, 3788, 434, 3788, 27603, 742, 13, 462, 308, 525, 5288, 3788, 23443, 3788, 12160, 3788, 880, 3788, 28898, 3788, 29873, 375, 742, 13, 462, 308, 525, 417, 345, 3788, 344, 3788, 29876, 357, 3788, 645, 2033, 13, 4706, 1583, 29889, 13801, 29918, 29888, 7971, 353, 518, 29953, 29892, 29896, 29941, 29892, 29906, 29906, 29892, 29896, 29906, 29892, 29941, 29892, 29941, 29892, 29941, 29892, 29896, 29900, 29892, 29953, 29892, 29896, 29900, 29892, 29955, 29892, 13, 462, 308, 29906, 29945, 29892, 29896, 29900, 29892, 29946, 29892, 29896, 29941, 29892, 29896, 29906, 29892, 29945, 29892, 29906, 29955, 29892, 29896, 29896, 29892, 29946, 29892, 29896, 29946, 29892, 29896, 29941, 29892, 29896, 29955, 29892, 29955, 29892, 29953, 29892, 29945, 29892, 29945, 29892, 29953, 29892, 29941, 29892, 13, 462, 308, 29906, 29896, 29892, 29896, 29900, 29892, 29941, 29892, 29947, 29892, 29941, 29892, 29906, 29900, 29892, 29929, 29892, 29896, 29946, 29892, 29896, 29900, 29892, 29896, 29953, 29892, 29896, 29896, 29892, 29947, 29892, 29953, 29892, 29947, 29892, 29896, 29900, 29892, 29955, 29892, 29953, 29892, 29945, 29892, 29955, 29892, 29955, 29892, 29946, 29892, 13, 462, 308, 29946, 29892, 29896, 29906, 29892, 29945, 29892, 29946, 29962, 13, 308, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 293, 29918, 29802, 22164, 13, 9651, 1480, 29889, 8382, 29898, 1311, 29889, 293, 29918, 29802, 29961, 29875, 29962, 718, 525, 525, 718, 851, 29898, 1311, 29889, 293, 29918, 29888, 7971, 29961, 29875, 12622, 13, 308, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 29894, 29918, 29802, 22164, 13, 9651, 1480, 29889, 8382, 29898, 1311, 29889, 29894, 29918, 29802, 29961, 29875, 29962, 718, 525, 525, 718, 851, 29898, 1311, 29889, 29894, 29918, 29888, 7971, 29961, 29875, 12622, 13, 632, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 14047, 29918, 29802, 22164, 13, 9651, 1480, 29889, 8382, 29898, 1311, 29889, 14047, 29918, 29802, 29961, 29875, 29962, 718, 525, 525, 718, 851, 29898, 1311, 29889, 14047, 29918, 29888, 7971, 29961, 29875, 12622, 13, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 13801, 29918, 29802, 22164, 13, 9651, 1480, 29889, 8382, 29898, 1311, 29889, 13801, 29918, 29802, 29961, 29875, 29962, 718, 525, 525, 718, 851, 29898, 1311, 29889, 13801, 29918, 29888, 7971, 29961, 29875, 12622, 13, 268, 13, 4706, 1583, 29889, 29879, 15114, 519, 29918, 1853, 353, 518, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 1311, 29889, 29963, 29892, 13, 462, 795, 1583, 29889, 8257, 29892, 1311, 29889, 8257, 29892, 1311, 29889, 8257, 29892, 1311, 29889, 8257, 29892, 13, 462, 795, 1583, 29889, 15633, 29892, 1311, 29889, 15633, 29892, 1311, 29889, 15633, 29892, 1311, 29889, 15633, 29892, 13, 462, 795, 1583, 29889, 29907, 8257, 29892, 1311, 29889, 29907, 8257, 29892, 1311, 29889, 29907, 8257, 29892, 1311, 29889, 29907, 8257, 29892, 1311, 29889, 29907, 8257, 29892, 1311, 29889, 29907, 8257, 29892, 13, 462, 795, 1583, 29889, 4174, 29892, 1311, 29889, 4174, 29962, 13, 4706, 396, 2158, 1583, 29889, 29879, 15114, 519, 29918, 1853, 13, 13, 4706, 1583, 29889, 293, 29918, 29879, 3885, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 293, 29918, 29888, 7971, 22164, 13, 9651, 363, 432, 297, 3464, 29898, 1311, 29889, 293, 29918, 29888, 7971, 29961, 29875, 29962, 1125, 13, 18884, 1583, 29889, 293, 29918, 29879, 3885, 29889, 4397, 29898, 1311, 29889, 293, 29918, 29802, 29961, 29875, 2314, 13, 4706, 1583, 29889, 29894, 29918, 29879, 3885, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 29894, 29918, 29888, 7971, 22164, 13, 9651, 363, 432, 297, 3464, 29898, 1311, 29889, 29894, 29918, 29888, 7971, 29961, 29875, 29962, 1125, 13, 18884, 1583, 29889, 29894, 29918, 29879, 3885, 29889, 4397, 29898, 1311, 29889, 29894, 29918, 29802, 29961, 29875, 2314, 13, 4706, 1583, 29889, 14047, 29918, 29879, 3885, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 14047, 29918, 29888, 7971, 22164, 13, 9651, 363, 432, 297, 3464, 29898, 1311, 29889, 14047, 29918, 29888, 7971, 29961, 29875, 29962, 1125, 13, 18884, 1583, 29889, 14047, 29918, 29879, 3885, 29889, 4397, 29898, 1311, 29889, 14047, 29918, 29802, 29961, 29875, 2314, 13, 4706, 1583, 29889, 13801, 29918, 29879, 3885, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1311, 29889, 13801, 29918, 29888, 7971, 22164, 13, 9651, 363, 432, 297, 3464, 29898, 1311, 29889, 13801, 29918, 29888, 7971, 29961, 29875, 29962, 1125, 13, 18884, 1583, 29889, 13801, 29918, 29879, 3885, 29889, 4397, 29898, 1311, 29889, 13801, 29918, 29802, 29961, 29875, 2314, 13, 13, 4706, 1480, 29889, 3888, 877, 19737, 17303, 29945, 4241, 5907, 16601, 29889, 1495, 13, 632, 13, 1678, 822, 5839, 29918, 29802, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 29879, 29918, 1853, 1275, 1583, 29889, 29963, 29901, 13, 9651, 1583, 29889, 29802, 353, 1583, 29889, 29894, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29894, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 13, 4706, 565, 1583, 29889, 29879, 29918, 1853, 1275, 1583, 29889, 15633, 29901, 13, 9651, 1583, 29889, 29802, 353, 1583, 29889, 293, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 293, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 718, 1583, 29889, 29894, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29894, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 13, 4706, 565, 1583, 29889, 29879, 29918, 1853, 1275, 1583, 29889, 8257, 29901, 13, 9651, 1583, 29889, 29802, 353, 1583, 29889, 29894, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29894, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 718, 1583, 29889, 13801, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 13801, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 13, 4706, 565, 1583, 29889, 29879, 29918, 1853, 1275, 1583, 29889, 29907, 8257, 29901, 13, 9651, 1583, 29889, 29802, 353, 1583, 29889, 293, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 293, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 718, 1583, 29889, 29894, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29894, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 320, 13, 9651, 718, 1583, 29889, 13801, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 13801, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 13, 4706, 565, 1583, 29889, 29879, 29918, 1853, 1275, 1583, 29889, 4174, 29901, 13, 9651, 1583, 29889, 29802, 353, 1583, 29889, 14047, 29918, 29879, 3885, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 14047, 29918, 29879, 3885, 876, 448, 29871, 29896, 29962, 13, 13, 1678, 822, 5706, 29903, 3019, 29898, 1311, 1125, 13, 308, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 877, 1272, 29374, 13, 9651, 2897, 29889, 11256, 3972, 877, 1272, 1495, 13, 13, 4706, 11799, 29918, 1445, 29918, 449, 353, 1722, 877, 1272, 29914, 1610, 29918, 344, 2801, 29918, 1272, 29889, 7638, 742, 525, 29893, 742, 25899, 2433, 1495, 13, 4706, 11799, 29918, 13236, 353, 11799, 29889, 13236, 29898, 7638, 29918, 1445, 29918, 449, 29897, 13, 4706, 11799, 29918, 13236, 29889, 13236, 340, 18959, 6508, 742, 525, 14058, 29918, 1170, 742, 525, 16213, 637, 742, 525, 3505, 742, 525, 4178, 7681, 9085, 742, 525, 29950, 11279, 6420, 742, 525, 12310, 2785, 742, 525, 29954, 6170, 358, 742, 525, 29931, 1450, 29918, 10108, 742, 525, 29911, 5309, 29918, 10108, 742, 525, 5323, 311, 29918, 29907, 2631, 742, 525, 5323, 955, 29918, 3399, 742, 525, 5160, 742, 525, 12310, 29918, 29924, 742, 525, 21140, 1372, 742, 525, 29954, 294, 29918, 3146, 1934, 742, 525, 14058, 29879, 742, 525, 2499, 1397, 8837, 742, 525, 855, 514, 279, 29918, 1469, 742, 525, 5776, 546, 1535, 11287, 13, 308, 13, 4706, 4390, 29918, 1445, 29918, 449, 353, 1722, 877, 1272, 29914, 1610, 29918, 344, 2801, 29918, 1272, 29889, 3126, 742, 525, 29893, 1495, 13, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 353, 1722, 877, 1272, 29914, 3471, 29918, 29886, 29900, 29900, 29918, 29886, 29900, 29900, 29889, 4130, 742, 525, 29893, 742, 25899, 2433, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 14237, 3251, 630, 491, 2045, 597, 3292, 29889, 510, 29914, 29903, 2350, 1233, 29928, 3780, 22017, 29914, 5323, 29894, 4539, 29899, 29934, 16903, 29899, 29903, 3019, 15462, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 525, 718, 851, 29898, 12673, 29889, 12673, 29889, 3707, 22130, 13, 13, 4706, 3186, 29918, 1761, 353, 5159, 13, 13, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 448, 29896, 13, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 353, 6629, 13, 13, 1678, 396, 259, 4408, 278, 17535, 13, 13, 4706, 1571, 353, 7700, 13, 4706, 1550, 451, 29898, 771, 546, 1125, 13, 9651, 5694, 353, 1583, 29889, 4174, 13, 9651, 1550, 5694, 1275, 1583, 29889, 4174, 29901, 13, 18884, 5694, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 9651, 1583, 29889, 29879, 29918, 1853, 353, 5694, 13, 9651, 1583, 29889, 23945, 29918, 29802, 580, 13, 9651, 1583, 29889, 1742, 353, 1583, 29889, 29802, 13, 9651, 5214, 353, 5852, 13, 9651, 1550, 5214, 29901, 13, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 4174, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 29963, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 15633, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 29907, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 565, 5694, 1275, 1583, 29889, 8257, 470, 5694, 1275, 1583, 29889, 29907, 8257, 29901, 13, 462, 1678, 5214, 353, 7700, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 29879, 29918, 1853, 353, 9878, 645, 519, 13, 462, 1678, 1583, 29889, 23945, 29918, 29802, 580, 13, 462, 1678, 1583, 29889, 1742, 4619, 1583, 29889, 29802, 13, 462, 1678, 5694, 353, 9878, 645, 519, 13, 13, 9651, 565, 7431, 29898, 1311, 29889, 1742, 29897, 1405, 29871, 29941, 322, 7431, 29898, 1311, 29889, 1742, 29897, 529, 29871, 29896, 29946, 29901, 13, 18884, 1571, 353, 5852, 13, 13, 4706, 1583, 29889, 344, 2801, 29918, 978, 353, 18460, 29898, 536, 29898, 1311, 29889, 1742, 29961, 29900, 2314, 448, 29871, 29941, 29906, 29897, 718, 1583, 29889, 1742, 29961, 29896, 29901, 2435, 29898, 1311, 29889, 1742, 4638, 13, 13, 4706, 1571, 353, 7700, 13, 4706, 1550, 451, 29898, 771, 546, 1125, 13, 9651, 5694, 353, 1583, 29889, 4174, 13, 9651, 1550, 5694, 1275, 1583, 29889, 4174, 29901, 13, 18884, 5694, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 9651, 1583, 29889, 29879, 29918, 1853, 353, 5694, 13, 9651, 1583, 29889, 23945, 29918, 29802, 580, 13, 9651, 1583, 29889, 1742, 353, 1583, 29889, 29802, 13, 9651, 5214, 353, 5852, 13, 9651, 1550, 5214, 29901, 13, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 4174, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 29963, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 15633, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1550, 5694, 1275, 1583, 29889, 29907, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 565, 5694, 1275, 1583, 29889, 8257, 470, 5694, 1275, 1583, 29889, 29907, 8257, 29901, 13, 462, 1678, 5214, 353, 7700, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 29879, 29918, 1853, 353, 9878, 645, 519, 13, 462, 1678, 1583, 29889, 23945, 29918, 29802, 580, 13, 462, 1678, 1583, 29889, 1742, 4619, 1583, 29889, 29802, 13, 462, 1678, 5694, 353, 9878, 645, 519, 13, 13, 9651, 565, 7431, 29898, 1311, 29889, 1742, 29897, 1405, 29871, 29941, 322, 7431, 29898, 1311, 29889, 1742, 29897, 529, 29871, 29896, 29946, 29901, 13, 18884, 1571, 353, 5852, 13, 13, 4706, 1024, 29918, 1707, 8837, 353, 9679, 877, 29881, 29896, 29900, 29900, 1495, 13, 308, 13, 4706, 396, 2158, 29898, 978, 29918, 1707, 8837, 29897, 13, 13, 4706, 565, 1024, 29918, 1707, 8837, 5277, 29871, 29953, 29900, 29901, 13, 9651, 565, 1024, 29918, 1707, 8837, 6736, 29871, 29946, 29945, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 18460, 29898, 536, 29898, 1311, 29889, 1742, 29961, 29900, 2314, 448, 29871, 29941, 29906, 29897, 718, 1583, 29889, 1742, 29961, 29896, 29901, 2435, 29898, 1311, 29889, 1742, 4638, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29941, 29945, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 28630, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29906, 29945, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 29933, 1187, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29896, 29945, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 6642, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29896, 29900, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 1123, 14520, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29955, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 29903, 3019, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29953, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 29348, 631, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29946, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 3904, 5746, 29925, 3927, 19386, 29915, 13, 9651, 25342, 1024, 29918, 1707, 8837, 6736, 29871, 29906, 29901, 13, 18884, 1583, 29889, 344, 2801, 29918, 978, 4619, 525, 525, 718, 525, 3904, 29968, 6632, 16048, 29915, 13, 13, 4706, 396, 2158, 29898, 1311, 29889, 344, 2801, 29918, 978, 29897, 13, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29937, 525, 718, 1583, 29889, 344, 2801, 29918, 978, 29897, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 29871, 29900, 29892, 29900, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29937, 4408, 29901, 525, 718, 1583, 29889, 344, 2801, 29918, 978, 29897, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29937, 3833, 9532, 29901, 341, 29896, 29896, 29900, 29945, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29937, 24596, 1169, 29901, 525, 718, 1583, 29889, 344, 2801, 29918, 978, 718, 525, 17535, 471, 20459, 5759, 491, 525, 718, 4770, 932, 1649, 29897, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29937, 13361, 29901, 529, 5813, 29958, 2045, 597, 1636, 29889, 19567, 29889, 510, 29914, 1792, 29914, 29903, 2350, 1233, 29928, 3780, 22017, 11135, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 7562, 29901, 390, 2540, 515, 18294, 852, 3201, 29894, 4539, 29871, 29906, 299, 17138, 29892, 322, 263, 1560, 333, 1885, 515, 3201, 29894, 4539, 29871, 29945, 29889, 29896, 29900, 29905, 29876, 1495, 13, 13, 1678, 396, 259, 4408, 278, 1014, 8803, 943, 13, 13, 4706, 396, 1311, 29889, 1491, 8803, 29918, 978, 353, 5159, 259, 13, 4706, 363, 11684, 297, 3464, 29898, 29896, 29953, 1125, 13, 9651, 1571, 353, 7700, 13, 9651, 1550, 451, 29898, 771, 546, 1125, 13, 18884, 5694, 353, 1583, 29889, 4174, 13, 18884, 1550, 5694, 1275, 1583, 29889, 4174, 29901, 13, 462, 1678, 5694, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 18884, 1583, 29889, 29879, 29918, 1853, 353, 5694, 13, 18884, 1583, 29889, 23945, 29918, 29802, 580, 13, 18884, 1583, 29889, 1742, 353, 1583, 29889, 29802, 13, 18884, 5214, 353, 5852, 13, 18884, 1550, 5214, 29901, 13, 462, 1678, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 1678, 1550, 5694, 1275, 1583, 29889, 4174, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 4706, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 1678, 1550, 5694, 1275, 1583, 29889, 29963, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 4706, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 1678, 1550, 5694, 1275, 1583, 29889, 15633, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 4706, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 1678, 1550, 5694, 1275, 1583, 29889, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 4706, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 1678, 1550, 5694, 1275, 1583, 29889, 29907, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 4706, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 1678, 565, 5694, 1275, 1583, 29889, 8257, 470, 5694, 1275, 1583, 29889, 29907, 8257, 29901, 13, 462, 4706, 5214, 353, 7700, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 29879, 29918, 1853, 353, 9878, 645, 519, 13, 462, 4706, 1583, 29889, 23945, 29918, 29802, 580, 13, 462, 4706, 1583, 29889, 1742, 4619, 1583, 29889, 29802, 13, 462, 4706, 5694, 353, 9878, 645, 519, 13, 13, 18884, 565, 7431, 29898, 1311, 29889, 1742, 29897, 1405, 29871, 29941, 322, 7431, 29898, 1311, 29889, 1742, 29897, 529, 29871, 29896, 29946, 29901, 13, 462, 1678, 1571, 353, 5852, 13, 13, 9651, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 3323, 344, 2801, 525, 718, 1583, 29889, 3221, 29918, 401, 29961, 1491, 29879, 29962, 718, 525, 29901, 525, 718, 18460, 29898, 536, 29898, 1311, 29889, 1742, 29961, 29900, 2314, 448, 29871, 29941, 29906, 29897, 718, 1583, 29889, 1742, 29961, 29896, 29901, 2435, 29898, 1311, 29889, 1742, 29897, 2314, 13, 9651, 396, 1311, 29889, 1491, 8803, 29918, 978, 29889, 4397, 29898, 22495, 29898, 536, 29898, 1311, 29889, 1742, 29961, 29900, 2314, 448, 29871, 29941, 29906, 29897, 718, 1583, 29889, 1742, 29961, 29896, 29901, 2435, 29898, 1311, 29889, 1742, 29897, 2314, 13, 4706, 396, 2158, 29898, 1311, 29889, 1491, 8803, 29918, 978, 29897, 13, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29937, 838, 1397, 29901, 1094, 29901, 9872, 5813, 11903, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 838, 1397, 29901, 24277, 29901, 376, 4032, 4306, 29908, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 838, 1397, 29901, 1954, 29901, 376, 1349, 1823, 12607, 1974, 29908, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 838, 1397, 29901, 4465, 29901, 376, 12283, 29899, 2499, 12961, 29892, 12968, 29899, 24130, 630, 29908, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 838, 1397, 29901, 1105, 29901, 376, 13296, 2480, 29875, 24606, 362, 29908, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 838, 1397, 29901, 12549, 29901, 376, 12283, 29899, 2499, 12961, 29892, 11681, 629, 29899, 24130, 630, 29908, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29937, 838, 1397, 29901, 27134, 29901, 376, 29999, 24008, 3270, 2138, 5987, 29908, 1495, 13, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29905, 29876, 29950, 735, 29871, 4408, 462, 501, 26433, 539, 5240, 17862, 795, 426, 29902, 29916, 29913, 259, 313, 1252, 29897, 1678, 518, 29907, 29916, 29962, 259, 405, 350, 29871, 796, 349, 29933, 29954, 399, 29871, 319, 1678, 624, 514, 279, 1495, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 29898, 29871, 11297, 29876, 807, 448, 2683, 5634, 448, 1378, 448, 2683, 5634, 448, 23648, 448, 22158, 448, 23648, 448, 1192, 448, 11474, 1192, 23250, 448, 9072, 29899, 1495, 13, 13, 4706, 1583, 29889, 11526, 29879, 29918, 24476, 353, 29871, 29900, 13, 13, 1678, 396, 259, 8561, 278, 3186, 29879, 13, 13, 4706, 363, 15090, 29918, 7720, 29918, 1054, 297, 3464, 29898, 29941, 29906, 1125, 13, 9651, 363, 15090, 29918, 7720, 29918, 798, 297, 3464, 29898, 29946, 29900, 1125, 13, 13, 18884, 565, 9679, 877, 29881, 29896, 29900, 29900, 1495, 5277, 1583, 29889, 6236, 279, 29918, 21518, 537, 29901, 13, 462, 308, 13, 18884, 396, 259, 3617, 2787, 4408, 13, 632, 13, 462, 1678, 1571, 353, 7700, 13, 462, 1678, 1550, 451, 29898, 771, 546, 1125, 13, 462, 4706, 5694, 353, 1583, 29889, 4174, 13, 462, 4706, 1550, 5694, 1275, 1583, 29889, 4174, 29901, 13, 462, 9651, 5694, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 4706, 1583, 29889, 29879, 29918, 1853, 353, 5694, 13, 462, 4706, 1583, 29889, 23945, 29918, 29802, 580, 13, 462, 4706, 1583, 29889, 1742, 353, 1583, 29889, 29802, 13, 462, 4706, 5214, 353, 5852, 13, 462, 4706, 1550, 5214, 29901, 13, 462, 9651, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 9651, 1550, 5694, 1275, 1583, 29889, 4174, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 9651, 1550, 5694, 1275, 1583, 29889, 29963, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 9651, 1550, 5694, 1275, 1583, 29889, 15633, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 29963, 470, 9878, 645, 519, 1275, 1583, 29889, 8257, 1125, 13, 462, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 9651, 1550, 5694, 1275, 1583, 29889, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 9651, 1550, 5694, 1275, 1583, 29889, 29907, 8257, 322, 313, 29879, 15114, 519, 1275, 1583, 29889, 15633, 470, 9878, 645, 519, 1275, 1583, 29889, 29907, 8257, 470, 9878, 645, 519, 1275, 1583, 29889, 4174, 1125, 13, 462, 18884, 9878, 645, 519, 353, 1583, 29889, 29879, 15114, 519, 29918, 1853, 29961, 9502, 524, 29898, 29896, 29892, 7431, 29898, 1311, 29889, 29879, 15114, 519, 29918, 1853, 876, 448, 29871, 29896, 29962, 13, 462, 9651, 565, 5694, 1275, 1583, 29889, 8257, 470, 5694, 1275, 1583, 29889, 29907, 8257, 29901, 13, 462, 18884, 5214, 353, 7700, 13, 462, 9651, 1683, 29901, 13, 462, 18884, 1583, 29889, 29879, 29918, 1853, 353, 9878, 645, 519, 13, 462, 18884, 1583, 29889, 23945, 29918, 29802, 580, 13, 462, 18884, 1583, 29889, 1742, 4619, 1583, 29889, 29802, 13, 462, 18884, 5694, 353, 9878, 645, 519, 13, 13, 462, 4706, 565, 7431, 29898, 1311, 29889, 1742, 29897, 1405, 29871, 29941, 322, 7431, 29898, 1311, 29889, 1742, 29897, 529, 29871, 29896, 29946, 29901, 13, 462, 9651, 1571, 353, 5852, 13, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 978, 353, 18460, 29898, 536, 29898, 1311, 29889, 1742, 29961, 29900, 2314, 448, 29871, 29941, 29906, 29897, 718, 1583, 29889, 1742, 29961, 29896, 29901, 2435, 29898, 1311, 29889, 1742, 4638, 13, 632, 13, 18884, 396, 259, 10987, 17015, 322, 3323, 344, 2801, 363, 4241, 2787, 13, 462, 268, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 353, 1583, 29889, 3221, 29918, 401, 15625, 20970, 29918, 7720, 29918, 1054, 29897, 849, 29871, 29947, 718, 5135, 20970, 29918, 7720, 29918, 798, 29897, 849, 29871, 29896, 29900, 29897, 334, 29871, 29946, 29962, 13, 462, 1678, 396, 2158, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 5479, 29897, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 353, 6629, 13, 462, 268, 13, 462, 1678, 565, 15090, 29918, 7720, 29918, 1054, 718, 29871, 29896, 529, 29871, 29896, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 4619, 525, 29900, 29915, 718, 1583, 29889, 20970, 29918, 401, 29961, 20970, 29918, 7720, 29918, 1054, 718, 29871, 29896, 29962, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 4619, 851, 29898, 20970, 29918, 7720, 29918, 1054, 718, 29871, 29896, 29897, 13, 13, 462, 1678, 565, 15090, 29918, 7720, 29918, 798, 718, 29871, 29896, 529, 29871, 29896, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 4619, 525, 29900, 29915, 718, 1583, 29889, 20970, 29918, 401, 29961, 20970, 29918, 7720, 29918, 798, 718, 29871, 29896, 29962, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 4619, 851, 29898, 20970, 29918, 7720, 29918, 798, 718, 29871, 29896, 29897, 13, 462, 1678, 396, 2158, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 5479, 29897, 13, 13, 18884, 396, 259, 21809, 363, 4241, 2787, 21179, 13, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 353, 9679, 877, 29906, 29928, 29899, 29906, 1495, 259, 13, 462, 1678, 396, 515, 3201, 29894, 4539, 29945, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 1275, 29871, 29896, 29900, 29901, 13, 462, 4706, 565, 1583, 29889, 9136, 29918, 799, 386, 29918, 305, 749, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 353, 9679, 877, 29896, 29928, 29974, 29929, 1495, 13, 462, 9651, 396, 2158, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 29897, 13, 13, 18884, 396, 259, 21809, 363, 4241, 2787, 2180, 7681, 9085, 13, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 353, 9679, 877, 10536, 29965, 29990, 1495, 718, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 13, 462, 1678, 396, 515, 3201, 29894, 4539, 29945, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 529, 29871, 29900, 470, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 1275, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 353, 29871, 29900, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1405, 29871, 29896, 29945, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 353, 29871, 29896, 29945, 13, 13, 18884, 396, 259, 21809, 363, 4241, 2787, 379, 11279, 6420, 13, 13, 462, 1678, 565, 1583, 29889, 29882, 11279, 29918, 28667, 29918, 5696, 1275, 525, 29933, 1463, 373, 2180, 7681, 9085, 2396, 13, 462, 4706, 396, 515, 18294, 852, 3201, 29894, 4539, 29871, 29906, 299, 17138, 322, 3201, 29894, 4539, 29945, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 353, 9679, 877, 10536, 29965, 29990, 1495, 718, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 396, 515, 1554, 1683, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 353, 9679, 877, 10536, 29965, 29990, 1495, 718, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 13, 462, 308, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 529, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 353, 29871, 29900, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 1405, 29871, 29896, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 353, 29871, 29896, 29900, 13, 13, 18884, 396, 259, 21179, 322, 2180, 7681, 9085, 27692, 29879, 2715, 304, 379, 11279, 6420, 13, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 529, 29871, 29906, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 353, 29871, 29900, 13, 462, 308, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 529, 29871, 29906, 470, 320, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29896, 29900, 470, 320, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29896, 29896, 470, 320, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29896, 29906, 29901, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 4619, 448, 29946, 13, 13, 18884, 396, 259, 4241, 2787, 6789, 546, 1535, 29973, 13, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 12863, 1535, 353, 9679, 877, 29906, 29881, 29953, 1495, 718, 1583, 29889, 11526, 29918, 12863, 1535, 29918, 18933, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 13, 462, 13, 18884, 396, 259, 6789, 546, 1535, 27692, 29879, 2715, 304, 379, 11279, 6420, 13, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 2804, 29871, 29896, 29941, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 2804, 29871, 29896, 29945, 29901, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 12863, 1535, 6736, 29871, 29896, 29900, 322, 1583, 29889, 3396, 29918, 11526, 29918, 12863, 1535, 5277, 29871, 29896, 29896, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 4619, 448, 29906, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 12863, 1535, 6736, 29871, 29896, 29906, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 4619, 448, 29953, 13, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 529, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 353, 29871, 29900, 13, 13, 18884, 396, 259, 21809, 363, 4241, 2787, 24810, 13, 13, 462, 1678, 396, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 353, 9679, 877, 29906, 29928, 29953, 29899, 29906, 1495, 13, 462, 1678, 396, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 353, 9679, 877, 29946, 29928, 29946, 29899, 29946, 1495, 13, 462, 268, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 353, 9679, 877, 29906, 29881, 29953, 29899, 29906, 1495, 13, 13, 18884, 396, 259, 21809, 363, 4241, 2787, 10354, 13, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 1405, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 353, 9679, 877, 10536, 29965, 29990, 1495, 718, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 529, 29871, 29900, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 353, 29871, 29900, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1405, 29871, 29896, 29945, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 353, 29871, 29896, 29945, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 353, 29871, 29900, 13, 13, 18884, 396, 259, 21809, 363, 7927, 21597, 13, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 1405, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 353, 9679, 877, 10536, 29965, 29990, 1495, 718, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 529, 29871, 29900, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 353, 29871, 29900, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 1405, 29871, 29896, 29945, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 353, 29871, 29896, 29945, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 353, 29871, 29900, 13, 462, 308, 13, 18884, 396, 259, 21809, 363, 7828, 637, 268, 13, 462, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 8508, 637, 353, 9679, 877, 29906, 29928, 29953, 1495, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29896, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 8508, 637, 4619, 29871, 29906, 13, 462, 1678, 25342, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29947, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 8508, 637, 4619, 29871, 29896, 13, 462, 1678, 25342, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29906, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 8508, 637, 4619, 448, 29906, 13, 462, 1678, 25342, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29946, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 8508, 637, 4619, 448, 29896, 13, 462, 13, 18884, 396, 259, 21809, 363, 17968, 21597, 13, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 1405, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 9679, 877, 29896, 29928, 29953, 1495, 13, 462, 13, 18884, 396, 259, 3462, 27692, 29879, 13, 462, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 4619, 1583, 29889, 8508, 637, 29918, 1767, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 4619, 1583, 29889, 2311, 29918, 1767, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 29962, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 4619, 1583, 29889, 271, 7681, 9085, 29918, 1767, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 4619, 1583, 29889, 29882, 11279, 29918, 1767, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 29962, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 4619, 1583, 29889, 7323, 2785, 29918, 1767, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 29962, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 4619, 1583, 29889, 29887, 6170, 358, 29918, 1767, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 29962, 13, 462, 13, 18884, 396, 259, 2087, 5143, 3080, 12539, 323, 29931, 363, 16738, 284, 9628, 1169, 13, 462, 13, 462, 4706, 565, 1583, 29889, 1195, 12539, 29918, 14632, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 2804, 448, 29896, 29901, 13, 462, 9651, 565, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 529, 1583, 29889, 1195, 12539, 29918, 14632, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5387, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 1583, 29889, 1195, 12539, 29918, 14632, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 13, 462, 268, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 529, 29871, 29900, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 29871, 29900, 13, 462, 4706, 565, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 1405, 29871, 29896, 29945, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 29871, 29896, 29945, 13, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 29871, 29900, 13, 462, 268, 13, 18884, 396, 259, 20535, 403, 3201, 955, 5920, 13, 462, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 353, 6629, 13, 462, 1678, 565, 313, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29896, 29900, 470, 313, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1275, 29871, 29900, 470, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1275, 29871, 29955, 320, 13, 462, 9651, 470, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1275, 29871, 29896, 29900, 29897, 470, 313, 1311, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 1275, 29871, 29900, 470, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 6736, 29871, 29929, 876, 322, 9679, 877, 29881, 29953, 1495, 1275, 29871, 29953, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 353, 525, 418, 319, 29915, 13, 462, 13, 18884, 396, 259, 7419, 786, 27226, 5920, 29898, 29879, 29897, 13, 462, 13, 462, 1678, 1583, 29889, 3018, 311, 29918, 2248, 353, 29871, 29900, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 353, 6024, 29871, 525, 5501, 29871, 525, 5501, 29871, 525, 5501, 29871, 525, 5501, 29871, 525, 5501, 29871, 13420, 525, 29871, 13420, 525, 29871, 13420, 525, 29871, 13420, 525, 29871, 525, 29962, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 353, 6024, 29871, 525, 5501, 29871, 525, 5501, 29871, 525, 5501, 29871, 525, 5501, 29871, 525, 5501, 29871, 13420, 525, 29871, 13420, 525, 29871, 13420, 525, 29871, 13420, 525, 29871, 525, 29962, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29946, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29929, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29946, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 5277, 29871, 29947, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29945, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29955, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 14769, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29909, 629, 3953, 3631, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 313, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29906, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29941, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29896, 29900, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29896, 29896, 29897, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29896, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 5277, 29871, 29945, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29941, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29953, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 6736, 29871, 29953, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 5277, 29871, 29929, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29925, 29916, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 4040, 2285, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 353, 525, 418, 319, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 1275, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 1275, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 2887, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29909, 303, 1489, 333, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 1275, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1275, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 1275, 29871, 29900, 29901, 13, 462, 4706, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29923, 29915, 320, 13, 462, 462, 4706, 470, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29990, 2396, 13, 462, 9651, 565, 9679, 877, 29896, 29928, 29941, 1495, 1405, 29871, 29896, 29901, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 29871, 29900, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29933, 29874, 29915, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 4297, 1267, 29915, 13, 462, 9651, 1683, 29901, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 353, 9679, 877, 29941, 29928, 29899, 29941, 1495, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 12130, 29915, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 16334, 1627, 29915, 13, 462, 18884, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 353, 525, 418, 390, 29915, 13, 462, 9651, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29909, 2396, 13, 462, 4706, 565, 9679, 877, 29896, 29928, 29941, 1495, 1275, 29871, 29896, 29901, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29907, 29886, 29915, 13, 462, 9651, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 4035, 344, 2801, 25343, 29915, 13, 462, 9651, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29945, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29896, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1275, 29871, 29953, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 6736, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 5277, 29871, 29941, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29733, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 1625, 2592, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29906, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 1275, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 2772, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 4002, 814, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29896, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29896, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 8754, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 8754, 5416, 438, 346, 550, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 6736, 29871, 29953, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 2311, 5277, 29871, 29947, 320, 13, 462, 462, 1678, 322, 313, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29945, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29953, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29947, 29897, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29945, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 5277, 29871, 29955, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29954, 29874, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29954, 7879, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29929, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 18567, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 16382, 24810, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 6736, 29871, 29896, 29906, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29950, 29873, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 16382, 1920, 305, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29896, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29896, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29902, 29883, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29902, 346, 29899, 29907, 17280, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 313, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29906, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29946, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29955, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29929, 29897, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29929, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 797, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 2568, 504, 9315, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29896, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29941, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 3410, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29931, 340, 24810, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 5277, 29871, 29945, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29931, 29873, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29931, 340, 1920, 305, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29941, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 5277, 29871, 29941, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29953, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 13695, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 12283, 29899, 29909, 629, 3953, 3631, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29953, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29940, 29875, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 12283, 29899, 2568, 504, 9315, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29906, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29945, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 6736, 29871, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 5277, 29871, 29941, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 9837, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 9837, 272, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 313, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29953, 320, 13, 462, 462, 1678, 470, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29947, 29897, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29953, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 5277, 29871, 29947, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 6736, 29871, 29946, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 5277, 29871, 29929, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29934, 29875, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 25627, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 1275, 29871, 29896, 29900, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29896, 320, 13, 462, 462, 1678, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29929, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29956, 29874, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29956, 1008, 2787, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1275, 29871, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29963, 29874, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29963, 22061, 398, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 718, 1583, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 6736, 29871, 29941, 29900, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 29943, 29877, 29915, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 1311, 29889, 3018, 311, 29918, 2248, 29962, 353, 525, 2831, 29890, 4215, 29915, 13, 462, 4706, 1583, 29889, 3018, 311, 29918, 2248, 4619, 29871, 29896, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 353, 525, 418, 390, 29915, 13, 462, 268, 13, 18884, 396, 259, 3139, 22561, 29973, 21590, 29973, 10550, 29892, 2992, 29973, 13, 462, 13, 462, 1678, 1583, 29889, 3188, 353, 6629, 13, 462, 1678, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29909, 2396, 13, 462, 4706, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29940, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29900, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29903, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29934, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29953, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29902, 29915, 13, 462, 1678, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29933, 2396, 13, 462, 4706, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29940, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29903, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29900, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29934, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29902, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29906, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29925, 29915, 13, 462, 1678, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29907, 2396, 13, 462, 4706, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29903, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29900, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29934, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29956, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29900, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29902, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29900, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29925, 29915, 13, 462, 1678, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29928, 2396, 13, 462, 4706, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29955, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29903, 29915, 13, 462, 4706, 25342, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29906, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29925, 29915, 13, 462, 1678, 565, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 1275, 525, 29923, 2396, 13, 462, 4706, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29896, 29906, 29901, 13, 462, 9651, 1583, 29889, 3188, 353, 525, 29925, 29915, 13, 462, 13, 18884, 396, 259, 24810, 9683, 666, 4926, 29973, 13, 462, 13, 462, 1678, 565, 9679, 877, 29896, 29928, 29953, 1495, 1405, 29871, 29941, 29901, 13, 462, 4706, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 353, 9679, 877, 29896, 29928, 29953, 29899, 29896, 1495, 13, 462, 4706, 1550, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 1275, 29871, 29945, 29901, 13, 462, 9651, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 353, 9679, 877, 29896, 29928, 29953, 29899, 29896, 1495, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 353, 9679, 877, 29896, 29928, 29953, 29974, 29946, 1495, 13, 462, 4706, 1550, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 1275, 29871, 29896, 29900, 29901, 13, 462, 9651, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 353, 9679, 877, 29896, 29928, 29953, 29974, 29946, 1495, 13, 462, 1678, 565, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 529, 29871, 29896, 29901, 13, 462, 4706, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 353, 29871, 29896, 13, 462, 13, 18884, 396, 259, 20540, 3398, 3741, 1372, 29973, 13, 462, 13, 462, 1678, 1583, 29889, 9018, 300, 3398, 29918, 6596, 1372, 353, 525, 29900, 29915, 13, 462, 1678, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29947, 29901, 13, 462, 4706, 1583, 29889, 9018, 300, 3398, 29918, 6596, 1372, 353, 1583, 29889, 9018, 300, 3398, 29918, 29890, 2152, 29918, 22640, 29961, 1245, 877, 29906, 29928, 1495, 29962, 13, 462, 308, 13, 462, 13, 18884, 396, 259, 19141, 4406, 1934, 29973, 13, 462, 13, 462, 1678, 1583, 29889, 25496, 29918, 3146, 1934, 353, 525, 29900, 29915, 13, 462, 1678, 565, 9679, 877, 29906, 29928, 29953, 1495, 6736, 29871, 29945, 29901, 13, 462, 4706, 1583, 29889, 25496, 29918, 3146, 1934, 353, 1583, 29889, 25496, 29918, 3146, 424, 29918, 22640, 29961, 1245, 877, 29906, 29928, 1495, 29962, 13, 462, 13, 18884, 396, 259, 2787, 29879, 29973, 13, 462, 1678, 1583, 29889, 11526, 29879, 353, 851, 29898, 29896, 718, 938, 29898, 1311, 29889, 9018, 300, 3398, 29918, 6596, 1372, 29897, 718, 938, 29898, 1311, 29889, 25496, 29918, 3146, 1934, 29897, 718, 9679, 877, 29906, 29928, 8785, 13, 462, 13, 18884, 396, 259, 838, 1397, 8837, 29973, 13, 13, 462, 1678, 565, 1583, 29889, 8172, 29918, 284, 1397, 8837, 338, 5852, 29901, 13, 462, 4706, 1583, 29889, 284, 1397, 8837, 353, 525, 1888, 29915, 13, 462, 4706, 5694, 353, 9679, 877, 29928, 29896, 29900, 29900, 1495, 13, 462, 4706, 565, 5694, 1405, 29871, 29945, 29900, 29901, 13, 462, 9651, 1583, 29889, 284, 1397, 8837, 353, 525, 29907, 29879, 29915, 13, 462, 4706, 565, 5694, 1405, 29871, 29947, 29900, 29901, 13, 462, 9651, 1583, 29889, 284, 1397, 8837, 353, 525, 13695, 29915, 13, 462, 4706, 565, 5694, 1405, 29871, 29929, 29900, 29901, 13, 462, 9651, 1583, 29889, 284, 1397, 8837, 353, 525, 29963, 29874, 29915, 13, 462, 4706, 565, 5694, 1405, 29871, 29929, 29946, 29901, 13, 462, 9651, 1583, 29889, 284, 1397, 8837, 353, 525, 6295, 29915, 13, 462, 4706, 565, 5694, 1405, 29871, 29929, 29955, 29901, 13, 462, 9651, 1583, 29889, 284, 1397, 8837, 353, 525, 2887, 29915, 13, 462, 4706, 565, 5694, 1275, 29871, 29896, 29900, 29900, 29901, 13, 462, 9651, 1583, 29889, 284, 1397, 8837, 353, 525, 29999, 29882, 29915, 13, 462, 268, 13, 18884, 396, 259, 2184, 17677, 13, 462, 13, 462, 1678, 1583, 29889, 6236, 279, 29918, 1272, 353, 6629, 13, 462, 1678, 5810, 29918, 2798, 353, 1583, 29889, 16586, 29961, 1245, 877, 29906, 29928, 29953, 1495, 29962, 13, 462, 1678, 565, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 6736, 29871, 29946, 322, 1583, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 5277, 29871, 29929, 320, 13, 462, 9651, 470, 1583, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 6736, 29871, 29947, 29901, 13, 462, 4706, 5810, 29918, 23560, 353, 29871, 29946, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 5810, 29918, 23560, 353, 29871, 29900, 13, 462, 1678, 5810, 29918, 24476, 353, 9679, 877, 29906, 29928, 29953, 1495, 718, 5810, 29918, 23560, 13, 462, 1678, 565, 5810, 29918, 24476, 1405, 29871, 29896, 29906, 29901, 13, 462, 4706, 5810, 29918, 24476, 353, 29871, 29896, 29906, 13, 462, 1678, 3517, 29918, 8508, 29918, 24476, 353, 5810, 29918, 24476, 13, 462, 1678, 1583, 29889, 6236, 279, 29918, 1272, 4619, 1583, 29889, 16072, 29918, 8508, 29918, 1853, 29961, 8508, 29918, 24476, 29962, 13, 462, 1678, 565, 9679, 877, 29896, 29928, 29953, 1495, 1405, 29871, 29941, 29901, 13, 462, 4706, 12965, 353, 9679, 877, 29896, 29928, 29953, 29899, 29896, 1495, 13, 462, 4706, 1550, 12965, 1275, 29871, 29945, 29901, 13, 462, 9651, 12965, 353, 9679, 877, 29896, 29928, 29953, 29899, 29896, 1495, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 12965, 353, 9679, 877, 29896, 29928, 29953, 29974, 29946, 1495, 13, 462, 4706, 1550, 12965, 1275, 29871, 29896, 29900, 29901, 13, 462, 9651, 12965, 353, 9679, 877, 29896, 29928, 29953, 29974, 29946, 1495, 13, 462, 1678, 1583, 29889, 6236, 279, 29918, 1272, 4619, 851, 29898, 1990, 2450, 29897, 13, 462, 1678, 5810, 29918, 24476, 353, 9679, 877, 29906, 29928, 29953, 1495, 718, 5810, 29918, 23560, 13, 462, 1678, 565, 5810, 29918, 24476, 1405, 29871, 29896, 29906, 29901, 13, 462, 4706, 5810, 29918, 24476, 353, 29871, 29896, 29906, 13, 462, 1678, 5810, 29918, 2311, 29918, 24476, 353, 1583, 29889, 8508, 29918, 2311, 29961, 8508, 29918, 24476, 29962, 13, 462, 1678, 565, 313, 1311, 29889, 6236, 279, 29918, 1272, 1275, 525, 29968, 29945, 29915, 470, 1583, 29889, 6236, 279, 29918, 1272, 1275, 525, 29924, 29929, 1495, 320, 13, 462, 9651, 322, 5810, 29918, 2311, 29918, 24476, 1275, 525, 5667, 525, 29901, 13, 462, 4706, 5810, 29918, 2311, 29918, 24476, 353, 525, 29963, 29871, 525, 13, 462, 1678, 565, 313, 1311, 29889, 6236, 279, 29918, 1272, 1275, 525, 29933, 29900, 29915, 470, 1583, 29889, 6236, 279, 29918, 1272, 1275, 525, 29943, 29946, 1495, 320, 13, 462, 9651, 322, 5810, 29918, 2311, 29918, 24476, 1275, 525, 5667, 525, 29901, 13, 462, 4706, 5810, 29918, 2311, 29918, 24476, 353, 525, 29963, 29871, 525, 13, 462, 1678, 1583, 29889, 6236, 279, 29918, 1272, 4619, 525, 525, 718, 5810, 29918, 2311, 29918, 24476, 13, 462, 1678, 3517, 29918, 8508, 29918, 2311, 29918, 24476, 353, 5810, 29918, 24476, 13, 462, 1678, 5810, 29918, 2798, 4619, 448, 29896, 13, 462, 1678, 565, 5810, 29918, 2798, 1405, 29871, 29896, 29901, 13, 462, 4706, 5810, 29918, 24476, 353, 9679, 877, 29906, 29928, 29953, 1495, 718, 3517, 29918, 8508, 29918, 24476, 13, 462, 4706, 565, 5810, 29918, 24476, 1405, 29871, 29896, 29906, 29901, 13, 462, 9651, 5810, 29918, 24476, 353, 29871, 29896, 29906, 13, 462, 4706, 18708, 29918, 1272, 353, 1583, 29889, 2388, 273, 291, 29918, 8508, 29918, 1853, 29961, 8508, 29918, 24476, 29962, 13, 462, 4706, 565, 9679, 877, 29896, 29928, 29953, 1495, 1405, 29871, 29941, 29901, 13, 462, 9651, 12965, 353, 9679, 877, 29896, 29928, 29953, 29899, 29896, 1495, 13, 462, 9651, 1550, 12965, 1275, 29871, 29945, 29901, 13, 462, 18884, 12965, 353, 9679, 877, 29896, 29928, 29953, 29899, 29896, 1495, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 12965, 353, 9679, 877, 29896, 29928, 29953, 29974, 29946, 1495, 13, 462, 9651, 1550, 12965, 1275, 29871, 29896, 29900, 29901, 13, 462, 18884, 12965, 353, 9679, 877, 29896, 29928, 29953, 29974, 29946, 1495, 13, 462, 4706, 18708, 29918, 1272, 4619, 851, 29898, 1990, 2450, 29897, 13, 462, 4706, 5810, 29918, 24476, 353, 9679, 877, 29906, 29928, 29953, 1495, 718, 3517, 29918, 8508, 29918, 2311, 29918, 24476, 13, 462, 4706, 565, 5810, 29918, 24476, 1405, 29871, 29896, 29906, 29901, 13, 462, 9651, 5810, 29918, 24476, 353, 29871, 29896, 29906, 13, 462, 4706, 5810, 29918, 2311, 29918, 24476, 353, 1583, 29889, 8508, 29918, 2311, 29961, 8508, 29918, 24476, 29962, 13, 462, 4706, 565, 313, 2388, 273, 291, 29918, 1272, 1275, 525, 29968, 29945, 29915, 470, 18708, 29918, 1272, 1275, 525, 29924, 29929, 1495, 320, 13, 462, 18884, 322, 5810, 29918, 2311, 29918, 24476, 1275, 525, 5667, 525, 29901, 13, 462, 9651, 5810, 29918, 2311, 29918, 24476, 353, 525, 29963, 29871, 525, 13, 462, 4706, 565, 313, 2388, 273, 291, 29918, 1272, 1275, 525, 29933, 29900, 29915, 470, 18708, 29918, 1272, 1275, 525, 29943, 29946, 1495, 320, 13, 462, 18884, 322, 5810, 29918, 2311, 29918, 24476, 1275, 525, 5667, 525, 29901, 13, 462, 9651, 5810, 29918, 2311, 29918, 24476, 353, 525, 29963, 29871, 525, 13, 462, 4706, 1583, 29889, 6236, 279, 29918, 1272, 4619, 525, 525, 718, 18708, 29918, 1272, 718, 525, 525, 718, 5810, 29918, 2311, 29918, 24476, 13, 13, 18884, 396, 7198, 2787, 756, 694, 1024, 29973, 3387, 263, 501, 26433, 29889, 13, 13, 462, 1678, 565, 9679, 877, 29928, 29896, 29900, 29900, 1495, 1405, 29871, 29929, 29945, 29901, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 978, 353, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 29962, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 29962, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 29962, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 29962, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 29962, 718, 17411, 29915, 718, 320, 13, 462, 462, 18884, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 29962, 13, 462, 308, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 18137, 353, 6629, 13, 462, 1678, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 13203, 353, 6629, 13, 462, 1678, 363, 474, 297, 3464, 29898, 1311, 29889, 3018, 311, 29918, 2248, 1125, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 18137, 4619, 525, 525, 718, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 401, 29961, 29875, 29962, 13, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 13203, 4619, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 1990, 29961, 29875, 29962, 718, 13420, 525, 13, 462, 268, 13, 18884, 396, 13905, 4241, 2787, 13, 13, 462, 1678, 1596, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 978, 718, 525, 313, 29995, 29879, 259, 1273, 29879, 29995, 29879, 29995, 29879, 29995, 29879, 29995, 29879, 29995, 29879, 29995, 29879, 19222, 29879, 1273, 29879, 29995, 29879, 16029, 1273, 313, 1311, 29889, 3396, 29918, 11526, 29918, 5479, 29892, 320, 13, 462, 462, 1678, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 1402, 320, 13, 462, 462, 1678, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 1402, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1402, 320, 13, 462, 462, 1678, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 1402, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 1402, 320, 13, 462, 462, 1678, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1402, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 1402, 320, 13, 462, 462, 1678, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 1402, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 18137, 29892, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 876, 13, 462, 268, 13, 462, 1678, 1583, 29889, 11526, 29879, 29918, 24476, 4619, 29871, 29896, 13, 13, 462, 1678, 11799, 29918, 13236, 29889, 13236, 340, 4197, 1311, 29889, 3396, 29918, 11526, 29918, 5479, 29892, 13, 462, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 978, 29892, 13, 462, 462, 4706, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 1402, 13, 462, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 1402, 13, 462, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 18137, 29961, 29896, 29901, 1402, 13, 462, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29961, 2435, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29897, 448, 29871, 29896, 29901, 2435, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29897, 1402, 13, 462, 462, 4706, 1583, 29889, 3188, 29892, 13, 462, 462, 4706, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 29892, 13, 462, 462, 4706, 1583, 29889, 9018, 300, 3398, 29918, 6596, 1372, 29892, 13, 462, 462, 4706, 1583, 29889, 25496, 29918, 3146, 1934, 29892, 13, 462, 462, 4706, 1583, 29889, 11526, 29879, 29892, 13, 462, 462, 4706, 1583, 29889, 284, 1397, 8837, 29892, 13, 462, 462, 4706, 1583, 29889, 6236, 279, 29918, 1272, 29892, 13, 462, 462, 4706, 1583, 29889, 3396, 29918, 11526, 29918, 12863, 1535, 2314, 13, 462, 268, 13, 462, 1678, 6427, 29918, 3757, 353, 6571, 13, 462, 268, 13, 462, 1678, 6427, 29918, 3757, 1839, 6508, 2033, 353, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 13, 462, 1678, 6427, 29918, 3757, 1839, 14058, 29918, 1170, 2033, 353, 1583, 29889, 3396, 29918, 11526, 29918, 978, 13, 462, 1678, 6427, 29918, 3757, 1839, 16213, 637, 2033, 353, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 3505, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 4178, 7681, 9085, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 29950, 11279, 6420, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 12310, 2785, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 29954, 6170, 358, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 29931, 1450, 29918, 10108, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 29911, 5309, 29918, 10108, 2033, 353, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 29962, 13, 462, 1678, 6427, 29918, 3757, 1839, 5323, 311, 29918, 29907, 2631, 2033, 353, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 18137, 29961, 29896, 17531, 13, 462, 1678, 6427, 29918, 3757, 1839, 5323, 955, 29918, 3399, 2033, 353, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29961, 2435, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29897, 448, 29871, 29896, 29901, 2435, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 4638, 13, 462, 1678, 6427, 29918, 3757, 1839, 5160, 2033, 353, 1583, 29889, 3188, 13, 462, 1678, 6427, 29918, 3757, 1839, 12310, 29918, 29924, 2033, 353, 1583, 29889, 7323, 2785, 29918, 18056, 4926, 13, 462, 1678, 6427, 29918, 3757, 1839, 21140, 1372, 2033, 353, 1583, 29889, 9018, 300, 3398, 29918, 6596, 1372, 13, 462, 1678, 6427, 29918, 3757, 1839, 29954, 294, 29918, 26074, 1934, 2033, 353, 1583, 29889, 25496, 29918, 3146, 1934, 13, 462, 1678, 6427, 29918, 3757, 1839, 14058, 29879, 2033, 353, 1583, 29889, 11526, 29879, 13, 462, 1678, 6427, 29918, 3757, 1839, 2499, 1397, 8837, 2033, 353, 1583, 29889, 284, 1397, 8837, 13, 462, 1678, 6427, 29918, 3757, 1839, 855, 514, 279, 29918, 1469, 2033, 353, 1583, 29889, 6236, 279, 29918, 1272, 13, 462, 1678, 6427, 29918, 3757, 1839, 5776, 546, 1535, 2033, 353, 1583, 29889, 3396, 29918, 11526, 29918, 12863, 1535, 13, 13, 462, 1678, 3186, 29918, 1761, 29889, 4397, 29898, 3018, 29894, 29918, 3757, 29897, 13, 13, 462, 1678, 9493, 29918, 1220, 353, 1583, 29889, 3396, 29918, 11526, 29918, 5479, 13, 462, 1678, 9493, 29918, 1220, 4619, 525, 525, 718, 1583, 29889, 3396, 29918, 11526, 29918, 978, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29906, 29953, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 1583, 29889, 11526, 29918, 8508, 637, 29918, 1990, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 8508, 637, 29962, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 2311, 29962, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 271, 7681, 9085, 29962, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29882, 11279, 6420, 29962, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 7323, 2785, 29962, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 29887, 6170, 358, 29962, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 10653, 29918, 5563, 29962, 718, 17411, 29915, 718, 320, 13, 462, 4706, 1583, 29889, 20970, 29918, 401, 29961, 1311, 29889, 3396, 29918, 11526, 29918, 11345, 29918, 5563, 29962, 13, 462, 1678, 9493, 29918, 1220, 4619, 525, 525, 718, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 311, 29918, 18137, 29961, 29896, 17531, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29947, 29896, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 1583, 29889, 3188, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29947, 29946, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 1583, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29961, 2435, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 29897, 448, 29871, 29896, 29901, 2435, 29898, 1311, 29889, 3396, 29918, 11526, 29918, 3018, 955, 29918, 401, 4638, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29947, 29945, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 525, 525, 718, 851, 29898, 1311, 29889, 7323, 2785, 29918, 18056, 4926, 29897, 718, 851, 29898, 1311, 29889, 9018, 300, 3398, 29918, 6596, 1372, 29897, 718, 851, 29898, 1311, 29889, 25496, 29918, 3146, 1934, 29897, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29929, 29900, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 1583, 29889, 11526, 29879, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29929, 29941, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 1583, 29889, 284, 1397, 8837, 13, 462, 1678, 1550, 7431, 29898, 16432, 29918, 1220, 29897, 529, 29871, 29929, 29947, 29901, 13, 462, 4706, 9493, 29918, 1220, 4619, 525, 525, 13, 462, 1678, 9493, 29918, 1220, 4619, 1583, 29889, 6236, 279, 29918, 1272, 13, 13, 462, 1678, 611, 2496, 29918, 1445, 29918, 449, 29889, 3539, 28909, 29876, 29915, 718, 9493, 29918, 1220, 29897, 13, 13, 4706, 396, 3126, 29889, 15070, 29898, 11526, 29918, 1761, 29892, 4390, 29918, 1445, 29918, 449, 29892, 29536, 29922, 29946, 29892, 9801, 29918, 294, 18869, 29922, 5574, 29897, 13, 4706, 4390, 29889, 15070, 29898, 11526, 29918, 1761, 29892, 4390, 29918, 1445, 29918, 449, 29892, 9801, 29918, 294, 18869, 29922, 5574, 29897, 13, 13, 4706, 11799, 29918, 1445, 29918, 449, 29889, 5358, 580, 13, 4706, 4390, 29918, 1445, 29918, 449, 29889, 5358, 580, 13, 4706, 611, 2496, 29918, 1445, 29918, 449, 29889, 5358, 580, 13, 13, 4706, 1596, 877, 14058, 29879, 29081, 29901, 742, 1583, 29889, 11526, 29879, 29918, 24476, 29897, 13, 4706, 1583, 29889, 3364, 292, 8009, 11526, 29879, 580, 13, 13, 1678, 822, 17546, 3313, 29918, 15033, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29882, 11279, 29918, 28667, 29918, 1859, 1575, 353, 6024, 29933, 1463, 373, 2180, 7681, 9085, 742, 525, 29933, 1463, 373, 21179, 2033, 13, 4706, 1583, 29889, 29882, 11279, 29918, 28667, 29918, 5696, 353, 1583, 29889, 29882, 11279, 29918, 28667, 29918, 1859, 1575, 29961, 1311, 29889, 29882, 11279, 3313, 29889, 3784, 3220, 580, 29962, 13, 4706, 396, 2158, 29898, 1311, 29889, 29882, 11279, 29918, 28667, 29918, 5696, 29897, 13, 4706, 1480, 29889, 3888, 703, 11838, 718, 1583, 29889, 29882, 11279, 29918, 28667, 29918, 5696, 718, 376, 11838, 718, 525, 471, 4629, 29889, 1495, 13, 13, 1678, 822, 14781, 279, 29918, 21518, 537, 3313, 29918, 15033, 29898, 1311, 1125, 13, 4706, 1583, 29889, 21518, 537, 29918, 1859, 1575, 353, 518, 29896, 29892, 29871, 29941, 29892, 29871, 29896, 29955, 29892, 29871, 29941, 29941, 29892, 29871, 29945, 29900, 29892, 29871, 29953, 29953, 29892, 29871, 29947, 29941, 29892, 29871, 29929, 29896, 29962, 13, 4706, 1583, 29889, 6236, 279, 29918, 21518, 537, 353, 1583, 29889, 21518, 537, 29918, 1859, 1575, 29961, 1311, 29889, 6236, 279, 29918, 21518, 537, 3313, 29889, 3784, 3220, 580, 29962, 13, 4706, 396, 2158, 29898, 1311, 29889, 6236, 279, 29918, 21518, 537, 29897, 13, 4706, 1480, 29889, 3888, 877, 29909, 624, 514, 279, 360, 575, 537, 310, 525, 718, 851, 29898, 1311, 29889, 6236, 279, 29918, 21518, 537, 29897, 718, 14210, 471, 4629, 29889, 1495, 13, 13, 1678, 822, 16831, 8837, 3313, 29918, 15033, 29898, 1311, 1125, 13, 4706, 1583, 29889, 284, 1397, 8837, 29918, 1859, 1575, 353, 6024, 2887, 742, 525, 29907, 29879, 742, 525, 1888, 742, 525, 13695, 742, 525, 6295, 742, 525, 29963, 29874, 742, 525, 29999, 29882, 2033, 13, 4706, 565, 1583, 29889, 284, 1397, 8837, 3313, 29889, 3784, 3220, 580, 1275, 29871, 29955, 29901, 13, 9651, 1583, 29889, 8172, 29918, 284, 1397, 8837, 353, 5852, 13, 9651, 1480, 29889, 3888, 877, 17875, 838, 1397, 8837, 471, 4629, 29889, 1495, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 284, 1397, 8837, 353, 1583, 29889, 284, 1397, 8837, 29918, 1859, 1575, 29961, 1311, 29889, 284, 1397, 8837, 3313, 29889, 3784, 3220, 580, 29962, 13, 9651, 1583, 29889, 8172, 29918, 284, 1397, 8837, 353, 7700, 13, 9651, 1480, 29889, 3888, 877, 2499, 1397, 8837, 13577, 718, 1583, 29889, 284, 1397, 8837, 718, 18793, 471, 4629, 29889, 1495, 13, 13, 1678, 822, 2428, 29918, 799, 386, 29918, 3198, 3313, 29918, 15033, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9136, 29918, 799, 386, 29918, 305, 749, 353, 1583, 29889, 9136, 29918, 799, 386, 29918, 3198, 3313, 29889, 275, 17817, 580, 13, 4706, 396, 2158, 29898, 1311, 29889, 9136, 29918, 799, 386, 29918, 305, 749, 29897, 13, 4706, 1480, 29889, 3888, 877, 1451, 749, 363, 5670, 29899, 29923, 28696, 29901, 525, 718, 851, 29898, 1311, 29889, 9136, 29918, 799, 386, 29918, 305, 749, 876, 13, 13, 1678, 822, 3158, 28173, 29918, 21001, 287, 29898, 1311, 1125, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 1510, 1048, 856, 1495, 13, 4706, 1583, 29889, 7323, 28173, 7647, 29889, 4294, 580, 13, 13, 1678, 822, 3158, 2182, 277, 1184, 29887, 29918, 21001, 287, 29898, 1311, 1125, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 439, 11407, 856, 1495, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 360, 12413, 29889, 1495, 13, 4706, 1480, 29889, 3888, 877, 3403, 3460, 9698, 29889, 1495, 13, 4706, 1583, 29889, 5358, 580, 13, 268, 13, 1678, 822, 6819, 8009, 11526, 29879, 29898, 1311, 1125, 13, 4706, 1480, 29889, 3888, 877, 4557, 310, 3186, 29879, 29901, 525, 718, 851, 29898, 1311, 29889, 11526, 29879, 29918, 24476, 876, 13, 4706, 1583, 29889, 7323, 26010, 7647, 29889, 1949, 11526, 29879, 9323, 29889, 12038, 877, 4557, 310, 3186, 29879, 29901, 525, 718, 851, 29898, 1311, 29889, 11526, 29879, 29918, 24476, 876, 13, 4706, 1583, 29889, 7323, 26010, 7647, 29889, 4294, 8009, 11526, 29879, 580, 308, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 268, 13, 1678, 1480, 353, 12183, 29889, 657, 16363, 877, 29903, 3019, 15462, 1495, 13, 1678, 1480, 29889, 842, 10108, 29898, 21027, 29889, 18525, 29897, 13, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 877, 3403, 29879, 29374, 13, 4706, 2897, 29889, 11256, 3972, 877, 3403, 29879, 1495, 13, 268, 13, 1678, 285, 29882, 353, 12183, 29889, 2283, 4598, 877, 3403, 29879, 29914, 29903, 3019, 15462, 29889, 1188, 742, 525, 29893, 1495, 13, 29871, 13, 1678, 883, 2620, 353, 12183, 29889, 18522, 877, 29995, 29898, 294, 312, 603, 29897, 29879, 1273, 29898, 5563, 978, 29897, 29879, 1273, 29898, 978, 29897, 29879, 448, 1273, 29898, 4906, 29897, 29879, 742, 13, 462, 462, 29871, 2635, 23479, 353, 14210, 29874, 29892, 1273, 29881, 1273, 29890, 1273, 29979, 1273, 29950, 16664, 29924, 16664, 29903, 1495, 13, 1678, 285, 29882, 29889, 842, 18522, 29898, 689, 2620, 29897, 13, 1678, 1480, 29889, 1202, 4598, 29898, 29888, 29882, 29897, 13, 268, 13, 1678, 1480, 29889, 3888, 877, 3403, 3460, 4687, 29889, 1495, 13, 1678, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 6257, 856, 1495, 13, 268, 13, 1678, 534, 927, 353, 931, 29889, 2997, 2230, 580, 13, 1678, 11265, 29918, 2230, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 1678, 565, 534, 927, 29961, 29900, 29962, 1405, 29871, 29906, 29900, 29906, 29906, 470, 534, 927, 29961, 29896, 29962, 1405, 29871, 29896, 29896, 29901, 13, 308, 13, 4706, 1480, 29889, 27392, 877, 29933, 1187, 931, 3785, 756, 1518, 2859, 29991, 1495, 13, 308, 13, 4706, 1596, 580, 13, 4706, 1596, 29898, 29943, 487, 29889, 19386, 718, 22135, 29889, 29933, 22789, 3912, 718, 4770, 932, 1649, 29892, 525, 5746, 2227, 19386, 29889, 1495, 13, 4706, 1596, 29898, 5568, 29889, 1525, 10490, 29918, 9818, 29897, 13, 4706, 1596, 580, 13, 4706, 1596, 22168, 8921, 1649, 29897, 13, 4706, 1596, 580, 13, 4706, 269, 353, 1881, 877, 10923, 12524, 4945, 29901, 25710, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 25480, 856, 1495, 13, 308, 13, 4706, 1596, 877, 8949, 1495, 13, 308, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 11084, 29889, 1495, 13, 4706, 1480, 29889, 3888, 877, 3403, 3460, 9698, 29889, 1495, 13, 1678, 1683, 29901, 13, 4706, 1596, 580, 13, 4706, 1596, 877, 25271, 366, 363, 6820, 742, 4770, 932, 1649, 29892, 525, 29874, 1018, 29889, 1495, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 3063, 363, 10772, 29928, 293, 261, 3028, 856, 1495, 13, 4706, 24604, 398, 29892, 6507, 353, 9679, 877, 3888, 1495, 13, 4706, 1596, 877, 4013, 1824, 3913, 742, 6507, 29897, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 1476, 525, 718, 6507, 718, 15300, 1495, 13, 4706, 1596, 580, 13, 4706, 1596, 877, 2683, 9072, 1495, 13, 4706, 1596, 22168, 8921, 1649, 29897, 13, 4706, 1596, 580, 13, 4706, 1596, 877, 1576, 3201, 29894, 4539, 3748, 297, 599, 7190, 338, 15205, 491, 8413, 16367, 9041, 558, 4637, 29889, 1495, 13, 4706, 1596, 877, 11882, 1266, 29871, 29896, 29929, 29955, 29955, 448, 29871, 29906, 29900, 29906, 29906, 8413, 16367, 9041, 558, 4637, 29889, 1495, 13, 4706, 1596, 877, 5323, 29894, 4539, 338, 263, 15443, 1020, 2310, 935, 310, 8413, 16367, 9041, 558, 4637, 29889, 1495, 13, 4706, 1596, 580, 13, 308, 13, 4706, 1480, 29889, 3888, 22168, 932, 1649, 718, 525, 4687, 29892, 322, 2734, 856, 1495, 13, 308, 13, 4706, 623, 353, 660, 4873, 29898, 9675, 29889, 19218, 29897, 13, 308, 13, 4706, 396, 11403, 1596, 29898, 29984, 5568, 5126, 29889, 8149, 3101, 304, 1284, 263, 731, 5568, 366, 763, 29892, 2012, 310, 525, 29943, 3958, 29915, 13, 13, 4706, 623, 29889, 842, 5568, 877, 29943, 3958, 1495, 13, 308, 13, 4706, 6501, 29925, 26456, 353, 660, 29925, 26456, 580, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 5907, 29892, 660, 3306, 29898, 29945, 29941, 29892, 29871, 29945, 29941, 29892, 29871, 29945, 29941, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 5907, 1626, 29892, 14705, 29889, 10921, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 4205, 3606, 29892, 660, 29925, 26456, 29889, 5907, 1626, 29892, 660, 3306, 29898, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 5160, 29892, 660, 3306, 29898, 29946, 29906, 29892, 29871, 29946, 29906, 29892, 29871, 29946, 29906, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 2499, 725, 403, 5160, 29892, 660, 3306, 29898, 29953, 29953, 29892, 29871, 29953, 29953, 29892, 29871, 29953, 29953, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 12229, 29911, 666, 5160, 29892, 14705, 29889, 10921, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 12229, 29911, 666, 1626, 29892, 14705, 29889, 10921, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 1626, 29892, 14705, 29889, 10921, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 4205, 3606, 29892, 660, 29925, 26456, 29889, 1626, 29892, 660, 3306, 29898, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 29928, 935, 29892, 660, 3306, 29898, 29941, 29945, 29892, 29871, 29941, 29945, 29892, 29871, 29941, 29945, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 2713, 6986, 29892, 660, 3306, 29898, 29906, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29906, 29900, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 3125, 29892, 660, 3306, 29898, 29945, 29941, 29892, 29871, 29945, 29941, 29892, 29871, 29945, 29941, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 3125, 1626, 29892, 14705, 29889, 10921, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 4205, 3606, 29892, 660, 29925, 26456, 29889, 3125, 1626, 29892, 660, 3306, 29898, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 29933, 1266, 1626, 29892, 14705, 29889, 1127, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 6595, 29892, 660, 3306, 29898, 29946, 29906, 29892, 29871, 29896, 29941, 29900, 29892, 29871, 29906, 29896, 29947, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 16382, 4366, 29892, 660, 3306, 29898, 29946, 29906, 29892, 29871, 29896, 29941, 29900, 29892, 29871, 29906, 29896, 29947, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 4205, 3606, 29892, 660, 29925, 26456, 29889, 16382, 4366, 29892, 660, 3306, 29898, 29947, 29900, 29892, 29871, 29947, 29900, 29892, 29871, 29947, 29900, 876, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 16382, 4366, 287, 1626, 29892, 14705, 29889, 10921, 29897, 13, 4706, 6501, 29925, 26456, 29889, 842, 3306, 29898, 29984, 29925, 26456, 29889, 4205, 3606, 29892, 660, 29925, 26456, 29889, 16382, 4366, 287, 1626, 29892, 660, 3306, 29898, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 29892, 29871, 29896, 29906, 29955, 876, 13, 308, 13, 4706, 1667, 2052, 353, 4241, 5907, 580, 13, 4706, 1667, 2052, 29889, 4294, 580, 13, 308, 13, 4706, 623, 29889, 842, 29925, 26456, 29898, 26031, 29925, 26456, 29897, 13, 13, 4706, 315, 4574, 29450, 29918, 9464, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 6370, 2084, 22168, 1445, 1649, 876, 13, 4706, 396, 2158, 29898, 22484, 29450, 29918, 9464, 29897, 13, 308, 13, 4706, 623, 29889, 4258, 29918, 580, 13, 2 ]
welcome.py
MadhavVij/File-Uploader-Bluemix
0
162931
import base64 import json import pymysql import swiftclient import os from cloudant import Cloudant from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from flask import Flask, render_template, jsonify from cryptography.fernet import Fernet #Object Storage Credentials auth_url = projectId = region = userId = password = #Cloudant Credentials cloud_username = cloud_password = cloud_url = client = Cloudant(cloud_username, cloud_password, url=cloud_url) client.connect() session = client.session() app = Flask(__name__) def genKey(): passWord= input('Enter key: ') salt = os.urandom(16) kdf = PBKDF2HMAC( algorithm=hashes.SHA256(), length=32, salt=salt, iterations=100000, backend=default_backend() ) passWord = <PASSWORD>() return base64.urlsafe_b64encode(kdf.derive(passWord)) def authenticate(): return swiftclient.Connection(key=password, authurl=auth_url, auth_version='3', os_options={"project_id": projectId, "user_id": userId, "region_name": region}) def createContainer(container_name): #container_name = 'file-container' #container_name2 = 'file-container2' #container_name3 = 'file-container3' Obj_conn = authenticate() Obj_conn.put_container(container_name) #Obj_conn.put_container(container_name2) return Obj_conn def getContainerName(Obj_conn): for container in Obj_conn.get_account()[1]: return container['name'] def createDB(): dbName = "datafiles" return client.create_database(dbName) @app.route('/toCloudUp') def cloudList(): root = app.root_path + '\container/' filenames = [] for (dirName, subdirList, fileList) in os.walk(root): filenames.extend(fileList) return render_template('toCloudUp.html', files=filenames) @app.route('/cloudUp') def cloudantUpload(): #dbName = "datafiles" #dbName = client[dbName] #filePath = app.root_path+'\container/'+filename #f = open(filePath,'rb') #data = f.read() dbName = "datafiles" dbName = client[dbName] data = ListLocal() #jdata = json.load(data) #jdata = jdata[0] print(data[0]) dbName.create_document({data[0]}) #dbName.create_document({zerocount:[{filename: data.decode()}]}) return 'Uploaded Successful!' @app.route('/upload') def upload(): file_type1 = ['txt', 'TXT', 'text'] file_type2 = ['jpg','jpeg','JPG','JPEG','png','PNG','gif'] root = app.root_path + '\container/' for dirName, subdirList, fileList in os.walk(root): for fname in fileList: file_location = (dirName + "/" + fname) size = os.path.getsize(file_location) if fname[-3:] in file_type1: container_name = 'file-container' Obj_conn = createContainer(container_name) with open(file_location, 'rb') as load_file: Obj_conn.put_object(container_name, fname, contents=load_file.read(), content_type='application/octet-stream') load_file.close() elif fname[-3:] in file_type2 or fname[-4:] in file_type2: if size <= 200000: container_name = 'small_img' Obj_conn = createContainer(container_name) file_location = (dirName + "/" + fname) with open(file_location, 'rb') as load_file: Obj_conn.put_object(container_name, fname, contents=load_file.read(), content_type='application/octet-stream') load_file.close() elif size>200000: container_name = 'large_img' Obj_conn = createContainer(container_name) file_location = (dirName + "/" + fname) with open(file_location, 'rb') as load_file: Obj_conn.put_object(container_name, fname, contents=load_file.read(), content_type='application/octet-stream') load_file.close() return 'Upload Successful!' @app.route('/files') def list_files(): print(app.root_path) root = app.root_path+'\container/' filenames = [] for (dirName, subdirList, fileList) in os.walk(root): filenames.extend(fileList) print(filenames) return render_template('files.html', files=filenames) @app.route('/toDownload') def downloadList(): Obj_conn = createContainer() filenames = [] container_name = getContainerName(Obj_conn) for data in Obj_conn.get_container(container_name)[1]: filenames.append(data['name']) return render_template('toDownload.html', files=filenames) @app.route('/download/<filename>') def download(filename): Obj_conn = createContainer() container_name = getContainerName(Obj_conn) file_details = Obj_conn.get_object(container_name, filename) with open(app.root_path+'\download.txt', 'wb') as my_copy: my_copy.write(file_details[1]) return filename + ' Downloaded!' @app.route('/toEncrypt') def encryptList(): root = app.root_path + '\container/' filenames = [] for (dirName, subdirList, fileList) in os.walk(root): filenames.extend(fileList) return render_template('toEncrypt.html', files=filenames) @app.route('/encrypt/<userFile>') def encryptFile(userFile): key = genKey() root = app.root_path f = open(root+'/'+userFile[:-4]+'_key.txt','wb') f.write(key) f = Fernet(key) for dirName, subdirList, fileList in os.walk(root+'/container/'): for fname in fileList: if userFile == fname: file_location = (dirName + "/" + fname) with open(file_location, 'rb') as load_file: token = f.encrypt(load_file.read()) load_file.close() fname = fname[:-4]+'-crypted'+fname[-4:] new_location = (root + "/encrypted/" + fname) with open(new_location, 'wb') as write_file: write_file.write(token) write_file.close() return 'file ' +fname+ ' encrypted' @app.route('/toDecrypt') def decryptionList(): root = app.root_path + '\encrypted/' filenames = [] for (dirName, subdirList, fileList) in os.walk(root): filenames.extend(fileList) return render_template('toDecrypt.html', files=filenames) @app.route('/decrypt/<userFile>') def decryptFile(userFile): root = app.root_path userFile = userFile[:-12]+userFile[-4:] f = open(root+'/'+userFile[:-4]+'_key.txt', 'rb') key = f.read() g = Fernet(key) for dirName, subdirList, fileList in os.walk(root+'/encrypted/'): for fname in fileList: if userFile[:-4]+'-crypted'+userFile[-4:] == fname: file_location = (dirName + "/" + fname) with open(file_location, 'rb') as load_file: token = g.decrypt(load_file.read()) load_file.close() fname = userFile[:-4]+'-decrypted'+userFile[-4:] new_location = (root + "/decrypted/" + fname) print(new_location) with open(new_location, 'wb') as write_file: write_file.write(token) write_file.close() return 'file ' +fname+ ' decrypted' @app.route('/') def Welcome(): return render_template('index.html') def connectDB(): host = '' port = 3306 user = '' password = '' db = '' conn = pymysql.connect( host=host, port=port, user=user, password=password, db=db) return conn @app.route('/clearUp') def uploadFile(): conn = connectDB() curr = conn.cursor() file_type1 = ['txt', 'TXT', 'text'] file_type2 = ['jpg', 'jpeg', 'JPG', 'JPEG', 'png', 'PNG', 'gif'] root = app.root_path + '\container/' for dirName, subdirList, fileList in os.walk(root): for fname in fileList: file_location = (dirName + "/" + fname) fsize = os.path.getsize(file_location) if fname[-3:] in file_type1: with open(file_location, 'rb') as load_file: fdata = load_file.read() query = 'insert into file_container (fname,fsize, fdata) VALUES (%s,%s,%s)' args = (fname,fsize,fdata) curr.execute(query,args) conn.commit() load_file.close() # results = curr.fetchall() # for row in results: # print(row[1]) # conn.commit() curr.close() conn.close() return 'DB Updated!' @app.route('/clearDown/<filename>') def downloadFile(filename): conn = connectDB() curr = conn.cursor() query = 'select fdata from file_container WHERE fname = %s' args = (filename) curr.execute(query, args) fdata = curr.fetchone()[0] with open(app.root_path + '\download.txt', 'wb') as my_copy: my_copy.write(fdata) conn.commit() curr.close() conn.close() return 'Downloaded '+filename #################################################### @app.route('/ListLocal') def ListLocal(): root = app.root_path filenames = [] zerocount = 0 for dirName, subdirList, fileList in os.walk(root+'/container/'): for fname in fileList: file_location = (dirName + "/" + fname) size = os.path.getsize(file_location) if size == 0: zerocount += 1 filenames.append(tuple((fname,size))) dbName = "datafiles" dbName = client[dbName] zerocount = [zerocount] for filename,size in filenames: file_location = (root+'/container/' + filename) with open(file_location, 'rb') as load_file: data = load_file.read() data = data.decode('utf-8') zerocount.append({filename: data}) return jsonify(zerocount) port = os.getenv('PORT', '5000') if __name__ == '__main__': app.run(host='127.0.0.1', port=int(port))
[ 1, 1053, 2967, 29953, 29946, 30004, 13, 5215, 4390, 30004, 13, 30004, 13, 5215, 282, 962, 952, 1519, 30004, 13, 5215, 12086, 4645, 30004, 13, 5215, 2897, 30004, 13, 30004, 13, 3166, 9570, 424, 1053, 14293, 424, 30004, 13, 3166, 24941, 5275, 29889, 29882, 834, 2922, 29889, 1627, 1975, 1053, 2322, 29918, 27852, 30004, 13, 3166, 24941, 5275, 29889, 29882, 834, 2922, 29889, 9469, 277, 3145, 1053, 6608, 267, 30004, 13, 3166, 24941, 5275, 29889, 29882, 834, 2922, 29889, 9469, 277, 3145, 29889, 29895, 2176, 29889, 24381, 29895, 2176, 29906, 1053, 349, 29933, 29968, 4037, 29906, 29950, 1529, 29907, 30004, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 4390, 1598, 30004, 13, 3166, 24941, 5275, 29889, 571, 1212, 1053, 7139, 300, 30004, 13, 30004, 13, 29937, 2061, 26162, 24596, 9409, 30004, 13, 5150, 29918, 2271, 353, 6756, 13, 4836, 1204, 353, 6756, 13, 12803, 353, 6756, 13, 29721, 353, 6756, 13, 5630, 353, 6756, 13, 30004, 13, 29937, 20442, 424, 24596, 9409, 30004, 13, 9274, 29918, 6786, 353, 6756, 13, 9274, 29918, 5630, 353, 6756, 13, 9274, 29918, 2271, 353, 6756, 13, 30004, 13, 4645, 353, 14293, 424, 29898, 9274, 29918, 6786, 29892, 9570, 29918, 5630, 29892, 3142, 29922, 9274, 29918, 2271, 8443, 13, 4645, 29889, 6915, 26471, 13, 7924, 353, 3132, 29889, 7924, 26471, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 8443, 13, 30004, 13, 30004, 13, 1753, 2531, 2558, 7295, 30004, 13, 1678, 1209, 14463, 29922, 1881, 877, 10399, 1820, 29901, 525, 8443, 13, 1678, 15795, 353, 2897, 29889, 332, 2685, 29898, 29896, 29953, 8443, 13, 1678, 413, 2176, 353, 349, 29933, 29968, 4037, 29906, 29950, 1529, 29907, 29898, 30004, 13, 4706, 5687, 29922, 8568, 267, 29889, 23498, 29906, 29945, 29953, 3285, 30004, 13, 4706, 3309, 29922, 29941, 29906, 11167, 13, 4706, 15795, 29922, 29879, 1997, 11167, 13, 4706, 24372, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 11167, 13, 4706, 14998, 29922, 4381, 29918, 27852, 26471, 13, 1678, 1723, 30004, 13, 1678, 1209, 14463, 353, 529, 25711, 17013, 16917, 30004, 13, 1678, 736, 2967, 29953, 29946, 29889, 2271, 11177, 29918, 29890, 29953, 29946, 12508, 29898, 29895, 2176, 29889, 672, 573, 29898, 3364, 14463, 876, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 1753, 15585, 403, 7295, 30004, 13, 1678, 736, 12086, 4645, 29889, 5350, 29898, 1989, 29922, 5630, 29892, 4817, 2271, 29922, 5150, 29918, 2271, 29892, 4817, 29918, 3259, 2433, 29941, 23592, 13, 462, 462, 418, 2897, 29918, 6768, 3790, 29908, 4836, 29918, 333, 1115, 2060, 1204, 29892, 376, 1792, 29918, 333, 1115, 1404, 1204, 29892, 376, 12803, 29918, 978, 1115, 5120, 1800, 30004, 13, 30004, 13, 30004, 13, 1753, 1653, 7895, 29898, 7611, 29918, 978, 1125, 30004, 13, 1678, 396, 7611, 29918, 978, 353, 525, 1445, 29899, 7611, 29915, 30004, 13, 1678, 396, 7611, 29918, 978, 29906, 353, 525, 1445, 29899, 7611, 29906, 29915, 30004, 13, 1678, 396, 7611, 29918, 978, 29941, 353, 525, 1445, 29899, 7611, 29941, 29915, 30004, 13, 1678, 4250, 29926, 29918, 13082, 353, 15585, 403, 26471, 13, 1678, 4250, 29926, 29918, 13082, 29889, 649, 29918, 7611, 29898, 7611, 29918, 978, 8443, 13, 1678, 396, 9930, 29918, 13082, 29889, 649, 29918, 7611, 29898, 7611, 29918, 978, 29906, 8443, 13, 1678, 736, 4250, 29926, 29918, 13082, 30004, 13, 30004, 13, 30004, 13, 1753, 679, 7895, 1170, 29898, 9930, 29918, 13082, 1125, 30004, 13, 1678, 363, 5639, 297, 4250, 29926, 29918, 13082, 29889, 657, 29918, 10149, 580, 29961, 29896, 5387, 30004, 13, 4706, 736, 5639, 1839, 978, 2033, 30004, 13, 30004, 13, 30004, 13, 1753, 1653, 4051, 7295, 30004, 13, 1678, 4833, 1170, 353, 376, 1272, 5325, 19451, 13, 1678, 736, 3132, 29889, 3258, 29918, 9803, 29898, 2585, 1170, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 517, 20442, 3373, 1495, 30004, 13, 1753, 9570, 1293, 7295, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 718, 11297, 7611, 22208, 30004, 13, 1678, 977, 264, 1280, 353, 5159, 30004, 13, 1678, 363, 313, 3972, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 29897, 297, 2897, 29889, 20919, 29898, 4632, 1125, 30004, 13, 4706, 977, 264, 1280, 29889, 21843, 29898, 1445, 1293, 8443, 13, 1678, 736, 4050, 29918, 6886, 877, 517, 20442, 3373, 29889, 1420, 742, 2066, 29922, 1777, 264, 1280, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 9274, 3373, 1495, 30004, 13, 1753, 9570, 424, 17553, 7295, 30004, 13, 1678, 396, 2585, 1170, 353, 376, 1272, 5325, 19451, 13, 1678, 396, 2585, 1170, 353, 3132, 29961, 2585, 1170, 29962, 30004, 13, 1678, 396, 1445, 2605, 353, 623, 29889, 4632, 29918, 2084, 29974, 12764, 7611, 29914, 18717, 9507, 30004, 13, 1678, 396, 29888, 353, 1722, 29898, 1445, 2605, 5501, 6050, 1495, 30004, 13, 1678, 396, 1272, 353, 285, 29889, 949, 26471, 13, 1678, 4833, 1170, 353, 376, 1272, 5325, 19451, 13, 1678, 4833, 1170, 353, 3132, 29961, 2585, 1170, 29962, 30004, 13, 1678, 848, 353, 2391, 7717, 26471, 13, 1678, 396, 29926, 1272, 353, 4390, 29889, 1359, 29898, 1272, 8443, 13, 1678, 396, 29926, 1272, 353, 432, 1272, 29961, 29900, 29962, 30004, 13, 1678, 1596, 29898, 1272, 29961, 29900, 2314, 30004, 13, 1678, 4833, 1170, 29889, 3258, 29918, 3225, 3319, 1272, 29961, 29900, 29962, 1800, 30004, 13, 1678, 396, 2585, 1170, 29889, 3258, 29918, 3225, 3319, 3298, 542, 792, 10834, 29912, 9507, 29901, 848, 29889, 13808, 580, 6525, 1800, 30004, 13, 1678, 736, 525, 3373, 15638, 21397, 1319, 20714, 30004, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 9009, 1495, 30004, 13, 1753, 6441, 7295, 30004, 13, 1678, 934, 29918, 1853, 29896, 353, 6024, 3945, 742, 525, 29911, 12188, 742, 525, 726, 2033, 30004, 13, 1678, 934, 29918, 1853, 29906, 353, 6024, 6173, 3788, 26568, 3788, 29967, 16903, 3788, 29967, 4162, 29954, 3788, 2732, 3788, 29925, 9312, 3788, 18660, 2033, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 718, 11297, 7611, 22208, 30004, 13, 30004, 13, 30004, 13, 1678, 363, 4516, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 297, 2897, 29889, 20919, 29898, 4632, 1125, 30004, 13, 4706, 363, 285, 978, 297, 934, 1293, 29901, 30004, 13, 9651, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 9651, 2159, 353, 2897, 29889, 2084, 29889, 657, 2311, 29898, 1445, 29918, 5479, 8443, 13, 30004, 13, 9651, 565, 285, 978, 14352, 29941, 17531, 297, 934, 29918, 1853, 29896, 29901, 30004, 13, 18884, 5639, 29918, 978, 353, 525, 1445, 29899, 7611, 29915, 30004, 13, 18884, 4250, 29926, 29918, 13082, 353, 1653, 7895, 29898, 7611, 29918, 978, 8443, 13, 30004, 13, 18884, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 462, 1678, 4250, 29926, 29918, 13082, 29889, 649, 29918, 3318, 29898, 7611, 29918, 978, 29892, 285, 978, 29892, 8118, 29922, 1359, 29918, 1445, 29889, 949, 3285, 30004, 13, 462, 462, 4706, 2793, 29918, 1853, 2433, 6214, 29914, 20082, 300, 29899, 5461, 1495, 30004, 13, 462, 1678, 2254, 29918, 1445, 29889, 5358, 26471, 13, 30004, 13, 9651, 25342, 285, 978, 14352, 29941, 17531, 297, 934, 29918, 1853, 29906, 470, 285, 978, 14352, 29946, 17531, 297, 934, 29918, 1853, 29906, 29901, 30004, 13, 18884, 565, 2159, 5277, 29871, 29906, 29900, 29900, 29900, 29900, 29900, 29901, 30004, 13, 462, 1678, 5639, 29918, 978, 353, 525, 9278, 29918, 2492, 29915, 30004, 13, 462, 1678, 4250, 29926, 29918, 13082, 353, 1653, 7895, 29898, 7611, 29918, 978, 8443, 13, 462, 1678, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 462, 1678, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 462, 4706, 4250, 29926, 29918, 13082, 29889, 649, 29918, 3318, 29898, 7611, 29918, 978, 29892, 285, 978, 29892, 8118, 29922, 1359, 29918, 1445, 29889, 949, 3285, 30004, 13, 462, 462, 9651, 2793, 29918, 1853, 2433, 6214, 29914, 20082, 300, 29899, 5461, 1495, 30004, 13, 462, 4706, 2254, 29918, 1445, 29889, 5358, 26471, 13, 30004, 13, 18884, 25342, 2159, 29958, 29906, 29900, 29900, 29900, 29900, 29900, 29901, 30004, 13, 462, 1678, 5639, 29918, 978, 353, 525, 16961, 29918, 2492, 29915, 30004, 13, 462, 1678, 4250, 29926, 29918, 13082, 353, 1653, 7895, 29898, 7611, 29918, 978, 8443, 13, 462, 1678, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 462, 1678, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 462, 4706, 4250, 29926, 29918, 13082, 29889, 649, 29918, 3318, 29898, 7611, 29918, 978, 29892, 285, 978, 29892, 8118, 29922, 1359, 29918, 1445, 29889, 949, 3285, 30004, 13, 462, 462, 9651, 2793, 29918, 1853, 2433, 6214, 29914, 20082, 300, 29899, 5461, 1495, 30004, 13, 462, 4706, 2254, 29918, 1445, 29889, 5358, 26471, 13, 1678, 736, 525, 17553, 21397, 1319, 20714, 30004, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 5325, 1495, 30004, 13, 1753, 1051, 29918, 5325, 7295, 30004, 13, 1678, 1596, 29898, 932, 29889, 4632, 29918, 2084, 8443, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 29974, 12764, 7611, 22208, 30004, 13, 1678, 977, 264, 1280, 353, 5159, 30004, 13, 1678, 363, 313, 3972, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 29897, 297, 2897, 29889, 20919, 29898, 4632, 1125, 30004, 13, 4706, 977, 264, 1280, 29889, 21843, 29898, 1445, 1293, 8443, 13, 1678, 1596, 29898, 1777, 264, 1280, 8443, 13, 1678, 736, 4050, 29918, 6886, 877, 5325, 29889, 1420, 742, 2066, 29922, 1777, 264, 1280, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 517, 22954, 1495, 30004, 13, 1753, 5142, 1293, 7295, 30004, 13, 1678, 4250, 29926, 29918, 13082, 353, 1653, 7895, 26471, 13, 1678, 977, 264, 1280, 353, 5159, 30004, 13, 1678, 5639, 29918, 978, 353, 679, 7895, 1170, 29898, 9930, 29918, 13082, 8443, 13, 1678, 363, 848, 297, 4250, 29926, 29918, 13082, 29889, 657, 29918, 7611, 29898, 7611, 29918, 978, 9601, 29896, 5387, 30004, 13, 4706, 977, 264, 1280, 29889, 4397, 29898, 1272, 1839, 978, 2033, 8443, 13, 1678, 736, 4050, 29918, 6886, 877, 517, 22954, 29889, 1420, 742, 2066, 29922, 1777, 264, 1280, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 10382, 29914, 29966, 9507, 29958, 1495, 30004, 13, 1753, 5142, 29898, 9507, 1125, 30004, 13, 1678, 4250, 29926, 29918, 13082, 353, 1653, 7895, 26471, 13, 1678, 5639, 29918, 978, 353, 679, 7895, 1170, 29898, 9930, 29918, 13082, 8443, 13, 1678, 934, 29918, 14144, 353, 4250, 29926, 29918, 13082, 29889, 657, 29918, 3318, 29898, 7611, 29918, 978, 29892, 10422, 8443, 13, 1678, 411, 1722, 29898, 932, 29889, 4632, 29918, 2084, 29974, 12764, 10382, 29889, 3945, 742, 525, 29893, 29890, 1495, 408, 590, 29918, 8552, 29901, 30004, 13, 4706, 590, 29918, 8552, 29889, 3539, 29898, 1445, 29918, 14144, 29961, 29896, 2314, 30004, 13, 1678, 736, 10422, 718, 525, 9943, 15638, 20714, 30004, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 517, 8566, 4641, 1495, 30004, 13, 1753, 27924, 1293, 7295, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 718, 11297, 7611, 22208, 30004, 13, 1678, 977, 264, 1280, 353, 5159, 30004, 13, 1678, 363, 313, 3972, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 29897, 297, 2897, 29889, 20919, 29898, 4632, 1125, 30004, 13, 4706, 977, 264, 1280, 29889, 21843, 29898, 1445, 1293, 8443, 13, 1678, 736, 4050, 29918, 6886, 877, 517, 8566, 4641, 29889, 1420, 742, 2066, 29922, 1777, 264, 1280, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 3977, 4641, 29914, 29966, 1792, 2283, 29958, 1495, 30004, 13, 1753, 27924, 2283, 29898, 1792, 2283, 1125, 30004, 13, 1678, 1820, 353, 2531, 2558, 26471, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 30004, 13, 1678, 285, 353, 1722, 29898, 4632, 23097, 29914, 18717, 1792, 2283, 7503, 29899, 29946, 10062, 15972, 1989, 29889, 3945, 3788, 29893, 29890, 1495, 30004, 13, 1678, 285, 29889, 3539, 29898, 1989, 8443, 13, 1678, 285, 353, 7139, 300, 29898, 1989, 8443, 13, 30004, 13, 1678, 363, 4516, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 297, 2897, 29889, 20919, 29898, 4632, 23097, 29914, 7611, 22208, 1125, 30004, 13, 4706, 363, 285, 978, 297, 934, 1293, 29901, 30004, 13, 9651, 565, 1404, 2283, 1275, 285, 978, 29901, 30004, 13, 18884, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 18884, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 462, 1678, 5993, 353, 285, 29889, 3977, 4641, 29898, 1359, 29918, 1445, 29889, 949, 3101, 30004, 13, 462, 1678, 2254, 29918, 1445, 29889, 5358, 26471, 13, 30004, 13, 18884, 285, 978, 353, 285, 978, 7503, 29899, 29946, 10062, 28560, 29883, 14740, 18717, 29888, 978, 14352, 29946, 17531, 30004, 13, 18884, 716, 29918, 5479, 353, 313, 4632, 718, 5591, 3977, 14740, 12975, 718, 285, 978, 8443, 13, 18884, 411, 1722, 29898, 1482, 29918, 5479, 29892, 525, 29893, 29890, 1495, 408, 2436, 29918, 1445, 29901, 30004, 13, 462, 1678, 2436, 29918, 1445, 29889, 3539, 29898, 6979, 8443, 13, 462, 1678, 2436, 29918, 1445, 29889, 5358, 26471, 13, 30004, 13, 1678, 736, 525, 1445, 525, 718, 29888, 978, 29974, 525, 23220, 29915, 30004, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 517, 6185, 4641, 1495, 30004, 13, 1753, 1602, 14272, 1293, 7295, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 718, 11297, 3977, 14740, 22208, 30004, 13, 1678, 977, 264, 1280, 353, 5159, 30004, 13, 1678, 363, 313, 3972, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 29897, 297, 2897, 29889, 20919, 29898, 4632, 1125, 30004, 13, 4706, 977, 264, 1280, 29889, 21843, 29898, 1445, 1293, 8443, 13, 1678, 736, 4050, 29918, 6886, 877, 517, 6185, 4641, 29889, 1420, 742, 2066, 29922, 1777, 264, 1280, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 7099, 4641, 29914, 29966, 1792, 2283, 29958, 1495, 30004, 13, 1753, 1602, 4641, 2283, 29898, 1792, 2283, 1125, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 30004, 13, 1678, 1404, 2283, 353, 1404, 2283, 7503, 29899, 29896, 29906, 10062, 1792, 2283, 14352, 29946, 17531, 30004, 13, 1678, 285, 353, 1722, 29898, 4632, 23097, 29914, 18717, 1792, 2283, 7503, 29899, 29946, 10062, 15972, 1989, 29889, 3945, 742, 525, 6050, 1495, 30004, 13, 1678, 1820, 353, 285, 29889, 949, 26471, 13, 1678, 330, 353, 7139, 300, 29898, 1989, 8443, 13, 30004, 13, 1678, 363, 4516, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 297, 2897, 29889, 20919, 29898, 4632, 23097, 29914, 3977, 14740, 22208, 1125, 30004, 13, 4706, 363, 285, 978, 297, 934, 1293, 29901, 30004, 13, 9651, 565, 1404, 2283, 7503, 29899, 29946, 10062, 28560, 29883, 14740, 18717, 1792, 2283, 14352, 29946, 17531, 1275, 285, 978, 29901, 30004, 13, 18884, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 18884, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 462, 1678, 5993, 353, 330, 29889, 7099, 4641, 29898, 1359, 29918, 1445, 29889, 949, 3101, 30004, 13, 462, 1678, 2254, 29918, 1445, 29889, 5358, 26471, 13, 30004, 13, 18884, 285, 978, 353, 1404, 2283, 7503, 29899, 29946, 10062, 28560, 7099, 14740, 18717, 1792, 2283, 14352, 29946, 17531, 30004, 13, 18884, 716, 29918, 5479, 353, 313, 4632, 718, 5591, 7099, 14740, 12975, 718, 285, 978, 8443, 13, 18884, 1596, 29898, 1482, 29918, 5479, 8443, 13, 18884, 411, 1722, 29898, 1482, 29918, 5479, 29892, 525, 29893, 29890, 1495, 408, 2436, 29918, 1445, 29901, 30004, 13, 462, 1678, 2436, 29918, 1445, 29889, 3539, 29898, 6979, 8443, 13, 462, 1678, 2436, 29918, 1445, 29889, 5358, 26471, 13, 30004, 13, 1678, 736, 525, 1445, 525, 718, 29888, 978, 29974, 525, 1602, 14740, 29915, 30004, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 1495, 30004, 13, 1753, 21829, 7295, 30004, 13, 1678, 736, 4050, 29918, 6886, 877, 2248, 29889, 1420, 1495, 30004, 13, 30004, 13, 30004, 13, 1753, 4511, 4051, 7295, 30004, 13, 1678, 3495, 353, 6629, 30004, 13, 1678, 2011, 353, 29871, 29941, 29941, 29900, 29953, 30004, 13, 1678, 1404, 353, 6629, 30004, 13, 1678, 4800, 353, 6629, 30004, 13, 1678, 4833, 353, 6629, 30004, 13, 1678, 11009, 353, 282, 962, 952, 1519, 29889, 6915, 29898, 30004, 13, 4706, 3495, 29922, 3069, 11167, 13, 4706, 2011, 29922, 637, 11167, 13, 4706, 1404, 29922, 1792, 11167, 13, 4706, 4800, 29922, 5630, 11167, 13, 4706, 4833, 29922, 2585, 8443, 13, 1678, 736, 11009, 30004, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 8551, 3373, 1495, 30004, 13, 1753, 6441, 2283, 7295, 30004, 13, 1678, 11009, 353, 4511, 4051, 26471, 13, 1678, 16256, 353, 11009, 29889, 18127, 26471, 13, 1678, 934, 29918, 1853, 29896, 353, 6024, 3945, 742, 525, 29911, 12188, 742, 525, 726, 2033, 30004, 13, 1678, 934, 29918, 1853, 29906, 353, 6024, 6173, 742, 525, 26568, 742, 525, 29967, 16903, 742, 525, 29967, 4162, 29954, 742, 525, 2732, 742, 525, 29925, 9312, 742, 525, 18660, 2033, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 718, 11297, 7611, 22208, 30004, 13, 30004, 13, 1678, 363, 4516, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 297, 2897, 29889, 20919, 29898, 4632, 1125, 30004, 13, 4706, 363, 285, 978, 297, 934, 1293, 29901, 30004, 13, 9651, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 9651, 285, 2311, 353, 2897, 29889, 2084, 29889, 657, 2311, 29898, 1445, 29918, 5479, 8443, 13, 30004, 13, 9651, 565, 285, 978, 14352, 29941, 17531, 297, 934, 29918, 1853, 29896, 29901, 30004, 13, 18884, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 462, 1678, 285, 1272, 353, 2254, 29918, 1445, 29889, 949, 26471, 13, 30004, 13, 18884, 2346, 353, 525, 7851, 964, 934, 29918, 7611, 313, 29888, 978, 29892, 29888, 2311, 29892, 285, 1272, 29897, 15673, 313, 29995, 29879, 24163, 29879, 24163, 29879, 16029, 30004, 13, 18884, 6389, 353, 313, 29888, 978, 29892, 29888, 2311, 29892, 29888, 1272, 8443, 13, 18884, 16256, 29889, 7978, 29898, 1972, 29892, 5085, 8443, 13, 18884, 11009, 29889, 15060, 26471, 13, 18884, 2254, 29918, 1445, 29889, 5358, 26471, 13, 1678, 396, 2582, 353, 16256, 29889, 9155, 497, 26471, 13, 1678, 396, 363, 1948, 297, 2582, 29901, 30004, 13, 1678, 396, 268, 1596, 29898, 798, 29961, 29896, 2314, 30004, 13, 1678, 396, 11009, 29889, 15060, 26471, 13, 1678, 16256, 29889, 5358, 26471, 13, 1678, 11009, 29889, 5358, 26471, 13, 1678, 736, 525, 4051, 25723, 20714, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 8551, 6767, 29914, 29966, 9507, 29958, 1495, 30004, 13, 1753, 5142, 2283, 29898, 9507, 1125, 30004, 13, 1678, 11009, 353, 4511, 4051, 26471, 13, 1678, 16256, 353, 11009, 29889, 18127, 26471, 13, 1678, 2346, 353, 525, 2622, 285, 1272, 515, 934, 29918, 7611, 5754, 285, 978, 353, 1273, 29879, 29915, 30004, 13, 1678, 6389, 353, 313, 9507, 8443, 13, 1678, 16256, 29889, 7978, 29898, 1972, 29892, 6389, 8443, 13, 1678, 285, 1272, 353, 29871, 16256, 29889, 9155, 650, 580, 29961, 29900, 29962, 30004, 13, 1678, 411, 1722, 29898, 932, 29889, 4632, 29918, 2084, 718, 11297, 10382, 29889, 3945, 742, 525, 29893, 29890, 1495, 408, 590, 29918, 8552, 29901, 30004, 13, 4706, 590, 29918, 8552, 29889, 3539, 29898, 29888, 1272, 8443, 13, 1678, 11009, 29889, 15060, 26471, 13, 1678, 16256, 29889, 5358, 26471, 13, 1678, 11009, 29889, 5358, 26471, 13, 1678, 736, 525, 6767, 15638, 525, 29974, 9507, 30004, 13, 30004, 13, 30004, 13, 13383, 13383, 13383, 4136, 30004, 13, 29992, 932, 29889, 13134, 11219, 1293, 7717, 1495, 30004, 13, 1753, 2391, 7717, 7295, 30004, 13, 1678, 3876, 353, 623, 29889, 4632, 29918, 2084, 30004, 13, 1678, 977, 264, 1280, 353, 5159, 30004, 13, 1678, 503, 261, 542, 792, 353, 29871, 29900, 30004, 13, 1678, 363, 4516, 1170, 29892, 1014, 3972, 1293, 29892, 934, 1293, 297, 2897, 29889, 20919, 29898, 4632, 23097, 29914, 7611, 22208, 1125, 30004, 13, 4706, 363, 285, 978, 297, 934, 1293, 29901, 30004, 13, 9651, 934, 29918, 5479, 353, 313, 3972, 1170, 718, 5591, 29908, 718, 285, 978, 8443, 13, 9651, 2159, 353, 2897, 29889, 2084, 29889, 657, 2311, 29898, 1445, 29918, 5479, 8443, 13, 9651, 565, 2159, 1275, 29871, 29900, 29901, 30004, 13, 18884, 503, 261, 542, 792, 4619, 29871, 29896, 30004, 13, 9651, 977, 264, 1280, 29889, 4397, 29898, 23583, 3552, 29888, 978, 29892, 2311, 4961, 30004, 13, 1678, 4833, 1170, 353, 376, 1272, 5325, 19451, 13, 1678, 4833, 1170, 353, 3132, 29961, 2585, 1170, 29962, 30004, 13, 1678, 503, 261, 542, 792, 353, 518, 3298, 542, 792, 29962, 30004, 13, 1678, 363, 10422, 29892, 2311, 297, 977, 264, 1280, 29901, 30004, 13, 4706, 934, 29918, 5479, 353, 313, 4632, 23097, 29914, 7611, 22208, 718, 10422, 8443, 13, 4706, 411, 1722, 29898, 1445, 29918, 5479, 29892, 525, 6050, 1495, 408, 2254, 29918, 1445, 29901, 30004, 13, 9651, 848, 353, 2254, 29918, 1445, 29889, 949, 26471, 13, 4706, 848, 353, 848, 29889, 13808, 877, 9420, 29899, 29947, 1495, 30004, 13, 4706, 503, 261, 542, 792, 29889, 4397, 3319, 9507, 29901, 848, 1800, 30004, 13, 1678, 736, 4390, 1598, 29898, 3298, 542, 792, 8443, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 637, 353, 2897, 29889, 657, 6272, 877, 15082, 742, 525, 29945, 29900, 29900, 29900, 1495, 30004, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 30004, 13, 1678, 623, 29889, 3389, 29898, 3069, 2433, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 2011, 29922, 524, 29898, 637, 876, 2 ]
graph_rl/envs/flatten_wrapper.py
nicoguertler/graphrl
1
41443
<filename>graph_rl/envs/flatten_wrapper.py from gym import Wrapper from ..spaces import space_from_gym_space class FlattenWrapper(Wrapper): """Flattens observation and action space.""" def __init__(self, env): super().__init__(env) self._action_space = space_from_gym_space(env.action_space) self._observation_space = space_from_gym_space(env.observation_space) self.action_space = self._action_space.get_flat_space().get_gym_space() self.observation_space = self._observation_space.get_flat_space().get_gym_space() def step(self, action): orig_action = self._action_space.unflatten_value(action) orig_obs, reward, done, info = self.env.step(orig_action) obs = self._observation_space.flatten_value(orig_obs) return obs, reward, done, info def reset(self, **kwargs): orig_obs = self.env.reset(**kwargs) obs = self._observation_space.flatten_value(orig_obs) return obs
[ 1, 529, 9507, 29958, 4262, 29918, 2096, 29914, 264, 4270, 29914, 1579, 8606, 29918, 17699, 29889, 2272, 13, 3166, 330, 962, 1053, 399, 6794, 13, 13, 3166, 6317, 22854, 1053, 2913, 29918, 3166, 29918, 29887, 962, 29918, 3493, 13, 13, 13, 1990, 2379, 8606, 15646, 29898, 15646, 1125, 13, 1678, 9995, 8754, 1131, 575, 15500, 322, 3158, 2913, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8829, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 6272, 29897, 13, 4706, 1583, 3032, 2467, 29918, 3493, 353, 2913, 29918, 3166, 29918, 29887, 962, 29918, 3493, 29898, 6272, 29889, 2467, 29918, 3493, 29897, 13, 4706, 1583, 3032, 26739, 362, 29918, 3493, 353, 2913, 29918, 3166, 29918, 29887, 962, 29918, 3493, 29898, 6272, 29889, 26739, 362, 29918, 3493, 29897, 13, 13, 4706, 1583, 29889, 2467, 29918, 3493, 353, 1583, 3032, 2467, 29918, 3493, 29889, 657, 29918, 20620, 29918, 3493, 2141, 657, 29918, 29887, 962, 29918, 3493, 580, 13, 4706, 1583, 29889, 26739, 362, 29918, 3493, 353, 1583, 3032, 26739, 362, 29918, 3493, 29889, 657, 29918, 20620, 29918, 3493, 2141, 657, 29918, 29887, 962, 29918, 3493, 580, 13, 13, 1678, 822, 4331, 29898, 1311, 29892, 3158, 1125, 13, 4706, 1677, 29918, 2467, 353, 1583, 3032, 2467, 29918, 3493, 29889, 348, 1579, 8606, 29918, 1767, 29898, 2467, 29897, 13, 4706, 1677, 29918, 26290, 29892, 20751, 29892, 2309, 29892, 5235, 353, 1583, 29889, 6272, 29889, 10568, 29898, 12683, 29918, 2467, 29897, 13, 4706, 20881, 353, 1583, 3032, 26739, 362, 29918, 3493, 29889, 1579, 8606, 29918, 1767, 29898, 12683, 29918, 26290, 29897, 13, 4706, 736, 20881, 29892, 20751, 29892, 2309, 29892, 5235, 13, 13, 1678, 822, 10092, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1677, 29918, 26290, 353, 1583, 29889, 6272, 29889, 12071, 29898, 1068, 19290, 29897, 13, 4706, 20881, 353, 1583, 3032, 26739, 362, 29918, 3493, 29889, 1579, 8606, 29918, 1767, 29898, 12683, 29918, 26290, 29897, 13, 4706, 736, 20881, 13, 13, 13, 13, 2 ]
publishconf.py
siongui/pali-chanting
2
192935
<reponame>siongui/pali-chanting<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * # no trailing / SITEURL = 'https://siongui.github.io/pali-chanting' RELATIVE_URLS = False FEED_ALL_ATOM = None CATEGORY_FEED_ATOM = None TRANSLATION_FEED_ATOM = None AUTHOR_FEED_ATOM = None AUTHOR_FEED_RSS = None DELETE_OUTPUT_DIRECTORY = True # Following items are often useful when publishing #DISQUS_SITENAME = "" #GOOGLE_ANALYTICS = "" # Google Custom Search #GOOGLE_CSE = '000759460633137666077:43yuu4nvb0c'
[ 1, 529, 276, 1112, 420, 29958, 29879, 291, 23569, 29914, 29886, 2606, 29899, 13775, 292, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 396, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 29937, 910, 934, 338, 871, 1304, 565, 366, 671, 421, 5675, 9805, 29952, 470, 13, 29937, 9479, 6084, 372, 408, 596, 2295, 934, 29889, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2764, 3972, 29897, 13, 3166, 4639, 2185, 5527, 1053, 334, 13, 13, 29937, 694, 25053, 847, 13, 29903, 9094, 4219, 353, 525, 991, 597, 29879, 291, 23569, 29889, 3292, 29889, 601, 29914, 29886, 2606, 29899, 13775, 292, 29915, 13, 1525, 29931, 1299, 18474, 29918, 4219, 29903, 353, 7700, 13, 13, 16359, 3352, 29918, 9818, 29918, 1299, 6488, 353, 6213, 13, 29907, 3040, 29954, 18929, 29918, 16359, 3352, 29918, 1299, 6488, 353, 6213, 13, 26813, 12750, 8098, 29918, 16359, 3352, 29918, 1299, 6488, 353, 6213, 13, 20656, 29950, 1955, 29918, 16359, 3352, 29918, 1299, 6488, 353, 6213, 13, 20656, 29950, 1955, 29918, 16359, 3352, 29918, 29934, 1799, 353, 6213, 13, 13, 2287, 18476, 29918, 12015, 12336, 29918, 4571, 26282, 18929, 353, 5852, 13, 13, 29937, 12206, 4452, 526, 4049, 5407, 746, 27256, 13, 13, 29937, 23711, 29984, 3308, 29918, 29903, 1806, 1430, 25797, 353, 5124, 13, 29937, 17080, 29949, 29954, 1307, 29918, 2190, 1964, 29979, 29911, 2965, 29903, 353, 5124, 13, 13, 29937, 5087, 8701, 11856, 13, 29937, 17080, 29949, 29954, 1307, 29918, 29907, 1660, 353, 525, 29900, 29900, 29900, 29955, 29945, 29929, 29946, 29953, 29900, 29953, 29941, 29941, 29896, 29941, 29955, 29953, 29953, 29953, 29900, 29955, 29955, 29901, 29946, 29941, 29891, 29884, 29884, 29946, 29876, 24666, 29900, 29883, 29915, 13, 2 ]
serving_patterns/src/app/apps/app_image.py
shibuiwilliam/ml-system-in-action
10
1611156
<gh_stars>1-10 import os from fastapi import FastAPI import logging from src.configurations import PlatformConfigurations from src.app.routers import health, predict_image from src.app.configurations import APIConfigurations logger = logging.getLogger(__name__) logger.info(f"starts {APIConfigurations.title}:{APIConfigurations.version}") logger.info(f"platform: {PlatformConfigurations.platform}") app = FastAPI( title=APIConfigurations.title, description=APIConfigurations.description, version=APIConfigurations.version, ) app.include_router(health.router, prefix="/health", tags=["health"]) app.include_router(predict_image.router, prefix="/predict", tags=["predict"])
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 3166, 5172, 2754, 1053, 23786, 8787, 13, 5215, 12183, 13, 13, 3166, 4765, 29889, 2917, 332, 800, 1053, 28096, 3991, 332, 800, 13, 3166, 4765, 29889, 932, 29889, 27537, 2153, 1053, 9045, 29892, 8500, 29918, 3027, 13, 3166, 4765, 29889, 932, 29889, 2917, 332, 800, 1053, 3450, 3991, 332, 800, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 21707, 29889, 3888, 29898, 29888, 29908, 27382, 426, 8787, 3991, 332, 800, 29889, 3257, 6177, 29912, 8787, 3991, 332, 800, 29889, 3259, 27195, 13, 21707, 29889, 3888, 29898, 29888, 29908, 12120, 29901, 426, 21889, 3991, 332, 800, 29889, 12120, 27195, 13, 13, 13, 932, 353, 23786, 8787, 29898, 13, 1678, 3611, 29922, 8787, 3991, 332, 800, 29889, 3257, 29892, 13, 1678, 6139, 29922, 8787, 3991, 332, 800, 29889, 8216, 29892, 13, 1678, 1873, 29922, 8787, 3991, 332, 800, 29889, 3259, 29892, 13, 29897, 13, 13, 932, 29889, 2856, 29918, 15140, 29898, 354, 4298, 29889, 15140, 29892, 10944, 13802, 354, 4298, 613, 8282, 29922, 3366, 354, 4298, 20068, 13, 13, 932, 29889, 2856, 29918, 15140, 29898, 27711, 29918, 3027, 29889, 15140, 29892, 10944, 13802, 27711, 613, 8282, 29922, 3366, 27711, 20068, 13, 2 ]
hello.py
jinheebee/github_test
0
57569
<filename>hello.py<gh_stars>0 print("hello world") a = 3 b = 4 c = a * b print(c)
[ 1, 529, 9507, 29958, 12199, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 2158, 703, 12199, 3186, 1159, 13, 29874, 353, 29871, 29941, 13, 29890, 353, 29871, 29946, 13, 29883, 353, 263, 334, 289, 13, 2158, 29898, 29883, 29897, 13, 2 ]
msg_capsgan.py
MahdiyarMM/MSG-CapsGAN
5
156261
<filename>msg_capsgan.py #Image lib import cv2 # math libraries import numpy as np import scipy.misc # ml libraries import tensorflow as tf from keras import layers, models, optimizers from keras import backend as K from keras.utils import to_categorical from keras.datasets import mnist, cifar10 from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Lambda, concatenate, Multiply from keras.layers import BatchNormalization, Activation, ZeroPadding2D, Add from keras.layers.advanced_activations import LeakyReLU from keras.layers.convolutional import UpSampling2D, Conv2D from keras.models import Sequential, Model from keras.optimizers import Adam from keras.preprocessing.image import ImageDataGenerator from keras import callbacks import datetime # visualization import skimage from skimage import data, color, exposure from skimage.transform import resize import matplotlib.pyplot as plt import math from skimage.measure import compare_ssim as ssim from skimage.measure import compare_psnr as psnr from keras.applications import VGG19 # sys and helpers import sys import os import glob from tqdm import tqdm print('Modules imported.') class DataLoader3_all(): def __init__(self, dataset_name, img_res=(128, 128)): self.dataset_name = dataset_name self.img_res = img_res def load_data(self, batch_size=1, is_testing=False): data_type = "train" if not is_testing else "test" path = glob.glob('/content/drive/My Drive/CelebA_sample/CelebA/*') batch_images = np.random.choice(path, size=batch_size) imgs_hr = [] imgs_lr = [] imgs_32 = [] imgs_64 = [] for img_path in batch_images: imgl = self.imread(img_path) img = imgl[20:218-20,:] h, w = self.img_res low_h, low_w = int(h / 8), int(w / 8) # img_hr = scipy.misc.imresize(img, self.img_res) # img_lr = scipy.misc.imresize(img, (low_h, low_w)) # img_32 = scipy.misc.imresize(img, (32, 32)) # img_64 = scipy.misc.imresize(img, (64, 64)) img_hr = cv2.resize(img, self.img_res) img_lr = cv2.resize(img, (low_h, low_w)) img_32 = cv2.resize(img, (32, 32)) img_64 = cv2.resize(img, (64, 64)) # If training => do random flip if not is_testing and np.random.random() < 0.5: img_hr = np.fliplr(img_hr) img_lr = np.fliplr(img_lr) img_32 = np.fliplr(img_32) img_64 = np.fliplr(img_64) imgs_hr.append(img_hr) imgs_lr.append(img_lr) imgs_32.append(img_32) imgs_64.append(img_64) imgs_hr = np.array(imgs_hr) / 127.5 - 1. imgs_lr = np.array(imgs_lr) / 127.5 - 1. imgs_32 = np.array(imgs_32) / 127.5 - 1. imgs_64 = np.array(imgs_64) / 127.5 - 1. return imgs_hr, imgs_lr , imgs_32, imgs_64 def imread(self, path): return plt.imread(path).astype(np.float) def load_test(self,path): img = self.imread(path) img_hr = scipy.misc.imresize(img, (256,256)) # Configure data loader dataset_name = 'img_align_celeba' hr_height = 128 hr_width = 128 data_loader = DataLoader3_all(dataset_name=dataset_name, img_res=(hr_height, hr_width)) def all_psnr(imageA, imageB): psnrs = [] for ii in range(len(imageA)): psnrs.append(psnr(imageA[ii],imageB[ii])) return np.mean(psnrs) def all_ssim(imageA, imageB): psnrs = [] for ii in range(len(imageA)): psnrs.append(ssim(imageA[ii],imageB[ii],multichannel =True)) return np.mean(psnrs) # squash function of capsule layers, borrowed from <NAME>'s implementation of Keras CapsNet `https://github.com/XifengGuo/CapsNet-Keras` def squash(vectors, axis=-1): """ The non-linear activation used in Capsule. It drives the length of a large vector to near 1 and small vector to 0 :param vectors: some vectors to be squashed, N-dim tensor :param axis: the axis to squash :return: a Tensor with same shape as input vectors """ s_squared_norm = K.sum(K.square(vectors), axis, keepdims=True) scale = s_squared_norm / (1 + s_squared_norm) / K.sqrt(s_squared_norm + K.epsilon()) return scale * vectors # device check from tensorflow.python.client import device_lib print('Devices:', device_lib.list_local_devices()) # GPU check if not tf.test.gpu_device_name(): print('No GPU found.') else: print('Default GPU Device: {}'.format(tf.test.gpu_device_name())) def build_vgg(hr_shape): """ Builds a pre-trained VGG19 model that outputs image features extracted at the third block of the model """ vgg = VGG19(weights="imagenet") # Set outputs to outputs of last conv. layer in block 3 # See architecture at: https://github.com/keras-team/keras/blob/master/keras/applications/vgg19.py vgg.outputs = [vgg.layers[9].output] img = Input(hr_shape) # Extract image features img_features = vgg(img) return Model(img, img_features) optimizer = Adam(0.0003, 0.5) vgg = build_vgg((128,128,3)) vgg.trainable = False vgg.compile(loss='mse', optimizer=optimizer, metrics=['accuracy']) vgg64 = build_vgg((64,64,3)) vgg64.trainable = False vgg64.compile(loss='mse', optimizer=optimizer, metrics=['accuracy']) vgg32 = build_vgg((32,32,3)) vgg32.trainable = False vgg32.compile(loss='mse', optimizer=optimizer, metrics=['accuracy']) # discriminator structure def build_discriminator(): # depending on dataset we define input shape for our network img = Input(shape=(128, 128, 3)) img64 = Input(shape=(64, 64, 3)) img32 = Input(shape=(32, 32, 3)) x1 = Conv2D(filters=128, kernel_size=9, strides=2, padding='same', name='conv0')(img) img64f = Conv2D(filters=128, kernel_size=9, strides=1, padding='same', name='convimg0')(img64) x2 = concatenate([x1,img64f],axis=-1) x3 = Conv2D(filters=128, kernel_size=9, strides=2, padding='same', name='conv1')(x2) img32f = Conv2D(filters=128, kernel_size=9, strides=1, padding='same', name='convimg1')(img32) x4 = concatenate([x3,img32f],axis=-1) # first typical convlayer outputs a 20x20x256 matrix x5 = Conv2D(filters=256, kernel_size=9, strides=1, padding='valid', name='conv2')(x4) x6 = LeakyReLU()(x5) # original 'Dynamic Routing Between Capsules' paper does not include the batch norm layer after the first conv group x = BatchNormalization(momentum=0.8)(x6) # # primarycaps coming first # # filters 256 (n_vectors=8 * channels=32) x = Conv2D(filters=8 * 32, kernel_size=9, strides=2, padding='valid', name='primarycap_conv2')(x) #Flatten to add dense layer x = Flatten()(x) # reshape into the 8D vector for all 32 feature maps combined # (primary capsule has collections of activations which denote orientation of the digit # while intensity of the vector which denotes the presence of the digit) x = Reshape(target_shape=[-1, 8], name='primarycap_reshape')(x) # the purpose is to output a number between 0 and 1 for each capsule where the length of the input decides the amount x = Lambda(squash, name='primarycap_squash')(x) x = BatchNormalization(momentum=0.8)(x) # # digitcaps are here # x = Flatten()(x) uhat = Dense(160, kernel_initializer='he_normal', bias_initializer='zeros', name='uhat_digitcaps')(x) # c = coupling coefficient (softmax over the bias weights, log prior) | "the coupling coefficients between capsule (i) and all the capsules in the layer above sum to 1" # we treat the coupling coefficiant as a softmax over bias weights from the previous dense layer c = Activation('softmax', name='softmax_digitcaps1')(uhat) # softmax will make sure that each weight c_ij is a non-negative number and their sum equals to one # s_j (output of the current capsule level) = uhat * c c = Dense(160)(c) # compute s_j x = Multiply()([uhat, c]) """ NOTE: Squashing the capsule outputs creates severe blurry artifacts, thus we replace it with Leaky ReLu. """ s_j = LeakyReLU()(x) # # we will repeat the routing part 2 more times (num_routing=3) to unfold the loop # c = Activation('softmax', name='softmax_digitcaps2')(s_j) # softmax will make sure that each weight c_ij is a non-negative number and their sum equals to one c = Dense(160)(c) # compute s_j x = Multiply()([uhat, c]) s_j = LeakyReLU()(x) c = Activation('softmax', name='softmax_digitcaps3')(s_j) # softmax will make sure that each weight c_ij is a non-negative number and their sum equals to one c = Dense(160)(c) # compute s_j x = Multiply()([uhat, c]) s_j = LeakyReLU()(x) pred = Dense(25*25, activation='sigmoid')(s_j) patch = Reshape(target_shape=[-1, 25], name='last_out_reshape')(pred) return Model([img,img64,img32], patch) # build and compile the discriminator discriminator = build_discriminator() print('DISCRIMINATOR:') discriminator.summary() sgd = optimizers.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) #discriminator.load_weights('images_MSG/wdis6400.h5') discriminator.compile(loss='binary_crossentropy', optimizer=sgd) # generator structure def build_generator(): from keras.applications import VGG19 vgg = VGG19(weights="imagenet") vgg.outputs = [vgg.layers[9].output] vgg.trainable =False def deconv2d(layer_input,num=256): """Layers used during upsampling""" u = UpSampling2D(size=2)(layer_input) u = Conv2D(num, kernel_size=3, strides=1, padding='same')(u) u = Activation('relu')(u) return u def residual_block(layer_input, filters): """Residual block described in paper""" d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(layer_input) d = Activation('relu')(d) d = BatchNormalization(momentum=0.8)(d) d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(d) d = BatchNormalization(momentum=0.8)(d) d = Add()([d, layer_input]) return d img_lr_in = Input(shape=(16,16,3)) img_bilinear = Lambda(lambda image: tf.image.resize_images(image,(128, 128),method = tf.image.ResizeMethod.BICUBIC,align_corners = True, preserve_aspect_ratio = True))(img_lr_in) img_bilinear_64 = Lambda(lambda image: tf.image.resize_images(image,(64, 64),method = tf.image.ResizeMethod.BICUBIC,align_corners = True, preserve_aspect_ratio = True))(img_lr_in) img_bilinear_32 = Lambda(lambda image: tf.image.resize_images(image,(32, 32),method = tf.image.ResizeMethod.BICUBIC,align_corners = True, preserve_aspect_ratio = True))(img_lr_in) vgg_features = vgg(img_bilinear) vgg_features_cnn = Conv2D(64, kernel_size=3, strides=1, padding='same',name = "vgg_features_cnn")(vgg_features) pd = Conv2D(64, kernel_size=3, strides=1, padding='same')(img_lr_in) x = residual_block(pd,64) x = deconv2d(x,num=64) xconcat = concatenate([x,vgg_features_cnn],axis=-1,name='concatenation') pd = Conv2D(64, kernel_size=3, strides=1, padding='same')(xconcat) x = residual_block(pd,64) x_out_32 = Conv2D(3, kernel_size=3, strides=1, padding='same')(x) x_out_32 = Activation('tanh')(x_out_32) x_32_add = Add()([x_out_32, img_bilinear_32]) x_32 = Activation('tanh')(x_32_add) x = deconv2d(x) pd = Conv2D(64, kernel_size=3, strides=1, padding='same')(x) x = residual_block(pd,64) x_out_64 = Conv2D(3, kernel_size=3, strides=1, padding='same')(x) x_out_64 = Activation('tanh')(x_out_64) x_64_add = Add()([x_out_64, img_bilinear_64]) x_64 = Activation('tanh')(x_64_add) x = deconv2d(x) x = Conv2D(3, kernel_size=3, strides=1, padding='same')(x) x_out_pre = Activation('tanh')(x) x_out_add = Add()([x_out_pre, img_bilinear]) x_out = Activation('tanh')(x_out_add) return Model([img_lr_in],[x_out,x_64,x_32]) # build and compile the generator generator = build_generator() print('GENERATOR:') generator.summary() #generator.load_weights('images_MSG/wgen6400.h5') generator.compile(loss='binary_crossentropy', optimizer=Adam(0.0002, 0.5)) model_json = generator.to_json() with open("model.json", "w") as json_file: json_file.write(model_json) model_json = generator.to_json() with open("model.json", "w") as json_file: json_file.write(model_json) # feeding noise to generator z = Input(shape=(16,16,3)) imgf = generator(z) fake_features = vgg(imgf[0]) fake_features_1 = vgg64(imgf[1]) fake_features_2 = vgg32(imgf[2]) # for the combined model we will only train the generator discriminator.trainable = False # try to discriminate generated images valid = discriminator(imgf) # the combined model (stacked generator and discriminator) takes # noise as input => generates images => determines validity combined = Model(z, [valid,fake_features,fake_features_1,fake_features_2]) print('COMBINED:') combined.summary() combined.compile(loss=['binary_crossentropy', 'mse', 'mse', 'mse'], loss_weights=[3e-3, 0.001,0.001,1], optimizer=Adam(0.0002, 0.5)) # loss values for further plotting D_L_REAL = [] D_L_FAKE = [] D_L = [] D_ACC = [] G_L = [] def train(dataset_title, epochs, batch_size=32, save_interval=50): start_time = datetime.datetime.now() half_batch = int(batch_size / 2) for epoch in range(0,50000): ''' #Progressive Weight Loss Adjustment if epoch == 600: combined.compile(loss=['binary_crossentropy', 'mse'], loss_weights=[1e-2, 1], optimizer=Adam(0.0002, 0.5)) # --------------------- if epoch == 1500: combined.compile(loss=['binary_crossentropy', 'mse'], loss_weights=[1e-1, 1], optimizer=Adam(0.0002, 0.5)) if epoch == 2500: combined.compile(loss=['binary_crossentropy', 'mse'], loss_weights=[1e-2, 1], optimizer=Adam(0.0002, 0.5)) if epoch == 3500: combined.compile(loss=['binary_crossentropy', 'mse'], loss_weights=[1e-1, 1], optimizer=Adam(0.0002, 0.5)) ''' # Train Discriminator # --------------------- # select a random half batch of images imgs_hr, imgs_lr, imgs_32, imgs_64 = data_loader.load_data(half_batch) # generate a half batch of new images gen_imgs = generator.predict(imgs_lr) # train the discriminator by feeding both real and fake (generated) images one by one d_loss_real = discriminator.train_on_batch([imgs_hr,imgs_64,imgs_32], np.random.uniform(low=0.8, high=1.2, size=(half_batch, 25,25))) # 0.9 for label smoothing d_loss_fake = discriminator.train_on_batch(gen_imgs, np.random.uniform(low=0.0, high=0.3, size=(half_batch, 25,25))) d_loss = 0.5 * np.add(d_loss_real, d_loss_fake) # --------------------- # Train Generator # --------------------- imgs_hr, imgs_lr, imgs_32, imgs_64 = data_loader.load_data(batch_size) # the generator wants the discriminator to label the generated samples # as valid (ones) image_features = vgg.predict(imgs_hr) image_features_1 = vgg64.predict(imgs_64) image_features_2 = vgg32.predict(imgs_32) # train the generator g_loss = combined.train_on_batch(imgs_lr, [np.ones((batch_size,25,25)),image_features,image_features_1,image_features_2]) elapsed_time = datetime.datetime.now() - start_time # Plot the progress print ("%d time: %s ,[D loss: %f, acc.: %.2f%%] [G loss: %f]" % (epoch,elapsed_time, d_loss, 100*d_loss, g_loss[0])) D_L_REAL.append(d_loss_real) D_L_FAKE.append(d_loss_fake) D_L.append(d_loss) D_ACC.append(d_loss) G_L.append(g_loss) # if at save interval => save generated image samples if epoch % save_interval == 0: sample_images(epoch) generator.save_weights("images_MSG/wgen%d.h5" % (epoch)) discriminator.save_weights("images_MSG/wdis%d.h5" % (epoch)) def sample_images(epoch): os.makedirs('images_MSG/%s' % dataset_name, exist_ok=True) r, c = 2, 5 imgs_hr, imgs_lr,_,_ = data_loader.load_data(batch_size=2, is_testing=True) fake_hr = generator.predict(imgs_lr) imgs_hr_inp = imgs_hr imgs_lr_inp = imgs_lr # Rescale images 0 - 1 imgs_lr = 0.5 * imgs_lr + 0.5 fake_hr[0] = 0.5 * fake_hr[0] + 0.5 fake_hr[1] = 0.5 * fake_hr[1] + 0.5 fake_hr[2] = 0.5 * fake_hr[2] + 0.5 imgs_hr = 0.5 * imgs_hr + 0.5 # Save generated images and the high resolution originals titles = ['Original','128x128'] fig, axs = plt.subplots(r, c) cnt = 0 for row in range(r): for col, image in enumerate([imgs_hr,fake_hr[0]]): axs[row, col+3].imshow(imgs_lr[row]) axs[row, col+2].imshow(fake_hr[2][row]) axs[row, col+1].imshow(fake_hr[1][row]) axs[row, col].imshow(image[row]) axs[row, col+1].set_title('64x64') axs[row, col+2].set_title('32x32') axs[row, col+3].set_title('input') axs[row, col].set_title(titles[col]) axs[row, col].axis('off') axs[row, col+1].axis('off') axs[row, col+2].axis('off') axs[row, col+3].axis('off') cnt += 1 txt = ("psnr = %f - ssim = %f" % (all_psnr(fake_hr[0],imgs_hr), all_ssim(fake_hr[0],imgs_hr))) fig.text(.5, .05, txt, ha='center') fig.savefig("images_MSG/%s/%d.png" % (dataset_name, epoch)) plt.close() # Save low resolution images for comparison for i in range(r): fig = plt.figure() plt.imshow(imgs_lr[i]) fig.savefig('images_MSG/%s/%d_lowres%d.png' % (dataset_name, epoch, i)) plt.close() print(all_psnr(fake_hr[0],imgs_hr)) print(all_ssim(fake_hr[0],imgs_hr)) if epoch<5000 and epoch>1000: combined.compile(loss=['binary_crossentropy', 'mse', 'mse', 'mse'], loss_weights=[3e-3, 0.001,(epoch - 999)/4000,1], optimizer=Adam(0.0002, 0.5)) if epoch<10000 and epoch>5000: combined.compile(loss=['binary_crossentropy', 'mse', 'mse', 'mse'], loss_weights=[3e-3, (epoch - 4999)/5000,1,1], optimizer=Adam(0.0002, 0.5)) if epoch<15000 and epoch>10000: combined.compile(loss=['binary_crossentropy', 'mse', 'mse', 'mse'], loss_weights=[3e-3 + 2e-3*(epoch - 9999)/5000, 1,1,1], optimizer=Adam(0.0002, 0.5)) return imgs_lr_inp,imgs_hr_inp history = train('cifar10', epochs=30000, batch_size=32, save_interval=50) #generator.save('mnist_model.h5') #generator.save('cifar10_model.h5') plt.plot(D_L) plt.title('Discriminator results (MNIST)') plt.xlabel('Epochs') plt.ylabel('Discriminator Loss (blue), Discriminator Accuracy (orange)') plt.legend(['Discriminator Loss', 'Discriminator Accuracy']) plt.show() plt.plot(G_L) plt.title('Generator results (MNIST)') plt.xlabel('Epochs') plt.ylabel('Generator Loss (blue)') plt.legend('Generator Loss') plt.show() plt.plot(D_L) plt.title('Discriminator results (CIFAR10)') plt.xlabel('Epochs') plt.ylabel('Discriminator Loss (blue), Discriminator Accuracy (orange)') plt.legend(['Discriminator Loss', 'Discriminator Accuracy']) plt.show() plt.plot(G_L) plt.title('Generator results (CIFAR10)') plt.xlabel('Epochs') plt.ylabel('Generator Loss (blue)') plt.legend('Generator Loss') plt.show()
[ 1, 529, 9507, 29958, 7645, 29918, 29883, 2547, 6249, 29889, 2272, 13, 13, 13, 29937, 2940, 4303, 13, 5215, 13850, 29906, 13, 29937, 5844, 9562, 13, 5215, 12655, 408, 7442, 13, 5215, 4560, 2272, 29889, 29885, 10669, 13, 29937, 286, 29880, 9562, 13, 5215, 26110, 408, 15886, 13, 3166, 13023, 294, 1053, 15359, 29892, 4733, 29892, 5994, 19427, 13, 3166, 13023, 294, 1053, 14998, 408, 476, 13, 3166, 13023, 294, 29889, 13239, 1053, 304, 29918, 29883, 20440, 936, 13, 3166, 13023, 294, 29889, 14538, 1691, 1053, 28597, 391, 29892, 274, 361, 279, 29896, 29900, 13, 3166, 13023, 294, 29889, 29277, 1053, 10567, 29892, 360, 1947, 29892, 2538, 14443, 29892, 2379, 8606, 29892, 20724, 449, 29892, 365, 2269, 29892, 16125, 403, 29892, 9683, 666, 368, 13, 3166, 13023, 294, 29889, 29277, 1053, 350, 905, 19077, 2133, 29892, 21775, 362, 29892, 28933, 29925, 4676, 29906, 29928, 29892, 3462, 13, 3166, 13023, 294, 29889, 29277, 29889, 328, 16858, 29918, 11236, 800, 1053, 951, 557, 29891, 1123, 29931, 29965, 13, 3166, 13023, 294, 29889, 29277, 29889, 535, 4068, 284, 1053, 5020, 22966, 10335, 29906, 29928, 29892, 1281, 29894, 29906, 29928, 13, 3166, 13023, 294, 29889, 9794, 1053, 922, 339, 2556, 29892, 8125, 13, 3166, 13023, 294, 29889, 20640, 19427, 1053, 11783, 13, 3166, 13023, 294, 29889, 1457, 19170, 29889, 3027, 1053, 7084, 1469, 21575, 13, 3166, 13023, 294, 1053, 6939, 29879, 13, 5215, 12865, 13, 29937, 7604, 2133, 13, 5215, 2071, 3027, 13, 3166, 2071, 3027, 1053, 848, 29892, 2927, 29892, 14060, 545, 13, 3166, 2071, 3027, 29889, 9067, 1053, 19490, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 5844, 13, 3166, 2071, 3027, 29889, 26658, 1053, 7252, 29918, 893, 326, 408, 269, 3601, 13, 3166, 2071, 3027, 29889, 26658, 1053, 7252, 29918, 567, 22230, 408, 6529, 22230, 13, 3166, 13023, 294, 29889, 932, 5795, 1053, 478, 26788, 29896, 29929, 13, 13, 13, 29937, 10876, 322, 1371, 414, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 13149, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 13, 2158, 877, 2111, 2540, 19673, 29889, 1495, 13, 13, 1990, 3630, 10036, 29941, 29918, 497, 7295, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8783, 29918, 978, 29892, 10153, 29918, 690, 7607, 29896, 29906, 29947, 29892, 29871, 29896, 29906, 29947, 22164, 13, 4706, 1583, 29889, 24713, 29918, 978, 353, 8783, 29918, 978, 13, 4706, 1583, 29889, 2492, 29918, 690, 353, 10153, 29918, 690, 13, 13, 1678, 822, 2254, 29918, 1272, 29898, 1311, 29892, 9853, 29918, 2311, 29922, 29896, 29892, 338, 29918, 13424, 29922, 8824, 1125, 13, 4706, 848, 29918, 1853, 353, 376, 14968, 29908, 565, 451, 338, 29918, 13424, 1683, 376, 1688, 29908, 13, 308, 13, 4706, 2224, 353, 13149, 29889, 23705, 11219, 3051, 29914, 21594, 29914, 3421, 22850, 29914, 29907, 6146, 29890, 29909, 29918, 11249, 29914, 29907, 6146, 29890, 29909, 5515, 1495, 13, 13, 4706, 9853, 29918, 8346, 353, 7442, 29889, 8172, 29889, 16957, 29898, 2084, 29892, 2159, 29922, 16175, 29918, 2311, 29897, 13, 13, 4706, 527, 3174, 29918, 1092, 353, 5159, 13, 4706, 527, 3174, 29918, 29212, 353, 5159, 13, 4706, 527, 3174, 29918, 29941, 29906, 353, 5159, 13, 4706, 527, 3174, 29918, 29953, 29946, 353, 5159, 13, 4706, 363, 10153, 29918, 2084, 297, 9853, 29918, 8346, 29901, 13, 9651, 527, 3820, 353, 1583, 29889, 326, 949, 29898, 2492, 29918, 2084, 29897, 13, 9651, 10153, 353, 527, 3820, 29961, 29906, 29900, 29901, 29906, 29896, 29947, 29899, 29906, 29900, 29892, 17531, 13, 9651, 298, 29892, 281, 353, 1583, 29889, 2492, 29918, 690, 13, 9651, 4482, 29918, 29882, 29892, 4482, 29918, 29893, 353, 938, 29898, 29882, 847, 29871, 29947, 511, 938, 29898, 29893, 847, 29871, 29947, 29897, 13, 13, 29937, 9651, 10153, 29918, 1092, 353, 4560, 2272, 29889, 29885, 10669, 29889, 326, 21476, 29898, 2492, 29892, 1583, 29889, 2492, 29918, 690, 29897, 13, 396, 965, 10153, 29918, 29212, 353, 4560, 2272, 29889, 29885, 10669, 29889, 326, 21476, 29898, 2492, 29892, 313, 677, 29918, 29882, 29892, 4482, 29918, 29893, 876, 13, 29871, 396, 3986, 10153, 29918, 29941, 29906, 353, 4560, 2272, 29889, 29885, 10669, 29889, 326, 21476, 29898, 2492, 29892, 313, 29941, 29906, 29892, 29871, 29941, 29906, 876, 13, 259, 396, 308, 10153, 29918, 29953, 29946, 353, 4560, 2272, 29889, 29885, 10669, 29889, 326, 21476, 29898, 2492, 29892, 313, 29953, 29946, 29892, 29871, 29953, 29946, 876, 13, 13, 9651, 10153, 29918, 1092, 353, 13850, 29906, 29889, 21476, 29898, 2492, 29892, 1583, 29889, 2492, 29918, 690, 29897, 13, 9651, 10153, 29918, 29212, 353, 13850, 29906, 29889, 21476, 29898, 2492, 29892, 313, 677, 29918, 29882, 29892, 4482, 29918, 29893, 876, 13, 9651, 10153, 29918, 29941, 29906, 353, 13850, 29906, 29889, 21476, 29898, 2492, 29892, 313, 29941, 29906, 29892, 29871, 29941, 29906, 876, 13, 9651, 10153, 29918, 29953, 29946, 353, 13850, 29906, 29889, 21476, 29898, 2492, 29892, 313, 29953, 29946, 29892, 29871, 29953, 29946, 876, 13, 9651, 396, 960, 6694, 1149, 437, 4036, 285, 3466, 13, 9651, 565, 451, 338, 29918, 13424, 322, 7442, 29889, 8172, 29889, 8172, 580, 529, 29871, 29900, 29889, 29945, 29901, 13, 18884, 10153, 29918, 1092, 353, 7442, 29889, 20157, 572, 29878, 29898, 2492, 29918, 1092, 29897, 13, 18884, 10153, 29918, 29212, 353, 7442, 29889, 20157, 572, 29878, 29898, 2492, 29918, 29212, 29897, 13, 18884, 10153, 29918, 29941, 29906, 353, 7442, 29889, 20157, 572, 29878, 29898, 2492, 29918, 29941, 29906, 29897, 13, 18884, 10153, 29918, 29953, 29946, 353, 7442, 29889, 20157, 572, 29878, 29898, 2492, 29918, 29953, 29946, 29897, 13, 13, 9651, 527, 3174, 29918, 1092, 29889, 4397, 29898, 2492, 29918, 1092, 29897, 13, 9651, 527, 3174, 29918, 29212, 29889, 4397, 29898, 2492, 29918, 29212, 29897, 13, 9651, 527, 3174, 29918, 29941, 29906, 29889, 4397, 29898, 2492, 29918, 29941, 29906, 29897, 13, 9651, 527, 3174, 29918, 29953, 29946, 29889, 4397, 29898, 2492, 29918, 29953, 29946, 29897, 13, 13, 4706, 527, 3174, 29918, 1092, 353, 7442, 29889, 2378, 29898, 2492, 29879, 29918, 1092, 29897, 847, 29871, 29896, 29906, 29955, 29889, 29945, 448, 29871, 29896, 29889, 13, 4706, 527, 3174, 29918, 29212, 353, 7442, 29889, 2378, 29898, 2492, 29879, 29918, 29212, 29897, 847, 29871, 29896, 29906, 29955, 29889, 29945, 448, 29871, 29896, 29889, 13, 4706, 527, 3174, 29918, 29941, 29906, 353, 7442, 29889, 2378, 29898, 2492, 29879, 29918, 29941, 29906, 29897, 847, 29871, 29896, 29906, 29955, 29889, 29945, 448, 29871, 29896, 29889, 13, 4706, 527, 3174, 29918, 29953, 29946, 353, 7442, 29889, 2378, 29898, 2492, 29879, 29918, 29953, 29946, 29897, 847, 29871, 29896, 29906, 29955, 29889, 29945, 448, 29871, 29896, 29889, 13, 13, 4706, 736, 527, 3174, 29918, 1092, 29892, 527, 3174, 29918, 29212, 1919, 527, 3174, 29918, 29941, 29906, 29892, 527, 3174, 29918, 29953, 29946, 13, 13, 13, 1678, 822, 527, 949, 29898, 1311, 29892, 2224, 1125, 13, 4706, 736, 14770, 29889, 326, 949, 29898, 2084, 467, 579, 668, 29898, 9302, 29889, 7411, 29897, 13, 268, 13, 1678, 822, 2254, 29918, 1688, 29898, 1311, 29892, 2084, 1125, 13, 4706, 10153, 353, 1583, 29889, 326, 949, 29898, 2084, 29897, 13, 4706, 10153, 29918, 1092, 353, 4560, 2272, 29889, 29885, 10669, 29889, 326, 21476, 29898, 2492, 29892, 313, 29906, 29945, 29953, 29892, 29906, 29945, 29953, 876, 259, 13, 13, 29937, 1281, 4532, 848, 23466, 13, 24713, 29918, 978, 353, 525, 2492, 29918, 2520, 29918, 346, 280, 2291, 29915, 13, 1092, 29918, 3545, 353, 29871, 29896, 29906, 29947, 13, 1092, 29918, 2103, 353, 29871, 29896, 29906, 29947, 13, 13, 1272, 29918, 12657, 353, 3630, 10036, 29941, 29918, 497, 29898, 24713, 29918, 978, 29922, 24713, 29918, 978, 29892, 13, 462, 795, 10153, 29918, 690, 7607, 1092, 29918, 3545, 29892, 22157, 29918, 2103, 876, 13, 13, 1753, 599, 29918, 567, 22230, 29898, 3027, 29909, 29892, 1967, 29933, 1125, 13, 1678, 6529, 29876, 2288, 353, 5159, 13, 1678, 363, 13607, 297, 3464, 29898, 2435, 29898, 3027, 29909, 22164, 13, 4706, 6529, 29876, 2288, 29889, 4397, 29898, 567, 22230, 29898, 3027, 29909, 29961, 2236, 1402, 3027, 29933, 29961, 2236, 12622, 13, 1678, 736, 7442, 29889, 12676, 29898, 567, 29876, 2288, 29897, 13, 13, 1753, 599, 29918, 893, 326, 29898, 3027, 29909, 29892, 1967, 29933, 1125, 13, 1678, 6529, 29876, 2288, 353, 5159, 13, 1678, 363, 13607, 297, 3464, 29898, 2435, 29898, 3027, 29909, 22164, 13, 4706, 6529, 29876, 2288, 29889, 4397, 29898, 893, 326, 29898, 3027, 29909, 29961, 2236, 1402, 3027, 29933, 29961, 2236, 1402, 4713, 436, 4143, 353, 5574, 876, 13, 1678, 736, 7442, 29889, 12676, 29898, 567, 29876, 2288, 29897, 13, 13, 308, 13, 29937, 10674, 1161, 740, 310, 26091, 1297, 15359, 29892, 27942, 287, 515, 529, 5813, 16299, 29879, 5314, 310, 12693, 294, 315, 2547, 6779, 421, 991, 597, 3292, 29889, 510, 29914, 29990, 361, 996, 9485, 29877, 29914, 29907, 2547, 6779, 29899, 29968, 18464, 29952, 13, 1753, 10674, 1161, 29898, 345, 14359, 29892, 9685, 10457, 29896, 1125, 13, 1678, 9995, 13, 1678, 450, 1661, 29899, 10660, 26229, 1304, 297, 315, 2547, 1297, 29889, 739, 25100, 278, 3309, 310, 263, 2919, 4608, 304, 2978, 29871, 29896, 322, 2319, 4608, 304, 29871, 29900, 13, 1678, 584, 3207, 12047, 29901, 777, 12047, 304, 367, 10674, 25936, 29892, 405, 29899, 6229, 12489, 13, 1678, 584, 3207, 9685, 29901, 278, 9685, 304, 10674, 1161, 13, 1678, 584, 2457, 29901, 263, 323, 6073, 411, 1021, 8267, 408, 1881, 12047, 13, 1678, 9995, 13, 1678, 269, 29918, 26613, 1965, 29918, 12324, 353, 476, 29889, 2083, 29898, 29968, 29889, 17619, 29898, 345, 14359, 511, 9685, 29892, 3013, 6229, 29879, 29922, 5574, 29897, 13, 1678, 6287, 353, 269, 29918, 26613, 1965, 29918, 12324, 847, 313, 29896, 718, 269, 29918, 26613, 1965, 29918, 12324, 29897, 847, 476, 29889, 3676, 29898, 29879, 29918, 26613, 1965, 29918, 12324, 718, 476, 29889, 5463, 3101, 13, 1678, 736, 6287, 334, 12047, 13, 13, 29937, 4742, 1423, 13, 3166, 26110, 29889, 4691, 29889, 4645, 1053, 4742, 29918, 1982, 13, 2158, 877, 16618, 1575, 29901, 742, 4742, 29918, 1982, 29889, 1761, 29918, 2997, 29918, 3359, 1575, 3101, 13, 13, 29937, 22796, 1423, 13, 361, 451, 15886, 29889, 1688, 29889, 29887, 3746, 29918, 10141, 29918, 978, 7295, 13, 1678, 1596, 877, 3782, 22796, 1476, 29889, 1495, 13, 2870, 29901, 13, 1678, 1596, 877, 4592, 22796, 21830, 29901, 6571, 4286, 4830, 29898, 13264, 29889, 1688, 29889, 29887, 3746, 29918, 10141, 29918, 978, 22130, 13, 13, 13, 13, 1753, 2048, 29918, 29894, 1505, 29898, 1092, 29918, 12181, 1125, 13, 1678, 9995, 13, 1678, 8878, 29879, 263, 758, 29899, 3018, 1312, 478, 26788, 29896, 29929, 1904, 393, 14391, 1967, 5680, 23892, 472, 278, 13, 1678, 4654, 2908, 310, 278, 1904, 13, 1678, 9995, 13, 268, 13, 1678, 325, 1505, 353, 478, 26788, 29896, 29929, 29898, 705, 5861, 543, 326, 5370, 300, 1159, 13, 1678, 396, 3789, 14391, 304, 14391, 310, 1833, 7602, 29889, 7546, 297, 2908, 29871, 29941, 13, 1678, 396, 2823, 11258, 472, 29901, 2045, 597, 3292, 29889, 510, 29914, 3946, 294, 29899, 14318, 29914, 3946, 294, 29914, 10054, 29914, 6207, 29914, 3946, 294, 29914, 932, 5795, 29914, 29894, 1505, 29896, 29929, 29889, 2272, 13, 1678, 325, 1505, 29889, 4905, 29879, 353, 518, 29894, 1505, 29889, 29277, 29961, 29929, 1822, 4905, 29962, 13, 13, 1678, 10153, 353, 10567, 29898, 1092, 29918, 12181, 29897, 13, 13, 1678, 396, 7338, 1461, 1967, 5680, 13, 1678, 10153, 29918, 22100, 353, 325, 1505, 29898, 2492, 29897, 13, 13, 1678, 736, 8125, 29898, 2492, 29892, 10153, 29918, 22100, 29897, 13, 13, 20640, 3950, 353, 11783, 29898, 29900, 29889, 29900, 29900, 29900, 29941, 29892, 29871, 29900, 29889, 29945, 29897, 13, 29894, 1505, 353, 2048, 29918, 29894, 1505, 3552, 29896, 29906, 29947, 29892, 29896, 29906, 29947, 29892, 29941, 876, 13, 29894, 1505, 29889, 14968, 519, 353, 7700, 13, 29894, 1505, 29889, 12198, 29898, 6758, 2433, 29885, 344, 742, 13, 9651, 5994, 3950, 29922, 20640, 3950, 29892, 13, 9651, 21556, 29922, 1839, 562, 2764, 4135, 11287, 13, 13, 29894, 1505, 29953, 29946, 353, 2048, 29918, 29894, 1505, 3552, 29953, 29946, 29892, 29953, 29946, 29892, 29941, 876, 13, 29894, 1505, 29953, 29946, 29889, 14968, 519, 353, 7700, 13, 29894, 1505, 29953, 29946, 29889, 12198, 29898, 6758, 2433, 29885, 344, 742, 13, 9651, 5994, 3950, 29922, 20640, 3950, 29892, 13, 9651, 21556, 29922, 1839, 562, 2764, 4135, 11287, 13, 13, 29894, 1505, 29941, 29906, 353, 2048, 29918, 29894, 1505, 3552, 29941, 29906, 29892, 29941, 29906, 29892, 29941, 876, 13, 29894, 1505, 29941, 29906, 29889, 14968, 519, 353, 7700, 13, 29894, 1505, 29941, 29906, 29889, 12198, 29898, 6758, 2433, 29885, 344, 742, 13, 9651, 5994, 3950, 29922, 20640, 3950, 29892, 13, 9651, 21556, 29922, 1839, 562, 2764, 4135, 11287, 13, 13, 29937, 2313, 20386, 1061, 3829, 13, 1753, 2048, 29918, 2218, 29883, 20386, 1061, 7295, 13, 13, 1678, 396, 8679, 373, 8783, 591, 4529, 1881, 8267, 363, 1749, 3564, 13, 1678, 10153, 353, 10567, 29898, 12181, 7607, 29896, 29906, 29947, 29892, 29871, 29896, 29906, 29947, 29892, 29871, 29941, 876, 13, 1678, 10153, 29953, 29946, 353, 10567, 29898, 12181, 7607, 29953, 29946, 29892, 29871, 29953, 29946, 29892, 29871, 29941, 876, 13, 1678, 10153, 29941, 29906, 353, 10567, 29898, 12181, 7607, 29941, 29906, 29892, 29871, 29941, 29906, 29892, 29871, 29941, 876, 13, 268, 13, 1678, 921, 29896, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29922, 29896, 29906, 29947, 29892, 8466, 29918, 2311, 29922, 29929, 29892, 851, 2247, 29922, 29906, 29892, 7164, 2433, 17642, 742, 1024, 2433, 20580, 29900, 1495, 29898, 2492, 29897, 13, 1678, 10153, 29953, 29946, 29888, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29922, 29896, 29906, 29947, 29892, 8466, 29918, 2311, 29922, 29929, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 742, 1024, 2433, 20580, 2492, 29900, 1495, 29898, 2492, 29953, 29946, 29897, 13, 1678, 921, 29906, 353, 16125, 403, 4197, 29916, 29896, 29892, 2492, 29953, 29946, 29888, 1402, 8990, 10457, 29896, 29897, 13, 1678, 921, 29941, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29922, 29896, 29906, 29947, 29892, 8466, 29918, 2311, 29922, 29929, 29892, 851, 2247, 29922, 29906, 29892, 7164, 2433, 17642, 742, 1024, 2433, 20580, 29896, 1495, 29898, 29916, 29906, 29897, 13, 1678, 10153, 29941, 29906, 29888, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29922, 29896, 29906, 29947, 29892, 8466, 29918, 2311, 29922, 29929, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 742, 1024, 2433, 20580, 2492, 29896, 1495, 29898, 2492, 29941, 29906, 29897, 13, 1678, 921, 29946, 353, 16125, 403, 4197, 29916, 29941, 29892, 2492, 29941, 29906, 29888, 1402, 8990, 10457, 29896, 29897, 13, 1678, 396, 937, 15662, 7602, 13148, 14391, 263, 29871, 29906, 29900, 29916, 29906, 29900, 29916, 29906, 29945, 29953, 4636, 13, 1678, 921, 29945, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29922, 29906, 29945, 29953, 29892, 8466, 29918, 2311, 29922, 29929, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 3084, 742, 1024, 2433, 20580, 29906, 1495, 29898, 29916, 29946, 29897, 13, 1678, 921, 29953, 353, 951, 557, 29891, 1123, 29931, 29965, 580, 29898, 29916, 29945, 29897, 13, 268, 13, 1678, 396, 2441, 525, 24001, 20829, 292, 21674, 315, 2547, 2540, 29915, 5650, 947, 451, 3160, 278, 9853, 6056, 7546, 1156, 278, 937, 7602, 2318, 13, 1678, 921, 353, 350, 905, 19077, 2133, 29898, 29885, 2932, 398, 29922, 29900, 29889, 29947, 5033, 29916, 29953, 29897, 13, 13, 268, 13, 1678, 396, 13, 1678, 396, 7601, 29883, 2547, 6421, 937, 13, 1678, 396, 13, 268, 13, 1678, 396, 18094, 29871, 29906, 29945, 29953, 313, 29876, 29918, 345, 14359, 29922, 29947, 334, 18196, 29922, 29941, 29906, 29897, 13, 1678, 921, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29922, 29947, 334, 29871, 29941, 29906, 29892, 8466, 29918, 2311, 29922, 29929, 29892, 851, 2247, 29922, 29906, 29892, 7164, 2433, 3084, 742, 1024, 2433, 16072, 5030, 29918, 20580, 29906, 1495, 29898, 29916, 29897, 13, 268, 13, 1678, 396, 29943, 5066, 841, 304, 788, 20619, 7546, 13, 1678, 921, 353, 2379, 8606, 580, 29898, 29916, 29897, 13, 268, 13, 1678, 396, 620, 14443, 964, 278, 29871, 29947, 29928, 4608, 363, 599, 29871, 29941, 29906, 4682, 11053, 12420, 13, 1678, 396, 313, 16072, 26091, 1297, 756, 16250, 310, 5039, 800, 607, 13530, 19843, 310, 278, 13615, 13, 1678, 396, 1550, 26171, 310, 278, 4608, 607, 20169, 278, 10122, 310, 278, 13615, 29897, 13, 1678, 921, 353, 2538, 14443, 29898, 5182, 29918, 12181, 11759, 29899, 29896, 29892, 29871, 29947, 1402, 1024, 2433, 16072, 5030, 29918, 690, 14443, 1495, 29898, 29916, 29897, 13, 268, 13, 1678, 396, 278, 6437, 338, 304, 1962, 263, 1353, 1546, 29871, 29900, 322, 29871, 29896, 363, 1269, 26091, 1297, 988, 278, 3309, 310, 278, 1881, 1602, 2247, 278, 5253, 13, 1678, 921, 353, 365, 2269, 29898, 26613, 1161, 29892, 1024, 2433, 16072, 5030, 29918, 26613, 1161, 1495, 29898, 29916, 29897, 13, 1678, 921, 353, 350, 905, 19077, 2133, 29898, 29885, 2932, 398, 29922, 29900, 29889, 29947, 5033, 29916, 29897, 13, 13, 13, 1678, 396, 13, 1678, 396, 13615, 29883, 2547, 526, 1244, 13, 1678, 396, 13, 13, 1678, 921, 353, 2379, 8606, 580, 29898, 29916, 29897, 13, 13, 1678, 318, 2455, 353, 360, 1947, 29898, 29896, 29953, 29900, 29892, 8466, 29918, 11228, 3950, 2433, 354, 29918, 8945, 742, 24003, 29918, 11228, 3950, 2433, 3298, 359, 742, 1024, 2433, 29884, 2455, 29918, 26204, 29883, 2547, 1495, 29898, 29916, 29897, 13, 268, 13, 1678, 396, 274, 353, 23638, 10825, 313, 2695, 3317, 975, 278, 24003, 18177, 29892, 1480, 7536, 29897, 891, 376, 1552, 23638, 16127, 1546, 26091, 1297, 313, 29875, 29897, 322, 599, 278, 26091, 2540, 297, 278, 7546, 2038, 2533, 304, 29871, 29896, 29908, 13, 1678, 396, 591, 7539, 278, 23638, 1302, 12352, 1654, 424, 408, 263, 4964, 3317, 975, 24003, 18177, 515, 278, 3517, 20619, 7546, 13, 1678, 274, 353, 21775, 362, 877, 2695, 3317, 742, 1024, 2433, 2695, 3317, 29918, 26204, 29883, 2547, 29896, 1495, 29898, 29884, 2455, 29897, 396, 4964, 3317, 674, 1207, 1854, 393, 1269, 7688, 274, 29918, 823, 338, 263, 1661, 29899, 22198, 1353, 322, 1009, 2533, 15743, 304, 697, 13, 268, 13, 1678, 396, 269, 29918, 29926, 313, 4905, 310, 278, 1857, 26091, 1297, 3233, 29897, 353, 318, 2455, 334, 274, 13, 1678, 274, 353, 360, 1947, 29898, 29896, 29953, 29900, 5033, 29883, 29897, 396, 10272, 269, 29918, 29926, 13, 1678, 921, 353, 9683, 666, 368, 580, 4197, 29884, 2455, 29892, 274, 2314, 13, 1678, 9995, 13, 1678, 6058, 29923, 29901, 317, 339, 1161, 292, 278, 26091, 1297, 14391, 10017, 22261, 1999, 332, 719, 24238, 29879, 29892, 4550, 591, 5191, 372, 411, 951, 557, 29891, 830, 24126, 29889, 13, 1678, 9995, 13, 1678, 269, 29918, 29926, 353, 951, 557, 29891, 1123, 29931, 29965, 580, 29898, 29916, 29897, 13, 13, 13, 1678, 396, 13, 1678, 396, 591, 674, 12312, 278, 21398, 760, 29871, 29906, 901, 3064, 313, 1949, 29918, 14608, 292, 29922, 29941, 29897, 304, 20220, 278, 2425, 13, 1678, 396, 13, 1678, 274, 353, 21775, 362, 877, 2695, 3317, 742, 1024, 2433, 2695, 3317, 29918, 26204, 29883, 2547, 29906, 1495, 29898, 29879, 29918, 29926, 29897, 396, 4964, 3317, 674, 1207, 1854, 393, 1269, 7688, 274, 29918, 823, 338, 263, 1661, 29899, 22198, 1353, 322, 1009, 2533, 15743, 304, 697, 13, 1678, 274, 353, 360, 1947, 29898, 29896, 29953, 29900, 5033, 29883, 29897, 396, 10272, 269, 29918, 29926, 13, 1678, 921, 353, 9683, 666, 368, 580, 4197, 29884, 2455, 29892, 274, 2314, 13, 1678, 269, 29918, 29926, 353, 951, 557, 29891, 1123, 29931, 29965, 580, 29898, 29916, 29897, 13, 13, 1678, 274, 353, 21775, 362, 877, 2695, 3317, 742, 1024, 2433, 2695, 3317, 29918, 26204, 29883, 2547, 29941, 1495, 29898, 29879, 29918, 29926, 29897, 396, 4964, 3317, 674, 1207, 1854, 393, 1269, 7688, 274, 29918, 823, 338, 263, 1661, 29899, 22198, 1353, 322, 1009, 2533, 15743, 304, 697, 13, 1678, 274, 353, 360, 1947, 29898, 29896, 29953, 29900, 5033, 29883, 29897, 396, 10272, 269, 29918, 29926, 13, 1678, 921, 353, 9683, 666, 368, 580, 4197, 29884, 2455, 29892, 274, 2314, 13, 1678, 269, 29918, 29926, 353, 951, 557, 29891, 1123, 29931, 29965, 580, 29898, 29916, 29897, 13, 13, 1678, 4450, 353, 360, 1947, 29898, 29906, 29945, 29930, 29906, 29945, 29892, 26229, 2433, 18816, 29885, 3398, 1495, 29898, 29879, 29918, 29926, 29897, 13, 1678, 13261, 353, 2538, 14443, 29898, 5182, 29918, 12181, 11759, 29899, 29896, 29892, 29871, 29906, 29945, 1402, 1024, 2433, 4230, 29918, 449, 29918, 690, 14443, 1495, 29898, 11965, 29897, 13, 268, 13, 268, 13, 1678, 736, 8125, 4197, 2492, 29892, 2492, 29953, 29946, 29892, 2492, 29941, 29906, 1402, 13261, 29897, 13, 13, 13, 13, 29937, 2048, 322, 6633, 278, 2313, 20386, 1061, 13, 2218, 29883, 20386, 1061, 353, 2048, 29918, 2218, 29883, 20386, 1061, 580, 13, 2158, 877, 23711, 29907, 3960, 16173, 1299, 1955, 29901, 1495, 13, 2218, 29883, 20386, 1061, 29889, 7727, 580, 13, 5311, 29881, 353, 5994, 19427, 29889, 26016, 29928, 29898, 29212, 29922, 29900, 29889, 29900, 29896, 29892, 20228, 29922, 29896, 29872, 29899, 29953, 29892, 19399, 29922, 29900, 29889, 29929, 29892, 302, 4156, 586, 29922, 5574, 29897, 13, 29937, 2218, 29883, 20386, 1061, 29889, 1359, 29918, 705, 5861, 877, 8346, 29918, 4345, 29954, 29914, 29893, 2218, 29953, 29946, 29900, 29900, 29889, 29882, 29945, 1495, 13, 2218, 29883, 20386, 1061, 29889, 12198, 29898, 6758, 2433, 19541, 29918, 19128, 296, 14441, 742, 5994, 3950, 29922, 5311, 29881, 29897, 13, 13, 29937, 15299, 3829, 1678, 13, 1753, 2048, 29918, 27959, 7295, 13, 1678, 515, 13023, 294, 29889, 932, 5795, 1053, 478, 26788, 29896, 29929, 13, 1678, 325, 1505, 353, 478, 26788, 29896, 29929, 29898, 705, 5861, 543, 326, 5370, 300, 1159, 13, 1678, 325, 1505, 29889, 4905, 29879, 353, 518, 29894, 1505, 29889, 29277, 29961, 29929, 1822, 4905, 29962, 13, 1678, 325, 1505, 29889, 14968, 519, 353, 8824, 13, 268, 13, 1678, 822, 316, 20580, 29906, 29881, 29898, 13148, 29918, 2080, 29892, 1949, 29922, 29906, 29945, 29953, 1125, 13, 4706, 9995, 29931, 388, 414, 1304, 2645, 24081, 314, 10335, 15945, 29908, 13, 4706, 318, 353, 5020, 22966, 10335, 29906, 29928, 29898, 2311, 29922, 29906, 5033, 13148, 29918, 2080, 29897, 13, 4706, 318, 353, 1281, 29894, 29906, 29928, 29898, 1949, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29884, 29897, 13, 4706, 318, 353, 21775, 362, 877, 2674, 29884, 1495, 29898, 29884, 29897, 13, 4706, 736, 318, 13, 268, 13, 1678, 822, 10995, 950, 29918, 1271, 29898, 13148, 29918, 2080, 29892, 18094, 1125, 13, 4706, 9995, 1666, 333, 950, 2908, 5439, 297, 5650, 15945, 29908, 13, 4706, 270, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 13148, 29918, 2080, 29897, 13, 4706, 270, 353, 21775, 362, 877, 2674, 29884, 1495, 29898, 29881, 29897, 13, 4706, 270, 353, 350, 905, 19077, 2133, 29898, 29885, 2932, 398, 29922, 29900, 29889, 29947, 5033, 29881, 29897, 13, 4706, 270, 353, 1281, 29894, 29906, 29928, 29898, 26705, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29881, 29897, 13, 4706, 270, 353, 350, 905, 19077, 2133, 29898, 29885, 2932, 398, 29922, 29900, 29889, 29947, 5033, 29881, 29897, 13, 4706, 270, 353, 3462, 580, 4197, 29881, 29892, 7546, 29918, 2080, 2314, 13, 4706, 736, 270, 13, 13, 1678, 10153, 29918, 29212, 29918, 262, 353, 10567, 29898, 12181, 7607, 29896, 29953, 29892, 29896, 29953, 29892, 29941, 876, 13, 1678, 10153, 29918, 18152, 457, 279, 353, 29871, 365, 2269, 29898, 2892, 1967, 29901, 15886, 29889, 3027, 29889, 21476, 29918, 8346, 29898, 3027, 22657, 29896, 29906, 29947, 29892, 29871, 29896, 29906, 29947, 511, 5696, 353, 15886, 29889, 3027, 29889, 1666, 675, 4062, 29889, 29933, 2965, 7466, 2965, 29892, 2520, 29918, 29883, 1398, 414, 353, 5852, 29892, 19905, 29918, 294, 1103, 29918, 3605, 601, 353, 5852, 876, 29898, 2492, 29918, 29212, 29918, 262, 29897, 29871, 13, 1678, 10153, 29918, 18152, 457, 279, 29918, 29953, 29946, 353, 29871, 365, 2269, 29898, 2892, 1967, 29901, 15886, 29889, 3027, 29889, 21476, 29918, 8346, 29898, 3027, 22657, 29953, 29946, 29892, 29871, 29953, 29946, 511, 5696, 353, 15886, 29889, 3027, 29889, 1666, 675, 4062, 29889, 29933, 2965, 7466, 2965, 29892, 2520, 29918, 29883, 1398, 414, 353, 5852, 29892, 19905, 29918, 294, 1103, 29918, 3605, 601, 353, 5852, 876, 29898, 2492, 29918, 29212, 29918, 262, 29897, 13, 1678, 10153, 29918, 18152, 457, 279, 29918, 29941, 29906, 353, 29871, 365, 2269, 29898, 2892, 1967, 29901, 15886, 29889, 3027, 29889, 21476, 29918, 8346, 29898, 3027, 22657, 29941, 29906, 29892, 29871, 29941, 29906, 511, 5696, 353, 15886, 29889, 3027, 29889, 1666, 675, 4062, 29889, 29933, 2965, 7466, 2965, 29892, 2520, 29918, 29883, 1398, 414, 353, 5852, 29892, 19905, 29918, 294, 1103, 29918, 3605, 601, 353, 5852, 876, 29898, 2492, 29918, 29212, 29918, 262, 29897, 13, 1678, 325, 1505, 29918, 22100, 353, 325, 1505, 29898, 2492, 29918, 18152, 457, 279, 29897, 13, 1678, 325, 1505, 29918, 22100, 29918, 29883, 15755, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 742, 978, 353, 376, 29894, 1505, 29918, 22100, 29918, 29883, 15755, 1159, 29898, 29894, 1505, 29918, 22100, 29897, 13, 13, 13, 1678, 10518, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 2492, 29918, 29212, 29918, 262, 29897, 13, 1678, 921, 353, 10995, 950, 29918, 1271, 29898, 15926, 29892, 29953, 29946, 29897, 13, 1678, 921, 353, 316, 20580, 29906, 29881, 29898, 29916, 29892, 1949, 29922, 29953, 29946, 29897, 13, 1678, 921, 17685, 353, 16125, 403, 4197, 29916, 29892, 29894, 1505, 29918, 22100, 29918, 29883, 15755, 1402, 8990, 10457, 29896, 29892, 978, 2433, 535, 29883, 2579, 362, 1495, 13, 1678, 10518, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29916, 17685, 29897, 13, 1678, 921, 353, 10995, 950, 29918, 1271, 29898, 15926, 29892, 29953, 29946, 29897, 13, 1678, 921, 29918, 449, 29918, 29941, 29906, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29916, 29897, 13, 1678, 921, 29918, 449, 29918, 29941, 29906, 353, 21775, 362, 877, 13161, 29882, 1495, 29898, 29916, 29918, 449, 29918, 29941, 29906, 29897, 13, 1678, 921, 29918, 29941, 29906, 29918, 1202, 353, 3462, 580, 4197, 29916, 29918, 449, 29918, 29941, 29906, 29892, 10153, 29918, 18152, 457, 279, 29918, 29941, 29906, 2314, 13, 1678, 921, 29918, 29941, 29906, 353, 21775, 362, 877, 13161, 29882, 1495, 29898, 29916, 29918, 29941, 29906, 29918, 1202, 29897, 13, 1678, 921, 353, 316, 20580, 29906, 29881, 29898, 29916, 29897, 13, 1678, 10518, 353, 1281, 29894, 29906, 29928, 29898, 29953, 29946, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29916, 29897, 13, 1678, 921, 353, 10995, 950, 29918, 1271, 29898, 15926, 29892, 29953, 29946, 29897, 13, 1678, 921, 29918, 449, 29918, 29953, 29946, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29916, 29897, 13, 1678, 921, 29918, 449, 29918, 29953, 29946, 353, 21775, 362, 877, 13161, 29882, 1495, 29898, 29916, 29918, 449, 29918, 29953, 29946, 29897, 13, 1678, 921, 29918, 29953, 29946, 29918, 1202, 353, 3462, 580, 4197, 29916, 29918, 449, 29918, 29953, 29946, 29892, 10153, 29918, 18152, 457, 279, 29918, 29953, 29946, 2314, 13, 1678, 921, 29918, 29953, 29946, 353, 21775, 362, 877, 13161, 29882, 1495, 29898, 29916, 29918, 29953, 29946, 29918, 1202, 29897, 13, 1678, 921, 353, 316, 20580, 29906, 29881, 29898, 29916, 29897, 13, 1678, 921, 353, 1281, 29894, 29906, 29928, 29898, 29941, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 851, 2247, 29922, 29896, 29892, 7164, 2433, 17642, 1495, 29898, 29916, 29897, 13, 1678, 921, 29918, 449, 29918, 1457, 353, 21775, 362, 877, 13161, 29882, 1495, 29898, 29916, 29897, 259, 13, 1678, 921, 29918, 449, 29918, 1202, 353, 3462, 580, 4197, 29916, 29918, 449, 29918, 1457, 29892, 10153, 29918, 18152, 457, 279, 2314, 13, 1678, 921, 29918, 449, 353, 21775, 362, 877, 13161, 29882, 1495, 29898, 29916, 29918, 449, 29918, 1202, 29897, 29871, 13, 268, 13, 1678, 736, 8125, 4197, 2492, 29918, 29212, 29918, 262, 16272, 29916, 29918, 449, 29892, 29916, 29918, 29953, 29946, 29892, 29916, 29918, 29941, 29906, 2314, 13, 268, 13, 268, 13, 29937, 2048, 322, 6633, 278, 15299, 13, 27959, 353, 2048, 29918, 27959, 580, 13, 2158, 877, 24647, 1001, 1299, 1955, 29901, 1495, 13, 27959, 29889, 7727, 580, 13, 29937, 27959, 29889, 1359, 29918, 705, 5861, 877, 8346, 29918, 4345, 29954, 29914, 29893, 1885, 29953, 29946, 29900, 29900, 29889, 29882, 29945, 1495, 13, 27959, 29889, 12198, 29898, 6758, 2433, 19541, 29918, 19128, 296, 14441, 742, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 13, 4299, 29918, 3126, 353, 15299, 29889, 517, 29918, 3126, 580, 13, 2541, 1722, 703, 4299, 29889, 3126, 613, 376, 29893, 1159, 408, 4390, 29918, 1445, 29901, 13, 1678, 4390, 29918, 1445, 29889, 3539, 29898, 4299, 29918, 3126, 29897, 13, 13, 4299, 29918, 3126, 353, 15299, 29889, 517, 29918, 3126, 580, 13, 2541, 1722, 703, 4299, 29889, 3126, 613, 376, 29893, 1159, 408, 4390, 29918, 1445, 29901, 13, 1678, 4390, 29918, 1445, 29889, 3539, 29898, 4299, 29918, 3126, 29897, 13, 13, 29937, 8343, 292, 11462, 304, 15299, 13, 29920, 353, 10567, 29898, 12181, 7607, 29896, 29953, 29892, 29896, 29953, 29892, 29941, 876, 13, 2492, 29888, 353, 15299, 29898, 29920, 29897, 13, 29888, 1296, 29918, 22100, 353, 325, 1505, 29898, 2492, 29888, 29961, 29900, 2314, 13, 29888, 1296, 29918, 22100, 29918, 29896, 353, 325, 1505, 29953, 29946, 29898, 2492, 29888, 29961, 29896, 2314, 13, 29888, 1296, 29918, 22100, 29918, 29906, 353, 325, 1505, 29941, 29906, 29898, 2492, 29888, 29961, 29906, 2314, 13, 13, 13, 29937, 363, 278, 12420, 1904, 591, 674, 871, 7945, 278, 15299, 13, 2218, 29883, 20386, 1061, 29889, 14968, 519, 353, 7700, 13, 13, 29937, 1018, 304, 2313, 5632, 16976, 5759, 4558, 13, 3084, 353, 2313, 20386, 1061, 29898, 2492, 29888, 29897, 13, 13, 29937, 278, 12420, 1904, 313, 1429, 287, 15299, 322, 2313, 20386, 1061, 29897, 4893, 13, 29937, 11462, 408, 1881, 1149, 16785, 4558, 1149, 3683, 1475, 2854, 537, 29871, 13, 17743, 1312, 353, 8125, 29898, 29920, 29892, 518, 3084, 29892, 29888, 1296, 29918, 22100, 29892, 29888, 1296, 29918, 22100, 29918, 29896, 29892, 29888, 1296, 29918, 22100, 29918, 29906, 2314, 13, 2158, 877, 3217, 9486, 1177, 3352, 29901, 1495, 13, 17743, 1312, 29889, 7727, 580, 13, 17743, 1312, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 742, 525, 29885, 344, 742, 525, 29885, 344, 7464, 29871, 13, 462, 6410, 29918, 705, 5861, 11759, 29941, 29872, 29899, 29941, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 29892, 29900, 29889, 29900, 29900, 29896, 29892, 29896, 1402, 13, 462, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 13, 13, 29937, 6410, 1819, 363, 4340, 6492, 1259, 13, 29928, 29918, 29931, 29918, 1525, 1964, 353, 5159, 13, 29928, 29918, 29931, 29918, 4519, 6059, 353, 5159, 13, 29928, 29918, 29931, 353, 5159, 13, 29928, 29918, 2477, 29907, 353, 5159, 13, 29954, 29918, 29931, 353, 5159, 13, 13, 1753, 7945, 29898, 24713, 29918, 3257, 29892, 21502, 12168, 29892, 9853, 29918, 2311, 29922, 29941, 29906, 29892, 4078, 29918, 19207, 29922, 29945, 29900, 1125, 13, 4706, 1369, 29918, 2230, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 4706, 4203, 29918, 16175, 353, 938, 29898, 16175, 29918, 2311, 847, 29871, 29906, 29897, 13, 13, 4706, 363, 21502, 305, 297, 3464, 29898, 29900, 29892, 29945, 29900, 29900, 29900, 29900, 1125, 13, 9651, 14550, 13, 12, 12, 12, 29937, 14470, 573, 1334, 523, 365, 2209, 2087, 5143, 358, 13, 9651, 565, 21502, 305, 1275, 29871, 29953, 29900, 29900, 29901, 13, 18884, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 7464, 29871, 13, 462, 6410, 29918, 705, 5861, 11759, 29896, 29872, 29899, 29906, 29892, 29871, 29896, 1402, 13, 462, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 268, 13, 9651, 396, 448, 2683, 807, 13, 9651, 565, 21502, 305, 1275, 29871, 29896, 29945, 29900, 29900, 29901, 13, 18884, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 7464, 29871, 13, 462, 6410, 29918, 705, 5861, 11759, 29896, 29872, 29899, 29896, 29892, 29871, 29896, 1402, 13, 462, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 29871, 13, 9651, 565, 21502, 305, 1275, 29871, 29906, 29945, 29900, 29900, 29901, 13, 18884, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 7464, 29871, 13, 462, 6410, 29918, 705, 5861, 11759, 29896, 29872, 29899, 29906, 29892, 29871, 29896, 1402, 13, 462, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 13, 9651, 565, 21502, 305, 1275, 29871, 29941, 29945, 29900, 29900, 29901, 13, 18884, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 7464, 29871, 13, 462, 6410, 29918, 705, 5861, 11759, 29896, 29872, 29899, 29896, 29892, 29871, 29896, 1402, 13, 462, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 259, 13, 9651, 14550, 13, 9651, 396, 29871, 28186, 8565, 20386, 1061, 13, 9651, 396, 448, 2683, 807, 13, 13, 9651, 396, 1831, 263, 4036, 4203, 9853, 310, 4558, 13, 9651, 527, 3174, 29918, 1092, 29892, 527, 3174, 29918, 29212, 29892, 527, 3174, 29918, 29941, 29906, 29892, 527, 3174, 29918, 29953, 29946, 353, 848, 29918, 12657, 29889, 1359, 29918, 1272, 29898, 24498, 29918, 16175, 29897, 13, 13, 13, 9651, 396, 5706, 263, 4203, 9853, 310, 716, 4558, 13, 9651, 2531, 29918, 2492, 29879, 353, 15299, 29889, 27711, 29898, 2492, 29879, 29918, 29212, 29897, 13, 13, 9651, 396, 7945, 278, 2313, 20386, 1061, 491, 8343, 292, 1716, 1855, 322, 25713, 313, 13525, 29897, 4558, 697, 491, 697, 13, 9651, 270, 29918, 6758, 29918, 6370, 353, 2313, 20386, 1061, 29889, 14968, 29918, 265, 29918, 16175, 4197, 2492, 29879, 29918, 1092, 29892, 2492, 29879, 29918, 29953, 29946, 29892, 2492, 29879, 29918, 29941, 29906, 1402, 7442, 29889, 8172, 29889, 29590, 29898, 677, 29922, 29900, 29889, 29947, 29892, 1880, 29922, 29896, 29889, 29906, 29892, 2159, 7607, 24498, 29918, 16175, 29892, 29871, 29906, 29945, 29892, 29906, 29945, 4961, 396, 29871, 29900, 29889, 29929, 363, 3858, 1560, 29877, 6046, 13, 9651, 270, 29918, 6758, 29918, 29888, 1296, 353, 2313, 20386, 1061, 29889, 14968, 29918, 265, 29918, 16175, 29898, 1885, 29918, 2492, 29879, 29892, 7442, 29889, 8172, 29889, 29590, 29898, 677, 29922, 29900, 29889, 29900, 29892, 1880, 29922, 29900, 29889, 29941, 29892, 2159, 7607, 24498, 29918, 16175, 29892, 29871, 29906, 29945, 29892, 29906, 29945, 4961, 13, 9651, 270, 29918, 6758, 353, 29871, 29900, 29889, 29945, 334, 7442, 29889, 1202, 29898, 29881, 29918, 6758, 29918, 6370, 29892, 270, 29918, 6758, 29918, 29888, 1296, 29897, 13, 13, 13, 9651, 396, 448, 2683, 807, 13, 9651, 396, 29871, 28186, 3251, 1061, 13, 9651, 396, 448, 2683, 807, 13, 13, 13, 9651, 527, 3174, 29918, 1092, 29892, 527, 3174, 29918, 29212, 29892, 527, 3174, 29918, 29941, 29906, 29892, 527, 3174, 29918, 29953, 29946, 353, 848, 29918, 12657, 29889, 1359, 29918, 1272, 29898, 16175, 29918, 2311, 29897, 13, 9651, 396, 278, 15299, 10753, 278, 2313, 20386, 1061, 304, 3858, 278, 5759, 11916, 13, 9651, 396, 408, 2854, 313, 2873, 29897, 13, 9651, 1967, 29918, 22100, 353, 325, 1505, 29889, 27711, 29898, 2492, 29879, 29918, 1092, 29897, 13, 9651, 1967, 29918, 22100, 29918, 29896, 353, 325, 1505, 29953, 29946, 29889, 27711, 29898, 2492, 29879, 29918, 29953, 29946, 29897, 13, 9651, 1967, 29918, 22100, 29918, 29906, 353, 325, 1505, 29941, 29906, 29889, 27711, 29898, 2492, 29879, 29918, 29941, 29906, 29897, 13, 13, 9651, 396, 7945, 278, 15299, 13, 9651, 330, 29918, 6758, 353, 12420, 29889, 14968, 29918, 265, 29918, 16175, 29898, 2492, 29879, 29918, 29212, 29892, 518, 9302, 29889, 2873, 3552, 16175, 29918, 2311, 29892, 29906, 29945, 29892, 29906, 29945, 8243, 3027, 29918, 22100, 29892, 3027, 29918, 22100, 29918, 29896, 29892, 3027, 29918, 22100, 29918, 29906, 2314, 13, 9651, 560, 28170, 29918, 2230, 353, 12865, 29889, 12673, 29889, 3707, 580, 448, 1369, 29918, 2230, 13, 632, 13, 9651, 396, 18399, 278, 6728, 13, 9651, 1596, 4852, 29995, 29881, 931, 29901, 1273, 29879, 1919, 29961, 29928, 6410, 29901, 1273, 29888, 29892, 1035, 4898, 18695, 29906, 29888, 7686, 29962, 518, 29954, 6410, 29901, 1273, 29888, 18017, 1273, 313, 1022, 2878, 29892, 295, 28170, 29918, 2230, 29892, 270, 29918, 6758, 29892, 29871, 29896, 29900, 29900, 29930, 29881, 29918, 6758, 29892, 330, 29918, 6758, 29961, 29900, 12622, 13, 9651, 360, 29918, 29931, 29918, 1525, 1964, 29889, 4397, 29898, 29881, 29918, 6758, 29918, 6370, 29897, 13, 9651, 360, 29918, 29931, 29918, 4519, 6059, 29889, 4397, 29898, 29881, 29918, 6758, 29918, 29888, 1296, 29897, 13, 9651, 360, 29918, 29931, 29889, 4397, 29898, 29881, 29918, 6758, 29897, 13, 9651, 360, 29918, 2477, 29907, 29889, 4397, 29898, 29881, 29918, 6758, 29897, 13, 9651, 402, 29918, 29931, 29889, 4397, 29898, 29887, 29918, 6758, 29897, 13, 13, 9651, 396, 565, 472, 4078, 7292, 1149, 4078, 5759, 1967, 11916, 13, 9651, 565, 21502, 305, 1273, 4078, 29918, 19207, 1275, 29871, 29900, 29901, 13, 18884, 4559, 29918, 8346, 29898, 1022, 2878, 29897, 13, 18884, 15299, 29889, 7620, 29918, 705, 5861, 703, 8346, 29918, 4345, 29954, 29914, 29893, 1885, 29995, 29881, 29889, 29882, 29945, 29908, 1273, 313, 1022, 2878, 876, 13, 18884, 2313, 20386, 1061, 29889, 7620, 29918, 705, 5861, 703, 8346, 29918, 4345, 29954, 29914, 29893, 2218, 29995, 29881, 29889, 29882, 29945, 29908, 1273, 313, 1022, 2878, 876, 13, 13, 1753, 4559, 29918, 8346, 29898, 1022, 2878, 1125, 13, 1678, 2897, 29889, 29885, 12535, 12935, 877, 8346, 29918, 4345, 29954, 22584, 29879, 29915, 1273, 8783, 29918, 978, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 1678, 364, 29892, 274, 353, 29871, 29906, 29892, 29871, 29945, 13, 13, 1678, 527, 3174, 29918, 1092, 29892, 527, 3174, 29918, 29212, 29892, 3383, 29918, 353, 848, 29918, 12657, 29889, 1359, 29918, 1272, 29898, 16175, 29918, 2311, 29922, 29906, 29892, 338, 29918, 13424, 29922, 5574, 29897, 13, 1678, 25713, 29918, 1092, 353, 15299, 29889, 27711, 29898, 2492, 29879, 29918, 29212, 29897, 13, 1678, 527, 3174, 29918, 1092, 29918, 262, 29886, 353, 527, 3174, 29918, 1092, 13, 1678, 527, 3174, 29918, 29212, 29918, 262, 29886, 353, 527, 3174, 29918, 29212, 13, 1678, 396, 2538, 29883, 744, 4558, 29871, 29900, 448, 29871, 29896, 13, 1678, 527, 3174, 29918, 29212, 353, 29871, 29900, 29889, 29945, 334, 527, 3174, 29918, 29212, 718, 29871, 29900, 29889, 29945, 13, 1678, 25713, 29918, 1092, 29961, 29900, 29962, 353, 29871, 29900, 29889, 29945, 334, 25713, 29918, 1092, 29961, 29900, 29962, 718, 29871, 29900, 29889, 29945, 13, 1678, 25713, 29918, 1092, 29961, 29896, 29962, 353, 29871, 29900, 29889, 29945, 334, 25713, 29918, 1092, 29961, 29896, 29962, 718, 29871, 29900, 29889, 29945, 13, 1678, 25713, 29918, 1092, 29961, 29906, 29962, 353, 29871, 29900, 29889, 29945, 334, 25713, 29918, 1092, 29961, 29906, 29962, 718, 29871, 29900, 29889, 29945, 13, 1678, 527, 3174, 29918, 1092, 353, 29871, 29900, 29889, 29945, 334, 527, 3174, 29918, 1092, 718, 29871, 29900, 29889, 29945, 13, 13, 1678, 396, 16913, 5759, 4558, 322, 278, 1880, 10104, 2441, 29879, 13, 1678, 17735, 353, 6024, 26036, 3788, 29896, 29906, 29947, 29916, 29896, 29906, 29947, 2033, 13, 1678, 2537, 29892, 4853, 29879, 353, 14770, 29889, 1491, 26762, 29898, 29878, 29892, 274, 29897, 13, 1678, 274, 593, 353, 29871, 29900, 13, 1678, 363, 1948, 297, 3464, 29898, 29878, 1125, 13, 4706, 363, 784, 29892, 1967, 297, 26985, 4197, 2492, 29879, 29918, 1092, 29892, 29888, 1296, 29918, 1092, 29961, 29900, 5262, 1125, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29941, 1822, 326, 4294, 29898, 2492, 29879, 29918, 29212, 29961, 798, 2314, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29906, 1822, 326, 4294, 29898, 29888, 1296, 29918, 1092, 29961, 29906, 3816, 798, 2314, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29896, 1822, 326, 4294, 29898, 29888, 1296, 29918, 1092, 29961, 29896, 3816, 798, 2314, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 1822, 326, 4294, 29898, 3027, 29961, 798, 2314, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29896, 1822, 842, 29918, 3257, 877, 29953, 29946, 29916, 29953, 29946, 1495, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29906, 1822, 842, 29918, 3257, 877, 29941, 29906, 29916, 29941, 29906, 1495, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29941, 1822, 842, 29918, 3257, 877, 2080, 1495, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 1822, 842, 29918, 3257, 29898, 23545, 793, 29961, 1054, 2314, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 1822, 8990, 877, 2696, 1495, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29896, 1822, 8990, 877, 2696, 1495, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29906, 1822, 8990, 877, 2696, 1495, 13, 9651, 4853, 29879, 29961, 798, 29892, 784, 29974, 29941, 1822, 8990, 877, 2696, 1495, 13, 4706, 274, 593, 4619, 29871, 29896, 13, 1678, 13872, 353, 4852, 567, 22230, 353, 1273, 29888, 448, 269, 3601, 353, 1273, 29888, 29908, 1273, 313, 497, 29918, 567, 22230, 29898, 29888, 1296, 29918, 1092, 29961, 29900, 1402, 2492, 29879, 29918, 1092, 511, 599, 29918, 893, 326, 29898, 29888, 1296, 29918, 1092, 29961, 29900, 1402, 2492, 29879, 29918, 1092, 4961, 13, 1678, 2537, 29889, 726, 11891, 29945, 29892, 869, 29900, 29945, 29892, 13872, 29892, 447, 2433, 5064, 1495, 13, 1678, 2537, 29889, 7620, 1003, 703, 8346, 29918, 4345, 29954, 22584, 29879, 22584, 29881, 29889, 2732, 29908, 1273, 313, 24713, 29918, 978, 29892, 21502, 305, 876, 13, 1678, 14770, 29889, 5358, 580, 13, 13, 1678, 396, 16913, 4482, 10104, 4558, 363, 10230, 13, 1678, 363, 474, 297, 3464, 29898, 29878, 1125, 13, 4706, 2537, 353, 14770, 29889, 4532, 580, 13, 4706, 14770, 29889, 326, 4294, 29898, 2492, 29879, 29918, 29212, 29961, 29875, 2314, 13, 4706, 2537, 29889, 7620, 1003, 877, 8346, 29918, 4345, 29954, 22584, 29879, 22584, 29881, 29918, 677, 690, 29995, 29881, 29889, 2732, 29915, 1273, 313, 24713, 29918, 978, 29892, 21502, 305, 29892, 474, 876, 13, 4706, 14770, 29889, 5358, 580, 13, 268, 13, 1678, 1596, 29898, 497, 29918, 567, 22230, 29898, 29888, 1296, 29918, 1092, 29961, 29900, 1402, 2492, 29879, 29918, 1092, 876, 13, 1678, 1596, 29898, 497, 29918, 893, 326, 29898, 29888, 1296, 29918, 1092, 29961, 29900, 1402, 2492, 29879, 29918, 1092, 876, 13, 1678, 565, 21502, 305, 29966, 29945, 29900, 29900, 29900, 322, 21502, 305, 29958, 29896, 29900, 29900, 29900, 29901, 13, 4706, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 742, 525, 29885, 344, 742, 525, 29885, 344, 7464, 29871, 13, 462, 308, 6410, 29918, 705, 5861, 11759, 29941, 29872, 29899, 29941, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 22657, 1022, 2878, 448, 29871, 29929, 29929, 29929, 6802, 29946, 29900, 29900, 29900, 29892, 29896, 1402, 13, 462, 308, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 965, 13, 308, 13, 1678, 565, 21502, 305, 29966, 29896, 29900, 29900, 29900, 29900, 322, 21502, 305, 29958, 29945, 29900, 29900, 29900, 29901, 13, 4706, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 742, 525, 29885, 344, 742, 525, 29885, 344, 7464, 29871, 13, 462, 308, 6410, 29918, 705, 5861, 11759, 29941, 29872, 29899, 29941, 29892, 313, 1022, 2878, 448, 29871, 29946, 29929, 29929, 29929, 6802, 29945, 29900, 29900, 29900, 29892, 29896, 29892, 29896, 1402, 13, 462, 308, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 13, 1678, 565, 21502, 305, 29966, 29896, 29945, 29900, 29900, 29900, 322, 21502, 305, 29958, 29896, 29900, 29900, 29900, 29900, 29901, 13, 4706, 12420, 29889, 12198, 29898, 6758, 29922, 1839, 19541, 29918, 19128, 296, 14441, 742, 525, 29885, 344, 742, 525, 29885, 344, 742, 525, 29885, 344, 7464, 29871, 13, 462, 308, 6410, 29918, 705, 5861, 11759, 29941, 29872, 29899, 29941, 718, 29871, 29906, 29872, 29899, 29941, 16395, 1022, 2878, 448, 29871, 29929, 29929, 29929, 29929, 6802, 29945, 29900, 29900, 29900, 29892, 29871, 29896, 29892, 29896, 29892, 29896, 1402, 13, 462, 308, 5994, 3950, 29922, 3253, 314, 29898, 29900, 29889, 29900, 29900, 29900, 29906, 29892, 29871, 29900, 29889, 29945, 876, 13, 13, 1678, 736, 527, 3174, 29918, 29212, 29918, 262, 29886, 29892, 2492, 29879, 29918, 1092, 29918, 262, 29886, 13, 13, 18434, 353, 7945, 877, 29883, 361, 279, 29896, 29900, 742, 21502, 12168, 29922, 29941, 29900, 29900, 29900, 29900, 29892, 9853, 29918, 2311, 29922, 29941, 29906, 29892, 4078, 29918, 19207, 29922, 29945, 29900, 29897, 13, 29937, 27959, 29889, 7620, 877, 23521, 391, 29918, 4299, 29889, 29882, 29945, 1495, 13, 29937, 27959, 29889, 7620, 877, 29883, 361, 279, 29896, 29900, 29918, 4299, 29889, 29882, 29945, 1495, 13, 13, 13, 572, 29873, 29889, 5317, 29898, 29928, 29918, 29931, 29897, 13, 572, 29873, 29889, 3257, 877, 4205, 29883, 20386, 1061, 2582, 313, 29924, 29940, 9047, 29897, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 29923, 1129, 12168, 1495, 13, 572, 29873, 29889, 29891, 1643, 877, 4205, 29883, 20386, 1061, 365, 2209, 313, 9539, 511, 8565, 20386, 1061, 4831, 332, 4135, 313, 272, 927, 29897, 1495, 13, 572, 29873, 29889, 26172, 18959, 4205, 29883, 20386, 1061, 365, 2209, 742, 525, 4205, 29883, 20386, 1061, 4831, 332, 4135, 11287, 13, 572, 29873, 29889, 4294, 580, 13, 13, 13, 13, 572, 29873, 29889, 5317, 29898, 29954, 29918, 29931, 29897, 13, 572, 29873, 29889, 3257, 877, 21575, 2582, 313, 29924, 29940, 9047, 29897, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 29923, 1129, 12168, 1495, 13, 572, 29873, 29889, 29891, 1643, 877, 21575, 365, 2209, 313, 9539, 29897, 1495, 13, 572, 29873, 29889, 26172, 877, 21575, 365, 2209, 1495, 13, 572, 29873, 29889, 4294, 580, 13, 13, 13, 572, 29873, 29889, 5317, 29898, 29928, 29918, 29931, 29897, 13, 572, 29873, 29889, 3257, 877, 4205, 29883, 20386, 1061, 2582, 313, 29907, 6545, 1718, 29896, 29900, 29897, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 29923, 1129, 12168, 1495, 13, 572, 29873, 29889, 29891, 1643, 877, 4205, 29883, 20386, 1061, 365, 2209, 313, 9539, 511, 8565, 20386, 1061, 4831, 332, 4135, 313, 272, 927, 29897, 1495, 13, 572, 29873, 29889, 26172, 18959, 4205, 29883, 20386, 1061, 365, 2209, 742, 525, 4205, 29883, 20386, 1061, 4831, 332, 4135, 11287, 13, 572, 29873, 29889, 4294, 580, 13, 13, 572, 29873, 29889, 5317, 29898, 29954, 29918, 29931, 29897, 13, 572, 29873, 29889, 3257, 877, 21575, 2582, 313, 29907, 6545, 1718, 29896, 29900, 29897, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 29923, 1129, 12168, 1495, 13, 572, 29873, 29889, 29891, 1643, 877, 21575, 365, 2209, 313, 9539, 29897, 1495, 13, 572, 29873, 29889, 26172, 877, 21575, 365, 2209, 1495, 13, 572, 29873, 29889, 4294, 580, 13, 13, 2 ]
monolithic/order_transaction.py
liks79/sample-saga-with-step-functions
3
31659
<reponame>liks79/sample-saga-with-step-functions """ Database model for Monolithic application ~~~~~~~~~~~~~~~~~~~~~~~ :created date: Thursday, March 12, 2020 :description: Monolithic application implementation of simple order transaction scenario :copyright: © 2020 written by sungshik (<EMAIL>) :license: BSD 3-Clause License, see LICENSE for more details. """ import config import traceback from model import db from model.user import User from model.order import Order from model.membership import Membership from model.payment import Payment from model.inventory import Inventory from faker import Faker from pprint import pformat from sqlalchemy_utc import utcnow from exception import OutOfStockError, PaymentFailureError fake = Faker(config.FAKER_LOCALE) logger = config.logger try: """ Data Preparation """ # Create tables, if it is not existed. db.Base.metadata.create_all(bind=db.engine) # T0.TRANSACTION BEGIN # Transaction is already begun by SQLalchemy logger.info('#### T0.TRANSACTION BEGIN ####') # T1.Initiate User model logger.info('#### T1.INITIATE USER MODEL ####') user = db.session.query(User).first() logger.info(pformat(user.to_json())) # T2.Initiate Inventory model logger.info('#### T2.INITIATE INVENTORY MODEL ####') item = db.session.query(Inventory).first() logger.info(pformat(item.to_json())) # T3.Initiate Payment model logger.info('#### T3.INITIATE PAYMENT MODEL ####') payment = Payment(pay_type='credit_card', user_id=user.user_id, allowed=fake.boolean(), date=utcnow()) logger.info(pformat(payment.to_json())) db.session.add(payment) # db.session.commit() # T4.Initiate Order model logger.info('#### T4.INITIATE ORDER MODEL ####') ordered_item_qty = fake.random_int(1, 100) order = Order(user_id=user.user_id, item_id=item.item_id, item_qty=ordered_item_qty, date=utcnow(), deliver_phone=fake.phone_number(), deliver_address=fake.address(), total_price=fake.random_int(100, 1000000)) logger.info(pformat(order.to_json())) db.session.add(order) # db.session.commit() # T5.Update Inventory model logger.info('#### T5.UPDATE INVENTORY MODEL ####') logger.info('UPDATE INVENTORY QTY: {} - {} = {}'. format(item.qty, ordered_item_qty, item.qty - ordered_item_qty)) item.qty = item.qty - ordered_item_qty # T6.Update Membership model membership = Membership(user_id=user.user_id, date=utcnow(), mileage=fake.random_int(10, 400)) db.session.add(membership) logger.info('#### T6.UPDATE MEMBERSHIP ####') logger.info(pformat(membership.to_json())) # OutOfStockError Exception handling logger.info(pformat(item.to_json())) if item.qty < 0: logger.error('ORDERED ITEM IS OUT OF STOCK: %s' % item.qty) logger.error('THIS IS AN INTENDED ERROR.') raise OutOfStockError # PaymentFailureError Exception handling logger.info(pformat(payment.to_json())) if payment.allowed is not True: logger.error('PAYMENT TRANSACTION IS FAILED: %s' % payment.allowed) logger.error('THIS IS AN INTENDED ERROR.') raise PaymentFailureError # T7.Commit db.session.commit() logger.info('#### T7.TRANSACTION COMPLETED! ####') except Exception as e: logger.error(e) print(traceback.format_exc()) db.session.rollback() finally: db.session.close()
[ 1, 529, 276, 1112, 420, 29958, 492, 2039, 29955, 29929, 29914, 11249, 29899, 29879, 7781, 29899, 2541, 29899, 10568, 29899, 12171, 13, 15945, 29908, 13, 1678, 5470, 1904, 363, 2598, 324, 389, 293, 2280, 13, 1678, 3695, 26594, 26594, 14087, 7377, 13, 13, 1678, 584, 11600, 2635, 29901, 498, 1295, 3250, 29892, 4779, 29871, 29896, 29906, 29892, 29871, 29906, 29900, 29906, 29900, 13, 1678, 584, 8216, 29901, 2598, 324, 389, 293, 2280, 5314, 310, 2560, 1797, 10804, 10483, 13, 1678, 584, 8552, 1266, 29901, 29871, 30211, 29871, 29906, 29900, 29906, 29900, 3971, 491, 269, 686, 845, 638, 313, 29966, 26862, 6227, 12948, 13, 1678, 584, 506, 1947, 29901, 350, 7230, 29871, 29941, 29899, 20216, 1509, 19245, 29892, 1074, 365, 2965, 1430, 1660, 363, 901, 4902, 29889, 13, 15945, 29908, 13, 5215, 2295, 13, 5215, 9637, 1627, 13, 3166, 1904, 1053, 4833, 13, 3166, 1904, 29889, 1792, 1053, 4911, 13, 3166, 1904, 29889, 2098, 1053, 8170, 13, 3166, 1904, 29889, 29885, 1590, 10475, 1053, 341, 1590, 10475, 13, 3166, 1904, 29889, 27825, 1053, 14617, 358, 13, 3166, 1904, 29889, 262, 23886, 1053, 512, 23886, 13, 3166, 285, 5790, 1053, 383, 5790, 13, 3166, 282, 2158, 1053, 282, 4830, 13, 3166, 4576, 284, 305, 6764, 29918, 329, 29883, 1053, 3477, 29883, 3707, 13, 3166, 3682, 1053, 4451, 2776, 20754, 384, 2392, 29892, 14617, 358, 24155, 2392, 13, 13, 29888, 1296, 353, 383, 5790, 29898, 2917, 29889, 4519, 29968, 1001, 29918, 3927, 5454, 1307, 29897, 13, 21707, 353, 2295, 29889, 21707, 13, 13, 2202, 29901, 13, 1678, 9995, 3630, 4721, 862, 362, 9995, 13, 1678, 396, 6204, 6131, 29892, 565, 372, 338, 451, 22856, 29889, 13, 1678, 4833, 29889, 5160, 29889, 19635, 29889, 3258, 29918, 497, 29898, 5355, 29922, 2585, 29889, 10599, 29897, 13, 13, 1678, 396, 323, 29900, 29889, 26813, 8132, 9838, 22815, 13, 1678, 396, 4103, 2467, 338, 2307, 23580, 491, 3758, 284, 305, 6764, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29900, 29889, 26813, 8132, 9838, 22815, 3191, 1495, 13, 13, 1678, 396, 323, 29896, 29889, 797, 4812, 403, 4911, 1904, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29896, 29889, 26019, 29902, 3040, 3148, 1001, 16999, 2287, 29931, 3191, 1495, 13, 1678, 1404, 353, 4833, 29889, 7924, 29889, 1972, 29898, 2659, 467, 4102, 580, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 1792, 29889, 517, 29918, 3126, 22130, 13, 13, 1678, 396, 323, 29906, 29889, 797, 4812, 403, 512, 23886, 1904, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29906, 29889, 26019, 29902, 3040, 2672, 29963, 3919, 18929, 16999, 2287, 29931, 3191, 1495, 13, 1678, 2944, 353, 4833, 29889, 7924, 29889, 1972, 29898, 797, 23886, 467, 4102, 580, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 667, 29889, 517, 29918, 3126, 22130, 13, 13, 1678, 396, 323, 29941, 29889, 797, 4812, 403, 14617, 358, 1904, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29941, 29889, 26019, 29902, 3040, 17687, 29979, 13780, 16999, 2287, 29931, 3191, 1495, 13, 1678, 19179, 353, 14617, 358, 29898, 10472, 29918, 1853, 2433, 11944, 277, 29918, 7543, 742, 13, 462, 418, 1404, 29918, 333, 29922, 1792, 29889, 1792, 29918, 333, 29892, 13, 462, 418, 6068, 29922, 29888, 1296, 29889, 20054, 3285, 13, 462, 418, 2635, 29922, 329, 29883, 3707, 3101, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 27825, 29889, 517, 29918, 3126, 22130, 13, 1678, 4833, 29889, 7924, 29889, 1202, 29898, 27825, 29897, 13, 1678, 396, 4833, 29889, 7924, 29889, 15060, 580, 13, 13, 1678, 396, 323, 29946, 29889, 797, 4812, 403, 8170, 1904, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29946, 29889, 26019, 29902, 3040, 15606, 16999, 2287, 29931, 3191, 1495, 13, 1678, 10372, 29918, 667, 29918, 29939, 1017, 353, 25713, 29889, 8172, 29918, 524, 29898, 29896, 29892, 29871, 29896, 29900, 29900, 29897, 13, 1678, 1797, 353, 8170, 29898, 1792, 29918, 333, 29922, 1792, 29889, 1792, 29918, 333, 29892, 13, 462, 29871, 2944, 29918, 333, 29922, 667, 29889, 667, 29918, 333, 29892, 13, 462, 29871, 2944, 29918, 29939, 1017, 29922, 21693, 29918, 667, 29918, 29939, 1017, 29892, 13, 462, 29871, 2635, 29922, 329, 29883, 3707, 3285, 13, 462, 29871, 12021, 29918, 6710, 29922, 29888, 1296, 29889, 6710, 29918, 4537, 3285, 13, 462, 29871, 12021, 29918, 7328, 29922, 29888, 1296, 29889, 7328, 3285, 13, 462, 29871, 3001, 29918, 9175, 29922, 29888, 1296, 29889, 8172, 29918, 524, 29898, 29896, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 876, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 2098, 29889, 517, 29918, 3126, 22130, 13, 1678, 4833, 29889, 7924, 29889, 1202, 29898, 2098, 29897, 13, 1678, 396, 4833, 29889, 7924, 29889, 15060, 580, 13, 13, 1678, 396, 323, 29945, 29889, 6422, 512, 23886, 1904, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29945, 29889, 14474, 2672, 29963, 3919, 18929, 16999, 2287, 29931, 3191, 1495, 13, 1678, 17927, 29889, 3888, 877, 14474, 2672, 29963, 3919, 18929, 660, 15631, 29901, 6571, 448, 6571, 353, 6571, 4286, 13, 18884, 3402, 29898, 667, 29889, 29939, 1017, 29892, 10372, 29918, 667, 29918, 29939, 1017, 29892, 2944, 29889, 29939, 1017, 448, 10372, 29918, 667, 29918, 29939, 1017, 876, 13, 1678, 2944, 29889, 29939, 1017, 353, 2944, 29889, 29939, 1017, 448, 10372, 29918, 667, 29918, 29939, 1017, 13, 13, 1678, 396, 323, 29953, 29889, 6422, 341, 1590, 10475, 1904, 13, 1678, 28512, 353, 341, 1590, 10475, 29898, 1792, 29918, 333, 29922, 1792, 29889, 1792, 29918, 333, 29892, 13, 462, 9651, 2635, 29922, 329, 29883, 3707, 3285, 13, 462, 9651, 17967, 482, 29922, 29888, 1296, 29889, 8172, 29918, 524, 29898, 29896, 29900, 29892, 29871, 29946, 29900, 29900, 876, 13, 1678, 4833, 29889, 7924, 29889, 1202, 29898, 29885, 1590, 10475, 29897, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29953, 29889, 14474, 22986, 9486, 1001, 7068, 5690, 3191, 1495, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 29885, 1590, 10475, 29889, 517, 29918, 3126, 22130, 13, 13, 1678, 396, 4451, 2776, 20754, 384, 2392, 8960, 11415, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 667, 29889, 517, 29918, 3126, 22130, 13, 1678, 565, 2944, 29889, 29939, 1017, 529, 29871, 29900, 29901, 13, 4706, 17927, 29889, 2704, 877, 22364, 3352, 306, 4330, 29924, 8519, 19474, 8079, 317, 4986, 7077, 29901, 1273, 29879, 29915, 1273, 2944, 29889, 29939, 1017, 29897, 13, 4706, 17927, 29889, 2704, 877, 4690, 3235, 8519, 13764, 19578, 1430, 2287, 29928, 14431, 29889, 1495, 13, 4706, 12020, 4451, 2776, 20754, 384, 2392, 13, 13, 1678, 396, 14617, 358, 24155, 2392, 8960, 11415, 13, 1678, 17927, 29889, 3888, 29898, 29886, 4830, 29898, 27825, 29889, 517, 29918, 3126, 22130, 13, 1678, 565, 19179, 29889, 24622, 338, 451, 5852, 29901, 13, 4706, 17927, 29889, 2704, 877, 7228, 29979, 13780, 10014, 2190, 8132, 9838, 8519, 13515, 29902, 20566, 29901, 1273, 29879, 29915, 1273, 19179, 29889, 24622, 29897, 13, 4706, 17927, 29889, 2704, 877, 4690, 3235, 8519, 13764, 19578, 1430, 2287, 29928, 14431, 29889, 1495, 13, 4706, 12020, 14617, 358, 24155, 2392, 13, 13, 1678, 396, 323, 29955, 29889, 1523, 2415, 13, 1678, 4833, 29889, 7924, 29889, 15060, 580, 13, 1678, 17927, 29889, 3888, 877, 4136, 323, 29955, 29889, 26813, 8132, 9838, 4810, 3580, 1307, 29911, 3352, 29991, 3191, 1495, 13, 13, 19499, 8960, 408, 321, 29901, 13, 1678, 17927, 29889, 2704, 29898, 29872, 29897, 13, 1678, 1596, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 1678, 4833, 29889, 7924, 29889, 1245, 1627, 580, 13, 13, 4951, 635, 29901, 13, 1678, 4833, 29889, 7924, 29889, 5358, 580, 13, 2 ]
reaver/utils/experiment.py
XinyiYS/reaver
0
1612175
<filename>reaver/utils/experiment.py import os import gin import json from datetime import datetime as dt class Experiment: def __init__(self, results_dir, env_name, agent_name, name=None, restore=False, restore_mix=False, args=None): if not name: if restore: experiments = [e for e in os.listdir(results_dir) if env_name in e and agent_name in e] assert len(experiments) > 0, 'No experiment to restore' name = max(experiments, key=lambda p: os.path.getmtime(results_dir+'/'+p)) name = '_'.join(name.split('_')[2:]) else: name = dt.now().strftime("%y-%m-%d_%H-%M-%S") else: if restore_mix: assert name is not None, "Must give a experiment name in order to <restore_mix>." experiments = [e for e in os.listdir(results_dir) if name in e and agent_name in e] assert len(experiments) > 0, 'No experiment to restore' name = dt.now().strftime("%y-%m-%d_%H-%M-%S") self.name = name self.restore = restore self.env_name = env_name self.agent_name = agent_name self.results_dir = results_dir self.args = args os.makedirs(self.path, exist_ok=True) os.makedirs(self.path + '/summaries', exist_ok=True) os.makedirs(self.results_dir + '/summaries', exist_ok=True) if not os.path.exists(self.summaries_path): os.symlink('../%s/summaries' % self.full_name, self.summaries_path) @property def full_name(self): if self.args.HRL and "HRL-{}".format(self.args.HRL) not in self.name: return '%s_%s_HRL-%s_%s' % (self.env_name, self.agent_name, self.args.HRL, self.name) else: return '%s_%s_%s' % (self.env_name, self.agent_name, self.name) @property def path(self): return '%s/%s' % (self.results_dir, self.full_name) @property def config_path(self): return '%s/%s' % (self.path, 'config.gin') @property def log_path(self): return '%s/%s' % (self.path, 'train.log') @property def checkpoints_path(self): return self.path + '/checkpoints' @property def summaries_path(self): return '%s/summaries/%s' % (self.results_dir, self.full_name) @property def experiment_config_path(self): return '%s/%s' % (self.path, 'experiment_config') def save_gin_config(self): with open(self.config_path, 'w') as cfg_file: cfg_file.write(gin.operative_config_str()) def save_experiment_config(self): ex_config_dict = {"name": self.name, "restore": self.restore, "env": self.env_name, "n_envs": self.args.n_envs, "agent": self.agent_name, "results_dir": self.results_dir, "time": dt.now().strftime("%y-%m-%d_%H-%M-%S"), "HRL": self.args.HRL, "max_ep_len": self.args.max_ep_len, } with open(self.experiment_config_path, 'a') as ex_cfg_file: ex_cfg_file.write(json.dumps(ex_config_dict)) def save_model_summary(self, model, **kwargs): if model: with open(self.path + '/' + 'model_summary.txt', 'w') as fl: model.summary(print_fn=lambda line: print(line, file=fl)) else: assert 'models' in kwargs and 'subenvs' in kwargs, "Missing models and subenvs" models = kwargs['models'] subenvs = kwargs['subenvs'] for model, subenv in zip(models, subenvs): with open(self.path + '/' + subenv + '_model_summary.txt', 'w') as fl: model.summary(print_fn=lambda line: print(line, file=fl))
[ 1, 529, 9507, 29958, 5638, 369, 29914, 13239, 29914, 735, 15362, 29889, 2272, 13, 5215, 2897, 13, 5215, 330, 262, 13, 5215, 4390, 13, 3166, 12865, 1053, 12865, 408, 11636, 13, 13, 13, 1990, 1222, 15362, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2582, 29918, 3972, 29892, 8829, 29918, 978, 29892, 10823, 29918, 978, 29892, 1024, 29922, 8516, 29892, 17749, 29922, 8824, 29892, 17749, 29918, 28084, 29922, 8824, 29892, 6389, 29922, 8516, 1125, 13, 4706, 565, 451, 1024, 29901, 13, 9651, 565, 17749, 29901, 13, 18884, 15729, 353, 518, 29872, 363, 321, 297, 2897, 29889, 1761, 3972, 29898, 9902, 29918, 3972, 29897, 565, 8829, 29918, 978, 297, 321, 322, 10823, 29918, 978, 297, 321, 29962, 13, 18884, 4974, 7431, 29898, 735, 546, 7862, 29897, 1405, 29871, 29900, 29892, 525, 3782, 7639, 304, 17749, 29915, 13, 18884, 1024, 353, 4236, 29898, 735, 546, 7862, 29892, 1820, 29922, 2892, 282, 29901, 2897, 29889, 2084, 29889, 657, 29885, 2230, 29898, 9902, 29918, 3972, 23097, 29914, 18717, 29886, 876, 13, 18884, 1024, 353, 22868, 4286, 7122, 29898, 978, 29889, 5451, 877, 29918, 29861, 29906, 29901, 2314, 13, 13, 9651, 1683, 29901, 13, 18884, 1024, 353, 11636, 29889, 3707, 2141, 710, 615, 603, 11702, 29891, 19222, 29885, 19222, 29881, 29918, 29995, 29950, 19222, 29924, 19222, 29903, 1159, 13, 4706, 1683, 29901, 13, 9651, 565, 17749, 29918, 28084, 29901, 13, 18884, 4974, 1024, 338, 451, 6213, 29892, 376, 29924, 504, 2367, 263, 7639, 1024, 297, 1797, 304, 529, 5060, 487, 29918, 28084, 29958, 1213, 13, 18884, 15729, 353, 518, 29872, 363, 321, 297, 2897, 29889, 1761, 3972, 29898, 9902, 29918, 3972, 29897, 565, 1024, 297, 321, 322, 10823, 29918, 978, 297, 321, 29962, 13, 18884, 4974, 7431, 29898, 735, 546, 7862, 29897, 1405, 29871, 29900, 29892, 525, 3782, 7639, 304, 17749, 29915, 13, 18884, 1024, 353, 11636, 29889, 3707, 2141, 710, 615, 603, 11702, 29891, 19222, 29885, 19222, 29881, 29918, 29995, 29950, 19222, 29924, 19222, 29903, 1159, 13, 13, 13, 4706, 1583, 29889, 978, 353, 1024, 13, 4706, 1583, 29889, 5060, 487, 353, 17749, 13, 4706, 1583, 29889, 6272, 29918, 978, 353, 8829, 29918, 978, 13, 4706, 1583, 29889, 14748, 29918, 978, 353, 10823, 29918, 978, 13, 4706, 1583, 29889, 9902, 29918, 3972, 353, 2582, 29918, 3972, 13, 4706, 1583, 29889, 5085, 353, 6389, 13, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 29889, 2084, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 29889, 2084, 718, 8207, 2083, 3034, 583, 742, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 29889, 9902, 29918, 3972, 718, 8207, 2083, 3034, 583, 742, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 1311, 29889, 2083, 3034, 583, 29918, 2084, 1125, 13, 9651, 2897, 29889, 29879, 21053, 682, 877, 6995, 29995, 29879, 29914, 2083, 3034, 583, 29915, 1273, 1583, 29889, 8159, 29918, 978, 29892, 1583, 29889, 2083, 3034, 583, 29918, 2084, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2989, 29918, 978, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 5085, 29889, 29950, 2241, 322, 376, 29950, 2241, 29899, 8875, 1642, 4830, 29898, 1311, 29889, 5085, 29889, 29950, 2241, 29897, 451, 297, 1583, 29889, 978, 29901, 13, 9651, 736, 14210, 29879, 29918, 29995, 29879, 29918, 29950, 2241, 19222, 29879, 29918, 29995, 29879, 29915, 1273, 313, 1311, 29889, 6272, 29918, 978, 29892, 1583, 29889, 14748, 29918, 978, 29892, 1583, 29889, 5085, 29889, 29950, 2241, 29892, 1583, 29889, 978, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 14210, 29879, 29918, 29995, 29879, 29918, 29995, 29879, 29915, 1273, 313, 1311, 29889, 6272, 29918, 978, 29892, 1583, 29889, 14748, 29918, 978, 29892, 1583, 29889, 978, 29897, 13, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2224, 29898, 1311, 1125, 13, 4706, 736, 14210, 29879, 22584, 29879, 29915, 1273, 313, 1311, 29889, 9902, 29918, 3972, 29892, 1583, 29889, 8159, 29918, 978, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2295, 29918, 2084, 29898, 1311, 1125, 13, 4706, 736, 14210, 29879, 22584, 29879, 29915, 1273, 313, 1311, 29889, 2084, 29892, 525, 2917, 29889, 5359, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1480, 29918, 2084, 29898, 1311, 1125, 13, 4706, 736, 14210, 29879, 22584, 29879, 29915, 1273, 313, 1311, 29889, 2084, 29892, 525, 14968, 29889, 1188, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1423, 9748, 29918, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2084, 718, 8207, 3198, 9748, 29915, 13, 13, 1678, 732, 6799, 13, 1678, 822, 19138, 583, 29918, 2084, 29898, 1311, 1125, 13, 4706, 736, 14210, 29879, 29914, 2083, 3034, 583, 22584, 29879, 29915, 1273, 313, 1311, 29889, 9902, 29918, 3972, 29892, 1583, 29889, 8159, 29918, 978, 29897, 13, 268, 13, 1678, 732, 6799, 13, 1678, 822, 7639, 29918, 2917, 29918, 2084, 29898, 1311, 1125, 13, 4706, 736, 14210, 29879, 22584, 29879, 29915, 1273, 313, 1311, 29889, 2084, 29892, 525, 735, 15362, 29918, 2917, 1495, 13, 268, 13, 1678, 822, 4078, 29918, 5359, 29918, 2917, 29898, 1311, 1125, 13, 4706, 411, 1722, 29898, 1311, 29889, 2917, 29918, 2084, 29892, 525, 29893, 1495, 408, 274, 16434, 29918, 1445, 29901, 13, 9651, 274, 16434, 29918, 1445, 29889, 3539, 29898, 5359, 29889, 3372, 1230, 29918, 2917, 29918, 710, 3101, 13, 268, 13, 1678, 822, 4078, 29918, 735, 15362, 29918, 2917, 29898, 1311, 1125, 13, 4706, 429, 29918, 2917, 29918, 8977, 353, 8853, 978, 1115, 1583, 29889, 978, 29892, 376, 5060, 487, 1115, 1583, 29889, 5060, 487, 29892, 13, 462, 9651, 376, 6272, 1115, 1583, 29889, 6272, 29918, 978, 29892, 376, 29876, 29918, 264, 4270, 1115, 1583, 29889, 5085, 29889, 29876, 29918, 264, 4270, 29892, 13, 462, 9651, 376, 14748, 1115, 1583, 29889, 14748, 29918, 978, 29892, 13, 462, 9651, 376, 9902, 29918, 3972, 1115, 1583, 29889, 9902, 29918, 3972, 29892, 29871, 13, 462, 9651, 376, 2230, 1115, 11636, 29889, 3707, 2141, 710, 615, 603, 11702, 29891, 19222, 29885, 19222, 29881, 29918, 29995, 29950, 19222, 29924, 19222, 29903, 4968, 13, 462, 9651, 376, 29950, 2241, 1115, 1583, 29889, 5085, 29889, 29950, 2241, 29892, 13, 462, 9651, 376, 3317, 29918, 1022, 29918, 2435, 1115, 1583, 29889, 5085, 29889, 3317, 29918, 1022, 29918, 2435, 29892, 13, 462, 9651, 500, 13, 4706, 411, 1722, 29898, 1311, 29889, 735, 15362, 29918, 2917, 29918, 2084, 29892, 525, 29874, 1495, 408, 429, 29918, 16859, 29918, 1445, 29901, 462, 13, 9651, 429, 29918, 16859, 29918, 1445, 29889, 3539, 29898, 3126, 29889, 29881, 17204, 29898, 735, 29918, 2917, 29918, 8977, 876, 13, 13, 1678, 822, 4078, 29918, 4299, 29918, 7727, 29898, 1311, 29892, 1904, 29892, 3579, 19290, 1125, 13, 4706, 565, 1904, 29901, 13, 9651, 411, 1722, 29898, 1311, 29889, 2084, 718, 8207, 29915, 718, 525, 4299, 29918, 7727, 29889, 3945, 742, 525, 29893, 1495, 408, 1652, 29901, 13, 18884, 1904, 29889, 7727, 29898, 2158, 29918, 9144, 29922, 2892, 1196, 29901, 1596, 29898, 1220, 29892, 934, 29922, 1579, 876, 13, 4706, 1683, 29901, 13, 9651, 4974, 525, 9794, 29915, 297, 9049, 5085, 322, 525, 1491, 264, 4270, 29915, 297, 9049, 5085, 29892, 376, 18552, 292, 4733, 322, 1014, 264, 4270, 29908, 13, 9651, 4733, 353, 9049, 5085, 1839, 9794, 2033, 13, 9651, 1014, 264, 4270, 353, 9049, 5085, 1839, 1491, 264, 4270, 2033, 13, 9651, 363, 1904, 29892, 1014, 6272, 29871, 297, 14319, 29898, 9794, 29892, 1014, 264, 4270, 1125, 13, 18884, 411, 1722, 29898, 1311, 29889, 2084, 718, 8207, 29915, 718, 1014, 6272, 718, 22868, 4299, 29918, 7727, 29889, 3945, 742, 525, 29893, 1495, 408, 1652, 29901, 13, 462, 1678, 1904, 29889, 7727, 29898, 2158, 29918, 9144, 29922, 2892, 1196, 29901, 1596, 29898, 1220, 29892, 934, 29922, 1579, 876, 13, 2 ]
repository/spraytime_repo.py
kbj2060/plantpointNutrients-backend
0
142950
<reponame>kbj2060/plantpointNutrients-backend<gh_stars>0 from domain.entities.spraytime import SprayTime as eSprayTime from repository.repo import BaseRepo from repository import models from controllers.app import session class SprayTimeRepository(BaseRepo): def __init__(self) -> None: super().__init__() self.model = models.SprayTime self.entity = eSprayTime def create(self, period): new_spraytime: models.SprayTime = models.SprayTime(period=period) session.add(new_spraytime) session.commit() sprayTimeRepository = SprayTimeRepository()
[ 1, 529, 276, 1112, 420, 29958, 21066, 29926, 29906, 29900, 29953, 29900, 29914, 24389, 3149, 29940, 329, 374, 1237, 29899, 27852, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 5354, 29889, 296, 1907, 29889, 1028, 764, 2230, 1053, 1706, 764, 2481, 408, 321, 5592, 764, 2481, 13, 3166, 9810, 29889, 20095, 1053, 7399, 5612, 29877, 13, 3166, 9810, 1053, 4733, 13, 3166, 21385, 29889, 932, 1053, 4867, 13, 13, 13, 1990, 1706, 764, 2481, 11481, 29898, 5160, 5612, 29877, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29897, 1599, 6213, 29901, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 4299, 353, 4733, 29889, 5592, 764, 2481, 13, 4706, 1583, 29889, 10041, 353, 321, 5592, 764, 2481, 13, 13, 1678, 822, 1653, 29898, 1311, 29892, 3785, 1125, 13, 4706, 716, 29918, 1028, 764, 2230, 29901, 4733, 29889, 5592, 764, 2481, 353, 4733, 29889, 5592, 764, 2481, 29898, 19145, 29922, 19145, 29897, 13, 4706, 4867, 29889, 1202, 29898, 1482, 29918, 1028, 764, 2230, 29897, 13, 4706, 4867, 29889, 15060, 580, 13, 13, 1028, 764, 2481, 11481, 353, 1706, 764, 2481, 11481, 580, 13, 2 ]
tests/conf.py
xncbf/django-dynamodb-cache
21
22252
<gh_stars>10-100 from random import random TABLE_NAME = f"test-django-dynamodb-cache-{random()}"
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 4036, 1053, 4036, 13, 13, 21009, 29918, 5813, 353, 285, 29908, 1688, 29899, 14095, 29899, 29881, 2926, 10396, 29899, 8173, 29899, 29912, 8172, 580, 5038, 13, 2 ]
src/tests/test_workflow.py
marcusianlevine/compose-flow
10
135910
import shlex from unittest import TestCase, mock from compose_flow.commands import Workflow from tests import BaseTestCase TEST_PROJECT_NAME = "test_project_name" @mock.patch("compose_flow.commands.subcommands.env.utils") @mock.patch("compose_flow.commands.subcommands.env.get_backend") class WorkflowTestCase(BaseTestCase): @staticmethod def _setup_docker_config_mock(*mocks): get_backend_mock = mocks[-2] get_backend_mock.return_value.read.return_value = "FOO=1\nBAR=2" @staticmethod def _setup_utils_mock(*mocks): utils_mock = mocks[-1] utils_mock.get_tag_version.return_value = "0.0.0" utils_mock.render.side_effect = lambda x, **kwargs: x def test_config_name_with_different_env(self, *mocks): """Ensure the config can have a different env prefix than the current env This allows storage of environments other than the current one, for example, storing a default local config in the dev remote so that multiple devs can access it to seed their environment """ command = shlex.split("-e dev -c local-test-project env cat") workflow = Workflow(argv=command) self.assertEquals("local-test-project", workflow.config_name) def test_default_env_when_no_env_specified(self, *mocks): self._setup_docker_config_mock(*mocks) self._setup_utils_mock(*mocks) command = shlex.split("env cat") workflow = Workflow(argv=command) env = workflow.environment self.assertEqual([], sorted(env.data.keys())) @mock.patch("compose_flow.commands.workflow.os") def test_docker_image_prefix_default(self, *mocks): """ Ensure the default image name will not accidentally push the image to a remote registry """ os_mock = mocks[0] os_mock.environ = {} os_mock.path.exists.return_value = False workflow = Workflow(argv=[]) self.assertEqual(workflow.docker_image_prefix, "localhost.localdomain") @mock.patch("compose_flow.commands.workflow.settings") @mock.patch("compose_flow.commands.workflow.os") def test_docker_image_prefix_from_os_settings(self, *mocks): os_mock = mocks[0] os_mock.path.exists.return_value = False settings_mock = mocks[1] settings_mock.DOCKER_IMAGE_PREFIX = "foo" workflow = Workflow(argv=[]) self.assertEqual(workflow.docker_image_prefix, "foo") @mock.patch( "compose_flow.commands.workflow.Workflow.app_config", new_callable=mock.PropertyMock, ) def test_docker_image_prefix_from_app_config(self, *mocks): image_prefix = "registry.prefix.com/foo" app_config_mock = mocks[0] app_config_mock.return_value = {"build": {"image_prefix": image_prefix}} workflow = Workflow(argv=[]) self.assertEqual(workflow.docker_image_prefix, image_prefix) def test_load_env_when_env_specified(self, *mocks): self._setup_docker_config_mock(*mocks) self._setup_utils_mock(*mocks) command = shlex.split("-e dev env cat") workflow = Workflow(argv=command) env = workflow.environment self.assertEqual(["BAR", "FOO"], sorted(env.data.keys())) self.assertEqual("1", env.data["FOO"]) self.assertEqual("2", env.data["BAR"]) @mock.patch( "compose_flow.commands.workflow.Workflow.subcommand", new_callable=mock.PropertyMock, ) def test_setup_environment_flag(self, *mocks): """ Ensures the environment cache is set to an empty dictionary when a workflow environment should not be setup """ subcommand_mock = mocks[0] subcommand_mock.return_value.setup_environment = False command = shlex.split("-e dev env cat") workflow = Workflow(argv=command) workflow._setup_environment() self.assertEqual({}, workflow.environment._data) @mock.patch("compose_flow.commands.workflow.print") @mock.patch("compose_flow.commands.workflow.pkg_resources") def test_version(self, *mocks): """ Ensure the --version arg just returns the version """ version = "0.0.0-test" pkg_resources_mock = mocks[0] pkg_resources_mock.require.return_value = [mock.Mock(version=version)] command = shlex.split("--version") workflow = Workflow(argv=command) workflow.run() print_mock = mocks[1] print_mock.assert_called_with(version) # noinspection PyUnusedLocal @mock.patch("compose_flow.commands.workflow.PROJECT_NAME", new=TEST_PROJECT_NAME) class WorkflowArgsTestCase(TestCase): """ Tests for parsing command line arguments """ def test_sensible_defaults_no_env(self, *mocks): """ Test sensible defaults when no environment is defined """ command = shlex.split("publish") workflow = Workflow(argv=command) self.assertEqual(None, workflow.args.environment) self.assertEqual(None, workflow.args.remote) self.assertEqual(TEST_PROJECT_NAME, workflow.config_name) self.assertEqual(TEST_PROJECT_NAME, workflow.project_name) def test_sensible_defaults_with_env(self, *mocks): """ Test sensible defaults when an environment is defined """ env = "dev" command = shlex.split(f"-e {env} publish") workflow = Workflow(argv=command) self.assertEqual(env, workflow.args.environment) self.assertEqual(env, workflow.args.remote) self.assertEqual(f"{env}-{TEST_PROJECT_NAME}", workflow.config_name) self.assertEqual(TEST_PROJECT_NAME, workflow.project_name) def test_sensible_defaults_with_env_and_project(self, *mocks): """ Test sensible defaults when an environment and project name is defined """ env = "dev" command = shlex.split(f"-e {env} --project-name foo publish") workflow = Workflow(argv=command) self.assertEqual(env, workflow.args.environment) self.assertEqual(env, workflow.args.remote) self.assertEqual(f"{env}-foo", workflow.config_name) self.assertEqual("foo", workflow.project_name)
[ 1, 1053, 528, 2506, 13, 13, 3166, 443, 27958, 1053, 4321, 8259, 29892, 11187, 13, 13, 3166, 27435, 29918, 1731, 29889, 26381, 1053, 5244, 1731, 13, 13, 3166, 6987, 1053, 7399, 3057, 8259, 13, 13, 18267, 29918, 8618, 17637, 29918, 5813, 353, 376, 1688, 29918, 4836, 29918, 978, 29908, 13, 13, 13, 29992, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1491, 26381, 29889, 6272, 29889, 13239, 1159, 13, 29992, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1491, 26381, 29889, 6272, 29889, 657, 29918, 27852, 1159, 13, 1990, 5244, 1731, 3057, 8259, 29898, 5160, 3057, 8259, 1125, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 14669, 29918, 14695, 29918, 2917, 29918, 17640, 10456, 17640, 29879, 1125, 13, 4706, 679, 29918, 27852, 29918, 17640, 353, 11187, 29879, 14352, 29906, 29962, 13, 4706, 679, 29918, 27852, 29918, 17640, 29889, 2457, 29918, 1767, 29889, 949, 29889, 2457, 29918, 1767, 353, 376, 5800, 29949, 29922, 29896, 29905, 29876, 29933, 1718, 29922, 29906, 29908, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 14669, 29918, 13239, 29918, 17640, 10456, 17640, 29879, 1125, 13, 4706, 3667, 29879, 29918, 17640, 353, 11187, 29879, 14352, 29896, 29962, 13, 4706, 3667, 29879, 29918, 17640, 29889, 657, 29918, 4039, 29918, 3259, 29889, 2457, 29918, 1767, 353, 376, 29900, 29889, 29900, 29889, 29900, 29908, 13, 4706, 3667, 29879, 29918, 17640, 29889, 9482, 29889, 2975, 29918, 15987, 353, 14013, 921, 29892, 3579, 19290, 29901, 921, 13, 13, 1678, 822, 1243, 29918, 2917, 29918, 978, 29918, 2541, 29918, 29881, 15622, 29918, 6272, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 29923, 1983, 545, 278, 2295, 508, 505, 263, 1422, 8829, 10944, 1135, 278, 1857, 8829, 13, 13, 4706, 910, 6511, 8635, 310, 23136, 916, 1135, 278, 1857, 697, 29892, 363, 1342, 29892, 15446, 263, 2322, 1887, 2295, 13, 4706, 297, 278, 2906, 7592, 577, 393, 2999, 2906, 29879, 508, 2130, 372, 304, 16717, 1009, 5177, 13, 4706, 9995, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 703, 29899, 29872, 2906, 448, 29883, 1887, 29899, 1688, 29899, 4836, 8829, 6635, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 1583, 29889, 9294, 14776, 703, 2997, 29899, 1688, 29899, 4836, 613, 27321, 29889, 2917, 29918, 978, 29897, 13, 13, 1678, 822, 1243, 29918, 4381, 29918, 6272, 29918, 8256, 29918, 1217, 29918, 6272, 29918, 6550, 2164, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 1583, 3032, 14669, 29918, 14695, 29918, 2917, 29918, 17640, 10456, 17640, 29879, 29897, 13, 4706, 1583, 3032, 14669, 29918, 13239, 29918, 17640, 10456, 17640, 29879, 29897, 13, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 703, 6272, 6635, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 8829, 353, 27321, 29889, 20944, 13, 13, 4706, 1583, 29889, 9294, 9843, 4197, 1402, 12705, 29898, 6272, 29889, 1272, 29889, 8149, 22130, 13, 13, 1678, 732, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 359, 1159, 13, 1678, 822, 1243, 29918, 14695, 29918, 3027, 29918, 13506, 29918, 4381, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 13, 4706, 22521, 545, 278, 2322, 1967, 1024, 674, 451, 11423, 635, 5503, 278, 1967, 304, 263, 7592, 21235, 13, 4706, 9995, 13, 4706, 2897, 29918, 17640, 353, 11187, 29879, 29961, 29900, 29962, 13, 4706, 2897, 29918, 17640, 29889, 21813, 353, 6571, 13, 4706, 2897, 29918, 17640, 29889, 2084, 29889, 9933, 29889, 2457, 29918, 1767, 353, 7700, 13, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 11759, 2314, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1287, 1731, 29889, 14695, 29918, 3027, 29918, 13506, 29892, 376, 7640, 29889, 2997, 7247, 1159, 13, 13, 1678, 732, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 11027, 1159, 13, 1678, 732, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 359, 1159, 13, 1678, 822, 1243, 29918, 14695, 29918, 3027, 29918, 13506, 29918, 3166, 29918, 359, 29918, 11027, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 2897, 29918, 17640, 353, 11187, 29879, 29961, 29900, 29962, 13, 4706, 2897, 29918, 17640, 29889, 2084, 29889, 9933, 29889, 2457, 29918, 1767, 353, 7700, 13, 13, 4706, 6055, 29918, 17640, 353, 11187, 29879, 29961, 29896, 29962, 13, 4706, 6055, 29918, 17640, 29889, 3970, 7077, 1001, 29918, 2382, 29918, 15094, 25634, 353, 376, 5431, 29908, 13, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 11759, 2314, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1287, 1731, 29889, 14695, 29918, 3027, 29918, 13506, 29892, 376, 5431, 1159, 13, 13, 1678, 732, 17640, 29889, 5041, 29898, 13, 4706, 376, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 5531, 1731, 29889, 932, 29918, 2917, 613, 13, 4706, 716, 29918, 4804, 519, 29922, 17640, 29889, 4854, 18680, 29892, 13, 1678, 1723, 13, 1678, 822, 1243, 29918, 14695, 29918, 3027, 29918, 13506, 29918, 3166, 29918, 932, 29918, 2917, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 1967, 29918, 13506, 353, 376, 1727, 6020, 29889, 13506, 29889, 510, 29914, 5431, 29908, 13, 13, 4706, 623, 29918, 2917, 29918, 17640, 353, 11187, 29879, 29961, 29900, 29962, 13, 4706, 623, 29918, 2917, 29918, 17640, 29889, 2457, 29918, 1767, 353, 8853, 4282, 1115, 8853, 3027, 29918, 13506, 1115, 1967, 29918, 13506, 930, 13, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 11759, 2314, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1287, 1731, 29889, 14695, 29918, 3027, 29918, 13506, 29892, 1967, 29918, 13506, 29897, 13, 13, 1678, 822, 1243, 29918, 1359, 29918, 6272, 29918, 8256, 29918, 6272, 29918, 6550, 2164, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 1583, 3032, 14669, 29918, 14695, 29918, 2917, 29918, 17640, 10456, 17640, 29879, 29897, 13, 4706, 1583, 3032, 14669, 29918, 13239, 29918, 17640, 10456, 17640, 29879, 29897, 13, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 703, 29899, 29872, 2906, 8829, 6635, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 8829, 353, 27321, 29889, 20944, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 3366, 29933, 1718, 613, 376, 5800, 29949, 12436, 12705, 29898, 6272, 29889, 1272, 29889, 8149, 22130, 13, 4706, 1583, 29889, 9294, 9843, 703, 29896, 613, 8829, 29889, 1272, 3366, 5800, 29949, 20068, 13, 4706, 1583, 29889, 9294, 9843, 703, 29906, 613, 8829, 29889, 1272, 3366, 29933, 1718, 20068, 13, 13, 1678, 732, 17640, 29889, 5041, 29898, 13, 4706, 376, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 5531, 1731, 29889, 1491, 6519, 613, 13, 4706, 716, 29918, 4804, 519, 29922, 17640, 29889, 4854, 18680, 29892, 13, 1678, 1723, 13, 1678, 822, 1243, 29918, 14669, 29918, 20944, 29918, 15581, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 13, 4706, 22521, 1973, 278, 5177, 7090, 338, 731, 304, 385, 4069, 8600, 746, 13, 4706, 263, 27321, 5177, 881, 451, 367, 6230, 13, 4706, 9995, 13, 4706, 1014, 6519, 29918, 17640, 353, 11187, 29879, 29961, 29900, 29962, 13, 4706, 1014, 6519, 29918, 17640, 29889, 2457, 29918, 1767, 29889, 14669, 29918, 20944, 353, 7700, 13, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 703, 29899, 29872, 2906, 8829, 6635, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 27321, 3032, 14669, 29918, 20944, 580, 13, 13, 4706, 1583, 29889, 9294, 9843, 3319, 1118, 27321, 29889, 20944, 3032, 1272, 29897, 13, 13, 1678, 732, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 2158, 1159, 13, 1678, 732, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 15865, 29918, 13237, 1159, 13, 1678, 822, 1243, 29918, 3259, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 13, 4706, 22521, 545, 278, 1192, 3259, 1852, 925, 3639, 278, 1873, 13, 4706, 9995, 13, 4706, 1873, 353, 376, 29900, 29889, 29900, 29889, 29900, 29899, 1688, 29908, 13, 13, 4706, 282, 9415, 29918, 13237, 29918, 17640, 353, 11187, 29879, 29961, 29900, 29962, 13, 4706, 282, 9415, 29918, 13237, 29918, 17640, 29889, 12277, 29889, 2457, 29918, 1767, 353, 518, 17640, 29889, 18680, 29898, 3259, 29922, 3259, 4638, 13, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 703, 489, 3259, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 27321, 29889, 3389, 580, 13, 13, 4706, 1596, 29918, 17640, 353, 11187, 29879, 29961, 29896, 29962, 13, 4706, 1596, 29918, 17640, 29889, 9294, 29918, 13998, 29918, 2541, 29898, 3259, 29897, 13, 13, 13, 29937, 694, 1144, 27988, 10772, 2525, 3880, 7717, 13, 29992, 17640, 29889, 5041, 703, 19438, 29918, 1731, 29889, 26381, 29889, 1287, 1731, 29889, 8618, 17637, 29918, 5813, 613, 716, 29922, 18267, 29918, 8618, 17637, 29918, 5813, 29897, 13, 1990, 5244, 1731, 7883, 3057, 8259, 29898, 3057, 8259, 1125, 13, 1678, 9995, 13, 1678, 4321, 29879, 363, 13755, 1899, 1196, 6273, 13, 1678, 9995, 13, 13, 1678, 822, 1243, 29918, 23149, 1821, 29918, 4381, 29879, 29918, 1217, 29918, 6272, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 13, 4706, 4321, 25182, 21274, 746, 694, 5177, 338, 3342, 13, 4706, 9995, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 703, 23679, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 8516, 29892, 27321, 29889, 5085, 29889, 20944, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 8516, 29892, 27321, 29889, 5085, 29889, 16674, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 18267, 29918, 8618, 17637, 29918, 5813, 29892, 27321, 29889, 2917, 29918, 978, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 18267, 29918, 8618, 17637, 29918, 5813, 29892, 27321, 29889, 4836, 29918, 978, 29897, 13, 13, 1678, 822, 1243, 29918, 23149, 1821, 29918, 4381, 29879, 29918, 2541, 29918, 6272, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 13, 4706, 4321, 25182, 21274, 746, 385, 5177, 338, 3342, 13, 4706, 9995, 13, 4706, 8829, 353, 376, 3359, 29908, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 29898, 29888, 29908, 29899, 29872, 426, 6272, 29913, 9805, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6272, 29892, 27321, 29889, 5085, 29889, 20944, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6272, 29892, 27321, 29889, 5085, 29889, 16674, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29888, 29908, 29912, 6272, 7402, 29912, 18267, 29918, 8618, 17637, 29918, 5813, 17671, 27321, 29889, 2917, 29918, 978, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 18267, 29918, 8618, 17637, 29918, 5813, 29892, 27321, 29889, 4836, 29918, 978, 29897, 13, 13, 1678, 822, 1243, 29918, 23149, 1821, 29918, 4381, 29879, 29918, 2541, 29918, 6272, 29918, 392, 29918, 4836, 29898, 1311, 29892, 334, 17640, 29879, 1125, 13, 4706, 9995, 13, 4706, 4321, 25182, 21274, 746, 385, 5177, 322, 2060, 1024, 338, 3342, 13, 4706, 9995, 13, 4706, 8829, 353, 376, 3359, 29908, 13, 4706, 1899, 353, 528, 2506, 29889, 5451, 29898, 29888, 29908, 29899, 29872, 426, 6272, 29913, 1192, 4836, 29899, 978, 7953, 9805, 1159, 13, 4706, 27321, 353, 5244, 1731, 29898, 19218, 29922, 6519, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6272, 29892, 27321, 29889, 5085, 29889, 20944, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6272, 29892, 27321, 29889, 5085, 29889, 16674, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29888, 29908, 29912, 6272, 7402, 5431, 613, 27321, 29889, 2917, 29918, 978, 29897, 13, 4706, 1583, 29889, 9294, 9843, 703, 5431, 613, 27321, 29889, 4836, 29918, 978, 29897, 13, 2 ]
python/ceasarCipher.py
majid-T/snippets
1
187621
<reponame>majid-T/snippets # Simplified Ceasar Cipher example works on alphabetic charachtors only. # Numbers provide a small pre-image since we are ciphering on each word. So numbers are not # accepted and instead of 1 you should type one to increese security import tkinter as tk # All alphabet chars in a list chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] # Function to cipher a charcahter by provided shift def getCipherChar(inCh, shift): # For space only return space if inCh == ' ': return ' ' # Get the current index of charachter in our list index = chars.index(inCh) # shift the index newIndex = index+shift # Check if new index is bigger than lenght of list -1 to avoid out of range index, # if it is deduct lenght to cycle from begining if(newIndex > len(chars)-1): newIndex -= len(chars) return chars[newIndex] # Function to iterate n a phrase and chipher charachters # Uses the lenght of the first word as shift def cipherPhrase(): phrase = originalPhrase.get() shift = len(phrase.split(' ')[0]) result = '' for ch in phrase: result += getCipherChar(ch, shift) data.delete(1.0, tk.END) data.insert(tk.END, result) # GUI part of code win = tk.Tk() win.title('Ceasar Cipher code') originalPhrase = tk.Entry(win, width=40) originalPhrase.grid(row=0, column=0, padx=3, pady=3) button = tk.Button(win, text='Encrypt text', command=cipherPhrase) button.grid(row=0, column=1, pady=5) data = tk.Text(win, height=20, width=100) data.grid(row=1, column=0, columnspan=2) labelFooter = tk.Label( win, text='Sample non official Copy- Under dev version <EMAIL>') labelFooter.grid(row=2, column=0, columnspan=2, padx=10, pady=1) win.mainloop()
[ 1, 529, 276, 1112, 420, 29958, 655, 29926, 333, 29899, 29911, 29914, 29879, 1240, 27421, 13, 29937, 3439, 572, 2164, 7747, 294, 279, 11402, 8096, 1342, 1736, 373, 394, 561, 370, 7492, 1373, 5860, 943, 871, 29889, 13, 29937, 11848, 2596, 3867, 263, 2319, 758, 29899, 3027, 1951, 591, 526, 4583, 561, 3241, 373, 1269, 1734, 29889, 1105, 3694, 526, 451, 13, 29937, 9259, 322, 2012, 310, 29871, 29896, 366, 881, 1134, 697, 304, 3079, 968, 6993, 13, 13, 5215, 18883, 1639, 408, 18883, 13, 13, 29937, 2178, 22968, 22524, 297, 263, 1051, 13, 305, 1503, 353, 6024, 29874, 742, 525, 29890, 742, 525, 29883, 742, 525, 29881, 742, 525, 29872, 742, 525, 29888, 742, 525, 29887, 742, 525, 29882, 742, 525, 29875, 742, 525, 29926, 742, 525, 29895, 742, 525, 29880, 742, 525, 29885, 742, 525, 29876, 742, 525, 29877, 742, 525, 29886, 742, 525, 29939, 742, 525, 29878, 742, 525, 29879, 742, 13, 308, 525, 29873, 742, 525, 29884, 742, 525, 29894, 742, 525, 29893, 742, 525, 29916, 742, 525, 29891, 742, 525, 29920, 742, 525, 29909, 742, 525, 29933, 742, 525, 29907, 742, 525, 29928, 742, 525, 29923, 742, 525, 29943, 742, 525, 29954, 742, 525, 29950, 742, 525, 29902, 742, 525, 29967, 742, 525, 29968, 742, 525, 29931, 742, 525, 29924, 742, 525, 29940, 742, 13, 308, 525, 29949, 742, 525, 29925, 742, 525, 29984, 742, 525, 29934, 742, 525, 29903, 742, 525, 29911, 742, 525, 29965, 742, 525, 29963, 742, 525, 29956, 742, 525, 29990, 742, 525, 29979, 742, 525, 29999, 2033, 13, 13, 13, 29937, 6680, 304, 4583, 8096, 263, 1373, 29883, 801, 357, 491, 4944, 9500, 13, 1753, 679, 29907, 29875, 8096, 5914, 29898, 262, 1451, 29892, 9500, 1125, 13, 1678, 396, 1152, 2913, 871, 736, 2913, 13, 1678, 565, 297, 1451, 1275, 525, 525, 29901, 13, 4706, 736, 525, 525, 13, 13, 1678, 396, 3617, 278, 1857, 2380, 310, 1373, 496, 357, 297, 1749, 1051, 13, 1678, 2380, 353, 22524, 29889, 2248, 29898, 262, 1451, 29897, 13, 13, 1678, 396, 9500, 278, 2380, 13, 1678, 716, 3220, 353, 2380, 29974, 10889, 13, 13, 1678, 396, 5399, 565, 716, 2380, 338, 16600, 1135, 28537, 400, 310, 1051, 448, 29896, 304, 4772, 714, 310, 3464, 2380, 29892, 13, 1678, 396, 565, 372, 338, 28262, 5313, 28537, 400, 304, 11412, 515, 1812, 2827, 13, 1678, 565, 29898, 1482, 3220, 1405, 7431, 29898, 305, 1503, 6817, 29896, 1125, 13, 4706, 716, 3220, 22361, 7431, 29898, 305, 1503, 29897, 13, 13, 1678, 736, 22524, 29961, 1482, 3220, 29962, 13, 13, 29937, 6680, 304, 13649, 302, 263, 16549, 322, 18558, 8096, 1373, 496, 2153, 13, 29937, 10783, 267, 278, 28537, 400, 310, 278, 937, 1734, 408, 9500, 13, 13, 13, 1753, 4583, 8096, 29925, 1092, 559, 7295, 13, 1678, 16549, 353, 2441, 29925, 1092, 559, 29889, 657, 580, 13, 1678, 9500, 353, 7431, 29898, 24588, 559, 29889, 5451, 877, 525, 9601, 29900, 2314, 13, 1678, 1121, 353, 6629, 13, 1678, 363, 521, 297, 16549, 29901, 13, 4706, 1121, 4619, 679, 29907, 29875, 8096, 5914, 29898, 305, 29892, 9500, 29897, 13, 13, 1678, 848, 29889, 8143, 29898, 29896, 29889, 29900, 29892, 18883, 29889, 11794, 29897, 13, 1678, 848, 29889, 7851, 29898, 11178, 29889, 11794, 29892, 1121, 29897, 13, 13, 13, 29937, 14839, 760, 310, 775, 13, 5080, 353, 18883, 29889, 29911, 29895, 580, 13, 5080, 29889, 3257, 877, 29907, 29872, 294, 279, 11402, 8096, 775, 1495, 13, 13, 13, 13492, 29925, 1092, 559, 353, 18883, 29889, 9634, 29898, 5080, 29892, 2920, 29922, 29946, 29900, 29897, 13, 13492, 29925, 1092, 559, 29889, 7720, 29898, 798, 29922, 29900, 29892, 1897, 29922, 29900, 29892, 17132, 29916, 29922, 29941, 29892, 282, 3714, 29922, 29941, 29897, 13, 13, 13, 3092, 353, 18883, 29889, 3125, 29898, 5080, 29892, 1426, 2433, 8566, 4641, 1426, 742, 1899, 29922, 455, 8096, 29925, 1092, 559, 29897, 13, 3092, 29889, 7720, 29898, 798, 29922, 29900, 29892, 1897, 29922, 29896, 29892, 282, 3714, 29922, 29945, 29897, 13, 13, 1272, 353, 18883, 29889, 1626, 29898, 5080, 29892, 3171, 29922, 29906, 29900, 29892, 2920, 29922, 29896, 29900, 29900, 29897, 13, 1272, 29889, 7720, 29898, 798, 29922, 29896, 29892, 1897, 29922, 29900, 29892, 1897, 9653, 29922, 29906, 29897, 13, 13, 1643, 13440, 261, 353, 18883, 29889, 4775, 29898, 13, 1678, 5401, 29892, 1426, 2433, 17708, 1661, 6221, 14187, 29899, 7634, 2906, 1873, 529, 26862, 6227, 29958, 1495, 13, 1643, 13440, 261, 29889, 7720, 29898, 798, 29922, 29906, 29892, 1897, 29922, 29900, 29892, 1897, 9653, 29922, 29906, 29892, 17132, 29916, 29922, 29896, 29900, 29892, 282, 3714, 29922, 29896, 29897, 13, 13, 5080, 29889, 3396, 7888, 580, 13, 2 ]
recipes/recipe_modules/cloudbuildhelper/__init__.py
NDevTK/chromium-infra
0
193345
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. PYTHON_VERSION_COMPATIBILITY = 'PY2+3' DEPS = [ 'recipe_engine/cipd', 'recipe_engine/commit_position', 'recipe_engine/context', 'recipe_engine/file', 'recipe_engine/golang', 'recipe_engine/json', 'recipe_engine/nodejs', 'recipe_engine/path', 'recipe_engine/raw_io', 'recipe_engine/step', 'depot_tools/depot_tools', 'depot_tools/git', 'depot_tools/git_cl', ]
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 450, 678, 456, 1974, 13189, 943, 29889, 2178, 10462, 21676, 29889, 13, 29937, 4803, 310, 445, 2752, 775, 338, 4095, 287, 491, 263, 350, 7230, 29899, 3293, 19405, 393, 508, 367, 13, 29937, 1476, 297, 278, 365, 2965, 1430, 1660, 934, 29889, 13, 13, 20055, 4690, 1164, 29918, 16358, 29918, 21514, 1299, 8979, 6227, 11937, 353, 525, 20055, 29906, 29974, 29941, 29915, 13, 13, 2287, 7024, 353, 518, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 7334, 29881, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 15060, 29918, 3283, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 4703, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 1445, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 29887, 324, 574, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 3126, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 3177, 1315, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 2084, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 1610, 29918, 601, 742, 13, 29871, 525, 4361, 412, 29918, 10599, 29914, 10568, 742, 13, 13, 29871, 525, 2716, 327, 29918, 8504, 29914, 2716, 327, 29918, 8504, 742, 13, 29871, 525, 2716, 327, 29918, 8504, 29914, 5559, 742, 13, 29871, 525, 2716, 327, 29918, 8504, 29914, 5559, 29918, 695, 742, 13, 29962, 13, 2 ]
elpis/engines/common/input/clean_json.py
guillaume-wisniewski/elpis
118
119213
<gh_stars>100-1000 #!/usr/bin/python3 """ Given a json file with transcript information these tools can perform - manipulations including generating word lists or filtering output to - exclude english/punctuation. - Optionally provide the output json file name with -j Usage: python3 clean_json.py [-h] [--i INFILE] [--o OUTFILE] [-r] [-u] Copyright: University of Queensland, 2019 Contributors: <NAME> - (The University of Queensland, 2017) <NAME> - (The University of Queensland, 2018) <NAME> - (The University of Queensland, 2019) """ import os import re import sys import nltk from argparse import ArgumentParser from langid.langid import LanguageIdentifier, model from nltk.corpus import words from typing import Dict, List, Set from ..utilities import load_json_file, write_data_to_json_file def clean_utterance(utterance: Dict[str, str], punctuation_to_collapse_by: str = '', punctuation_to_explode_by: str = '', special_cases: set = {None}, translation_tags: set = {None}, remove_english: bool = False, english_words: set = None) -> (List[str], int): """ Takes an utterance and cleans it based on the rules established by the provided parameters. :param utterance: a dictionary with a "transcript" key-value pair. :param punctuation_to_collapse_by: punctuation marks to strip. :param punctuation_to_explode_by: punctuation marks to replace with spaces. :param special_cases: a list of words to always remove from the output. :param translation_tags: a list of tags to always remove from the output. :param remove_english: whether or not to remove English words. :param english_words: a list of english words to remove from the transcript (we suggest the nltk corpus). :return: a tuple with a list of 'cleaned' words and the number of English to remove. """ # TODO add interface setting to include user specific tags # translation_tags = {"@eng@", "<ind:", "<eng:"} # TODO add interface setting to skip this as caps are significant in some languages utterance_string = utterance.get("transcript").lower() dirty_words = utterance_string.split() clean_words = [] english_word_count = 0 for word in dirty_words: if word in special_cases: continue if remove_english and len(word) > 3 and word in english_words: english_word_count += 1 continue if word in translation_tags: return [], 0 # Word is ok to use, now clean it word = deal_with_punctuation(text=word, punctuation_to_collapse_by=punctuation_to_collapse_by, punctuation_to_explode_by=punctuation_to_explode_by) clean_words.append(word) return clean_words, english_word_count def get_english_words() -> Set[str]: """ Gets a list of English words from the nltk corpora (~235k words). N.B: will download the word list if not already available (~740kB), requires internet. :return: a set containing the English words """ nltk.download("words") # Will only download if not locally available. return set(words.words()) def are_words_valid(clean_words: List[str], english_word_count: int, remove_english: bool, use_langid: bool) -> bool: """ Determines whether a list of words is valid based on the provided parameters. :param clean_words: a list of clean word strings. :param english_word_count: the number of english words removed from the string during cleaning. :param remove_english: whether or not to remove english words. :param use_langid: whether or not to use the langid library to determine if a word is English. :return: True if utterance is valid, False otherwise. """ # Exclude utterance if empty after cleaning cleaned_transcription = " ".join(clean_words).strip() if cleaned_transcription == "": return False # Exclude utterance if > 10% english if remove_english and len(clean_words) > 0 and english_word_count / len(clean_words) > 0.1: # print(round(english_word_count / len(clean_words)), trans, file=sys.stderr) return False # Exclude utterance if langid thinks its english if remove_english and use_langid: langid_identifier = LanguageIdentifier.from_modelstring(model, norm_probs=True) lang, prob = langid_identifier.classify(cleaned_transcription) if lang == "en" and prob > 0.5: return False return True def clean_json_utterance(utterance: Dict[str, str], punctuation_to_collapse_by: str = '', punctuation_to_explode_by: str = '', special_cases: set = {None}, translation_tags: set = {None}, remove_english: bool = False, use_langid: bool = False) -> Dict[str, str]: """ Clean an utterance (Python dictionary) based on the given parameters. :param utterance: Python dictionary, must have a 'transcript' key-value. :param punctuation_to_collapse_by: punctuation marks to strip. :param punctuation_to_explode_by: punctuation marks to replace with spaces. :param special_cases: a list of words to always remove from the output. :param translation_tags: a list of tags to always remove from the output. :param remove_english: whether or not to remove English from the utterances. :param use_langid: whether or not to use the langid library to identify English to remove. :return: cleaned utterance (dictionary). """ # TODO make this an interface setting # special_cases = ["<silence>"] # Any words you want to ignore if remove_english: english_words = get_english_words() # pre-load English corpus else: english_words = set() # Clean the text in the dict, returns a list of cleaned words clean_words, english_word_count = \ clean_utterance(utterance=utterance, punctuation_to_collapse_by=punctuation_to_collapse_by, punctuation_to_explode_by=punctuation_to_explode_by, special_cases=special_cases, translation_tags=translation_tags, remove_english=remove_english, english_words=english_words ) # Check that the cleaned words are valid (ie, not null, not English etc) if are_words_valid(clean_words, english_word_count, remove_english, use_langid): cleaned_transcript = " ".join(clean_words).strip() else: # TODO is it best to return an empty str here or raise an error? cleaned_transcript = "" utterance['transcript'] = cleaned_transcript return utterance def clean_json_data(json_data: List[Dict[str, str]], punctuation_to_collapse_by: str = '', punctuation_to_explode_by: str = '', special_cases: set = {None}, translation_tags: set = {None}, remove_english: bool = False, use_langid: bool = False, ) -> List[Dict[str, str]]: """ Clean a list of utterances (Python dictionaries) based on the given parameters. :param json_data: List of Python dictionaries, each must have a 'transcript' key-value. :param punctuation_to_collapse_by: punctuation marks to strip. :param punctuation_to_explode_by: punctuation marks to replace with spaces. :param special_cases: a list of words to always remove from the output. :param translation_tags: a list of tags to always remove from the output. :param remove_english: whether or not to remove English from the utterances. :param use_langid: whether or not to use the langid library to identify English to remove. :return: list of cleaned utterances (dictionaries). """ json_data_cleaned = [] for utterance in json_data: utterance_cleaned = clean_json_utterance(utterance, punctuation_to_collapse_by=punctuation_to_collapse_by, punctuation_to_explode_by=punctuation_to_explode_by, special_cases=special_cases, translation_tags=translation_tags, remove_english=remove_english, use_langid=use_langid) json_data_cleaned.append(utterance_cleaned) return json_data_cleaned def extract_additional_corpora(additional_corpus: str = '', corpus_txt: str = '', punctuation_to_collapse_by: str = '', punctuation_to_explode_by: str = '') -> None: """ Takes a text file, extracts all sentences and writes them to the main corpus file. :param additional_corpus: the path to a plaintext file to extract additional sentences/lines from :param corpus_txt: the path to the compiled corpus.txt file :param punctuation_to_collapse_by: punctuation marks to strip :param punctuation_to_explode_by: punctuation marks to replace with spaces """ print("corpus_txt", corpus_txt) if os.path.exists(corpus_txt): write_mode = 'a' # append if already exists else: write_mode = 'w' # make a new file if not with open(corpus_txt, write_mode) as corpus_txt_file: if os.path.exists(additional_corpus): print(f"Extracting corpus examples from: {additional_corpus}") with open(additional_corpus, "r", encoding="utf-8", ) as file_: for line in file_.readlines(): # clean the text along the way line = \ deal_with_punctuation(text=line, punctuation_to_collapse_by=punctuation_to_collapse_by, punctuation_to_explode_by=punctuation_to_explode_by) if not line.endswith('\n'): line = line + '\n' corpus_txt_file.writelines(line) else: print(f"Provided additional text additional_corpus file path invalid: " f"{additional_corpus}") def deal_with_punctuation(text: str = '', punctuation_to_collapse_by: str = '', punctuation_to_explode_by: str = '') -> str: """ Removes punctuation from a string :param text: original text :param punctuation_to_collapse_by: punctuation marks to strip :param punctuation_to_explode_by: punctuation marks to replace with spaces :return: cleaned text """ new_text: str = text # Prioritise exploding first, these are punctuation marks that the user sets if punctuation_to_explode_by: pattern_to_explode_by = re.escape(punctuation_to_explode_by) new_text = re.sub(rf"[{pattern_to_explode_by}]", " ", new_text) # Then strip the rest if punctuation_to_collapse_by: pattern_to_collapse_by = re.escape(punctuation_to_collapse_by) new_text = re.sub(rf"[{pattern_to_collapse_by}]", "", new_text) return new_text def main() -> None: """ Run the entire clean_json process as a command line utility. Usage: python3 clean_json.py [--i INFILE] [--o OUTFILE] [-r] [-u] """ parser: ArgumentParser = ArgumentParser() parser.add_argument("-i", "--infile", type=str, help="The path to the dirty json file to clean.", required=True) parser.add_argument("-o", "--outfile", type=str, help="The path to the clean json file to write to", required=True) parser.add_argument("-r", "--remove_english", help="Remove english-like utterances", action="store_true") parser.add_argument("-u", "--use_langid", help="Use langid library to detect English", action="store_true") # TODO add defaults parser.add_argument("-c", "--punctuation_to_collapse_by", type=str, help="Chars to strip") parser.add_argument("-e", "--punctuation_to_explode_by", type=str, help="Chars to strip and replace with spaces") arguments = parser.parse_args() dirty_json_data: List[Dict[str, str]] = load_json_file(arguments.infile) outfile = arguments.outfile if arguments.outfile else sys.stdout print(f"Filtering dirty json data {arguments.infile}...") filtered_data = clean_json_data(json_data=dirty_json_data, remove_english=arguments.remove_english, use_langid=arguments.use_langid, punctuation_to_collapse_by=arguments.punctuation_to_collapse_by, punctuation_to_explode_by=arguments.punctuation_to_explode_by) write_data_to_json_file(data=list(filtered_data), file_name=outfile) print(f"Finished! Wrote {str(len(filtered_data))} transcriptions.") if __name__ == "__main__": main()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 29941, 13, 13, 15945, 29908, 13, 29954, 5428, 263, 4390, 934, 411, 1301, 924, 2472, 1438, 8492, 508, 2189, 13, 29899, 11525, 8250, 3704, 14655, 1734, 8857, 470, 21166, 1962, 304, 13, 29899, 19060, 3033, 1674, 29914, 29886, 18049, 29884, 362, 29889, 13, 29899, 10831, 635, 3867, 278, 1962, 4390, 934, 1024, 411, 448, 29926, 13, 13, 27573, 29901, 3017, 29941, 5941, 29918, 3126, 29889, 2272, 21069, 29882, 29962, 518, 489, 29875, 2672, 7724, 29962, 518, 489, 29877, 19474, 7724, 29962, 21069, 29878, 29962, 21069, 29884, 29962, 13, 13, 11882, 1266, 29901, 3014, 310, 25195, 29892, 29871, 29906, 29900, 29896, 29929, 13, 1323, 1091, 29560, 29901, 13, 795, 529, 5813, 29958, 448, 313, 1576, 3014, 310, 25195, 29892, 29871, 29906, 29900, 29896, 29955, 29897, 13, 795, 529, 5813, 29958, 448, 313, 1576, 3014, 310, 25195, 29892, 29871, 29906, 29900, 29896, 29947, 29897, 13, 795, 529, 5813, 29958, 448, 313, 1576, 3014, 310, 25195, 29892, 29871, 29906, 29900, 29896, 29929, 29897, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 10876, 13, 5215, 302, 1896, 29895, 13, 3166, 1852, 5510, 1053, 23125, 11726, 13, 3166, 6361, 333, 29889, 3893, 333, 1053, 17088, 12889, 29892, 1904, 13, 3166, 302, 1896, 29895, 29889, 2616, 13364, 1053, 3838, 13, 3166, 19229, 1053, 360, 919, 29892, 2391, 29892, 3789, 13, 3166, 6317, 4422, 1907, 1053, 2254, 29918, 3126, 29918, 1445, 29892, 2436, 29918, 1272, 29918, 517, 29918, 3126, 29918, 1445, 13, 13, 13, 1753, 5941, 29918, 6463, 749, 29898, 6463, 749, 29901, 360, 919, 29961, 710, 29892, 851, 1402, 13, 462, 1678, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 1678, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 1678, 4266, 29918, 11436, 29901, 731, 353, 426, 8516, 1118, 13, 462, 1678, 13962, 29918, 11338, 29901, 731, 353, 426, 8516, 1118, 13, 462, 1678, 3349, 29918, 996, 1674, 29901, 6120, 353, 7700, 29892, 13, 462, 1678, 3033, 1674, 29918, 9303, 29901, 731, 353, 6213, 29897, 1599, 313, 1293, 29961, 710, 1402, 938, 1125, 13, 1678, 9995, 13, 1678, 323, 6926, 385, 14401, 749, 322, 4531, 550, 372, 2729, 373, 278, 6865, 7841, 491, 278, 4944, 4128, 29889, 13, 1678, 584, 3207, 14401, 749, 29901, 263, 8600, 411, 263, 376, 3286, 924, 29908, 1820, 29899, 1767, 5101, 29889, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 17820, 29889, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 5191, 411, 8162, 29889, 13, 1678, 584, 3207, 4266, 29918, 11436, 29901, 263, 1051, 310, 3838, 304, 2337, 3349, 515, 278, 1962, 29889, 13, 1678, 584, 3207, 13962, 29918, 11338, 29901, 263, 1051, 310, 8282, 304, 2337, 3349, 515, 278, 1962, 29889, 13, 1678, 584, 3207, 3349, 29918, 996, 1674, 29901, 3692, 470, 451, 304, 3349, 4223, 3838, 29889, 13, 1678, 584, 3207, 3033, 1674, 29918, 9303, 29901, 263, 1051, 310, 3033, 1674, 3838, 304, 3349, 515, 278, 1301, 924, 313, 705, 4368, 278, 302, 1896, 29895, 1034, 13364, 467, 13, 1678, 584, 2457, 29901, 263, 18761, 411, 263, 1051, 310, 525, 14941, 287, 29915, 3838, 322, 278, 1353, 310, 4223, 304, 3349, 29889, 13, 1678, 9995, 13, 1678, 396, 14402, 788, 5067, 4444, 304, 3160, 1404, 2702, 8282, 13, 1678, 396, 13962, 29918, 11338, 353, 8853, 29992, 996, 24695, 9872, 513, 29901, 613, 9872, 996, 6160, 29913, 13, 1678, 396, 14402, 788, 5067, 4444, 304, 14383, 445, 408, 26091, 526, 7282, 297, 777, 10276, 13, 1678, 14401, 749, 29918, 1807, 353, 14401, 749, 29889, 657, 703, 3286, 924, 2564, 13609, 580, 13, 1678, 26616, 29918, 9303, 353, 14401, 749, 29918, 1807, 29889, 5451, 580, 13, 1678, 5941, 29918, 9303, 353, 5159, 13, 1678, 3033, 1674, 29918, 1742, 29918, 2798, 353, 29871, 29900, 13, 1678, 363, 1734, 297, 26616, 29918, 9303, 29901, 13, 4706, 565, 1734, 297, 4266, 29918, 11436, 29901, 13, 9651, 6773, 13, 4706, 565, 3349, 29918, 996, 1674, 322, 7431, 29898, 1742, 29897, 1405, 29871, 29941, 322, 1734, 297, 3033, 1674, 29918, 9303, 29901, 13, 9651, 3033, 1674, 29918, 1742, 29918, 2798, 4619, 29871, 29896, 13, 9651, 6773, 13, 4706, 565, 1734, 297, 13962, 29918, 11338, 29901, 13, 9651, 736, 19997, 29871, 29900, 13, 4706, 396, 10803, 338, 3431, 304, 671, 29892, 1286, 5941, 372, 13, 4706, 1734, 353, 5376, 29918, 2541, 29918, 29886, 18049, 29884, 362, 29898, 726, 29922, 1742, 29892, 13, 462, 462, 268, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 29892, 13, 462, 462, 268, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29897, 13, 4706, 5941, 29918, 9303, 29889, 4397, 29898, 1742, 29897, 13, 1678, 736, 5941, 29918, 9303, 29892, 3033, 1674, 29918, 1742, 29918, 2798, 13, 13, 13, 1753, 679, 29918, 996, 1674, 29918, 9303, 580, 1599, 3789, 29961, 710, 5387, 13, 1678, 9995, 13, 1678, 402, 1691, 263, 1051, 310, 4223, 3838, 515, 278, 302, 1896, 29895, 17266, 29874, 313, 30022, 29906, 29941, 29945, 29895, 3838, 467, 13, 1678, 405, 29889, 29933, 29901, 674, 5142, 278, 1734, 1051, 565, 451, 2307, 3625, 313, 30022, 29955, 29946, 29900, 29895, 29933, 511, 6858, 8986, 29889, 13, 1678, 584, 2457, 29901, 263, 731, 6943, 278, 4223, 3838, 13, 1678, 9995, 13, 1678, 302, 1896, 29895, 29889, 10382, 703, 9303, 1159, 29871, 396, 2811, 871, 5142, 565, 451, 12430, 3625, 29889, 13, 1678, 736, 731, 29898, 9303, 29889, 9303, 3101, 13, 13, 13, 1753, 526, 29918, 9303, 29918, 3084, 29898, 14941, 29918, 9303, 29901, 2391, 29961, 710, 1402, 13, 462, 1678, 3033, 1674, 29918, 1742, 29918, 2798, 29901, 938, 29892, 13, 462, 1678, 3349, 29918, 996, 1674, 29901, 6120, 29892, 13, 462, 1678, 671, 29918, 3893, 333, 29901, 6120, 29897, 1599, 6120, 29901, 13, 1678, 9995, 13, 1678, 5953, 837, 1475, 3692, 263, 1051, 310, 3838, 338, 2854, 2729, 373, 278, 4944, 4128, 29889, 13, 1678, 584, 3207, 5941, 29918, 9303, 29901, 263, 1051, 310, 5941, 1734, 6031, 29889, 13, 1678, 584, 3207, 3033, 1674, 29918, 1742, 29918, 2798, 29901, 278, 1353, 310, 3033, 1674, 3838, 6206, 515, 278, 1347, 2645, 5941, 292, 29889, 13, 1678, 584, 3207, 3349, 29918, 996, 1674, 29901, 3692, 470, 451, 304, 3349, 3033, 1674, 3838, 29889, 13, 1678, 584, 3207, 671, 29918, 3893, 333, 29901, 3692, 470, 451, 304, 671, 278, 6361, 333, 3489, 304, 8161, 565, 263, 1734, 338, 4223, 29889, 13, 1678, 584, 2457, 29901, 5852, 565, 14401, 749, 338, 2854, 29892, 7700, 6467, 29889, 13, 1678, 9995, 13, 1678, 396, 1222, 2325, 14401, 749, 565, 4069, 1156, 5941, 292, 13, 1678, 5941, 287, 29918, 3286, 3395, 353, 376, 11393, 7122, 29898, 14941, 29918, 9303, 467, 17010, 580, 13, 1678, 565, 5941, 287, 29918, 3286, 3395, 1275, 376, 1115, 13, 4706, 736, 7700, 13, 13, 1678, 396, 1222, 2325, 14401, 749, 565, 1405, 29871, 29896, 29900, 29995, 3033, 1674, 13, 1678, 565, 3349, 29918, 996, 1674, 322, 7431, 29898, 14941, 29918, 9303, 29897, 1405, 29871, 29900, 322, 3033, 1674, 29918, 1742, 29918, 2798, 847, 7431, 29898, 14941, 29918, 9303, 29897, 1405, 29871, 29900, 29889, 29896, 29901, 13, 4706, 396, 1596, 29898, 14486, 29898, 996, 1674, 29918, 1742, 29918, 2798, 847, 7431, 29898, 14941, 29918, 9303, 8243, 1301, 29892, 934, 29922, 9675, 29889, 303, 20405, 29897, 13, 4706, 736, 7700, 13, 13, 1678, 396, 1222, 2325, 14401, 749, 565, 6361, 333, 22405, 967, 3033, 1674, 13, 1678, 565, 3349, 29918, 996, 1674, 322, 671, 29918, 3893, 333, 29901, 13, 4706, 6361, 333, 29918, 25378, 353, 17088, 12889, 29889, 3166, 29918, 4299, 1807, 29898, 4299, 29892, 6056, 29918, 771, 5824, 29922, 5574, 29897, 13, 4706, 6361, 29892, 2070, 353, 6361, 333, 29918, 25378, 29889, 1990, 1598, 29898, 14941, 287, 29918, 3286, 3395, 29897, 13, 4706, 565, 6361, 1275, 376, 264, 29908, 322, 2070, 1405, 29871, 29900, 29889, 29945, 29901, 13, 9651, 736, 7700, 13, 1678, 736, 5852, 13, 13, 13, 1753, 5941, 29918, 3126, 29918, 6463, 749, 29898, 6463, 749, 29901, 360, 919, 29961, 710, 29892, 851, 1402, 13, 462, 308, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 308, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 308, 4266, 29918, 11436, 29901, 731, 353, 426, 8516, 1118, 13, 462, 308, 13962, 29918, 11338, 29901, 731, 353, 426, 8516, 1118, 13, 462, 308, 3349, 29918, 996, 1674, 29901, 6120, 353, 7700, 29892, 13, 462, 308, 671, 29918, 3893, 333, 29901, 6120, 353, 7700, 29897, 1599, 360, 919, 29961, 710, 29892, 851, 5387, 13, 1678, 9995, 13, 1678, 315, 14044, 385, 14401, 749, 313, 11980, 8600, 29897, 2729, 373, 278, 2183, 4128, 29889, 13, 1678, 584, 3207, 14401, 749, 29901, 5132, 8600, 29892, 1818, 505, 263, 525, 3286, 924, 29915, 1820, 29899, 1767, 29889, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 17820, 29889, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 5191, 411, 8162, 29889, 13, 1678, 584, 3207, 4266, 29918, 11436, 29901, 263, 1051, 310, 3838, 304, 2337, 3349, 515, 278, 1962, 29889, 13, 1678, 584, 3207, 13962, 29918, 11338, 29901, 263, 1051, 310, 8282, 304, 2337, 3349, 515, 278, 1962, 29889, 13, 1678, 584, 3207, 3349, 29918, 996, 1674, 29901, 3692, 470, 451, 304, 3349, 4223, 515, 278, 14401, 2925, 29889, 13, 1678, 584, 3207, 671, 29918, 3893, 333, 29901, 3692, 470, 451, 304, 671, 278, 6361, 333, 3489, 304, 12439, 4223, 304, 3349, 29889, 13, 1678, 584, 2457, 29901, 5941, 287, 14401, 749, 313, 27126, 467, 13, 1678, 9995, 13, 13, 1678, 396, 14402, 1207, 445, 385, 5067, 4444, 13, 1678, 396, 4266, 29918, 11436, 353, 6796, 29966, 25590, 663, 29958, 3108, 29871, 396, 3139, 3838, 366, 864, 304, 11455, 13, 13, 1678, 565, 3349, 29918, 996, 1674, 29901, 13, 4706, 3033, 1674, 29918, 9303, 353, 679, 29918, 996, 1674, 29918, 9303, 580, 29871, 396, 758, 29899, 1359, 4223, 1034, 13364, 13, 1678, 1683, 29901, 13, 4706, 3033, 1674, 29918, 9303, 353, 731, 580, 13, 13, 1678, 396, 315, 14044, 278, 1426, 297, 278, 9657, 29892, 3639, 263, 1051, 310, 5941, 287, 3838, 13, 1678, 5941, 29918, 9303, 29892, 3033, 1674, 29918, 1742, 29918, 2798, 353, 320, 13, 4706, 5941, 29918, 6463, 749, 29898, 6463, 749, 29922, 6463, 749, 29892, 13, 462, 4706, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 29892, 13, 462, 4706, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29892, 13, 462, 4706, 4266, 29918, 11436, 29922, 18732, 29918, 11436, 29892, 13, 462, 4706, 13962, 29918, 11338, 29922, 3286, 18411, 29918, 11338, 29892, 13, 462, 4706, 3349, 29918, 996, 1674, 29922, 5992, 29918, 996, 1674, 29892, 13, 462, 4706, 3033, 1674, 29918, 9303, 29922, 996, 1674, 29918, 9303, 13, 462, 4706, 1723, 13, 13, 1678, 396, 5399, 393, 278, 5941, 287, 3838, 526, 2854, 313, 347, 29892, 451, 1870, 29892, 451, 4223, 2992, 29897, 13, 1678, 565, 526, 29918, 9303, 29918, 3084, 29898, 14941, 29918, 9303, 29892, 13, 462, 539, 3033, 1674, 29918, 1742, 29918, 2798, 29892, 13, 462, 539, 3349, 29918, 996, 1674, 29892, 13, 462, 539, 671, 29918, 3893, 333, 1125, 13, 4706, 5941, 287, 29918, 3286, 924, 353, 376, 11393, 7122, 29898, 14941, 29918, 9303, 467, 17010, 580, 13, 1678, 1683, 29901, 13, 4706, 396, 14402, 338, 372, 1900, 304, 736, 385, 4069, 851, 1244, 470, 12020, 385, 1059, 29973, 13, 4706, 5941, 287, 29918, 3286, 924, 353, 5124, 13, 13, 1678, 14401, 749, 1839, 3286, 924, 2033, 353, 5941, 287, 29918, 3286, 924, 13, 1678, 736, 14401, 749, 13, 13, 13, 1753, 5941, 29918, 3126, 29918, 1272, 29898, 3126, 29918, 1272, 29901, 2391, 29961, 21533, 29961, 710, 29892, 851, 20526, 13, 462, 1678, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 1678, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 1678, 4266, 29918, 11436, 29901, 731, 353, 426, 8516, 1118, 13, 462, 1678, 13962, 29918, 11338, 29901, 731, 353, 426, 8516, 1118, 13, 462, 1678, 3349, 29918, 996, 1674, 29901, 6120, 353, 7700, 29892, 13, 462, 1678, 671, 29918, 3893, 333, 29901, 6120, 353, 7700, 29892, 13, 462, 1678, 1723, 1599, 2391, 29961, 21533, 29961, 710, 29892, 851, 5262, 29901, 13, 1678, 9995, 13, 1678, 315, 14044, 263, 1051, 310, 14401, 2925, 313, 11980, 21503, 4314, 29897, 2729, 373, 278, 2183, 4128, 29889, 13, 1678, 584, 3207, 4390, 29918, 1272, 29901, 2391, 310, 5132, 21503, 4314, 29892, 1269, 1818, 505, 263, 525, 3286, 924, 29915, 1820, 29899, 1767, 29889, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 17820, 29889, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 5191, 411, 8162, 29889, 13, 1678, 584, 3207, 4266, 29918, 11436, 29901, 263, 1051, 310, 3838, 304, 2337, 3349, 515, 278, 1962, 29889, 13, 1678, 584, 3207, 13962, 29918, 11338, 29901, 263, 1051, 310, 8282, 304, 2337, 3349, 515, 278, 1962, 29889, 13, 1678, 584, 3207, 3349, 29918, 996, 1674, 29901, 3692, 470, 451, 304, 3349, 4223, 515, 278, 14401, 2925, 29889, 13, 1678, 584, 3207, 671, 29918, 3893, 333, 29901, 3692, 470, 451, 304, 671, 278, 6361, 333, 3489, 304, 12439, 4223, 304, 3349, 29889, 13, 1678, 584, 2457, 29901, 1051, 310, 5941, 287, 14401, 2925, 313, 29467, 4314, 467, 13, 1678, 9995, 13, 1678, 4390, 29918, 1272, 29918, 14941, 287, 353, 5159, 13, 1678, 363, 14401, 749, 297, 4390, 29918, 1272, 29901, 13, 4706, 14401, 749, 29918, 14941, 287, 353, 5941, 29918, 3126, 29918, 6463, 749, 29898, 6463, 749, 29892, 13, 462, 462, 462, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 29892, 13, 462, 462, 462, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29892, 13, 462, 462, 462, 4266, 29918, 11436, 29922, 18732, 29918, 11436, 29892, 13, 462, 462, 462, 13962, 29918, 11338, 29922, 3286, 18411, 29918, 11338, 29892, 13, 462, 462, 462, 3349, 29918, 996, 1674, 29922, 5992, 29918, 996, 1674, 29892, 13, 462, 462, 462, 671, 29918, 3893, 333, 29922, 1509, 29918, 3893, 333, 29897, 13, 4706, 4390, 29918, 1272, 29918, 14941, 287, 29889, 4397, 29898, 6463, 749, 29918, 14941, 287, 29897, 13, 1678, 736, 4390, 29918, 1272, 29918, 14941, 287, 13, 13, 13, 1753, 6597, 29918, 1202, 3245, 29918, 2616, 1971, 29874, 29898, 1202, 3245, 29918, 2616, 13364, 29901, 851, 353, 15516, 13, 462, 1669, 1034, 13364, 29918, 3945, 29901, 851, 353, 15516, 13, 462, 1669, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 1669, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 851, 353, 27255, 1599, 6213, 29901, 13, 1678, 9995, 13, 1678, 323, 6926, 263, 1426, 934, 29892, 6597, 29879, 599, 25260, 322, 15873, 963, 304, 278, 1667, 1034, 13364, 934, 29889, 13, 1678, 584, 3207, 5684, 29918, 2616, 13364, 29901, 278, 2224, 304, 263, 8656, 726, 934, 304, 6597, 5684, 25260, 29914, 9012, 515, 13, 1678, 584, 3207, 1034, 13364, 29918, 3945, 29901, 278, 2224, 304, 278, 13126, 1034, 13364, 29889, 3945, 934, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 17820, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 5191, 411, 8162, 13, 1678, 9995, 13, 1678, 1596, 703, 2616, 13364, 29918, 3945, 613, 1034, 13364, 29918, 3945, 29897, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 29898, 2616, 13364, 29918, 3945, 1125, 13, 4706, 2436, 29918, 8513, 353, 525, 29874, 29915, 29871, 396, 9773, 565, 2307, 4864, 13, 1678, 1683, 29901, 13, 4706, 2436, 29918, 8513, 353, 525, 29893, 29915, 29871, 396, 1207, 263, 716, 934, 565, 451, 13, 1678, 411, 1722, 29898, 2616, 13364, 29918, 3945, 29892, 2436, 29918, 8513, 29897, 408, 1034, 13364, 29918, 3945, 29918, 1445, 29901, 13, 4706, 565, 2897, 29889, 2084, 29889, 9933, 29898, 1202, 3245, 29918, 2616, 13364, 1125, 13, 9651, 1596, 29898, 29888, 29908, 5647, 1461, 292, 1034, 13364, 6455, 515, 29901, 426, 1202, 3245, 29918, 2616, 13364, 27195, 13, 9651, 411, 1722, 29898, 1202, 3245, 29918, 2616, 13364, 29892, 376, 29878, 613, 8025, 543, 9420, 29899, 29947, 613, 1723, 408, 934, 29918, 29901, 13, 18884, 363, 1196, 297, 934, 5396, 949, 9012, 7295, 13, 462, 1678, 396, 5941, 278, 1426, 3412, 278, 982, 13, 462, 1678, 1196, 353, 320, 13, 462, 4706, 5376, 29918, 2541, 29918, 29886, 18049, 29884, 362, 29898, 726, 29922, 1220, 29892, 13, 462, 462, 795, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 29892, 13, 462, 462, 795, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29922, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29897, 13, 462, 1678, 565, 451, 1196, 29889, 1975, 2541, 28909, 29876, 29374, 13, 462, 4706, 1196, 353, 1196, 718, 11297, 29876, 29915, 13, 462, 1678, 1034, 13364, 29918, 3945, 29918, 1445, 29889, 8231, 24210, 29898, 1220, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 29898, 29888, 29908, 1184, 29894, 2618, 5684, 1426, 5684, 29918, 2616, 13364, 934, 2224, 8340, 29901, 376, 13, 462, 29871, 285, 29908, 29912, 1202, 3245, 29918, 2616, 13364, 27195, 13, 13, 13, 1753, 5376, 29918, 2541, 29918, 29886, 18049, 29884, 362, 29898, 726, 29901, 851, 353, 15516, 13, 462, 3986, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 851, 353, 15516, 13, 462, 3986, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 851, 353, 27255, 1599, 851, 29901, 13, 1678, 9995, 13, 1678, 5240, 586, 267, 6035, 22999, 362, 515, 263, 1347, 13, 1678, 584, 3207, 1426, 29901, 2441, 1426, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 17820, 13, 1678, 584, 3207, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 6035, 22999, 362, 17997, 304, 5191, 411, 8162, 13, 1678, 584, 2457, 29901, 5941, 287, 1426, 13, 1678, 9995, 13, 1678, 716, 29918, 726, 29901, 851, 353, 1426, 13, 1678, 396, 22096, 277, 895, 3902, 3689, 937, 29892, 1438, 526, 6035, 22999, 362, 17997, 393, 278, 1404, 6166, 13, 1678, 565, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29901, 13, 4706, 4766, 29918, 517, 29918, 24516, 356, 29918, 1609, 353, 337, 29889, 21587, 29898, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29897, 13, 4706, 716, 29918, 726, 353, 337, 29889, 1491, 29898, 9600, 29908, 19660, 11037, 29918, 517, 29918, 24516, 356, 29918, 1609, 6525, 613, 376, 9162, 716, 29918, 726, 29897, 13, 1678, 396, 1987, 17820, 278, 1791, 13, 1678, 565, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29901, 13, 4706, 4766, 29918, 517, 29918, 27756, 29918, 1609, 353, 337, 29889, 21587, 29898, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 29897, 13, 4706, 716, 29918, 726, 353, 337, 29889, 1491, 29898, 9600, 29908, 19660, 11037, 29918, 517, 29918, 27756, 29918, 1609, 6525, 613, 12633, 716, 29918, 726, 29897, 13, 1678, 736, 716, 29918, 726, 13, 13, 13, 1753, 1667, 580, 1599, 6213, 29901, 13, 1678, 9995, 13, 1678, 7525, 278, 4152, 5941, 29918, 3126, 1889, 408, 263, 1899, 1196, 19725, 29889, 13, 1678, 10783, 482, 29901, 3017, 29941, 5941, 29918, 3126, 29889, 2272, 518, 489, 29875, 2672, 7724, 29962, 518, 489, 29877, 19474, 7724, 29962, 21069, 29878, 29962, 21069, 29884, 29962, 13, 1678, 9995, 13, 1678, 13812, 29901, 23125, 11726, 353, 23125, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29875, 613, 376, 489, 262, 1445, 613, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 1371, 543, 1576, 2224, 304, 278, 26616, 4390, 934, 304, 5941, 19602, 13, 462, 4706, 3734, 29922, 5574, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29877, 613, 376, 489, 449, 1445, 613, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 1371, 543, 1576, 2224, 304, 278, 5941, 4390, 934, 304, 2436, 304, 613, 13, 462, 4706, 3734, 29922, 5574, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29878, 613, 376, 489, 5992, 29918, 996, 1674, 613, 13, 462, 4706, 1371, 543, 15941, 3033, 1674, 29899, 4561, 14401, 2925, 613, 13, 462, 4706, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29884, 613, 376, 489, 1509, 29918, 3893, 333, 613, 13, 462, 4706, 1371, 543, 11403, 6361, 333, 3489, 304, 6459, 4223, 613, 13, 462, 4706, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 396, 14402, 788, 21274, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29883, 613, 376, 489, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 613, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 1371, 543, 1451, 1503, 304, 17820, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29872, 613, 376, 489, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 613, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 1371, 543, 1451, 1503, 304, 17820, 322, 5191, 411, 8162, 1159, 13, 13, 1678, 6273, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 26616, 29918, 3126, 29918, 1272, 29901, 2391, 29961, 21533, 29961, 710, 29892, 851, 5262, 353, 2254, 29918, 3126, 29918, 1445, 29898, 25699, 29889, 262, 1445, 29897, 13, 1678, 714, 1445, 353, 6273, 29889, 449, 1445, 565, 6273, 29889, 449, 1445, 1683, 10876, 29889, 25393, 13, 13, 1678, 1596, 29898, 29888, 29908, 5072, 292, 26616, 4390, 848, 426, 25699, 29889, 262, 1445, 29913, 856, 1159, 13, 13, 1678, 22289, 29918, 1272, 353, 5941, 29918, 3126, 29918, 1272, 29898, 3126, 29918, 1272, 29922, 3972, 1017, 29918, 3126, 29918, 1272, 29892, 13, 462, 462, 1678, 3349, 29918, 996, 1674, 29922, 25699, 29889, 5992, 29918, 996, 1674, 29892, 13, 462, 462, 1678, 671, 29918, 3893, 333, 29922, 25699, 29889, 1509, 29918, 3893, 333, 29892, 13, 462, 462, 1678, 6035, 22999, 362, 29918, 517, 29918, 27756, 29918, 1609, 29922, 25699, 29889, 29886, 18049, 29884, 362, 29918, 517, 29918, 27756, 29918, 1609, 29892, 13, 462, 462, 1678, 6035, 22999, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29922, 25699, 29889, 29886, 18049, 29884, 362, 29918, 517, 29918, 24516, 356, 29918, 1609, 29897, 13, 13, 1678, 2436, 29918, 1272, 29918, 517, 29918, 3126, 29918, 1445, 29898, 1272, 29922, 1761, 29898, 4572, 287, 29918, 1272, 511, 13, 462, 9651, 934, 29918, 978, 29922, 449, 1445, 29897, 13, 13, 1678, 1596, 29898, 29888, 29908, 12881, 3276, 29991, 399, 4859, 426, 710, 29898, 2435, 29898, 4572, 287, 29918, 1272, 876, 29913, 1301, 699, 1980, 23157, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 2 ]
server.py
vitorpamplona/relayserver
0
140114
import socket # for connecting to the server import _thread # to manage multiple clients import json # to enconde and decode the data host = '127.0.0.1' port = 5000 # initiate port no above 1024 clients = {} def server_program(): print('Starting Relay Server at ' + host + ':' + str(port)) # show in terminal print('Waiting for clients...') server_socket = socket.socket() # get instance server_socket.bind((host, port)) # bind host address and port together # configure how many clients the server can listen simultaneously server_socket.listen(2) while True: conn, address = server_socket.accept() # accept new connection _thread.start_new_thread(on_new_client,(conn, address)) #puts into a thread. server_socket.close() # close the connection def on_new_client(clientsocket, addr): # print("Connection from: " + str(addr)) # print("Waiting for client name...") # wait for the first message. msgRaw = clientsocket.recv(1024).decode() # print("Message received: " + msgRaw) # Register the socket name at a list. msgDict = json.loads(msgRaw) print(msgDict['client_id'] + " connected") clients[msgDict['client_id']] = clientsocket wait_for_next_message(clientsocket, msgDict['client_id']) def wait_for_next_message(clientsocket, client_id): # wait for a message. msgRaw = clientsocket.recv(1024).decode() while msgRaw: print("Message received from " + client_id + ": " + msgRaw) msgDict = json.loads(msgRaw) if msgDict['to'] in clients.keys(): #reformat the message formattedMsg = json.dumps({'from': client_id, 'data': msgDict['data']}) # sending it to the next partner clients[msgDict['to']].send(formattedMsg.encode()) # send data to the client else: print(msgDict['to'] + ' is not connected') # could not find the other socket formattedMsg = json.dumps({'error':msgDict['to']+ ' not found'}) # sending error message back. clientsocket.send(formattedMsg.encode()) # send data to the client #wait for next message msgRaw = clientsocket.recv(1024).decode() clientsocket.close() if __name__ == '__main__': server_program()
[ 1, 1053, 9909, 396, 363, 16791, 304, 278, 1923, 13, 5215, 903, 7097, 396, 304, 10933, 2999, 13154, 13, 5215, 4390, 396, 304, 427, 15973, 322, 21822, 278, 848, 13, 13, 3069, 353, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29915, 13, 637, 353, 29871, 29945, 29900, 29900, 29900, 29871, 396, 14511, 403, 2011, 694, 2038, 29871, 29896, 29900, 29906, 29946, 13, 13, 11303, 1237, 353, 6571, 13, 13, 1753, 1923, 29918, 8860, 7295, 13, 1678, 1596, 877, 4763, 292, 6376, 388, 5656, 472, 525, 718, 3495, 718, 525, 11283, 718, 851, 29898, 637, 876, 29871, 396, 1510, 297, 8638, 13, 1678, 1596, 877, 15716, 292, 363, 13154, 856, 1495, 13, 13, 1678, 1923, 29918, 11514, 353, 9909, 29889, 11514, 580, 29871, 396, 679, 2777, 13, 1678, 1923, 29918, 11514, 29889, 5355, 3552, 3069, 29892, 2011, 876, 29871, 396, 7868, 3495, 3211, 322, 2011, 4208, 13, 13, 1678, 396, 10822, 920, 1784, 13154, 278, 1923, 508, 11621, 21699, 13, 1678, 1923, 29918, 11514, 29889, 20631, 29898, 29906, 29897, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 11009, 29892, 3211, 353, 1923, 29918, 11514, 29889, 16044, 580, 29871, 396, 3544, 716, 3957, 13, 4706, 903, 7097, 29889, 2962, 29918, 1482, 29918, 7097, 29898, 265, 29918, 1482, 29918, 4645, 22657, 13082, 29892, 3211, 876, 396, 649, 29879, 964, 263, 3244, 29889, 29871, 13, 13, 1678, 1923, 29918, 11514, 29889, 5358, 580, 29871, 396, 3802, 278, 3957, 13, 13, 1753, 373, 29918, 1482, 29918, 4645, 29898, 4645, 11514, 29892, 28915, 1125, 13, 1678, 396, 1596, 703, 5350, 515, 29901, 376, 718, 851, 29898, 10030, 876, 13, 1678, 396, 1596, 703, 15716, 292, 363, 3132, 1024, 856, 1159, 13, 13, 1678, 396, 4480, 363, 278, 937, 2643, 29889, 29871, 13, 1678, 10191, 22131, 353, 3132, 11514, 29889, 3757, 29894, 29898, 29896, 29900, 29906, 29946, 467, 13808, 580, 13, 1678, 396, 1596, 703, 3728, 4520, 29901, 376, 718, 10191, 22131, 29897, 13, 268, 13, 1678, 396, 12577, 278, 9909, 1024, 472, 263, 1051, 29889, 29871, 13, 1678, 10191, 21533, 353, 4390, 29889, 18132, 29898, 7645, 22131, 29897, 13, 1678, 1596, 29898, 7645, 21533, 1839, 4645, 29918, 333, 2033, 718, 376, 6631, 1159, 13, 1678, 13154, 29961, 7645, 21533, 1839, 4645, 29918, 333, 2033, 29962, 353, 3132, 11514, 13, 13, 1678, 4480, 29918, 1454, 29918, 4622, 29918, 4906, 29898, 4645, 11514, 29892, 10191, 21533, 1839, 4645, 29918, 333, 11287, 13, 13, 1753, 4480, 29918, 1454, 29918, 4622, 29918, 4906, 29898, 4645, 11514, 29892, 3132, 29918, 333, 1125, 29871, 13, 1678, 396, 4480, 363, 263, 2643, 29889, 29871, 13, 1678, 10191, 22131, 353, 3132, 11514, 29889, 3757, 29894, 29898, 29896, 29900, 29906, 29946, 467, 13808, 580, 13, 13, 1678, 1550, 10191, 22131, 29901, 539, 13, 4706, 1596, 703, 3728, 4520, 515, 376, 718, 3132, 29918, 333, 718, 29242, 376, 718, 10191, 22131, 29897, 13, 4706, 10191, 21533, 353, 4390, 29889, 18132, 29898, 7645, 22131, 29897, 13, 13, 4706, 565, 10191, 21533, 1839, 517, 2033, 297, 13154, 29889, 8149, 7295, 13, 9651, 396, 276, 4830, 278, 2643, 268, 13, 9651, 20917, 16190, 353, 4390, 29889, 29881, 17204, 3319, 29915, 3166, 2396, 3132, 29918, 333, 29892, 525, 1272, 2396, 10191, 21533, 1839, 1272, 2033, 1800, 13, 9651, 396, 9348, 372, 304, 278, 2446, 18096, 1678, 13, 9651, 13154, 29961, 7645, 21533, 1839, 517, 2033, 1822, 6717, 29898, 689, 19667, 16190, 29889, 12508, 3101, 29871, 396, 3638, 848, 304, 278, 3132, 13, 4706, 1683, 29901, 13, 9651, 1596, 29898, 7645, 21533, 1839, 517, 2033, 718, 525, 338, 451, 6631, 1495, 13, 9651, 396, 1033, 451, 1284, 278, 916, 9909, 29871, 13, 9651, 20917, 16190, 353, 4390, 29889, 29881, 17204, 3319, 29915, 2704, 2396, 7645, 21533, 1839, 517, 2033, 29974, 525, 451, 1476, 29915, 1800, 13, 9651, 396, 9348, 1059, 2643, 1250, 29889, 13, 9651, 3132, 11514, 29889, 6717, 29898, 689, 19667, 16190, 29889, 12508, 3101, 29871, 396, 3638, 848, 304, 278, 3132, 13, 13, 4706, 396, 10685, 363, 2446, 2643, 13, 4706, 10191, 22131, 353, 3132, 11514, 29889, 3757, 29894, 29898, 29896, 29900, 29906, 29946, 467, 13808, 580, 13, 13, 1678, 3132, 11514, 29889, 5358, 580, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1923, 29918, 8860, 580, 2 ]
Algorithms/LCP/29/math1.py
M-Quadra/LeetCode-problems
0
17971
<reponame>M-Quadra/LeetCode-problems class Solution: def orchestraLayout(self, num: int, xPos: int, yPos: int) -> int: a, b = (min(xPos, num-1-yPos), 1) if yPos >= xPos else (min(yPos, num-1-xPos), -1) return (4*num*a - 4*a*a - 2*a + b*(xPos+yPos) + (b>>1&1)*4*(num-a-1))%9 + 1
[ 1, 529, 276, 1112, 420, 29958, 29924, 29899, 2182, 328, 336, 29914, 3226, 300, 3399, 29899, 17199, 29879, 13, 1990, 24380, 29901, 13, 1678, 822, 470, 15554, 3453, 29898, 1311, 29892, 954, 29901, 938, 29892, 921, 9135, 29901, 938, 29892, 343, 9135, 29901, 938, 29897, 1599, 938, 29901, 13, 4706, 263, 29892, 289, 353, 313, 1195, 29898, 29916, 9135, 29892, 954, 29899, 29896, 29899, 29891, 9135, 511, 29871, 29896, 29897, 565, 343, 9135, 6736, 921, 9135, 1683, 313, 1195, 29898, 29891, 9135, 29892, 954, 29899, 29896, 29899, 29916, 9135, 511, 448, 29896, 29897, 13, 4706, 736, 313, 29946, 29930, 1949, 29930, 29874, 448, 29871, 29946, 29930, 29874, 29930, 29874, 448, 29871, 29906, 29930, 29874, 718, 289, 16395, 29916, 9135, 29974, 29891, 9135, 29897, 718, 313, 29890, 6778, 29896, 29987, 29896, 11877, 29946, 16395, 1949, 29899, 29874, 29899, 29896, 876, 29995, 29929, 718, 29871, 29896, 2 ]
lecture_04/312_plan_motion_ros_artist.py
farzanehesk/COMPAS-II-FS2022
11
17499
import math import time from compas_fab.backends import RosClient from compas.artists import Artist from compas.geometry import Frame with RosClient("localhost") as client: robot = client.load_robot(load_geometry=True) group = robot.main_group_name frame = Frame((0.4, 0.3, 0.05), (-1, 0, 0), (0, 1, 0)) tolerance_position = 0.001 tolerance_axes = [math.radians(1)] * 3 start_configuration = robot.zero_configuration() start_configuration.joint_values = (-0.106, 5.351, 2.231, -2.869, 4.712, 1.465) # create goal constraints from frame goal_constraints = robot.constraints_from_frame(frame, tolerance_position, tolerance_axes, group) trajectory = robot.plan_motion(goal_constraints, start_configuration, group, options=dict(planner_id="RRT")) print("Computed kinematic path with %d configurations." % len(trajectory.points)) print("Executing this path at full speed would take approx. %.3f seconds." % trajectory.time_from_start) artist = Artist(robot.model) for tp in trajectory.points: config = robot.zero_configuration() config.joint_values = tp.joint_values artist.update(config) artist.draw_visual() artist.redraw() time.sleep(0.02)
[ 1, 1053, 5844, 13, 5215, 931, 13, 13, 3166, 752, 294, 29918, 16582, 29889, 1627, 1975, 1053, 5678, 4032, 13, 13, 3166, 752, 294, 29889, 442, 2879, 1053, 3012, 391, 13, 3166, 752, 294, 29889, 19156, 1053, 12218, 13, 13, 2541, 5678, 4032, 703, 7640, 1159, 408, 3132, 29901, 13, 1678, 19964, 353, 3132, 29889, 1359, 29918, 307, 7451, 29898, 1359, 29918, 19156, 29922, 5574, 29897, 13, 1678, 2318, 353, 19964, 29889, 3396, 29918, 2972, 29918, 978, 13, 13, 1678, 3515, 353, 12218, 3552, 29900, 29889, 29946, 29892, 29871, 29900, 29889, 29941, 29892, 29871, 29900, 29889, 29900, 29945, 511, 8521, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 511, 313, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 876, 13, 1678, 20341, 749, 29918, 3283, 353, 29871, 29900, 29889, 29900, 29900, 29896, 13, 1678, 20341, 749, 29918, 1165, 267, 353, 518, 755, 29889, 3665, 5834, 29898, 29896, 4638, 334, 29871, 29941, 13, 13, 1678, 1369, 29918, 13305, 353, 19964, 29889, 9171, 29918, 13305, 580, 13, 1678, 1369, 29918, 13305, 29889, 12090, 29918, 5975, 353, 8521, 29900, 29889, 29896, 29900, 29953, 29892, 29871, 29945, 29889, 29941, 29945, 29896, 29892, 29871, 29906, 29889, 29906, 29941, 29896, 29892, 448, 29906, 29889, 29947, 29953, 29929, 29892, 29871, 29946, 29889, 29955, 29896, 29906, 29892, 29871, 29896, 29889, 29946, 29953, 29945, 29897, 13, 13, 1678, 396, 1653, 7306, 11938, 515, 3515, 13, 1678, 7306, 29918, 13646, 29879, 353, 19964, 29889, 13646, 29879, 29918, 3166, 29918, 2557, 29898, 2557, 29892, 20341, 749, 29918, 3283, 29892, 20341, 749, 29918, 1165, 267, 29892, 2318, 29897, 13, 13, 1678, 23324, 706, 353, 19964, 29889, 9018, 29918, 29885, 8194, 29898, 28111, 29918, 13646, 29879, 29892, 1369, 29918, 13305, 29892, 2318, 29892, 3987, 29922, 8977, 29898, 572, 7310, 29918, 333, 543, 29934, 13079, 5783, 13, 13, 1678, 1596, 703, 20606, 287, 19015, 19217, 2224, 411, 1273, 29881, 22920, 1213, 1273, 7431, 29898, 3018, 622, 706, 29889, 9748, 876, 13, 1678, 1596, 703, 5379, 17068, 445, 2224, 472, 2989, 6210, 723, 2125, 2134, 29916, 29889, 18695, 29941, 29888, 6923, 1213, 1273, 23324, 706, 29889, 2230, 29918, 3166, 29918, 2962, 29897, 13, 13, 1678, 7664, 353, 3012, 391, 29898, 307, 7451, 29889, 4299, 29897, 13, 13, 1678, 363, 260, 29886, 297, 23324, 706, 29889, 9748, 29901, 13, 4706, 2295, 353, 19964, 29889, 9171, 29918, 13305, 580, 13, 4706, 2295, 29889, 12090, 29918, 5975, 353, 260, 29886, 29889, 12090, 29918, 5975, 13, 4706, 7664, 29889, 5504, 29898, 2917, 29897, 13, 4706, 7664, 29889, 4012, 29918, 20119, 580, 13, 4706, 7664, 29889, 1127, 1610, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29906, 29897, 13, 2 ]
pymath/vampire_numbers/vampire_numbers.py
JASTYN/pythonmaster
3
82769
def vampire_test(x, y): product = x * y if len(str(x) + str(y)) != len(str(product)): return False for i in str(x) + str(y): if i in str(product): return True else: return False
[ 1, 822, 325, 1160, 533, 29918, 1688, 29898, 29916, 29892, 343, 1125, 13, 1678, 3234, 353, 921, 334, 343, 13, 1678, 565, 7431, 29898, 710, 29898, 29916, 29897, 718, 851, 29898, 29891, 876, 2804, 7431, 29898, 710, 29898, 4704, 22164, 13, 4706, 736, 7700, 13, 13, 1678, 363, 474, 297, 851, 29898, 29916, 29897, 718, 851, 29898, 29891, 1125, 13, 4706, 565, 474, 297, 851, 29898, 4704, 1125, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 736, 7700, 13, 2 ]
sandbox/decorator_use.py
olileger/sBeull
0
1615107
<gh_stars>0 from decorator_def import FuncDecoratorOne, FuncDecoratorListProperties, ClassDecoratorOne class FuncDecoratorUse: def __init__(_self_): _self_.var1 = "test" _self_.var2 = "abc" _self_.var3 = 12345 @FuncDecoratorListProperties def FunctionOne(_self_, v): print("FunctionOne: ", v) t = FuncDecoratorUse() t.FunctionOne("Test") @ClassDecoratorOne class ClassDecoratorUser: def __init__(_self_): print("Hello, World !") t = ClassDecoratorUser()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 10200, 1061, 29918, 1753, 1053, 383, 4661, 6185, 272, 1061, 6716, 29892, 383, 4661, 6185, 272, 1061, 1293, 11857, 29892, 4134, 6185, 272, 1061, 6716, 13, 13, 1990, 383, 4661, 6185, 272, 1061, 11403, 29901, 13, 13, 1678, 822, 4770, 2344, 1649, 7373, 1311, 29918, 1125, 13, 4706, 903, 1311, 5396, 1707, 29896, 353, 376, 1688, 29908, 13, 4706, 903, 1311, 5396, 1707, 29906, 353, 376, 10736, 29908, 13, 4706, 903, 1311, 5396, 1707, 29941, 353, 29871, 29896, 29906, 29941, 29946, 29945, 13, 13, 1678, 732, 14400, 6185, 272, 1061, 1293, 11857, 13, 1678, 822, 6680, 6716, 7373, 1311, 3383, 325, 1125, 13, 4706, 1596, 703, 6678, 6716, 29901, 9162, 325, 29897, 13, 13, 13, 29873, 353, 383, 4661, 6185, 272, 1061, 11403, 580, 13, 29873, 29889, 6678, 6716, 703, 3057, 1159, 13, 13, 29992, 2385, 6185, 272, 1061, 6716, 13, 1990, 4134, 6185, 272, 1061, 2659, 29901, 13, 1678, 822, 4770, 2344, 1649, 7373, 1311, 29918, 1125, 13, 4706, 1596, 703, 10994, 29892, 2787, 1738, 1159, 13, 13, 29873, 353, 4134, 6185, 272, 1061, 2659, 580, 2 ]
pyglobi/config.py
nicholac/pyglobi
0
92040
<gh_stars>0 # -*- coding: utf-8 -*- """ pyglobi.config ~~~~~~~~~~~~ Configuration used by pyglobi :copyright: (c) 2019 by <NAME>. :license: MIT, see LICENSE for more details. """ # Base URL's globi_neo_url = "https://neo4j.globalbioticinteractions.org/db/data/cypher" eol_url = "https://eol.org/pages" eol_geo_url = "https://eol.org/data/map_data_dwca"
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 15945, 29908, 13, 2272, 23705, 29875, 29889, 2917, 13, 26594, 14087, 13, 8614, 1304, 491, 19484, 2127, 29875, 13, 29901, 8552, 1266, 29901, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29929, 491, 529, 5813, 15513, 13, 29901, 506, 1947, 29901, 341, 1806, 29892, 1074, 365, 2965, 1430, 1660, 363, 901, 4902, 29889, 13, 15945, 29908, 13, 13, 29937, 7399, 3988, 29915, 29879, 13, 23705, 29875, 29918, 11496, 29918, 2271, 353, 376, 991, 597, 11496, 29946, 29926, 29889, 10945, 5365, 13574, 1639, 7387, 29889, 990, 29914, 2585, 29914, 1272, 29914, 1270, 8096, 29908, 13, 13, 29872, 324, 29918, 2271, 353, 376, 991, 597, 29872, 324, 29889, 990, 29914, 12292, 29908, 13, 13, 29872, 324, 29918, 24756, 29918, 2271, 353, 376, 991, 597, 29872, 324, 29889, 990, 29914, 1272, 29914, 1958, 29918, 1272, 29918, 28012, 1113, 29908, 13, 2 ]
pset_4/tasks/stylize.py
GabrielBG010/PSET4
0
155053
<reponame>GabrielBG010/PSET4<gh_stars>0 import os import luigi from luigi import ExternalTask, Parameter, Task, LocalTarget from luigi.format import FileWrapper from csci_utils.luigi.target import SuffixPreservingLocalTarget from neural_style.neural_style import stylize from pset_4.tasks.data import DownloadImage, DownloadModel class Stylize(Task): """ Luigi Taks that stylize images according to a model """ model = Parameter(default=r"rain_princess.pth") image = Parameter(default=r"luigi.jpg") def requires(self): return { 'image': self.clone(DownloadImage), 'model': self.clone(DownloadModel) } def output(self): # return SuffixPreservingLocalTarget of the stylized image return SuffixPreservingLocalTarget(os.path.join('images_out', "luigiout.jpg"), format=luigi.format.Nop) def run(self): inputs = self.input() with self.output().temporary_path() as temp_output_path: class args: content_image = inputs['image'].path output_image = temp_output_path model = inputs['model'].path cuda = 0 content_scale = None export_onnx = None stylize(args)
[ 1, 529, 276, 1112, 420, 29958, 29954, 370, 12836, 29933, 29954, 29900, 29896, 29900, 29914, 29925, 10490, 29946, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 13, 5215, 8092, 10091, 13, 3166, 8092, 10091, 1053, 3985, 5398, 29892, 24953, 29892, 9330, 29892, 9959, 8667, 13, 13, 3166, 8092, 10091, 29889, 4830, 1053, 3497, 15646, 13, 3166, 5939, 455, 29918, 13239, 29889, 6092, 10091, 29889, 5182, 1053, 2166, 600, 861, 13504, 29530, 7717, 8667, 13, 3166, 19677, 29918, 3293, 29889, 484, 3631, 29918, 3293, 1053, 380, 2904, 675, 13, 3166, 282, 842, 29918, 29946, 29889, 20673, 29889, 1272, 1053, 25553, 2940, 29892, 25553, 3195, 13, 13, 13, 1990, 624, 2904, 675, 29898, 5398, 1125, 13, 1678, 9995, 13, 1678, 22487, 323, 10327, 393, 380, 2904, 675, 4558, 5034, 304, 263, 1904, 13, 1678, 9995, 13, 13, 1678, 1904, 353, 24953, 29898, 4381, 29922, 29878, 29908, 6038, 29918, 558, 262, 985, 29889, 29886, 386, 1159, 13, 1678, 1967, 353, 24953, 29898, 4381, 29922, 29878, 29908, 6092, 10091, 29889, 6173, 1159, 13, 13, 1678, 822, 6858, 29898, 1311, 1125, 13, 4706, 736, 426, 13, 9651, 525, 3027, 2396, 1583, 29889, 16513, 29898, 22954, 2940, 511, 13, 9651, 525, 4299, 2396, 1583, 29889, 16513, 29898, 22954, 3195, 29897, 13, 4706, 500, 13, 13, 1678, 822, 1962, 29898, 1311, 1125, 13, 4706, 396, 736, 2166, 600, 861, 13504, 29530, 7717, 8667, 310, 278, 380, 2904, 1891, 1967, 13, 4706, 736, 2166, 600, 861, 13504, 29530, 7717, 8667, 29898, 359, 29889, 2084, 29889, 7122, 877, 8346, 29918, 449, 742, 376, 6092, 10091, 449, 29889, 6173, 4968, 3402, 29922, 6092, 10091, 29889, 4830, 29889, 29940, 459, 29897, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 10970, 353, 1583, 29889, 2080, 580, 13, 4706, 411, 1583, 29889, 4905, 2141, 1356, 1971, 653, 29918, 2084, 580, 408, 5694, 29918, 4905, 29918, 2084, 29901, 13, 9651, 770, 6389, 29901, 13, 18884, 2793, 29918, 3027, 353, 10970, 1839, 3027, 13359, 2084, 13, 18884, 1962, 29918, 3027, 353, 5694, 29918, 4905, 29918, 2084, 13, 18884, 1904, 353, 10970, 1839, 4299, 13359, 2084, 13, 18884, 274, 6191, 353, 29871, 29900, 13, 18884, 2793, 29918, 7052, 353, 6213, 13, 18884, 5609, 29918, 3409, 29916, 353, 6213, 13, 13, 9651, 380, 2904, 675, 29898, 5085, 29897, 13, 2 ]
movements.py
sxnnytripathi/GestureGaming
0
105598
<gh_stars>0 import numpy as np import cv2 import time import math import imutils from imutils.video import FileVideoStream, VideoStream import keyboard from pynput.keyboard import Key, Controller # keyboard=Controller() size_height = 600 size_width = 600 last = 0 # last extreme of steer chng = 3 # change in last, to remove small changes fulucations chngt = 3 # to restart change to 0, if moved towards centre by some value COLOR_RED = (0, 0, 255) COLOR_BLACK = (0, 0, 0) THRESH_ACTION = 60 # t def get_centroid(bbox): # center point of rectangle x, y, w, h = bbox centx = (2 * x + w) // 2 centy = (2 * y + h) // 2 return (centx, centy) def draw_circle(frame, center, radius=THRESH_ACTION, color=COLOR_BLACK, thickness=3): cv2.circle(frame, center, radius, color, thickness) def drawbox(ret, bbox, frame): # draws rectangle from bbox global q if ret: # Tracking Success p1 = (int(bbox[0]), int(bbox[1])) p2 = (int(bbox[0] + bbox[2]), int(bbox[1] + bbox[3])) cv2.rectangle(frame, p1, p2, (255, 0, 0), 2, 1) if p1[0] < 10: # quits program if taken hand to left top corner q = True # quit color = {"blue": (255, 0, 0), "red": (0, 0, 255), "green": (0, 255, 0), "white": (255, 255, 255)} def detect_center(img, hand): # convert image to gray-scale # drawing rectangle around the feature and labeling it (x, y, w, h) = [int(v) for v in hand] # cv2.rectangle(img, (x,y), (x+w, y+h), color['green'], 2) #uncomment if you want to see face boundary cv2.circle(img, ((2 * x + w) // 2, (2 * y + h) // 2), 2, color['green'], 2) hand = ((2 * x + w) // 2, (2 * y + h) // 2) return img, hand # cord value will be decided by uh by assigning the cirle on screen def draw_controller_left(img, cords): size = 40 # x1 = cords[0] - size y1 = cords[1] - size # x2 = cords[0] + size y2 = cords[1] + size cv2.circle(img, cords, size, color['blue'], 2) return (y1, y2) def draw_controller_right(img, cords): size = 40 x1 = cords[0] - size # y1 = cords[1] - size x2 = cords[0] + size # y2 = cords[1] + size cv2.circle(img, cords, size, color['red'], 2) return (x1, x2) def keyboard_events_l(lcord, cord_left, cmd): try: # x1,x2 = cord_right y1, y2 = cord_left xl, yl = lcord # xr,yr=rcord except Exception as e: print(e) return # if xr < x1: # cmd = "left" # elif(xr > x2): # cmd = "right" if (yl < y1): cmd = "z" elif (yl > y2): cmd = "down" if cmd: print("Detected movement: ", cmd, "\n") # if cmd=="left": # keyboard.press(cmd) # elif cmd=="right": # keyboard.press(cmd) keyboard.press(cmd) # keyboard.press(cmd) return cmd def keyboard_events_r(rcord, cord_right, cmd2): try: x1, x2 = cord_right # y1,y2 = cord_left # xl,yl=lcord xr, yr = rcord except Exception as e: print(e) return if xr < x1: cmd2 = "left" elif (xr > x2): cmd2 = "right" # elif(yl<y1): # cmd = "up" # elif(yl > y2): # cmd = "down" if cmd2: print("Detected another movement: ", cmd2, "\n") keyboard.press(cmd2) # elif cmd=="up": # keyboard.press(cmd2) # elif cmd=="down": # keyboard.press(cmd2) # keyboard.press(cmd) return cmd2 def reset_press_flag(lcord, rcord, cord_left, cord_right, cmd, cmd2): try: x1, x2 = cord_right y1, y2 = cord_left xl, yl = lcord xr, yr = rcord # xc, yc = nose_cords except: return True, cmd, cmd2 if x1 < xr < x2 or y1 < yl < y2: if x1 < xr < x2 and (cmd2 != None and cmd2 != ""): keyboard.release(cmd2) if y1 < yl < y2 and (cmd != None and cmd != ""): keyboard.release(cmd) if x1 < xr < x2 and y1 < yl < y2: # keyboard.release(cmd) return True, None, None elif x1 < xr < x2: return True, cmd, None elif y1 < yl < y2: return True, None, cmd2 return False, cmd, cmd2 def get_frame(): # to get frame by reading fvs, init fvs first res, frame = fvs.read() if frame is None: raise Exception("Frame Not Found") return frame = cv2.flip(frame, 1) frame = imutils.resize(frame, width=size_width, height=size_height) return frame fvs = cv2.VideoCapture(0) # 0 for web cam time.sleep(2.0) # to allow web cam to open TIMER_SETUP = 3 # timer for capturing base image t = time.time() while True: frame = get_frame() curr = (time.time() - t) if curr > TIMER_SETUP: break cv2.putText(frame, str(int(TIMER_SETUP - curr) + 1), (225, 255), cv2.FONT_HERSHEY_SIMPLEX, 1.5, COLOR_RED, 4) cv2.imshow("Setup", frame) cv2.waitKey(1) FRAME = frame.copy() cv2.destroyAllWindows() # Make box around hand frame = FRAME.copy() cv2.putText(frame, 'Select Left Hand for steering', (30, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.75, COLOR_RED, 2) bboxleft = cv2.selectROI(frame, False) # bounding box for left hand frame = FRAME.copy() cv2.putText(frame, 'Select Right Hand for acceleration', (30, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.75, COLOR_RED, 2) bboxright = cv2.selectROI(frame, False) # bounding box for right hand # centleft = get_centroid(bboxleft) # centright = get_centroid(bboxright) # draw_circle(frame, centleft) # circle, outside this movements will happend # draw_circle(frame, centright) BBL, BBR = bboxleft, bboxright # saving it for later cv2.destroyAllWindows() # fvs.release() # BBR ''' cv2.destroyAllWindows() ''' # fvs = cv2.VideoCapture(0) #0 for web cam # time.sleep(2.0) bboxleft, bboxright = BBL, BBR # Creating the CSRT Tracker trackerleft = cv2.TrackerCSRT_create() # left hand for steering trackerright = cv2.TrackerCSRT_create() # right hand for acceleration (acc) # Initialize tracker with first frame and bounding box trackerleft.init(FRAME, bboxleft) trackerright.init(FRAME, bboxright) # cv2.putText(frame.copy(), 'Put both your hands in Postion', (100,70), \ cv2.FONT_HERSHEY_SIMPLEX, 0.75, COLOR_BLACK, 2 press_flag = False cmd = "" cmd2 = "" while True: frame = get_frame() # if curr > TIMER_SETUP or frame is None: # break # cv2.putText(frame, str(int(TIMER_SETUP - curr)+1), (225,255), cv2.FONT_HERSHEY_SIMPLEX, 1.5, COLOR_RED, 4) if BBL is not None: # grab the new bounding box coordinates of the object (success, box) = trackerleft.update(frame) (success1, box1) = trackerright.update(frame) # check to see if the tracking was a success if success: (x, y, w, h) = [int(v) for v in box] cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2) (a, b, c, d) = [int(f) for f in box1] cv2.rectangle(frame, (a, b), (a + c, b + d), (0, 255, 0), 2) # cv2.putText(img, cmd, (10,50), cv2.FONT_HERSHEY_SIMPLEX, 1, color['red'], 1, cv2.LINE_AA) frame, lcord = detect_center(frame, box) frame, rcord = detect_center(frame, box1) # print("detect_center func called...") # draw boundary circle cord_left = draw_controller_left(frame, (110, 189)) cord_right = draw_controller_right(frame, (479, 189)) # print("circle draw done") if press_flag and (cmd == None or cmd == ""): # print("calling keyboard event") cmd = keyboard_events_l(lcord, cord_left, cmd) if press_flag and (cmd2 == None or cmd2 == ""): cmd2 = keyboard_events_r(rcord, cord_right, cmd2) press_flag, cmd, cmd2 = reset_press_flag(lcord, rcord, cord_left, cord_right, cmd, cmd2) # print("press flag: ",press_flag) # Writing processed image in a new window cv2.imshow("Tracking", frame) if cv2.waitKey(1) == 13: break cv2.destroyAllWindows() fvs.release() # fvs.release() # BBL
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 13850, 29906, 30004, 13, 5215, 931, 30004, 13, 5215, 5844, 30004, 13, 5215, 527, 13239, 30004, 13, 3166, 527, 13239, 29889, 9641, 1053, 3497, 15167, 3835, 29892, 13987, 3835, 30004, 13, 5215, 12247, 30004, 13, 3166, 282, 948, 649, 29889, 1989, 3377, 1053, 7670, 29892, 15830, 30004, 13, 29937, 12247, 29922, 2956, 26471, 13, 30004, 13, 2311, 29918, 3545, 353, 29871, 29953, 29900, 29900, 30004, 13, 2311, 29918, 2103, 353, 29871, 29953, 29900, 29900, 30004, 13, 4230, 353, 29871, 29900, 29871, 396, 1833, 18677, 310, 1886, 261, 30004, 13, 305, 865, 353, 29871, 29941, 29871, 396, 1735, 297, 1833, 29892, 304, 3349, 2319, 3620, 6095, 1682, 800, 30004, 13, 305, 865, 29873, 353, 29871, 29941, 29871, 396, 304, 10715, 1735, 304, 29871, 29900, 29892, 565, 6153, 7113, 8442, 491, 777, 995, 30004, 13, 30004, 13, 15032, 1955, 29918, 19386, 353, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 8443, 13, 15032, 1955, 29918, 13367, 11375, 353, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 8443, 13, 30004, 13, 4690, 1525, 7068, 29918, 24705, 353, 29871, 29953, 29900, 29871, 396, 260, 30004, 13, 30004, 13, 30004, 13, 1753, 679, 29918, 1760, 1007, 29898, 29890, 1884, 1125, 29871, 396, 4818, 1298, 310, 16701, 30004, 13, 1678, 921, 29892, 343, 29892, 281, 29892, 298, 353, 289, 1884, 30004, 13, 1678, 1644, 29916, 353, 313, 29906, 334, 921, 718, 281, 29897, 849, 29871, 29906, 30004, 13, 1678, 1644, 29891, 353, 313, 29906, 334, 343, 718, 298, 29897, 849, 29871, 29906, 30004, 13, 1678, 736, 313, 1760, 29916, 29892, 1644, 29891, 8443, 13, 30004, 13, 30004, 13, 1753, 4216, 29918, 16622, 29898, 2557, 29892, 4818, 29892, 11855, 29922, 4690, 1525, 7068, 29918, 24705, 29892, 2927, 29922, 15032, 1955, 29918, 13367, 11375, 29892, 12003, 2264, 29922, 29941, 1125, 30004, 13, 1678, 13850, 29906, 29889, 16622, 29898, 2557, 29892, 4818, 29892, 11855, 29892, 2927, 29892, 12003, 2264, 8443, 13, 30004, 13, 30004, 13, 1753, 4216, 1884, 29898, 2267, 29892, 289, 1884, 29892, 3515, 1125, 29871, 396, 4216, 29879, 16701, 515, 289, 1884, 30004, 13, 1678, 5534, 3855, 30004, 13, 1678, 565, 3240, 29901, 30004, 13, 4706, 396, 17026, 292, 21397, 30004, 13, 4706, 282, 29896, 353, 313, 524, 29898, 29890, 1884, 29961, 29900, 11724, 938, 29898, 29890, 1884, 29961, 29896, 12622, 30004, 13, 4706, 282, 29906, 353, 313, 524, 29898, 29890, 1884, 29961, 29900, 29962, 718, 289, 1884, 29961, 29906, 11724, 938, 29898, 29890, 1884, 29961, 29896, 29962, 718, 289, 1884, 29961, 29941, 12622, 30004, 13, 4706, 13850, 29906, 29889, 1621, 2521, 29898, 2557, 29892, 282, 29896, 29892, 282, 29906, 29892, 313, 29906, 29945, 29945, 29892, 29871, 29900, 29892, 29871, 29900, 511, 29871, 29906, 29892, 29871, 29896, 8443, 13, 30004, 13, 1678, 565, 282, 29896, 29961, 29900, 29962, 529, 29871, 29896, 29900, 29901, 29871, 396, 439, 1169, 1824, 565, 4586, 1361, 304, 2175, 2246, 11155, 30004, 13, 4706, 3855, 353, 5852, 29871, 396, 23283, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 2780, 353, 8853, 9539, 1115, 313, 29906, 29945, 29945, 29892, 29871, 29900, 29892, 29871, 29900, 511, 376, 1127, 1115, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 511, 376, 12692, 1115, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 511, 376, 10921, 1115, 313, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 2915, 30004, 13, 30004, 13, 30004, 13, 1753, 6459, 29918, 5064, 29898, 2492, 29892, 1361, 1125, 30004, 13, 1678, 396, 3588, 1967, 304, 16749, 29899, 7052, 30004, 13, 1678, 396, 11580, 16701, 2820, 278, 4682, 322, 3858, 292, 372, 30004, 13, 1678, 313, 29916, 29892, 343, 29892, 281, 29892, 298, 29897, 353, 518, 524, 29898, 29894, 29897, 363, 325, 297, 1361, 29962, 30004, 13, 1678, 396, 29871, 13850, 29906, 29889, 1621, 2521, 29898, 2492, 29892, 313, 29916, 29892, 29891, 511, 313, 29916, 29974, 29893, 29892, 343, 29974, 29882, 511, 29871, 2927, 1839, 12692, 7464, 29871, 29906, 29897, 29871, 396, 348, 9342, 565, 366, 864, 304, 1074, 3700, 10452, 30004, 13, 1678, 13850, 29906, 29889, 16622, 29898, 2492, 29892, 5135, 29906, 334, 921, 718, 281, 29897, 849, 29871, 29906, 29892, 313, 29906, 334, 343, 718, 298, 29897, 849, 29871, 29906, 511, 29871, 29906, 29892, 2927, 1839, 12692, 7464, 29871, 29906, 8443, 13, 1678, 1361, 353, 5135, 29906, 334, 921, 718, 281, 29897, 849, 29871, 29906, 29892, 313, 29906, 334, 343, 718, 298, 29897, 849, 29871, 29906, 8443, 13, 1678, 736, 10153, 29892, 1361, 30004, 13, 30004, 13, 30004, 13, 29937, 13793, 29871, 995, 674, 367, 8459, 491, 318, 29882, 491, 23188, 278, 5902, 280, 373, 4315, 30004, 13, 1753, 4216, 29918, 8299, 29918, 1563, 29898, 2492, 29892, 274, 4339, 1125, 30004, 13, 1678, 2159, 353, 29871, 29946, 29900, 30004, 13, 1678, 396, 921, 29896, 353, 274, 4339, 29961, 29900, 29962, 448, 2159, 30004, 13, 1678, 343, 29896, 353, 274, 4339, 29961, 29896, 29962, 448, 2159, 30004, 13, 1678, 396, 921, 29906, 353, 274, 4339, 29961, 29900, 29962, 718, 2159, 30004, 13, 1678, 343, 29906, 353, 274, 4339, 29961, 29896, 29962, 718, 2159, 30004, 13, 1678, 13850, 29906, 29889, 16622, 29898, 2492, 29892, 274, 4339, 29892, 2159, 29892, 2927, 1839, 9539, 7464, 29871, 29906, 8443, 13, 1678, 736, 313, 29891, 29896, 29892, 343, 29906, 8443, 13, 30004, 13, 30004, 13, 1753, 4216, 29918, 8299, 29918, 1266, 29898, 2492, 29892, 274, 4339, 1125, 30004, 13, 1678, 2159, 353, 29871, 29946, 29900, 30004, 13, 1678, 921, 29896, 353, 274, 4339, 29961, 29900, 29962, 448, 2159, 30004, 13, 1678, 396, 343, 29896, 353, 274, 4339, 29961, 29896, 29962, 448, 2159, 30004, 13, 1678, 921, 29906, 353, 274, 4339, 29961, 29900, 29962, 718, 2159, 30004, 13, 1678, 396, 343, 29906, 353, 274, 4339, 29961, 29896, 29962, 718, 2159, 30004, 13, 1678, 13850, 29906, 29889, 16622, 29898, 2492, 29892, 274, 4339, 29892, 2159, 29892, 2927, 1839, 1127, 7464, 29871, 29906, 8443, 13, 1678, 736, 313, 29916, 29896, 29892, 921, 29906, 8443, 13, 30004, 13, 30004, 13, 1753, 12247, 29918, 13604, 29918, 29880, 29898, 29880, 16090, 29892, 13793, 29918, 1563, 29892, 9920, 1125, 30004, 13, 1678, 1018, 29901, 30004, 13, 4706, 396, 921, 29896, 29892, 29916, 29906, 353, 13793, 29918, 1266, 30004, 13, 4706, 343, 29896, 29892, 343, 29906, 353, 13793, 29918, 1563, 30004, 13, 4706, 921, 29880, 29892, 343, 29880, 353, 301, 16090, 30004, 13, 4706, 396, 921, 29878, 29892, 4316, 29922, 2214, 536, 30004, 13, 1678, 5174, 8960, 408, 321, 29901, 30004, 13, 4706, 1596, 29898, 29872, 8443, 13, 4706, 736, 30004, 13, 1678, 396, 565, 921, 29878, 529, 921, 29896, 29901, 30004, 13, 1678, 396, 1678, 9920, 353, 376, 1563, 19451, 13, 1678, 396, 25342, 29898, 29916, 29878, 1405, 921, 29906, 1125, 30004, 13, 1678, 396, 1678, 9920, 353, 376, 1266, 19451, 13, 1678, 565, 313, 2904, 529, 343, 29896, 1125, 30004, 13, 4706, 9920, 353, 376, 29920, 19451, 13, 1678, 25342, 313, 2904, 1405, 343, 29906, 1125, 30004, 13, 4706, 9920, 353, 376, 3204, 19451, 13, 1678, 565, 9920, 29901, 30004, 13, 4706, 1596, 703, 6362, 26458, 10298, 29901, 9162, 9920, 29892, 6634, 29876, 1159, 30004, 13, 4706, 396, 565, 9920, 26359, 1563, 1115, 30004, 13, 4706, 396, 29871, 12247, 29889, 2139, 29898, 9006, 8443, 13, 4706, 396, 25342, 9920, 26359, 1266, 1115, 30004, 13, 4706, 396, 259, 12247, 29889, 2139, 29898, 9006, 8443, 13, 4706, 12247, 29889, 2139, 29898, 9006, 8443, 13, 30004, 13, 4706, 396, 12247, 29889, 2139, 29898, 9006, 8443, 13, 1678, 736, 9920, 30004, 13, 30004, 13, 30004, 13, 1753, 12247, 29918, 13604, 29918, 29878, 29898, 2214, 536, 29892, 13793, 29918, 1266, 29892, 9920, 29906, 1125, 30004, 13, 1678, 1018, 29901, 30004, 13, 4706, 921, 29896, 29892, 921, 29906, 353, 13793, 29918, 1266, 30004, 13, 4706, 396, 343, 29896, 29892, 29891, 29906, 353, 13793, 29918, 1563, 30004, 13, 4706, 396, 921, 29880, 29892, 2904, 29922, 29880, 16090, 30004, 13, 4706, 921, 29878, 29892, 343, 29878, 353, 364, 16090, 30004, 13, 1678, 5174, 8960, 408, 321, 29901, 30004, 13, 4706, 1596, 29898, 29872, 8443, 13, 4706, 736, 30004, 13, 1678, 565, 921, 29878, 529, 921, 29896, 29901, 30004, 13, 4706, 9920, 29906, 353, 376, 1563, 19451, 13, 1678, 25342, 313, 29916, 29878, 1405, 921, 29906, 1125, 30004, 13, 4706, 9920, 29906, 353, 376, 1266, 19451, 13, 1678, 396, 25342, 29898, 2904, 29966, 29891, 29896, 1125, 30004, 13, 1678, 396, 1678, 9920, 353, 376, 786, 19451, 13, 1678, 396, 25342, 29898, 2904, 1405, 343, 29906, 1125, 30004, 13, 1678, 396, 1678, 9920, 353, 376, 3204, 19451, 13, 1678, 565, 9920, 29906, 29901, 30004, 13, 4706, 1596, 703, 6362, 26458, 1790, 10298, 29901, 9162, 9920, 29906, 29892, 6634, 29876, 1159, 30004, 13, 4706, 12247, 29889, 2139, 29898, 9006, 29906, 8443, 13, 4706, 396, 25342, 9920, 26359, 786, 1115, 30004, 13, 4706, 396, 259, 12247, 29889, 2139, 29898, 9006, 29906, 8443, 13, 4706, 396, 25342, 9920, 26359, 3204, 1115, 30004, 13, 4706, 396, 259, 12247, 29889, 2139, 29898, 9006, 29906, 8443, 13, 30004, 13, 4706, 396, 12247, 29889, 2139, 29898, 9006, 8443, 13, 1678, 736, 9920, 29906, 30004, 13, 30004, 13, 30004, 13, 1753, 10092, 29918, 2139, 29918, 15581, 29898, 29880, 16090, 29892, 364, 16090, 29892, 13793, 29918, 1563, 29892, 13793, 29918, 1266, 29892, 9920, 29892, 9920, 29906, 1125, 30004, 13, 1678, 1018, 29901, 30004, 13, 4706, 921, 29896, 29892, 921, 29906, 353, 13793, 29918, 1266, 30004, 13, 4706, 343, 29896, 29892, 343, 29906, 353, 13793, 29918, 1563, 30004, 13, 4706, 921, 29880, 29892, 343, 29880, 353, 301, 16090, 30004, 13, 4706, 921, 29878, 29892, 343, 29878, 353, 364, 16090, 30004, 13, 4706, 396, 921, 29883, 29892, 343, 29883, 353, 26414, 29918, 29883, 4339, 30004, 13, 1678, 5174, 29901, 30004, 13, 4706, 736, 5852, 29892, 9920, 29892, 9920, 29906, 30004, 13, 1678, 565, 921, 29896, 529, 921, 29878, 529, 921, 29906, 470, 343, 29896, 529, 343, 29880, 529, 343, 29906, 29901, 30004, 13, 4706, 565, 921, 29896, 529, 921, 29878, 529, 921, 29906, 322, 313, 9006, 29906, 2804, 6213, 322, 9920, 29906, 2804, 5124, 1125, 30004, 13, 9651, 12247, 29889, 14096, 29898, 9006, 29906, 8443, 13, 4706, 565, 343, 29896, 529, 343, 29880, 529, 343, 29906, 322, 313, 9006, 2804, 6213, 322, 9920, 2804, 5124, 1125, 30004, 13, 9651, 12247, 29889, 14096, 29898, 9006, 8443, 13, 4706, 565, 921, 29896, 529, 921, 29878, 529, 921, 29906, 322, 343, 29896, 529, 343, 29880, 529, 343, 29906, 29901, 30004, 13, 9651, 396, 12247, 29889, 14096, 29898, 9006, 8443, 13, 9651, 736, 5852, 29892, 6213, 29892, 6213, 30004, 13, 4706, 25342, 921, 29896, 529, 921, 29878, 529, 921, 29906, 29901, 30004, 13, 9651, 736, 5852, 29892, 9920, 29892, 6213, 30004, 13, 4706, 25342, 343, 29896, 529, 343, 29880, 529, 343, 29906, 29901, 30004, 13, 9651, 736, 5852, 29892, 6213, 29892, 9920, 29906, 30004, 13, 1678, 736, 7700, 29892, 9920, 29892, 9920, 29906, 30004, 13, 30004, 13, 30004, 13, 1753, 679, 29918, 2557, 7295, 29871, 396, 304, 679, 3515, 491, 5183, 285, 4270, 29892, 2069, 285, 4270, 937, 30004, 13, 1678, 620, 29892, 3515, 353, 285, 4270, 29889, 949, 26471, 13, 1678, 565, 3515, 338, 6213, 29901, 30004, 13, 4706, 12020, 8960, 703, 4308, 2216, 7460, 1159, 30004, 13, 4706, 736, 30004, 13, 1678, 3515, 353, 13850, 29906, 29889, 29888, 3466, 29898, 2557, 29892, 29871, 29896, 8443, 13, 1678, 3515, 353, 527, 13239, 29889, 21476, 29898, 2557, 29892, 2920, 29922, 2311, 29918, 2103, 29892, 3171, 29922, 2311, 29918, 3545, 8443, 13, 1678, 736, 3515, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 29888, 4270, 353, 13850, 29906, 29889, 15167, 21133, 545, 29898, 29900, 29897, 29871, 396, 29871, 29900, 363, 1856, 3949, 30004, 13, 2230, 29889, 17059, 29898, 29906, 29889, 29900, 29897, 29871, 396, 304, 2758, 1856, 3949, 304, 1722, 30004, 13, 30004, 13, 29911, 7833, 1001, 29918, 10490, 4897, 353, 29871, 29941, 29871, 396, 12237, 363, 4332, 3864, 2967, 1967, 30004, 13, 29873, 353, 931, 29889, 2230, 26471, 13, 30004, 13, 8000, 5852, 29901, 30004, 13, 1678, 3515, 353, 679, 29918, 2557, 26471, 13, 1678, 16256, 353, 313, 2230, 29889, 2230, 580, 448, 260, 8443, 13, 1678, 565, 16256, 1405, 323, 7833, 1001, 29918, 10490, 4897, 29901, 30004, 13, 4706, 2867, 30004, 13, 1678, 13850, 29906, 29889, 649, 1626, 29898, 2557, 29892, 851, 29898, 524, 29898, 29911, 7833, 1001, 29918, 10490, 4897, 448, 16256, 29897, 718, 29871, 29896, 511, 313, 29906, 29906, 29945, 29892, 29871, 29906, 29945, 29945, 511, 13850, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29896, 29889, 29945, 29892, 23958, 1955, 29918, 19386, 29892, 29871, 29946, 8443, 13, 1678, 13850, 29906, 29889, 326, 4294, 703, 26947, 613, 3515, 8443, 13, 1678, 13850, 29906, 29889, 10685, 2558, 29898, 29896, 8443, 13, 30004, 13, 29943, 4717, 2303, 353, 3515, 29889, 8552, 26471, 13, 11023, 29906, 29889, 20524, 3596, 7685, 26471, 13, 30004, 13, 29937, 8561, 3800, 2820, 1361, 30004, 13, 2557, 353, 383, 4717, 2303, 29889, 8552, 26471, 13, 11023, 29906, 29889, 649, 1626, 29898, 2557, 29892, 525, 3549, 19941, 5166, 363, 1886, 3241, 742, 313, 29941, 29900, 29892, 29871, 29941, 29900, 511, 13850, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29900, 29889, 29955, 29945, 29892, 23958, 1955, 29918, 19386, 29892, 29871, 29906, 8443, 13, 29890, 1884, 1563, 353, 13850, 29906, 29889, 2622, 1672, 29902, 29898, 2557, 29892, 7700, 29897, 29871, 396, 3216, 292, 3800, 363, 2175, 1361, 30004, 13, 30004, 13, 2557, 353, 383, 4717, 2303, 29889, 8552, 26471, 13, 11023, 29906, 29889, 649, 1626, 29898, 2557, 29892, 525, 3549, 10428, 5166, 363, 28178, 742, 313, 29941, 29900, 29892, 29871, 29941, 29900, 511, 13850, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29900, 29889, 29955, 29945, 29892, 23958, 1955, 29918, 19386, 29892, 29871, 29906, 8443, 13, 29890, 1884, 1266, 353, 13850, 29906, 29889, 2622, 1672, 29902, 29898, 2557, 29892, 7700, 29897, 29871, 396, 3216, 292, 3800, 363, 1492, 1361, 30004, 13, 30004, 13, 29937, 1644, 1563, 353, 679, 29918, 1760, 1007, 29898, 29890, 1884, 1563, 8443, 13, 29937, 1644, 1266, 353, 679, 29918, 1760, 1007, 29898, 29890, 1884, 1266, 8443, 13, 30004, 13, 29937, 4216, 29918, 16622, 29898, 2557, 29892, 1644, 1563, 29897, 396, 8607, 29892, 5377, 445, 24147, 674, 2250, 355, 30004, 13, 29937, 4216, 29918, 16622, 29898, 2557, 29892, 1644, 1266, 8443, 13, 30004, 13, 29933, 13367, 29892, 350, 15176, 353, 289, 1884, 1563, 29892, 289, 1884, 1266, 29871, 396, 14238, 372, 363, 2678, 30004, 13, 30004, 13, 11023, 29906, 29889, 20524, 3596, 7685, 26471, 13, 29937, 285, 4270, 29889, 14096, 26471, 13, 30004, 13, 30004, 13, 29937, 350, 15176, 30004, 13, 12008, 30004, 13, 11023, 29906, 29889, 20524, 3596, 7685, 26471, 13, 12008, 30004, 13, 30004, 13, 29937, 285, 4270, 353, 13850, 29906, 29889, 15167, 21133, 545, 29898, 29900, 29897, 396, 29900, 363, 1856, 3949, 30004, 13, 29937, 931, 29889, 17059, 29898, 29906, 29889, 29900, 8443, 13, 30004, 13, 29890, 1884, 1563, 29892, 289, 1884, 1266, 353, 350, 13367, 29892, 350, 15176, 30004, 13, 30004, 13, 29937, 26221, 278, 21107, 13079, 3201, 4937, 30004, 13, 3018, 4937, 1563, 353, 13850, 29906, 29889, 5323, 4937, 9295, 13079, 29918, 3258, 580, 29871, 396, 2175, 1361, 363, 1886, 3241, 30004, 13, 3018, 4937, 1266, 353, 13850, 29906, 29889, 5323, 4937, 9295, 13079, 29918, 3258, 580, 29871, 396, 1492, 1361, 363, 28178, 313, 5753, 8443, 13, 30004, 13, 29937, 25455, 1020, 4937, 411, 937, 3515, 322, 3216, 292, 3800, 30004, 13, 3018, 4937, 1563, 29889, 2344, 29898, 29943, 4717, 2303, 29892, 289, 1884, 1563, 8443, 13, 3018, 4937, 1266, 29889, 2344, 29898, 29943, 4717, 2303, 29892, 289, 1884, 1266, 8443, 13, 30004, 13, 29937, 13850, 29906, 29889, 649, 1626, 29898, 2557, 29889, 8552, 3285, 525, 22908, 1716, 596, 6567, 297, 4918, 291, 742, 313, 29896, 29900, 29900, 29892, 29955, 29900, 511, 320, 30004, 13, 11023, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29900, 29889, 29955, 29945, 29892, 23958, 1955, 29918, 13367, 11375, 29892, 29871, 29906, 30004, 13, 30004, 13, 2139, 29918, 15581, 353, 7700, 30004, 13, 9006, 353, 5124, 30004, 13, 9006, 29906, 353, 5124, 30004, 13, 30004, 13, 8000, 5852, 29901, 30004, 13, 1678, 3515, 353, 679, 29918, 2557, 26471, 13, 1678, 396, 565, 16256, 1405, 323, 7833, 1001, 29918, 10490, 4897, 470, 3515, 338, 6213, 29901, 30004, 13, 1678, 396, 1678, 2867, 30004, 13, 1678, 396, 13850, 29906, 29889, 649, 1626, 29898, 2557, 29892, 851, 29898, 524, 29898, 29911, 7833, 1001, 29918, 10490, 4897, 448, 16256, 7240, 29896, 511, 313, 29906, 29906, 29945, 29892, 29906, 29945, 29945, 511, 13850, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29896, 29889, 29945, 29892, 23958, 1955, 29918, 19386, 29892, 29871, 29946, 8443, 13, 1678, 565, 350, 13367, 338, 451, 6213, 29901, 30004, 13, 4706, 396, 17229, 278, 716, 3216, 292, 3800, 10350, 310, 278, 1203, 30004, 13, 4706, 313, 8698, 29892, 3800, 29897, 353, 1020, 4937, 1563, 29889, 5504, 29898, 2557, 8443, 13, 4706, 313, 8698, 29896, 29892, 3800, 29896, 29897, 353, 1020, 4937, 1266, 29889, 5504, 29898, 2557, 8443, 13, 4706, 396, 1423, 304, 1074, 565, 278, 23110, 471, 263, 2551, 30004, 13, 4706, 565, 2551, 29901, 30004, 13, 9651, 313, 29916, 29892, 343, 29892, 281, 29892, 298, 29897, 353, 518, 524, 29898, 29894, 29897, 363, 325, 297, 3800, 29962, 30004, 13, 9651, 13850, 29906, 29889, 1621, 2521, 29898, 2557, 29892, 313, 29916, 29892, 343, 511, 313, 29916, 718, 281, 29892, 343, 718, 298, 511, 30004, 13, 462, 3986, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 511, 29871, 29906, 8443, 13, 9651, 313, 29874, 29892, 289, 29892, 274, 29892, 270, 29897, 353, 518, 524, 29898, 29888, 29897, 363, 285, 297, 3800, 29896, 29962, 30004, 13, 9651, 13850, 29906, 29889, 1621, 2521, 29898, 2557, 29892, 313, 29874, 29892, 289, 511, 313, 29874, 718, 274, 29892, 289, 718, 270, 511, 30004, 13, 462, 3986, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 511, 29871, 29906, 8443, 13, 30004, 13, 4706, 396, 13850, 29906, 29889, 649, 1626, 29898, 2492, 29892, 9920, 29892, 313, 29896, 29900, 29892, 29945, 29900, 511, 13850, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29896, 29892, 2927, 1839, 1127, 7464, 29871, 29896, 29892, 13850, 29906, 29889, 18521, 29918, 6344, 8443, 13, 4706, 3515, 29892, 301, 16090, 353, 6459, 29918, 5064, 29898, 2557, 29892, 3800, 8443, 13, 4706, 3515, 29892, 364, 16090, 353, 6459, 29918, 5064, 29898, 2557, 29892, 3800, 29896, 8443, 13, 4706, 396, 1596, 703, 4801, 522, 29918, 5064, 3653, 2000, 856, 1159, 30004, 13, 4706, 396, 4216, 10452, 8607, 30004, 13, 4706, 13793, 29918, 1563, 353, 4216, 29918, 8299, 29918, 1563, 29898, 2557, 29892, 313, 29896, 29896, 29900, 29892, 29871, 29896, 29947, 29929, 876, 30004, 13, 4706, 13793, 29918, 1266, 353, 4216, 29918, 8299, 29918, 1266, 29898, 2557, 29892, 313, 29946, 29955, 29929, 29892, 29871, 29896, 29947, 29929, 876, 30004, 13, 4706, 396, 1596, 703, 16622, 4216, 2309, 1159, 30004, 13, 4706, 565, 3965, 29918, 15581, 322, 313, 9006, 1275, 6213, 470, 9920, 1275, 5124, 1125, 30004, 13, 9651, 396, 1596, 703, 4804, 292, 12247, 1741, 1159, 30004, 13, 9651, 9920, 353, 12247, 29918, 13604, 29918, 29880, 29898, 29880, 16090, 29892, 13793, 29918, 1563, 29892, 9920, 8443, 13, 30004, 13, 4706, 565, 3965, 29918, 15581, 322, 313, 9006, 29906, 1275, 6213, 470, 9920, 29906, 1275, 5124, 1125, 30004, 13, 9651, 9920, 29906, 353, 12247, 29918, 13604, 29918, 29878, 29898, 2214, 536, 29892, 13793, 29918, 1266, 29892, 9920, 29906, 8443, 13, 4706, 3965, 29918, 15581, 29892, 9920, 29892, 9920, 29906, 353, 10092, 29918, 2139, 29918, 15581, 29898, 29880, 16090, 29892, 364, 16090, 29892, 13793, 29918, 1563, 29892, 13793, 29918, 1266, 29892, 9920, 29892, 9920, 29906, 8443, 13, 4706, 396, 1596, 703, 2139, 7353, 29901, 9162, 2139, 29918, 15581, 8443, 13, 30004, 13, 4706, 396, 28676, 19356, 1967, 297, 263, 716, 3474, 30004, 13, 30004, 13, 1678, 13850, 29906, 29889, 326, 4294, 703, 17936, 292, 613, 3515, 8443, 13, 1678, 565, 13850, 29906, 29889, 10685, 2558, 29898, 29896, 29897, 1275, 29871, 29896, 29941, 29901, 30004, 13, 4706, 2867, 30004, 13, 30004, 13, 11023, 29906, 29889, 20524, 3596, 7685, 26471, 13, 29888, 4270, 29889, 14096, 26471, 13, 30004, 13, 29937, 285, 4270, 29889, 14096, 26471, 13, 30004, 13, 29937, 350, 13367, 30004, 13, 30004, 13, 2 ]
tests/util/alert_server.py
grayfallstown/greendoge-blockchain
44
64852
<gh_stars>10-100 import argparse import asyncio import logging from pathlib import Path from typing import Any from aiohttp import web log = logging.getLogger(__name__) class AlertServer: shut_down: bool shut_down_event: asyncio.Event log: Any app: Any alert_file_path: Path port: int @staticmethod async def create_alert_server(alert_file_path: Path, port): self = AlertServer() self.log = log self.shut_down = False self.app = web.Application() self.shut_down_event = asyncio.Event() self.port = port routes = [ web.get("/status", self.status), ] self.alert_file_path = alert_file_path self.app.add_routes(routes) return self async def status(self, request): file_text = self.alert_file_path.read_text() return web.Response(body=file_text, content_type="text/plain") async def stop(self): self.shut_down_event.set() async def run(self): runner = web.AppRunner(self.app, access_log=None) await runner.setup() site = web.TCPSite(runner, None, self.port) await site.start() async def run_and_wait(file_path, port): server = await AlertServer.create_alert_server(Path(file_path), port) await server.run() await server.shut_down_event.wait() def main(): parser = argparse.ArgumentParser() parser.add_argument("-file_path", type=str, dest="file_path") parser.add_argument("-port", type=str, dest="port") port = None file_path = None for key, value in vars(parser.parse_args()).items(): if key == "port": port = value elif key == "file_path": file_path = value else: print(f"Invalid argument {key}") if port is None or file_path is None: print( "Missing arguments, example usage:\n\n" "python greendoge/util/alert_server.py -p 4000 -file_path /home/user/alert.txt\n" ) quit() return asyncio.get_event_loop().run_until_complete(run_and_wait(file_path, port)) if __name__ == "__main__": main()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 1852, 5510, 13, 5215, 408, 948, 3934, 13, 5215, 12183, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 19229, 1053, 3139, 13, 13, 3166, 263, 601, 1124, 1053, 1856, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1990, 28861, 6004, 29901, 13, 1678, 12522, 29918, 3204, 29901, 6120, 13, 1678, 12522, 29918, 3204, 29918, 3696, 29901, 408, 948, 3934, 29889, 2624, 13, 1678, 1480, 29901, 3139, 13, 1678, 623, 29901, 3139, 13, 1678, 6655, 29918, 1445, 29918, 2084, 29901, 10802, 13, 1678, 2011, 29901, 938, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 7465, 822, 1653, 29918, 12888, 29918, 2974, 29898, 12888, 29918, 1445, 29918, 2084, 29901, 10802, 29892, 2011, 1125, 13, 4706, 1583, 353, 28861, 6004, 580, 13, 4706, 1583, 29889, 1188, 353, 1480, 13, 4706, 1583, 29889, 845, 329, 29918, 3204, 353, 7700, 13, 4706, 1583, 29889, 932, 353, 1856, 29889, 4873, 580, 13, 4706, 1583, 29889, 845, 329, 29918, 3204, 29918, 3696, 353, 408, 948, 3934, 29889, 2624, 580, 13, 4706, 1583, 29889, 637, 353, 2011, 13, 4706, 12049, 353, 518, 13, 9651, 1856, 29889, 657, 11974, 4882, 613, 1583, 29889, 4882, 511, 13, 4706, 4514, 13, 13, 4706, 1583, 29889, 12888, 29918, 1445, 29918, 2084, 353, 6655, 29918, 1445, 29918, 2084, 13, 4706, 1583, 29889, 932, 29889, 1202, 29918, 27894, 29898, 27894, 29897, 13, 13, 4706, 736, 1583, 13, 13, 1678, 7465, 822, 4660, 29898, 1311, 29892, 2009, 1125, 13, 4706, 934, 29918, 726, 353, 1583, 29889, 12888, 29918, 1445, 29918, 2084, 29889, 949, 29918, 726, 580, 13, 4706, 736, 1856, 29889, 5103, 29898, 2587, 29922, 1445, 29918, 726, 29892, 2793, 29918, 1853, 543, 726, 29914, 24595, 1159, 13, 13, 1678, 7465, 822, 5040, 29898, 1311, 1125, 13, 4706, 1583, 29889, 845, 329, 29918, 3204, 29918, 3696, 29889, 842, 580, 13, 13, 1678, 7465, 822, 1065, 29898, 1311, 1125, 13, 4706, 28877, 353, 1856, 29889, 2052, 16802, 29898, 1311, 29889, 932, 29892, 2130, 29918, 1188, 29922, 8516, 29897, 13, 4706, 7272, 28877, 29889, 14669, 580, 13, 4706, 3268, 353, 1856, 29889, 29911, 6271, 17033, 29898, 27492, 29892, 6213, 29892, 1583, 29889, 637, 29897, 13, 4706, 7272, 3268, 29889, 2962, 580, 13, 13, 13, 12674, 822, 1065, 29918, 392, 29918, 10685, 29898, 1445, 29918, 2084, 29892, 2011, 1125, 13, 1678, 1923, 353, 7272, 28861, 6004, 29889, 3258, 29918, 12888, 29918, 2974, 29898, 2605, 29898, 1445, 29918, 2084, 511, 2011, 29897, 13, 1678, 7272, 1923, 29889, 3389, 580, 13, 1678, 7272, 1923, 29889, 845, 329, 29918, 3204, 29918, 3696, 29889, 10685, 580, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 1445, 29918, 2084, 613, 1134, 29922, 710, 29892, 2731, 543, 1445, 29918, 2084, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 637, 613, 1134, 29922, 710, 29892, 2731, 543, 637, 1159, 13, 13, 1678, 2011, 353, 6213, 13, 1678, 934, 29918, 2084, 353, 6213, 13, 13, 1678, 363, 1820, 29892, 995, 297, 24987, 29898, 16680, 29889, 5510, 29918, 5085, 16655, 7076, 7295, 13, 4706, 565, 1820, 1275, 376, 637, 1115, 13, 9651, 2011, 353, 995, 13, 4706, 25342, 1820, 1275, 376, 1445, 29918, 2084, 1115, 13, 9651, 934, 29918, 2084, 353, 995, 13, 4706, 1683, 29901, 13, 9651, 1596, 29898, 29888, 29908, 13919, 2980, 426, 1989, 27195, 13, 13, 1678, 565, 2011, 338, 6213, 470, 934, 29918, 2084, 338, 6213, 29901, 13, 4706, 1596, 29898, 13, 9651, 376, 18552, 292, 6273, 29892, 1342, 8744, 3583, 29876, 29905, 29876, 29908, 13, 9651, 376, 4691, 1395, 355, 21317, 29914, 4422, 29914, 12888, 29918, 2974, 29889, 2272, 448, 29886, 29871, 29946, 29900, 29900, 29900, 448, 1445, 29918, 2084, 847, 5184, 29914, 1792, 29914, 12888, 29889, 3945, 29905, 29876, 29908, 13, 4706, 1723, 13, 4706, 23283, 580, 13, 13, 1678, 736, 408, 948, 3934, 29889, 657, 29918, 3696, 29918, 7888, 2141, 3389, 29918, 29305, 29918, 8835, 29898, 3389, 29918, 392, 29918, 10685, 29898, 1445, 29918, 2084, 29892, 2011, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 2 ]
streamkit/database/core/orm.py
glentner/streamkit
2
117420
# This program is free software: you can redistribute it and/or modify it under the # terms of the Apache License (v2.0) as published by the Apache Software Foundation. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the Apache License for more details. # # You should have received a copy of the Apache License along with this program. # If not, see <https://www.apache.org/licenses/LICENSE-2.0>. """Database ORM for StreamKit.""" # type annotations from __future__ import annotations from typing import Tuple, Dict, Any # standard libs import logging # external libs from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, ForeignKey, Index, Integer, BigInteger, String, DateTime from sqlalchemy.schema import Sequence, CheckConstraint from sqlalchemy.orm import relationship # internal libs from .engine import schema, db_config # initialize module level logger log = logging.getLogger(__name__) Table = declarative_base() class Level(Table): """ A level relates a name and its identifier. """ __tablename__ = 'level' __table_args__ = {'schema': schema} id = Column('id', Integer, primary_key=True) name = Column('name', String, unique=True, nullable=False) def __repr__(self) -> str: return f'<Level(id={repr(self.id)}, name={repr(self.name)})>' def to_dict(self) -> Dict[str, Any]: """Python dictionary representation.""" return {'id': self.id, 'name': self.name} def values(self, joined: bool = False) -> Tuple: # noqa: unused parameter """ Tuple representation of values. Args: joined (bool): Join relations instead of identifiers. Not used by `Level`. Returns: row (tuple): The `Level.id` and `Level.name`. """ return self.id, self.name @staticmethod def keys(joined: bool = False) -> Tuple[str, ...]: # noqa: unused parameter """ Tuple representation of keys. Args: joined (bool): Join relations instead of identifiers. Not used by `Level`. Returns: keys (tuple): ('id', 'name') """ return 'id', 'name' def embedded(self) -> Dict[str, Any]: """Re-map keys and include join relationships.""" return {'level_id': self.id, 'level_name': self.name} class Topic(Table): """ A topic relates a name and its identifier. """ __tablename__ = 'topic' __table_args__ = {'schema': schema} id = Column('id', Integer, primary_key=True) name = Column('name', String, unique=True, nullable=False) def __repr__(self) -> str: return f'<Topic(id={repr(self.id)}, name={repr(self.name)})>' def to_dict(self) -> Dict[str, Any]: """Python dictionary representation.""" return {'id': self.id, 'name': self.name} def values(self, joined: bool = False) -> Tuple: # noqa: unused parameter """ Tuple representation of values. Args: joined (bool): Join relations instead of identifiers. Not used by `Topic`. Returns: row (tuple): The `Topic.id` and `Topic.name`. """ return self.id, self.name @staticmethod def keys(joined: bool = False) -> Tuple[str, ...]: # noqa: unused parameter """ Tuple representation of keys. Args: joined (bool): Join relations instead of identifiers. Not used by `Topic`. Returns: keys (tuple): ('id', 'name') """ return 'id', 'name' def embedded(self) -> Dict[str, Any]: """Re-map keys and include join relationships.""" return {'topic_id': self.id, 'topic_name': self.name} class Host(Table): """ A host relates a name and its identifier. """ __tablename__ = 'host' __table_args__ = {'schema': schema} id = Column('id', Integer, primary_key=True) name = Column('name', String, unique=True, nullable=False) def __repr__(self) -> str: return f'<Host(id={repr(self.id)}, name={repr(self.name)})>' def to_dict(self) -> Dict[str, Any]: """Python dictionary representation.""" return {'id': self.id, 'name': self.name} def values(self, joined: bool = False) -> Tuple: # noqa: unused parameter """ Tuple representation of values. Args: joined (bool): Join relations instead of identifiers. Not used by `Host`. Returns: row (tuple): The `Host.id` and `Host.name`. """ return self.id, self.name @staticmethod def keys(joined: bool = False) -> Tuple[str, ...]: # noqa: unused parameter """ Tuple representation of keys. Args: joined (bool): Join relations instead of identifiers. Not used by `Host`. Returns: keys (tuple): ('id', 'name') """ return 'id', 'name' def embedded(self) -> Dict[str, Any]: """Re-map keys and include join relationships.""" return {'host_id': self.id, 'host_name': self.name} class Message(Table): __tablename__ = 'message' __table_args__ = {'schema': schema} id = Column('id', BigInteger().with_variant(Integer, 'sqlite'), primary_key=True) time = Column('time', DateTime(timezone=True), nullable=False) topic_id = Column('topic_id', Integer, ForeignKey(Topic.id), nullable=False) level_id = Column('level_id', Integer, ForeignKey(Level.id), nullable=False) host_id = Column('host_id', Integer, ForeignKey(Host.id), nullable=False) text = Column('text', String, nullable=False) topic = relationship('Topic', backref='message') level = relationship('Level', backref='message') host = relationship('Host', backref='message') # conditionally redefine for time-based partitioning if db_config['backend'] in ('timescale', ): # NOTE: The primary key is (`time`, `topic_id`) NOT `id`. # This is weird but important for automatic hyper-table partitioning # on the `time` values for TimeScaleDB (PostgreSQL). id = Column('id', BigInteger, Sequence('message_id_seq', start=1, increment=1, schema=schema), CheckConstraint('id > 0', name='message_id_check'), nullable=False) time = Column('time', DateTime(timezone=True), nullable=False, primary_key=True) topic_id = Column('topic_id', Integer, nullable=False, primary_key=True) # NOTE: remove explicit foreign keys? # level_id = Column('level_id', Integer, nullable=False) # host_id = Column('host_id', Integer, nullable=False) # # topic = relationship('Topic', backref='message', foreign_keys=[topic_id], # primaryjoin='Message.topic_id == Topic.id') # level = relationship('Level', backref='message', foreign_keys=[level_id], # primaryjoin='Message.level_id == Level.id') # host = relationship('Host', backref='message', foreign_keys=[host_id], # primaryjoin='Message.host_id == Host.id') def __repr__(self) -> str: return (f'<Message(id={repr(self.id)},' f' time={repr(self.time)},' f' topic_id={repr(self.topic_id)},' f' level_id={repr(self.level_id)},' f' host_id={repr(self.host_id)},' f' text={repr(self.text)})>') def to_dict(self) -> Dict[str, Any]: """Python dictionary representation.""" return {'id': self.id, 'time': self.time, 'topic_id': self.topic_id, 'level_id': self.level_id, 'host_id': self.host_id, 'text': self.text} def values(self, joined: bool = False) -> Tuple: """ Tuple representation of values. Args: joined (bool): Join relations instead of identifiers (default: False). """ if not joined: return self.id, self.time, self.topic_id, self.level_id, self.host_id, self.text else: return self.id, self.time, self.topic.name, self.level.name, self.host.name, self.text @staticmethod def keys(joined: bool = False) -> Tuple[str, ...]: """ Tuple representation of keys. Args: joined (bool): Join relations instead of identifiers (default: False). """ if not joined: return 'id', 'time', 'topic_id', 'level_id', 'host_id', 'text' else: return 'id', 'time', 'topic', 'level', 'host', 'text' def embedded(self) -> Dict[str, Any]: """Re-map keys and include join relationships.""" message = {'message_time': self.time.strftime('%Y-%m-%d %H:%M:%S.%f'), 'message_text': self.text} return {**message, **self.topic.embedded(), **self.level.embedded(), **self.host.embedded()} if db_config['backend'] in ('timescale', ): # we use time-topic PK and need to index ID message_id_index = Index('message_id_index', Message.id) else: message_time_topic_index = Index('message_time_topic_index', Message.time, Message.topic_id) # efficient filtering on host or level message_level_index = Index('message_level_index', Message.level_id) message_host_index = Index('message_host_index', Message.host_id) class Subscriber(Table): """ A subscriber relates a name and its identifier. """ __tablename__ = 'subscriber' __table_args__ = {'schema': schema} id = Column('id', Integer, primary_key=True) name = Column('name', String, unique=True, nullable=False) def __repr__(self) -> str: return f'<Subscriber(id={repr(self.id)}, name={repr(self.name)})>' def to_dict(self) -> Dict[str, Any]: """Python dictionary representation.""" return {'id': self.id, 'name': self.name} def values(self, joined: bool = False) -> Tuple: # noqa: unused parameter """ Tuple representation of values. Args: joined (bool): Join relations instead of identifiers. Not used by `Subscriber`. Returns: row (tuple): The `Subscriber.id` and `Subscriber.name`. """ return self.id, self.name @staticmethod def keys(joined: bool = False) -> Tuple[str, ...]: # noqa: unused parameter """ Tuple representation of keys. Args: joined (bool): Join relations instead of identifiers. Not used by `Subscriber`. Returns: keys (tuple): ('id', 'name') """ return 'id', 'name' def embedded(self) -> Dict[str, Any]: """Re-map keys and include join relationships.""" return {'subscriber_id': self.id, 'subscriber_name': self.name} class Access(Table): __tablename__ = 'access' __table_args__ = {'schema': schema} subscriber_id = Column('subscriber_id', Integer, ForeignKey(Subscriber.id), nullable=False, primary_key=True) topic_id = Column('topic_id', Integer, ForeignKey(Topic.id), nullable=False, primary_key=True) time = Column('time', DateTime(timezone=True), nullable=False) subscriber = relationship('Subscriber', backref='access') topic = relationship('Topic', backref='access') def __repr__(self) -> str: return (f'<Access(subscriber_id={repr(self.subscriber_id)},' f' topic_id={repr(self.topic_id)},' f' time={repr(self.time)})>') def to_dict(self) -> Dict[str, Any]: """Python dictionary representation.""" return {'subscriber_id': self.subscriber_id, 'topic_id': self.topic_id, 'time': self.time} def values(self, joined: bool = False) -> Tuple: """ Tuple representation of values. Args: joined (bool): Join relations instead of identifiers (default: False). """ if not joined: return self.subscriber_id, self.topic_id, self.time else: return self.subscriber.name, self.topic.name, self.time @staticmethod def keys(joined: bool = False) -> Tuple[str, ...]: """ Tuple representation of keys. Args: joined (bool): Join relations instead of identifiers (default: False). """ if not joined: return 'subscriber_id', 'topic_id', 'time' else: return 'subscriber', 'topic', 'time' def embedded(self) -> Dict[str, Any]: """Re-map keys and include join relationships.""" access = {'access_time': self.time.strftime('%Y-%m-%d %H:%M:%S.%f')} return {**access, **self.subscriber.embedded(), **self.topic.embedded()} tables: Dict[str, Table] = { 'level': Level, 'topic': Topic, 'host': Host, 'message': Message, 'subscriber': Subscriber, 'access': Access }
[ 1, 396, 910, 1824, 338, 3889, 7047, 29901, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 6623, 372, 1090, 278, 13, 29937, 4958, 310, 278, 13380, 19245, 313, 29894, 29906, 29889, 29900, 29897, 408, 6369, 491, 278, 13380, 18540, 10606, 29889, 13, 29937, 13, 29937, 910, 1824, 338, 13235, 297, 278, 4966, 393, 372, 674, 367, 5407, 29892, 541, 399, 1806, 8187, 2692, 13764, 29979, 13, 29937, 399, 1718, 29934, 13566, 29979, 29936, 1728, 1584, 278, 2411, 2957, 1370, 21867, 29891, 310, 341, 1001, 3210, 13566, 2882, 6227, 11937, 470, 383, 1806, 8186, 1799, 15842, 319, 13, 29937, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 29889, 2823, 278, 13380, 19245, 363, 901, 4902, 29889, 13, 29937, 13, 29937, 887, 881, 505, 4520, 263, 3509, 310, 278, 13380, 19245, 3412, 411, 445, 1824, 29889, 13, 29937, 960, 451, 29892, 1074, 529, 991, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 15513, 13, 13, 15945, 29908, 9112, 6323, 29924, 363, 13763, 13117, 1213, 15945, 13, 13, 13, 29937, 1134, 25495, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 13, 3166, 19229, 1053, 12603, 552, 29892, 360, 919, 29892, 3139, 13, 13, 29937, 3918, 4303, 29879, 13, 5215, 12183, 13, 13, 29937, 7029, 4303, 29879, 13, 3166, 4576, 284, 305, 6764, 29889, 1062, 29889, 311, 16544, 1230, 1053, 7669, 1230, 29918, 3188, 13, 3166, 4576, 284, 305, 6764, 1053, 12481, 29892, 19358, 2558, 29892, 11374, 29892, 8102, 29892, 7997, 7798, 29892, 1714, 29892, 12315, 13, 3166, 4576, 284, 305, 6764, 29889, 11010, 1053, 922, 3910, 29892, 5399, 21529, 13, 3166, 4576, 284, 305, 6764, 29889, 555, 1053, 9443, 13, 13, 29937, 7463, 4303, 29879, 13, 3166, 869, 10599, 1053, 10938, 29892, 4833, 29918, 2917, 13, 13, 13, 29937, 11905, 3883, 3233, 17927, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 3562, 353, 7669, 1230, 29918, 3188, 580, 13, 13, 13, 1990, 21597, 29898, 3562, 1125, 13, 1678, 9995, 13, 1678, 319, 3233, 1104, 1078, 263, 1024, 322, 967, 15882, 29889, 13, 1678, 9995, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 5563, 29915, 13, 1678, 4770, 2371, 29918, 5085, 1649, 353, 11117, 11010, 2396, 10938, 29913, 13, 1678, 1178, 353, 12481, 877, 333, 742, 8102, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 1024, 353, 12481, 877, 978, 742, 1714, 29892, 5412, 29922, 5574, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 285, 29915, 29966, 10108, 29898, 333, 3790, 276, 558, 29898, 1311, 29889, 333, 19230, 1024, 3790, 276, 558, 29898, 1311, 29889, 978, 26972, 16299, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11980, 8600, 8954, 1213, 15945, 13, 4706, 736, 11117, 333, 2396, 1583, 29889, 333, 29892, 525, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 1678, 822, 1819, 29898, 1311, 29892, 8772, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29901, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 1819, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 10108, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 1948, 313, 23583, 1125, 13, 18884, 450, 421, 10108, 29889, 333, 29952, 322, 421, 10108, 29889, 978, 1412, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 333, 29892, 1583, 29889, 978, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6611, 29898, 2212, 1312, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29961, 710, 29892, 2023, 5387, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 6611, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 10108, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 6611, 313, 23583, 1125, 6702, 333, 742, 525, 978, 1495, 13, 4706, 9995, 13, 4706, 736, 525, 333, 742, 525, 978, 29915, 13, 13, 1678, 822, 15685, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 1123, 29899, 1958, 6611, 322, 3160, 5988, 21702, 1213, 15945, 13, 4706, 736, 11117, 5563, 29918, 333, 2396, 1583, 29889, 333, 29892, 525, 5563, 29918, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 13, 1990, 7488, 293, 29898, 3562, 1125, 13, 1678, 9995, 13, 1678, 319, 11261, 1104, 1078, 263, 1024, 322, 967, 15882, 29889, 13, 1678, 9995, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 13010, 29915, 13, 1678, 4770, 2371, 29918, 5085, 1649, 353, 11117, 11010, 2396, 10938, 29913, 13, 1678, 1178, 353, 12481, 877, 333, 742, 8102, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 1024, 353, 12481, 877, 978, 742, 1714, 29892, 5412, 29922, 5574, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 285, 29915, 29966, 7031, 293, 29898, 333, 3790, 276, 558, 29898, 1311, 29889, 333, 19230, 1024, 3790, 276, 558, 29898, 1311, 29889, 978, 26972, 16299, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11980, 8600, 8954, 1213, 15945, 13, 4706, 736, 11117, 333, 2396, 1583, 29889, 333, 29892, 525, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 1678, 822, 1819, 29898, 1311, 29892, 8772, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29901, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 1819, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 7031, 293, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 1948, 313, 23583, 1125, 13, 18884, 450, 421, 7031, 293, 29889, 333, 29952, 322, 421, 7031, 293, 29889, 978, 1412, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 333, 29892, 1583, 29889, 978, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6611, 29898, 2212, 1312, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29961, 710, 29892, 2023, 5387, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 6611, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 7031, 293, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 6611, 313, 23583, 1125, 6702, 333, 742, 525, 978, 1495, 13, 4706, 9995, 13, 4706, 736, 525, 333, 742, 525, 978, 29915, 13, 13, 1678, 822, 15685, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 1123, 29899, 1958, 6611, 322, 3160, 5988, 21702, 1213, 15945, 13, 4706, 736, 11117, 13010, 29918, 333, 2396, 1583, 29889, 333, 29892, 525, 13010, 29918, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 13, 1990, 16956, 29898, 3562, 1125, 13, 1678, 9995, 13, 1678, 319, 3495, 1104, 1078, 263, 1024, 322, 967, 15882, 29889, 13, 1678, 9995, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 3069, 29915, 13, 1678, 4770, 2371, 29918, 5085, 1649, 353, 11117, 11010, 2396, 10938, 29913, 13, 1678, 1178, 353, 12481, 877, 333, 742, 8102, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 1024, 353, 12481, 877, 978, 742, 1714, 29892, 5412, 29922, 5574, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 285, 29915, 29966, 8514, 29898, 333, 3790, 276, 558, 29898, 1311, 29889, 333, 19230, 1024, 3790, 276, 558, 29898, 1311, 29889, 978, 26972, 16299, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11980, 8600, 8954, 1213, 15945, 13, 4706, 736, 11117, 333, 2396, 1583, 29889, 333, 29892, 525, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 1678, 822, 1819, 29898, 1311, 29892, 8772, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29901, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 1819, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 8514, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 1948, 313, 23583, 1125, 13, 18884, 450, 421, 8514, 29889, 333, 29952, 322, 421, 8514, 29889, 978, 1412, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 333, 29892, 1583, 29889, 978, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6611, 29898, 2212, 1312, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29961, 710, 29892, 2023, 5387, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 6611, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 8514, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 6611, 313, 23583, 1125, 6702, 333, 742, 525, 978, 1495, 13, 4706, 9995, 13, 4706, 736, 525, 333, 742, 525, 978, 29915, 13, 13, 1678, 822, 15685, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 1123, 29899, 1958, 6611, 322, 3160, 5988, 21702, 1213, 15945, 13, 4706, 736, 11117, 3069, 29918, 333, 2396, 1583, 29889, 333, 29892, 525, 3069, 29918, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 13, 1990, 7777, 29898, 3562, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 4906, 29915, 13, 1678, 4770, 2371, 29918, 5085, 1649, 353, 11117, 11010, 2396, 10938, 29913, 13, 13, 1678, 1178, 353, 12481, 877, 333, 742, 7997, 7798, 2141, 2541, 29918, 19365, 29898, 7798, 29892, 525, 22793, 5477, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 931, 353, 12481, 877, 2230, 742, 12315, 29898, 2230, 8028, 29922, 5574, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 11261, 29918, 333, 353, 12481, 877, 13010, 29918, 333, 742, 8102, 29892, 19358, 2558, 29898, 7031, 293, 29889, 333, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 3233, 29918, 333, 353, 12481, 877, 5563, 29918, 333, 742, 8102, 29892, 19358, 2558, 29898, 10108, 29889, 333, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 3495, 29918, 333, 353, 12481, 877, 3069, 29918, 333, 742, 8102, 29892, 19358, 2558, 29898, 8514, 29889, 333, 511, 1870, 519, 29922, 8824, 29897, 13, 1678, 1426, 353, 12481, 877, 726, 742, 1714, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 11261, 353, 9443, 877, 7031, 293, 742, 1250, 999, 2433, 4906, 1495, 13, 1678, 3233, 353, 9443, 877, 10108, 742, 1250, 999, 2433, 4906, 1495, 13, 1678, 3495, 29871, 353, 9443, 877, 8514, 742, 1250, 999, 2433, 4906, 1495, 13, 13, 1678, 396, 4195, 635, 337, 7922, 363, 931, 29899, 6707, 8877, 292, 13, 1678, 565, 4833, 29918, 2917, 1839, 27852, 2033, 297, 6702, 3706, 29883, 744, 742, 29871, 1125, 13, 4706, 396, 6058, 29923, 29901, 450, 7601, 1820, 338, 6695, 2230, 1673, 421, 13010, 29918, 333, 6348, 6058, 421, 333, 1412, 13, 4706, 396, 910, 338, 13543, 541, 4100, 363, 18428, 11266, 29899, 2371, 8877, 292, 13, 4706, 396, 373, 278, 421, 2230, 29952, 1819, 363, 5974, 17185, 4051, 313, 6747, 7979, 4176, 467, 13, 4706, 1178, 353, 12481, 877, 333, 742, 7997, 7798, 29892, 13, 462, 1678, 922, 3910, 877, 4906, 29918, 333, 29918, 11762, 742, 1369, 29922, 29896, 29892, 11924, 29922, 29896, 29892, 10938, 29922, 11010, 511, 13, 462, 1678, 5399, 21529, 877, 333, 1405, 29871, 29900, 742, 1024, 2433, 4906, 29918, 333, 29918, 3198, 5477, 1870, 519, 29922, 8824, 29897, 13, 13, 4706, 931, 353, 12481, 877, 2230, 742, 12315, 29898, 2230, 8028, 29922, 5574, 511, 1870, 519, 29922, 8824, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 4706, 11261, 29918, 333, 353, 12481, 877, 13010, 29918, 333, 742, 8102, 29892, 1870, 519, 29922, 8824, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 13, 4706, 396, 6058, 29923, 29901, 3349, 6261, 9117, 6611, 29973, 13, 4706, 396, 3233, 29918, 333, 353, 12481, 877, 5563, 29918, 333, 742, 8102, 29892, 1870, 519, 29922, 8824, 29897, 13, 4706, 396, 3495, 29918, 333, 353, 12481, 877, 3069, 29918, 333, 742, 8102, 29892, 1870, 519, 29922, 8824, 29897, 13, 4706, 396, 13, 4706, 396, 11261, 353, 9443, 877, 7031, 293, 742, 1250, 999, 2433, 4906, 742, 9117, 29918, 8149, 11759, 13010, 29918, 333, 1402, 13, 4706, 396, 462, 418, 7601, 7122, 2433, 3728, 29889, 13010, 29918, 333, 1275, 7488, 293, 29889, 333, 1495, 13, 4706, 396, 3233, 353, 9443, 877, 10108, 742, 1250, 999, 2433, 4906, 742, 9117, 29918, 8149, 11759, 5563, 29918, 333, 1402, 13, 4706, 396, 462, 418, 7601, 7122, 2433, 3728, 29889, 5563, 29918, 333, 1275, 21597, 29889, 333, 1495, 13, 4706, 396, 3495, 29871, 353, 9443, 877, 8514, 742, 1250, 999, 2433, 4906, 742, 9117, 29918, 8149, 11759, 3069, 29918, 333, 1402, 13, 4706, 396, 462, 418, 7601, 7122, 2433, 3728, 29889, 3069, 29918, 333, 1275, 16956, 29889, 333, 1495, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 313, 29888, 29915, 29966, 3728, 29898, 333, 3790, 276, 558, 29898, 1311, 29889, 333, 19230, 29915, 13, 18884, 285, 29915, 931, 3790, 276, 558, 29898, 1311, 29889, 2230, 19230, 29915, 13, 18884, 285, 29915, 11261, 29918, 333, 3790, 276, 558, 29898, 1311, 29889, 13010, 29918, 333, 19230, 29915, 13, 18884, 285, 29915, 3233, 29918, 333, 3790, 276, 558, 29898, 1311, 29889, 5563, 29918, 333, 19230, 29915, 13, 18884, 285, 29915, 3495, 29918, 333, 3790, 276, 558, 29898, 1311, 29889, 3069, 29918, 333, 19230, 29915, 13, 18884, 285, 29915, 1426, 3790, 276, 558, 29898, 1311, 29889, 726, 26972, 29958, 1495, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11980, 8600, 8954, 1213, 15945, 13, 4706, 736, 11117, 333, 2396, 1583, 29889, 333, 29892, 525, 2230, 2396, 1583, 29889, 2230, 29892, 525, 13010, 29918, 333, 2396, 1583, 29889, 13010, 29918, 333, 29892, 13, 18884, 525, 5563, 29918, 333, 2396, 1583, 29889, 5563, 29918, 333, 29892, 525, 3069, 29918, 333, 2396, 1583, 29889, 3069, 29918, 333, 29892, 525, 726, 2396, 1583, 29889, 726, 29913, 13, 13, 1678, 822, 1819, 29898, 1311, 29892, 8772, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29901, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 1819, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 313, 4381, 29901, 7700, 467, 13, 4706, 9995, 13, 4706, 565, 451, 8772, 29901, 13, 9651, 736, 1583, 29889, 333, 29892, 1583, 29889, 2230, 29892, 1583, 29889, 13010, 29918, 333, 29892, 1583, 29889, 5563, 29918, 333, 29892, 1583, 29889, 3069, 29918, 333, 29892, 1583, 29889, 726, 13, 4706, 1683, 29901, 13, 9651, 736, 1583, 29889, 333, 29892, 1583, 29889, 2230, 29892, 1583, 29889, 13010, 29889, 978, 29892, 1583, 29889, 5563, 29889, 978, 29892, 1583, 29889, 3069, 29889, 978, 29892, 1583, 29889, 726, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6611, 29898, 2212, 1312, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29961, 710, 29892, 2023, 5387, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 6611, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 313, 4381, 29901, 7700, 467, 13, 4706, 9995, 13, 4706, 565, 451, 8772, 29901, 13, 9651, 736, 525, 333, 742, 525, 2230, 742, 525, 13010, 29918, 333, 742, 525, 5563, 29918, 333, 742, 525, 3069, 29918, 333, 742, 525, 726, 29915, 13, 4706, 1683, 29901, 13, 9651, 736, 525, 333, 742, 525, 2230, 742, 525, 13010, 742, 525, 5563, 742, 525, 3069, 742, 525, 726, 29915, 13, 13, 1678, 822, 15685, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 1123, 29899, 1958, 6611, 322, 3160, 5988, 21702, 1213, 15945, 13, 4706, 2643, 353, 11117, 4906, 29918, 2230, 2396, 1583, 29889, 2230, 29889, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 29889, 29995, 29888, 5477, 13, 462, 259, 525, 4906, 29918, 726, 2396, 1583, 29889, 726, 29913, 13, 4706, 736, 426, 1068, 4906, 29892, 3579, 1311, 29889, 13010, 29889, 17987, 7176, 3285, 13, 18884, 3579, 1311, 29889, 5563, 29889, 17987, 7176, 3285, 3579, 1311, 29889, 3069, 29889, 17987, 7176, 28296, 13, 13, 13, 361, 4833, 29918, 2917, 1839, 27852, 2033, 297, 6702, 3706, 29883, 744, 742, 29871, 1125, 13, 1678, 396, 591, 671, 931, 29899, 13010, 24457, 322, 817, 304, 2380, 3553, 13, 1678, 2643, 29918, 333, 29918, 2248, 353, 11374, 877, 4906, 29918, 333, 29918, 2248, 742, 7777, 29889, 333, 29897, 13, 2870, 29901, 13, 1678, 2643, 29918, 2230, 29918, 13010, 29918, 2248, 353, 11374, 877, 4906, 29918, 2230, 29918, 13010, 29918, 2248, 742, 7777, 29889, 2230, 29892, 7777, 29889, 13010, 29918, 333, 29897, 13, 13, 13, 29937, 8543, 21166, 373, 3495, 470, 3233, 13, 4906, 29918, 5563, 29918, 2248, 353, 11374, 877, 4906, 29918, 5563, 29918, 2248, 742, 7777, 29889, 5563, 29918, 333, 29897, 13, 4906, 29918, 3069, 29918, 2248, 353, 11374, 877, 4906, 29918, 3069, 29918, 2248, 742, 7777, 29889, 3069, 29918, 333, 29897, 13, 13, 13, 1990, 3323, 7588, 495, 29898, 3562, 1125, 13, 1678, 9995, 13, 1678, 319, 21696, 495, 1104, 1078, 263, 1024, 322, 967, 15882, 29889, 13, 1678, 9995, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 1491, 7588, 495, 29915, 13, 1678, 4770, 2371, 29918, 5085, 1649, 353, 11117, 11010, 2396, 10938, 29913, 13, 1678, 1178, 353, 12481, 877, 333, 742, 8102, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 1024, 353, 12481, 877, 978, 742, 1714, 29892, 5412, 29922, 5574, 29892, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 285, 29915, 29966, 4035, 7588, 495, 29898, 333, 3790, 276, 558, 29898, 1311, 29889, 333, 19230, 1024, 3790, 276, 558, 29898, 1311, 29889, 978, 26972, 16299, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11980, 8600, 8954, 1213, 15945, 13, 4706, 736, 11117, 333, 2396, 1583, 29889, 333, 29892, 525, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 1678, 822, 1819, 29898, 1311, 29892, 8772, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29901, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 1819, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 4035, 7588, 495, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 1948, 313, 23583, 1125, 13, 18884, 450, 421, 4035, 7588, 495, 29889, 333, 29952, 322, 421, 4035, 7588, 495, 29889, 978, 1412, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 333, 29892, 1583, 29889, 978, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6611, 29898, 2212, 1312, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29961, 710, 29892, 2023, 5387, 29871, 396, 694, 25621, 29901, 443, 3880, 3443, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 6611, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 29889, 13, 18884, 2216, 1304, 491, 421, 4035, 7588, 495, 1412, 13, 13, 4706, 16969, 29901, 13, 9651, 6611, 313, 23583, 1125, 6702, 333, 742, 525, 978, 1495, 13, 4706, 9995, 13, 4706, 736, 525, 333, 742, 525, 978, 29915, 13, 13, 1678, 822, 15685, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 1123, 29899, 1958, 6611, 322, 3160, 5988, 21702, 1213, 15945, 13, 4706, 736, 11117, 1491, 7588, 495, 29918, 333, 2396, 1583, 29889, 333, 29892, 525, 1491, 7588, 495, 29918, 978, 2396, 1583, 29889, 978, 29913, 13, 13, 13, 1990, 11028, 29898, 3562, 1125, 13, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 5943, 29915, 13, 1678, 4770, 2371, 29918, 5085, 1649, 353, 11117, 11010, 2396, 10938, 29913, 13, 1678, 21696, 495, 29918, 333, 353, 12481, 877, 1491, 7588, 495, 29918, 333, 742, 8102, 29892, 19358, 2558, 29898, 4035, 7588, 495, 29889, 333, 511, 1870, 519, 29922, 8824, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 11261, 29918, 333, 353, 12481, 877, 13010, 29918, 333, 742, 8102, 29892, 19358, 2558, 29898, 7031, 293, 29889, 333, 511, 1870, 519, 29922, 8824, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 931, 353, 12481, 877, 2230, 742, 12315, 29898, 2230, 8028, 29922, 5574, 511, 1870, 519, 29922, 8824, 29897, 13, 13, 1678, 21696, 495, 353, 9443, 877, 4035, 7588, 495, 742, 1250, 999, 2433, 5943, 1495, 13, 1678, 11261, 353, 9443, 877, 7031, 293, 742, 1250, 999, 2433, 5943, 1495, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 313, 29888, 29915, 29966, 6638, 29898, 1491, 7588, 495, 29918, 333, 3790, 276, 558, 29898, 1311, 29889, 1491, 7588, 495, 29918, 333, 19230, 29915, 13, 18884, 285, 29915, 11261, 29918, 333, 3790, 276, 558, 29898, 1311, 29889, 13010, 29918, 333, 19230, 29915, 13, 18884, 285, 29915, 931, 3790, 276, 558, 29898, 1311, 29889, 2230, 26972, 29958, 1495, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11980, 8600, 8954, 1213, 15945, 13, 4706, 736, 11117, 1491, 7588, 495, 29918, 333, 2396, 1583, 29889, 1491, 7588, 495, 29918, 333, 29892, 13, 18884, 525, 13010, 29918, 333, 2396, 1583, 29889, 13010, 29918, 333, 29892, 13, 18884, 525, 2230, 2396, 1583, 29889, 2230, 29913, 13, 13, 1678, 822, 1819, 29898, 1311, 29892, 8772, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29901, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 1819, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 313, 4381, 29901, 7700, 467, 13, 4706, 9995, 13, 4706, 565, 451, 8772, 29901, 13, 9651, 736, 1583, 29889, 1491, 7588, 495, 29918, 333, 29892, 1583, 29889, 13010, 29918, 333, 29892, 1583, 29889, 2230, 13, 4706, 1683, 29901, 13, 9651, 736, 1583, 29889, 1491, 7588, 495, 29889, 978, 29892, 1583, 29889, 13010, 29889, 978, 29892, 1583, 29889, 2230, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6611, 29898, 2212, 1312, 29901, 6120, 353, 7700, 29897, 1599, 12603, 552, 29961, 710, 29892, 2023, 5387, 13, 4706, 9995, 13, 4706, 12603, 552, 8954, 310, 6611, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 8772, 313, 11227, 1125, 13, 18884, 3650, 262, 5302, 2012, 310, 2893, 14903, 313, 4381, 29901, 7700, 467, 13, 4706, 9995, 13, 4706, 565, 451, 8772, 29901, 13, 9651, 736, 525, 1491, 7588, 495, 29918, 333, 742, 525, 13010, 29918, 333, 742, 525, 2230, 29915, 13, 4706, 1683, 29901, 13, 9651, 736, 525, 1491, 7588, 495, 742, 525, 13010, 742, 525, 2230, 29915, 13, 13, 1678, 822, 15685, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 1123, 29899, 1958, 6611, 322, 3160, 5988, 21702, 1213, 15945, 13, 4706, 2130, 353, 11117, 5943, 29918, 2230, 2396, 1583, 29889, 2230, 29889, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 29889, 29995, 29888, 1495, 29913, 13, 4706, 736, 426, 1068, 5943, 29892, 3579, 1311, 29889, 1491, 7588, 495, 29889, 17987, 7176, 3285, 3579, 1311, 29889, 13010, 29889, 17987, 7176, 28296, 13, 13, 13, 24051, 29901, 360, 919, 29961, 710, 29892, 6137, 29962, 353, 426, 13, 1678, 525, 5563, 2396, 21597, 29892, 13, 1678, 525, 13010, 2396, 7488, 293, 29892, 13, 1678, 525, 3069, 2396, 16956, 29892, 13, 1678, 525, 4906, 2396, 7777, 29892, 13, 1678, 525, 1491, 7588, 495, 2396, 3323, 7588, 495, 29892, 13, 1678, 525, 5943, 2396, 11028, 13, 29913, 13, 2 ]
napari_plugin_engine/__init__.py
tlambert-forks/napari-plugin-engine
6
75160
<filename>napari_plugin_engine/__init__.py try: from ._version import version as __version__ except ImportError: # broken installation, we don't even try # unknown only works because we do poor mans version compare __version__ = "unknown" __all__ = [ "get_metadata", "HookCaller", "HookCallError", "HookImplementation", "HookImplementationMarker", "HookResult", "HookSpecification", "HookSpecificationMarker", "napari_hook_implementation", "napari_hook_specification", "PluginCallError", "PluginError", "PluginImplementationError", "PluginImportError", "PluginManager", "PluginRegistrationError", "PluginValidationError", "standard_metadata", ] from .callers import HookResult from .dist import get_metadata, standard_metadata from .exceptions import ( HookCallError, PluginCallError, PluginError, PluginImplementationError, PluginImportError, PluginRegistrationError, PluginValidationError, ) from .hooks import HookCaller from .implementation import HookImplementation, HookSpecification from .manager import PluginManager from .markers import HookImplementationMarker, HookSpecificationMarker napari_hook_implementation = HookImplementationMarker("napari") napari_hook_specification = HookSpecificationMarker("napari")
[ 1, 529, 9507, 29958, 8971, 1306, 29918, 8582, 29918, 10599, 29914, 1649, 2344, 26914, 2272, 13, 2202, 29901, 13, 1678, 515, 869, 29918, 3259, 1053, 1873, 408, 4770, 3259, 1649, 13, 19499, 16032, 2392, 29901, 13, 1678, 396, 9391, 11161, 29892, 591, 1016, 29915, 29873, 1584, 1018, 13, 1678, 396, 9815, 871, 1736, 1363, 591, 437, 6460, 286, 550, 1873, 7252, 13, 1678, 4770, 3259, 1649, 353, 376, 26690, 29908, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 376, 657, 29918, 19635, 613, 13, 1678, 376, 29950, 2550, 5594, 261, 613, 13, 1678, 376, 29950, 2550, 5594, 2392, 613, 13, 1678, 376, 29950, 2550, 1888, 14607, 613, 13, 1678, 376, 29950, 2550, 1888, 14607, 24619, 613, 13, 1678, 376, 29950, 2550, 3591, 613, 13, 1678, 376, 29950, 2550, 10299, 2450, 613, 13, 1678, 376, 29950, 2550, 10299, 2450, 24619, 613, 13, 1678, 376, 8971, 1306, 29918, 20849, 29918, 21382, 613, 13, 1678, 376, 8971, 1306, 29918, 20849, 29918, 6550, 2450, 613, 13, 1678, 376, 16288, 5594, 2392, 613, 13, 1678, 376, 16288, 2392, 613, 13, 1678, 376, 16288, 1888, 14607, 2392, 613, 13, 1678, 376, 16288, 17518, 2392, 613, 13, 1678, 376, 16288, 3260, 613, 13, 1678, 376, 16288, 4597, 8306, 2392, 613, 13, 1678, 376, 16288, 19448, 2392, 613, 13, 1678, 376, 15770, 29918, 19635, 613, 13, 29962, 13, 13, 3166, 869, 4804, 414, 1053, 29612, 3591, 13, 3166, 869, 5721, 1053, 679, 29918, 19635, 29892, 3918, 29918, 19635, 13, 3166, 869, 11739, 29879, 1053, 313, 13, 1678, 29612, 5594, 2392, 29892, 13, 1678, 1858, 3851, 5594, 2392, 29892, 13, 1678, 1858, 3851, 2392, 29892, 13, 1678, 1858, 3851, 1888, 14607, 2392, 29892, 13, 1678, 1858, 3851, 17518, 2392, 29892, 13, 1678, 1858, 3851, 4597, 8306, 2392, 29892, 13, 1678, 1858, 3851, 19448, 2392, 29892, 13, 29897, 13, 3166, 869, 1251, 12117, 1053, 29612, 5594, 261, 13, 3166, 869, 21382, 1053, 29612, 1888, 14607, 29892, 29612, 10299, 2450, 13, 3166, 869, 12847, 1053, 1858, 3851, 3260, 13, 3166, 869, 3502, 414, 1053, 29612, 1888, 14607, 24619, 29892, 29612, 10299, 2450, 24619, 13, 13, 8971, 1306, 29918, 20849, 29918, 21382, 353, 29612, 1888, 14607, 24619, 703, 8971, 1306, 1159, 13, 8971, 1306, 29918, 20849, 29918, 6550, 2450, 353, 29612, 10299, 2450, 24619, 703, 8971, 1306, 1159, 13, 2 ]
tests/test_tipc/bigru_crf/export_model.py
mukaiu/PaddleNLP
0
83592
# -*- coding: UTF-8 -*- # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import argparse import os import paddle from paddle.static import InputSpec import paddlenlp as ppnlp from paddlenlp.data import Vocab from data import load_vocab from model import BiGruCrf # yapf: disable parser = argparse.ArgumentParser(__doc__) parser.add_argument("--data_dir", type=str, default=None, help="The folder where the dataset is located.") parser.add_argument("--params_path", type=str, default='./checkpoints/final.pdparams', help="The path of model parameter to be loaded.") parser.add_argument("--output_path", type=str, default='./infer_model', help="The path of model parameter in static graph to be saved.") parser.add_argument("--emb_dim", type=int, default=128, help="The dimension in which a word is embedded.") parser.add_argument("--hidden_size", type=int, default=128, help="The number of hidden nodes in the GRU layer.") args = parser.parse_args() # yapf: enable def main(): word_vocab = load_vocab(os.path.join(args.data_dir, 'word.dic')) label_vocab = load_vocab(os.path.join(args.data_dir, 'tag.dic')) model = BiGruCrf(args.emb_dim, args.hidden_size, len(word_vocab), len(label_vocab)) state_dict = paddle.load(args.params_path) model.set_dict(state_dict) model.eval() model = paddle.jit.to_static(model, input_spec=[ InputSpec(shape=[None, None], dtype="int64", name='token_ids'), InputSpec(shape=[None], dtype="int64", name='length') ]) # Save in static graph model. paddle.jit.save(model, os.path.join(args.output_path, "inference")) if __name__ == "__main__": main()
[ 1, 396, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 29937, 259, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 349, 22352, 29925, 22352, 13189, 943, 29889, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 13, 5215, 282, 22352, 13, 3166, 282, 22352, 29889, 7959, 1053, 10567, 10299, 13, 5215, 282, 1202, 2435, 22833, 408, 6499, 12938, 29886, 13, 3166, 282, 1202, 2435, 22833, 29889, 1272, 1053, 478, 542, 370, 13, 13, 3166, 848, 1053, 2254, 29918, 29894, 542, 370, 13, 3166, 1904, 1053, 3457, 29954, 582, 29907, 9600, 13, 13, 29937, 343, 481, 29888, 29901, 11262, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 22168, 1514, 1649, 29897, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1272, 29918, 3972, 613, 1134, 29922, 710, 29892, 2322, 29922, 8516, 29892, 1371, 543, 1576, 4138, 988, 278, 8783, 338, 5982, 23157, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 7529, 29918, 2084, 613, 1134, 29922, 710, 29892, 2322, 2433, 6904, 3198, 9748, 29914, 8394, 29889, 15926, 7529, 742, 1371, 543, 1576, 2224, 310, 1904, 3443, 304, 367, 7500, 23157, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 4905, 29918, 2084, 613, 1134, 29922, 710, 29892, 2322, 2433, 6904, 262, 571, 29918, 4299, 742, 1371, 543, 1576, 2224, 310, 1904, 3443, 297, 2294, 3983, 304, 367, 7160, 23157, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1590, 29918, 6229, 613, 1134, 29922, 524, 29892, 2322, 29922, 29896, 29906, 29947, 29892, 1371, 543, 1576, 9927, 297, 607, 263, 1734, 338, 15685, 23157, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 10892, 29918, 2311, 613, 1134, 29922, 524, 29892, 2322, 29922, 29896, 29906, 29947, 29892, 1371, 543, 1576, 1353, 310, 7934, 7573, 297, 278, 18016, 29965, 7546, 23157, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 29937, 343, 481, 29888, 29901, 9025, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 1734, 29918, 29894, 542, 370, 353, 2254, 29918, 29894, 542, 370, 29898, 359, 29889, 2084, 29889, 7122, 29898, 5085, 29889, 1272, 29918, 3972, 29892, 525, 1742, 29889, 27774, 8785, 13, 1678, 3858, 29918, 29894, 542, 370, 353, 2254, 29918, 29894, 542, 370, 29898, 359, 29889, 2084, 29889, 7122, 29898, 5085, 29889, 1272, 29918, 3972, 29892, 525, 4039, 29889, 27774, 8785, 13, 13, 1678, 1904, 353, 3457, 29954, 582, 29907, 9600, 29898, 5085, 29889, 1590, 29918, 6229, 29892, 6389, 29889, 10892, 29918, 2311, 29892, 7431, 29898, 1742, 29918, 29894, 542, 370, 511, 13, 462, 268, 7431, 29898, 1643, 29918, 29894, 542, 370, 876, 13, 13, 1678, 2106, 29918, 8977, 353, 282, 22352, 29889, 1359, 29898, 5085, 29889, 7529, 29918, 2084, 29897, 13, 1678, 1904, 29889, 842, 29918, 8977, 29898, 3859, 29918, 8977, 29897, 13, 1678, 1904, 29889, 14513, 580, 13, 13, 1678, 1904, 353, 282, 22352, 29889, 29926, 277, 29889, 517, 29918, 7959, 29898, 4299, 29892, 13, 462, 462, 1881, 29918, 6550, 11759, 13, 462, 462, 268, 10567, 10299, 29898, 12181, 11759, 8516, 29892, 6213, 1402, 13, 462, 462, 1669, 26688, 543, 524, 29953, 29946, 613, 13, 462, 462, 1669, 1024, 2433, 6979, 29918, 4841, 5477, 13, 462, 462, 268, 10567, 10299, 29898, 12181, 11759, 8516, 1402, 13, 462, 462, 1669, 26688, 543, 524, 29953, 29946, 613, 13, 462, 462, 1669, 1024, 2433, 2848, 1495, 13, 462, 462, 29871, 2314, 13, 1678, 396, 16913, 297, 2294, 3983, 1904, 29889, 13, 1678, 282, 22352, 29889, 29926, 277, 29889, 7620, 29898, 4299, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 5085, 29889, 4905, 29918, 2084, 29892, 376, 262, 1659, 5783, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 2 ]
test/test_bch.py
timoi-Lucypher/npCrypto
0
139832
<reponame>timoi-Lucypher/npCrypto import numpy as np from npcrypto.codes.bch import BCH from npcrypto.codes.poly_gf2 import a2p, strip_zeros def test_encode(): #http://www.comlab.hut.fi/studies/3410/slides_08_6_4.pdf n = 7 m = 3 k = 3 t = 2 msg = np.array([1,0,1], dtype=np.uint8) expected = np.array([1, 1, 0, 0, 1, 0, 1], dtype=np.uint8) bch = BCH(n, m, k, t) gen = np.array([1, 0, 1, 1, 1], dtype=np.uint8) bch.set_generator(gen) cdw = bch.encode(msg) assert np.all(strip_zeros(cdw) == expected)
[ 1, 529, 276, 1112, 420, 29958, 29873, 4200, 29875, 29899, 24126, 1270, 8096, 29914, 9302, 29907, 17929, 13, 5215, 12655, 408, 7442, 13, 3166, 302, 6739, 17929, 29889, 18137, 29889, 29890, 305, 1053, 350, 3210, 13, 3166, 302, 6739, 17929, 29889, 18137, 29889, 22678, 29918, 29887, 29888, 29906, 1053, 263, 29906, 29886, 29892, 17820, 29918, 3298, 359, 13, 13, 1753, 1243, 29918, 12508, 7295, 13, 1678, 396, 1124, 597, 1636, 29889, 510, 8205, 29889, 29882, 329, 29889, 7241, 29914, 18082, 583, 29914, 29941, 29946, 29896, 29900, 29914, 2536, 2247, 29918, 29900, 29947, 29918, 29953, 29918, 29946, 29889, 5140, 13, 1678, 302, 353, 29871, 29955, 13, 1678, 286, 353, 29871, 29941, 13, 1678, 413, 353, 29871, 29941, 13, 1678, 260, 353, 29871, 29906, 13, 13, 1678, 10191, 353, 7442, 29889, 2378, 4197, 29896, 29892, 29900, 29892, 29896, 1402, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 1678, 3806, 353, 7442, 29889, 2378, 4197, 29896, 29892, 29871, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 29892, 29871, 29896, 1402, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 1678, 289, 305, 353, 350, 3210, 29898, 29876, 29892, 286, 29892, 413, 29892, 260, 29897, 13, 1678, 2531, 353, 7442, 29889, 2378, 4197, 29896, 29892, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 1402, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 1678, 289, 305, 29889, 842, 29918, 27959, 29898, 1885, 29897, 259, 13, 1678, 14965, 29893, 353, 289, 305, 29889, 12508, 29898, 7645, 29897, 13, 1678, 4974, 7442, 29889, 497, 29898, 17010, 29918, 3298, 359, 29898, 2252, 29893, 29897, 1275, 3806, 29897, 13, 268, 13, 13, 2 ]
stest/pylibs/lazy_libs.py
hotswwkyo/stest
0
128206
<reponame>hotswwkyo/stest #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Author: 思文伟 @Date: 2022/03/23 ''' class LazyLibs(object): class Appium(object): @property def MobileBy(self): from appium.webdriver.common.mobileby import MobileBy return MobileBy @property def webdriver(self): from appium import webdriver return webdriver class Selenium(object): @property def exceptions(cls): from selenium.common import exceptions return exceptions @property def ActionChains(self): from selenium.webdriver import ActionChains return ActionChains @property def Keys(self): from selenium.webdriver.common.keys import Keys return Keys @property def By(self): from selenium.webdriver.common.by import By return By @property def WebDriverWait(self): from selenium.webdriver.support.wait import WebDriverWait return WebDriverWait @property def webdriver(self): from selenium import webdriver return webdriver @property def WebElement(self): from selenium.webdriver.remote.webelement import WebElement return WebElement @property def Select(self): from selenium.webdriver.support.ui import Select return Select class Wechat(object): @property def minium(self): import minium return minium @property def miniconfig(self): from minium.framework import miniconfig return miniconfig
[ 1, 529, 276, 1112, 420, 29958, 29882, 1862, 1615, 3459, 29877, 29914, 303, 342, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 8025, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 12008, 13, 29992, 13720, 29901, 29871, 31579, 30333, 231, 191, 162, 13, 29992, 2539, 29901, 29871, 29906, 29900, 29906, 29906, 29914, 29900, 29941, 29914, 29906, 29941, 13, 12008, 13, 13, 13, 1990, 19575, 29891, 14868, 29879, 29898, 3318, 1125, 13, 1678, 770, 2401, 1974, 29898, 3318, 1125, 13, 4706, 732, 6799, 13, 4706, 822, 21600, 2059, 29898, 1311, 1125, 13, 9651, 515, 623, 1974, 29889, 29813, 29889, 9435, 29889, 16769, 1609, 1053, 21600, 2059, 13, 9651, 736, 21600, 2059, 13, 13, 4706, 732, 6799, 13, 4706, 822, 1856, 9465, 29898, 1311, 1125, 13, 9651, 515, 623, 1974, 1053, 1856, 9465, 13, 9651, 736, 1856, 9465, 13, 13, 1678, 770, 317, 13462, 29898, 3318, 1125, 13, 4706, 732, 6799, 13, 4706, 822, 15283, 29898, 25932, 1125, 13, 9651, 515, 18866, 29889, 9435, 1053, 15283, 13, 9651, 736, 15283, 13, 13, 4706, 732, 6799, 13, 4706, 822, 9123, 1451, 2708, 29898, 1311, 1125, 13, 9651, 515, 18866, 29889, 29813, 1053, 9123, 1451, 2708, 13, 9651, 736, 9123, 1451, 2708, 13, 13, 4706, 732, 6799, 13, 4706, 822, 4813, 952, 29898, 1311, 1125, 13, 9651, 515, 18866, 29889, 29813, 29889, 9435, 29889, 8149, 1053, 4813, 952, 13, 9651, 736, 4813, 952, 13, 13, 4706, 732, 6799, 13, 4706, 822, 2648, 29898, 1311, 1125, 13, 9651, 515, 18866, 29889, 29813, 29889, 9435, 29889, 1609, 1053, 2648, 13, 9651, 736, 2648, 13, 13, 4706, 732, 6799, 13, 4706, 822, 2563, 12376, 15716, 29898, 1311, 1125, 13, 9651, 515, 18866, 29889, 29813, 29889, 5924, 29889, 10685, 1053, 2563, 12376, 15716, 13, 9651, 736, 2563, 12376, 15716, 13, 13, 4706, 732, 6799, 13, 4706, 822, 1856, 9465, 29898, 1311, 1125, 13, 9651, 515, 18866, 1053, 1856, 9465, 13, 9651, 736, 1856, 9465, 13, 13, 4706, 732, 6799, 13, 4706, 822, 2563, 2642, 29898, 1311, 1125, 13, 9651, 515, 18866, 29889, 29813, 29889, 16674, 29889, 705, 915, 944, 1053, 2563, 2642, 13, 9651, 736, 2563, 2642, 13, 13, 4706, 732, 6799, 13, 4706, 822, 7605, 29898, 1311, 1125, 13, 9651, 515, 18866, 29889, 29813, 29889, 5924, 29889, 1481, 1053, 7605, 13, 9651, 736, 7605, 13, 13, 1678, 770, 1334, 13496, 29898, 3318, 1125, 13, 4706, 732, 6799, 13, 4706, 822, 1375, 1974, 29898, 1311, 1125, 13, 9651, 1053, 1375, 1974, 13, 9651, 736, 1375, 1974, 13, 13, 4706, 732, 6799, 13, 4706, 822, 1375, 4144, 1003, 29898, 1311, 1125, 13, 9651, 515, 1375, 1974, 29889, 4468, 1053, 1375, 4144, 1003, 13, 9651, 736, 1375, 4144, 1003, 13, 2 ]
reprounzip-qt/reprounzip_qt/qt_terminal.py
kyleam/reprozip
0
69081
<filename>reprounzip-qt/reprounzip_qt/qt_terminal.py # Copyright (C) 2014-2017 New York University # This file is part of ReproZip which is released under the Revised BSD License # See file LICENSE for full license details. from __future__ import division, print_function, unicode_literals import cgi import locale from PyQt4 import QtCore, QtGui import sys class Terminal(QtGui.QWidget): finished = QtCore.pyqtSignal(int) def __init__(self, cmdline, env, input_enabled=False, success_msg=None, fail_msg=None, **kwargs): super(Terminal, self).__init__(**kwargs) self.success_msg = success_msg or "Command finished" self.fail_msg = fail_msg or "Command failed" layout = QtGui.QVBoxLayout() self.text = QtGui.QTextEdit(readOnly=True) layout.addWidget(self.text) if input_enabled: self.input = QtGui.QLineEdit() self.input.returnPressed.connect(self._enter) layout.addWidget(self.input) else: self.input = None self.setLayout(layout) self.process = QtCore.QProcess(self) # Dodge py2app issues environ = QtCore.QProcessEnvironment.systemEnvironment() if environ.contains('PYTHONHOME'): environ.remove('PYTHONPATH') environ.remove('PYTHONHOME') if sys.platform == 'darwin': environ.insert( 'PATH', (environ.value('PATH', '/usr/bin:/bin:/usr/sbin:/sbin') + ':/usr/local/bin:/opt/reprounzip')) # Unset TERM to avoid ansi escapes environ.remove('TERM') # Add additional environment variables for k, v in env.items(): environ.insert(k, v) self.process.setProcessEnvironment(environ) self.process.setProcessChannelMode(QtCore.QProcess.SeparateChannels) if input_enabled: mode = QtCore.QIODevice.ReadWrite else: mode = QtCore.QIODevice.ReadOnly self.process.start(cmdline[0], cmdline[1:], mode) if not input_enabled: self.process.closeWriteChannel() self.process.readyReadStandardOutput.connect(self._read_stdout) self.process.readyReadStandardError.connect(self._read_stderr) self.process.finished.connect(self._finished) self.text.setHtml('''\ <style> body { font: Consolas, "Liberation Mono", Menlo, Courier, monospace; } .err { color: red; } </style> ''') self.text.append('<span style="color: blue;">%s</span>' % cgi.escape(' '.join(cmdline))) def _enter(self): cmd = self.input.text() self.input.setText('') self.process.write(cmd + '\n') def _read_stdout(self): out = self.process.readAllStandardOutput() out = bytes(out).decode(locale.getpreferredencoding() or 'UTF-8', 'replace') self.text.append('<span>%s</span>' % cgi.escape(out)) def _read_stderr(self): out = self.process.readAllStandardError() out = bytes(out).decode(locale.getpreferredencoding() or 'UTF-8', 'replace') self.text.append('<span class="err">%s</span>' % cgi.escape(out)) def _finished(self, code, status): good = False if status == QtCore.QProcess.NormalExit: msg = "returned %d" % code self.finished.emit(code) good = code == 0 else: msg = "crashed" self.finished.emit(-1) if good: msg = self.success_msg else: msg = "%s (%s)" % (self.fail_msg, msg) self.text.append('<br><span style="color: blue;">%s</span>' % msg) def run_in_builtin_terminal(cmd, env, text=None, success_msg=None, fail_msg=None): result = [False] def store_result(code): result[:] = [code] dialog = QtGui.QDialog() layout = QtGui.QVBoxLayout() if text is not None: layout.addWidget(QtGui.QLabel(text)) terminal = Terminal(cmd, env, input_enabled=False, success_msg=success_msg, fail_msg=fail_msg) terminal.finished.connect(store_result) layout.addWidget(terminal) buttons = QtGui.QHBoxLayout() buttons.addStretch(1) accept = QtGui.QPushButton("Close", enabled=False) accept.clicked.connect(dialog.accept) terminal.finished.connect(lambda _: accept.setEnabled(True)) buttons.addWidget(accept) layout.addLayout(buttons) dialog.setLayout(layout) dialog.exec_() return result[0]
[ 1, 529, 9507, 29958, 276, 558, 1309, 7554, 29899, 17915, 29914, 276, 558, 1309, 7554, 29918, 17915, 29914, 17915, 29918, 8489, 979, 29889, 2272, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29946, 29899, 29906, 29900, 29896, 29955, 1570, 3088, 3014, 13, 29937, 910, 934, 338, 760, 310, 830, 771, 26264, 607, 338, 5492, 1090, 278, 830, 11292, 350, 7230, 19245, 13, 29937, 2823, 934, 365, 2965, 1430, 1660, 363, 2989, 19405, 4902, 29889, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 29892, 1596, 29918, 2220, 29892, 29104, 29918, 20889, 1338, 13, 13, 5215, 274, 3146, 13, 5215, 15068, 13, 3166, 10772, 17303, 29946, 1053, 14705, 9203, 29892, 14705, 28707, 13, 5215, 10876, 13, 13, 13, 1990, 29175, 29898, 17303, 28707, 29889, 29984, 8801, 1125, 13, 1678, 7743, 353, 14705, 9203, 29889, 2272, 17915, 10140, 284, 29898, 524, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 9920, 1220, 29892, 8829, 29892, 1881, 29918, 17590, 29922, 8824, 29892, 13, 462, 2551, 29918, 7645, 29922, 8516, 29892, 4418, 29918, 7645, 29922, 8516, 29892, 13, 462, 3579, 19290, 1125, 13, 4706, 2428, 29898, 14343, 979, 29892, 1583, 467, 1649, 2344, 12035, 1068, 19290, 29897, 13, 13, 4706, 1583, 29889, 8698, 29918, 7645, 353, 2551, 29918, 7645, 470, 376, 6255, 7743, 29908, 13, 4706, 1583, 29889, 14057, 29918, 7645, 353, 4418, 29918, 7645, 470, 376, 6255, 5229, 29908, 13, 13, 4706, 5912, 353, 14705, 28707, 29889, 29984, 29963, 3313, 3453, 580, 13, 4706, 1583, 29889, 726, 353, 14705, 28707, 29889, 29984, 1626, 6103, 29898, 949, 11730, 29922, 5574, 29897, 13, 4706, 5912, 29889, 1202, 8801, 29898, 1311, 29889, 726, 29897, 13, 4706, 565, 1881, 29918, 17590, 29901, 13, 9651, 1583, 29889, 2080, 353, 14705, 28707, 29889, 2239, 457, 6103, 580, 13, 9651, 1583, 29889, 2080, 29889, 2457, 24104, 29889, 6915, 29898, 1311, 3032, 5893, 29897, 13, 9651, 5912, 29889, 1202, 8801, 29898, 1311, 29889, 2080, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 2080, 353, 6213, 13, 4706, 1583, 29889, 842, 3453, 29898, 2680, 29897, 13, 13, 4706, 1583, 29889, 5014, 353, 14705, 9203, 29889, 29984, 7032, 29898, 1311, 29897, 13, 13, 4706, 396, 360, 17979, 11451, 29906, 932, 5626, 13, 4706, 12471, 353, 14705, 9203, 29889, 29984, 7032, 18649, 29889, 5205, 18649, 580, 13, 4706, 565, 12471, 29889, 11516, 877, 20055, 4690, 1164, 17353, 29374, 13, 9651, 12471, 29889, 5992, 877, 20055, 4690, 1164, 10145, 1495, 13, 9651, 12471, 29889, 5992, 877, 20055, 4690, 1164, 17353, 1495, 13, 4706, 565, 10876, 29889, 12120, 1275, 525, 16702, 5080, 2396, 13, 9651, 12471, 29889, 7851, 29898, 13, 18884, 525, 10145, 742, 13, 18884, 313, 21813, 29889, 1767, 877, 10145, 742, 8207, 4855, 29914, 2109, 8419, 2109, 8419, 4855, 29914, 29879, 2109, 8419, 29879, 2109, 1495, 718, 13, 462, 525, 8419, 4855, 29914, 2997, 29914, 2109, 8419, 3670, 29914, 276, 558, 1309, 7554, 8785, 13, 13, 4706, 396, 853, 842, 323, 1001, 29924, 304, 4772, 385, 1039, 3966, 11603, 13, 4706, 12471, 29889, 5992, 877, 4945, 29924, 1495, 13, 13, 4706, 396, 3462, 5684, 5177, 3651, 13, 4706, 363, 413, 29892, 325, 297, 8829, 29889, 7076, 7295, 13, 9651, 12471, 29889, 7851, 29898, 29895, 29892, 325, 29897, 13, 13, 4706, 1583, 29889, 5014, 29889, 842, 7032, 18649, 29898, 21813, 29897, 13, 4706, 1583, 29889, 5014, 29889, 842, 7032, 13599, 6818, 29898, 17303, 9203, 29889, 29984, 7032, 29889, 2008, 862, 403, 1451, 12629, 29897, 13, 4706, 565, 1881, 29918, 17590, 29901, 13, 9651, 4464, 353, 14705, 9203, 29889, 29984, 5971, 11501, 29889, 6359, 6113, 13, 4706, 1683, 29901, 13, 9651, 4464, 353, 14705, 9203, 29889, 29984, 5971, 11501, 29889, 6359, 11730, 13, 4706, 1583, 29889, 5014, 29889, 2962, 29898, 9006, 1220, 29961, 29900, 1402, 9920, 1220, 29961, 29896, 29901, 1402, 4464, 29897, 13, 4706, 565, 451, 1881, 29918, 17590, 29901, 13, 9651, 1583, 29889, 5014, 29889, 5358, 6113, 13599, 580, 13, 4706, 1583, 29889, 5014, 29889, 2040, 6359, 15449, 6466, 29889, 6915, 29898, 1311, 3032, 949, 29918, 25393, 29897, 13, 4706, 1583, 29889, 5014, 29889, 2040, 6359, 15449, 2392, 29889, 6915, 29898, 1311, 3032, 949, 29918, 303, 20405, 29897, 13, 4706, 1583, 29889, 5014, 29889, 4951, 3276, 29889, 6915, 29898, 1311, 3032, 4951, 3276, 29897, 13, 4706, 1583, 29889, 726, 29889, 842, 10922, 877, 4907, 29905, 13, 29966, 3293, 29958, 13, 2587, 426, 13, 1678, 4079, 29901, 2138, 16118, 29892, 376, 29931, 12347, 362, 2598, 29877, 613, 7567, 417, 29892, 19565, 4336, 29892, 1601, 359, 3535, 29936, 13, 29913, 13, 13, 29889, 3127, 426, 13, 1678, 2927, 29901, 2654, 29936, 13, 29913, 13, 829, 3293, 29958, 13, 4907, 1495, 13, 4706, 1583, 29889, 726, 29889, 4397, 877, 29966, 9653, 3114, 543, 2780, 29901, 7254, 12334, 29995, 29879, 829, 9653, 16299, 1273, 13, 462, 308, 274, 3146, 29889, 21587, 877, 15300, 7122, 29898, 9006, 1220, 4961, 13, 13, 1678, 822, 903, 5893, 29898, 1311, 1125, 13, 4706, 9920, 353, 1583, 29889, 2080, 29889, 726, 580, 13, 4706, 1583, 29889, 2080, 29889, 12038, 877, 1495, 13, 4706, 1583, 29889, 5014, 29889, 3539, 29898, 9006, 718, 11297, 29876, 1495, 13, 13, 1678, 822, 903, 949, 29918, 25393, 29898, 1311, 1125, 13, 4706, 714, 353, 1583, 29889, 5014, 29889, 949, 3596, 15449, 6466, 580, 13, 4706, 714, 353, 6262, 29898, 449, 467, 13808, 29898, 23337, 29889, 657, 1457, 14373, 22331, 580, 470, 525, 10496, 29899, 29947, 742, 13, 462, 18884, 525, 6506, 1495, 13, 4706, 1583, 29889, 726, 29889, 4397, 877, 29966, 9653, 29958, 29995, 29879, 829, 9653, 16299, 1273, 274, 3146, 29889, 21587, 29898, 449, 876, 13, 13, 1678, 822, 903, 949, 29918, 303, 20405, 29898, 1311, 1125, 13, 4706, 714, 353, 1583, 29889, 5014, 29889, 949, 3596, 15449, 2392, 580, 13, 4706, 714, 353, 6262, 29898, 449, 467, 13808, 29898, 23337, 29889, 657, 1457, 14373, 22331, 580, 470, 525, 10496, 29899, 29947, 742, 13, 462, 18884, 525, 6506, 1495, 13, 4706, 1583, 29889, 726, 29889, 4397, 877, 29966, 9653, 770, 543, 3127, 1013, 29995, 29879, 829, 9653, 16299, 1273, 274, 3146, 29889, 21587, 29898, 449, 876, 13, 13, 1678, 822, 903, 4951, 3276, 29898, 1311, 29892, 775, 29892, 4660, 1125, 13, 4706, 1781, 353, 7700, 13, 4706, 565, 4660, 1275, 14705, 9203, 29889, 29984, 7032, 29889, 19077, 24365, 29901, 13, 9651, 10191, 353, 376, 2457, 287, 1273, 29881, 29908, 1273, 775, 13, 9651, 1583, 29889, 4951, 3276, 29889, 21976, 29898, 401, 29897, 13, 9651, 1781, 353, 775, 1275, 29871, 29900, 13, 4706, 1683, 29901, 13, 9651, 10191, 353, 376, 7283, 25936, 29908, 13, 9651, 1583, 29889, 4951, 3276, 29889, 21976, 6278, 29896, 29897, 13, 4706, 565, 1781, 29901, 13, 9651, 10191, 353, 1583, 29889, 8698, 29918, 7645, 13, 4706, 1683, 29901, 13, 9651, 10191, 353, 11860, 29879, 313, 29995, 29879, 5513, 1273, 313, 1311, 29889, 14057, 29918, 7645, 29892, 10191, 29897, 13, 4706, 1583, 29889, 726, 29889, 4397, 877, 29966, 1182, 5299, 9653, 3114, 543, 2780, 29901, 7254, 12334, 29995, 29879, 829, 9653, 16299, 1273, 10191, 29897, 13, 13, 13, 1753, 1065, 29918, 262, 29918, 16145, 262, 29918, 8489, 979, 29898, 9006, 29892, 8829, 29892, 13, 462, 9651, 1426, 29922, 8516, 29892, 2551, 29918, 7645, 29922, 8516, 29892, 4418, 29918, 7645, 29922, 8516, 1125, 13, 1678, 1121, 353, 518, 8824, 29962, 13, 13, 1678, 822, 3787, 29918, 2914, 29898, 401, 1125, 13, 4706, 1121, 7503, 29962, 353, 518, 401, 29962, 13, 13, 1678, 7928, 353, 14705, 28707, 29889, 29984, 7647, 580, 13, 1678, 5912, 353, 14705, 28707, 29889, 29984, 29963, 3313, 3453, 580, 13, 1678, 565, 1426, 338, 451, 6213, 29901, 13, 4706, 5912, 29889, 1202, 8801, 29898, 17303, 28707, 29889, 2239, 1107, 29898, 726, 876, 13, 1678, 8638, 353, 29175, 29898, 9006, 29892, 8829, 29892, 1881, 29918, 17590, 29922, 8824, 29892, 13, 462, 4706, 2551, 29918, 7645, 29922, 8698, 29918, 7645, 29892, 4418, 29918, 7645, 29922, 14057, 29918, 7645, 29897, 13, 1678, 8638, 29889, 4951, 3276, 29889, 6915, 29898, 8899, 29918, 2914, 29897, 13, 1678, 5912, 29889, 1202, 8801, 29898, 8489, 979, 29897, 13, 1678, 9828, 353, 14705, 28707, 29889, 29984, 29950, 3313, 3453, 580, 13, 1678, 9828, 29889, 1202, 855, 10301, 29898, 29896, 29897, 13, 1678, 3544, 353, 14705, 28707, 29889, 29984, 27031, 3125, 703, 11123, 613, 9615, 29922, 8824, 29897, 13, 1678, 3544, 29889, 3808, 287, 29889, 6915, 29898, 15901, 29889, 16044, 29897, 13, 1678, 8638, 29889, 4951, 3276, 29889, 6915, 29898, 2892, 903, 29901, 3544, 29889, 842, 10861, 29898, 5574, 876, 13, 1678, 9828, 29889, 1202, 8801, 29898, 16044, 29897, 13, 1678, 5912, 29889, 1202, 3453, 29898, 4187, 7453, 29897, 13, 1678, 7928, 29889, 842, 3453, 29898, 2680, 29897, 13, 1678, 7928, 29889, 4258, 29918, 580, 13, 13, 1678, 736, 1121, 29961, 29900, 29962, 13, 2 ]
weather_alarm/main.py
Cs4r/weather_alarm
0
23459
<filename>weather_alarm/main.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import datetime import os from apscheduler.schedulers.blocking import BlockingScheduler from weather_alarm.constants import * from weather_alarm.forecaster import Forecaster from weather_alarm.sender import NotificationSender sender = NotificationSender(BOT_TOKEN, TELEGRAM_USER_ID) forecaster = Forecaster(OWM_API_KEY) def send_tomorrow_forecast(hour, time): sender.send_message(forecaster.tomorrow_forecast_at(CITY, hour, time)) def send_current_observed_weather(): sender.send_message(forecaster.current_observed_weather(CITY)) now = datetime.datetime.now() nightly_alarm_time = datetime.datetime(now.year, now.month, now.day, *NIGHTLY_ALARM_TIME) daily_alarm_time = datetime.datetime(now.year, now.month, now.day, *DAILY_ALARM_TIME) scheduler = BlockingScheduler() scheduler.add_job(func=send_tomorrow_forecast, args=FORECAST_TIME, trigger='interval', next_run_time=nightly_alarm_time, misfire_grace_time=30, days=1) scheduler.add_job(func=send_current_observed_weather, trigger='interval', next_run_time=daily_alarm_time, misfire_grace_time=30, days=1) print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C')) try: scheduler.start() except (KeyboardInterrupt, SystemExit): pass
[ 1, 529, 9507, 29958, 705, 1624, 29918, 284, 2817, 29914, 3396, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 12865, 13, 5215, 2897, 13, 3166, 263, 567, 305, 14952, 29889, 816, 287, 352, 414, 29889, 1271, 292, 1053, 15658, 292, 4504, 14952, 13, 3166, 14826, 29918, 284, 2817, 29889, 3075, 1934, 1053, 334, 13, 3166, 14826, 29918, 284, 2817, 29889, 1079, 29883, 1901, 1053, 28297, 29883, 1901, 13, 3166, 14826, 29918, 284, 2817, 29889, 15452, 1053, 28578, 29615, 13, 13, 13, 15452, 353, 28578, 29615, 29898, 29933, 2891, 29918, 4986, 29968, 1430, 29892, 17067, 1307, 29954, 25058, 29918, 11889, 29918, 1367, 29897, 13, 1079, 29883, 1901, 353, 28297, 29883, 1901, 29898, 9806, 29924, 29918, 8787, 29918, 10818, 29897, 13, 13, 13, 1753, 3638, 29918, 15135, 22396, 29918, 1079, 4384, 29898, 18721, 29892, 931, 1125, 13, 1678, 10004, 29889, 6717, 29918, 4906, 29898, 1079, 29883, 1901, 29889, 15135, 22396, 29918, 1079, 4384, 29918, 271, 29898, 29907, 11937, 29892, 7234, 29892, 931, 876, 13, 13, 13, 1753, 3638, 29918, 3784, 29918, 711, 643, 1490, 29918, 705, 1624, 7295, 13, 1678, 10004, 29889, 6717, 29918, 4906, 29898, 1079, 29883, 1901, 29889, 3784, 29918, 711, 643, 1490, 29918, 705, 1624, 29898, 29907, 11937, 876, 13, 13, 13, 3707, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 11147, 368, 29918, 284, 2817, 29918, 2230, 353, 12865, 29889, 12673, 29898, 3707, 29889, 6360, 29892, 1286, 29889, 10874, 29892, 1286, 29889, 3250, 29892, 334, 29940, 22530, 16786, 29918, 1964, 1718, 29924, 29918, 15307, 29897, 13, 29881, 8683, 29918, 284, 2817, 29918, 2230, 353, 12865, 29889, 12673, 29898, 3707, 29889, 6360, 29892, 1286, 29889, 10874, 29892, 1286, 29889, 3250, 29892, 334, 7698, 6227, 29979, 29918, 1964, 1718, 29924, 29918, 15307, 29897, 13, 13, 816, 14952, 353, 15658, 292, 4504, 14952, 580, 13, 13, 816, 14952, 29889, 1202, 29918, 9057, 29898, 9891, 29922, 6717, 29918, 15135, 22396, 29918, 1079, 4384, 29892, 6389, 29922, 5800, 1525, 5454, 1254, 29918, 15307, 29892, 7135, 2433, 19207, 742, 2446, 29918, 3389, 29918, 2230, 29922, 11147, 368, 29918, 284, 2817, 29918, 2230, 29892, 13, 462, 29871, 3984, 8696, 29918, 3874, 346, 29918, 2230, 29922, 29941, 29900, 29892, 3841, 29922, 29896, 29897, 13, 13, 816, 14952, 29889, 1202, 29918, 9057, 29898, 9891, 29922, 6717, 29918, 3784, 29918, 711, 643, 1490, 29918, 705, 1624, 29892, 7135, 2433, 19207, 742, 2446, 29918, 3389, 29918, 2230, 29922, 29881, 8683, 29918, 284, 2817, 29918, 2230, 29892, 13, 462, 29871, 3984, 8696, 29918, 3874, 346, 29918, 2230, 29922, 29941, 29900, 29892, 3841, 29922, 29896, 29897, 13, 13, 2158, 877, 10923, 315, 11742, 29974, 29912, 29900, 29913, 304, 6876, 4286, 4830, 877, 20130, 557, 29915, 565, 2897, 29889, 978, 1275, 525, 593, 29915, 1683, 525, 29907, 8785, 13, 13, 2202, 29901, 13, 1678, 1364, 14952, 29889, 2962, 580, 13, 19499, 313, 2558, 3377, 4074, 6685, 29892, 2184, 24365, 1125, 13, 1678, 1209, 2 ]