content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
#!/usr/bin/python -u
import argparse
import sys
import re
import os
import traceback
from operator import itemgetter, attrgetter
from biokbase.probabilistic_annotation.Client import _read_inifile
from biokbase.workspaceService.Client import *
desc = '''
Given a JSON object calculate the false positive, negative rates. Optionally omit everything that isn't
in the specified media.
'''
separator ='///'
rolesToRxnsFileName = 'roles_to_reactions'
if __name__ == "__main__":
parser = argparse.ArgumentParser(prog='GeneratePhenotypeROCCurve.py', description=desc)
parser.add_argument('genome', help='ID of genome to analyze', action='store', default=None)
parser.add_argument('model', help='ID of integrated gap filled model to analyze', action='store', default=None)
parser.add_argument('phenosimset', help='ID of PhenotypeSimulationSet object to analyze', action='store', default=None)
parser.add_argument('workspace', help='ID of workspace containing objects to analyze', action='store', default=None)
parser.add_argument('--solution', help='index number of solution in integrated gap filled model', action='store', default='0')
parser.add_argument('--phenosimsetws', help='workspace containing PhenotypeSimulationSet object (same as workspace if not specified)', action='store', default=None)
parser.add_argument('--media', help='limit analysis to only this media condition', action='store', dest='media', default=None)
parser.add_argument('--probanno', help='ID of ProbAnno object for genome', action='store', dest='probanno', default=None)
parser.add_argument('--probannows', help='workspace containing ProbAnno object (same as workspace if not specified)', action='store', dest='probannows', default=None)
parser.add_argument('--rxnprobs', help='ID of RxnProbs object for genome', action='store', dest='rxnprobs', default=None)
parser.add_argument('--rxnprobsws', help='workspace containing RxnProbs object (same as workspace if not specified)', action='store', dest='rxnprobsws', default=None)
parser.add_argument('--script-dir', help='path to directory with analysis scripts', action='store', dest='scriptDir', default='.')
parser.add_argument('--fba-url', help='url for fba modeling service', action='store', dest='fbaurl', default='http://bio-data-1.mcs.anl.gov/services/fba')
parser.add_argument('--ws-url', help='url for workspace service', action='store', dest='wsurl', default='http://kbase.us/services/workspace/')
args = parser.parse_args()
if args.probanno is None:
args.probanno = args.genome + '.probanno'
if args.probannows is None:
args.probannows = args.workspace
if args.rxnprobs is None:
args.rxnprobs = args.genome + '.rxnprobs'
if args.rxnprobsws is None:
args.rxnprobsws = args.workspace
if args.phenosimsetws is None:
args.phenosimsetws = args.workspace
# Create the clients for the services we need.
authdata = _read_inifile()
token = authdata['token']
wsClient = workspaceService(args.wsurl)
# Build roles to reactions dictionary.
step = 1
print "+++ Step %d: Build reactions to roles dictionary +++" %(step)
if not os.path.exists(rolesToRxnsFileName):
os.system("all_roles_used_in_models | roles_to_complexes | get_relationship_HasStep -to id >%s" %(rolesToRxnsFileName))
rolesToReactions = dict()
reactionsToRoles = dict()
# Each line of the file has four fields: (1) role, (2) hypothetical flag, (3) complex id, (4) reaction id
rolesToRxnsFile = open(rolesToRxnsFileName, 'r')
for line in rolesToRxnsFile:
fields = line.strip('\r\n').split('\t')
reaction = fields[3]
if reaction not in reactionsToRoles:
reactionsToRoles[reaction] = list()
reactionsToRoles[reaction].append(fields[0])
rolesToRxnsFile.close()
print " %d reactions in reactions to roles dictionary" %(len(reactionsToRoles))
# Analyze the gap fill results for the specified model.
step += 1
print "+++ Step %d: Run AnalyzeGapfillResults.py for model '%s/%s' +++" %(step, args.workspace, args.model)
rxnprobs = args.rxnprobs
resultsFileName = args.model + '.results'
os.system("%s/AnalyzeGapfillResults.py -m %s -w %s --rxnprobs %s --url %s >%s" \
%(args.scriptDir, args.model, args.workspace, rxnprobs, args.fbaurl, resultsFileName))
genesToReactions = dict()
resultsFile = open(resultsFileName, 'r')
resultsFile.readline() # Throw away header line
for line in resultsFile:
fields = line.strip('\r\n').split('\t')
if fields[0] == args.solution:
if fields[5] == '0': # Only keep reactions that are not a reversibility change
if fields[6]: # Only keep reactions that have a GPR
rxnid = re.sub(r'rxn0*(\d+)', r'kb|rxn.\1', fields[1])
geneList = re.findall('fig\|\d+\.\d+\.peg\.\d+', fields[6])
for index in range(len(geneList)):
if geneList[index] not in genesToReactions:
genesToReactions[geneList[index]] = dict()
genesToReactions[geneList[index]][rxnid] = 0.0
resultsFile.close()
print " %d genes in genes to reactions dictionary" %(len(genesToReactions))
# Get the ProbAnno object from the workspace.
step += 1
probanno = args.probanno
print "+++ Step %d: Get ProbAnno object '%s/%s'" %(step, args.probannows, probanno)
paObject = wsClient.get_object( { 'id': probanno, 'workspace': args.probannows, 'type': 'ProbAnno', 'auth': token } )
probAnno = paObject['data']
print " %d genes in ProbAnno roleset probabilities dictionary" %(len(probAnno['roleset_probabilities']))
# Need to go through rolesets dictionary
# If an entry has more than one role, split into parts
# Then run the array and combine any duplicate roles by adding probs
# Parse the roleset probabilities from the ProbAnno object.
step += 1
print "+++ Step %d: Parse rolesets into roles and adjust probabilities for duplicates +++" %(step)
rolesetProbabilities = dict()
for gene in probAnno['roleset_probabilities']:
geneRoleList = probAnno['roleset_probabilities'][gene]
geneRoleDict = dict()
for index in range(len(geneRoleList)):
prob = geneRoleList[index][1] # Probability for this roleset
# Split multiple roles in roleset for this gene
roleList = geneRoleList[index][0].split(separator)
# If role occurs more than once, add up the probabilities
for j in range(len(roleList)):
if roleList[j] in geneRoleDict:
geneRoleDict[roleList[j]] += prob
else:
geneRoleDict[roleList[j]] = prob
rolesetProbabilities[gene] = geneRoleDict
print " %d genes in parsed roleset probabilities dictionary" %(len(rolesetProbabilities))
# for each reaction in the reactions dictionary, find the roles in the rolesToReactions dictionary
# then find the roles in the probanno object for the gene
step += 1
print "+++ Step %d: Find maximum probability of reaction given gene +++" %(step)
probsFile = open(args.model+'.probs', 'w')
numProbs = 0
for gene in genesToReactions:
if gene in rolesetProbabilities:
geneRoleDict = rolesetProbabilities[gene]
for reaction in genesToReactions[gene]:
if reaction not in reactionsToRoles:
print 'Why is reaction %s not in the reactionToRoles dictionary?' %(reaction)
roleList = reactionsToRoles[reaction]
for index in range(0,len(roleList)):
for role in geneRoleDict:
if role == roleList[index]:
probsFile.write('P(%s | %s) = %f\n' %(reaction, gene, geneRoleDict[role]))
genesToReactions[gene][reaction] = max(geneRoleDict[role], genesToReactions[gene][reaction])
numProbs += 1
else:
print 'Gene %s not found in ProbAnno object' %(gene)
probsFile.close()
print " %d reaction probabilities set in genesToReactions dictionary" %(numProbs)
# Get the PhenotypeSimulationSet object.
step += 1
print "+++ Step %d: Get phenotype simulation set %s/%s +++" %(step, args.phenosimsetws, args.phenosimset)
pssObject = wsClient.get_object( { 'id': args.phenosimset, 'workspace': args.phenosimsetws, 'type': 'PhenotypeSimulationSet', 'auth': token } )
phenoSimSet = pssObject['data']
# Make sure the model matches in the phenotype simulation set.
if phenoSimSet['model'] != args.model or phenoSimSet['model_workspace'] != args.workspace:
print 'Specified model %s/%s does not match model %s/%s in phenotype simulation set' \
%(args.workspace, args.model, phenoSimSet['model_workspace'], phenoSimSet['model'])
print " %d simulations in phenotype simulation set" %(len(phenoSimSet['phenotypeSimulations']))
# Go through the list of simulations, for each gene and see if the gene is in the genesToReactions
# dictionary. If so, mark it as known and include the probability. Otherwise, mark it as unknown
# and set the probability to 0.5. In both cases, set a flag indicating if the simulation was
# correct or incorrect.
step += 1
print "+++ Step %d: Analyze phenotype simulation set results +++" %(step)
numKnown = 0
resultList = list()
for sim in phenoSimSet['phenotypeSimulations']:
if sim[3] == 'CP' or sim[3] == 'CN':
right = 1
else:
right = 0
geneList = sim[0][0]
for gene in geneList:
if gene in genesToReactions:
for reaction in genesToReactions[gene]:
resultList.append( (gene, reaction, genesToReactions[gene][reaction], right ) )
numKnown += 1
else:
resultList.append( (gene, 'unknown', 0.5, right) )
print " %d genes had reactions with known probabilities" %(numKnown)
step += 1
print "+++ Step %d: Save analysis to file +++" %(step)
resultList.sort(key=itemgetter(2), reverse=True)
resultFile = open(args.phenosimset+'.results.csv', 'w')
resultFile.write('prob,true,reaction\n')
for index in range(len(resultList)):
resultFile.write('%f,%d,%s\n' %(resultList[index][2], resultList[index][3], resultList[index][1]))
print " Saved analysis to %s" %(resultFile.name)
resultFile.close()
exit(0)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
532,
84,
198,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
28686,
198,
11748,
12854,
1891,
198,
6738,
10088,
1330,
2378,
1136,
353,
11,
708,
81,
1136,
353,
198,
6738,
3182,
482,
8692,
13,
1676,
65,
14991,
2569,
62,
1236,
14221,
13,
11792,
1330,
4808,
961,
62,
259,
361,
576,
198,
6738,
3182,
482,
8692,
13,
5225,
10223,
16177,
13,
11792,
1330,
1635,
198,
198,
20147,
796,
705,
7061,
198,
15056,
257,
19449,
2134,
15284,
262,
3991,
3967,
11,
4633,
3965,
13,
16018,
453,
42848,
2279,
326,
2125,
470,
198,
259,
262,
7368,
2056,
13,
198,
7061,
6,
198,
25512,
1352,
796,
6,
20379,
6,
198,
305,
829,
2514,
49,
87,
5907,
8979,
5376,
796,
705,
305,
829,
62,
1462,
62,
260,
4658,
6,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
1676,
70,
11639,
8645,
378,
47,
831,
8690,
13252,
4093,
333,
303,
13,
9078,
3256,
6764,
28,
20147,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
5235,
462,
3256,
1037,
11639,
2389,
286,
19270,
284,
16602,
3256,
2223,
11639,
8095,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
19849,
3256,
1037,
11639,
2389,
286,
11521,
7625,
5901,
2746,
284,
16602,
3256,
2223,
11639,
8095,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
31024,
418,
320,
2617,
3256,
1037,
11639,
2389,
286,
34828,
8690,
8890,
1741,
7248,
2134,
284,
16602,
3256,
2223,
11639,
8095,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
5225,
10223,
3256,
1037,
11639,
2389,
286,
44573,
7268,
5563,
284,
16602,
3256,
2223,
11639,
8095,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
82,
2122,
3256,
1037,
11639,
9630,
1271,
286,
4610,
287,
11521,
7625,
5901,
2746,
3256,
2223,
11639,
8095,
3256,
4277,
11639,
15,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
31024,
418,
320,
2617,
18504,
3256,
1037,
11639,
5225,
10223,
7268,
34828,
8690,
8890,
1741,
7248,
2134,
357,
31642,
355,
44573,
611,
407,
7368,
8,
3256,
2223,
11639,
8095,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
11431,
3256,
1037,
11639,
32374,
3781,
284,
691,
428,
2056,
4006,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
11431,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
1676,
65,
1236,
78,
3256,
1037,
11639,
2389,
286,
30873,
2025,
3919,
2134,
329,
19270,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
1676,
65,
1236,
78,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
1676,
65,
1236,
1666,
3256,
1037,
11639,
5225,
10223,
7268,
30873,
2025,
3919,
2134,
357,
31642,
355,
44573,
611,
407,
7368,
8,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
1676,
65,
1236,
1666,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
40914,
77,
1676,
1443,
3256,
1037,
11639,
2389,
286,
49715,
77,
2964,
1443,
2134,
329,
19270,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
40914,
77,
1676,
1443,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
40914,
77,
1676,
1443,
18504,
3256,
1037,
11639,
5225,
10223,
7268,
49715,
77,
2964,
1443,
2134,
357,
31642,
355,
44573,
611,
407,
7368,
8,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
40914,
77,
1676,
1443,
18504,
3256,
4277,
28,
14202,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
12048,
12,
15908,
3256,
1037,
11639,
6978,
284,
8619,
351,
3781,
14750,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
12048,
35277,
3256,
4277,
11639,
2637,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
69,
7012,
12,
6371,
3256,
1037,
11639,
6371,
329,
277,
7012,
21128,
2139,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
21855,
2899,
75,
3256,
4277,
11639,
4023,
1378,
65,
952,
12,
7890,
12,
16,
13,
76,
6359,
13,
272,
75,
13,
9567,
14,
30416,
14,
69,
7012,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
18504,
12,
6371,
3256,
1037,
11639,
6371,
329,
44573,
2139,
3256,
2223,
11639,
8095,
3256,
2244,
11639,
18504,
6371,
3256,
4277,
11639,
4023,
1378,
74,
8692,
13,
385,
14,
30416,
14,
5225,
10223,
14,
11537,
198,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
611,
26498,
13,
1676,
65,
1236,
78,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
1676,
65,
1236,
78,
796,
26498,
13,
5235,
462,
1343,
45302,
1676,
65,
1236,
78,
6,
198,
220,
220,
220,
611,
26498,
13,
1676,
65,
1236,
1666,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
1676,
65,
1236,
1666,
796,
26498,
13,
5225,
10223,
198,
220,
220,
220,
611,
26498,
13,
40914,
77,
1676,
1443,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
40914,
77,
1676,
1443,
796,
26498,
13,
5235,
462,
1343,
45302,
40914,
77,
1676,
1443,
6,
198,
220,
220,
220,
611,
26498,
13,
40914,
77,
1676,
1443,
18504,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
40914,
77,
1676,
1443,
18504,
796,
26498,
13,
5225,
10223,
198,
220,
220,
220,
611,
26498,
13,
31024,
418,
320,
2617,
18504,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
31024,
418,
320,
2617,
18504,
796,
26498,
13,
5225,
10223,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
13610,
262,
7534,
329,
262,
2594,
356,
761,
13,
198,
220,
220,
220,
6284,
7890,
796,
4808,
961,
62,
259,
361,
576,
3419,
198,
220,
220,
220,
11241,
796,
6284,
7890,
17816,
30001,
20520,
198,
220,
220,
220,
266,
82,
11792,
796,
44573,
16177,
7,
22046,
13,
18504,
6371,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
10934,
9176,
284,
12737,
22155,
13,
198,
220,
220,
220,
2239,
796,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
10934,
12737,
284,
9176,
22155,
49954,
1,
4064,
7,
9662,
8,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
305,
829,
2514,
49,
87,
5907,
8979,
5376,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
10057,
7203,
439,
62,
305,
829,
62,
1484,
62,
259,
62,
27530,
930,
9176,
62,
1462,
62,
41887,
274,
930,
651,
62,
39468,
1056,
62,
19242,
8600,
532,
1462,
4686,
1875,
4,
82,
1,
4064,
7,
305,
829,
2514,
49,
87,
5907,
8979,
5376,
4008,
198,
220,
220,
220,
9176,
2514,
3041,
4658,
796,
8633,
3419,
198,
220,
220,
220,
12737,
2514,
49,
4316,
796,
8633,
3419,
198,
220,
220,
220,
1303,
5501,
1627,
286,
262,
2393,
468,
1440,
7032,
25,
357,
16,
8,
2597,
11,
357,
17,
8,
25345,
6056,
11,
357,
18,
8,
3716,
4686,
11,
357,
19,
8,
6317,
4686,
198,
220,
220,
220,
9176,
2514,
49,
87,
5907,
8979,
796,
1280,
7,
305,
829,
2514,
49,
87,
5907,
8979,
5376,
11,
705,
81,
11537,
198,
220,
220,
220,
329,
1627,
287,
9176,
2514,
49,
87,
5907,
8979,
25,
198,
220,
220,
220,
220,
220,
220,
220,
7032,
796,
1627,
13,
36311,
10786,
59,
81,
59,
77,
27691,
35312,
10786,
59,
83,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
6317,
796,
7032,
58,
18,
60,
198,
220,
220,
220,
220,
220,
220,
220,
611,
6317,
407,
287,
12737,
2514,
49,
4316,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12737,
2514,
49,
4316,
58,
260,
2673,
60,
796,
1351,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
12737,
2514,
49,
4316,
58,
260,
2673,
4083,
33295,
7,
25747,
58,
15,
12962,
198,
220,
220,
220,
9176,
2514,
49,
87,
5907,
8979,
13,
19836,
3419,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
12737,
287,
12737,
284,
9176,
22155,
1,
4064,
7,
11925,
7,
260,
4658,
2514,
49,
4316,
4008,
628,
220,
220,
220,
1303,
16213,
2736,
262,
7625,
6070,
2482,
329,
262,
7368,
2746,
13,
198,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
5660,
16213,
2736,
38,
499,
20797,
25468,
13,
9078,
329,
2746,
705,
4,
82,
14,
4,
82,
6,
49954,
1,
4064,
7,
9662,
11,
26498,
13,
5225,
10223,
11,
26498,
13,
19849,
8,
198,
220,
220,
220,
374,
87,
77,
1676,
1443,
796,
26498,
13,
40914,
77,
1676,
1443,
198,
220,
220,
220,
2482,
8979,
5376,
796,
26498,
13,
19849,
1343,
45302,
43420,
6,
198,
220,
220,
220,
28686,
13,
10057,
7203,
4,
82,
14,
37702,
2736,
38,
499,
20797,
25468,
13,
9078,
532,
76,
4064,
82,
532,
86,
4064,
82,
1377,
40914,
77,
1676,
1443,
4064,
82,
1377,
6371,
4064,
82,
1875,
4,
82,
1,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4064,
7,
22046,
13,
12048,
35277,
11,
26498,
13,
19849,
11,
26498,
13,
5225,
10223,
11,
374,
87,
77,
1676,
1443,
11,
26498,
13,
21855,
2899,
75,
11,
2482,
8979,
5376,
4008,
198,
220,
220,
220,
10812,
2514,
3041,
4658,
796,
8633,
3419,
198,
220,
220,
220,
2482,
8979,
796,
1280,
7,
43420,
8979,
5376,
11,
705,
81,
11537,
198,
220,
220,
220,
2482,
8979,
13,
961,
1370,
3419,
1303,
22481,
1497,
13639,
1627,
198,
220,
220,
220,
329,
1627,
287,
2482,
8979,
25,
198,
220,
220,
220,
220,
220,
220,
220,
7032,
796,
1627,
13,
36311,
10786,
59,
81,
59,
77,
27691,
35312,
10786,
59,
83,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
7032,
58,
15,
60,
6624,
26498,
13,
82,
2122,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
7032,
58,
20,
60,
6624,
705,
15,
10354,
1303,
5514,
1394,
12737,
326,
389,
407,
257,
10372,
2247,
1487,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
7032,
58,
21,
5974,
1303,
5514,
1394,
12737,
326,
423,
257,
402,
4805,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
87,
77,
312,
796,
302,
13,
7266,
7,
81,
6,
40914,
77,
15,
9,
38016,
67,
28988,
3256,
374,
6,
32812,
91,
40914,
77,
13,
59,
16,
3256,
7032,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
8053,
796,
302,
13,
19796,
439,
10786,
5647,
59,
91,
59,
67,
10,
17405,
59,
67,
10,
17405,
22071,
17405,
59,
67,
10,
3256,
7032,
58,
21,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
6376,
287,
2837,
7,
11925,
7,
70,
1734,
8053,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
9779,
8053,
58,
9630,
60,
407,
287,
10812,
2514,
3041,
4658,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10812,
2514,
3041,
4658,
58,
70,
1734,
8053,
58,
9630,
11907,
796,
8633,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10812,
2514,
3041,
4658,
58,
70,
1734,
8053,
58,
9630,
60,
7131,
40914,
77,
312,
60,
796,
657,
13,
15,
628,
220,
220,
220,
220,
198,
220,
220,
220,
2482,
8979,
13,
19836,
3419,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
10812,
287,
10812,
284,
12737,
22155,
1,
4064,
7,
11925,
7,
5235,
274,
2514,
3041,
4658,
4008,
628,
220,
220,
220,
1303,
3497,
262,
30873,
2025,
3919,
2134,
422,
262,
44573,
13,
198,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
1861,
1236,
78,
796,
26498,
13,
1676,
65,
1236,
78,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
3497,
30873,
2025,
3919,
2134,
705,
4,
82,
14,
4,
82,
29653,
4064,
7,
9662,
11,
26498,
13,
1676,
65,
1236,
1666,
11,
1861,
1236,
78,
8,
198,
220,
220,
220,
14187,
10267,
796,
266,
82,
11792,
13,
1136,
62,
15252,
7,
1391,
705,
312,
10354,
1861,
1236,
78,
11,
705,
5225,
10223,
10354,
26498,
13,
1676,
65,
1236,
1666,
11,
705,
4906,
10354,
705,
2964,
65,
2025,
3919,
3256,
705,
18439,
10354,
11241,
1782,
1267,
198,
220,
220,
220,
1861,
2025,
3919,
796,
14187,
10267,
17816,
7890,
20520,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
10812,
287,
30873,
2025,
3919,
9176,
316,
39522,
22155,
1,
4064,
7,
11925,
7,
1676,
65,
2025,
3919,
17816,
305,
829,
316,
62,
1676,
65,
5738,
20520,
4008,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
10664,
284,
467,
832,
9176,
1039,
22155,
198,
220,
220,
220,
1303,
1002,
281,
5726,
468,
517,
621,
530,
2597,
11,
6626,
656,
3354,
198,
220,
220,
220,
1303,
3244,
1057,
262,
7177,
290,
12082,
597,
23418,
9176,
416,
4375,
386,
1443,
198,
220,
220,
220,
1303,
2547,
325,
262,
9176,
316,
39522,
422,
262,
30873,
2025,
3919,
2134,
13,
198,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
2547,
325,
9176,
1039,
656,
9176,
290,
4532,
39522,
329,
14184,
16856,
49954,
1,
4064,
7,
9662,
8,
198,
220,
220,
220,
9176,
316,
2964,
65,
5738,
796,
8633,
3419,
198,
220,
220,
220,
329,
9779,
287,
1861,
2025,
3919,
17816,
305,
829,
316,
62,
1676,
65,
5738,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
9779,
47445,
8053,
796,
1861,
2025,
3919,
17816,
305,
829,
316,
62,
1676,
65,
5738,
6,
7131,
70,
1734,
60,
198,
220,
220,
220,
220,
220,
220,
220,
9779,
47445,
35,
713,
796,
8633,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
6376,
287,
2837,
7,
11925,
7,
70,
1734,
47445,
8053,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1861,
796,
9779,
47445,
8053,
58,
9630,
7131,
16,
60,
1303,
30873,
1799,
329,
428,
9176,
316,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
27758,
3294,
9176,
287,
9176,
316,
329,
428,
9779,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2597,
8053,
796,
9779,
47445,
8053,
58,
9630,
7131,
15,
4083,
35312,
7,
25512,
1352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
2597,
8833,
517,
621,
1752,
11,
751,
510,
262,
39522,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
11925,
7,
18090,
8053,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2597,
8053,
58,
73,
60,
287,
9779,
47445,
35,
713,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
47445,
35,
713,
58,
18090,
8053,
58,
73,
11907,
15853,
1861,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
47445,
35,
713,
58,
18090,
8053,
58,
73,
11907,
796,
1861,
198,
220,
220,
220,
220,
220,
220,
220,
9176,
316,
2964,
65,
5738,
58,
70,
1734,
60,
796,
9779,
47445,
35,
713,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
10812,
287,
44267,
9176,
316,
39522,
22155,
1,
4064,
7,
11925,
7,
305,
829,
316,
2964,
65,
5738,
4008,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
329,
1123,
6317,
287,
262,
12737,
22155,
11,
1064,
262,
9176,
287,
262,
9176,
2514,
3041,
4658,
22155,
198,
220,
220,
220,
1303,
788,
1064,
262,
9176,
287,
262,
1861,
1236,
78,
2134,
329,
262,
9779,
198,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
9938,
5415,
12867,
286,
6317,
1813,
9779,
49954,
1,
4064,
7,
9662,
8,
198,
220,
220,
220,
386,
1443,
8979,
796,
1280,
7,
22046,
13,
19849,
10,
4458,
1676,
1443,
3256,
705,
86,
11537,
198,
220,
220,
220,
997,
2964,
1443,
796,
657,
198,
220,
220,
220,
329,
9779,
287,
10812,
2514,
3041,
4658,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
9779,
287,
9176,
316,
2964,
65,
5738,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
47445,
35,
713,
796,
9176,
316,
2964,
65,
5738,
58,
70,
1734,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
6317,
287,
10812,
2514,
3041,
4658,
58,
70,
1734,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
6317,
407,
287,
12737,
2514,
49,
4316,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
705,
5195,
318,
6317,
4064,
82,
407,
287,
262,
6317,
2514,
49,
4316,
22155,
8348,
4064,
7,
260,
2673,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2597,
8053,
796,
12737,
2514,
49,
4316,
58,
260,
2673,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
6376,
287,
2837,
7,
15,
11,
11925,
7,
18090,
8053,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2597,
287,
9779,
47445,
35,
713,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2597,
6624,
2597,
8053,
58,
9630,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
386,
1443,
8979,
13,
13564,
10786,
47,
7,
4,
82,
930,
4064,
82,
8,
796,
4064,
69,
59,
77,
6,
4064,
7,
260,
2673,
11,
9779,
11,
9779,
47445,
35,
713,
58,
18090,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10812,
2514,
3041,
4658,
58,
70,
1734,
7131,
260,
2673,
60,
796,
3509,
7,
70,
1734,
47445,
35,
713,
58,
18090,
4357,
10812,
2514,
3041,
4658,
58,
70,
1734,
7131,
260,
2673,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
2964,
1443,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
705,
39358,
4064,
82,
407,
1043,
287,
30873,
2025,
3919,
2134,
6,
4064,
7,
70,
1734,
8,
198,
220,
220,
220,
386,
1443,
8979,
13,
19836,
3419,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
6317,
39522,
900,
287,
10812,
2514,
3041,
4658,
22155,
1,
4064,
7,
22510,
2964,
1443,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
3497,
262,
34828,
8690,
8890,
1741,
7248,
2134,
13,
198,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
3497,
47174,
18640,
900,
4064,
82,
14,
4,
82,
49954,
1,
4064,
7,
9662,
11,
26498,
13,
31024,
418,
320,
2617,
18504,
11,
26498,
13,
31024,
418,
320,
2617,
8,
198,
220,
220,
220,
279,
824,
10267,
796,
266,
82,
11792,
13,
1136,
62,
15252,
7,
1391,
705,
312,
10354,
26498,
13,
31024,
418,
320,
2617,
11,
705,
5225,
10223,
10354,
26498,
13,
31024,
418,
320,
2617,
18504,
11,
705,
4906,
10354,
705,
47,
831,
8690,
8890,
1741,
7248,
3256,
705,
18439,
10354,
11241,
1782,
1267,
198,
220,
220,
220,
6566,
78,
8890,
7248,
796,
279,
824,
10267,
17816,
7890,
20520,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
6889,
1654,
262,
2746,
7466,
287,
262,
47174,
18640,
900,
13,
198,
220,
220,
220,
611,
6566,
78,
8890,
7248,
17816,
19849,
20520,
14512,
26498,
13,
19849,
393,
6566,
78,
8890,
7248,
17816,
19849,
62,
5225,
10223,
20520,
14512,
26498,
13,
5225,
10223,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
705,
22882,
1431,
2746,
4064,
82,
14,
4,
82,
857,
407,
2872,
2746,
4064,
82,
14,
4,
82,
287,
47174,
18640,
900,
6,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4064,
7,
22046,
13,
5225,
10223,
11,
26498,
13,
19849,
11,
6566,
78,
8890,
7248,
17816,
19849,
62,
5225,
10223,
6,
4357,
6566,
78,
8890,
7248,
17816,
19849,
6,
12962,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
27785,
287,
47174,
18640,
900,
1,
4064,
7,
11925,
7,
31024,
78,
8890,
7248,
17816,
31024,
8690,
8890,
5768,
20520,
4008,
628,
220,
220,
220,
1303,
1514,
832,
262,
1351,
286,
27785,
11,
329,
1123,
9779,
290,
766,
611,
262,
9779,
318,
287,
262,
10812,
2514,
3041,
4658,
198,
220,
220,
220,
1303,
22155,
13,
220,
1002,
523,
11,
1317,
340,
355,
1900,
290,
2291,
262,
12867,
13,
220,
15323,
11,
1317,
340,
355,
6439,
198,
220,
220,
220,
1303,
290,
900,
262,
12867,
284,
657,
13,
20,
13,
220,
554,
1111,
2663,
11,
900,
257,
6056,
12739,
611,
262,
18640,
373,
198,
220,
220,
220,
1303,
3376,
393,
11491,
13,
198,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
16213,
2736,
47174,
18640,
900,
2482,
49954,
1,
4064,
7,
9662,
8,
198,
220,
220,
220,
997,
29870,
796,
657,
198,
220,
220,
220,
1255,
8053,
796,
1351,
3419,
198,
220,
220,
220,
329,
985,
287,
6566,
78,
8890,
7248,
17816,
31024,
8690,
8890,
5768,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
611,
985,
58,
18,
60,
6624,
705,
8697,
6,
393,
985,
58,
18,
60,
6624,
705,
44175,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
826,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
826,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
9779,
8053,
796,
985,
58,
15,
7131,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
9779,
287,
9779,
8053,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
9779,
287,
10812,
2514,
3041,
4658,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
6317,
287,
10812,
2514,
3041,
4658,
58,
70,
1734,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
8053,
13,
33295,
7,
357,
70,
1734,
11,
6317,
11,
10812,
2514,
3041,
4658,
58,
70,
1734,
7131,
260,
2673,
4357,
826,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
29870,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
8053,
13,
33295,
7,
357,
70,
1734,
11,
705,
34680,
3256,
657,
13,
20,
11,
826,
8,
1267,
198,
220,
220,
220,
3601,
366,
220,
4064,
67,
10812,
550,
12737,
351,
1900,
39522,
1,
4064,
7,
22510,
29870,
8,
628,
220,
220,
220,
2239,
15853,
352,
198,
220,
220,
220,
3601,
366,
45340,
5012,
4064,
67,
25,
12793,
3781,
284,
2393,
49954,
1,
4064,
7,
9662,
8,
198,
220,
220,
220,
1255,
8053,
13,
30619,
7,
2539,
28,
9186,
1136,
353,
7,
17,
828,
9575,
28,
17821,
8,
198,
220,
220,
220,
1255,
8979,
796,
1280,
7,
22046,
13,
31024,
418,
320,
2617,
10,
4458,
43420,
13,
40664,
3256,
705,
86,
11537,
198,
220,
220,
220,
1255,
8979,
13,
13564,
10786,
1676,
65,
11,
7942,
11,
260,
2673,
59,
77,
11537,
198,
220,
220,
220,
329,
6376,
287,
2837,
7,
11925,
7,
20274,
8053,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
8979,
13,
13564,
10786,
4,
69,
11,
4,
67,
11,
4,
82,
59,
77,
6,
4064,
7,
20274,
8053,
58,
9630,
7131,
17,
4357,
1255,
8053,
58,
9630,
7131,
18,
4357,
1255,
8053,
58,
9630,
7131,
16,
60,
4008,
198,
220,
220,
220,
3601,
366,
220,
8858,
276,
3781,
284,
4064,
82,
1,
4064,
7,
20274,
8979,
13,
3672,
8,
198,
220,
220,
220,
1255,
8979,
13,
19836,
3419,
198,
220,
220,
220,
8420,
7,
15,
8,
198,
220,
220,
220,
220,
198
] | 2.539645 | 4,225 |
# Imports the Google Cloud client library
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
import json
import re
| [
2,
1846,
3742,
262,
3012,
10130,
5456,
5888,
198,
6738,
23645,
13,
17721,
1330,
3303,
198,
6738,
23645,
13,
17721,
13,
16129,
1330,
551,
5700,
198,
6738,
23645,
13,
17721,
13,
16129,
1330,
3858,
198,
198,
11748,
33918,
198,
11748,
302,
198
] | 4.261905 | 42 |
from requests_ntlm import HttpNtlmAuth
__all__ = [HttpNtlmAuth] | [
6738,
7007,
62,
429,
75,
76,
1330,
367,
29281,
45,
28781,
76,
30515,
198,
198,
834,
439,
834,
796,
685,
43481,
45,
28781,
76,
30515,
60
] | 2.461538 | 26 |
# Generated by Django 3.0.7 on 2020-06-30 14:42
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
3312,
12,
1270,
1478,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
"""Tutorial: Guess the Number, by Al Sweigart [email protected]
Part 1 of a tutorial to make a "Guess the Number" game, bit by bit."""
# Try copying the code in this program on your own and running the
# program before moving on to part 2. (You don't have to copy the
# comments.)
# Everything after a # is a "comment" and is ignored by the computer.
# You can use comments to write notes and reminders in your code.
# This program really only has three lines of actual code.
# Programs start executing instructions at the top of the file
# and go down.
# The print() function displays text on the screen. Notice that
# the ' single quotes are not printed:
print('Hello! What is your name?')
# The input() function lets the player type text in and press Enter. The
# text is stored in a variable named playerName:
playerName = input()
# This displays the name that the player typed in:
print('It is good to meet you, ' + playerName)
| [
37811,
51,
44917,
25,
37571,
262,
7913,
11,
416,
978,
19372,
328,
433,
435,
31,
259,
1151,
4480,
29412,
13,
785,
198,
198,
7841,
352,
286,
257,
11808,
284,
787,
257,
366,
8205,
408,
262,
7913,
1,
983,
11,
1643,
416,
1643,
526,
15931,
198,
198,
2,
9993,
23345,
262,
2438,
287,
428,
1430,
319,
534,
898,
290,
2491,
262,
198,
2,
1430,
878,
3867,
319,
284,
636,
362,
13,
357,
1639,
836,
470,
423,
284,
4866,
262,
198,
2,
3651,
2014,
198,
198,
2,
11391,
706,
257,
1303,
318,
257,
366,
23893,
1,
290,
318,
9514,
416,
262,
3644,
13,
198,
2,
921,
460,
779,
3651,
284,
3551,
4710,
290,
40687,
287,
534,
2438,
13,
198,
2,
770,
1430,
1107,
691,
468,
1115,
3951,
286,
4036,
2438,
13,
198,
198,
2,
26179,
923,
23710,
7729,
379,
262,
1353,
286,
262,
2393,
198,
2,
290,
467,
866,
13,
198,
198,
2,
383,
3601,
3419,
2163,
11298,
2420,
319,
262,
3159,
13,
17641,
326,
198,
2,
262,
705,
2060,
13386,
389,
407,
10398,
25,
198,
4798,
10786,
15496,
0,
1867,
318,
534,
1438,
8348,
8,
198,
198,
2,
383,
5128,
3419,
2163,
8781,
262,
2137,
2099,
2420,
287,
290,
1803,
6062,
13,
383,
198,
2,
2420,
318,
8574,
287,
257,
7885,
3706,
2137,
5376,
25,
198,
7829,
5376,
796,
5128,
3419,
198,
198,
2,
770,
11298,
262,
1438,
326,
262,
2137,
25683,
287,
25,
198,
4798,
10786,
1026,
318,
922,
284,
1826,
345,
11,
705,
1343,
2137,
5376,
8,
198
] | 3.799197 | 249 |
from economic.auth import Authentication
import pytest
from _pytest.fixtures import SubRequest
@pytest.fixture
| [
6738,
3034,
13,
18439,
1330,
48191,
198,
11748,
12972,
9288,
198,
6738,
4808,
9078,
9288,
13,
69,
25506,
1330,
3834,
18453,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 3.766667 | 30 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Description
Christopher J.C. Burges, Robert Ragno, and Quoc Viet Le. 2006.
Learning to Rank with Nonsmooth Cost Functions. In Proceedings of NIPS conference. 193–200.
"""
import torch
import torch.nn.functional as F
from ptranking.data.data_utils import LABEL_TYPE
from ptranking.metric.metric_utils import get_delta_ndcg
from ptranking.base.adhoc_ranker import AdhocNeuralRanker
from ptranking.ltr_adhoc.eval.parameter import ModelParameter
from ptranking.ltr_adhoc.util.lambda_utils import get_pairwise_comp_probs
class LambdaRank(AdhocNeuralRanker):
'''
Christopher J.C. Burges, Robert Ragno, and Quoc Viet Le. 2006.
Learning to Rank with Nonsmooth Cost Functions. In Proceedings of NIPS conference. 193–200.
'''
def custom_loss_function(self, batch_preds, batch_std_labels, **kwargs):
'''
@param batch_preds: [batch, ranking_size] each row represents the relevance predictions for documents associated with the same query
@param batch_std_labels: [batch, ranking_size] each row represents the standard relevance grades for documents associated with the same query
@param kwargs:
@return:
'''
assert 'label_type' in kwargs and LABEL_TYPE.MultiLabel == kwargs['label_type']
label_type = kwargs['label_type']
assert 'presort' in kwargs and kwargs['presort'] is True # aiming for direct usage of ideal ranking
# sort documents according to the predicted relevance
batch_descending_preds, batch_pred_desc_inds = torch.sort(batch_preds, dim=1, descending=True)
# reorder batch_stds correspondingly so as to make it consistent.
# BTW, batch_stds[batch_preds_sorted_inds] only works with 1-D tensor
batch_predict_rankings = torch.gather(batch_std_labels, dim=1, index=batch_pred_desc_inds)
batch_p_ij, batch_std_p_ij = get_pairwise_comp_probs(batch_preds=batch_descending_preds,
batch_std_labels=batch_predict_rankings,
sigma=self.sigma)
batch_delta_ndcg = get_delta_ndcg(batch_ideal_rankings=batch_std_labels,
batch_predict_rankings=batch_predict_rankings,
label_type=label_type, device=self.device)
_batch_loss = F.binary_cross_entropy(input=torch.triu(batch_p_ij, diagonal=1),
target=torch.triu(batch_std_p_ij, diagonal=1),
weight=torch.triu(batch_delta_ndcg, diagonal=1), reduction='none')
batch_loss = torch.sum(torch.sum(_batch_loss, dim=(2, 1)))
self.optimizer.zero_grad()
batch_loss.backward()
self.optimizer.step()
return batch_loss
###### Parameter of LambdaRank ######
class LambdaRankParameter(ModelParameter):
''' Parameter class for LambdaRank '''
def default_para_dict(self):
"""
Default parameter setting for LambdaRank
:return:
"""
self.lambda_para_dict = dict(model_id=self.model_id, sigma=1.0)
return self.lambda_para_dict
def to_para_string(self, log=False, given_para_dict=None):
"""
String identifier of parameters
:param log:
:param given_para_dict: a given dict, which is used for maximum setting w.r.t. grid-search
:return:
"""
# using specified para-dict or inner para-dict
lambda_para_dict = given_para_dict if given_para_dict is not None else self.lambda_para_dict
s1, s2 = (':', '\n') if log else ('_', '_')
lambdarank_para_str = s1.join(['Sigma', '{:,g}'.format(lambda_para_dict['sigma'])])
return lambdarank_para_str
def grid_search(self):
"""
Iterator of parameter settings for LambdaRank
"""
if self.use_json:
choice_sigma = self.json_dict['sigma']
else:
choice_sigma = [5.0, 1.0] if self.debug else [1.0] # 1.0, 10.0, 50.0, 100.0
for sigma in choice_sigma:
self.lambda_para_dict = dict(model_id=self.model_id, sigma=sigma)
yield self.lambda_para_dict
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
11828,
198,
38025,
449,
13,
34,
13,
5481,
3212,
11,
5199,
38000,
3919,
11,
290,
2264,
420,
8730,
1004,
13,
4793,
13,
198,
41730,
284,
10916,
351,
399,
684,
76,
5226,
6446,
40480,
13,
554,
30641,
286,
24947,
3705,
4495,
13,
29691,
1906,
2167,
13,
198,
37811,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
50116,
15230,
13,
7890,
13,
7890,
62,
26791,
1330,
406,
6242,
3698,
62,
25216,
198,
6738,
50116,
15230,
13,
4164,
1173,
13,
4164,
1173,
62,
26791,
1330,
651,
62,
67,
12514,
62,
358,
66,
70,
198,
6738,
50116,
15230,
13,
8692,
13,
24411,
420,
62,
43027,
263,
1330,
1215,
71,
420,
8199,
1523,
27520,
263,
198,
6738,
50116,
15230,
13,
75,
2213,
62,
24411,
420,
13,
18206,
13,
17143,
2357,
1330,
9104,
36301,
198,
6738,
50116,
15230,
13,
75,
2213,
62,
24411,
420,
13,
22602,
13,
50033,
62,
26791,
1330,
651,
62,
24874,
3083,
62,
5589,
62,
1676,
1443,
198,
198,
4871,
21114,
6814,
27520,
7,
2782,
71,
420,
8199,
1523,
27520,
263,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
12803,
449,
13,
34,
13,
5481,
3212,
11,
5199,
38000,
3919,
11,
290,
2264,
420,
8730,
1004,
13,
4793,
13,
198,
220,
220,
220,
18252,
284,
10916,
351,
399,
684,
76,
5226,
6446,
40480,
13,
554,
30641,
286,
24947,
3705,
4495,
13,
29691,
1906,
2167,
13,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
2183,
62,
22462,
62,
8818,
7,
944,
11,
15458,
62,
28764,
82,
11,
15458,
62,
19282,
62,
23912,
1424,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
17143,
15458,
62,
28764,
82,
25,
685,
43501,
11,
12759,
62,
7857,
60,
1123,
5752,
6870,
262,
23082,
16277,
329,
4963,
3917,
351,
262,
976,
12405,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
17143,
15458,
62,
19282,
62,
23912,
1424,
25,
685,
43501,
11,
12759,
62,
7857,
60,
1123,
5752,
6870,
262,
3210,
23082,
19051,
329,
4963,
3917,
351,
262,
976,
12405,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
17143,
479,
86,
22046,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
705,
18242,
62,
4906,
6,
287,
479,
86,
22046,
290,
406,
6242,
3698,
62,
25216,
13,
29800,
33986,
6624,
479,
86,
22046,
17816,
18242,
62,
4906,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
6167,
62,
4906,
796,
479,
86,
22046,
17816,
18242,
62,
4906,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
705,
18302,
419,
6,
287,
479,
86,
22046,
290,
479,
86,
22046,
17816,
18302,
419,
20520,
318,
6407,
220,
1303,
17272,
329,
1277,
8748,
286,
7306,
12759,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3297,
4963,
1864,
284,
262,
11001,
23082,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
20147,
1571,
62,
28764,
82,
11,
15458,
62,
28764,
62,
20147,
62,
521,
82,
796,
28034,
13,
30619,
7,
43501,
62,
28764,
82,
11,
5391,
28,
16,
11,
31491,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
302,
2875,
15458,
62,
301,
9310,
6053,
4420,
523,
355,
284,
787,
340,
6414,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
22205,
54,
11,
15458,
62,
301,
9310,
58,
43501,
62,
28764,
82,
62,
82,
9741,
62,
521,
82,
60,
691,
2499,
351,
352,
12,
35,
11192,
273,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
79,
17407,
62,
43027,
654,
796,
28034,
13,
70,
1032,
7,
43501,
62,
19282,
62,
23912,
1424,
11,
5391,
28,
16,
11,
6376,
28,
43501,
62,
28764,
62,
20147,
62,
521,
82,
8,
628,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
79,
62,
2926,
11,
15458,
62,
19282,
62,
79,
62,
2926,
796,
651,
62,
24874,
3083,
62,
5589,
62,
1676,
1443,
7,
43501,
62,
28764,
82,
28,
43501,
62,
20147,
1571,
62,
28764,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
19282,
62,
23912,
1424,
28,
43501,
62,
79,
17407,
62,
43027,
654,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
13495,
28,
944,
13,
82,
13495,
8,
628,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
67,
12514,
62,
358,
66,
70,
796,
651,
62,
67,
12514,
62,
358,
66,
70,
7,
43501,
62,
485,
282,
62,
43027,
654,
28,
43501,
62,
19282,
62,
23912,
1424,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
79,
17407,
62,
43027,
654,
28,
43501,
62,
79,
17407,
62,
43027,
654,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
62,
4906,
28,
18242,
62,
4906,
11,
3335,
28,
944,
13,
25202,
8,
628,
220,
220,
220,
220,
220,
220,
220,
4808,
43501,
62,
22462,
796,
376,
13,
39491,
62,
19692,
62,
298,
28338,
7,
15414,
28,
13165,
354,
13,
28461,
84,
7,
43501,
62,
79,
62,
2926,
11,
40039,
28,
16,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
28,
13165,
354,
13,
28461,
84,
7,
43501,
62,
19282,
62,
79,
62,
2926,
11,
40039,
28,
16,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3463,
28,
13165,
354,
13,
28461,
84,
7,
43501,
62,
67,
12514,
62,
358,
66,
70,
11,
40039,
28,
16,
828,
7741,
11639,
23108,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
22462,
796,
28034,
13,
16345,
7,
13165,
354,
13,
16345,
28264,
43501,
62,
22462,
11,
5391,
16193,
17,
11,
352,
22305,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
40085,
7509,
13,
22570,
62,
9744,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
22462,
13,
1891,
904,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
40085,
7509,
13,
9662,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
15458,
62,
22462,
628,
198,
4242,
2235,
25139,
2357,
286,
21114,
6814,
27520,
46424,
2,
198,
198,
4871,
21114,
6814,
27520,
36301,
7,
17633,
36301,
2599,
198,
220,
220,
220,
705,
7061,
25139,
2357,
1398,
329,
21114,
6814,
27520,
705,
7061,
628,
220,
220,
220,
825,
4277,
62,
1845,
64,
62,
11600,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
15161,
11507,
4634,
329,
21114,
6814,
27520,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
50033,
62,
1845,
64,
62,
11600,
796,
8633,
7,
19849,
62,
312,
28,
944,
13,
19849,
62,
312,
11,
264,
13495,
28,
16,
13,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
50033,
62,
1845,
64,
62,
11600,
628,
220,
220,
220,
825,
284,
62,
1845,
64,
62,
8841,
7,
944,
11,
2604,
28,
25101,
11,
1813,
62,
1845,
64,
62,
11600,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
10903,
27421,
286,
10007,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2604,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1813,
62,
1845,
64,
62,
11600,
25,
257,
1813,
8633,
11,
543,
318,
973,
329,
5415,
4634,
266,
13,
81,
13,
83,
13,
10706,
12,
12947,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1262,
7368,
31215,
12,
11600,
393,
8434,
31215,
12,
11600,
198,
220,
220,
220,
220,
220,
220,
220,
37456,
62,
1845,
64,
62,
11600,
796,
1813,
62,
1845,
64,
62,
11600,
611,
1813,
62,
1845,
64,
62,
11600,
318,
407,
6045,
2073,
2116,
13,
50033,
62,
1845,
64,
62,
11600,
628,
220,
220,
220,
220,
220,
220,
220,
264,
16,
11,
264,
17,
796,
357,
10354,
3256,
705,
59,
77,
11537,
611,
2604,
2073,
19203,
62,
3256,
705,
62,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
19343,
27455,
962,
62,
1845,
64,
62,
2536,
796,
264,
16,
13,
22179,
7,
17816,
50,
13495,
3256,
705,
90,
45299,
70,
92,
4458,
18982,
7,
50033,
62,
1845,
64,
62,
11600,
17816,
82,
13495,
6,
12962,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
19343,
27455,
962,
62,
1845,
64,
62,
2536,
628,
220,
220,
220,
825,
10706,
62,
12947,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
40806,
1352,
286,
11507,
6460,
329,
21114,
6814,
27520,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
1904,
62,
17752,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3572,
62,
82,
13495,
796,
2116,
13,
17752,
62,
11600,
17816,
82,
13495,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3572,
62,
82,
13495,
796,
685,
20,
13,
15,
11,
352,
13,
15,
60,
611,
2116,
13,
24442,
2073,
685,
16,
13,
15,
60,
220,
1303,
352,
13,
15,
11,
838,
13,
15,
11,
2026,
13,
15,
11,
1802,
13,
15,
628,
220,
220,
220,
220,
220,
220,
220,
329,
264,
13495,
287,
3572,
62,
82,
13495,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
50033,
62,
1845,
64,
62,
11600,
796,
8633,
7,
19849,
62,
312,
28,
944,
13,
19849,
62,
312,
11,
264,
13495,
28,
82,
13495,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7800,
2116,
13,
50033,
62,
1845,
64,
62,
11600,
198
] | 2.236582 | 1,919 |
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class TableOfContents(Component):
"""A TableOfContents component.
Build a table of contents list with links to the headers tag.
Keyword arguments:
- id (string; optional): Unique identifier for the component.
- className (string; optional): className for the top ul component.
- content_selector (string; optional): Selector to search for building the toc.
- headings (list; optional): Headings tag name to search.
The table of contents will be leveled according to the order of
the headings prop.
- table_of_contents (list; optional): The table of content in object form.
- style (dict; optional): Style of the parent <ul>
- setProps (boolean | number | string | dict | list; optional)"""
@_explicitize_args
| [
2,
47044,
46,
24700,
1137,
11617,
45811,
532,
8410,
5626,
48483,
198,
198,
6738,
14470,
13,
31267,
13,
8692,
62,
42895,
1330,
35100,
11,
4808,
20676,
3628,
1096,
62,
22046,
628,
198,
4871,
8655,
5189,
15842,
7,
21950,
2599,
198,
220,
220,
220,
37227,
32,
8655,
5189,
15842,
7515,
13,
198,
15580,
257,
3084,
286,
10154,
1351,
351,
6117,
284,
262,
24697,
7621,
13,
198,
198,
9218,
4775,
7159,
25,
198,
12,
4686,
357,
8841,
26,
11902,
2599,
30015,
27421,
329,
262,
7515,
13,
198,
12,
1398,
5376,
357,
8841,
26,
11902,
2599,
1398,
5376,
329,
262,
1353,
14856,
7515,
13,
198,
12,
2695,
62,
19738,
273,
357,
8841,
26,
11902,
2599,
9683,
273,
284,
2989,
329,
2615,
262,
284,
66,
13,
198,
12,
1182,
654,
357,
4868,
26,
11902,
2599,
7123,
654,
7621,
1438,
284,
2989,
13,
198,
464,
3084,
286,
10154,
481,
307,
33297,
1864,
284,
262,
1502,
286,
198,
1169,
1182,
654,
2632,
13,
198,
12,
3084,
62,
1659,
62,
3642,
658,
357,
4868,
26,
11902,
2599,
383,
3084,
286,
2695,
287,
2134,
1296,
13,
198,
12,
3918,
357,
11600,
26,
11902,
2599,
17738,
286,
262,
2560,
1279,
377,
29,
198,
12,
900,
2964,
862,
357,
2127,
21052,
930,
1271,
930,
4731,
930,
8633,
930,
1351,
26,
11902,
8,
37811,
198,
220,
220,
220,
2488,
62,
20676,
3628,
1096,
62,
22046,
198
] | 3.688889 | 225 |
"""Test asyncpraw.models.front."""
from .. import IntegrationTest
| [
37811,
14402,
355,
2047,
13155,
1831,
13,
27530,
13,
8534,
526,
15931,
198,
6738,
11485,
1330,
38410,
14402,
628
] | 3.526316 | 19 |
from flask import render_template, flash, redirect, request, url_for
from app import app
from .forms import ConfigForm
from .scrabble_logic import Scrabble
tile_draw = []
grouped = {}
hasblank = 0
@app.route('/')
@app.route('/index')
@app.route('/table')
@app.route('/config', methods=['GET', 'POST'])
| [
6738,
42903,
1330,
8543,
62,
28243,
11,
7644,
11,
18941,
11,
2581,
11,
19016,
62,
1640,
198,
6738,
598,
1330,
598,
198,
6738,
764,
23914,
1330,
17056,
8479,
198,
6738,
764,
1416,
25619,
903,
62,
6404,
291,
1330,
1446,
25619,
903,
198,
198,
40927,
62,
19334,
796,
17635,
198,
8094,
276,
796,
23884,
198,
10134,
27190,
796,
657,
628,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
628,
198,
31,
1324,
13,
38629,
10786,
14,
9630,
11537,
628,
198,
31,
1324,
13,
38629,
10786,
14,
11487,
11537,
628,
198,
31,
1324,
13,
38629,
10786,
14,
11250,
3256,
5050,
28,
17816,
18851,
3256,
705,
32782,
6,
12962,
198
] | 2.906542 | 107 |
import enum
from elkconfdparser import errors
| [
11748,
33829,
198,
198,
6738,
1288,
74,
10414,
26059,
28198,
1330,
8563,
628,
628,
628
] | 3.466667 | 15 |
#!/usr/bin/env python3
import os
import sys
LIB_PATH = os.environ['LADYBUG_LIB_PATH']
sys.path.append(LIB_PATH)
from build_message_lib import BuildMessage
from plot_weather_lib import PlotWeather
from send_message_lib import SendMessage
# TODO: Error checking needs improvement.
# plot_weather() returns True (could create a PNG) or False (PNG of weather
# could not be created). Yet, build message assumes multiplart MIME with the
# Weather PNG in place.
p = PlotWeather()
b = BuildMessage()
# send margaret a message. False means send detailed data.
m = b.build_message('Margaret',False)
s = SendMessage()
s.send_message('[email protected]',m)
m = b.build_message('Thor',True) # Send summary info
s.send_message('[email protected]',m)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
40347,
62,
34219,
796,
28686,
13,
268,
2268,
17816,
43,
2885,
56,
12953,
62,
40347,
62,
34219,
20520,
198,
17597,
13,
6978,
13,
33295,
7,
40347,
62,
34219,
8,
198,
6738,
1382,
62,
20500,
62,
8019,
1330,
10934,
12837,
198,
6738,
7110,
62,
23563,
62,
8019,
1330,
28114,
41865,
198,
6738,
3758,
62,
20500,
62,
8019,
1330,
16290,
12837,
198,
2,
16926,
46,
25,
13047,
10627,
2476,
9025,
13,
198,
2,
7110,
62,
23563,
3419,
5860,
6407,
357,
24089,
2251,
257,
36182,
8,
393,
10352,
357,
47,
10503,
286,
6193,
198,
2,
714,
407,
307,
2727,
737,
220,
6430,
11,
1382,
3275,
18533,
15082,
433,
337,
12789,
351,
262,
198,
2,
15615,
36182,
287,
1295,
13,
198,
79,
796,
28114,
41865,
3419,
198,
65,
796,
10934,
12837,
3419,
198,
2,
3758,
6145,
8984,
257,
3275,
13,
220,
10352,
1724,
3758,
6496,
1366,
13,
198,
76,
796,
275,
13,
11249,
62,
20500,
10786,
24428,
8984,
3256,
25101,
8,
198,
82,
796,
16290,
12837,
3419,
198,
82,
13,
21280,
62,
20500,
10786,
34191,
820,
13,
76,
30686,
1559,
31,
14816,
13,
785,
3256,
76,
8,
198,
76,
796,
275,
13,
11249,
62,
20500,
10786,
46765,
3256,
17821,
8,
220,
1303,
16290,
10638,
7508,
198,
82,
13,
21280,
62,
20500,
10786,
400,
273,
62,
30686,
1559,
31,
907,
77,
13,
785,
3256,
76,
8,
198
] | 3.154812 | 239 |
''':'
autocomplete()
{
if [ $# != 2 ]
then
echo "USAGE: autocomplete <command> <config-path>"
return 1
fi
local COMMAND="$1"
local CONFIG_PATH="$(readlink -f "$2")"
eval "
_complete_$COMMAND()
{
local THIS_FILE=\"\$(readlink -f \"\${BASH_SOURCE[0]}\")\"
COMPREPLY=( \$(python \"\$THIS_FILE\" \"$CONFIG_PATH\" \"\$COMP_LINE\" \"\$COMP_POINT\" \"\$COMP_CWORD\") );
# Some special behaviour (like displaying path autocompletion only from the last slash on)
# must be done in bash on-demand, so the first line is reserved for compopt.
for FLAG in \$(echo \"\${COMPREPLY[0]}\" | tr ',' '\\n')
do
if [ \"\$FLAG\" = \".\" ]
then
continue
fi
compopt -o \"\$FLAG\"
done
COMPREPLY=( \"\${COMPREPLY[@]:1}\" )
}
complete -F _complete_$COMMAND $COMMAND
"
}
return
'''
import collections
import os
import shlex
import sys
import traceback
import types
completers = {}
completer_prefix = 'complete_'
completers['value'] = complete_value
completers['path'] = complete_path
if __name__ == '__main__':
sys.exit(main(sys.argv))
| [
7061,
10354,
6,
198,
2306,
42829,
6677,
3419,
198,
90,
198,
220,
220,
220,
611,
685,
720,
2,
14512,
362,
2361,
198,
220,
220,
220,
788,
198,
220,
220,
220,
220,
220,
220,
220,
9809,
366,
2937,
11879,
25,
1960,
42829,
6677,
1279,
21812,
29,
1279,
11250,
12,
6978,
24618,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
352,
198,
220,
220,
220,
25912,
198,
220,
220,
220,
1957,
22240,
6981,
2625,
3,
16,
1,
198,
220,
220,
220,
1957,
25626,
62,
34219,
2625,
3,
7,
961,
8726,
532,
69,
17971,
17,
4943,
1,
198,
220,
220,
220,
5418,
366,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
20751,
62,
3,
9858,
44,
6981,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1957,
12680,
62,
25664,
17553,
59,
3,
7,
961,
8726,
532,
69,
19990,
59,
38892,
33,
11211,
62,
47690,
58,
15,
60,
32239,
4943,
7879,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24301,
2200,
6489,
56,
16193,
3467,
3,
7,
29412,
19990,
59,
3,
43559,
62,
25664,
7879,
19990,
3,
10943,
16254,
62,
34219,
7879,
19990,
59,
3,
9858,
47,
62,
24027,
7879,
19990,
59,
3,
9858,
47,
62,
16402,
12394,
7879,
19990,
59,
3,
9858,
47,
62,
43538,
12532,
59,
4943,
5619,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2773,
2041,
9172,
357,
2339,
19407,
3108,
1960,
42829,
24547,
691,
422,
262,
938,
24632,
319,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1276,
307,
1760,
287,
27334,
319,
12,
28550,
11,
523,
262,
717,
1627,
318,
10395,
329,
552,
8738,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
9977,
4760,
287,
3467,
3,
7,
30328,
19990,
59,
38892,
9858,
46437,
6489,
56,
58,
15,
48999,
7879,
930,
491,
705,
4032,
705,
6852,
77,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
466,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
685,
19990,
59,
3,
38948,
7879,
796,
3467,
1911,
7879,
2361,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
788,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25912,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
552,
8738,
532,
78,
19990,
59,
3,
38948,
7879,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1760,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24301,
2200,
6489,
56,
16193,
19990,
59,
38892,
9858,
46437,
6489,
56,
58,
31,
5974,
16,
92,
7879,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1844,
532,
37,
4808,
20751,
62,
3,
9858,
44,
6981,
720,
9858,
44,
6981,
198,
220,
220,
220,
366,
198,
92,
198,
7783,
198,
7061,
6,
198,
198,
11748,
17268,
198,
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
11748,
3858,
628,
198,
785,
1154,
1010,
220,
220,
220,
220,
220,
220,
796,
23884,
198,
785,
1154,
353,
62,
40290,
796,
705,
20751,
62,
6,
628,
628,
198,
198,
785,
1154,
1010,
17816,
8367,
20520,
796,
1844,
62,
8367,
198,
198,
785,
1154,
1010,
17816,
6978,
20520,
796,
1844,
62,
6978,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
25064,
13,
37023,
7,
12417,
7,
17597,
13,
853,
85,
4008,
198
] | 2.028302 | 636 |
from . import api, cli, extra, core
from .core import Habitica
| [
6738,
764,
1330,
40391,
11,
537,
72,
11,
3131,
11,
4755,
198,
6738,
764,
7295,
1330,
41950,
3970,
198
] | 3.315789 | 19 |
from ..base import HaravanResource
from haravan import mixins
import haravan
| [
6738,
11485,
8692,
1330,
2113,
12421,
26198,
198,
6738,
3971,
12421,
1330,
5022,
1040,
198,
11748,
3971,
12421,
628
] | 4.105263 | 19 |
# https://atcoder.jp/contests/abc229/tasks/abc229_d
S = input()
K = int(input())
ans = 0
tail_idx = 0
cum_dot = [0] * (len(S) + 1)
for i in range(len(S)):
if S[i] == '.':
cum_dot[i + 1] = cum_dot[i] + 1
else:
cum_dot[i + 1] = cum_dot[i]
for head_idx in range(len(S)):
while tail_idx <= len(S) - 1 and can_swap_to_x(head_idx, tail_idx + 1):
tail_idx += 1
ans = max(ans, tail_idx - head_idx)
print(ans)
| [
2,
3740,
1378,
265,
66,
12342,
13,
34523,
14,
3642,
3558,
14,
39305,
23539,
14,
83,
6791,
14,
39305,
23539,
62,
67,
198,
50,
796,
5128,
3419,
198,
42,
796,
493,
7,
15414,
28955,
198,
504,
796,
657,
198,
13199,
62,
312,
87,
796,
657,
198,
198,
36340,
62,
26518,
796,
685,
15,
60,
1635,
357,
11925,
7,
50,
8,
1343,
352,
8,
198,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
50,
8,
2599,
198,
220,
220,
220,
611,
311,
58,
72,
60,
6624,
705,
2637,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10973,
62,
26518,
58,
72,
1343,
352,
60,
796,
10973,
62,
26518,
58,
72,
60,
1343,
352,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10973,
62,
26518,
58,
72,
1343,
352,
60,
796,
10973,
62,
26518,
58,
72,
60,
628,
198,
198,
1640,
1182,
62,
312,
87,
287,
2837,
7,
11925,
7,
50,
8,
2599,
198,
220,
220,
220,
981,
7894,
62,
312,
87,
19841,
18896,
7,
50,
8,
532,
352,
290,
460,
62,
2032,
499,
62,
1462,
62,
87,
7,
2256,
62,
312,
87,
11,
7894,
62,
312,
87,
1343,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
7894,
62,
312,
87,
15853,
352,
198,
220,
220,
220,
9093,
796,
3509,
7,
504,
11,
7894,
62,
312,
87,
532,
1182,
62,
312,
87,
8,
198,
198,
4798,
7,
504,
8,
198
] | 1.886076 | 237 |
# Copyright 2015-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function, unicode_literals
from botocore.exceptions import ClientError
from c7n.actions import BaseAction
from c7n.filters import Filter
from c7n.manager import resources
from c7n.query import QueryResourceManager
from c7n.utils import local_session, type_schema
@resources.register('shield-protection')
@resources.register('shield-attack')
class SetShieldProtection(BaseAction):
"""Enable shield protection on applicable resource.
"""
permissions = ('shield:CreateProtection', 'shield:ListProtections',)
schema = type_schema(
'set-shield',
state={'type': 'boolean'})
| [
2,
15069,
1853,
12,
5539,
9747,
1881,
6168,
11,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
10214,
420,
382,
13,
1069,
11755,
1330,
20985,
12331,
198,
6738,
269,
22,
77,
13,
4658,
1330,
7308,
12502,
198,
6738,
269,
22,
77,
13,
10379,
1010,
1330,
25853,
198,
6738,
269,
22,
77,
13,
37153,
1330,
4133,
198,
6738,
269,
22,
77,
13,
22766,
1330,
43301,
26198,
13511,
198,
6738,
269,
22,
77,
13,
26791,
1330,
1957,
62,
29891,
11,
2099,
62,
15952,
2611,
628,
198,
31,
37540,
13,
30238,
10786,
26662,
12,
42846,
11537,
628,
198,
31,
37540,
13,
30238,
10786,
26662,
12,
20358,
11537,
628,
198,
198,
4871,
5345,
33651,
19703,
3213,
7,
14881,
12502,
2599,
198,
220,
220,
220,
37227,
36695,
7614,
4800,
319,
9723,
8271,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
21627,
796,
19203,
26662,
25,
16447,
19703,
3213,
3256,
705,
26662,
25,
8053,
41426,
507,
3256,
8,
198,
220,
220,
220,
32815,
796,
2099,
62,
15952,
2611,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
2617,
12,
26662,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
34758,
6,
4906,
10354,
705,
2127,
21052,
6,
30072,
198
] | 3.565341 | 352 |
from django.shortcuts import render, redirect
from newDjangoProject.todo_app.forms import TodoForm
from newDjangoProject.todo_app.models import Todo
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
198,
6738,
649,
35,
73,
14208,
16775,
13,
83,
24313,
62,
1324,
13,
23914,
1330,
309,
24313,
8479,
198,
6738,
649,
35,
73,
14208,
16775,
13,
83,
24313,
62,
1324,
13,
27530,
1330,
309,
24313,
628,
628,
198
] | 3.142857 | 49 |
temp = []
princ = []
c = maior = menor = 0
continuar = ' '
while continuar not in 'Nn':
c += 1
print(f'{c}º PESSOA')
print('-' * 10)
temp.append(str(input(f'Digite o seu nome: ')))
temp.append(float(input(f'Digite o seu peso: ')))
if c == 1:
maior = menor = temp[1]
else:
if temp[1] > maior:
maior = temp[1]
if temp[1] < menor:
menor = temp[1]
princ.append(temp[:])
temp.clear()
while True:
continuar = str(input('Quer continuar? [S/N]:'))
if continuar in 'NnSs':
break
print('Tente novamente!', end=' ')
print(f'Foram cadastradas {c} pessoas.')
print(f'O maior peso foi de {maior}',end=' ')
for p in princ:
if p[1] == maior:
print(p[0])
print(f'O menor peso foi de {menor}',end=' ')
for p in princ:
if p[1] == menor:
print(p[0])
| [
29510,
796,
17635,
198,
1050,
1939,
796,
17635,
198,
66,
796,
17266,
1504,
796,
1450,
273,
796,
657,
198,
18487,
84,
283,
796,
705,
705,
198,
4514,
11143,
283,
407,
287,
705,
45,
77,
10354,
198,
220,
220,
220,
269,
15853,
352,
198,
220,
220,
220,
3601,
7,
69,
6,
90,
66,
92,
36165,
350,
7597,
23621,
11537,
198,
220,
220,
220,
3601,
10786,
19355,
1635,
838,
8,
198,
220,
220,
220,
20218,
13,
33295,
7,
2536,
7,
15414,
7,
69,
6,
19511,
578,
267,
384,
84,
299,
462,
25,
705,
22305,
198,
220,
220,
220,
20218,
13,
33295,
7,
22468,
7,
15414,
7,
69,
6,
19511,
578,
267,
384,
84,
32317,
78,
25,
705,
22305,
198,
220,
220,
220,
611,
269,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
17266,
1504,
796,
1450,
273,
796,
20218,
58,
16,
60,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
20218,
58,
16,
60,
1875,
17266,
1504,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17266,
1504,
796,
20218,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
611,
20218,
58,
16,
60,
1279,
1450,
273,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1450,
273,
796,
20218,
58,
16,
60,
198,
220,
220,
220,
5144,
13,
33295,
7,
29510,
58,
25,
12962,
198,
220,
220,
220,
20218,
13,
20063,
3419,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11143,
283,
796,
965,
7,
15414,
10786,
4507,
263,
11143,
283,
30,
685,
50,
14,
45,
5974,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
11143,
283,
287,
705,
45,
77,
50,
82,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
51,
21872,
645,
85,
3263,
68,
0,
3256,
886,
11639,
705,
8,
198,
4798,
7,
69,
6,
1890,
321,
20603,
459,
6335,
292,
1391,
66,
92,
279,
408,
78,
292,
2637,
8,
198,
4798,
7,
69,
6,
46,
17266,
1504,
32317,
78,
11511,
72,
390,
1391,
2611,
1504,
92,
3256,
437,
11639,
705,
8,
198,
1640,
279,
287,
5144,
25,
198,
220,
220,
220,
611,
279,
58,
16,
60,
6624,
17266,
1504,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
79,
58,
15,
12962,
198,
4798,
7,
69,
6,
46,
1450,
273,
32317,
78,
11511,
72,
390,
1391,
3653,
273,
92,
3256,
437,
11639,
705,
8,
198,
1640,
279,
287,
5144,
25,
198,
220,
220,
220,
611,
279,
58,
16,
60,
6624,
1450,
273,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
79,
58,
15,
12962,
628,
628,
628
] | 1.915401 | 461 |
#! /usr/bin/env python3
import os
import sys
import time
import json
import os.path
import hashlib
import logging
import threading
from decimal import Decimal
from flask_socketio import SocketIO
from flask import Flask, render_template, url_for, request
from binance_api import api_master_rest_caller
from binance_api import api_master_socket_caller
from . import trader
MULTI_DEPTH_INDICATORS = ['ema', 'sma', 'rma', 'order']
# Initilize globals.
## Setup flask app/socket
APP = Flask(__name__)
SOCKET_IO = SocketIO(APP)
## Initilize base core object.
core_object = None
started_updater = False
## Initilize IP/port pair globals.
host_ip = ''
host_port = ''
## Set traders cache file name.
CAHCE_FILES = 'traders.json'
@APP.context_processor
@APP.route('/', methods=['GET'])
@APP.route('/rest-api/v1/trader_update', methods=['POST'])
@APP.route('/rest-api/v1/get_trader_charting', methods=['GET'])
@APP.route('/rest-api/v1/get_trader_indicators', methods=['GET'])
@APP.route('/rest-api/v1/get_trader_candles', methods=['GET'])
@APP.route('/rest-api/v1/test', methods=['GET'])
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
28686,
13,
6978,
198,
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
4704,
278,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
42903,
62,
44971,
952,
1330,
47068,
9399,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
2581,
198,
198,
6738,
9874,
590,
62,
15042,
1330,
40391,
62,
9866,
62,
2118,
62,
13345,
263,
198,
6738,
9874,
590,
62,
15042,
1330,
40391,
62,
9866,
62,
44971,
62,
13345,
263,
198,
198,
6738,
764,
1330,
31791,
198,
198,
44,
16724,
40,
62,
46162,
4221,
62,
12115,
2149,
1404,
20673,
796,
37250,
19687,
3256,
705,
82,
2611,
3256,
705,
81,
2611,
3256,
705,
2875,
20520,
198,
198,
2,
44707,
346,
1096,
15095,
874,
13,
198,
198,
2235,
31122,
42903,
598,
14,
44971,
198,
24805,
220,
220,
220,
220,
220,
220,
220,
220,
796,
46947,
7,
834,
3672,
834,
8,
198,
50,
11290,
2767,
62,
9399,
220,
220,
796,
47068,
9399,
7,
24805,
8,
198,
198,
2235,
44707,
346,
1096,
2779,
4755,
2134,
13,
198,
7295,
62,
15252,
796,
6045,
198,
198,
46981,
62,
929,
67,
729,
796,
10352,
198,
198,
2235,
44707,
346,
1096,
6101,
14,
634,
5166,
15095,
874,
13,
198,
4774,
62,
541,
220,
220,
220,
220,
796,
10148,
198,
4774,
62,
634,
220,
220,
796,
10148,
198,
198,
2235,
5345,
21703,
12940,
2393,
1438,
13,
198,
8141,
39,
5222,
62,
46700,
1546,
796,
705,
2213,
9972,
13,
17752,
6,
628,
198,
31,
24805,
13,
22866,
62,
41341,
628,
198,
198,
31,
24805,
13,
38629,
10786,
14,
3256,
5050,
28,
17816,
18851,
6,
12962,
628,
198,
31,
24805,
13,
38629,
10786,
14,
2118,
12,
15042,
14,
85,
16,
14,
2213,
5067,
62,
19119,
3256,
5050,
28,
17816,
32782,
6,
12962,
628,
198,
31,
24805,
13,
38629,
10786,
14,
2118,
12,
15042,
14,
85,
16,
14,
1136,
62,
2213,
5067,
62,
40926,
278,
3256,
5050,
28,
17816,
18851,
6,
12962,
628,
198,
31,
24805,
13,
38629,
10786,
14,
2118,
12,
15042,
14,
85,
16,
14,
1136,
62,
2213,
5067,
62,
521,
44549,
3256,
5050,
28,
17816,
18851,
6,
12962,
628,
198,
31,
24805,
13,
38629,
10786,
14,
2118,
12,
15042,
14,
85,
16,
14,
1136,
62,
2213,
5067,
62,
46188,
829,
3256,
5050,
28,
17816,
18851,
6,
12962,
628,
198,
31,
24805,
13,
38629,
10786,
14,
2118,
12,
15042,
14,
85,
16,
14,
9288,
3256,
5050,
28,
17816,
18851,
6,
12962,
628,
628,
628
] | 2.652482 | 423 |
from selenium import webdriver
from test_utils import *
from time import sleep
import random
if __name__ == "__main__":
try:
test_SignUpRequest()
print("test_SignUpRequest passed")
except:
print("test_SignUpRequest Failed")
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
1332,
62,
26791,
1330,
1635,
198,
6738,
640,
1330,
3993,
198,
11748,
4738,
198,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
11712,
4933,
18453,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
9288,
62,
11712,
4933,
18453,
3804,
4943,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
9288,
62,
11712,
4933,
18453,
22738,
4943,
198
] | 2.636364 | 99 |
from marshmallow import EXCLUDE
from ma import ma
from models.book import BookModel | [
6738,
22397,
42725,
1330,
7788,
5097,
52,
7206,
198,
6738,
17266,
1330,
17266,
198,
6738,
4981,
13,
2070,
1330,
4897,
17633
] | 3.952381 | 21 |
import requests
import bs4 as bs
if __name__ == "__main__":
url = "http://192.168.1.40/.hidden/"
scrapping_recursive(url)
| [
11748,
7007,
198,
11748,
275,
82,
19,
355,
275,
82,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
6371,
796,
366,
4023,
1378,
17477,
13,
14656,
13,
16,
13,
1821,
11757,
30342,
30487,
198,
197,
1416,
430,
2105,
62,
8344,
30753,
7,
6371,
8,
198
] | 2.45098 | 51 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from Axon.Component import component
from Axon.ThreadedComponent import threadedcomponent
from Axon.Ipc import producerFinished, shutdownMicroprocess
from Kamaelia.Util.PipelineComponent import pipeline
import time
from Axon.Scheduler import _ACTIVE
class Profiler(threadedcomponent):
"""\
Profiler([samplingrate][,outputrate]) -> new Profiler component.
Basic code profiler for Axon/Kamaelia systems. Measures the amount of time
different microproceses are running.
Keyword arguments:
- samplingrate -- samples of state taken per second (default=1.0)
- outputrate -- times statistics are output per second (default=1.0)
"""
Inboxes = { "inbox" : "",
"control" : "",
}
Outboxes = { "outbox" : "Raw profiling data",
"signal" : "",
}
if __name__=="__main__":
from Kamaelia.Util.Console import ConsoleEchoer
BusyComponent().activate()
pipeline( FormattedProfiler(10.0,1.0),
ConsoleEchoer(),
).run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
3050,
3517,
32250,
10501,
290,
509,
1689,
25418,
25767,
669,
7,
16,
8,
198,
2,
198,
2,
357,
16,
8,
509,
1689,
25418,
25767,
669,
389,
5610,
287,
262,
37195,
20673,
2393,
290,
379,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
74,
1689,
25418,
13,
2398,
14,
32,
24318,
20673,
532,
3387,
9117,
428,
2393,
11,
198,
2,
220,
220,
220,
220,
407,
428,
4003,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
6738,
12176,
261,
13,
21950,
1330,
7515,
198,
6738,
12176,
261,
13,
16818,
276,
21950,
1330,
40945,
42895,
198,
6738,
12176,
261,
13,
40,
14751,
1330,
9920,
18467,
1348,
11,
18325,
13031,
14681,
198,
6738,
509,
1689,
25418,
13,
18274,
346,
13,
47,
541,
4470,
21950,
1330,
11523,
198,
11748,
640,
198,
6738,
12176,
261,
13,
50,
1740,
18173,
1330,
4808,
10659,
9306,
198,
198,
4871,
4415,
5329,
7,
16663,
276,
42895,
2599,
198,
220,
220,
220,
37227,
59,
198,
220,
220,
220,
4415,
5329,
26933,
37687,
11347,
4873,
7131,
11,
22915,
4873,
12962,
4613,
649,
4415,
5329,
7515,
13,
628,
220,
220,
220,
14392,
2438,
1534,
5329,
329,
12176,
261,
14,
42,
1689,
25418,
3341,
13,
45040,
262,
2033,
286,
640,
198,
220,
220,
220,
1180,
4580,
1676,
728,
274,
389,
2491,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
7383,
4775,
7159,
25,
198,
220,
220,
220,
532,
19232,
4873,
220,
1377,
8405,
286,
1181,
2077,
583,
1218,
357,
12286,
28,
16,
13,
15,
8,
198,
220,
220,
220,
532,
5072,
4873,
220,
220,
220,
1377,
1661,
7869,
389,
5072,
583,
1218,
357,
12286,
28,
16,
13,
15,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
554,
29305,
796,
1391,
366,
259,
3524,
1,
1058,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13716,
1,
1058,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
3806,
29305,
796,
1391,
366,
448,
3524,
1,
1058,
366,
27369,
31582,
1366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12683,
282,
1,
1058,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
422,
509,
1689,
25418,
13,
18274,
346,
13,
47581,
1330,
24371,
36,
6679,
263,
198,
220,
220,
220,
220,
198,
220,
220,
220,
5869,
88,
21950,
22446,
39022,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
11523,
7,
5178,
16898,
15404,
5329,
7,
940,
13,
15,
11,
16,
13,
15,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24371,
36,
6679,
263,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6739,
5143,
3419,
198,
220,
220,
220,
220
] | 2.851796 | 668 |
import re
from typing import Tuple
BINANCE_SYMBOL_SPLITTER = re.compile(r"^(\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$")
| [
11748,
302,
198,
6738,
19720,
1330,
309,
29291,
628,
198,
33,
1268,
19240,
62,
23060,
10744,
3535,
62,
4303,
43,
2043,
5781,
796,
302,
13,
5589,
576,
7,
81,
1,
61,
38016,
86,
10,
5769,
35964,
91,
20702,
91,
15766,
33,
91,
55,
20031,
91,
2937,
24544,
91,
2937,
9697,
91,
51,
29072,
91,
4537,
55,
8,
3,
4943,
628,
628
] | 2.04918 | 61 |
import json
import os
print("relation", "raw_p", "few_p", "p inc", "raw_type_p", "few_type_p", "t inc", sep='\t')
relations = ['P1001', 'P101', 'P103', 'P106', 'P108', 'P127', 'P1303', 'P131', 'P136', 'P1376', 'P138', 'P140', 'P1412', 'P159', 'P17', 'P176', 'P178', 'P19', 'P190', 'P20', 'P264', 'P27', 'P276', 'P279', 'P30', 'P31', 'P36', 'P361', 'P364', 'P37', 'P39', 'P407', 'P413', 'P449', 'P463', 'P47', 'P495', 'P527', 'P530', 'P740', 'P937']
fewshot_dir_path = 'case_based_10_train'
raw_dir_path = 'lama'
with open('data/type_file/bert.json', 'r') as f:
relation_token = json.load(f)
for relation in relations:
with open(os.path.join(fewshot_dir_path, relation, relation + '_predictions.jsonl'), 'r') as f:
fewshot_prediction_list = f.readlines()
fewshot_prediction_list = [json.loads(pred) for pred in fewshot_prediction_list]
with open(os.path.join(raw_dir_path, relation, relation + '_predictions.jsonl'), 'r') as f:
raw_prediction_list = f.readlines()
raw_prediction_list = [json.loads(pred) for pred in raw_prediction_list]
type_token_set = set(relation_token[relation])
raw_p = get_precision(raw_prediction_list)
few_p = get_precision(fewshot_prediction_list)
p_inc = few_p - raw_p
raw_type_p = get_type_precision(raw_prediction_list, type_token_set)
few_type_p = get_type_precision(fewshot_prediction_list, type_token_set)
t_inc = few_type_p - raw_type_p
print(
relation,
raw_p,
few_p,
p_inc,
raw_type_p,
few_type_p,
t_inc,
sep='\t'
)
| [
11748,
33918,
198,
11748,
28686,
198,
198,
4798,
7203,
49501,
1600,
366,
1831,
62,
79,
1600,
366,
32146,
62,
79,
1600,
366,
79,
753,
1600,
366,
1831,
62,
4906,
62,
79,
1600,
366,
32146,
62,
4906,
62,
79,
1600,
366,
83,
753,
1600,
41767,
11639,
59,
83,
11537,
628,
198,
39468,
796,
37250,
47,
47705,
3256,
705,
47,
8784,
3256,
705,
47,
15197,
3256,
705,
47,
15801,
3256,
705,
47,
15711,
3256,
705,
47,
16799,
3256,
705,
47,
12952,
18,
3256,
705,
47,
22042,
3256,
705,
47,
20809,
3256,
705,
47,
1485,
4304,
3256,
705,
47,
20107,
3256,
705,
47,
15187,
3256,
705,
47,
1415,
1065,
3256,
705,
47,
19707,
3256,
705,
47,
1558,
3256,
705,
47,
24096,
3256,
705,
47,
23188,
3256,
705,
47,
1129,
3256,
705,
47,
19782,
3256,
705,
47,
1238,
3256,
705,
47,
18897,
3256,
705,
47,
1983,
3256,
705,
47,
27988,
3256,
705,
47,
26050,
3256,
705,
47,
1270,
3256,
705,
47,
3132,
3256,
705,
47,
2623,
3256,
705,
47,
35195,
3256,
705,
47,
26780,
3256,
705,
47,
2718,
3256,
705,
47,
2670,
3256,
705,
47,
30120,
3256,
705,
47,
44103,
3256,
705,
47,
31911,
3256,
705,
47,
38380,
3256,
705,
47,
2857,
3256,
705,
47,
33781,
3256,
705,
47,
20,
1983,
3256,
705,
47,
38612,
3256,
705,
47,
45598,
3256,
705,
47,
24,
2718,
20520,
198,
32146,
9442,
62,
15908,
62,
6978,
796,
705,
7442,
62,
3106,
62,
940,
62,
27432,
6,
198,
1831,
62,
15908,
62,
6978,
796,
705,
75,
1689,
6,
198,
198,
4480,
1280,
10786,
7890,
14,
4906,
62,
7753,
14,
4835,
13,
17752,
3256,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220,
8695,
62,
30001,
796,
33918,
13,
2220,
7,
69,
8,
628,
198,
1640,
8695,
287,
2316,
25,
198,
220,
220,
220,
351,
1280,
7,
418,
13,
6978,
13,
22179,
7,
32146,
9442,
62,
15908,
62,
6978,
11,
8695,
11,
8695,
1343,
705,
62,
28764,
9278,
13,
17752,
75,
33809,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1178,
9442,
62,
28764,
2867,
62,
4868,
796,
277,
13,
961,
6615,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1178,
9442,
62,
28764,
2867,
62,
4868,
796,
685,
17752,
13,
46030,
7,
28764,
8,
329,
2747,
287,
1178,
9442,
62,
28764,
2867,
62,
4868,
60,
198,
220,
220,
220,
351,
1280,
7,
418,
13,
6978,
13,
22179,
7,
1831,
62,
15908,
62,
6978,
11,
8695,
11,
8695,
1343,
705,
62,
28764,
9278,
13,
17752,
75,
33809,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
28764,
2867,
62,
4868,
796,
277,
13,
961,
6615,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
28764,
2867,
62,
4868,
796,
685,
17752,
13,
46030,
7,
28764,
8,
329,
2747,
287,
8246,
62,
28764,
2867,
62,
4868,
60,
198,
220,
220,
220,
2099,
62,
30001,
62,
2617,
796,
900,
7,
49501,
62,
30001,
58,
49501,
12962,
198,
220,
220,
220,
8246,
62,
79,
796,
651,
62,
3866,
16005,
7,
1831,
62,
28764,
2867,
62,
4868,
8,
198,
220,
220,
220,
1178,
62,
79,
796,
651,
62,
3866,
16005,
7,
32146,
9442,
62,
28764,
2867,
62,
4868,
8,
198,
220,
220,
220,
279,
62,
1939,
796,
1178,
62,
79,
532,
8246,
62,
79,
198,
220,
220,
220,
8246,
62,
4906,
62,
79,
796,
651,
62,
4906,
62,
3866,
16005,
7,
1831,
62,
28764,
2867,
62,
4868,
11,
2099,
62,
30001,
62,
2617,
8,
198,
220,
220,
220,
1178,
62,
4906,
62,
79,
796,
651,
62,
4906,
62,
3866,
16005,
7,
32146,
9442,
62,
28764,
2867,
62,
4868,
11,
2099,
62,
30001,
62,
2617,
8,
198,
220,
220,
220,
256,
62,
1939,
796,
1178,
62,
4906,
62,
79,
532,
8246,
62,
4906,
62,
79,
198,
220,
220,
220,
3601,
7,
198,
220,
220,
220,
220,
220,
220,
220,
8695,
11,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1178,
62,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
1939,
11,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
4906,
62,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1178,
62,
4906,
62,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
256,
62,
1939,
11,
198,
220,
220,
220,
220,
220,
220,
220,
41767,
11639,
59,
83,
6,
198,
220,
220,
220,
1267,
198
] | 2.166667 | 738 |
import json
import os
import logging
import pandas as pd
import torch
def set_logger(log_path):
"""Set the logger to log info in terminal and file `log_path`.
In general, it is useful to have a logger so that every output to the terminal is saved
in a permanent file. Here we save it to `model_dir/train.log`.
Example:
```
logging.info("Starting training...")
```
Args:
log_path: (string) where to log
"""
logger = logging.getLogger()
logger.setLevel(logging.INFO)
if not logger.handlers:
# Logging to a file
file_handler = logging.FileHandler(log_path)
file_handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s: %(message)s'))
logger.addHandler(file_handler)
# Logging to console
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s: %(message)s'))
logger.addHandler(stream_handler)
def save_metric_histories(train_hist, valid_hist, results_path):
"""
both lists of dicts, keys are metric names
"""
train_hist_df = pd.DataFrame(train_hist)
valid_hist_df = pd.DataFrame(valid_hist)
TRAIN_HIST_FILE = os.path.join(results_path, 'train_hist.csv')
VALID_HIST_FILE = os.path.join(results_path, 'valid_hist.csv')
train_hist_df.to_csv(TRAIN_HIST_FILE, index=False)
valid_hist_df.to_csv(VALID_HIST_FILE, index=False)
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
628,
198,
198,
4299,
900,
62,
6404,
1362,
7,
6404,
62,
6978,
2599,
198,
220,
220,
220,
37227,
7248,
262,
49706,
284,
2604,
7508,
287,
12094,
290,
2393,
4600,
6404,
62,
6978,
44646,
198,
220,
220,
220,
554,
2276,
11,
340,
318,
4465,
284,
423,
257,
49706,
523,
326,
790,
5072,
284,
262,
12094,
318,
7448,
198,
220,
220,
220,
287,
257,
7748,
2393,
13,
3423,
356,
3613,
340,
284,
4600,
19849,
62,
15908,
14,
27432,
13,
6404,
44646,
198,
220,
220,
220,
17934,
25,
198,
220,
220,
220,
7559,
63,
198,
220,
220,
220,
18931,
13,
10951,
7203,
22851,
3047,
9313,
8,
198,
220,
220,
220,
7559,
63,
198,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
6978,
25,
357,
8841,
8,
810,
284,
2604,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
49706,
796,
18931,
13,
1136,
11187,
1362,
3419,
198,
220,
220,
220,
49706,
13,
2617,
4971,
7,
6404,
2667,
13,
10778,
8,
628,
220,
220,
220,
611,
407,
49706,
13,
4993,
8116,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5972,
2667,
284,
257,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
30281,
796,
18931,
13,
8979,
25060,
7,
6404,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
30281,
13,
2617,
8479,
1436,
7,
6404,
2667,
13,
8479,
1436,
10786,
4,
7,
292,
310,
524,
8,
82,
25,
4,
7,
5715,
3672,
8,
82,
25,
4064,
7,
20500,
8,
82,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
2860,
25060,
7,
7753,
62,
30281,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
5972,
2667,
284,
8624,
198,
220,
220,
220,
220,
220,
220,
220,
4269,
62,
30281,
796,
18931,
13,
12124,
25060,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
4269,
62,
30281,
13,
2617,
8479,
1436,
7,
6404,
2667,
13,
8479,
1436,
10786,
4,
7,
292,
310,
524,
8,
82,
25,
4,
7,
5715,
3672,
8,
82,
25,
4064,
7,
20500,
8,
82,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
2860,
25060,
7,
5532,
62,
30281,
8,
628,
198,
4299,
3613,
62,
4164,
1173,
62,
10034,
1749,
7,
27432,
62,
10034,
11,
4938,
62,
10034,
11,
2482,
62,
6978,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1111,
8341,
286,
8633,
82,
11,
8251,
389,
18663,
3891,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4512,
62,
10034,
62,
7568,
796,
279,
67,
13,
6601,
19778,
7,
27432,
62,
10034,
8,
198,
220,
220,
220,
4938,
62,
10034,
62,
7568,
796,
279,
67,
13,
6601,
19778,
7,
12102,
62,
10034,
8,
628,
220,
220,
220,
29125,
1268,
62,
39,
8808,
62,
25664,
796,
28686,
13,
6978,
13,
22179,
7,
43420,
62,
6978,
11,
705,
27432,
62,
10034,
13,
40664,
11537,
198,
220,
220,
220,
26173,
2389,
62,
39,
8808,
62,
25664,
796,
28686,
13,
6978,
13,
22179,
7,
43420,
62,
6978,
11,
705,
12102,
62,
10034,
13,
40664,
11537,
628,
220,
220,
220,
4512,
62,
10034,
62,
7568,
13,
1462,
62,
40664,
7,
51,
3861,
1268,
62,
39,
8808,
62,
25664,
11,
6376,
28,
25101,
8,
198,
220,
220,
220,
4938,
62,
10034,
62,
7568,
13,
1462,
62,
40664,
7,
23428,
2389,
62,
39,
8808,
62,
25664,
11,
6376,
28,
25101,
8,
628,
198
] | 2.494845 | 582 |
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import unittest
from unittest.mock import MagicMock, Mock, patch
from test_workflow.integ_test.integ_test_start_properties_opensearch_dashboards import IntegTestStartPropertiesOpenSearchDashboards
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
2,
383,
4946,
18243,
25767,
669,
2421,
9284,
925,
284,
198,
2,
428,
2393,
307,
11971,
739,
262,
24843,
12,
17,
13,
15,
5964,
393,
257,
198,
2,
11670,
1280,
2723,
5964,
13,
198,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
11,
44123,
11,
8529,
198,
198,
6738,
1332,
62,
1818,
11125,
13,
18908,
62,
9288,
13,
18908,
62,
9288,
62,
9688,
62,
48310,
62,
404,
1072,
998,
62,
42460,
12821,
1330,
15995,
14402,
10434,
2964,
18200,
11505,
18243,
43041,
12821,
628
] | 3.59633 | 109 |
from Spectrum import Spectrum
from UniversalSpectrumIdentifier import UniversalSpectrumIdentifier
# USI created
usi = UniversalSpectrumIdentifier("asdf:PXD000561::Adult_Frontalcortex_bRP_Elite_85_f09:scan:17555:VLHPLEGAVVIIFK/2")
# usi = UniversalSpectrumIdentifier("mzspec:PXD002437:00261_A06_P001564_B00E_A00_R1:scan:10951:PEPT[Phospho]IDELVISK/2")
# usi = UniversalSpectrumIdentifier("mzspec:PXD005712::20152002_RG_150218_Saita_Ctrl_3XXXXX:scan:5748:AVAAVAATGPASAPGPGGGR/2")
usi.parse(verbose=False)
# if the USI is okay then create a spectrum class to fetch from the online database
if usi.valid:
# spectrum class just takes in a USI
spectrum = Spectrum(usi)
# fetches the USI from the PeptideAtlas database or whatever database is specified
resp = spectrum.fetch('PeptideAtlas')
print(resp.code)
if resp.code == 'OK':
spectrum.show()
| [
6738,
27217,
1330,
27217,
201,
198,
6738,
14499,
49738,
6582,
33234,
7483,
1330,
14499,
49738,
6582,
33234,
7483,
201,
198,
201,
198,
2,
1294,
40,
2727,
201,
198,
385,
72,
796,
14499,
49738,
6582,
33234,
7483,
7203,
292,
7568,
25,
47,
55,
35,
830,
47915,
3712,
42995,
62,
25886,
282,
66,
26158,
62,
65,
20031,
62,
9527,
578,
62,
5332,
62,
69,
2931,
25,
35836,
25,
1558,
31046,
25,
47468,
14082,
2538,
9273,
53,
45529,
26236,
14,
17,
4943,
201,
198,
2,
514,
72,
796,
14499,
49738,
6582,
33234,
7483,
7203,
76,
89,
16684,
25,
47,
55,
35,
405,
1731,
2718,
25,
405,
30057,
62,
32,
3312,
62,
47,
405,
1314,
2414,
62,
33,
405,
36,
62,
32,
405,
62,
49,
16,
25,
35836,
25,
940,
50119,
25,
47,
8905,
51,
58,
2725,
14222,
78,
60,
2389,
3698,
29817,
42,
14,
17,
4943,
201,
198,
2,
514,
72,
796,
14499,
49738,
6582,
33234,
7483,
7203,
76,
89,
16684,
25,
47,
55,
35,
405,
3553,
1065,
3712,
4626,
16942,
62,
48192,
62,
8628,
28727,
62,
50,
4548,
64,
62,
40069,
62,
18,
24376,
55,
25,
35836,
25,
3553,
2780,
25,
10116,
3838,
11731,
1404,
16960,
1921,
2969,
38,
6968,
38,
10761,
14,
17,
4943,
201,
198,
385,
72,
13,
29572,
7,
19011,
577,
28,
25101,
8,
201,
198,
2,
611,
262,
1294,
40,
318,
8788,
788,
2251,
257,
10958,
1398,
284,
21207,
422,
262,
2691,
6831,
201,
198,
361,
514,
72,
13,
12102,
25,
201,
198,
220,
220,
220,
1303,
10958,
1398,
655,
2753,
287,
257,
1294,
40,
201,
198,
220,
220,
220,
10958,
796,
27217,
7,
385,
72,
8,
201,
198,
220,
220,
220,
1303,
11351,
2052,
262,
1294,
40,
422,
262,
2631,
457,
485,
2953,
21921,
6831,
393,
4232,
6831,
318,
7368,
201,
198,
220,
220,
220,
1217,
796,
10958,
13,
69,
7569,
10786,
6435,
457,
485,
2953,
21921,
11537,
201,
198,
220,
220,
220,
3601,
7,
4363,
13,
8189,
8,
201,
198,
220,
220,
220,
611,
1217,
13,
8189,
6624,
705,
11380,
10354,
201,
198,
220,
220,
220,
220,
220,
220,
220,
10958,
13,
12860,
3419,
201,
198,
220,
220,
220,
220,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198
] | 2.464674 | 368 |
"""Crop maps
"""
# pylint: disable=C0103
import os
import sys
import cartopy.crs as ccrs
import cartopy.io.shapereader as shpreader
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from vtra.utils import *
mpl.style.use('ggplot')
mpl.rcParams['font.size'] = 11.
mpl.rcParams['axes.labelsize'] = 14.
mpl.rcParams['xtick.labelsize'] = 11.
mpl.rcParams['ytick.labelsize'] = 11.
mpl.rcParams['savefig.pad_inches'] = 0.05
if __name__ == '__main__':
main()
| [
37811,
34,
1773,
8739,
198,
37811,
198,
2,
279,
2645,
600,
25,
15560,
28,
34,
486,
3070,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
6383,
11081,
13,
66,
3808,
355,
36624,
3808,
198,
11748,
6383,
11081,
13,
952,
13,
43358,
46862,
355,
427,
9681,
263,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
410,
9535,
13,
26791,
1330,
1635,
198,
198,
76,
489,
13,
7635,
13,
1904,
10786,
1130,
29487,
11537,
198,
76,
489,
13,
6015,
10044,
4105,
17816,
10331,
13,
7857,
20520,
796,
1367,
13,
198,
76,
489,
13,
6015,
10044,
4105,
17816,
897,
274,
13,
23912,
1424,
1096,
20520,
796,
1478,
13,
198,
76,
489,
13,
6015,
10044,
4105,
17816,
742,
624,
13,
23912,
1424,
1096,
20520,
796,
1367,
13,
198,
76,
489,
13,
6015,
10044,
4105,
17816,
20760,
624,
13,
23912,
1424,
1096,
20520,
796,
1367,
13,
198,
76,
489,
13,
6015,
10044,
4105,
17816,
21928,
5647,
13,
15636,
62,
45457,
20520,
796,
657,
13,
2713,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.435 | 200 |
from collections import defaultdict
import matplotlib.pyplot as plt
from boxes import generate_legend_handles, group_boxplot
from commons import WIDTH_IN
with open("data/hops.csv") as f:
ret = defaultdict(list)
for l in f.readlines()[1:]:
split = l.rstrip("\n").split(",")
# is datacenter?
if split[-1] == "1":
continue
# Hops, ASes
ret[split[0]].append((int(split[5]), int(split[6])))
grp = [
(continent, [("Hops", [x[0] for x in xs]), ("ASes", [x[1] for x in xs])])
for continent, xs in ret.items()
]
fig, ax = plt.subplots(figsize=(WIDTH_IN, 1.2))
ax, positions, props = group_boxplot(grp, ax, showfliers=False)
ax.set_yticks(range(0, 26, 5))
ax.set_ylabel("Path length")
ax.legend(
handles=generate_legend_handles(props),
handlelength=1,
labelspacing=0.06,
columnspacing=0.5,
handletextpad=0.3,
ncol=6,
fontsize="small",
loc="upper right",
fancybox=False,
edgecolor="k",
)
plt.grid(axis="y")
plt.subplots_adjust(top=0.99, bottom=0.17, left=0.14, right=0.99)
plt.savefig("figures/figure-7.pdf")
| [
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
10559,
1330,
7716,
62,
1455,
437,
62,
4993,
829,
11,
1448,
62,
3524,
29487,
198,
6738,
36523,
1330,
370,
2389,
4221,
62,
1268,
198,
198,
4480,
1280,
7203,
7890,
14,
21936,
13,
40664,
4943,
355,
277,
25,
198,
220,
220,
220,
1005,
796,
4277,
11600,
7,
4868,
8,
198,
220,
220,
220,
329,
300,
287,
277,
13,
961,
6615,
3419,
58,
16,
25,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
6626,
796,
300,
13,
81,
36311,
7203,
59,
77,
11074,
35312,
7,
2430,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
318,
4818,
330,
9255,
30,
198,
220,
220,
220,
220,
220,
220,
220,
611,
6626,
58,
12,
16,
60,
6624,
366,
16,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
367,
2840,
11,
7054,
274,
198,
220,
220,
220,
220,
220,
220,
220,
1005,
58,
35312,
58,
15,
60,
4083,
33295,
19510,
600,
7,
35312,
58,
20,
46570,
493,
7,
35312,
58,
21,
60,
22305,
198,
198,
2164,
79,
796,
685,
198,
220,
220,
220,
357,
3642,
7233,
11,
685,
7203,
39,
2840,
1600,
685,
87,
58,
15,
60,
329,
2124,
287,
2124,
82,
46570,
5855,
1921,
274,
1600,
685,
87,
58,
16,
60,
329,
2124,
287,
2124,
82,
12962,
12962,
198,
220,
220,
220,
329,
15549,
11,
2124,
82,
287,
1005,
13,
23814,
3419,
198,
60,
628,
198,
5647,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
7,
5647,
7857,
16193,
54,
2389,
4221,
62,
1268,
11,
352,
13,
17,
4008,
198,
897,
11,
6116,
11,
25744,
796,
1448,
62,
3524,
29487,
7,
2164,
79,
11,
7877,
11,
905,
2704,
3183,
28,
25101,
8,
198,
897,
13,
2617,
62,
20760,
3378,
7,
9521,
7,
15,
11,
2608,
11,
642,
4008,
198,
897,
13,
2617,
62,
2645,
9608,
7203,
15235,
4129,
4943,
198,
897,
13,
1455,
437,
7,
198,
220,
220,
220,
17105,
28,
8612,
378,
62,
1455,
437,
62,
4993,
829,
7,
1676,
862,
828,
198,
220,
220,
220,
5412,
13664,
28,
16,
11,
198,
220,
220,
220,
14722,
79,
4092,
28,
15,
13,
3312,
11,
198,
220,
220,
220,
5721,
2777,
4092,
28,
15,
13,
20,
11,
198,
220,
220,
220,
5412,
5239,
15636,
28,
15,
13,
18,
11,
198,
220,
220,
220,
299,
4033,
28,
21,
11,
198,
220,
220,
220,
10369,
7857,
2625,
17470,
1600,
198,
220,
220,
220,
1179,
2625,
45828,
826,
1600,
198,
220,
220,
220,
14996,
3524,
28,
25101,
11,
198,
220,
220,
220,
5743,
8043,
2625,
74,
1600,
198,
8,
198,
198,
489,
83,
13,
25928,
7,
22704,
2625,
88,
4943,
198,
489,
83,
13,
7266,
489,
1747,
62,
23032,
7,
4852,
28,
15,
13,
2079,
11,
4220,
28,
15,
13,
1558,
11,
1364,
28,
15,
13,
1415,
11,
826,
28,
15,
13,
2079,
8,
198,
489,
83,
13,
21928,
5647,
7203,
5647,
942,
14,
26875,
12,
22,
13,
12315,
4943,
198
] | 2.178082 | 511 |
"""
Created by adam on 5/31/18
"""
__author__ = 'adam'
import sqlite3
import environment
def get_all_words_in_tweet(tweetId, db):
"""
Returns all the words used in the tweet
Example:
words = get_all_words_in_tweet(331546674315014144, db=environment.TWEET_DB_NO_STOP)
words = [x[2] for x in words]
Result:
words = ['thought', 'crying',
'like', 'crazy',
'im', 'tired',
'pain','inevitability',
'rely', 'life',
'spoonie']
"""
conn = sqlite3.connect(db)
query = "SELECT * FROM word_map WHERE tweet_id = ?"
param = (tweetId, )
with conn:
r = conn.execute(query, param)
return r.fetchall()
if __name__ == '__main__':
pass | [
37811,
198,
41972,
416,
23197,
319,
642,
14,
3132,
14,
1507,
198,
37811,
198,
834,
9800,
834,
796,
705,
324,
321,
6,
198,
11748,
44161,
578,
18,
198,
11748,
2858,
628,
198,
4299,
651,
62,
439,
62,
10879,
62,
259,
62,
83,
7277,
7,
83,
7277,
7390,
11,
20613,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
477,
262,
2456,
973,
287,
262,
6126,
628,
220,
220,
220,
17934,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2456,
796,
651,
62,
439,
62,
10879,
62,
259,
62,
83,
7277,
7,
2091,
21526,
28933,
3559,
1314,
28645,
18444,
11,
20613,
28,
38986,
13,
51,
8845,
2767,
62,
11012,
62,
15285,
62,
2257,
3185,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2456,
796,
685,
87,
58,
17,
60,
329,
2124,
287,
2456,
60,
198,
220,
220,
220,
25414,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2456,
796,
37250,
28895,
3256,
705,
66,
14992,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
2339,
3256,
705,
50112,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
320,
3256,
705,
83,
1202,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35436,
41707,
500,
85,
34147,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
38015,
3256,
705,
6042,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
2777,
2049,
494,
20520,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
48260,
796,
44161,
578,
18,
13,
8443,
7,
9945,
8,
628,
220,
220,
220,
12405,
796,
366,
46506,
1635,
16034,
1573,
62,
8899,
33411,
6126,
62,
312,
796,
220,
1701,
198,
220,
220,
220,
5772,
796,
357,
83,
7277,
7390,
11,
1267,
198,
220,
220,
220,
351,
48260,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
48260,
13,
41049,
7,
22766,
11,
5772,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
374,
13,
69,
7569,
439,
3419,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1208
] | 2.182891 | 339 |
"""
Represents an optical Gaussian source.
"""
| [
37811,
198,
6207,
6629,
281,
18480,
12822,
31562,
2723,
13,
198,
37811,
198
] | 3.615385 | 13 |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#TOFILL
if __name__ == '__main__':
param = [
([2, 5, 7, 12, 13, 13, 15, 18, 20, 21, 22, 26, 27, 41, 41, 50, 53, 57, 58, 58, 61, 62, 62, 64, 70, 75, 78, 79, 81, 81, 81, 83, 86, 91, 93, 95, 97, 99, 99],36,35,),
([8, 16, 62, -24, 14, -4, 2, 50, -64, -76, 78, 66, -64, 18],12,11,),
([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],32,27,),
([50, 20, 79, 42, 85, 24, 20, 76, 36, 88, 40, 5, 24, 85, 7, 19, 43, 51, 94, 13, 53, 93, 92, 43, 97, 38, 80, 48, 52, 47, 77, 56, 41, 80, 32, 34, 77, 14, 70, 3],29,27,),
([-96, -94, -72, -58, -48, -36, -28, -26, -10, -10, -8, -8, -6, 2, 14, 30, 30, 54, 58, 60, 64, 68, 78, 84, 96, 98],16,18,),
([1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],7,8,),
([2, 7, 8, 15, 18, 23, 24, 25, 27, 35, 40, 42, 43, 46, 48, 50, 53, 64, 66, 69, 70, 71, 72, 77, 78, 80, 81, 81, 81, 82, 82, 82, 84, 87, 97, 98],23,32,),
([46, 54, 24, -10],3,3,),
([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],21,34,),
([39, 21, 38, 6, 38, 44, 96, 1, 16, 1, 28, 4, 55, 8],12,11,)
]
n_success = 0
for i, parameters_set in enumerate(param):
if f_filled(*parameters_set) == f_gold(*parameters_set):
n_success+=1
print("#Results: %i, %i" % (n_success, len(param))) | [
2,
15069,
357,
66,
8,
13130,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
2,
628,
198,
2,
10468,
37,
8267,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
5772,
796,
685,
198,
220,
220,
220,
29565,
17,
11,
642,
11,
767,
11,
1105,
11,
1511,
11,
1511,
11,
1315,
11,
1248,
11,
1160,
11,
2310,
11,
2534,
11,
2608,
11,
2681,
11,
6073,
11,
6073,
11,
2026,
11,
7192,
11,
7632,
11,
7618,
11,
7618,
11,
8454,
11,
8190,
11,
8190,
11,
5598,
11,
4317,
11,
5441,
11,
8699,
11,
9225,
11,
9773,
11,
9773,
11,
9773,
11,
9698,
11,
9849,
11,
10495,
11,
10261,
11,
6957,
11,
10111,
11,
7388,
11,
7388,
4357,
2623,
11,
2327,
11,
828,
198,
220,
220,
220,
29565,
23,
11,
1467,
11,
8190,
11,
532,
1731,
11,
1478,
11,
532,
19,
11,
362,
11,
2026,
11,
532,
2414,
11,
532,
4304,
11,
8699,
11,
7930,
11,
532,
2414,
11,
1248,
4357,
1065,
11,
1157,
11,
828,
198,
220,
220,
220,
29565,
15,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
4357,
2624,
11,
1983,
11,
828,
198,
220,
220,
220,
29565,
1120,
11,
1160,
11,
9225,
11,
5433,
11,
7600,
11,
1987,
11,
1160,
11,
8684,
11,
4570,
11,
9193,
11,
2319,
11,
642,
11,
1987,
11,
7600,
11,
767,
11,
678,
11,
5946,
11,
6885,
11,
10048,
11,
1511,
11,
7192,
11,
10261,
11,
10190,
11,
5946,
11,
10111,
11,
4353,
11,
4019,
11,
4764,
11,
6740,
11,
6298,
11,
8541,
11,
7265,
11,
6073,
11,
4019,
11,
3933,
11,
4974,
11,
8541,
11,
1478,
11,
4317,
11,
513,
4357,
1959,
11,
1983,
11,
828,
198,
220,
220,
220,
29565,
12,
4846,
11,
532,
5824,
11,
532,
4761,
11,
532,
3365,
11,
532,
2780,
11,
532,
2623,
11,
532,
2078,
11,
532,
2075,
11,
532,
940,
11,
532,
940,
11,
532,
23,
11,
532,
23,
11,
532,
21,
11,
362,
11,
1478,
11,
1542,
11,
1542,
11,
7175,
11,
7618,
11,
3126,
11,
5598,
11,
8257,
11,
8699,
11,
9508,
11,
9907,
11,
9661,
4357,
1433,
11,
1507,
11,
828,
198,
220,
220,
220,
29565,
16,
11,
657,
11,
352,
11,
352,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
657,
11,
657,
4357,
22,
11,
23,
11,
828,
198,
220,
220,
220,
29565,
17,
11,
767,
11,
807,
11,
1315,
11,
1248,
11,
2242,
11,
1987,
11,
1679,
11,
2681,
11,
3439,
11,
2319,
11,
5433,
11,
5946,
11,
6337,
11,
4764,
11,
2026,
11,
7192,
11,
5598,
11,
7930,
11,
8644,
11,
4317,
11,
9166,
11,
7724,
11,
8541,
11,
8699,
11,
4019,
11,
9773,
11,
9773,
11,
9773,
11,
9415,
11,
9415,
11,
9415,
11,
9508,
11,
10083,
11,
10111,
11,
9661,
4357,
1954,
11,
2624,
11,
828,
198,
220,
220,
220,
29565,
3510,
11,
7175,
11,
1987,
11,
532,
940,
4357,
18,
11,
18,
11,
828,
198,
220,
220,
220,
29565,
15,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
11,
352,
4357,
2481,
11,
2682,
11,
828,
198,
220,
220,
220,
29565,
2670,
11,
2310,
11,
4353,
11,
718,
11,
4353,
11,
5846,
11,
9907,
11,
352,
11,
1467,
11,
352,
11,
2579,
11,
604,
11,
5996,
11,
807,
4357,
1065,
11,
1157,
35751,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
198,
220,
220,
220,
299,
62,
13138,
796,
657,
198,
220,
220,
220,
329,
1312,
11,
10007,
62,
2617,
287,
27056,
378,
7,
17143,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
277,
62,
20286,
46491,
17143,
7307,
62,
2617,
8,
6624,
277,
62,
24267,
46491,
17143,
7307,
62,
2617,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
62,
13138,
47932,
16,
198,
220,
220,
220,
3601,
7203,
2,
25468,
25,
4064,
72,
11,
4064,
72,
1,
4064,
357,
77,
62,
13138,
11,
18896,
7,
17143,
22305
] | 1.898689 | 839 |
"""Events."""
import asyncio
import networkx
from aocrecs.cache import cached
from aocrecs.util import by_key
def get_sides(matches, participants):
"""Get users per side given matches."""
users = {}
for match in matches:
users.update({
p['user_id']: dict(
id=p['user_id'],
name=p['user_name'] or p['name'],
platform_id=p['platform_id']
) for p in match['players']
})
return [
dict(p, users=[users[u] for u in p['user_ids'] if u])
for p in compute_participants(matches, participants)
]
async def get_series(database, series_id):
"""Get a series."""
series_query = """
select series.id, series.played, series_metadata.name, rounds.tournament_id, tournaments.id as tournament_id,
tournaments.name as tournament_name, events.id as event_id, events.name as event_name
from series join rounds on series.round_id=rounds.id join series_metadata on series.id=series_metadata.series_id
join tournaments on rounds.tournament_id=tournaments.id
join events on tournaments.event_id=events.id
where series.id=:id
"""
participants_query = 'select series_id, name, score, winner from participants where series_id=:id'
matches_query = 'select id, series_id from matches where series_id=:id'
values = {'id': series_id}
series, participants, matches = await asyncio.gather(
database.fetch_one(series_query, values=values),
database.fetch_all(participants_query, values=values),
database.fetch_all(matches_query, values=values)
)
return dict(
series,
participants=list(map(dict, participants)),
match_ids=list(map(lambda m: m['id'], matches)),
tournament=dict(
id=series['tournament_id'],
name=series['tournament_name'],
event=dict(
id=series['event_id'],
name=series['event_name']
)
)
)
@cached(ttl=86400)
async def get_event(database, event_id):
"""Get an event."""
events_query = 'select id, name, year from events where id=:event_id'
tournaments_query = 'select id, event_id, name from tournaments where event_id=:event_id'
series_query = """
select
series.id, series.played, series_metadata.name, rounds.tournament_id
from series
join rounds on series.round_id=rounds.id
join tournaments on rounds.tournament_id=tournaments.id
join series_metadata on series.id=series_metadata.series_id
where tournaments.event_id=:event_id
order by series.id
"""
participants_query = """
select series_id, participants.name, score, winner
from participants
join series on participants.series_id=series.id
join rounds on series.round_id=rounds.id
join tournaments on rounds.tournament_id=tournaments.id
where tournaments.event_id=:event_id
"""
maps_query = """
select
map_name, avg(matches.duration)::interval(0) as avg_duration, count(distinct match_id) as matches, max(players.dataset_id) as dataset_id,
round(count(distinct match_id)/(select count(*) from matches where event_id=:event_id)::numeric, 2) as played_percent,
mode() within group (order by civilizations.id) as most_played_civ_id,
mode() within group (order by civilizations.name) as most_played_civ_name
from players
join civilizations on civilizations.dataset_id=players.dataset_id and civilizations.id = players.civilization_id
join matches on players.match_id=matches.id
where event_id=:event_id
group by map_name
order by count(distinct match_id) desc
"""
players_query = """
select
max(players.name) as name, max(players.platform_id) as platform_id, max(user_id) as user_id,
max(people.id) as person_id, max(people.name) as person_name, max(people.country) as country,
count(*) as matches, round(sum(players.winner::int)/count(*)::numeric, 2) as win_percent,
max(matches.dataset_id) as dataset_id,
avg(matches.duration)::interval(0) as avg_duration,
mode() within group (order by civilizations.id) as most_played_civ_id,
mode() within group (order by civilizations.name) as most_played_civ_name,
mode() within group (order by matches.map_name) as most_played_map
from players
join civilizations on civilizations.dataset_id=players.dataset_id and civilizations.id = players.civilization_id
join matches on players.match_id=matches.id
left join users on players.platform_id=users.platform_id and players.user_id=users.id
left join people on users.person_id=people.id
where event_id=:event_id
group by case when people.id is not null then people.id::varchar else players.name end
order by count(*) desc, sum(players.winner::int)/count(*)::numeric desc
"""
civilizations_query = """
select
civilizations.id, civilizations.name, avg(matches.duration)::interval(0) as avg_duration,
count(distinct match_id) as matches, max(players.dataset_id) as dataset_id,
count(*) as matches, round(sum(players.winner::int)/count(*)::numeric, 2) as win_percent,
mode() within group (order by matches.map_name) as most_played_map
from players
join civilizations on civilizations.dataset_id=players.dataset_id and civilizations.id = players.civilization_id
join matches on players.match_id=matches.id
where event_id=:event_id
group by civilizations.id, civilizations.name
order by count(distinct match_id) desc
;
"""
event, tournaments, series, maps, civilizations, players, participants = await asyncio.gather(
database.fetch_one(events_query, values={'event_id': event_id}),
database.fetch_all(tournaments_query, values={'event_id': event_id}),
database.fetch_all(series_query, values={'event_id': event_id}),
database.fetch_all(maps_query, values={'event_id': event_id}),
database.fetch_all(civilizations_query, values={'event_id': event_id}),
database.fetch_all(players_query, values={'event_id': event_id}),
database.fetch_all(participants_query, values={'event_id': event_id})
)
series_data = by_key(series, 'tournament_id')
participant_data = by_key(participants, 'series_id')
return dict(
event,
maps=[
dict(
map=dict(
name=m['map_name']
),
average_duration=m['avg_duration'],
match_count=m['matches'],
played_percent=m['played_percent'],
most_played_civilization=dict(
id=m['most_played_civ_id'],
name=m['most_played_civ_name'],
dataset_id=m['dataset_id']
)
) for m in maps
],
civilizations=[
dict(
civilization=dict(
id=c['id'],
name=c['name'],
dataset_id=c['dataset_id']
),
average_duration=c['avg_duration'],
match_count=c['matches'],
win_percent=c['win_percent'],
most_played_map=c['most_played_map']
) for c in civilizations
],
players=[
dict(
player=dict(
name=player['name'],
user=dict(
id=player['user_id'],
name=player['name'],
platform_id=player['platform_id'],
person=dict(
id=player['person_id'],
country=player['country'],
name=player['person_name']
) if player['person_id'] else None
) if player['user_id'] else None
),
match_count=player['matches'],
win_percent=player['win_percent'],
average_duration=player['avg_duration'],
most_played_map=player['most_played_map'],
most_played_civilization=dict(
id=player['most_played_civ_id'],
name=player['most_played_civ_name'],
dataset_id=player['dataset_id']
)
) for player in players
],
tournaments=[dict(
tournament,
series=[dict(
series_,
participants=participant_data[series_['id']],
) for series_ in series_data[tournament['id']]]
) for tournament in tournaments]
)
@cached(warm=True, ttl=86400)
async def get_events(database):
"""Get events."""
events_query = 'select id, name, year from events order by year, name'
events = await database.fetch_all(events_query)
return [dict(e) for e in events]
def compute_participants(matches, challonge_data):
"""Compute series participants.
Iterate all matches and players to create a graph.
Apply connected components algorithm to resolve distinct
participant groups over all matches.
Sort participant groups by number of wins to correlate
with Challonge participant data (which also includes number
of wins).
Note that edge cases exist that are not covered. For example,
teams sometimes field a 1v1 player for a single match. If neither
player in the 1v1 match takes part in any other matches,
the players can't be placed in a participant group and their win
is not counted. There are two consequences:
1. Not counting a win may make the number of wins between
participants even, in which case we don't know which
participant group won the series.
2. Not grouping a player means the participant player list
will be incomplete.
"""
graph = networkx.DiGraph()
win_id = 0
platform_ids = []
name_to_user = {}
for match in matches:
# Record a win
win_id += 1
graph.add_node(win_id, type='win')
# Record platform ID
platform_ids.append(match['platform_id'])
# Add node for each player
for player in match['players']:
name_to_user[player['name']] = player['user_id']
graph.add_node(player['name'], type='player')
# Can happen for incomplete matches
if match['winning_team'] is None:
continue
# Connect winning players to recorded win
for player in match['winning_team']['players']:
graph.add_edge(player['name'], win_id)
# Connect all players on the same team
for team in match['teams']:
for i in team['players']:
for j in team['players']:
graph.add_edge(i['name'], j['name'])
mgz_data = [{
'wins': len([node for node in g if graph.nodes[node]['type'] == 'win']),
'players': [node for node in g if graph.nodes[node]['type'] == 'player']
} for g in networkx.weakly_connected_components(graph)]
return [{
'user_ids': [name_to_user[n] for n in mgz['players']],
'winner': challonge['winner'],
'name': challonge['name'],
'score': challonge['score'],
'platform_id': platform_ids[0]
} for mgz, challonge in zip(
sorted(mgz_data, key=lambda k: -1 * k['wins']),
sorted(challonge_data, key=lambda k: -1 * k['score'] if k['score'] else 0)
)]
| [
37811,
37103,
526,
15931,
198,
11748,
30351,
952,
198,
198,
11748,
3127,
87,
198,
6738,
257,
27945,
6359,
13,
23870,
1330,
39986,
198,
6738,
257,
27945,
6359,
13,
22602,
1330,
416,
62,
2539,
628,
198,
4299,
651,
62,
82,
1460,
7,
6759,
2052,
11,
6809,
2599,
198,
220,
220,
220,
37227,
3855,
2985,
583,
1735,
1813,
7466,
526,
15931,
198,
220,
220,
220,
2985,
796,
23884,
198,
220,
220,
220,
329,
2872,
287,
7466,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2985,
13,
19119,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
17816,
7220,
62,
312,
6,
5974,
8633,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
79,
17816,
7220,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
79,
17816,
7220,
62,
3672,
20520,
393,
279,
17816,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3859,
62,
312,
28,
79,
17816,
24254,
62,
312,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
329,
279,
287,
2872,
17816,
32399,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
32092,
198,
220,
220,
220,
1441,
685,
198,
220,
220,
220,
220,
220,
220,
220,
8633,
7,
79,
11,
2985,
41888,
18417,
58,
84,
60,
329,
334,
287,
279,
17816,
7220,
62,
2340,
20520,
611,
334,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
329,
279,
287,
24061,
62,
48013,
1187,
7,
6759,
2052,
11,
6809,
8,
198,
220,
220,
220,
2361,
628,
198,
292,
13361,
825,
651,
62,
25076,
7,
48806,
11,
2168,
62,
312,
2599,
198,
220,
220,
220,
37227,
3855,
257,
2168,
526,
15931,
198,
220,
220,
220,
2168,
62,
22766,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
2168,
13,
312,
11,
2168,
13,
21542,
11,
2168,
62,
38993,
13,
3672,
11,
9196,
13,
83,
5138,
62,
312,
11,
18130,
13,
312,
355,
7756,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
18130,
13,
3672,
355,
7756,
62,
3672,
11,
2995,
13,
312,
355,
1785,
62,
312,
11,
2995,
13,
3672,
355,
1785,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
422,
2168,
4654,
9196,
319,
2168,
13,
744,
62,
312,
28,
744,
82,
13,
312,
4654,
2168,
62,
38993,
319,
2168,
13,
312,
28,
25076,
62,
38993,
13,
25076,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
18130,
319,
9196,
13,
83,
5138,
62,
312,
28,
83,
16950,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
2995,
319,
18130,
13,
15596,
62,
312,
28,
31534,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
810,
2168,
13,
312,
28,
25,
312,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6809,
62,
22766,
796,
705,
19738,
2168,
62,
312,
11,
1438,
11,
4776,
11,
8464,
422,
6809,
810,
2168,
62,
312,
28,
25,
312,
6,
198,
220,
220,
220,
7466,
62,
22766,
796,
705,
19738,
4686,
11,
2168,
62,
312,
422,
7466,
810,
2168,
62,
312,
28,
25,
312,
6,
198,
220,
220,
220,
3815,
796,
1391,
6,
312,
10354,
2168,
62,
312,
92,
198,
220,
220,
220,
2168,
11,
6809,
11,
7466,
796,
25507,
30351,
952,
13,
70,
1032,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
505,
7,
25076,
62,
22766,
11,
3815,
28,
27160,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
48013,
1187,
62,
22766,
11,
3815,
28,
27160,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
6759,
2052,
62,
22766,
11,
3815,
28,
27160,
8,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1441,
8633,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2168,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6809,
28,
4868,
7,
8899,
7,
11600,
11,
6809,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
2872,
62,
2340,
28,
4868,
7,
8899,
7,
50033,
285,
25,
285,
17816,
312,
6,
4357,
7466,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
7756,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
25076,
17816,
83,
5138,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
25076,
17816,
83,
5138,
62,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1785,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
25076,
17816,
15596,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
25076,
17816,
15596,
62,
3672,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
1267,
628,
198,
31,
66,
2317,
7,
926,
75,
28,
39570,
405,
8,
198,
292,
13361,
825,
651,
62,
15596,
7,
48806,
11,
1785,
62,
312,
2599,
198,
220,
220,
220,
37227,
3855,
281,
1785,
526,
15931,
198,
220,
220,
220,
2995,
62,
22766,
796,
705,
19738,
4686,
11,
1438,
11,
614,
422,
2995,
810,
4686,
28,
25,
15596,
62,
312,
6,
198,
220,
220,
220,
18130,
62,
22766,
796,
705,
19738,
4686,
11,
1785,
62,
312,
11,
1438,
422,
18130,
810,
1785,
62,
312,
28,
25,
15596,
62,
312,
6,
198,
220,
220,
220,
2168,
62,
22766,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2168,
13,
312,
11,
2168,
13,
21542,
11,
2168,
62,
38993,
13,
3672,
11,
9196,
13,
83,
5138,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
422,
2168,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4654,
9196,
319,
2168,
13,
744,
62,
312,
28,
744,
82,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4654,
18130,
319,
9196,
13,
83,
5138,
62,
312,
28,
83,
16950,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4654,
2168,
62,
38993,
319,
2168,
13,
312,
28,
25076,
62,
38993,
13,
25076,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
810,
18130,
13,
15596,
62,
312,
28,
25,
15596,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1502,
416,
2168,
13,
312,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6809,
62,
22766,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
2168,
62,
312,
11,
6809,
13,
3672,
11,
4776,
11,
8464,
198,
220,
220,
220,
220,
220,
220,
220,
422,
6809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4654,
2168,
319,
6809,
13,
25076,
62,
312,
28,
25076,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4654,
9196,
319,
2168,
13,
744,
62,
312,
28,
744,
82,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4654,
18130,
319,
9196,
13,
83,
5138,
62,
312,
28,
83,
16950,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
810,
18130,
13,
15596,
62,
312,
28,
25,
15596,
62,
312,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8739,
62,
22766,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
3672,
11,
42781,
7,
6759,
2052,
13,
32257,
2599,
25,
3849,
2100,
7,
15,
8,
355,
42781,
62,
32257,
11,
954,
7,
17080,
4612,
2872,
62,
312,
8,
355,
7466,
11,
3509,
7,
32399,
13,
19608,
292,
316,
62,
312,
8,
355,
27039,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2835,
7,
9127,
7,
17080,
4612,
2872,
62,
312,
20679,
7,
19738,
954,
7,
28104,
422,
7466,
810,
1785,
62,
312,
28,
25,
15596,
62,
312,
2599,
25,
77,
39223,
11,
362,
8,
355,
2826,
62,
25067,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4235,
3419,
1626,
1448,
357,
2875,
416,
35928,
13,
312,
8,
355,
749,
62,
21542,
62,
66,
452,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4235,
3419,
1626,
1448,
357,
2875,
416,
35928,
13,
3672,
8,
355,
749,
62,
21542,
62,
66,
452,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
422,
1938,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
35928,
319,
35928,
13,
19608,
292,
316,
62,
312,
28,
32399,
13,
19608,
292,
316,
62,
312,
290,
35928,
13,
312,
796,
1938,
13,
37636,
1634,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
7466,
319,
1938,
13,
15699,
62,
312,
28,
6759,
2052,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
810,
1785,
62,
312,
28,
25,
15596,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
416,
3975,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
1502,
416,
954,
7,
17080,
4612,
2872,
62,
312,
8,
1715,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1938,
62,
22766,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
32399,
13,
3672,
8,
355,
1438,
11,
3509,
7,
32399,
13,
24254,
62,
312,
8,
355,
3859,
62,
312,
11,
3509,
7,
7220,
62,
312,
8,
355,
2836,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
15332,
13,
312,
8,
355,
1048,
62,
312,
11,
3509,
7,
15332,
13,
3672,
8,
355,
1048,
62,
3672,
11,
3509,
7,
15332,
13,
19315,
8,
355,
1499,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
7,
28104,
355,
7466,
11,
2835,
7,
16345,
7,
32399,
13,
39791,
3712,
600,
20679,
9127,
46491,
2599,
25,
77,
39223,
11,
362,
8,
355,
1592,
62,
25067,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
6759,
2052,
13,
19608,
292,
316,
62,
312,
8,
355,
27039,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42781,
7,
6759,
2052,
13,
32257,
2599,
25,
3849,
2100,
7,
15,
8,
355,
42781,
62,
32257,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4235,
3419,
1626,
1448,
357,
2875,
416,
35928,
13,
312,
8,
355,
749,
62,
21542,
62,
66,
452,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4235,
3419,
1626,
1448,
357,
2875,
416,
35928,
13,
3672,
8,
355,
749,
62,
21542,
62,
66,
452,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4235,
3419,
1626,
1448,
357,
2875,
416,
7466,
13,
8899,
62,
3672,
8,
355,
749,
62,
21542,
62,
8899,
198,
220,
220,
220,
220,
220,
220,
220,
422,
1938,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
35928,
319,
35928,
13,
19608,
292,
316,
62,
312,
28,
32399,
13,
19608,
292,
316,
62,
312,
290,
35928,
13,
312,
796,
1938,
13,
37636,
1634,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
7466,
319,
1938,
13,
15699,
62,
312,
28,
6759,
2052,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1364,
4654,
2985,
319,
1938,
13,
24254,
62,
312,
28,
18417,
13,
24254,
62,
312,
290,
1938,
13,
7220,
62,
312,
28,
18417,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1364,
4654,
661,
319,
2985,
13,
6259,
62,
312,
28,
15332,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
810,
1785,
62,
312,
28,
25,
15596,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
416,
1339,
618,
661,
13,
312,
318,
407,
9242,
788,
661,
13,
312,
3712,
85,
998,
283,
2073,
1938,
13,
3672,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1502,
416,
954,
7,
28104,
1715,
11,
2160,
7,
32399,
13,
39791,
3712,
600,
20679,
9127,
46491,
2599,
25,
77,
39223,
1715,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
35928,
62,
22766,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35928,
13,
312,
11,
35928,
13,
3672,
11,
42781,
7,
6759,
2052,
13,
32257,
2599,
25,
3849,
2100,
7,
15,
8,
355,
42781,
62,
32257,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
7,
17080,
4612,
2872,
62,
312,
8,
355,
7466,
11,
3509,
7,
32399,
13,
19608,
292,
316,
62,
312,
8,
355,
27039,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
7,
28104,
355,
7466,
11,
2835,
7,
16345,
7,
32399,
13,
39791,
3712,
600,
20679,
9127,
46491,
2599,
25,
77,
39223,
11,
362,
8,
355,
1592,
62,
25067,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4235,
3419,
1626,
1448,
357,
2875,
416,
7466,
13,
8899,
62,
3672,
8,
355,
749,
62,
21542,
62,
8899,
198,
220,
220,
220,
220,
220,
220,
220,
422,
1938,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
35928,
319,
35928,
13,
19608,
292,
316,
62,
312,
28,
32399,
13,
19608,
292,
316,
62,
312,
290,
35928,
13,
312,
796,
1938,
13,
37636,
1634,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
4654,
7466,
319,
1938,
13,
15699,
62,
312,
28,
6759,
2052,
13,
312,
198,
220,
220,
220,
220,
220,
220,
220,
810,
1785,
62,
312,
28,
25,
15596,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
416,
35928,
13,
312,
11,
35928,
13,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
1502,
416,
954,
7,
17080,
4612,
2872,
62,
312,
8,
1715,
198,
26,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1785,
11,
18130,
11,
2168,
11,
8739,
11,
35928,
11,
1938,
11,
6809,
796,
25507,
30351,
952,
13,
70,
1032,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
505,
7,
31534,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
92,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
83,
16950,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
92,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
25076,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
92,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
31803,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
92,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
37636,
4582,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
92,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
32399,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
92,
828,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
13,
69,
7569,
62,
439,
7,
48013,
1187,
62,
22766,
11,
3815,
34758,
6,
15596,
62,
312,
10354,
1785,
62,
312,
30072,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
2168,
62,
7890,
796,
416,
62,
2539,
7,
25076,
11,
705,
83,
5138,
62,
312,
11537,
198,
220,
220,
220,
18399,
62,
7890,
796,
416,
62,
2539,
7,
48013,
1187,
11,
705,
25076,
62,
312,
11537,
198,
220,
220,
220,
1441,
8633,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
11,
198,
220,
220,
220,
220,
220,
220,
220,
8739,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3975,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
76,
17816,
8899,
62,
3672,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2811,
62,
32257,
28,
76,
17816,
615,
70,
62,
32257,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2872,
62,
9127,
28,
76,
17816,
6759,
2052,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2826,
62,
25067,
28,
76,
17816,
21542,
62,
25067,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
749,
62,
21542,
62,
37636,
1634,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
76,
17816,
1712,
62,
21542,
62,
66,
452,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
76,
17816,
1712,
62,
21542,
62,
66,
452,
62,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27039,
62,
312,
28,
76,
17816,
19608,
292,
316,
62,
312,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
329,
285,
287,
8739,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
35928,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14355,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
66,
17816,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
66,
17816,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27039,
62,
312,
28,
66,
17816,
19608,
292,
316,
62,
312,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2811,
62,
32257,
28,
66,
17816,
615,
70,
62,
32257,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2872,
62,
9127,
28,
66,
17816,
6759,
2052,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1592,
62,
25067,
28,
66,
17816,
5404,
62,
25067,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
749,
62,
21542,
62,
8899,
28,
66,
17816,
1712,
62,
21542,
62,
8899,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
329,
269,
287,
35928,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
1938,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2137,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
7829,
17816,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2836,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
7829,
17816,
7220,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
7829,
17816,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3859,
62,
312,
28,
7829,
17816,
24254,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1048,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
7829,
17816,
6259,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1499,
28,
7829,
17816,
19315,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
7829,
17816,
6259,
62,
3672,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
611,
2137,
17816,
6259,
62,
312,
20520,
2073,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
611,
2137,
17816,
7220,
62,
312,
20520,
2073,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2872,
62,
9127,
28,
7829,
17816,
6759,
2052,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1592,
62,
25067,
28,
7829,
17816,
5404,
62,
25067,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2811,
62,
32257,
28,
7829,
17816,
615,
70,
62,
32257,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
749,
62,
21542,
62,
8899,
28,
7829,
17816,
1712,
62,
21542,
62,
8899,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
749,
62,
21542,
62,
37636,
1634,
28,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
7829,
17816,
1712,
62,
21542,
62,
66,
452,
62,
312,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
7829,
17816,
1712,
62,
21542,
62,
66,
452,
62,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27039,
62,
312,
28,
7829,
17816,
19608,
292,
316,
62,
312,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
329,
2137,
287,
1938,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
18130,
41888,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7756,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2168,
41888,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2168,
62,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6809,
28,
48013,
415,
62,
7890,
58,
25076,
62,
17816,
312,
20520,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
329,
2168,
62,
287,
2168,
62,
7890,
58,
83,
5138,
17816,
312,
6,
11907,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
329,
7756,
287,
18130,
60,
198,
220,
220,
220,
1267,
628,
198,
31,
66,
2317,
7,
31975,
28,
17821,
11,
256,
28781,
28,
39570,
405,
8,
198,
292,
13361,
825,
651,
62,
31534,
7,
48806,
2599,
198,
220,
220,
220,
37227,
3855,
2995,
526,
15931,
198,
220,
220,
220,
2995,
62,
22766,
796,
705,
19738,
4686,
11,
1438,
11,
614,
422,
2995,
1502,
416,
614,
11,
1438,
6,
198,
220,
220,
220,
2995,
796,
25507,
6831,
13,
69,
7569,
62,
439,
7,
31534,
62,
22766,
8,
198,
220,
220,
220,
1441,
685,
11600,
7,
68,
8,
329,
304,
287,
2995,
60,
628,
198,
4299,
24061,
62,
48013,
1187,
7,
6759,
2052,
11,
2532,
14220,
62,
7890,
2599,
198,
220,
220,
220,
37227,
7293,
1133,
2168,
6809,
13,
628,
220,
220,
220,
40806,
378,
477,
7466,
290,
1938,
284,
2251,
257,
4823,
13,
198,
220,
220,
220,
27967,
5884,
6805,
11862,
284,
10568,
7310,
198,
220,
220,
220,
18399,
2628,
625,
477,
7466,
13,
628,
220,
220,
220,
33947,
18399,
2628,
416,
1271,
286,
7864,
284,
39684,
198,
220,
220,
220,
351,
10772,
14220,
18399,
1366,
357,
4758,
635,
3407,
1271,
198,
220,
220,
220,
286,
7864,
737,
628,
220,
220,
220,
5740,
326,
5743,
2663,
2152,
326,
389,
407,
5017,
13,
1114,
1672,
11,
198,
220,
220,
220,
3466,
3360,
2214,
257,
352,
85,
16,
2137,
329,
257,
2060,
2872,
13,
1002,
6159,
198,
220,
220,
220,
2137,
287,
262,
352,
85,
16,
2872,
2753,
636,
287,
597,
584,
7466,
11,
198,
220,
220,
220,
262,
1938,
460,
470,
307,
4624,
287,
257,
18399,
1448,
290,
511,
1592,
198,
220,
220,
220,
318,
407,
14789,
13,
1318,
389,
734,
6948,
25,
628,
220,
220,
220,
352,
13,
1892,
14143,
257,
1592,
743,
787,
262,
1271,
286,
7864,
1022,
198,
220,
220,
220,
220,
220,
220,
6809,
772,
11,
287,
543,
1339,
356,
836,
470,
760,
543,
198,
220,
220,
220,
220,
220,
220,
18399,
1448,
1839,
262,
2168,
13,
198,
220,
220,
220,
362,
13,
1892,
36115,
257,
2137,
1724,
262,
18399,
2137,
1351,
198,
220,
220,
220,
220,
220,
220,
481,
307,
17503,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4823,
796,
3127,
87,
13,
18683,
37065,
3419,
198,
220,
220,
220,
1592,
62,
312,
796,
657,
198,
220,
220,
220,
3859,
62,
2340,
796,
17635,
198,
220,
220,
220,
1438,
62,
1462,
62,
7220,
796,
23884,
198,
220,
220,
220,
329,
2872,
287,
7466,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13266,
257,
1592,
198,
220,
220,
220,
220,
220,
220,
220,
1592,
62,
312,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
4823,
13,
2860,
62,
17440,
7,
5404,
62,
312,
11,
2099,
11639,
5404,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
13266,
3859,
4522,
198,
220,
220,
220,
220,
220,
220,
220,
3859,
62,
2340,
13,
33295,
7,
15699,
17816,
24254,
62,
312,
6,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
10139,
329,
1123,
2137,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2137,
287,
2872,
17816,
32399,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
1462,
62,
7220,
58,
7829,
17816,
3672,
6,
11907,
796,
2137,
17816,
7220,
62,
312,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4823,
13,
2860,
62,
17440,
7,
7829,
17816,
3672,
6,
4357,
2099,
11639,
7829,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1680,
1645,
329,
17503,
7466,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2872,
17816,
14463,
62,
15097,
20520,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
8113,
5442,
1938,
284,
6264,
1592,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2137,
287,
2872,
17816,
14463,
62,
15097,
6,
7131,
6,
32399,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4823,
13,
2860,
62,
14907,
7,
7829,
17816,
3672,
6,
4357,
1592,
62,
312,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
8113,
477,
1938,
319,
262,
976,
1074,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1074,
287,
2872,
17816,
660,
4105,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
1074,
17816,
32399,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
1074,
17816,
32399,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4823,
13,
2860,
62,
14907,
7,
72,
17816,
3672,
6,
4357,
474,
17816,
3672,
6,
12962,
628,
220,
220,
220,
10527,
89,
62,
7890,
796,
685,
90,
198,
220,
220,
220,
220,
220,
220,
220,
705,
86,
1040,
10354,
18896,
26933,
17440,
329,
10139,
287,
308,
611,
4823,
13,
77,
4147,
58,
17440,
7131,
6,
4906,
20520,
6624,
705,
5404,
20520,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
32399,
10354,
685,
17440,
329,
10139,
287,
308,
611,
4823,
13,
77,
4147,
58,
17440,
7131,
6,
4906,
20520,
6624,
705,
7829,
20520,
198,
220,
220,
220,
1782,
329,
308,
287,
3127,
87,
13,
38695,
306,
62,
15236,
62,
5589,
3906,
7,
34960,
15437,
628,
220,
220,
220,
1441,
685,
90,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7220,
62,
2340,
10354,
685,
3672,
62,
1462,
62,
7220,
58,
77,
60,
329,
299,
287,
10527,
89,
17816,
32399,
20520,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
39791,
10354,
2532,
14220,
17816,
39791,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
3672,
10354,
2532,
14220,
17816,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
26675,
10354,
2532,
14220,
17816,
26675,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
24254,
62,
312,
10354,
3859,
62,
2340,
58,
15,
60,
198,
220,
220,
220,
1782,
329,
10527,
89,
11,
2532,
14220,
287,
19974,
7,
198,
220,
220,
220,
220,
220,
220,
220,
23243,
7,
11296,
89,
62,
7890,
11,
1994,
28,
50033,
479,
25,
532,
16,
1635,
479,
17816,
86,
1040,
20520,
828,
198,
220,
220,
220,
220,
220,
220,
220,
23243,
7,
36747,
14220,
62,
7890,
11,
1994,
28,
50033,
479,
25,
532,
16,
1635,
479,
17816,
26675,
20520,
611,
479,
17816,
26675,
20520,
2073,
657,
8,
198,
220,
220,
220,
48600,
198
] | 2.264198 | 5,212 |
# Coneversiones de unidades
import struct
import binascii
| [
2,
327,
505,
9641,
274,
390,
555,
312,
2367,
198,
11748,
2878,
198,
11748,
9874,
292,
979,
72,
198
] | 3.052632 | 19 |
# MiniPlayerViewWidget.py
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import sys, subprocess, time, threading, datetime, os, mutagen
from _prefs import miniplayer_coversize, cmus_remote_cmd, player_coversize
coversize = miniplayer_coversize
| [
2,
12558,
14140,
7680,
38300,
13,
9078,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
198,
198,
11748,
25064,
11,
850,
14681,
11,
640,
11,
4704,
278,
11,
4818,
8079,
11,
28686,
11,
4517,
11286,
198,
198,
6738,
4808,
3866,
9501,
1330,
9927,
7829,
62,
1073,
690,
1096,
11,
12067,
385,
62,
47960,
62,
28758,
11,
2137,
62,
1073,
690,
1096,
198,
198,
1073,
690,
1096,
796,
9927,
7829,
62,
1073,
690,
1096,
198
] | 2.679245 | 106 |
r"""*Main implementation file for* ``flake8-absolute-import``.
flake8 plugin to require absolute imports
**Author**
Brian Skinn ([email protected])
**File Created**
6 Sep 2019
**Copyright**
\(c) Brian Skinn 2019-2021
**Source Repository**
http://github.com/bskinn/flake8-absolute-import
**License**
The MIT License; see |license_txt|_ for full license terms
**Members**
"""
import ast
from flake8_absolute_import.version import __version__
ABS101 = "ABS101 Relative import found"
class Visitor(ast.NodeVisitor):
"""NodeVisitor to report relative imports."""
def __init__(self):
"""Create a Visitor with empty errors list."""
self.errors = []
def visit_ImportFrom(self, node): # noqa: N802
"""Implement check for relative import."""
if node.level > 0:
self.errors.append((node.lineno, node.col_offset, ABS101))
self.generic_visit(node)
class Plugin:
"""Core plugin class for flake8-absolute-import."""
name = "flake8-absolute-import"
version = __version__
def __init__(self, tree):
"""Create plugin instance from the provided AST."""
self._tree = tree
def run(self):
"""Traverse the AST and collect the errors."""
visitor = Visitor()
visitor.visit(self._tree)
for line, col, msg in visitor.errors:
yield line, col, msg, type(self)
| [
81,
37811,
9,
13383,
7822,
2393,
329,
9,
7559,
47597,
23,
12,
48546,
12,
11748,
15506,
13,
198,
198,
47597,
23,
13877,
284,
2421,
4112,
17944,
198,
198,
1174,
13838,
1174,
198,
220,
220,
220,
8403,
3661,
3732,
357,
1443,
74,
3732,
31,
282,
388,
13,
2781,
13,
15532,
8,
198,
198,
1174,
8979,
15622,
1174,
198,
220,
220,
220,
718,
8621,
13130,
198,
198,
1174,
15269,
1174,
198,
220,
220,
220,
16792,
66,
8,
8403,
3661,
3732,
13130,
12,
1238,
2481,
198,
198,
1174,
7416,
1432,
13264,
1174,
198,
220,
220,
220,
2638,
1378,
12567,
13,
785,
14,
1443,
74,
3732,
14,
47597,
23,
12,
48546,
12,
11748,
198,
198,
1174,
34156,
1174,
198,
220,
220,
220,
383,
17168,
13789,
26,
766,
930,
43085,
62,
14116,
91,
62,
329,
1336,
5964,
2846,
198,
198,
1174,
25341,
1174,
198,
198,
37811,
198,
198,
11748,
6468,
198,
198,
6738,
781,
539,
23,
62,
48546,
62,
11748,
13,
9641,
1330,
11593,
9641,
834,
628,
198,
32,
4462,
8784,
796,
366,
32,
4462,
8784,
45344,
1330,
1043,
1,
628,
198,
4871,
6911,
2072,
7,
459,
13,
19667,
15854,
2072,
2599,
198,
220,
220,
220,
37227,
19667,
15854,
2072,
284,
989,
3585,
17944,
526,
15931,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16447,
257,
6911,
2072,
351,
6565,
8563,
1351,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
48277,
796,
17635,
628,
220,
220,
220,
825,
3187,
62,
20939,
4863,
7,
944,
11,
10139,
2599,
220,
1303,
645,
20402,
25,
399,
30863,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3546,
26908,
2198,
329,
3585,
1330,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
10139,
13,
5715,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
48277,
13,
33295,
19510,
17440,
13,
2815,
23397,
11,
10139,
13,
4033,
62,
28968,
11,
29950,
8784,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
41357,
62,
4703,
270,
7,
17440,
8,
628,
198,
4871,
42636,
25,
198,
220,
220,
220,
37227,
14055,
13877,
1398,
329,
781,
539,
23,
12,
48546,
12,
11748,
526,
15931,
628,
220,
220,
220,
1438,
796,
366,
47597,
23,
12,
48546,
12,
11748,
1,
198,
220,
220,
220,
2196,
796,
11593,
9641,
834,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
5509,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16447,
13877,
4554,
422,
262,
2810,
29273,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
21048,
796,
5509,
628,
220,
220,
220,
825,
1057,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15721,
4399,
262,
29273,
290,
2824,
262,
8563,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
21493,
796,
6911,
2072,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
21493,
13,
4703,
270,
7,
944,
13557,
21048,
8,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1627,
11,
951,
11,
31456,
287,
21493,
13,
48277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7800,
1627,
11,
951,
11,
31456,
11,
2099,
7,
944,
8,
198
] | 2.64432 | 537 |
from django.conf.urls import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
# from django.conf import settings
urlpatterns = [
# Example:
url(r'^', include('halolib.halolib.urls')),
#url(r'^(?P<url>.*)$', proxy),#, ProxyLink.as_view(), name='proxy'),
# Uncomment the admin/doc line below to enable admin documentation:
#url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
#url(r'^admin/', include(admin.site.urls)),
#url(r'^api-token-auth/', include('rest_framework.authtoken.views.obtain_auth_token')),
] #+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
1635,
198,
198,
2,
791,
23893,
262,
1306,
734,
3951,
284,
7139,
262,
13169,
25,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
28482,
13,
2306,
375,
29392,
3419,
198,
198,
2,
422,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
1303,
17934,
25,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3256,
2291,
10786,
14201,
349,
571,
13,
14201,
349,
571,
13,
6371,
82,
11537,
828,
198,
220,
220,
220,
1303,
6371,
7,
81,
6,
61,
7,
30,
47,
27,
6371,
29,
15885,
8,
3,
3256,
15741,
828,
2,
11,
38027,
11280,
13,
292,
62,
1177,
22784,
1438,
11639,
36436,
33809,
628,
220,
220,
220,
1303,
791,
23893,
262,
13169,
14,
15390,
1627,
2174,
284,
7139,
13169,
10314,
25,
198,
220,
220,
220,
1303,
6371,
7,
81,
6,
61,
28482,
14,
15390,
14,
3256,
2291,
10786,
28241,
14208,
13,
3642,
822,
13,
324,
10155,
420,
82,
13,
6371,
82,
11537,
828,
628,
220,
220,
220,
1303,
791,
23893,
262,
1306,
1627,
284,
7139,
262,
13169,
25,
198,
220,
220,
220,
1303,
6371,
7,
81,
6,
61,
28482,
14,
3256,
2291,
7,
28482,
13,
15654,
13,
6371,
82,
36911,
628,
220,
220,
220,
1303,
6371,
7,
81,
6,
61,
15042,
12,
30001,
12,
18439,
14,
3256,
2291,
10786,
2118,
62,
30604,
13,
18439,
30001,
13,
33571,
13,
672,
3153,
62,
18439,
62,
30001,
11537,
828,
198,
60,
1303,
10,
9037,
7,
33692,
13,
35744,
2149,
62,
21886,
11,
3188,
62,
15763,
28,
33692,
13,
35744,
2149,
62,
13252,
2394,
8,
628,
198
] | 2.681319 | 273 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This module is meant to be used together with the web app.
For the stand alone CLI implementation, see parent directory.
"""
from datetime import datetime
import ast
import os
import re
import unicodedata
import logging
import defaults
logger = logging.getLogger()
try:
import redis
except ImportError:
print('pip install redis')
exit(1)
try:
import ssdeep
except ImportError:
"""
if you get errors during the installation process, install these:
sudo apt-get install python3 python-dev python3-dev build-essential libssl-dev
libffi-dev libxml2-dev libxslt1-dev zlib1g-dev python-pip libfuzzy-dev
"""
print('pip install ssdeep')
exit(1)
# To start with, set all to None.
inputname = None
inputssdeep = None
inputsha256 = None
# set the DB number and host to the default value
REDIS_DB = defaults.REDIS_DB
REDIS_HOST = defaults.REDIS_HOST
REDIS_PASS = defaults.REDIS_PASS
# Connect to redis.
# Also, convert all responses to strings, not bytes
r = redis.StrictRedis(REDIS_HOST, 6379, db=REDIS_DB, password=REDIS_PASS,
charset="utf-8", decode_responses=True)
def remove_control_characters(s):
"""Some input (like filenames) has some really nasty control chars.
This trick removes those (https://stackoverflow.com/a/19016117)"""
return "".join(ch for ch in s if unicodedata.category(ch)[0] != "C")
def replace_badchars(inputstring):
"""Stringing together '.replace' seems the fastest way
to do this: https://stackoverflow.com/a/27086669.
As the input is json, the "," does not nead special treatment
"""
blacklist = {':': '', '\\': '', '"': '', '\'': '', '|': '',
' ': '', '/': ''}
for k in blacklist:
inputstring = inputstring.replace(k, blacklist[k])
return inputstring
def clean_context(contextstring):
"""Remove all troublesome characters from the context option.
We need to do this to make splitting the strings by
other tools reliable."""
clean_contextstring = replace_badchars(contextstring)
# make string splitable on pipe symbol and turn to lowercase
clean_contextstring = clean_contextstring.encode('utf-8', 'ignore')
clean_contextstring = clean_contextstring.decode('utf-8', 'ignore')
clean_contextstring = clean_contextstring.replace(',', '|').lower()
clean_contextstring = remove_control_characters(clean_contextstring)
return clean_contextstring
def clean_name(filename):
"""Remove pathname from the input and characters
which could cause issues with stringparsing.
"""
# XXX in the case of directories, we'd want dirnames etc.
cleanname = os.path.basename(filename)
cleanname = replace_badchars(cleanname)
cleanname = cleanname.encode('utf-8', 'ignore').decode('utf-8', 'ignore')
cleanname = remove_control_characters(cleanname)
# this turns a comma seperated list into the actual context list
cleanname = cleanname.replace(',', '|').lower()
return (cleanname)
# The below two functions (preprocess_ssdeep and get_all_7_char_rolling_window)
# originally come from Brian Wallace:
# https://www.virusbulletin.com/virusbulletin/2015/11/\
# optimizing-ssdeep-use-scale
def get_all_7_char_rolling_window(bs, h):
"""return a set containing the 7 character length strings (rolling window)
of the ssdeep string for both block sizes, with the block size prepended.
Ssdeep only does a compare if at least 7 characters match between strings.
These are the keys which hold the sibling values."""
return set((str(bs) + ":" + h[i:i + 7]) for i in range(len(h) - 6))
def preprocess_ssdeep(h):
"""The ssdeep string is split into block_size, ssdeep, ssdeep_double_block.
Before returning a set of all the rolling_window for size and double size,
all the repeated character sequences of more than 3 are reduced to max 3.
This is something the ssdeep algoritm does internally too.
"""
h_rolling_window = set()
block_size, h = h.split(":", 1)
block_size = int(block_size)
# Reduce any sequence of the same char greater than 3 to 3
for c in set(list(h)):
while c * 4 in h:
h = h.replace(c * 4, c * 3)
block_data, double_block_data = h.split(":")
h_rolling_window.update(get_all_7_char_rolling_window(block_size,
block_data))
h_rolling_window.update(get_all_7_char_rolling_window(block_size * 2,
double_block_data))
return h_rolling_window
def get_ssdeep_sets(rolling_window_ssdeep, inputssdeep):
""" create a set of ssdeep hashes matching filesssdeep
from the rolling_window set, which does not contain
inputssdeep hash itself. Using '.discard' to silently
return without inputssdeep."""
siblings_set = r.smembers(rolling_window_ssdeep)
siblings_set.discard(inputssdeep)
return siblings_set
def add_ssdeep_to_rolling_window(rolling_window_ssdeep, inputssdeep):
"""This function adds the inputssdeep hash to all the matching
rolling_windows."""
r.sadd(rolling_window_ssdeep, inputssdeep)
def add_info(inputname, inputsha256, inputssdeep, inputcontext):
"""The four info fields contain a set (read: unique) of information
about the added entity. This way sha256/inputname/inputssdeep are
linked and retrievable."""
inputcontext = clean_context(inputcontext)
splitcontext = inputcontext.split('|')
inputsha256 = inputsha256.lower()
r.sadd('info:inputname:{}'.format(inputname),
'sha256:{}:ssdeep:{}:context:{}'.format(inputsha256,
inputssdeep,
inputcontext))
r.sadd('info:ssdeep:{}'.format(inputssdeep),
'sha256:{}:context:{}:inputname:{}'.format(inputsha256,
inputcontext,
inputname))
r.sadd('info:sha256:{}'.format(inputsha256),
'ssdeep:{}:context:{}:inputname:{}'.format(inputssdeep,
inputcontext,
inputname))
r.sadd("hashes:ssdeep", '{}'.format(inputssdeep))
r.sadd("names:inputname", '{}'.format(inputname))
# pull all most significant contexts from an ssdeep and, if they are
# different, add the combined names to splitcontext for inclusion in
# "names:context".
# Because the ssdeeps are similar, this will make different naming
# schemes explicit.
for contexts in r.smembers('info:ssdeep:{}'.format(inputssdeep)):
context = contexts.split(':')[3].split('|')[0]
if context != splitcontext[0]:
context = '/'.join(sorted([context, splitcontext[0]]))
splitcontext.append(context)
for singlecontext in splitcontext:
# add unique key to set with 'incr 1' to keep track of occurance
# and create a ranked set. Rank may chance over time, but that
# is not a problem when updates do not happen inbetween calls
r.zincrby("names:context", '{}'.format(singlecontext), amount=1)
info_string = 'sha256:{}:ssdeep:{}:inputname:{}:inputcontext:{}'
r.sadd('info:context:{}'.format(singlecontext),
info_string.format(inputsha256,
inputssdeep, inputname, inputcontext))
# timestamp is used for caching of query results. It is updated after
# every addition so it never goes stale.
# keep a log of timestamps
r.sadd("timestamplog", r.get("timestamp"))
logger.debug(timestamp())
r.set("timestamp", timestamp())
logger.debug(r.get("timestamp"))
def get_allsha256_for_ssdeep(ssdeep):
"""function which retrieves a string of unique sha256 hashes for
an ssdeep hash. Theoretically a single ssdeep hash could match multiple
different inputs, if the differences are insignificant."""
allsha256s = [allsha256.split(':')[1]
for allsha256 in r.smembers('info:ssdeep:{}'.format(ssdeep))]
allsha256s = str.join(':', set(allsha256s))
logger.debug(f"=== DEBUG === : allsha256s: {allsha256s}")
return allsha256s
def get_allcontext_for_ssdeep(ssdeep):
"""function which retrieves a string of unique context strings for
an ssdeep hash. Theoretically a single ssdeep hash could match multiple
different contexts, based on how they are added to the dataset."""
allcontexts = [allcontext.split(':')[3]
for allcontext in
r.smembers('info:ssdeep:{}'.format(ssdeep))]
allcontexts = str.join(':', set(allcontexts))
logger.debug(f"=== DEBUG === : allcontexts: {allcontexts}")
return allcontexts
def return_results(inputname, inputsha256, inputssdeep, inputcontext):
"""The results should be in json. But the json.dumps function
cannot deal with python sets, so we turn them into lists.
additionally we retrieve other files with the same sha256 and,
last but not least, it siblings (partially matching ssdeep hashes)."""
info = dict()
info['inputname'] = inputname
info['sha256'] = inputsha256.lower()
info['ssdeep'] = inputssdeep
info['context'] = inputcontext
info['other_inputnames'] = [inputnames.split(':')[-1]
for inputnames in
r.smembers('info:sha256:{}'.format(inputsha256))
if inputnames.split(':')[-1] not in inputname]
info['siblings'] = list(r.zrangebyscore(inputssdeep, min=0,
max='+inf', withscores=True))
return(info)
def new_hash(inputsha256):
""" To speed things up, we take a different path if the file is already known.
return True if new, False if the hash is already known."""
inputsha256 = inputsha256.lower()
if r.sismember("hashes:sha256", '{}'.format(inputsha256)):
new = False
else:
new = True
return new
def rest_add(info_object):
"""This function should receive a list of dictionaries.
Each dictionary must consist of:
{"inputname": <>, "sha256": <>, "ssdeep": <>, "contexts": ["<>", "<>", "<>"]}
The most important context must be the first in the list."""
logger.debug(f"=== DEBUG === : ingesting info_object: {info_object}")
# sanity check
for rest_info in info_object:
inputname = clean_name(rest_info['inputname'])
if check_sha256(rest_info['sha256']):
input_sha256 = rest_info['sha256'].lower()
else:
return False
if check_ssdeep(rest_info['ssdeep']):
input_ssdeep = rest_info['ssdeep']
else:
return False
if len(rest_info['contexts']) == 0:
return False
contexts = list(map(lambda x: clean_context(x), rest_info['contexts']))
input_contexts = ','.join(contexts)
add_ssdeep_to_db(inputname, input_sha256, input_ssdeep, input_contexts)
return True
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
770,
8265,
318,
4001,
284,
307,
973,
1978,
351,
262,
3992,
598,
13,
198,
1890,
262,
1302,
3436,
43749,
7822,
11,
766,
2560,
8619,
13,
198,
37811,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
6468,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
28000,
9043,
1045,
198,
11748,
18931,
198,
11748,
26235,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
2266,
271,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
3601,
10786,
79,
541,
2721,
2266,
271,
11537,
198,
220,
220,
220,
8420,
7,
16,
8,
198,
28311,
25,
198,
220,
220,
220,
1330,
37786,
22089,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
345,
651,
8563,
1141,
262,
9988,
1429,
11,
2721,
777,
25,
198,
220,
220,
220,
21061,
15409,
12,
1136,
2721,
21015,
18,
21015,
12,
7959,
21015,
18,
12,
7959,
1382,
12,
31195,
9195,
45163,
12,
7959,
198,
220,
220,
220,
9195,
487,
72,
12,
7959,
9195,
19875,
17,
12,
7959,
9195,
34223,
2528,
16,
12,
7959,
1976,
8019,
16,
70,
12,
7959,
21015,
12,
79,
541,
9195,
69,
4715,
88,
12,
7959,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3601,
10786,
79,
541,
2721,
37786,
22089,
11537,
198,
220,
220,
220,
8420,
7,
16,
8,
628,
198,
2,
1675,
923,
351,
11,
900,
477,
284,
6045,
13,
198,
15414,
3672,
796,
6045,
198,
15414,
824,
22089,
796,
6045,
198,
15414,
26270,
11645,
796,
6045,
198,
198,
2,
900,
262,
20137,
1271,
290,
2583,
284,
262,
4277,
1988,
198,
22083,
1797,
62,
11012,
796,
26235,
13,
22083,
1797,
62,
11012,
198,
22083,
1797,
62,
39,
10892,
796,
26235,
13,
22083,
1797,
62,
39,
10892,
198,
22083,
1797,
62,
47924,
796,
26235,
13,
22083,
1797,
62,
47924,
198,
198,
2,
8113,
284,
2266,
271,
13,
198,
2,
4418,
11,
10385,
477,
9109,
284,
13042,
11,
407,
9881,
198,
81,
796,
2266,
271,
13,
1273,
2012,
7738,
271,
7,
22083,
1797,
62,
39,
10892,
11,
718,
29088,
11,
20613,
28,
22083,
1797,
62,
11012,
11,
9206,
28,
22083,
1797,
62,
47924,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34534,
316,
2625,
40477,
12,
23,
1600,
36899,
62,
16733,
274,
28,
17821,
8,
628,
628,
198,
198,
4299,
4781,
62,
13716,
62,
10641,
19858,
7,
82,
2599,
198,
220,
220,
220,
37227,
4366,
5128,
357,
2339,
1226,
268,
1047,
8,
468,
617,
1107,
17166,
1630,
34534,
13,
198,
220,
220,
220,
770,
6908,
20694,
883,
357,
5450,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
1129,
27037,
17657,
8,
37811,
198,
220,
220,
220,
1441,
366,
1911,
22179,
7,
354,
329,
442,
287,
264,
611,
28000,
9043,
1045,
13,
22872,
7,
354,
38381,
15,
60,
14512,
366,
34,
4943,
628,
198,
4299,
6330,
62,
14774,
354,
945,
7,
15414,
8841,
2599,
198,
220,
220,
220,
37227,
10100,
278,
1978,
45302,
33491,
6,
2331,
262,
14162,
835,
198,
220,
220,
220,
284,
466,
428,
25,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
1983,
2919,
2791,
3388,
13,
198,
220,
220,
220,
1081,
262,
5128,
318,
33918,
11,
262,
366,
553,
857,
407,
497,
324,
2041,
3513,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38810,
796,
1391,
10354,
10354,
705,
3256,
705,
6852,
10354,
705,
3256,
705,
1,
10354,
705,
3256,
705,
59,
7061,
25,
705,
3256,
705,
91,
10354,
705,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
705,
25,
705,
3256,
31051,
10354,
10148,
92,
198,
220,
220,
220,
329,
479,
287,
38810,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
8841,
796,
5128,
8841,
13,
33491,
7,
74,
11,
38810,
58,
74,
12962,
198,
220,
220,
220,
1441,
5128,
8841,
628,
198,
4299,
3424,
62,
22866,
7,
22866,
8841,
2599,
198,
220,
220,
220,
37227,
27914,
477,
35778,
3435,
422,
262,
4732,
3038,
13,
198,
220,
220,
220,
775,
761,
284,
466,
428,
284,
787,
26021,
262,
13042,
416,
198,
220,
220,
220,
584,
4899,
9314,
526,
15931,
198,
220,
220,
220,
3424,
62,
22866,
8841,
796,
6330,
62,
14774,
354,
945,
7,
22866,
8841,
8,
198,
220,
220,
220,
1303,
787,
4731,
4328,
4674,
319,
12656,
6194,
290,
1210,
284,
2793,
7442,
198,
220,
220,
220,
3424,
62,
22866,
8841,
796,
3424,
62,
22866,
8841,
13,
268,
8189,
10786,
40477,
12,
23,
3256,
705,
46430,
11537,
198,
220,
220,
220,
3424,
62,
22866,
8841,
796,
3424,
62,
22866,
8841,
13,
12501,
1098,
10786,
40477,
12,
23,
3256,
705,
46430,
11537,
198,
220,
220,
220,
3424,
62,
22866,
8841,
796,
3424,
62,
22866,
8841,
13,
33491,
7,
3256,
3256,
705,
91,
27691,
21037,
3419,
198,
220,
220,
220,
3424,
62,
22866,
8841,
796,
4781,
62,
13716,
62,
10641,
19858,
7,
27773,
62,
22866,
8841,
8,
198,
220,
220,
220,
1441,
3424,
62,
22866,
8841,
628,
198,
4299,
3424,
62,
3672,
7,
34345,
2599,
198,
220,
220,
220,
37227,
27914,
3108,
3672,
422,
262,
5128,
290,
3435,
198,
220,
220,
220,
543,
714,
2728,
2428,
351,
4731,
79,
945,
278,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
27713,
287,
262,
1339,
286,
29196,
11,
356,
1549,
765,
26672,
14933,
3503,
13,
198,
220,
220,
220,
1190,
1236,
480,
796,
28686,
13,
6978,
13,
12093,
12453,
7,
34345,
8,
198,
220,
220,
220,
1190,
1236,
480,
796,
6330,
62,
14774,
354,
945,
7,
2375,
1236,
480,
8,
198,
220,
220,
220,
1190,
1236,
480,
796,
1190,
1236,
480,
13,
268,
8189,
10786,
40477,
12,
23,
3256,
705,
46430,
27691,
12501,
1098,
10786,
40477,
12,
23,
3256,
705,
46430,
11537,
198,
220,
220,
220,
1190,
1236,
480,
796,
4781,
62,
13716,
62,
10641,
19858,
7,
2375,
1236,
480,
8,
198,
220,
220,
220,
1303,
428,
4962,
257,
39650,
384,
525,
515,
1351,
656,
262,
4036,
4732,
1351,
198,
220,
220,
220,
1190,
1236,
480,
796,
1190,
1236,
480,
13,
33491,
7,
3256,
3256,
705,
91,
27691,
21037,
3419,
198,
220,
220,
220,
1441,
357,
2375,
1236,
480,
8,
628,
198,
2,
383,
2174,
734,
5499,
357,
3866,
14681,
62,
824,
22089,
290,
651,
62,
439,
62,
22,
62,
10641,
62,
18886,
62,
17497,
8,
198,
2,
6198,
1282,
422,
8403,
17161,
25,
198,
2,
3740,
1378,
2503,
13,
85,
19397,
15065,
1616,
259,
13,
785,
14,
85,
19397,
15065,
1616,
259,
14,
4626,
14,
1157,
14,
59,
198,
2,
220,
220,
220,
220,
220,
220,
220,
45780,
12,
824,
22089,
12,
1904,
12,
9888,
198,
198,
4299,
651,
62,
439,
62,
22,
62,
10641,
62,
18886,
62,
17497,
7,
1443,
11,
289,
2599,
198,
220,
220,
220,
37227,
7783,
257,
900,
7268,
262,
767,
2095,
4129,
13042,
357,
18886,
4324,
8,
198,
220,
220,
220,
286,
262,
37786,
22089,
4731,
329,
1111,
2512,
10620,
11,
351,
262,
2512,
2546,
3143,
1631,
13,
198,
220,
220,
220,
311,
82,
22089,
691,
857,
257,
8996,
611,
379,
1551,
767,
3435,
2872,
1022,
13042,
13,
198,
220,
220,
220,
2312,
389,
262,
8251,
543,
1745,
262,
33423,
3815,
526,
15931,
198,
220,
220,
220,
1441,
900,
19510,
2536,
7,
1443,
8,
1343,
366,
11097,
1343,
289,
58,
72,
25,
72,
1343,
767,
12962,
329,
1312,
287,
2837,
7,
11925,
7,
71,
8,
532,
718,
4008,
628,
198,
4299,
662,
14681,
62,
824,
22089,
7,
71,
2599,
198,
220,
220,
220,
37227,
464,
37786,
22089,
4731,
318,
6626,
656,
2512,
62,
7857,
11,
37786,
22089,
11,
37786,
22089,
62,
23352,
62,
9967,
13,
198,
220,
220,
220,
7413,
8024,
257,
900,
286,
477,
262,
10708,
62,
17497,
329,
2546,
290,
4274,
2546,
11,
198,
220,
220,
220,
477,
262,
5100,
2095,
16311,
286,
517,
621,
513,
389,
5322,
284,
3509,
513,
13,
198,
220,
220,
220,
770,
318,
1223,
262,
37786,
22089,
435,
7053,
270,
76,
857,
20947,
1165,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
289,
62,
18886,
62,
17497,
796,
900,
3419,
198,
220,
220,
220,
2512,
62,
7857,
11,
289,
796,
289,
13,
35312,
7,
1298,
1600,
352,
8,
198,
220,
220,
220,
2512,
62,
7857,
796,
493,
7,
9967,
62,
7857,
8,
198,
220,
220,
220,
1303,
44048,
597,
8379,
286,
262,
976,
1149,
3744,
621,
513,
284,
513,
198,
220,
220,
220,
329,
269,
287,
900,
7,
4868,
7,
71,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
981,
269,
1635,
604,
287,
289,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
796,
289,
13,
33491,
7,
66,
1635,
604,
11,
269,
1635,
513,
8,
198,
220,
220,
220,
2512,
62,
7890,
11,
4274,
62,
9967,
62,
7890,
796,
289,
13,
35312,
7,
2404,
8,
198,
220,
220,
220,
289,
62,
18886,
62,
17497,
13,
19119,
7,
1136,
62,
439,
62,
22,
62,
10641,
62,
18886,
62,
17497,
7,
9967,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2512,
62,
7890,
4008,
198,
220,
220,
220,
289,
62,
18886,
62,
17497,
13,
19119,
7,
1136,
62,
439,
62,
22,
62,
10641,
62,
18886,
62,
17497,
7,
9967,
62,
7857,
1635,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4274,
62,
9967,
62,
7890,
4008,
198,
220,
220,
220,
1441,
289,
62,
18886,
62,
17497,
628,
198,
4299,
651,
62,
824,
22089,
62,
28709,
7,
18886,
62,
17497,
62,
824,
22089,
11,
5128,
824,
22089,
2599,
198,
220,
220,
220,
37227,
2251,
257,
900,
286,
37786,
22089,
46621,
12336,
1226,
408,
82,
22089,
198,
220,
220,
220,
422,
262,
10708,
62,
17497,
900,
11,
543,
857,
407,
3994,
198,
220,
220,
220,
5128,
824,
22089,
12234,
2346,
13,
8554,
45302,
15410,
446,
6,
284,
24595,
198,
220,
220,
220,
1441,
1231,
5128,
824,
22089,
526,
15931,
198,
220,
220,
220,
20569,
62,
2617,
796,
374,
13,
5796,
368,
1213,
7,
18886,
62,
17497,
62,
824,
22089,
8,
198,
220,
220,
220,
20569,
62,
2617,
13,
15410,
446,
7,
15414,
824,
22089,
8,
198,
220,
220,
220,
1441,
20569,
62,
2617,
628,
198,
4299,
751,
62,
824,
22089,
62,
1462,
62,
18886,
62,
17497,
7,
18886,
62,
17497,
62,
824,
22089,
11,
5128,
824,
22089,
2599,
198,
220,
220,
220,
37227,
1212,
2163,
6673,
262,
5128,
824,
22089,
12234,
284,
477,
262,
12336,
198,
220,
220,
220,
10708,
62,
28457,
526,
15931,
198,
220,
220,
220,
374,
13,
82,
2860,
7,
18886,
62,
17497,
62,
824,
22089,
11,
5128,
824,
22089,
8,
628,
198,
4299,
751,
62,
10951,
7,
15414,
3672,
11,
5128,
26270,
11645,
11,
5128,
824,
22089,
11,
5128,
22866,
2599,
198,
220,
220,
220,
37227,
464,
1440,
7508,
7032,
3994,
257,
900,
357,
961,
25,
3748,
8,
286,
1321,
198,
220,
220,
220,
546,
262,
2087,
9312,
13,
770,
835,
427,
64,
11645,
14,
15414,
3672,
14,
15414,
824,
22089,
389,
198,
220,
220,
220,
6692,
290,
37715,
1990,
540,
526,
15931,
198,
220,
220,
220,
5128,
22866,
796,
3424,
62,
22866,
7,
15414,
22866,
8,
198,
220,
220,
220,
6626,
22866,
796,
5128,
22866,
13,
35312,
10786,
91,
11537,
198,
220,
220,
220,
5128,
26270,
11645,
796,
5128,
26270,
11645,
13,
21037,
3419,
628,
220,
220,
220,
374,
13,
82,
2860,
10786,
10951,
25,
15414,
3672,
29164,
92,
4458,
18982,
7,
15414,
3672,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
26270,
11645,
29164,
38362,
824,
22089,
29164,
38362,
22866,
29164,
92,
4458,
18982,
7,
15414,
26270,
11645,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
824,
22089,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
22866,
4008,
198,
220,
220,
220,
374,
13,
82,
2860,
10786,
10951,
25,
824,
22089,
29164,
92,
4458,
18982,
7,
15414,
824,
22089,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
26270,
11645,
29164,
38362,
22866,
29164,
38362,
15414,
3672,
29164,
92,
4458,
18982,
7,
15414,
26270,
11645,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
22866,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
3672,
4008,
198,
220,
220,
220,
374,
13,
82,
2860,
10786,
10951,
25,
26270,
11645,
29164,
92,
4458,
18982,
7,
15414,
26270,
11645,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
824,
22089,
29164,
38362,
22866,
29164,
38362,
15414,
3672,
29164,
92,
4458,
18982,
7,
15414,
824,
22089,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
22866,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
3672,
4008,
198,
220,
220,
220,
374,
13,
82,
2860,
7203,
71,
7465,
25,
824,
22089,
1600,
705,
90,
92,
4458,
18982,
7,
15414,
824,
22089,
4008,
198,
220,
220,
220,
374,
13,
82,
2860,
7203,
14933,
25,
15414,
3672,
1600,
705,
90,
92,
4458,
18982,
7,
15414,
3672,
4008,
198,
220,
220,
220,
1303,
2834,
477,
749,
2383,
26307,
422,
281,
37786,
22089,
290,
11,
611,
484,
389,
198,
220,
220,
220,
1303,
1180,
11,
751,
262,
5929,
3891,
284,
6626,
22866,
329,
14900,
287,
198,
220,
220,
220,
1303,
366,
14933,
25,
22866,
1911,
198,
220,
220,
220,
1303,
4362,
262,
37786,
22089,
82,
389,
2092,
11,
428,
481,
787,
1180,
19264,
198,
220,
220,
220,
1303,
16546,
7952,
13,
198,
220,
220,
220,
329,
26307,
287,
374,
13,
5796,
368,
1213,
10786,
10951,
25,
824,
22089,
29164,
92,
4458,
18982,
7,
15414,
824,
22089,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
4732,
796,
26307,
13,
35312,
7,
10354,
11537,
58,
18,
4083,
35312,
10786,
91,
11537,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4732,
14512,
6626,
22866,
58,
15,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4732,
796,
31051,
4458,
22179,
7,
82,
9741,
26933,
22866,
11,
6626,
22866,
58,
15,
11907,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6626,
22866,
13,
33295,
7,
22866,
8,
628,
220,
220,
220,
329,
2060,
22866,
287,
6626,
22866,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
751,
3748,
1994,
284,
900,
351,
705,
1939,
81,
352,
6,
284,
1394,
2610,
286,
3051,
590,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
290,
2251,
257,
10307,
900,
13,
10916,
743,
2863,
625,
640,
11,
475,
326,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
318,
407,
257,
1917,
618,
5992,
466,
407,
1645,
287,
23395,
3848,
198,
220,
220,
220,
220,
220,
220,
220,
374,
13,
89,
1939,
81,
1525,
7203,
14933,
25,
22866,
1600,
705,
90,
92,
4458,
18982,
7,
29762,
22866,
828,
2033,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7508,
62,
8841,
796,
705,
26270,
11645,
29164,
38362,
824,
22089,
29164,
38362,
15414,
3672,
29164,
38362,
15414,
22866,
29164,
92,
6,
198,
220,
220,
220,
220,
220,
220,
220,
374,
13,
82,
2860,
10786,
10951,
25,
22866,
29164,
92,
4458,
18982,
7,
29762,
22866,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7508,
62,
8841,
13,
18982,
7,
15414,
26270,
11645,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
824,
22089,
11,
5128,
3672,
11,
5128,
22866,
4008,
198,
220,
220,
220,
1303,
41033,
318,
973,
329,
40918,
286,
12405,
2482,
13,
632,
318,
6153,
706,
198,
220,
220,
220,
1303,
790,
3090,
523,
340,
1239,
2925,
39985,
13,
198,
220,
220,
220,
1303,
1394,
257,
2604,
286,
4628,
395,
9430,
198,
220,
220,
220,
374,
13,
82,
2860,
7203,
16514,
395,
321,
489,
519,
1600,
374,
13,
1136,
7203,
16514,
27823,
48774,
198,
220,
220,
220,
49706,
13,
24442,
7,
16514,
27823,
28955,
198,
220,
220,
220,
374,
13,
2617,
7203,
16514,
27823,
1600,
41033,
28955,
628,
220,
220,
220,
49706,
13,
24442,
7,
81,
13,
1136,
7203,
16514,
27823,
48774,
628,
198,
4299,
651,
62,
439,
26270,
11645,
62,
1640,
62,
824,
22089,
7,
824,
22089,
2599,
198,
220,
220,
220,
37227,
8818,
543,
13236,
1158,
257,
4731,
286,
3748,
427,
64,
11645,
46621,
329,
198,
220,
220,
220,
281,
37786,
22089,
12234,
13,
383,
9997,
1146,
257,
2060,
37786,
22089,
12234,
714,
2872,
3294,
198,
220,
220,
220,
1180,
17311,
11,
611,
262,
5400,
389,
32081,
526,
15931,
198,
220,
220,
220,
477,
26270,
11645,
82,
796,
685,
439,
26270,
11645,
13,
35312,
7,
10354,
11537,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
477,
26270,
11645,
287,
374,
13,
5796,
368,
1213,
10786,
10951,
25,
824,
22089,
29164,
92,
4458,
18982,
7,
824,
22089,
4008,
60,
198,
220,
220,
220,
477,
26270,
11645,
82,
796,
965,
13,
22179,
7,
10354,
3256,
900,
7,
439,
26270,
11645,
82,
4008,
198,
220,
220,
220,
49706,
13,
24442,
7,
69,
1,
18604,
16959,
24844,
1058,
477,
26270,
11645,
82,
25,
1391,
439,
26270,
11645,
82,
92,
4943,
198,
220,
220,
220,
1441,
477,
26270,
11645,
82,
628,
198,
4299,
651,
62,
439,
22866,
62,
1640,
62,
824,
22089,
7,
824,
22089,
2599,
198,
220,
220,
220,
37227,
8818,
543,
13236,
1158,
257,
4731,
286,
3748,
4732,
13042,
329,
198,
220,
220,
220,
281,
37786,
22089,
12234,
13,
383,
9997,
1146,
257,
2060,
37786,
22089,
12234,
714,
2872,
3294,
198,
220,
220,
220,
1180,
26307,
11,
1912,
319,
703,
484,
389,
2087,
284,
262,
27039,
526,
15931,
198,
220,
220,
220,
477,
22866,
82,
796,
685,
439,
22866,
13,
35312,
7,
10354,
11537,
58,
18,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
477,
22866,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
13,
5796,
368,
1213,
10786,
10951,
25,
824,
22089,
29164,
92,
4458,
18982,
7,
824,
22089,
4008,
60,
198,
220,
220,
220,
477,
22866,
82,
796,
965,
13,
22179,
7,
10354,
3256,
900,
7,
439,
22866,
82,
4008,
198,
220,
220,
220,
49706,
13,
24442,
7,
69,
1,
18604,
16959,
24844,
1058,
477,
22866,
82,
25,
1391,
439,
22866,
82,
92,
4943,
198,
220,
220,
220,
1441,
477,
22866,
82,
628,
198,
4299,
1441,
62,
43420,
7,
15414,
3672,
11,
5128,
26270,
11645,
11,
5128,
824,
22089,
11,
5128,
22866,
2599,
198,
220,
220,
220,
37227,
464,
2482,
815,
307,
287,
33918,
13,
887,
262,
33918,
13,
67,
8142,
2163,
198,
220,
220,
220,
2314,
1730,
351,
21015,
5621,
11,
523,
356,
1210,
606,
656,
8341,
13,
198,
220,
220,
220,
36527,
356,
19818,
584,
3696,
351,
262,
976,
427,
64,
11645,
290,
11,
198,
220,
220,
220,
938,
475,
407,
1551,
11,
340,
20569,
357,
3911,
1927,
12336,
37786,
22089,
46621,
21387,
15931,
198,
220,
220,
220,
7508,
796,
8633,
3419,
198,
220,
220,
220,
7508,
17816,
15414,
3672,
20520,
796,
5128,
3672,
198,
220,
220,
220,
7508,
17816,
26270,
11645,
20520,
796,
5128,
26270,
11645,
13,
21037,
3419,
198,
220,
220,
220,
7508,
17816,
824,
22089,
20520,
796,
5128,
824,
22089,
198,
220,
220,
220,
7508,
17816,
22866,
20520,
796,
5128,
22866,
198,
220,
220,
220,
7508,
17816,
847,
62,
15414,
14933,
20520,
796,
685,
15414,
14933,
13,
35312,
7,
10354,
11537,
58,
12,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
5128,
14933,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
13,
5796,
368,
1213,
10786,
10951,
25,
26270,
11645,
29164,
92,
4458,
18982,
7,
15414,
26270,
11645,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5128,
14933,
13,
35312,
7,
10354,
11537,
58,
12,
16,
60,
407,
287,
5128,
3672,
60,
198,
220,
220,
220,
7508,
17816,
82,
19389,
20520,
796,
1351,
7,
81,
13,
89,
9521,
48209,
7295,
7,
15414,
824,
22089,
11,
949,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
11639,
10,
10745,
3256,
351,
1416,
2850,
28,
17821,
4008,
198,
220,
220,
220,
1441,
7,
10951,
8,
628,
198,
4299,
649,
62,
17831,
7,
15414,
26270,
11645,
2599,
198,
220,
220,
220,
37227,
1675,
2866,
1243,
510,
11,
356,
1011,
257,
1180,
3108,
611,
262,
2393,
318,
1541,
1900,
13,
198,
220,
220,
220,
1441,
6407,
611,
649,
11,
10352,
611,
262,
12234,
318,
1541,
1900,
526,
15931,
198,
220,
220,
220,
5128,
26270,
11645,
796,
5128,
26270,
11645,
13,
21037,
3419,
198,
220,
220,
220,
611,
374,
13,
82,
1042,
1491,
7203,
71,
7465,
25,
26270,
11645,
1600,
705,
90,
92,
4458,
18982,
7,
15414,
26270,
11645,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
649,
796,
10352,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
649,
796,
6407,
198,
220,
220,
220,
1441,
649,
628,
628,
198,
4299,
1334,
62,
2860,
7,
10951,
62,
15252,
2599,
198,
220,
220,
220,
37227,
1212,
2163,
815,
3328,
257,
1351,
286,
48589,
3166,
13,
198,
220,
220,
220,
5501,
22155,
1276,
3473,
286,
25,
198,
220,
220,
220,
19779,
15414,
3672,
1298,
1279,
22330,
366,
26270,
11645,
1298,
1279,
22330,
366,
824,
22089,
1298,
1279,
22330,
366,
22866,
82,
1298,
14631,
27,
29,
1600,
33490,
29,
1600,
33490,
29,
8973,
92,
198,
220,
220,
220,
383,
749,
1593,
4732,
1276,
307,
262,
717,
287,
262,
1351,
526,
15931,
198,
220,
220,
220,
49706,
13,
24442,
7,
69,
1,
18604,
16959,
24844,
1058,
26151,
278,
7508,
62,
15252,
25,
1391,
10951,
62,
15252,
92,
4943,
628,
220,
220,
220,
1303,
34182,
2198,
198,
220,
220,
220,
329,
1334,
62,
10951,
287,
7508,
62,
15252,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
3672,
796,
3424,
62,
3672,
7,
2118,
62,
10951,
17816,
15414,
3672,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2198,
62,
26270,
11645,
7,
2118,
62,
10951,
17816,
26270,
11645,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
26270,
11645,
796,
1334,
62,
10951,
17816,
26270,
11645,
6,
4083,
21037,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2198,
62,
824,
22089,
7,
2118,
62,
10951,
17816,
824,
22089,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
824,
22089,
796,
1334,
62,
10951,
17816,
824,
22089,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
2118,
62,
10951,
17816,
22866,
82,
6,
12962,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
220,
220,
220,
220,
26307,
796,
1351,
7,
8899,
7,
50033,
2124,
25,
3424,
62,
22866,
7,
87,
828,
1334,
62,
10951,
17816,
22866,
82,
20520,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
22866,
82,
796,
705,
4032,
13,
22179,
7,
22866,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
751,
62,
824,
22089,
62,
1462,
62,
9945,
7,
15414,
3672,
11,
5128,
62,
26270,
11645,
11,
5128,
62,
824,
22089,
11,
5128,
62,
22866,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628
] | 2.535601 | 4,410 |
import time
from datetime import datetime as dt
hp = r"C:\Windows\System32\drivers\hosts" #provide the proper host path according to yor system
redirect = "127.0.0.1"
web = ["www.youtube.com","www.facebook.com"] #add the website links in the list
while True:
if dt(dt.now().year, dt.now().month, dt.now().day,9) < dt.now() < dt(dt.now().year, dt.now().month, dt.now().day,18):
print("Sorry you are not allowed...")
with open(hp,'r+') as file:
content = file.read()
for site in web:
if site in content:
pass
else:
file.write(redirect+" "+site+"\n")
else:
with open(hp,'r+') as file:
content = file.readlines()
file.seek(0)
for line in content:
if not any(site in line for site in web):
file.write(line)
file.truncate()
print("Access Granted....")
time.sleep(5)
| [
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
355,
288,
83,
198,
198,
24831,
796,
374,
1,
34,
7479,
11209,
59,
11964,
2624,
59,
36702,
59,
4774,
82,
1,
220,
220,
1303,
15234,
485,
262,
1774,
2583,
3108,
1864,
284,
331,
273,
1080,
198,
445,
1060,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1,
198,
12384,
796,
14631,
2503,
13,
11604,
13,
785,
2430,
2503,
13,
19024,
13,
785,
8973,
220,
1303,
2860,
262,
3052,
6117,
287,
262,
1351,
198,
198,
4514,
6407,
25,
198,
220,
611,
288,
83,
7,
28664,
13,
2197,
22446,
1941,
11,
288,
83,
13,
2197,
22446,
8424,
11,
288,
83,
13,
2197,
22446,
820,
11,
24,
8,
1279,
288,
83,
13,
2197,
3419,
1279,
288,
83,
7,
28664,
13,
2197,
22446,
1941,
11,
288,
83,
13,
2197,
22446,
8424,
11,
288,
83,
13,
2197,
22446,
820,
11,
1507,
2599,
198,
220,
220,
220,
3601,
7203,
14385,
345,
389,
407,
3142,
9313,
8,
198,
220,
220,
220,
351,
1280,
7,
24831,
4032,
81,
10,
11537,
355,
2393,
25,
198,
220,
220,
220,
220,
220,
2695,
796,
2393,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
329,
2524,
287,
3992,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2524,
287,
2695,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
7,
445,
1060,
10,
1,
43825,
15654,
10,
1,
59,
77,
4943,
198,
220,
2073,
25,
198,
220,
220,
220,
351,
1280,
7,
24831,
4032,
81,
10,
11537,
355,
2393,
25,
198,
220,
220,
220,
220,
220,
2695,
796,
2393,
13,
961,
6615,
3419,
198,
220,
220,
220,
220,
220,
2393,
13,
36163,
7,
15,
8,
198,
220,
220,
220,
220,
220,
329,
1627,
287,
2695,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
597,
7,
15654,
287,
1627,
329,
2524,
287,
3992,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
2393,
13,
2213,
19524,
378,
3419,
198,
220,
220,
220,
3601,
7203,
15457,
38842,
1106,
4943,
198,
220,
640,
13,
42832,
7,
20,
8,
198
] | 2.313984 | 379 |
"""Fix bad casting
Revision ID: c2f1fafd2225
Revises: bff84c33d64d
Create Date: 2019-01-10 15:41:34.358222
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'c2f1fafd2225'
down_revision = 'bff84c33d64d'
branch_labels = None
depends_on = None
| [
37811,
22743,
2089,
13092,
198,
198,
18009,
1166,
4522,
25,
269,
17,
69,
16,
69,
1878,
67,
1828,
1495,
198,
18009,
2696,
25,
275,
487,
5705,
66,
2091,
67,
2414,
67,
198,
16447,
7536,
25,
13130,
12,
486,
12,
940,
1315,
25,
3901,
25,
2682,
13,
31128,
23148,
198,
198,
37811,
198,
6738,
31341,
2022,
291,
1330,
1034,
198,
11748,
44161,
282,
26599,
355,
473,
198,
6738,
44161,
282,
26599,
13,
38969,
478,
82,
1330,
1281,
34239,
13976,
198,
198,
2,
18440,
42814,
11,
973,
416,
9300,
2022,
291,
13,
198,
260,
10178,
796,
705,
66,
17,
69,
16,
69,
1878,
67,
1828,
1495,
6,
198,
2902,
62,
260,
10178,
796,
705,
65,
487,
5705,
66,
2091,
67,
2414,
67,
6,
198,
1671,
3702,
62,
23912,
1424,
796,
6045,
198,
10378,
2412,
62,
261,
796,
6045,
628,
198
] | 2.485507 | 138 |
#! /usr/bin/env python3
from pager import Pager
from pexels_results import PexelsResults
if __name__ == "__main__":
import requests
main ()
quit ()
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
279,
3536,
1330,
350,
3536,
198,
6738,
613,
87,
1424,
62,
43420,
1330,
350,
1069,
1424,
25468,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
11748,
7007,
198,
197,
12417,
7499,
198,
197,
47391,
7499,
198
] | 2.781818 | 55 |
"""
error.py
~~~~~~~~
This module contains errors to be thrown by storage modules
:copyright: (c) by 2016 James Moore
:license: BSD, see LICENSE for more details
"""
class SchemaExistsError(Exception):
"""
Thrown when a schema already exists
"""
pass
class SchemaDoesNotExistError(Exception):
"""
Thrown when a schema does not exist
"""
pass
class SchemaHasNoVersionsError(Exception):
"""
Thrown when a schema does not have any versions
"""
pass
class SchemaVersionDoesNotExistError(Exception):
"""
Thrown when a schema version does not exist
"""
pass | [
37811,
198,
220,
220,
220,
4049,
13,
9078,
198,
220,
220,
220,
220,
15116,
628,
220,
220,
220,
770,
8265,
4909,
8563,
284,
307,
8754,
416,
6143,
13103,
628,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
416,
1584,
3700,
8877,
198,
220,
220,
220,
1058,
43085,
25,
347,
10305,
11,
766,
38559,
24290,
329,
517,
3307,
198,
37811,
198,
198,
4871,
10011,
2611,
3109,
1023,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
536,
2053,
618,
257,
32815,
1541,
7160,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1208,
198,
198,
4871,
10011,
2611,
13921,
3673,
3109,
396,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
536,
2053,
618,
257,
32815,
857,
407,
2152,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1208,
198,
198,
4871,
10011,
2611,
19242,
2949,
45150,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
536,
2053,
618,
257,
32815,
857,
407,
423,
597,
6300,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1208,
198,
198,
4871,
10011,
2611,
14815,
13921,
3673,
3109,
396,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
536,
2053,
618,
257,
32815,
2196,
857,
407,
2152,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1208
] | 2.900452 | 221 |
# Generated by Django 2.1.1 on 2019-07-16 19:43
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
16,
319,
13130,
12,
2998,
12,
1433,
678,
25,
3559,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
'''
Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2.
An interleaving of two strings s and t is a configuration where they are divided into non-empty substrings such that:
s = s1 + s2 + ... + sn
t = t1 + t2 + ... + tm
|n - m| <= 1
The interleaving is s1 + t1 + s2 + t2 + s3 + t3 + ... or t1 + s1 + t2 + s2 + t3 + s3 + ...
Note: a + b is the concatenation of strings a and b.
Example 1:
Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"
Output: true
Example 2:
Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbbaccc"
Output: false
Example 3:
Input: s1 = "", s2 = "", s3 = ""
Output: true
'''
| [
7061,
6,
198,
15056,
13042,
264,
16,
11,
264,
17,
11,
290,
264,
18,
11,
1064,
1771,
264,
18,
318,
7042,
416,
281,
987,
293,
2703,
286,
264,
16,
290,
264,
17,
13,
198,
198,
2025,
987,
293,
2703,
286,
734,
13042,
264,
290,
256,
318,
257,
8398,
810,
484,
389,
9086,
656,
1729,
12,
28920,
850,
37336,
884,
326,
25,
198,
198,
82,
796,
264,
16,
1343,
264,
17,
1343,
2644,
1343,
3013,
198,
83,
796,
256,
16,
1343,
256,
17,
1343,
2644,
1343,
256,
76,
198,
91,
77,
532,
285,
91,
19841,
352,
198,
464,
987,
293,
2703,
318,
264,
16,
1343,
256,
16,
1343,
264,
17,
1343,
256,
17,
1343,
264,
18,
1343,
256,
18,
1343,
2644,
393,
256,
16,
1343,
264,
16,
1343,
256,
17,
1343,
264,
17,
1343,
256,
18,
1343,
264,
18,
1343,
2644,
198,
6425,
25,
257,
1343,
275,
318,
262,
1673,
36686,
341,
286,
13042,
257,
290,
275,
13,
628,
220,
198,
198,
16281,
352,
25,
628,
198,
20560,
25,
264,
16,
796,
366,
64,
397,
535,
1600,
264,
17,
796,
366,
9945,
65,
6888,
1600,
264,
18,
796,
366,
64,
324,
11848,
66,
15630,
330,
1,
198,
26410,
25,
2081,
198,
16281,
362,
25,
198,
198,
20560,
25,
264,
16,
796,
366,
64,
397,
535,
1600,
264,
17,
796,
366,
9945,
65,
6888,
1600,
264,
18,
796,
366,
64,
324,
11848,
65,
330,
535,
1,
198,
26410,
25,
3991,
198,
16281,
513,
25,
198,
198,
20560,
25,
264,
16,
796,
366,
1600,
264,
17,
796,
366,
1600,
264,
18,
796,
13538,
198,
26410,
25,
2081,
198,
7061,
6,
198
] | 2.38806 | 268 |
for var_x in range(1,6):
print(var_x)
var_i = ["Apple","Banana","Pieapple","Orange","Lime"]
for var_x in var_i:
print(var_x)
food_info={"Food_1":"Apple","Food_2":"Banana","Food_3":"Pieapple","Food_4":"Mango","Food_5":"Orange","Food_6":"Lime"}
index_num1 = range(len(dict.keys(food_info)))
key_list =list(dict.keys(food_info))
print("Food Name"+"\t"+"Food List")
for var_x in index_num1:
print(key_list[var_x]+"\t\t"+food_info[key_list[var_x]])
| [
1640,
1401,
62,
87,
287,
2837,
7,
16,
11,
21,
2599,
201,
198,
220,
220,
220,
3601,
7,
7785,
62,
87,
8,
201,
198,
220,
220,
220,
220,
201,
198,
7785,
62,
72,
796,
14631,
16108,
2430,
30457,
2271,
2430,
48223,
18040,
2430,
40141,
2430,
43,
524,
8973,
201,
198,
1640,
1401,
62,
87,
287,
1401,
62,
72,
25,
201,
198,
220,
220,
220,
3601,
7,
7785,
62,
87,
8,
201,
198,
220,
220,
220,
220,
201,
198,
19425,
62,
10951,
28,
4895,
24602,
62,
16,
2404,
16108,
2430,
24602,
62,
17,
2404,
30457,
2271,
2430,
24602,
62,
18,
2404,
48223,
18040,
2430,
24602,
62,
19,
2404,
44,
14208,
2430,
24602,
62,
20,
2404,
40141,
2430,
24602,
62,
21,
2404,
43,
524,
20662,
201,
198,
9630,
62,
22510,
16,
796,
2837,
7,
11925,
7,
11600,
13,
13083,
7,
19425,
62,
10951,
22305,
201,
198,
2539,
62,
4868,
796,
4868,
7,
11600,
13,
13083,
7,
19425,
62,
10951,
4008,
201,
198,
220,
220,
201,
198,
4798,
7203,
24602,
6530,
1,
10,
1,
59,
83,
1,
10,
1,
24602,
7343,
4943,
201,
198,
220,
220,
201,
198,
1640,
1401,
62,
87,
287,
6376,
62,
22510,
16,
25,
201,
198,
220,
220,
220,
3601,
7,
2539,
62,
4868,
58,
7785,
62,
87,
48688,
1,
59,
83,
59,
83,
1,
10,
19425,
62,
10951,
58,
2539,
62,
4868,
58,
7785,
62,
87,
11907,
8,
201,
198
] | 2.099138 | 232 |
import graphene
from flask_graphql_auth import mutation_jwt_required, get_jwt_identity, AuthInfoField
from app.models import User, QuickMemo
from app.schema.unions import ResponseUnion
from app.schema.fields import ResponseMessageField
| [
11748,
42463,
198,
6738,
42903,
62,
34960,
13976,
62,
18439,
1330,
15148,
62,
73,
46569,
62,
35827,
11,
651,
62,
73,
46569,
62,
738,
414,
11,
26828,
12360,
15878,
198,
198,
6738,
598,
13,
27530,
1330,
11787,
11,
12029,
13579,
78,
198,
6738,
598,
13,
15952,
2611,
13,
403,
507,
1330,
18261,
38176,
198,
6738,
598,
13,
15952,
2611,
13,
25747,
1330,
18261,
12837,
15878,
628
] | 3.606061 | 66 |
from .imdb import get_movies
# TODO extract items from org mode? perhaps not very high priority
| [
6738,
764,
320,
9945,
1330,
651,
62,
76,
20526,
198,
198,
2,
16926,
46,
7925,
3709,
422,
8745,
4235,
30,
3737,
407,
845,
1029,
8475,
198
] | 3.730769 | 26 |
# Under MIT license, see LICENSE.txt
import numpy as np
from Util.geometry import wrap_to_pi
from Util.role import Role
from ai.Algorithm.evaluation_module import closest_players_to_point_except, ball_going_toward_player
from ai.GameDomainObjects import Player
from ai.STA.Strategy.graphless_strategy import GraphlessStrategy
from ai.STA.Tactic.go_kick import GoKick
from ai.STA.Tactic.goalkeeper import GoalKeeper
from ai.STA.Tactic.position_for_pass import PositionForPass
from ai.STA.Tactic.receive_pass import ReceivePass
from ai.STA.Tactic.stay_away_from_ball import StayAwayFromBall
from ai.STA.Tactic.tactic_constants import Flags
from ai.states.game_state import GameState
MAX_DISTANCE_TO_SWITCH_TO_RECEIVE_PASS = 1500
| [
2,
4698,
17168,
5964,
11,
766,
38559,
24290,
13,
14116,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
7273,
346,
13,
469,
15748,
1330,
14441,
62,
1462,
62,
14415,
198,
6738,
7273,
346,
13,
18090,
1330,
20934,
198,
6738,
257,
72,
13,
2348,
42289,
13,
18206,
2288,
62,
21412,
1330,
11706,
62,
32399,
62,
1462,
62,
4122,
62,
16341,
11,
2613,
62,
5146,
62,
83,
46138,
62,
7829,
198,
6738,
257,
72,
13,
8777,
43961,
10267,
82,
1330,
7853,
198,
6738,
257,
72,
13,
2257,
32,
13,
13290,
4338,
13,
34960,
1203,
62,
2536,
4338,
1330,
29681,
1203,
13290,
4338,
198,
6738,
257,
72,
13,
2257,
32,
13,
51,
12009,
13,
2188,
62,
24585,
1330,
1514,
45390,
198,
6738,
257,
72,
13,
2257,
32,
13,
51,
12009,
13,
35231,
13884,
1330,
25376,
42,
41278,
198,
6738,
257,
72,
13,
2257,
32,
13,
51,
12009,
13,
9150,
62,
1640,
62,
6603,
1330,
23158,
1890,
14478,
198,
6738,
257,
72,
13,
2257,
32,
13,
51,
12009,
13,
260,
15164,
62,
6603,
1330,
797,
15164,
14478,
198,
6738,
257,
72,
13,
2257,
32,
13,
51,
12009,
13,
31712,
62,
8272,
62,
6738,
62,
1894,
1330,
16160,
32,
1014,
4863,
23410,
198,
6738,
257,
72,
13,
2257,
32,
13,
51,
12009,
13,
83,
12009,
62,
9979,
1187,
1330,
34771,
198,
6738,
257,
72,
13,
27219,
13,
6057,
62,
5219,
1330,
3776,
9012,
198,
198,
22921,
62,
35,
8808,
19240,
62,
10468,
62,
17887,
31949,
62,
10468,
62,
2200,
5222,
9306,
62,
47924,
796,
20007,
628
] | 2.889328 | 253 |
# -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.Segment import Segment
from pyleecan.Classes.SurfLine import SurfLine
from pyleecan.Classes.LamHole import LamHole
from pyleecan.Classes.HoleM53 import HoleM53
from pyleecan.Classes.Magnet import Magnet
from numpy import exp, arcsin, ndarray, pi
from pyleecan.Methods.Slot.HoleM53 import Slot53InterError
# For AlmostEqual
DELTA = 1e-6
HoleM53_test = list()
HoleM53_test_error = list()
# Two hole
test_obj = LamHole(is_internal=True, Rext=80.2e-3, Rint=0)
test_obj.hole = list()
test_obj.hole.append(
HoleM53(
Zh=8, H0=0.02, H1=0.001, H2=0.01, H3=0.003, W1=0.005, W2=0, W3=0.01, W4=0.78
)
)
HoleM53_test.append(
{
"test_obj": test_obj,
"S_exp": 3.63836e-4,
"SM_exp": 0.0002,
"Rmin": 5.8879558e-2,
"Rmax": 7.92e-2,
"W5": 7.78324e-3,
}
)
# One hole
test_obj = LamHole(is_internal=True, Rext=80.2e-3, Rint=0)
test_obj.hole = list()
test_obj.hole.append(
HoleM53(Zh=8, H0=0.02, H1=0.001, H2=0.01, H3=0.003, W1=0, W2=0, W3=0.01, W4=0.78)
)
HoleM53_test.append(
{
"test_obj": test_obj,
"S_exp": 3.73158e-4,
"SM_exp": 0.0002,
"Rmin": 5.8523556e-2,
"Rmax": 7.92e-2,
"W5": 8.317707e-3,
}
)
# Error test
test_obj = LamHole(is_internal=True, Rext=80.2e-3, Rint=0)
test_obj.hole = list()
test_obj.hole.append(
HoleM53(Zh=8, H0=0.02, H1=0.001, H2=0.01, H3=0.003, W1=0, W2=0, W3=0.01, W4=0.78)
)
HoleM53_test_error.append(
{
"test_obj": test_obj,
"S_exp": 3.73158e-4,
"SM_exp": 0.0002,
"Rmin": 5.8523556e-2,
"Rmax": 7.92e-2,
"W5": 8.317707e-3,
}
)
@pytest.mark.METHODS
class Test_HoleM53_meth(object):
"""pytest for holeB53 methods"""
@pytest.mark.parametrize("test_dict", HoleM53_test)
def test_comp_surface(self, test_dict):
"""Check that the computation of the surface is correct"""
test_obj = test_dict["test_obj"]
result = test_obj.hole[0].comp_surface()
a = result
b = test_dict["S_exp"]
msg = "Return " + str(a) + " expected " + str(b)
assert abs((a - b) / a - 0) < DELTA, msg
@pytest.mark.parametrize("test_dict", HoleM53_test)
def test_comp_surface_mag(self, test_dict):
"""Check that the computation of the magnet surface is correct"""
test_obj = test_dict["test_obj"]
result = test_obj.hole[0].comp_surface_magnets()
a = result
b = test_dict["SM_exp"]
msg = "Return " + str(a) + " expected " + str(b)
assert abs((a - b) / a - 0) < DELTA, msg
@pytest.mark.parametrize("test_dict", HoleM53_test)
def test_comp_radius(self, test_dict):
"""Check that the computation of the radius is correct"""
test_obj = test_dict["test_obj"]
result = test_obj.hole[0].comp_radius()
a = result[0]
b = test_dict["Rmin"]
msg = "Return " + str(a) + " expected " + str(b)
assert abs((a - b) / a - 0) < DELTA, msg
a = result[1]
b = test_dict["Rmax"]
msg = "Return " + str(a) + " expected " + str(b)
assert abs((a - b) / a - 0) < DELTA, msg
@pytest.mark.parametrize("test_dict", HoleM53_test)
def test_comp_W5(self, test_dict):
"""Check that the computation of W5 iscorrect"""
test_obj = test_dict["test_obj"]
a = test_obj.hole[0].comp_W5()
b = test_dict["W5"]
msg = "Return " + str(a) + " expected " + str(b)
assert abs((a - b) / a - 0) < DELTA, msg
# Test that Z11 = Zlist[0]
test_obj2 = LamHole(is_internal=True, Rext=80.2e-3, Rint=0)
test_obj2.hole = list()
test_obj2.hole.append(
HoleM53(
Zh=8,
H0=0.00000000000000000000002,
H1=0.00000001,
H2=0.01,
H3=0.003,
W1=0,
W2=0,
W3=0.01,
W4=2.28,
)
)
a = test_obj2.hole[0].comp_W5()
assert -0.0014380265690122837 == a
@pytest.mark.parametrize("test_dict", HoleM53_test)
def test_build_geometry(self, test_dict):
"""Check that the build geometry method works"""
# is_simplified to True and magnetization Parallel
test_obj = test_dict["test_obj"]
test_obj.hole[0].magnet_0 = Magnet(type_magnetization=1)
test_obj.hole[0].magnet_1 = Magnet(type_magnetization=1)
a = test_obj.hole[0].build_geometry(is_simplified=True)
assert a[1].label == "HoleMagnet_Stator_Parallel_N_R0_T0_S0"
assert a[1].line_list[0] is not None
assert a[1].line_list[1] is not None
with pytest.raises(IndexError) as context:
a[1].line_list[2]
if test_obj.hole[0].W1 > 0:
assert a[4].label == "HoleMagnet_Stator_Parallel_N_R0_T1_S0"
assert a[4].line_list[0] is not None
assert a[4].line_list[1] is not None
with pytest.raises(IndexError) as context:
a[4].line_list[2]
else:
assert a[3].label == "HoleMagnet_Stator_Parallel_N_R0_T1_S0"
assert a[3].line_list[0] is not None
assert a[3].line_list[1] is not None
with pytest.raises(IndexError) as context:
a[3].line_list[2]
@pytest.mark.parametrize("test_dict", HoleM53_test_error)
def test_build_geometry_Z11_Z1_not_foundable(self, test_dict):
"""Check that the build geometry error works"""
test_obj = test_dict["test_obj"]
test_obj.hole[0] = HoleM53(
Zh=8,
H0=0.02,
H1=0.001,
H2=0.01,
H3=0.003,
W1=0.765149757,
W2=0.32542,
W3=0.0564,
W4=0.324,
)
# Z11
with pytest.raises(Slot53InterError) as context:
test_obj.hole[0].build_geometry()
test_obj.hole[0] = HoleM53(
Zh=8,
H0=50.02,
H1=10.0054456451,
H2=40.56456456401,
H3=0.968464003,
W1=10.0,
W2=0.14540,
W3=1.01546654654,
W4=0.05144,
)
# Z1
with pytest.raises(Slot53InterError) as context:
test_obj.hole[0].build_geometry()
@pytest.mark.parametrize("test_dict", HoleM53_test_error)
def test_build_geometry_Z11_Z1(self, test_dict):
"""Check nothing it's just for the coverage"""
test_obj = test_dict["test_obj"]
test_obj.hole[0] = HoleM53(
Zh=8, H0=0.02, H1=0.001, H2=0.01, H3=0.003, W1=0.005, W2=0, W3=0.01, W4=0.78
)
lst_pattern = test_obj.hole[0].build_geometry()
# Z11 = Zlist[0]
test_obj.hole[0] = HoleM53(
Zh=8,
H0=0.00000000000000000000002,
H1=0.00000001,
H2=0.01,
H3=0.003,
W1=0,
W2=0,
W3=0.01,
W4=2.28,
)
lst1 = test_obj.hole[0].build_geometry()
# Z1 = Zlist[0]
test_obj.hole[0] = HoleM53(
Zh=8,
H0=0.00000000000000000000002,
H1=0.00000001,
H2=0.01,
H3=0.003,
W1=0,
W2=0,
W3=0.01,
W4=4.78,
)
lst2 = test_obj.hole[0].build_geometry()
assert len(lst1) != len(lst_pattern)
assert len(lst2) != len(lst_pattern)
def test_comp_surface_magnet_id(self):
"""check that id is 0"""
hole = HoleM53(
Zh=8, H0=0.02, H1=0.001, H2=0.01, H3=0.003, W1=0.005, W2=0, W3=0.01, W4=0.78
)
assert hole.comp_surface_magnet_id(2) == 0
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
41030,
434,
1330,
1001,
5154,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
14214,
69,
13949,
1330,
43771,
13949,
198,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
43,
321,
39,
2305,
1330,
10923,
39,
2305,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
39,
2305,
44,
4310,
1330,
24478,
44,
4310,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
13436,
3262,
1330,
32079,
198,
6738,
299,
32152,
1330,
1033,
11,
44606,
259,
11,
299,
67,
18747,
11,
31028,
198,
198,
6738,
279,
2349,
721,
272,
13,
46202,
13,
38963,
13,
39,
2305,
44,
4310,
1330,
32026,
4310,
9492,
12331,
198,
198,
2,
1114,
16699,
36,
13255,
198,
35,
3698,
5603,
796,
352,
68,
12,
21,
198,
198,
39,
2305,
44,
4310,
62,
9288,
796,
1351,
3419,
198,
39,
2305,
44,
4310,
62,
9288,
62,
18224,
796,
1351,
3419,
198,
198,
2,
4930,
7604,
198,
9288,
62,
26801,
796,
10923,
39,
2305,
7,
271,
62,
32538,
28,
17821,
11,
797,
742,
28,
1795,
13,
17,
68,
12,
18,
11,
371,
600,
28,
15,
8,
198,
9288,
62,
26801,
13,
13207,
796,
1351,
3419,
198,
9288,
62,
26801,
13,
13207,
13,
33295,
7,
198,
220,
220,
220,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
367,
15,
28,
15,
13,
2999,
11,
367,
16,
28,
15,
13,
8298,
11,
367,
17,
28,
15,
13,
486,
11,
367,
18,
28,
15,
13,
11245,
11,
370,
16,
28,
15,
13,
22544,
11,
370,
17,
28,
15,
11,
370,
18,
28,
15,
13,
486,
11,
370,
19,
28,
15,
13,
3695,
198,
220,
220,
220,
1267,
198,
8,
198,
39,
2305,
44,
4310,
62,
9288,
13,
33295,
7,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
62,
26801,
1298,
1332,
62,
26801,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
50,
62,
11201,
1298,
513,
13,
21,
2548,
2623,
68,
12,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
12310,
62,
11201,
1298,
657,
13,
34215,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
49,
1084,
1298,
642,
13,
3459,
3720,
40486,
68,
12,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
49,
9806,
1298,
767,
13,
5892,
68,
12,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
54,
20,
1298,
767,
13,
3695,
33916,
68,
12,
18,
11,
198,
220,
220,
220,
1782,
198,
8,
198,
198,
2,
1881,
7604,
198,
9288,
62,
26801,
796,
10923,
39,
2305,
7,
271,
62,
32538,
28,
17821,
11,
797,
742,
28,
1795,
13,
17,
68,
12,
18,
11,
371,
600,
28,
15,
8,
198,
9288,
62,
26801,
13,
13207,
796,
1351,
3419,
198,
9288,
62,
26801,
13,
13207,
13,
33295,
7,
198,
220,
220,
220,
24478,
44,
4310,
7,
57,
71,
28,
23,
11,
367,
15,
28,
15,
13,
2999,
11,
367,
16,
28,
15,
13,
8298,
11,
367,
17,
28,
15,
13,
486,
11,
367,
18,
28,
15,
13,
11245,
11,
370,
16,
28,
15,
11,
370,
17,
28,
15,
11,
370,
18,
28,
15,
13,
486,
11,
370,
19,
28,
15,
13,
3695,
8,
198,
8,
198,
39,
2305,
44,
4310,
62,
9288,
13,
33295,
7,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
62,
26801,
1298,
1332,
62,
26801,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
50,
62,
11201,
1298,
513,
13,
4790,
21273,
68,
12,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
12310,
62,
11201,
1298,
657,
13,
34215,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
49,
1084,
1298,
642,
13,
5332,
1954,
37864,
68,
12,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
49,
9806,
1298,
767,
13,
5892,
68,
12,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
54,
20,
1298,
807,
13,
34125,
24038,
68,
12,
18,
11,
198,
220,
220,
220,
1782,
198,
8,
198,
198,
2,
13047,
1332,
198,
9288,
62,
26801,
796,
10923,
39,
2305,
7,
271,
62,
32538,
28,
17821,
11,
797,
742,
28,
1795,
13,
17,
68,
12,
18,
11,
371,
600,
28,
15,
8,
198,
9288,
62,
26801,
13,
13207,
796,
1351,
3419,
198,
9288,
62,
26801,
13,
13207,
13,
33295,
7,
198,
220,
220,
220,
24478,
44,
4310,
7,
57,
71,
28,
23,
11,
367,
15,
28,
15,
13,
2999,
11,
367,
16,
28,
15,
13,
8298,
11,
367,
17,
28,
15,
13,
486,
11,
367,
18,
28,
15,
13,
11245,
11,
370,
16,
28,
15,
11,
370,
17,
28,
15,
11,
370,
18,
28,
15,
13,
486,
11,
370,
19,
28,
15,
13,
3695,
8,
198,
8,
198,
39,
2305,
44,
4310,
62,
9288,
62,
18224,
13,
33295,
7,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
62,
26801,
1298,
1332,
62,
26801,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
50,
62,
11201,
1298,
513,
13,
4790,
21273,
68,
12,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
12310,
62,
11201,
1298,
657,
13,
34215,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
49,
1084,
1298,
642,
13,
5332,
1954,
37864,
68,
12,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
49,
9806,
1298,
767,
13,
5892,
68,
12,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
54,
20,
1298,
807,
13,
34125,
24038,
68,
12,
18,
11,
198,
220,
220,
220,
1782,
198,
8,
628,
198,
31,
9078,
9288,
13,
4102,
13,
49273,
50,
198,
4871,
6208,
62,
39,
2305,
44,
4310,
62,
76,
2788,
7,
15252,
2599,
198,
220,
220,
220,
37227,
9078,
9288,
329,
7604,
33,
4310,
5050,
37811,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
8,
198,
220,
220,
220,
825,
1332,
62,
5589,
62,
42029,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
326,
262,
29964,
286,
262,
4417,
318,
3376,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
5589,
62,
42029,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
1332,
62,
11600,
14692,
50,
62,
11201,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
366,
13615,
366,
1343,
965,
7,
64,
8,
1343,
366,
2938,
366,
1343,
965,
7,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2352,
19510,
64,
532,
275,
8,
1220,
257,
532,
657,
8,
1279,
28163,
5603,
11,
31456,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
8,
198,
220,
220,
220,
825,
1332,
62,
5589,
62,
42029,
62,
19726,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
326,
262,
29964,
286,
262,
19972,
4417,
318,
3376,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
5589,
62,
42029,
62,
76,
4660,
1039,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
1332,
62,
11600,
14692,
12310,
62,
11201,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
366,
13615,
366,
1343,
965,
7,
64,
8,
1343,
366,
2938,
366,
1343,
965,
7,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2352,
19510,
64,
532,
275,
8,
1220,
257,
532,
657,
8,
1279,
28163,
5603,
11,
31456,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
8,
198,
220,
220,
220,
825,
1332,
62,
5589,
62,
42172,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
326,
262,
29964,
286,
262,
16874,
318,
3376,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
5589,
62,
42172,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1255,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
1332,
62,
11600,
14692,
49,
1084,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
366,
13615,
366,
1343,
965,
7,
64,
8,
1343,
366,
2938,
366,
1343,
965,
7,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2352,
19510,
64,
532,
275,
8,
1220,
257,
532,
657,
8,
1279,
28163,
5603,
11,
31456,
628,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1255,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
1332,
62,
11600,
14692,
49,
9806,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
366,
13615,
366,
1343,
965,
7,
64,
8,
1343,
366,
2938,
366,
1343,
965,
7,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2352,
19510,
64,
532,
275,
8,
1220,
257,
532,
657,
8,
1279,
28163,
5603,
11,
31456,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
8,
198,
220,
220,
220,
825,
1332,
62,
5589,
62,
54,
20,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
326,
262,
29964,
286,
370,
20,
318,
30283,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
5589,
62,
54,
20,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
1332,
62,
11600,
14692,
54,
20,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
366,
13615,
366,
1343,
965,
7,
64,
8,
1343,
366,
2938,
366,
1343,
965,
7,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2352,
19510,
64,
532,
275,
8,
1220,
257,
532,
657,
8,
1279,
28163,
5603,
11,
31456,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
6208,
326,
1168,
1157,
796,
1168,
4868,
58,
15,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
17,
796,
10923,
39,
2305,
7,
271,
62,
32538,
28,
17821,
11,
797,
742,
28,
1795,
13,
17,
68,
12,
18,
11,
371,
600,
28,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
17,
13,
13207,
796,
1351,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
17,
13,
13207,
13,
33295,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
15,
28,
15,
13,
25645,
10535,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
16,
28,
15,
13,
10535,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
17,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
18,
28,
15,
13,
11245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
16,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
17,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
18,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
19,
28,
17,
13,
2078,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1332,
62,
26801,
17,
13,
13207,
58,
15,
4083,
5589,
62,
54,
20,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
532,
15,
13,
405,
21139,
1795,
22980,
3388,
486,
23815,
2718,
6624,
257,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
8,
198,
220,
220,
220,
825,
1332,
62,
11249,
62,
469,
15748,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
326,
262,
1382,
22939,
2446,
2499,
37811,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
318,
62,
14323,
489,
1431,
284,
6407,
290,
19972,
1634,
42945,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
19726,
3262,
62,
15,
796,
32079,
7,
4906,
62,
19726,
3262,
1634,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
19726,
3262,
62,
16,
796,
32079,
7,
4906,
62,
19726,
3262,
1634,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
11249,
62,
469,
15748,
7,
271,
62,
14323,
489,
1431,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
16,
4083,
18242,
6624,
366,
39,
2305,
13436,
3262,
62,
1273,
1352,
62,
10044,
29363,
62,
45,
62,
49,
15,
62,
51,
15,
62,
50,
15,
1,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
16,
4083,
1370,
62,
4868,
58,
15,
60,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
16,
4083,
1370,
62,
4868,
58,
16,
60,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
351,
12972,
9288,
13,
430,
2696,
7,
15732,
12331,
8,
355,
4732,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
58,
16,
4083,
1370,
62,
4868,
58,
17,
60,
628,
220,
220,
220,
220,
220,
220,
220,
611,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
54,
16,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
19,
4083,
18242,
6624,
366,
39,
2305,
13436,
3262,
62,
1273,
1352,
62,
10044,
29363,
62,
45,
62,
49,
15,
62,
51,
16,
62,
50,
15,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
19,
4083,
1370,
62,
4868,
58,
15,
60,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
19,
4083,
1370,
62,
4868,
58,
16,
60,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
12972,
9288,
13,
430,
2696,
7,
15732,
12331,
8,
355,
4732,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
58,
19,
4083,
1370,
62,
4868,
58,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
18,
4083,
18242,
6624,
366,
39,
2305,
13436,
3262,
62,
1273,
1352,
62,
10044,
29363,
62,
45,
62,
49,
15,
62,
51,
16,
62,
50,
15,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
18,
4083,
1370,
62,
4868,
58,
15,
60,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
257,
58,
18,
4083,
1370,
62,
4868,
58,
16,
60,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
12972,
9288,
13,
430,
2696,
7,
15732,
12331,
8,
355,
4732,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
58,
18,
4083,
1370,
62,
4868,
58,
17,
60,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
62,
18224,
8,
198,
220,
220,
220,
825,
1332,
62,
11249,
62,
469,
15748,
62,
57,
1157,
62,
57,
16,
62,
1662,
62,
9275,
540,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
326,
262,
1382,
22939,
4049,
2499,
37811,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
60,
796,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
15,
28,
15,
13,
2999,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
16,
28,
15,
13,
8298,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
17,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
18,
28,
15,
13,
11245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
16,
28,
15,
13,
29143,
19442,
39251,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
17,
28,
15,
13,
26582,
3682,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
18,
28,
15,
13,
2713,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
19,
28,
15,
13,
33916,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1168,
1157,
628,
220,
220,
220,
220,
220,
220,
220,
351,
12972,
9288,
13,
430,
2696,
7,
38963,
4310,
9492,
12331,
8,
355,
4732,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
11249,
62,
469,
15748,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
60,
796,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
15,
28,
1120,
13,
2999,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
16,
28,
940,
13,
405,
4051,
29228,
36330,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
17,
28,
1821,
13,
3980,
29228,
2231,
2414,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
18,
28,
15,
13,
38956,
44578,
11245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
16,
28,
940,
13,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
17,
28,
15,
13,
18781,
1821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
18,
28,
16,
13,
486,
4051,
2791,
4051,
39111,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
19,
28,
15,
13,
2713,
18444,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1168,
16,
198,
220,
220,
220,
220,
220,
220,
220,
351,
12972,
9288,
13,
430,
2696,
7,
38963,
4310,
9492,
12331,
8,
355,
4732,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
11249,
62,
469,
15748,
3419,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9288,
62,
11600,
1600,
24478,
44,
4310,
62,
9288,
62,
18224,
8,
198,
220,
220,
220,
825,
1332,
62,
11249,
62,
469,
15748,
62,
57,
1157,
62,
57,
16,
7,
944,
11,
1332,
62,
11600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
2147,
340,
338,
655,
329,
262,
5197,
37811,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
796,
1332,
62,
11600,
14692,
9288,
62,
26801,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
60,
796,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
367,
15,
28,
15,
13,
2999,
11,
367,
16,
28,
15,
13,
8298,
11,
367,
17,
28,
15,
13,
486,
11,
367,
18,
28,
15,
13,
11245,
11,
370,
16,
28,
15,
13,
22544,
11,
370,
17,
28,
15,
11,
370,
18,
28,
15,
13,
486,
11,
370,
19,
28,
15,
13,
3695,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
300,
301,
62,
33279,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
11249,
62,
469,
15748,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1168,
1157,
796,
1168,
4868,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
60,
796,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
15,
28,
15,
13,
25645,
10535,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
16,
28,
15,
13,
10535,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
17,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
18,
28,
15,
13,
11245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
16,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
17,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
18,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
19,
28,
17,
13,
2078,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
300,
301,
16,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
11249,
62,
469,
15748,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1168,
16,
796,
1168,
4868,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
26801,
13,
13207,
58,
15,
60,
796,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
15,
28,
15,
13,
25645,
10535,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
16,
28,
15,
13,
10535,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
17,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
18,
28,
15,
13,
11245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
16,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
17,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
18,
28,
15,
13,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
19,
28,
19,
13,
3695,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
300,
301,
17,
796,
1332,
62,
26801,
13,
13207,
58,
15,
4083,
11249,
62,
469,
15748,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
6818,
18896,
7,
75,
301,
16,
8,
14512,
18896,
7,
75,
301,
62,
33279,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
18896,
7,
75,
301,
17,
8,
14512,
18896,
7,
75,
301,
62,
33279,
8,
628,
220,
220,
220,
825,
1332,
62,
5589,
62,
42029,
62,
19726,
3262,
62,
312,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9122,
326,
4686,
318,
657,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
7604,
796,
24478,
44,
4310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10511,
28,
23,
11,
367,
15,
28,
15,
13,
2999,
11,
367,
16,
28,
15,
13,
8298,
11,
367,
17,
28,
15,
13,
486,
11,
367,
18,
28,
15,
13,
11245,
11,
370,
16,
28,
15,
13,
22544,
11,
370,
17,
28,
15,
11,
370,
18,
28,
15,
13,
486,
11,
370,
19,
28,
15,
13,
3695,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
7604,
13,
5589,
62,
42029,
62,
19726,
3262,
62,
312,
7,
17,
8,
6624,
657,
198
] | 1.787816 | 4,350 |
from .box_iou_rotated_cuda import box_iou_rotated
__all__ = ['box_iou_rotated']
| [
6738,
764,
3524,
62,
72,
280,
62,
10599,
515,
62,
66,
15339,
1330,
3091,
62,
72,
280,
62,
10599,
515,
198,
198,
834,
439,
834,
796,
37250,
3524,
62,
72,
280,
62,
10599,
515,
20520,
198
] | 2.25 | 36 |
import typing
| [
11748,
19720,
628
] | 5 | 3 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
""" This module uses oauth to allow applications and users access.
Supports 2-legged oauth for application requests, and for trusted
applications accessing user-restricted methods. Supports 3-legged
oauth for non-trusted applications that want to access user methods.
To use this module, add this to your settings.py:
SPOTSEEKER_AUTH_MODULE = spotseeker_server.auth.oauth
"""
from django.http import HttpResponse
from oauth_provider.utils import get_oauth_request, verify_oauth_request
from oauth_provider.store import store, InvalidConsumerError, InvalidTokenError
from spotseeker_server.models import TrustedOAuthClient
import logging
| [
2,
15069,
33448,
33436,
12,
2043,
11,
2059,
286,
2669,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
37811,
770,
8265,
3544,
267,
18439,
284,
1249,
5479,
290,
2985,
1895,
13,
198,
15979,
2096,
362,
12,
40898,
267,
18439,
329,
3586,
7007,
11,
290,
329,
13467,
198,
1324,
677,
602,
22534,
2836,
12,
49343,
5050,
13,
220,
45267,
513,
12,
40898,
198,
12162,
1071,
329,
1729,
12,
2213,
8459,
5479,
326,
765,
284,
1895,
2836,
5050,
13,
198,
198,
2514,
779,
428,
8265,
11,
751,
428,
284,
534,
6460,
13,
9078,
25,
198,
198,
4303,
2394,
36078,
42839,
62,
32,
24318,
62,
33365,
24212,
796,
4136,
325,
28233,
62,
15388,
13,
18439,
13,
12162,
1071,
198,
37811,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
198,
6738,
267,
18439,
62,
15234,
1304,
13,
26791,
1330,
651,
62,
12162,
1071,
62,
25927,
11,
11767,
62,
12162,
1071,
62,
25927,
198,
6738,
267,
18439,
62,
15234,
1304,
13,
8095,
1330,
3650,
11,
17665,
49106,
12331,
11,
17665,
30642,
12331,
198,
6738,
4136,
325,
28233,
62,
15388,
13,
27530,
1330,
833,
8459,
23621,
1071,
11792,
198,
198,
11748,
18931,
628,
198
] | 3.66 | 200 |
#!/usr/bin/env python
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from functools import partial
import os
import os.path as osp
from vai.dpuv1.rt.xdnn_io import loadImageBlobFromFileScriptBase
IMAGEROOT = osp.join(os.environ['HOME'], 'CK-TOOLS/dataset-imagenet-ilsvrc2012-val-min')
IMAGELIST = osp.join(os.environ['HOME'], 'CK-TOOLS/dataset-imagenet-ilsvrc2012-val-min/val.txt')
INPUT_NODES = 'input'
### Preprocessing formulas
### Available transformations: ['resize', 'resize2mindim', 'resize2maxdim', 'crop_letterbox',
### 'crop_center', 'plot', 'pxlscale', 'meansub', 'chtranspose', 'chswap']
CMD_SEQ = {
'resnet50_v1_tf':[
('meansub', [103.94, 116.78, 123.68]),
('chswap',(2,1,0)),
('resize', [256, 256]),
('crop_center', [224, 224]),
],
'inception_v1_tf':[
('pxlscale', 1/255.),
('meansub', 0.5),
('pxlscale', 2),
('resize', [256, 256]),
('crop_center', [224, 224]),
],
'inception_v3_tf':[
('pxlscale', 1/255.),
('meansub', 0.5),
('pxlscale', 2),
('resize', [342, 342]),
('crop_center', [299, 299]),
],
}
for name in CMD_SEQ:
globals()['input_fn_{}'.format(name)] = get_input_fn(name)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
13130,
1395,
346,
28413,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
198,
198,
6738,
410,
1872,
13,
26059,
14795,
16,
13,
17034,
13,
24954,
20471,
62,
952,
1330,
3440,
5159,
3629,
672,
4863,
8979,
7391,
14881,
198,
198,
3955,
4760,
34812,
2394,
796,
267,
2777,
13,
22179,
7,
418,
13,
268,
2268,
17816,
39069,
6,
4357,
705,
34,
42,
12,
10468,
3535,
50,
14,
19608,
292,
316,
12,
320,
11286,
316,
12,
4487,
85,
6015,
6999,
12,
2100,
12,
1084,
11537,
198,
3955,
4760,
3698,
8808,
796,
267,
2777,
13,
22179,
7,
418,
13,
268,
2268,
17816,
39069,
6,
4357,
705,
34,
42,
12,
10468,
3535,
50,
14,
19608,
292,
316,
12,
320,
11286,
316,
12,
4487,
85,
6015,
6999,
12,
2100,
12,
1084,
14,
2100,
13,
14116,
11537,
198,
1268,
30076,
62,
45,
3727,
1546,
796,
705,
15414,
6,
198,
198,
21017,
3771,
36948,
32126,
198,
21017,
14898,
38226,
25,
37250,
411,
1096,
3256,
705,
411,
1096,
17,
10155,
320,
3256,
705,
411,
1096,
17,
9806,
27740,
3256,
705,
31476,
62,
9291,
3524,
3256,
198,
21017,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
31476,
62,
16159,
3256,
705,
29487,
3256,
705,
8416,
75,
9888,
3256,
705,
1326,
504,
549,
3256,
705,
354,
7645,
3455,
3256,
705,
354,
2032,
499,
20520,
198,
198,
34,
12740,
62,
5188,
48,
220,
220,
220,
220,
220,
220,
220,
796,
1391,
198,
220,
220,
220,
705,
411,
3262,
1120,
62,
85,
16,
62,
27110,
10354,
58,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
1326,
504,
549,
3256,
685,
15197,
13,
5824,
11,
18693,
13,
3695,
11,
17031,
13,
3104,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
354,
2032,
499,
3256,
7,
17,
11,
16,
11,
15,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
411,
1096,
3256,
685,
11645,
11,
17759,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
31476,
62,
16159,
3256,
685,
24137,
11,
26063,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
705,
924,
1159,
62,
85,
16,
62,
27110,
10354,
58,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
8416,
75,
9888,
3256,
352,
14,
13381,
12179,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
1326,
504,
549,
3256,
657,
13,
20,
828,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
8416,
75,
9888,
3256,
362,
828,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
411,
1096,
3256,
685,
11645,
11,
17759,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
31476,
62,
16159,
3256,
685,
24137,
11,
26063,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
705,
924,
1159,
62,
85,
18,
62,
27110,
10354,
58,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
8416,
75,
9888,
3256,
352,
14,
13381,
12179,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
1326,
504,
549,
3256,
657,
13,
20,
828,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
8416,
75,
9888,
3256,
362,
828,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
411,
1096,
3256,
685,
31575,
11,
44341,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
31476,
62,
16159,
3256,
685,
22579,
11,
31011,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
1782,
198,
198,
1640,
1438,
287,
327,
12740,
62,
5188,
48,
25,
198,
220,
220,
220,
15095,
874,
3419,
17816,
15414,
62,
22184,
23330,
92,
4458,
18982,
7,
3672,
15437,
796,
651,
62,
15414,
62,
22184,
7,
3672,
8,
198
] | 2.336761 | 778 |
# -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
"""aihwkit example 20: MNIST training with PyTorch Distributed Data Parallel (DDP).
MNIST training example based on the paper:
https://www.frontiersin.org/articles/10.3389/fnins.2016.00333/full
Uses learning rates of η = 0.01, 0.005, and 0.0025
for epochs 0–10, 11–20, and 21–30, respectively.
"""
# pylint: disable=invalid-name
# pylint: disable=too-many-locals
import os
from time import time
# Imports from PyTorch.
import torch
from torch import nn
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.optim.lr_scheduler import StepLR
from torchvision import datasets, transforms
# Imports from aihwkit.
from aihwkit.nn import AnalogLinear, AnalogLinearMapped, AnalogSequential
from aihwkit.optim import AnalogSGD
from aihwkit.simulator.configs import InferenceRPUConfig
# Check device
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Path where the datasets will be stored.
PATH_DATASET = os.path.join('data', 'DATASET')
# Network definition.
INPUT_SIZE = 784
HIDDEN_SIZES = [256, 128]
OUTPUT_SIZE = 10
# Training parameters.
EPOCHS = 30
BATCH_SIZE = 64
def init_process(rank, size, fn, backend='nccl'):
""" Initialize the distributed environment. """
print("init process: ", rank)
os.environ['MASTER_ADDR'] = 'localhost'
os.environ['MASTER_PORT'] = '29411'
dist.init_process_group(backend, rank=rank, world_size=size)
fn()
def cleanup():
""" Destroy distributed processes once they are complete. """
dist.destroy_process_group()
def load_images():
"""Load images for train from the torchvision datasets."""
rank = dist.get_rank()
size = dist.get_world_size()
transform = transforms.Compose([transforms.ToTensor()])
# Load the images.
train_set = datasets.MNIST(PATH_DATASET,
download=True, train=True, transform=transform)
val_set = datasets.MNIST(PATH_DATASET,
download=True, train=False, transform=transform)
train_sampler = torch.utils.data.DistributedSampler(train_set, num_replicas=size, rank=rank,
shuffle=True, seed=42)
train_data = torch.utils.data.DataLoader(train_set,
batch_size=BATCH_SIZE,
shuffle=False,
num_workers=size,
sampler=train_sampler,
pin_memory=True)
validation_data = torch.utils.data.DataLoader(val_set,
batch_size=BATCH_SIZE,
shuffle=True,
num_workers=size,
pin_memory=True)
return train_data, validation_data
def create_analog_network(input_size, hidden_sizes, output_size):
"""Create the neural network using analog and digital layers.
Args:
input_size (int): size of the Tensor at the input.
hidden_sizes (list): list of sizes of the hidden layers (2 layers).
output_size (int): size of the Tensor at the output.
Returns:
nn.Module: created analog model
"""
model = AnalogSequential(
AnalogLinear(input_size, hidden_sizes[0], True,
rpu_config=InferenceRPUConfig()),
nn.Sigmoid(),
AnalogLinear(hidden_sizes[0], hidden_sizes[1], True,
rpu_config=InferenceRPUConfig()),
nn.Sigmoid(),
AnalogLinearMapped(hidden_sizes[1], output_size, True,
rpu_config=InferenceRPUConfig()),
nn.LogSoftmax(dim=1)
)
return model
def create_sgd_optimizer(model):
"""Create the analog-aware optimizer.
Args:
model (nn.Module): model to be trained.
Returns:
nn.Module: optimizer
"""
optimizer = AnalogSGD(model.parameters(), lr=0.05)
optimizer.regroup_param_groups(model)
return optimizer
def train(model, train_set):
"""Train the network.
Args:
model (nn.Module): model to be trained.
train_set (DataLoader): dataset of elements to use as input for training.
"""
rank = dist.get_rank()
size = dist.get_world_size()
device = torch.device('cuda', rank)
classifier = nn.NLLLoss()
optimizer = create_sgd_optimizer(model)
scheduler = StepLR(optimizer, step_size=10, gamma=0.5)
time_init = time()
total_time = [torch.zeros(1, dtype=torch.float).to(device) for _ in range(size)]
for epoch_number in range(EPOCHS):
total_loss = torch.zeros(1, dtype=torch.float).to(device)
total_images = torch.zeros(1, dtype=torch.int).to(device)
for images, labels in train_set:
images = images.to(device)
labels = labels.to(device)
# Flatten MNIST images into a 784 vector.
images = images.view(images.shape[0], -1)
optimizer.zero_grad()
# Add training Tensor to the model (input).
output = model(images)
loss = classifier(output, labels)
# Run training (backward propagation).
loss.backward()
# Optimize weights.
optimizer.step()
total_images += labels.size(0)
total_loss += loss.item() * labels.size(0)
dist.all_reduce(total_loss, op=dist.ReduceOp.SUM)
dist.all_reduce(total_images, op=dist.ReduceOp.SUM)
if rank == 0:
train_loss = total_loss.item() / total_images.item()
print('Epoch {} - Training loss: {:.16f}'.format(epoch_number, train_loss))
# Decay learning rate if needed.
scheduler.step()
dist.all_gather(total_time, torch.tensor(time()-time_init).to(device))
if rank == 0:
avg_train_time = torch.mean(torch.cat(total_time, 0))
print('\nAverage Training Time (s) = {}'.format(avg_train_time))
def test_evaluation(model, val_set):
"""Test trained network
Args:
model (nn.Model): Trained model to be evaluated
val_set (DataLoader): Validation set to perform the evaluation
"""
rank = dist.get_rank()
size = dist.get_world_size()
device = torch.device('cuda', rank)
# Setup counter of images predicted to 0.
predicted_ok = 0
total_images = 0
# make list to collect test ccuracies for each gpu
acc_list = [torch.zeros(1, dtype=torch.float).to(device) for _ in range(size)]
model.eval()
for images, labels in val_set:
# Predict image.
images = images.to(device)
labels = labels.to(device)
images = images.view(images.shape[0], -1)
pred = model(images)
_, predicted = torch.max(pred.data, 1)
total_images += labels.size(0)
predicted_ok += (predicted == labels).sum().item()
dist.all_gather(acc_list, torch.tensor(predicted_ok/total_images).to(device))
if rank == 0:
acc = torch.mean(torch.cat(acc_list, 0))
print('\nNumber Of Images Tested = {}'.format(total_images))
print('Model Accuracy = {}'.format(acc))
def main():
"""Train a PyTorch analog model with the MNIST dataset."""
rank = dist.get_rank()
device = torch.device('cuda', rank)
# Load datasets.
train_dataset, validation_dataset = load_images()
# Prepare the model.
model = create_analog_network(INPUT_SIZE, HIDDEN_SIZES, OUTPUT_SIZE)
if rank == 0:
print(model)
model.prepare_for_ddp()
model.to(device)
# enable parallel training
model = DDP(model, device_ids=[rank], output_device=rank)
# Train the model.
train(model, train_dataset)
# Evaluate the trained model.
test_evaluation(model, validation_dataset)
cleanup()
if __name__ == '__main__':
# Execute only if run as the entry point into the program
world_size = 2
print("Device count: ", world_size)
processes = []
ctx = mp.get_context("spawn")
for world_rank in range(world_size):
print("Process: ", world_rank)
p = ctx.Process(target=init_process, args=(world_rank, world_size, main))
p.start()
processes.append(p)
for p in processes:
p.join()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
357,
34,
8,
15069,
12131,
11,
33448,
19764,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
198,
2,
7330,
257,
4866,
286,
428,
5964,
287,
262,
38559,
24290,
13,
14116,
2393,
287,
262,
6808,
8619,
198,
2,
286,
428,
2723,
5509,
393,
379,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
13,
198,
2,
198,
2,
4377,
19008,
393,
27255,
2499,
286,
428,
2438,
1276,
12377,
428,
198,
2,
6634,
4003,
11,
290,
9518,
3696,
761,
284,
3283,
257,
4003,
12739,
198,
2,
326,
484,
423,
587,
14294,
422,
262,
47324,
13,
198,
198,
37811,
1872,
36599,
15813,
1672,
1160,
25,
29060,
8808,
3047,
351,
9485,
15884,
354,
4307,
6169,
6060,
42945,
357,
35,
6322,
737,
198,
198,
39764,
8808,
3047,
1672,
1912,
319,
262,
3348,
25,
198,
5450,
1378,
2503,
13,
8534,
3183,
259,
13,
2398,
14,
26845,
14,
940,
13,
2091,
4531,
14,
22184,
1040,
13,
5304,
13,
405,
20370,
14,
12853,
198,
198,
5842,
274,
4673,
3965,
286,
7377,
115,
796,
657,
13,
486,
11,
657,
13,
22544,
11,
290,
657,
13,
405,
1495,
198,
1640,
36835,
82,
657,
1906,
940,
11,
1367,
1906,
1238,
11,
290,
2310,
1906,
1270,
11,
8148,
13,
198,
37811,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
2,
279,
2645,
600,
25,
15560,
28,
18820,
12,
21834,
12,
17946,
874,
198,
198,
11748,
28686,
198,
6738,
640,
1330,
640,
198,
198,
2,
1846,
3742,
422,
9485,
15884,
354,
13,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
11748,
28034,
13,
16680,
541,
305,
919,
278,
355,
29034,
198,
6738,
28034,
13,
20471,
13,
1845,
29363,
1330,
4307,
6169,
6601,
10044,
29363,
355,
360,
6322,
198,
6738,
28034,
13,
40085,
13,
14050,
62,
1416,
704,
18173,
1330,
5012,
35972,
198,
198,
6738,
28034,
10178,
1330,
40522,
11,
31408,
628,
198,
2,
1846,
3742,
422,
257,
4449,
86,
15813,
13,
198,
6738,
257,
4449,
86,
15813,
13,
20471,
1330,
50088,
14993,
451,
11,
50088,
14993,
451,
44,
6320,
11,
50088,
44015,
1843,
198,
6738,
257,
4449,
86,
15813,
13,
40085,
1330,
50088,
38475,
35,
198,
6738,
257,
4449,
86,
15813,
13,
14323,
8927,
13,
11250,
82,
1330,
554,
4288,
49,
5105,
16934,
198,
198,
2,
6822,
3335,
198,
7206,
27389,
796,
28034,
13,
25202,
10786,
66,
15339,
6,
611,
28034,
13,
66,
15339,
13,
271,
62,
15182,
3419,
2073,
705,
36166,
11537,
198,
198,
2,
10644,
810,
262,
40522,
481,
307,
8574,
13,
198,
34219,
62,
35,
1404,
1921,
2767,
796,
28686,
13,
6978,
13,
22179,
10786,
7890,
3256,
705,
35,
1404,
1921,
2767,
11537,
198,
198,
2,
7311,
6770,
13,
198,
1268,
30076,
62,
33489,
796,
767,
5705,
198,
39,
2389,
41819,
62,
11584,
57,
1546,
796,
685,
11645,
11,
13108,
60,
198,
2606,
7250,
3843,
62,
33489,
796,
838,
198,
198,
2,
13614,
10007,
13,
198,
8905,
46,
3398,
50,
796,
1542,
198,
33,
11417,
62,
33489,
796,
5598,
628,
198,
4299,
2315,
62,
14681,
7,
43027,
11,
2546,
11,
24714,
11,
30203,
11639,
77,
535,
75,
6,
2599,
198,
220,
220,
220,
37227,
20768,
1096,
262,
9387,
2858,
13,
37227,
198,
220,
220,
220,
3601,
7203,
15003,
1429,
25,
33172,
4279,
8,
198,
220,
220,
220,
28686,
13,
268,
2268,
17816,
31180,
5781,
62,
2885,
7707,
20520,
796,
705,
36750,
6,
198,
220,
220,
220,
28686,
13,
268,
2268,
17816,
31180,
5781,
62,
15490,
20520,
796,
705,
27696,
1157,
6,
198,
220,
220,
220,
1233,
13,
15003,
62,
14681,
62,
8094,
7,
1891,
437,
11,
4279,
28,
43027,
11,
995,
62,
7857,
28,
7857,
8,
198,
220,
220,
220,
24714,
3419,
628,
198,
4299,
27425,
33529,
198,
220,
220,
220,
37227,
19448,
9387,
7767,
1752,
484,
389,
1844,
13,
37227,
198,
220,
220,
220,
1233,
13,
41659,
62,
14681,
62,
8094,
3419,
628,
198,
4299,
3440,
62,
17566,
33529,
198,
220,
220,
220,
37227,
8912,
4263,
329,
4512,
422,
262,
28034,
10178,
40522,
526,
15931,
198,
220,
220,
220,
4279,
796,
1233,
13,
1136,
62,
43027,
3419,
198,
220,
220,
220,
2546,
796,
1233,
13,
1136,
62,
6894,
62,
7857,
3419,
198,
220,
220,
220,
6121,
796,
31408,
13,
7293,
577,
26933,
7645,
23914,
13,
2514,
51,
22854,
3419,
12962,
628,
220,
220,
220,
1303,
8778,
262,
4263,
13,
198,
220,
220,
220,
4512,
62,
2617,
796,
40522,
13,
39764,
8808,
7,
34219,
62,
35,
1404,
1921,
2767,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4321,
28,
17821,
11,
4512,
28,
17821,
11,
6121,
28,
35636,
8,
628,
220,
220,
220,
1188,
62,
2617,
796,
40522,
13,
39764,
8808,
7,
34219,
62,
35,
1404,
1921,
2767,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4321,
28,
17821,
11,
4512,
28,
25101,
11,
6121,
28,
35636,
8,
628,
220,
220,
220,
4512,
62,
37687,
20053,
796,
28034,
13,
26791,
13,
7890,
13,
20344,
6169,
16305,
20053,
7,
27432,
62,
2617,
11,
997,
62,
35666,
44645,
28,
7857,
11,
4279,
28,
43027,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36273,
28,
17821,
11,
9403,
28,
3682,
8,
628,
220,
220,
220,
4512,
62,
7890,
796,
28034,
13,
26791,
13,
7890,
13,
6601,
17401,
7,
27432,
62,
2617,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
28,
33,
11417,
62,
33489,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36273,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
62,
22896,
28,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6072,
20053,
28,
27432,
62,
37687,
20053,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6757,
62,
31673,
28,
17821,
8,
628,
220,
220,
220,
21201,
62,
7890,
796,
28034,
13,
26791,
13,
7890,
13,
6601,
17401,
7,
2100,
62,
2617,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
28,
33,
11417,
62,
33489,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36273,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
62,
22896,
28,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6757,
62,
31673,
28,
17821,
8,
628,
220,
220,
220,
1441,
4512,
62,
7890,
11,
21201,
62,
7890,
628,
198,
4299,
2251,
62,
272,
11794,
62,
27349,
7,
15414,
62,
7857,
11,
7104,
62,
82,
4340,
11,
5072,
62,
7857,
2599,
198,
220,
220,
220,
37227,
16447,
262,
17019,
3127,
1262,
15075,
290,
4875,
11685,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
7857,
357,
600,
2599,
2546,
286,
262,
309,
22854,
379,
262,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7104,
62,
82,
4340,
357,
4868,
2599,
1351,
286,
10620,
286,
262,
7104,
11685,
357,
17,
11685,
737,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
7857,
357,
600,
2599,
2546,
286,
262,
309,
22854,
379,
262,
5072,
13,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
299,
77,
13,
26796,
25,
2727,
15075,
2746,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2746,
796,
50088,
44015,
1843,
7,
198,
220,
220,
220,
220,
220,
220,
220,
50088,
14993,
451,
7,
15414,
62,
7857,
11,
7104,
62,
82,
4340,
58,
15,
4357,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
19944,
62,
11250,
28,
818,
4288,
49,
5105,
16934,
3419,
828,
198,
220,
220,
220,
220,
220,
220,
220,
299,
77,
13,
50,
17225,
1868,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
50088,
14993,
451,
7,
30342,
62,
82,
4340,
58,
15,
4357,
7104,
62,
82,
4340,
58,
16,
4357,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
19944,
62,
11250,
28,
818,
4288,
49,
5105,
16934,
3419,
828,
198,
220,
220,
220,
220,
220,
220,
220,
299,
77,
13,
50,
17225,
1868,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
50088,
14993,
451,
44,
6320,
7,
30342,
62,
82,
4340,
58,
16,
4357,
5072,
62,
7857,
11,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
19944,
62,
11250,
28,
818,
4288,
49,
5105,
16934,
3419,
828,
198,
220,
220,
220,
220,
220,
220,
220,
299,
77,
13,
11187,
18380,
9806,
7,
27740,
28,
16,
8,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1441,
2746,
628,
198,
4299,
2251,
62,
82,
21287,
62,
40085,
7509,
7,
19849,
2599,
198,
220,
220,
220,
37227,
16447,
262,
15075,
12,
9685,
6436,
7509,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
357,
20471,
13,
26796,
2599,
2746,
284,
307,
8776,
13,
198,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
299,
77,
13,
26796,
25,
6436,
7509,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6436,
7509,
796,
50088,
38475,
35,
7,
19849,
13,
17143,
7307,
22784,
300,
81,
28,
15,
13,
2713,
8,
198,
220,
220,
220,
6436,
7509,
13,
2301,
3233,
62,
17143,
62,
24432,
7,
19849,
8,
628,
220,
220,
220,
1441,
6436,
7509,
628,
198,
4299,
4512,
7,
19849,
11,
4512,
62,
2617,
2599,
198,
220,
220,
220,
37227,
44077,
262,
3127,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
357,
20471,
13,
26796,
2599,
2746,
284,
307,
8776,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
2617,
357,
6601,
17401,
2599,
27039,
286,
4847,
284,
779,
355,
5128,
329,
3047,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4279,
796,
1233,
13,
1136,
62,
43027,
3419,
198,
220,
220,
220,
2546,
796,
1233,
13,
1136,
62,
6894,
62,
7857,
3419,
198,
220,
220,
220,
3335,
796,
28034,
13,
25202,
10786,
66,
15339,
3256,
4279,
8,
628,
220,
220,
220,
1398,
7483,
796,
299,
77,
13,
45,
3069,
43,
793,
3419,
198,
220,
220,
220,
6436,
7509,
796,
2251,
62,
82,
21287,
62,
40085,
7509,
7,
19849,
8,
198,
220,
220,
220,
6038,
18173,
796,
5012,
35972,
7,
40085,
7509,
11,
2239,
62,
7857,
28,
940,
11,
34236,
28,
15,
13,
20,
8,
628,
220,
220,
220,
640,
62,
15003,
796,
640,
3419,
198,
220,
220,
220,
2472,
62,
2435,
796,
685,
13165,
354,
13,
9107,
418,
7,
16,
11,
288,
4906,
28,
13165,
354,
13,
22468,
737,
1462,
7,
25202,
8,
329,
4808,
287,
2837,
7,
7857,
15437,
198,
220,
220,
220,
329,
36835,
62,
17618,
287,
2837,
7,
8905,
46,
3398,
50,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
22462,
796,
28034,
13,
9107,
418,
7,
16,
11,
288,
4906,
28,
13165,
354,
13,
22468,
737,
1462,
7,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
17566,
796,
28034,
13,
9107,
418,
7,
16,
11,
288,
4906,
28,
13165,
354,
13,
600,
737,
1462,
7,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4263,
11,
14722,
287,
4512,
62,
2617,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4263,
796,
4263,
13,
1462,
7,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14722,
796,
14722,
13,
1462,
7,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1610,
41769,
29060,
8808,
4263,
656,
257,
767,
5705,
15879,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4263,
796,
4263,
13,
1177,
7,
17566,
13,
43358,
58,
15,
4357,
532,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6436,
7509,
13,
22570,
62,
9744,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
3047,
309,
22854,
284,
262,
2746,
357,
15414,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
796,
2746,
7,
17566,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
796,
1398,
7483,
7,
22915,
11,
14722,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5660,
3047,
357,
1891,
904,
43594,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
13,
1891,
904,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
30011,
1096,
19590,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6436,
7509,
13,
9662,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
17566,
15853,
14722,
13,
7857,
7,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
22462,
15853,
2994,
13,
9186,
3419,
1635,
14722,
13,
7857,
7,
15,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1233,
13,
439,
62,
445,
7234,
7,
23350,
62,
22462,
11,
1034,
28,
17080,
13,
7738,
7234,
18257,
13,
50,
5883,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1233,
13,
439,
62,
445,
7234,
7,
23350,
62,
17566,
11,
1034,
28,
17080,
13,
7738,
7234,
18257,
13,
50,
5883,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
4279,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
22462,
796,
2472,
62,
22462,
13,
9186,
3419,
1220,
2472,
62,
17566,
13,
9186,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
13807,
5374,
23884,
532,
13614,
2994,
25,
46110,
13,
1433,
69,
92,
4458,
18982,
7,
538,
5374,
62,
17618,
11,
4512,
62,
22462,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
39087,
4673,
2494,
611,
2622,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6038,
18173,
13,
9662,
3419,
628,
220,
220,
220,
1233,
13,
439,
62,
70,
1032,
7,
23350,
62,
2435,
11,
28034,
13,
83,
22854,
7,
2435,
3419,
12,
2435,
62,
15003,
737,
1462,
7,
25202,
4008,
628,
220,
220,
220,
611,
4279,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
42781,
62,
27432,
62,
2435,
796,
28034,
13,
32604,
7,
13165,
354,
13,
9246,
7,
23350,
62,
2435,
11,
657,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
59,
77,
26287,
13614,
3862,
357,
82,
8,
796,
23884,
4458,
18982,
7,
615,
70,
62,
27432,
62,
2435,
4008,
628,
198,
4299,
1332,
62,
18206,
2288,
7,
19849,
11,
1188,
62,
2617,
2599,
198,
220,
220,
220,
37227,
14402,
8776,
3127,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
357,
20471,
13,
17633,
2599,
833,
1328,
2746,
284,
307,
16726,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
62,
2617,
357,
6601,
17401,
2599,
3254,
24765,
900,
284,
1620,
262,
12660,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4279,
796,
1233,
13,
1136,
62,
43027,
3419,
198,
220,
220,
220,
2546,
796,
1233,
13,
1136,
62,
6894,
62,
7857,
3419,
198,
220,
220,
220,
3335,
796,
28034,
13,
25202,
10786,
66,
15339,
3256,
4279,
8,
628,
220,
220,
220,
1303,
31122,
3753,
286,
4263,
11001,
284,
657,
13,
198,
220,
220,
220,
11001,
62,
482,
796,
657,
198,
220,
220,
220,
2472,
62,
17566,
796,
657,
628,
220,
220,
220,
1303,
787,
1351,
284,
2824,
1332,
269,
22019,
13433,
329,
1123,
308,
19944,
198,
220,
220,
220,
697,
62,
4868,
796,
685,
13165,
354,
13,
9107,
418,
7,
16,
11,
288,
4906,
28,
13165,
354,
13,
22468,
737,
1462,
7,
25202,
8,
329,
4808,
287,
2837,
7,
7857,
15437,
628,
220,
220,
220,
2746,
13,
18206,
3419,
628,
220,
220,
220,
329,
4263,
11,
14722,
287,
1188,
62,
2617,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
49461,
2939,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4263,
796,
4263,
13,
1462,
7,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
14722,
796,
14722,
13,
1462,
7,
25202,
8,
628,
220,
220,
220,
220,
220,
220,
220,
4263,
796,
4263,
13,
1177,
7,
17566,
13,
43358,
58,
15,
4357,
532,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2747,
796,
2746,
7,
17566,
8,
628,
220,
220,
220,
220,
220,
220,
220,
4808,
11,
11001,
796,
28034,
13,
9806,
7,
28764,
13,
7890,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
17566,
15853,
14722,
13,
7857,
7,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
11001,
62,
482,
15853,
357,
28764,
5722,
6624,
14722,
737,
16345,
22446,
9186,
3419,
628,
220,
220,
220,
1233,
13,
439,
62,
70,
1032,
7,
4134,
62,
4868,
11,
28034,
13,
83,
22854,
7,
28764,
5722,
62,
482,
14,
23350,
62,
17566,
737,
1462,
7,
25202,
4008,
628,
220,
220,
220,
611,
4279,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
697,
796,
28034,
13,
32604,
7,
13165,
354,
13,
9246,
7,
4134,
62,
4868,
11,
657,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
59,
77,
15057,
3226,
5382,
6208,
276,
796,
23884,
4458,
18982,
7,
23350,
62,
17566,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
17633,
33222,
796,
23884,
4458,
18982,
7,
4134,
4008,
628,
198,
4299,
1388,
33529,
198,
220,
220,
220,
37227,
44077,
257,
9485,
15884,
354,
15075,
2746,
351,
262,
29060,
8808,
27039,
526,
15931,
198,
220,
220,
220,
4279,
796,
1233,
13,
1136,
62,
43027,
3419,
198,
220,
220,
220,
3335,
796,
28034,
13,
25202,
10786,
66,
15339,
3256,
4279,
8,
628,
220,
220,
220,
1303,
8778,
40522,
13,
198,
220,
220,
220,
4512,
62,
19608,
292,
316,
11,
21201,
62,
19608,
292,
316,
796,
3440,
62,
17566,
3419,
628,
220,
220,
220,
1303,
43426,
262,
2746,
13,
198,
220,
220,
220,
2746,
796,
2251,
62,
272,
11794,
62,
27349,
7,
1268,
30076,
62,
33489,
11,
367,
2389,
41819,
62,
11584,
57,
1546,
11,
16289,
30076,
62,
33489,
8,
628,
220,
220,
220,
611,
4279,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
19849,
8,
628,
220,
220,
220,
2746,
13,
46012,
533,
62,
1640,
62,
1860,
79,
3419,
198,
220,
220,
220,
2746,
13,
1462,
7,
25202,
8,
628,
220,
220,
220,
1303,
7139,
10730,
3047,
198,
220,
220,
220,
2746,
796,
360,
6322,
7,
19849,
11,
3335,
62,
2340,
41888,
43027,
4357,
5072,
62,
25202,
28,
43027,
8,
628,
220,
220,
220,
1303,
16835,
262,
2746,
13,
198,
220,
220,
220,
4512,
7,
19849,
11,
4512,
62,
19608,
292,
316,
8,
628,
220,
220,
220,
1303,
26439,
4985,
262,
8776,
2746,
13,
198,
220,
220,
220,
1332,
62,
18206,
2288,
7,
19849,
11,
21201,
62,
19608,
292,
316,
8,
628,
220,
220,
220,
27425,
3419,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
8393,
1133,
691,
611,
1057,
355,
262,
5726,
966,
656,
262,
1430,
198,
220,
220,
220,
995,
62,
7857,
796,
362,
198,
220,
220,
220,
3601,
7203,
24728,
954,
25,
33172,
995,
62,
7857,
8,
198,
220,
220,
220,
7767,
796,
17635,
198,
220,
220,
220,
269,
17602,
796,
29034,
13,
1136,
62,
22866,
7203,
48183,
4943,
628,
220,
220,
220,
329,
995,
62,
43027,
287,
2837,
7,
6894,
62,
7857,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
18709,
25,
33172,
995,
62,
43027,
8,
198,
220,
220,
220,
220,
220,
220,
220,
279,
796,
269,
17602,
13,
18709,
7,
16793,
28,
15003,
62,
14681,
11,
26498,
16193,
6894,
62,
43027,
11,
995,
62,
7857,
11,
1388,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
279,
13,
9688,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
7767,
13,
33295,
7,
79,
8,
628,
220,
220,
220,
329,
279,
287,
7767,
25,
198,
220,
220,
220,
220,
220,
220,
220,
279,
13,
22179,
3419,
198
] | 2.329765 | 3,830 |
# coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
2237,
1330,
4731,
62,
19199,
11,
11629,
23814,
198,
6738,
1643,
76,
709,
259,
62,
15042,
62,
21282,
74,
13,
11321,
13,
1930,
9122,
1330,
1426,
9122,
62,
19849,
628
] | 3.043478 | 46 |
"""Maintain db function searchkey_first_name here."""
from alembic_utils.pg_function import PGFunction
sim_number = PGFunction(
schema="public",
signature="sim_number(actual_name character varying)",
definition="""
RETURNS numeric
LANGUAGE plpgsql
AS $function$
DECLARE
v_name VARCHAR(60);
v_sim_number DECIMAL;
BEGIN
v_name := regexp_replace(actual_name, '(.)\1{1,}', '\1', 'g');
if length((SELECT public.searchkey_last_name(v_name))) <= 3 then
v_sim_number := .65 ;
else
v_sim_number := .46 ;
end if;
return v_sim_number;
END
;
$function$;
"""
)
| [
37811,
44,
32725,
20613,
2163,
2989,
2539,
62,
11085,
62,
3672,
994,
526,
15931,
198,
6738,
31341,
2022,
291,
62,
26791,
13,
6024,
62,
8818,
1330,
350,
21713,
4575,
628,
198,
14323,
62,
17618,
796,
350,
21713,
4575,
7,
198,
220,
220,
220,
32815,
2625,
11377,
1600,
198,
220,
220,
220,
9877,
2625,
14323,
62,
17618,
7,
50039,
62,
3672,
2095,
15874,
42501,
198,
220,
220,
220,
6770,
2625,
15931,
198,
30826,
4261,
8035,
35575,
198,
406,
15567,
52,
11879,
458,
6024,
25410,
198,
1921,
720,
8818,
3,
198,
41374,
43,
12203,
198,
220,
220,
410,
62,
3672,
569,
31315,
1503,
7,
1899,
1776,
198,
220,
220,
410,
62,
14323,
62,
17618,
27196,
3955,
1847,
26,
198,
220,
347,
43312,
198,
220,
220,
220,
220,
410,
62,
3672,
19039,
40364,
79,
62,
33491,
7,
50039,
62,
3672,
11,
29513,
2014,
59,
16,
90,
16,
11,
92,
3256,
705,
59,
16,
3256,
705,
70,
24036,
628,
220,
220,
220,
220,
611,
4129,
19510,
46506,
1171,
13,
12947,
2539,
62,
12957,
62,
3672,
7,
85,
62,
3672,
22305,
19841,
513,
788,
198,
197,
410,
62,
14323,
62,
17618,
19039,
764,
2996,
2162,
198,
197,
2073,
198,
197,
410,
62,
14323,
62,
17618,
19039,
764,
3510,
2162,
198,
220,
220,
886,
611,
26,
198,
220,
1441,
410,
62,
14323,
62,
17618,
26,
198,
220,
23578,
198,
220,
220,
220,
2162,
220,
198,
220,
220,
220,
720,
8818,
3,
26,
198,
220,
220,
220,
37227,
198,
8,
198
] | 2.495902 | 244 |
from __future__ import absolute_import
from datetime import datetime
from mock import patch
import pytest
import pytz
from sentry.models import GroupRelease, Release
from sentry.testutils import TestCase, SnubaTestCase
from sentry.testutils.helpers.datetime import iso_format, before_now
from sentry.utils.snuba import (
_prepare_query_params,
get_snuba_translators,
zerofill,
get_json_type,
get_snuba_column_name,
detect_dataset,
transform_aliases_and_query,
Dataset,
SnubaQueryParams,
UnqualifiedQueryError,
)
class TransformAliasesAndQueryTransactionsTest(TestCase):
"""
This test mocks snuba.raw_query because there is currently no
way to insert data into the transactions dataset during tests.
"""
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
@patch("sentry.utils.snuba.raw_query")
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
15290,
1330,
8529,
198,
11748,
12972,
9288,
198,
11748,
12972,
22877,
198,
198,
6738,
1908,
563,
13,
27530,
1330,
4912,
26362,
11,
13868,
198,
6738,
1908,
563,
13,
9288,
26791,
1330,
6208,
20448,
11,
5489,
22013,
14402,
20448,
198,
6738,
1908,
563,
13,
9288,
26791,
13,
16794,
364,
13,
19608,
8079,
1330,
47279,
62,
18982,
11,
878,
62,
2197,
198,
6738,
1908,
563,
13,
26791,
13,
16184,
22013,
1330,
357,
198,
220,
220,
220,
4808,
46012,
533,
62,
22766,
62,
37266,
11,
198,
220,
220,
220,
651,
62,
16184,
22013,
62,
7645,
75,
2024,
11,
198,
220,
220,
220,
1976,
263,
1659,
359,
11,
198,
220,
220,
220,
651,
62,
17752,
62,
4906,
11,
198,
220,
220,
220,
651,
62,
16184,
22013,
62,
28665,
62,
3672,
11,
198,
220,
220,
220,
4886,
62,
19608,
292,
316,
11,
198,
220,
220,
220,
6121,
62,
7344,
1386,
62,
392,
62,
22766,
11,
198,
220,
220,
220,
16092,
292,
316,
11,
198,
220,
220,
220,
5489,
22013,
20746,
10044,
4105,
11,
198,
220,
220,
220,
791,
22557,
20746,
12331,
11,
198,
8,
628,
628,
198,
4871,
26981,
37893,
1386,
1870,
20746,
8291,
4658,
14402,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1332,
285,
3320,
3013,
22013,
13,
1831,
62,
22766,
780,
612,
318,
3058,
645,
198,
220,
220,
220,
835,
284,
7550,
1366,
656,
262,
8945,
27039,
1141,
5254,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
220,
220,
220,
2488,
17147,
7203,
82,
13000,
13,
26791,
13,
16184,
22013,
13,
1831,
62,
22766,
4943,
628,
198
] | 2.722628 | 411 |
"""
Perona-Malik anisotropic smoothing filter [Sergeevich]_.
.. [Sergeevich] Employing the Perona - Malik anisotropic filter for the problem of landing site detection: https://github.com/Galarius/pm-ocl
"""
import logging
from math import ceil
import os
import cupy as cp
import numpy as np
from utoolbox.parallel import RawKernelFile
__all__ = ["PeronaMalik2D", "PeronaMalik3D"]
logger = logging.getLogger(__name__)
class PeronaMalik2D(object):
"""
Perona-Malik anisotropic smoothing filter in 2D.
Args:
threshold (float, optional): Conduction function threshold.
niter (float, optiona): Number of iterations.
tile_width (int, optional): Tile size during kernel launch.
"""
def __call__(self, x, in_place=True):
"""
Args:
x (cp.ndarray): Input data.
in_place (bool, optional): Write result into provided array.
"""
ny, nx = x.shape
grid_sz = (int(ceil(nx / self._tile_width)), int(ceil(ny / self._tile_width)))
in_buf = x if in_place else cp.copy(x)
out_buf = cp.empty_like(in_buf)
for _ in range(self._niter):
self._kernels["perona_malik_2d_kernel"](
grid_sz,
(self._tile_width,) * 2,
(out_buf, in_buf, np.float32(self._threshold), nx, ny),
)
in_buf, out_buf = out_buf, in_buf
return in_buf
class PeronaMalik3D(object):
"""
Perona-Malik anisotropic smoothing filter in 3D.
Args:
threshold (float, optional): Conduction function threshold.
niter (float, optiona): Number of iterations.
tile_width (int, optional): Tile size during kernel launch.
"""
def __call__(self, x, in_place=True):
"""
Args:
x (cp.ndarray): Input data.
in_place (bool, optional): Write result into provided array.
"""
nz, ny, nx = x.shape
grid_sz = (
int(ceil(nx / self._tile_width)),
int(ceil(ny / self._tile_width)),
int(ceil(nz / self._tile_width)),
)
in_buf = x if in_place else cp.copy(x)
out_buf = cp.empty_like(in_buf)
for _ in range(self._niter):
self._kernels["perona_malik_3d_kernel"](
grid_sz,
(self._tile_width,) * 3,
(out_buf, in_buf, np.float32(self._threshold), nx, ny, nz),
)
in_buf, out_buf = out_buf, in_buf
return in_buf
if __name__ == "__main__":
from imageio import volread, volwrite
from utoolbox.exposure.rescale_intensity import RescaleIntensity
in_data = volread("mito.tif")
_, _, nc = in_data.shape
pm = PeronaMalik3D(threshold=10, niter=16)
in_data = in_data.astype(np.float32)
in_data = cp.asarray(in_data)
out_data = pm(in_data)
ri = RescaleIntensity()
out_data = ri(out_data, out_range=np.uint16)
out_data = cp.asnumpy(out_data)
out_data = out_data.astype(np.uint16)
volwrite("result.tif", out_data)
| [
37811,
198,
5990,
4450,
12,
15029,
1134,
281,
271,
46084,
32746,
722,
8106,
685,
7089,
469,
1990,
488,
60,
44807,
198,
198,
492,
685,
7089,
469,
1990,
488,
60,
12645,
278,
262,
2448,
4450,
532,
31745,
281,
271,
46084,
8106,
329,
262,
1917,
286,
9581,
2524,
13326,
25,
3740,
1378,
12567,
13,
785,
14,
26552,
19897,
14,
4426,
12,
38679,
198,
37811,
198,
11748,
18931,
198,
6738,
10688,
1330,
2906,
346,
198,
11748,
28686,
198,
198,
11748,
6508,
88,
355,
31396,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
3384,
970,
3524,
13,
1845,
29363,
1330,
16089,
42,
7948,
8979,
198,
198,
834,
439,
834,
796,
14631,
5990,
4450,
15029,
1134,
17,
35,
1600,
366,
5990,
4450,
15029,
1134,
18,
35,
8973,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4871,
2448,
4450,
15029,
1134,
17,
35,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2448,
4450,
12,
15029,
1134,
281,
271,
46084,
32746,
722,
8106,
287,
362,
35,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11387,
357,
22468,
11,
11902,
2599,
9724,
8110,
2163,
11387,
13,
198,
220,
220,
220,
220,
220,
220,
220,
299,
2676,
357,
22468,
11,
3038,
64,
2599,
7913,
286,
34820,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17763,
62,
10394,
357,
600,
11,
11902,
2599,
47870,
2546,
1141,
9720,
4219,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
13345,
834,
7,
944,
11,
2124,
11,
287,
62,
5372,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
357,
13155,
13,
358,
18747,
2599,
23412,
1366,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
62,
5372,
357,
30388,
11,
11902,
2599,
19430,
1255,
656,
2810,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
299,
88,
11,
299,
87,
796,
2124,
13,
43358,
198,
220,
220,
220,
220,
220,
220,
220,
10706,
62,
82,
89,
796,
357,
600,
7,
344,
346,
7,
77,
87,
1220,
2116,
13557,
40927,
62,
10394,
36911,
493,
7,
344,
346,
7,
3281,
1220,
2116,
13557,
40927,
62,
10394,
22305,
628,
220,
220,
220,
220,
220,
220,
220,
287,
62,
29325,
796,
2124,
611,
287,
62,
5372,
2073,
31396,
13,
30073,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
503,
62,
29325,
796,
31396,
13,
28920,
62,
2339,
7,
259,
62,
29325,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4808,
287,
2837,
7,
944,
13557,
77,
2676,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
74,
44930,
14692,
525,
4450,
62,
7617,
1134,
62,
17,
67,
62,
33885,
8973,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
62,
82,
89,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
944,
13557,
40927,
62,
10394,
35751,
1635,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
448,
62,
29325,
11,
287,
62,
29325,
11,
45941,
13,
22468,
2624,
7,
944,
13557,
400,
10126,
828,
299,
87,
11,
299,
88,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
62,
29325,
11,
503,
62,
29325,
796,
503,
62,
29325,
11,
287,
62,
29325,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
287,
62,
29325,
628,
198,
4871,
2448,
4450,
15029,
1134,
18,
35,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2448,
4450,
12,
15029,
1134,
281,
271,
46084,
32746,
722,
8106,
287,
513,
35,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11387,
357,
22468,
11,
11902,
2599,
9724,
8110,
2163,
11387,
13,
198,
220,
220,
220,
220,
220,
220,
220,
299,
2676,
357,
22468,
11,
3038,
64,
2599,
7913,
286,
34820,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17763,
62,
10394,
357,
600,
11,
11902,
2599,
47870,
2546,
1141,
9720,
4219,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
13345,
834,
7,
944,
11,
2124,
11,
287,
62,
5372,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
357,
13155,
13,
358,
18747,
2599,
23412,
1366,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
62,
5372,
357,
30388,
11,
11902,
2599,
19430,
1255,
656,
2810,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
299,
89,
11,
299,
88,
11,
299,
87,
796,
2124,
13,
43358,
198,
220,
220,
220,
220,
220,
220,
220,
10706,
62,
82,
89,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
7,
344,
346,
7,
77,
87,
1220,
2116,
13557,
40927,
62,
10394,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
7,
344,
346,
7,
3281,
1220,
2116,
13557,
40927,
62,
10394,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
7,
344,
346,
7,
27305,
1220,
2116,
13557,
40927,
62,
10394,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
287,
62,
29325,
796,
2124,
611,
287,
62,
5372,
2073,
31396,
13,
30073,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
503,
62,
29325,
796,
31396,
13,
28920,
62,
2339,
7,
259,
62,
29325,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4808,
287,
2837,
7,
944,
13557,
77,
2676,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
74,
44930,
14692,
525,
4450,
62,
7617,
1134,
62,
18,
67,
62,
33885,
8973,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
62,
82,
89,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
944,
13557,
40927,
62,
10394,
35751,
1635,
513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
448,
62,
29325,
11,
287,
62,
29325,
11,
45941,
13,
22468,
2624,
7,
944,
13557,
400,
10126,
828,
299,
87,
11,
299,
88,
11,
299,
89,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
62,
29325,
11,
503,
62,
29325,
796,
503,
62,
29325,
11,
287,
62,
29325,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
287,
62,
29325,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
422,
2939,
952,
1330,
2322,
961,
11,
2322,
13564,
198,
220,
220,
220,
422,
3384,
970,
3524,
13,
1069,
26205,
13,
411,
38765,
62,
47799,
1330,
1874,
38765,
5317,
6377,
628,
220,
220,
220,
287,
62,
7890,
796,
2322,
961,
7203,
2781,
78,
13,
49929,
4943,
628,
220,
220,
220,
4808,
11,
4808,
11,
299,
66,
796,
287,
62,
7890,
13,
43358,
198,
220,
220,
220,
9114,
796,
2448,
4450,
15029,
1134,
18,
35,
7,
400,
10126,
28,
940,
11,
299,
2676,
28,
1433,
8,
628,
220,
220,
220,
287,
62,
7890,
796,
287,
62,
7890,
13,
459,
2981,
7,
37659,
13,
22468,
2624,
8,
198,
220,
220,
220,
287,
62,
7890,
796,
31396,
13,
292,
18747,
7,
259,
62,
7890,
8,
628,
220,
220,
220,
503,
62,
7890,
796,
9114,
7,
259,
62,
7890,
8,
628,
220,
220,
220,
374,
72,
796,
1874,
38765,
5317,
6377,
3419,
198,
220,
220,
220,
503,
62,
7890,
796,
374,
72,
7,
448,
62,
7890,
11,
503,
62,
9521,
28,
37659,
13,
28611,
1433,
8,
628,
220,
220,
220,
503,
62,
7890,
796,
31396,
13,
292,
77,
32152,
7,
448,
62,
7890,
8,
198,
220,
220,
220,
503,
62,
7890,
796,
503,
62,
7890,
13,
459,
2981,
7,
37659,
13,
28611,
1433,
8,
628,
220,
220,
220,
2322,
13564,
7203,
20274,
13,
49929,
1600,
503,
62,
7890,
8,
198
] | 2.139972 | 1,436 |
from collections import namedtuple
Transition = namedtuple("Transition", ("state", "action", "reward", "done", "new_state"))
class BaseBuffer:
"""
Base class for replay buffer.
"""
def __init__(self, size, batch_size=32, n_step=0):
"""
Initialize replay buffer.
Args:
size: Buffer maximum size.
batch_size: Size of the batch that should be used in get_sample() implementation.
n_step: The reward after n_step after applying discount factor
"""
assert size > 0, f'Buffer size should be > 0, got {size}'
assert batch_size > 0, f'Buffer batch size should be > 0, got {batch_size}'
assert (
batch_size <= size
), f'Buffer batch size `{batch_size}` should be <= size `{size}`'
self.size = size
self.batch_size = batch_size
self.n_step = n_step
self.current_size = 0
def append(self, *args):
"""
Add experience to buffer.
Args:
*args: Items to store, types are implementation specific.
"""
raise NotImplementedError(
f'append() should be implemented by {self.__class__.__name__} subclasses'
)
def get_sample_indices(self):
"""
Random sample indices from stored experience.
:return:
List of batch_size indices.
"""
raise NotImplementedError(
f'get_sample_indices() should be implemented by {self.__class__.__name__} subclasses'
)
def get_sample(self, indices):
"""
Sample from stored experience.
Args:
*indices: The indices of getting samo
Returns:
Sample as numpy array.
"""
raise NotImplementedError(
f'get_sample() should be implemented by {self.__class__.__name__} subclasses'
)
| [
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
8291,
653,
796,
3706,
83,
29291,
7203,
8291,
653,
1600,
5855,
5219,
1600,
366,
2673,
1600,
366,
260,
904,
1600,
366,
28060,
1600,
366,
3605,
62,
5219,
48774,
628,
198,
4871,
7308,
28632,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7308,
1398,
329,
24788,
11876,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2546,
11,
15458,
62,
7857,
28,
2624,
11,
299,
62,
9662,
28,
15,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
20768,
1096,
24788,
11876,
13,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
25,
47017,
5415,
2546,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
25,
12849,
286,
262,
15458,
326,
815,
307,
973,
287,
651,
62,
39873,
3419,
7822,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
62,
9662,
25,
383,
6721,
706,
299,
62,
9662,
706,
11524,
9780,
5766,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2546,
1875,
657,
11,
277,
6,
28632,
2546,
815,
307,
1875,
657,
11,
220,
1392,
1391,
7857,
92,
6,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
15458,
62,
7857,
1875,
657,
11,
277,
6,
28632,
15458,
2546,
815,
307,
1875,
657,
11,
1392,
1391,
43501,
62,
7857,
92,
6,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
19841,
2546,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
277,
6,
28632,
15458,
2546,
4600,
90,
43501,
62,
7857,
92,
63,
815,
307,
19841,
2546,
4600,
90,
7857,
92,
63,
6,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7857,
796,
2546,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43501,
62,
7857,
796,
15458,
62,
7857,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
77,
62,
9662,
796,
299,
62,
9662,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
14421,
62,
7857,
796,
657,
628,
220,
220,
220,
825,
24443,
7,
944,
11,
1635,
22046,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3060,
1998,
284,
11876,
13,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
22046,
25,
17230,
284,
3650,
11,
3858,
389,
7822,
2176,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
1892,
3546,
1154,
12061,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
33295,
3419,
815,
307,
9177,
416,
1391,
944,
13,
834,
4871,
834,
13,
834,
3672,
834,
92,
850,
37724,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
651,
62,
39873,
62,
521,
1063,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
14534,
6291,
36525,
422,
8574,
1998,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7343,
286,
15458,
62,
7857,
36525,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
1892,
3546,
1154,
12061,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
1136,
62,
39873,
62,
521,
1063,
3419,
815,
307,
9177,
416,
1391,
944,
13,
834,
4871,
834,
13,
834,
3672,
834,
92,
850,
37724,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
651,
62,
39873,
7,
944,
11,
36525,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27565,
422,
8574,
1998,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
521,
1063,
25,
383,
36525,
286,
1972,
6072,
78,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27565,
355,
299,
32152,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
1892,
3546,
1154,
12061,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
1136,
62,
39873,
3419,
815,
307,
9177,
416,
1391,
944,
13,
834,
4871,
834,
13,
834,
3672,
834,
92,
850,
37724,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198
] | 2.27512 | 836 |
from office365.runtime.client_value import ClientValue
class SharePointIds(ClientValue):
"""The SharePointIds resource groups the various identifiers for an item stored in a SharePoint site or OneDrive
for Business into a single structure. """
| [
6738,
2607,
24760,
13,
43282,
13,
16366,
62,
8367,
1330,
20985,
11395,
628,
198,
4871,
8734,
12727,
7390,
82,
7,
11792,
11395,
2599,
198,
220,
220,
220,
37227,
464,
8734,
12727,
7390,
82,
8271,
2628,
262,
2972,
42814,
329,
281,
2378,
8574,
287,
257,
8734,
12727,
2524,
393,
1881,
24825,
198,
220,
220,
220,
329,
7320,
656,
257,
2060,
4645,
13,
37227,
198
] | 4.031746 | 63 |
import random
| [
11748,
4738,
628
] | 5 | 3 |
import chess.uci
import sys
import os
###########################################
########## UCI config functions ###########
###########################################
def write_config(opt, file):
"""Export options dictionnary to config file."""
for key, value in opt.items():
if key.lower() == "multipv":
continue
file.write("{:s} = {:s}\n".format(str(key), str(value)))
def update_options_from_config(opt, file):
"""Read a config and update dictionnary opt"""
data = file.readlines()
for line in data:
key, val = line.split('=')
opt[key.strip()] = val.strip() #remove whitespace
return opt
def default_options(engine):
"""Returns a dictionnary containing all engine options at their default value"""
Options = engine.options
ret = dict()
for e in Options:
ret[Options[e].name] = Options[e].default
return ret
def load_options(engine, config):
"""
Load engine uci options from config,
if no config exists will create one.
Returns a tuple : (config , boolean containing whereas or not we used a default config)"""
if config == "<autodiscover>": #no config provided
engine_name = engine.name.split()[0] # first string in name
config = engine_name + ".cfg"
if not os.path.isfile(config): # no existing config file
print("\n!Warning: No config file for {:s} detected, creating one. Default values used.\n".format(engine_name))
f = open(config, "w")
opt = default_options(engine)
write_config(opt, f) # exporting config to file
return (opt, True)
if os.path.isfile(config): # custom or default config exists
opt = default_options(engine)
f = open(config, "r")
update_options_from_config(opt, f)
return (opt, False)
else: #no config found
sys.stderr.write("!!Error: config {:s} doesn't exists ! Exiting...\n")
sys.exit(-2)
| [
11748,
19780,
13,
42008,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
29113,
7804,
21017,
198,
7804,
2235,
14417,
40,
4566,
5499,
1303,
7804,
2235,
198,
29113,
7804,
21017,
198,
198,
4299,
3551,
62,
11250,
7,
8738,
11,
2393,
2599,
198,
220,
220,
220,
37227,
43834,
3689,
48589,
77,
560,
284,
4566,
2393,
526,
15931,
198,
220,
220,
220,
329,
1994,
11,
1988,
287,
2172,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
13,
21037,
3419,
6624,
366,
16680,
541,
85,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
7203,
90,
25,
82,
92,
796,
46110,
82,
32239,
77,
1911,
18982,
7,
2536,
7,
2539,
828,
965,
7,
8367,
22305,
198,
198,
4299,
4296,
62,
25811,
62,
6738,
62,
11250,
7,
8738,
11,
2393,
2599,
198,
220,
220,
220,
37227,
5569,
257,
4566,
290,
4296,
48589,
77,
560,
2172,
37811,
198,
220,
220,
220,
1366,
796,
2393,
13,
961,
6615,
3419,
198,
220,
220,
220,
329,
1627,
287,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1994,
11,
1188,
796,
1627,
13,
35312,
10786,
28,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2172,
58,
2539,
13,
36311,
3419,
60,
796,
1188,
13,
36311,
3419,
1303,
28956,
13216,
10223,
628,
220,
220,
220,
1441,
2172,
198,
198,
4299,
4277,
62,
25811,
7,
18392,
2599,
198,
220,
220,
220,
37227,
35561,
257,
48589,
77,
560,
7268,
477,
3113,
3689,
379,
511,
4277,
1988,
37811,
198,
220,
220,
220,
18634,
796,
3113,
13,
25811,
198,
220,
220,
220,
1005,
796,
8633,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
329,
304,
287,
18634,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1005,
58,
29046,
58,
68,
4083,
3672,
60,
796,
18634,
58,
68,
4083,
12286,
628,
220,
220,
220,
1441,
1005,
198,
198,
4299,
3440,
62,
25811,
7,
18392,
11,
4566,
2599,
198,
220,
220,
220,
37227,
220,
198,
220,
220,
220,
8778,
3113,
334,
979,
3689,
422,
4566,
11,
220,
198,
220,
220,
220,
611,
645,
4566,
7160,
481,
2251,
530,
13,
220,
198,
220,
220,
220,
16409,
257,
46545,
1058,
357,
11250,
837,
25131,
7268,
9472,
393,
407,
356,
973,
257,
4277,
4566,
8,
37811,
198,
220,
220,
220,
611,
4566,
6624,
33490,
2306,
375,
29392,
29,
1298,
1303,
3919,
4566,
2810,
198,
220,
220,
220,
220,
220,
220,
220,
3113,
62,
3672,
796,
3113,
13,
3672,
13,
35312,
3419,
58,
15,
60,
1303,
717,
4731,
287,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
4566,
796,
3113,
62,
3672,
1343,
27071,
37581,
1,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
4468,
576,
7,
11250,
2599,
1303,
645,
4683,
4566,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
59,
77,
0,
20361,
25,
1400,
4566,
2393,
329,
46110,
82,
92,
12326,
11,
4441,
530,
13,
15161,
3815,
973,
13,
59,
77,
1911,
18982,
7,
18392,
62,
3672,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
796,
1280,
7,
11250,
11,
366,
86,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2172,
796,
4277,
62,
25811,
7,
18392,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
11250,
7,
8738,
11,
277,
8,
1303,
39133,
4566,
284,
2393,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
8738,
11,
6407,
8,
628,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
11250,
2599,
1303,
2183,
393,
4277,
4566,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
2172,
796,
4277,
62,
25811,
7,
18392,
8,
628,
220,
220,
220,
220,
220,
220,
220,
277,
796,
1280,
7,
11250,
11,
366,
81,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
4296,
62,
25811,
62,
6738,
62,
11250,
7,
8738,
11,
277,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
8738,
11,
10352,
8,
628,
220,
220,
220,
2073,
25,
1303,
3919,
4566,
1043,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
301,
1082,
81,
13,
13564,
7203,
3228,
12331,
25,
4566,
46110,
82,
92,
1595,
470,
7160,
5145,
1475,
1780,
986,
59,
77,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
32590,
17,
8,
198
] | 2.7 | 740 |
from abstract_factory.factories.furniture_factory import FurnitureFactory
from abstract_factory.factories.modern_furniture_factory import ModernFurnitureFactory
from abstract_factory.factories.victorian_furniture_factory import VictorianFurnitureFactory
'''
Abstract Factory is a creational design pattern that lets you produce families
of related objects without specifying their concrete classes.
Chair, Sofa, Coffee Table X Modern, Victorian
'''
def client_code(factory: FurnitureFactory) -> None:
"""
The client code works with factories and products only through abstract
types: FurnitureFactory and abstract furniture Chair, Sofa and Coffee Table.
This lets you pass any factory or product subclass to the client code without breaking it.
"""
chair = factory.create_chair()
sofa = factory.create_sofa()
print(f"{chair.chair_feature_1()}")
print(f"{sofa.sofa_feature_2()}")
if __name__ == "__main__":
"""
The client code can work with any concrete factory class.
"""
print("Client: Testing client code with the ModernFurnitureFactory:")
client_code(ModernFurnitureFactory())
print('\n')
print("Client: Testing client code with the VictorianFurnitureFactory:")
client_code(VictorianFurnitureFactory())
| [
6738,
12531,
62,
69,
9548,
13,
22584,
1749,
13,
69,
700,
8089,
62,
69,
9548,
1330,
34937,
8089,
22810,
198,
6738,
12531,
62,
69,
9548,
13,
22584,
1749,
13,
23922,
62,
69,
700,
8089,
62,
69,
9548,
1330,
12495,
37,
700,
8089,
22810,
198,
6738,
12531,
62,
69,
9548,
13,
22584,
1749,
13,
32433,
22618,
62,
69,
700,
8089,
62,
69,
9548,
1330,
24569,
37,
700,
8089,
22810,
198,
198,
7061,
6,
198,
23839,
19239,
318,
257,
1126,
864,
1486,
3912,
326,
8781,
345,
4439,
4172,
220,
198,
1659,
3519,
5563,
1231,
31577,
511,
10017,
6097,
13,
198,
198,
43189,
11,
1406,
13331,
11,
19443,
8655,
1395,
12495,
11,
24569,
198,
7061,
6,
628,
198,
4299,
5456,
62,
8189,
7,
69,
9548,
25,
34937,
8089,
22810,
8,
4613,
6045,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
383,
5456,
2438,
2499,
351,
17590,
290,
3186,
691,
832,
12531,
198,
220,
220,
220,
3858,
25,
34937,
8089,
22810,
290,
12531,
13091,
9369,
11,
1406,
13331,
290,
19443,
8655,
13,
198,
220,
220,
220,
770,
8781,
345,
1208,
597,
8860,
393,
1720,
47611,
284,
262,
5456,
2438,
1231,
7163,
340,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5118,
796,
8860,
13,
17953,
62,
16337,
3419,
198,
220,
220,
220,
34902,
796,
8860,
13,
17953,
62,
568,
13331,
3419,
628,
220,
220,
220,
3601,
7,
69,
1,
90,
16337,
13,
16337,
62,
30053,
62,
16,
3419,
92,
4943,
198,
220,
220,
220,
3601,
7,
69,
1,
90,
568,
13331,
13,
568,
13331,
62,
30053,
62,
17,
3419,
92,
4943,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
383,
5456,
2438,
460,
670,
351,
597,
10017,
8860,
1398,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3601,
7203,
11792,
25,
23983,
5456,
2438,
351,
262,
12495,
37,
700,
8089,
22810,
25,
4943,
198,
220,
220,
220,
5456,
62,
8189,
7,
31439,
37,
700,
8089,
22810,
28955,
628,
220,
220,
220,
3601,
10786,
59,
77,
11537,
628,
220,
220,
220,
3601,
7203,
11792,
25,
23983,
5456,
2438,
351,
262,
24569,
37,
700,
8089,
22810,
25,
4943,
198,
220,
220,
220,
5456,
62,
8189,
7,
21944,
22618,
37,
700,
8089,
22810,
28955,
198
] | 3.405836 | 377 |
from django.shortcuts import render
from django.views.generic import ListView, DetailView
from django_vend.core.views import (VendAuthSingleObjectSyncMixin,
VendAuthCollectionSyncMixin)
from .models import VendOutlet, VendRegister
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
42585,
7680,
198,
198,
6738,
42625,
14208,
62,
85,
437,
13,
7295,
13,
33571,
1330,
357,
53,
437,
30515,
28008,
10267,
28985,
35608,
259,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44220,
30515,
36307,
28985,
35608,
259,
8,
198,
198,
6738,
764,
27530,
1330,
44220,
7975,
1616,
11,
44220,
38804,
628,
628,
198
] | 2.650485 | 103 |
import numpy as np
def TSNR(noisy_stft, signal_gains, noise_estimation):
"""
Reconstructs the signal by re-adding phase components to the magnitude estimate
:param noisy_stft: stft of original noisy signal
:param signal_gains: gains of each stft frame returned by DD
:param noise_estimation: noise estimation average based on first n frames of noisy signal
:return:
signal_output: stft of signal after TSNR modification
TSNR_gains: ndarray containing gain for each bin in signal_output
"""
num_frames = noisy_stft.shape[1]
signal_output = np.zeros(noisy_stft.shape, dtype=complex)
TSNR_gains = []
for frame_number in range(num_frames):
noisy_frame = np.abs(noisy_stft[:, frame_number])
#Calculating SNR_prior for current frame
numerator = (signal_gains[:, frame_number] * noisy_frame) ** 2
prior_SNR = numerator / noise_estimation
#Calculating TSNR filter_gain for current frame
TSNR_gain = np.divide(prior_SNR, prior_SNR + 1)
TSNR_gains.append(TSNR_gain)
signal_output[:, frame_number] = TSNR_gain * noisy_stft[:, frame_number]
return signal_output, np.asarray(TSNR_gains).T | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
309,
15571,
49,
7,
3919,
13560,
62,
301,
701,
11,
6737,
62,
70,
1299,
11,
7838,
62,
395,
18991,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23419,
7249,
82,
262,
6737,
416,
302,
12,
26872,
7108,
6805,
284,
262,
14735,
8636,
198,
220,
220,
220,
1058,
17143,
31210,
62,
301,
701,
25,
336,
701,
286,
2656,
31210,
6737,
198,
220,
220,
220,
1058,
17143,
6737,
62,
70,
1299,
25,
8810,
286,
1123,
336,
701,
5739,
4504,
416,
20084,
198,
220,
220,
220,
1058,
17143,
7838,
62,
395,
18991,
25,
7838,
31850,
2811,
1912,
319,
717,
299,
13431,
286,
31210,
6737,
198,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
6737,
62,
22915,
25,
336,
701,
286,
6737,
706,
309,
15571,
49,
17613,
198,
220,
220,
220,
220,
220,
220,
220,
309,
15571,
49,
62,
70,
1299,
25,
299,
67,
18747,
7268,
4461,
329,
1123,
9874,
287,
6737,
62,
22915,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
997,
62,
37805,
796,
31210,
62,
301,
701,
13,
43358,
58,
16,
60,
198,
220,
220,
220,
6737,
62,
22915,
796,
45941,
13,
9107,
418,
7,
3919,
13560,
62,
301,
701,
13,
43358,
11,
288,
4906,
28,
41887,
8,
198,
220,
220,
220,
309,
15571,
49,
62,
70,
1299,
796,
17635,
628,
220,
220,
220,
329,
5739,
62,
17618,
287,
2837,
7,
22510,
62,
37805,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
31210,
62,
14535,
796,
45941,
13,
8937,
7,
3919,
13560,
62,
301,
701,
58,
45299,
5739,
62,
17618,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
9771,
3129,
803,
11346,
49,
62,
3448,
273,
329,
1459,
5739,
198,
220,
220,
220,
220,
220,
220,
220,
5470,
1352,
796,
357,
12683,
282,
62,
70,
1299,
58,
45299,
5739,
62,
17618,
60,
1635,
31210,
62,
14535,
8,
12429,
362,
198,
220,
220,
220,
220,
220,
220,
220,
3161,
62,
15571,
49,
796,
5470,
1352,
1220,
7838,
62,
395,
18991,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
9771,
3129,
803,
309,
15571,
49,
8106,
62,
48544,
329,
1459,
5739,
198,
220,
220,
220,
220,
220,
220,
220,
309,
15571,
49,
62,
48544,
796,
45941,
13,
7146,
485,
7,
3448,
273,
62,
15571,
49,
11,
3161,
62,
15571,
49,
1343,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
309,
15571,
49,
62,
70,
1299,
13,
33295,
7,
4694,
24723,
62,
48544,
8,
628,
220,
220,
220,
220,
220,
220,
220,
6737,
62,
22915,
58,
45299,
5739,
62,
17618,
60,
796,
309,
15571,
49,
62,
48544,
1635,
31210,
62,
301,
701,
58,
45299,
5739,
62,
17618,
60,
628,
220,
220,
220,
1441,
6737,
62,
22915,
11,
45941,
13,
292,
18747,
7,
4694,
24723,
62,
70,
1299,
737,
51
] | 2.58547 | 468 |
# py_adventure screen scrypt
import config
import os
| [
2,
12972,
62,
324,
5388,
3159,
629,
6012,
201,
198,
11748,
4566,
201,
198,
11748,
28686,
201
] | 3.235294 | 17 |
# coding: utf-8
# In[1]:
import numpy as np
from time import time
import gzip
import warnings
import pickle
warnings.filterwarnings("ignore")
from Bio.PDB import *
import Bio
from config import DefaultConfig
configs = DefaultConfig()
parser = PDBParser()
THIRD_ATOM = 'N' # 'O'
# In[2]:
# In[3]:
from Bio import pairwise2
from Bio.pairwise2 import format_alignment
from Bio import SeqUtils
protein_letters_3to1 = SeqUtils.IUPACData.protein_letters_3to1
ppb = PPBuilder()
# dist_matrix_map, angle_matrix_map
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
640,
1330,
640,
198,
11748,
308,
13344,
198,
11748,
14601,
198,
11748,
2298,
293,
198,
198,
40539,
654,
13,
24455,
40539,
654,
7203,
46430,
4943,
198,
198,
6738,
16024,
13,
5760,
33,
1330,
1635,
198,
11748,
16024,
198,
6738,
4566,
1330,
15161,
16934,
198,
11250,
82,
796,
15161,
16934,
3419,
628,
198,
198,
48610,
796,
350,
11012,
46677,
3419,
198,
198,
4221,
46833,
62,
1404,
2662,
796,
705,
45,
6,
220,
1303,
705,
46,
6,
628,
198,
2,
554,
58,
17,
5974,
628,
628,
198,
198,
2,
554,
58,
18,
5974,
628,
198,
6738,
16024,
1330,
5166,
3083,
17,
198,
6738,
16024,
13,
24874,
3083,
17,
1330,
5794,
62,
282,
16747,
198,
6738,
16024,
1330,
1001,
80,
18274,
4487,
198,
198,
48693,
62,
15653,
62,
18,
1462,
16,
796,
1001,
80,
18274,
4487,
13,
40,
8577,
2246,
6601,
13,
48693,
62,
15653,
62,
18,
1462,
16,
198,
198,
381,
65,
796,
21082,
32875,
3419,
628,
198,
2,
220,
220,
220,
220,
1233,
62,
6759,
8609,
62,
8899,
11,
9848,
62,
6759,
8609,
62,
8899,
628
] | 2.69697 | 198 |
import numpy as np
from numpy.typing import ArrayLike
import sys
from puzzle_1 import load_input
sys.path.append("..")
import helpers # noqa
def calculate_last_winning_score(
draw_numbers: list[int], boards: list[ArrayLike], blank_boards: list[ArrayLike]
) -> tuple[int, int, int]:
"""Function to calculate the winning score from the
board which would win last. The score is given by
sum of all unmarked numbers on that board multiplied
by the number that was just called for the winning
board.
"""
boards_in_play = [i for i in range(len(boards))]
remove_board = []
for drawn_number in draw_numbers:
for board_no in boards_in_play:
board = boards[board_no]
blank_board = blank_boards[board_no]
drawn_number_found = board == drawn_number
if drawn_number_found.sum() > 0:
blank_board = blank_board + drawn_number_found
blank_board = np.clip(blank_board, a_min=None, a_max=1)
blank_boards[board_no] = blank_board
unmarked_board = (1 - blank_board) * board
# check for winning board
if (blank_board.sum(axis=0) == 5).any() or (
blank_board.sum(axis=1) == 5
).any():
# if the board wins, store the board number and remove it
# outside of the loop
if len(boards_in_play) > 1:
remove_board.append(board_no)
else:
unmarked_board = (1 - blank_board) * board
unmarked_board_score = unmarked_board.sum()
return (
unmarked_board_score * drawn_number,
unmarked_board_score,
drawn_number,
)
if remove_board is not []:
for board_to_remove in remove_board:
boards_in_play.remove(board_to_remove)
remove_board = []
if __name__ == "__main__":
input = load_input("input_1.txt")
result = calculate_last_winning_score(*input)
print(result)
| [
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
774,
13886,
1330,
15690,
7594,
198,
11748,
25064,
198,
6738,
15027,
62,
16,
1330,
3440,
62,
15414,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
11748,
49385,
220,
1303,
645,
20402,
628,
198,
4299,
15284,
62,
12957,
62,
14463,
62,
26675,
7,
198,
220,
220,
220,
3197,
62,
77,
17024,
25,
1351,
58,
600,
4357,
11490,
25,
1351,
58,
19182,
7594,
4357,
9178,
62,
12821,
25,
1351,
58,
19182,
7594,
60,
198,
8,
4613,
46545,
58,
600,
11,
493,
11,
493,
5974,
198,
220,
220,
220,
37227,
22203,
284,
15284,
262,
5442,
4776,
422,
262,
198,
220,
220,
220,
3096,
543,
561,
1592,
938,
13,
383,
4776,
318,
1813,
416,
198,
220,
220,
220,
2160,
286,
477,
46791,
3146,
319,
326,
3096,
33096,
198,
220,
220,
220,
416,
262,
1271,
326,
373,
655,
1444,
329,
262,
5442,
198,
220,
220,
220,
3096,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
11490,
62,
259,
62,
1759,
796,
685,
72,
329,
1312,
287,
2837,
7,
11925,
7,
12821,
4008,
60,
628,
220,
220,
220,
4781,
62,
3526,
796,
17635,
628,
220,
220,
220,
329,
7428,
62,
17618,
287,
3197,
62,
77,
17024,
25,
628,
220,
220,
220,
220,
220,
220,
220,
329,
3096,
62,
3919,
287,
11490,
62,
259,
62,
1759,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3096,
796,
11490,
58,
3526,
62,
3919,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9178,
62,
3526,
796,
9178,
62,
12821,
58,
3526,
62,
3919,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7428,
62,
17618,
62,
9275,
796,
3096,
6624,
7428,
62,
17618,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
7428,
62,
17618,
62,
9275,
13,
16345,
3419,
1875,
657,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9178,
62,
3526,
796,
9178,
62,
3526,
1343,
7428,
62,
17618,
62,
9275,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9178,
62,
3526,
796,
45941,
13,
15036,
7,
27190,
62,
3526,
11,
257,
62,
1084,
28,
14202,
11,
257,
62,
9806,
28,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9178,
62,
12821,
58,
3526,
62,
3919,
60,
796,
9178,
62,
3526,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46791,
62,
3526,
796,
357,
16,
532,
9178,
62,
3526,
8,
1635,
3096,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2198,
329,
5442,
3096,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
357,
27190,
62,
3526,
13,
16345,
7,
22704,
28,
15,
8,
6624,
642,
737,
1092,
3419,
393,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9178,
62,
3526,
13,
16345,
7,
22704,
28,
16,
8,
6624,
642,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6739,
1092,
33529,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
262,
3096,
7864,
11,
3650,
262,
3096,
1271,
290,
4781,
340,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2354,
286,
262,
9052,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
12821,
62,
259,
62,
1759,
8,
1875,
352,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4781,
62,
3526,
13,
33295,
7,
3526,
62,
3919,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46791,
62,
3526,
796,
357,
16,
532,
9178,
62,
3526,
8,
1635,
3096,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46791,
62,
3526,
62,
26675,
796,
46791,
62,
3526,
13,
16345,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46791,
62,
3526,
62,
26675,
1635,
7428,
62,
17618,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46791,
62,
3526,
62,
26675,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7428,
62,
17618,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
611,
4781,
62,
3526,
318,
407,
685,
5974,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
3096,
62,
1462,
62,
28956,
287,
4781,
62,
3526,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11490,
62,
259,
62,
1759,
13,
28956,
7,
3526,
62,
1462,
62,
28956,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4781,
62,
3526,
796,
17635,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
5128,
796,
3440,
62,
15414,
7203,
15414,
62,
16,
13,
14116,
4943,
628,
220,
220,
220,
1255,
796,
15284,
62,
12957,
62,
14463,
62,
26675,
46491,
15414,
8,
628,
220,
220,
220,
3601,
7,
20274,
8,
198
] | 2.092279 | 1,062 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
"""A Neural Network abstract class for all (quantum) neural networks within Qiskit's
machine learning module."""
from abc import ABC, abstractmethod
from typing import Tuple, Union, List, Optional
import numpy as np
try:
from sparse import SparseArray
except ImportError:
class SparseArray: # type: ignore
"""Empty SparseArray class
Replacement if sparse.SparseArray is not present.
"""
pass
from ..exceptions import QiskitMachineLearningError
class NeuralNetwork(ABC):
"""Abstract Neural Network class providing forward and backward pass and handling
batched inputs. This is to be implemented by other (quantum) neural networks.
"""
def __init__(
self,
num_inputs: int,
num_weights: int,
sparse: bool,
output_shape: Union[int, Tuple[int, ...]],
) -> None:
"""Initializes the Neural Network.
Args:
num_inputs: The number of input features.
num_weights: The number of trainable weights.
sparse: Determines whether the output is a sparse array or not.
output_shape: The shape of the output.
Raises:
QiskitMachineLearningError: Invalid parameter values.
"""
if num_inputs < 0:
raise QiskitMachineLearningError(f"Number of inputs cannot be negative: {num_inputs}!")
self._num_inputs = num_inputs
if num_weights < 0:
raise QiskitMachineLearningError(
f"Number of weights cannot be negative: {num_weights}!"
)
self._num_weights = num_weights
self._sparse = sparse
if isinstance(output_shape, int):
output_shape = (output_shape,)
if not np.all([s > 0 for s in output_shape]):
raise QiskitMachineLearningError(
f"Invalid output shape, all components must be > 0, but got: {output_shape}."
)
self._output_shape = output_shape
self._input_gradients = False
@property
def num_inputs(self) -> int:
"""Returns the number of input features."""
return self._num_inputs
@property
def num_weights(self) -> int:
"""Returns the number of trainable weights."""
return self._num_weights
@property
def sparse(self) -> bool:
"""Returns whether the output is sparse or not."""
return self._sparse
@property
def output_shape(self) -> Tuple[int, ...]:
"""Returns the output shape."""
return self._output_shape
@property
def input_gradients(self) -> bool:
"""Returns whether gradients with respect to input data are computed by this neural network
in the ``backward`` method or not. By default such gradients are not computed."""
return self._input_gradients
@input_gradients.setter
def input_gradients(self, input_gradients: bool) -> None:
"""Turn on/off computation of gradients with respect to input data."""
self._input_gradients = input_gradients
def forward(
self,
input_data: Optional[Union[List[float], np.ndarray, float]],
weights: Optional[Union[List[float], np.ndarray, float]],
) -> Union[np.ndarray, SparseArray]:
"""Forward pass of the network.
Args:
input_data: input data of the shape (num_inputs). In case of a single scalar input it is
directly cast to and interpreted like a one-element array.
weights: trainable weights of the shape (num_weights). In case of a single scalar weight
it is directly cast to and interpreted like a one-element array.
Returns:
The result of the neural network of the shape (output_shape).
"""
input_, shape = self._validate_input(input_data)
weights_ = self._validate_weights(weights)
output_data = self._forward(input_, weights_)
return self._validate_forward_output(output_data, shape)
@abstractmethod
def backward(
self,
input_data: Optional[Union[List[float], np.ndarray, float]],
weights: Optional[Union[List[float], np.ndarray, float]],
) -> Tuple[Optional[Union[np.ndarray, SparseArray]], Optional[Union[np.ndarray, SparseArray]],]:
"""Backward pass of the network.
Args:
input_data: input data of the shape (num_inputs). In case of a
single scalar input it is directly cast to and interpreted like a one-element array.
weights: trainable weights of the shape (num_weights). In case of a single scalar weight
it is directly cast to and interpreted like a one-element array.
Returns:
The result of the neural network of the backward pass, i.e., a tuple with the gradients
for input and weights of shape (output_shape, num_input) and
(output_shape, num_weights), respectively.
"""
input_, shape = self._validate_input(input_data)
weights_ = self._validate_weights(weights)
input_grad, weight_grad = self._backward(input_, weights_)
input_grad_reshaped, weight_grad_reshaped = self._validate_backward_output(
input_grad, weight_grad, shape
)
return input_grad_reshaped, weight_grad_reshaped
@abstractmethod
| [
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
12131,
11,
33448,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
198,
2,
7330,
257,
4866,
286,
428,
5964,
287,
262,
38559,
24290,
13,
14116,
2393,
287,
262,
6808,
8619,
198,
2,
286,
428,
2723,
5509,
393,
379,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
13,
198,
2,
198,
2,
4377,
19008,
393,
27255,
2499,
286,
428,
2438,
1276,
12377,
428,
198,
2,
6634,
4003,
11,
290,
9518,
3696,
761,
284,
3283,
257,
4003,
12739,
198,
2,
326,
484,
423,
587,
14294,
422,
262,
47324,
13,
198,
198,
37811,
32,
47986,
7311,
12531,
1398,
329,
477,
357,
40972,
388,
8,
17019,
7686,
1626,
1195,
1984,
270,
338,
198,
30243,
4673,
8265,
526,
15931,
628,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
309,
29291,
11,
4479,
11,
7343,
11,
32233,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
29877,
1330,
1338,
17208,
19182,
198,
16341,
17267,
12331,
25,
628,
220,
220,
220,
1398,
1338,
17208,
19182,
25,
220,
1303,
2099,
25,
8856,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
40613,
1338,
17208,
19182,
1398,
198,
220,
220,
220,
220,
220,
220,
220,
43986,
611,
29877,
13,
50,
29572,
19182,
318,
407,
1944,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
198,
6738,
11485,
1069,
11755,
1330,
1195,
1984,
270,
37573,
41730,
12331,
628,
198,
4871,
47986,
26245,
7,
24694,
2599,
198,
220,
220,
220,
37227,
23839,
47986,
7311,
1398,
4955,
2651,
290,
19528,
1208,
290,
9041,
198,
220,
220,
220,
7365,
1740,
17311,
13,
770,
318,
284,
307,
9177,
416,
584,
357,
40972,
388,
8,
17019,
7686,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
15414,
82,
25,
493,
11,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
43775,
25,
493,
11,
198,
220,
220,
220,
220,
220,
220,
220,
29877,
25,
20512,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
43358,
25,
4479,
58,
600,
11,
309,
29291,
58,
600,
11,
2644,
60,
4357,
198,
220,
220,
220,
1267,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24243,
4340,
262,
47986,
7311,
13,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
62,
15414,
82,
25,
383,
1271,
286,
5128,
3033,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
62,
43775,
25,
383,
1271,
286,
4512,
540,
19590,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29877,
25,
360,
13221,
274,
1771,
262,
5072,
318,
257,
29877,
7177,
393,
407,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
43358,
25,
383,
5485,
286,
262,
5072,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
1984,
270,
37573,
41730,
12331,
25,
17665,
11507,
3815,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
997,
62,
15414,
82,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
1195,
1984,
270,
37573,
41730,
12331,
7,
69,
1,
15057,
286,
17311,
2314,
307,
4633,
25,
1391,
22510,
62,
15414,
82,
92,
2474,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
22510,
62,
15414,
82,
796,
997,
62,
15414,
82,
628,
220,
220,
220,
220,
220,
220,
220,
611,
997,
62,
43775,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
1195,
1984,
270,
37573,
41730,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
15057,
286,
19590,
2314,
307,
4633,
25,
1391,
22510,
62,
43775,
92,
2474,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
22510,
62,
43775,
796,
997,
62,
43775,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
82,
29572,
796,
29877,
628,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
22915,
62,
43358,
11,
493,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
43358,
796,
357,
22915,
62,
43358,
35751,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
45941,
13,
439,
26933,
82,
1875,
657,
329,
264,
287,
5072,
62,
43358,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
1195,
1984,
270,
37573,
41730,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
44651,
5072,
5485,
11,
477,
6805,
1276,
307,
1875,
657,
11,
475,
1392,
25,
1391,
22915,
62,
43358,
92,
526,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
22915,
62,
43358,
796,
5072,
62,
43358,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
15414,
62,
9744,
2334,
796,
10352,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
997,
62,
15414,
82,
7,
944,
8,
4613,
493,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35561,
262,
1271,
286,
5128,
3033,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
22510,
62,
15414,
82,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
997,
62,
43775,
7,
944,
8,
4613,
493,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35561,
262,
1271,
286,
4512,
540,
19590,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
22510,
62,
43775,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
29877,
7,
944,
8,
4613,
20512,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35561,
1771,
262,
5072,
318,
29877,
393,
407,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
82,
29572,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
5072,
62,
43358,
7,
944,
8,
4613,
309,
29291,
58,
600,
11,
2644,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35561,
262,
5072,
5485,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
22915,
62,
43358,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
5128,
62,
9744,
2334,
7,
944,
8,
4613,
20512,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35561,
1771,
3915,
2334,
351,
2461,
284,
5128,
1366,
389,
29231,
416,
428,
17019,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
287,
262,
7559,
1891,
904,
15506,
2446,
393,
407,
13,
2750,
4277,
884,
3915,
2334,
389,
407,
29231,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
15414,
62,
9744,
2334,
628,
220,
220,
220,
2488,
15414,
62,
9744,
2334,
13,
2617,
353,
198,
220,
220,
220,
825,
5128,
62,
9744,
2334,
7,
944,
11,
5128,
62,
9744,
2334,
25,
20512,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
17278,
319,
14,
2364,
29964,
286,
3915,
2334,
351,
2461,
284,
5128,
1366,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
15414,
62,
9744,
2334,
796,
5128,
62,
9744,
2334,
628,
220,
220,
220,
825,
2651,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
7890,
25,
32233,
58,
38176,
58,
8053,
58,
22468,
4357,
45941,
13,
358,
18747,
11,
12178,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
19590,
25,
32233,
58,
38176,
58,
8053,
58,
22468,
4357,
45941,
13,
358,
18747,
11,
12178,
60,
4357,
198,
220,
220,
220,
1267,
4613,
4479,
58,
37659,
13,
358,
18747,
11,
1338,
17208,
19182,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
39746,
1208,
286,
262,
3127,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
7890,
25,
5128,
1366,
286,
262,
5485,
357,
22510,
62,
15414,
82,
737,
554,
1339,
286,
257,
2060,
16578,
283,
5128,
340,
318,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3264,
3350,
284,
290,
16173,
588,
257,
530,
12,
30854,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19590,
25,
4512,
540,
19590,
286,
262,
5485,
357,
22510,
62,
43775,
737,
554,
1339,
286,
257,
2060,
16578,
283,
3463,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
318,
3264,
3350,
284,
290,
16173,
588,
257,
530,
12,
30854,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
1255,
286,
262,
17019,
3127,
286,
262,
5485,
357,
22915,
62,
43358,
737,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
11,
5485,
796,
2116,
13557,
12102,
378,
62,
15414,
7,
15414,
62,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
19590,
62,
796,
2116,
13557,
12102,
378,
62,
43775,
7,
43775,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
7890,
796,
2116,
13557,
11813,
7,
15414,
62,
11,
19590,
62,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
12102,
378,
62,
11813,
62,
22915,
7,
22915,
62,
7890,
11,
5485,
8,
628,
220,
220,
220,
2488,
397,
8709,
24396,
628,
220,
220,
220,
825,
19528,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
7890,
25,
32233,
58,
38176,
58,
8053,
58,
22468,
4357,
45941,
13,
358,
18747,
11,
12178,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
19590,
25,
32233,
58,
38176,
58,
8053,
58,
22468,
4357,
45941,
13,
358,
18747,
11,
12178,
60,
4357,
198,
220,
220,
220,
1267,
4613,
309,
29291,
58,
30719,
58,
38176,
58,
37659,
13,
358,
18747,
11,
1338,
17208,
19182,
60,
4357,
32233,
58,
38176,
58,
37659,
13,
358,
18747,
11,
1338,
17208,
19182,
60,
4357,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7282,
904,
1208,
286,
262,
3127,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
7890,
25,
5128,
1366,
286,
262,
5485,
357,
22510,
62,
15414,
82,
737,
554,
1339,
286,
257,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2060,
16578,
283,
5128,
340,
318,
3264,
3350,
284,
290,
16173,
588,
257,
530,
12,
30854,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19590,
25,
4512,
540,
19590,
286,
262,
5485,
357,
22510,
62,
43775,
737,
554,
1339,
286,
257,
2060,
16578,
283,
3463,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
318,
3264,
3350,
284,
290,
16173,
588,
257,
530,
12,
30854,
7177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
1255,
286,
262,
17019,
3127,
286,
262,
19528,
1208,
11,
1312,
13,
68,
1539,
257,
46545,
351,
262,
3915,
2334,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
5128,
290,
19590,
286,
5485,
357,
22915,
62,
43358,
11,
997,
62,
15414,
8,
290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
22915,
62,
43358,
11,
997,
62,
43775,
828,
8148,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
11,
5485,
796,
2116,
13557,
12102,
378,
62,
15414,
7,
15414,
62,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
19590,
62,
796,
2116,
13557,
12102,
378,
62,
43775,
7,
43775,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
9744,
11,
3463,
62,
9744,
796,
2116,
13557,
1891,
904,
7,
15414,
62,
11,
19590,
62,
8,
628,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
9744,
62,
3447,
5813,
11,
3463,
62,
9744,
62,
3447,
5813,
796,
2116,
13557,
12102,
378,
62,
1891,
904,
62,
22915,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
9744,
11,
3463,
62,
9744,
11,
5485,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
5128,
62,
9744,
62,
3447,
5813,
11,
3463,
62,
9744,
62,
3447,
5813,
628,
220,
220,
220,
2488,
397,
8709,
24396,
198
] | 2.629663 | 2,225 |
#!/usr/bin/env python
import os
import re
import shutil
import glob
# This script converts from the docker version to a shell install version
# Useful for installation without docker
# Manual installation
# - Init a database using ../postgresql/docker-entrypoint-initdb.d/init-database.sh
# - Add db, smtp and rabbitmq to /etc/hosts
# - Excute ./docker2shell.py
# - Open schellinstall folder
# - Update database connexion in config files (*.py)
# - Create env file and load data in bash session for envsub
# - Update NGINX ports in *.template
# - Update SMTP config (config.py and wcs.settings.py)
# - Turn debug off if needed in config files (*.py)
# - Execute install.sh
# - Start app with start-xxx.sh
apps = ["base", "hobo", "authentic", "combo", "fargo", "passerelle", "wcs"]
project_path = os.getcwd()
bare_path = os.path.join(project_path, "shellinstall")
if not os.path.exists(bare_path):
os.makedirs(bare_path)
else:
[os.remove(f) for f in glob.glob(bare_path+"/*")]
replace_dict = {
"FROM" : "# FROM",
"MAINTAINER" : "# MAINTAINER",
"VOLUME" : "# VOLUME",
"EXPOSE" : "# EXPOSE",
"ENTRYPOINT\s\[\"(?P<script>[A-Za-z\-\.]*)\"\]" : "./\g<script>",
"CMD" : "# CMD",
"RUN " : "",
"COPY" : "cp",
"ENV\s(?P<name>[A-Z]*)\s*(?P<value>[a-z]*)" : "export \g<name>=\g<value>",
"/root" : "/usr/bin"
}
do_not_copy = ["Dockerfile", "LICENSE", "README.md", \
".git", "nginx.template", "start.sh", "stop.sh"]
startgru = ""
stopgru = ""
configuregru = ""
envextractor = re.compile("(envsubst.*)")
for app in apps:
app_path = os.path.join(project_path, app)
if "Dockerfile" in os.listdir(app) :
print("Converting {} docker image...".format(app))
# Rename nginx template using app name
nginx_path = os.path.join(app_path, "nginx.template")
if os.path.isfile(nginx_path):
nginx_new_name = "nginx-"+app+".template"
replace_dict.update({"nginx.template" : nginx_new_name})
shutil.copyfile(nginx_path, os.path.join(bare_path, nginx_new_name))
# Convert docker entrypoint into startup script
entrypoint_path = os.path.join(app_path, "start.sh")
if os.path.isfile(entrypoint_path):
startappscript = "start-"+app+".sh"
replace_dict.update({"start.sh" : startappscript})
# delete the 'exec' command in the script
with open(entrypoint_path) as f:
newContent = f.read().replace('exec "$@"', '')
newContent = envextractor.sub('# moved to configure.sh \\1', newContent)
configuregru += "\n".join([ a + "\n" for a in envextractor.findall(newContent)])
with open(os.path.join(bare_path, startappscript), "w+") as f:
f.write(newContent)
startgru += "./" + startappscript + "\n"
# Convert docker stop script
entrypoint_path = os.path.join(app_path, "stop.sh")
if os.path.isfile(entrypoint_path):
stopappscript = "stop-"+app+".sh"
replace_dict.update({"stop.sh" : stopappscript})
shutil.copyfile(entrypoint_path, os.path.join(bare_path, stopappscript))
stopgru += "./" + stopappscript + "\n"
# Convert dockerfile
file_replace(replace_dict, \
os.path.join(app_path, "Dockerfile"), \
os.path.join(bare_path, "install.sh"), app)
# Copy other files
files = [f for f in os.listdir(app) if f not in do_not_copy]
for file in files:
file_path = os.path.join(app_path, file)
if os.path.isfile(os.path.join(bare_path, file)):
print("Error, file %s already exists", file)
shutil.copy(file_path, bare_path)
print("{} docker image converted".format(app))
with open(os.path.join(bare_path, "start-all.sh"), "w") as f:
f.write(startgru)
with open(os.path.join(bare_path, "stop-all.sh"), "w") as f:
f.write(stopgru)
with open(os.path.join(bare_path, "configure.sh"), "w") as f:
f.write(configuregru) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
4423,
346,
198,
11748,
15095,
198,
198,
2,
770,
4226,
26161,
422,
262,
36253,
2196,
284,
257,
7582,
2721,
2196,
198,
2,
49511,
329,
9988,
1231,
36253,
628,
198,
2,
17969,
9988,
198,
2,
532,
44707,
257,
6831,
1262,
11485,
14,
7353,
34239,
13976,
14,
45986,
12,
13000,
4122,
12,
15003,
9945,
13,
67,
14,
15003,
12,
48806,
13,
1477,
198,
2,
532,
3060,
20613,
11,
895,
34788,
290,
22746,
76,
80,
284,
1220,
14784,
14,
4774,
82,
198,
2,
532,
25268,
1133,
24457,
45986,
17,
29149,
13,
9078,
198,
2,
532,
4946,
3897,
297,
17350,
9483,
198,
2,
220,
220,
532,
10133,
6831,
369,
12413,
295,
287,
4566,
3696,
20789,
13,
9078,
8,
198,
2,
220,
220,
532,
13610,
17365,
2393,
290,
3440,
1366,
287,
27334,
6246,
329,
17365,
7266,
198,
2,
220,
220,
532,
10133,
39058,
1268,
55,
14090,
287,
46866,
28243,
198,
2,
220,
220,
532,
10133,
9447,
7250,
4566,
357,
11250,
13,
9078,
290,
266,
6359,
13,
33692,
13,
9078,
8,
198,
2,
220,
220,
532,
6756,
14257,
572,
611,
2622,
287,
4566,
3696,
20789,
13,
9078,
8,
198,
2,
220,
220,
532,
8393,
1133,
2721,
13,
1477,
198,
2,
220,
220,
532,
7253,
598,
351,
923,
12,
31811,
13,
1477,
198,
220,
220,
220,
220,
198,
18211,
796,
14631,
8692,
1600,
366,
71,
20391,
1600,
366,
41299,
291,
1600,
366,
785,
2127,
1600,
366,
69,
9448,
1600,
366,
79,
21612,
2411,
293,
1600,
366,
12712,
8973,
198,
198,
16302,
62,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
49382,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
16302,
62,
6978,
11,
366,
29149,
17350,
4943,
198,
361,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
49382,
62,
6978,
2599,
198,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
49382,
62,
6978,
8,
198,
17772,
25,
198,
220,
220,
220,
685,
418,
13,
28956,
7,
69,
8,
329,
277,
287,
15095,
13,
4743,
672,
7,
49382,
62,
6978,
10,
1,
15211,
4943,
60,
198,
198,
33491,
62,
11600,
796,
1391,
198,
220,
220,
220,
366,
10913,
2662,
1,
1058,
25113,
16034,
1600,
198,
220,
220,
220,
366,
5673,
1268,
30339,
1137,
1,
1058,
25113,
8779,
1268,
30339,
1137,
1600,
198,
220,
220,
220,
366,
44558,
38340,
1,
1058,
25113,
38570,
38340,
1600,
198,
220,
220,
220,
366,
6369,
48933,
1,
1058,
25113,
25703,
14058,
1600,
198,
220,
220,
220,
366,
3525,
18276,
16402,
12394,
59,
82,
59,
58,
7879,
7,
30,
47,
27,
12048,
36937,
32,
12,
57,
64,
12,
89,
41441,
59,
8183,
28104,
7879,
59,
30866,
1058,
366,
19571,
59,
70,
27,
12048,
29,
1600,
198,
220,
220,
220,
366,
34,
12740,
1,
1058,
25113,
327,
12740,
1600,
198,
220,
220,
220,
366,
49,
4944,
366,
1058,
366,
1600,
198,
220,
220,
220,
366,
34,
3185,
56,
1,
1058,
366,
13155,
1600,
198,
220,
220,
220,
366,
1677,
53,
59,
82,
7,
30,
47,
27,
3672,
36937,
32,
12,
57,
60,
9,
19415,
82,
9,
7,
30,
47,
27,
8367,
36937,
64,
12,
89,
60,
9,
16725,
1058,
366,
39344,
3467,
70,
27,
3672,
29,
28,
59,
70,
27,
8367,
29,
1600,
198,
220,
220,
220,
12813,
15763,
1,
1058,
12813,
14629,
14,
8800,
1,
198,
220,
220,
220,
1782,
198,
198,
4598,
62,
1662,
62,
30073,
796,
14631,
35,
12721,
7753,
1600,
366,
43,
2149,
24290,
1600,
366,
15675,
11682,
13,
9132,
1600,
3467,
198,
220,
220,
220,
27071,
18300,
1600,
366,
782,
28413,
13,
28243,
1600,
366,
9688,
13,
1477,
1600,
366,
11338,
13,
1477,
8973,
198,
198,
9688,
48929,
796,
13538,
198,
11338,
48929,
796,
13538,
198,
11250,
495,
48929,
796,
13538,
198,
268,
303,
742,
40450,
796,
302,
13,
5589,
576,
7203,
7,
24330,
7266,
301,
15885,
8,
4943,
198,
198,
1640,
598,
287,
6725,
25,
198,
220,
220,
220,
598,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
16302,
62,
6978,
11,
598,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
611,
366,
35,
12721,
7753,
1,
287,
28686,
13,
4868,
15908,
7,
1324,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
3103,
48820,
23884,
36253,
2939,
9313,
13,
18982,
7,
1324,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
7152,
480,
299,
42822,
11055,
1262,
598,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
299,
42822,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
1324,
62,
6978,
11,
366,
782,
28413,
13,
28243,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
782,
28413,
62,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
42822,
62,
3605,
62,
3672,
796,
366,
782,
28413,
21215,
10,
1324,
10,
1911,
28243,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6330,
62,
11600,
13,
19119,
7,
4895,
782,
28413,
13,
28243,
1,
1058,
299,
42822,
62,
3605,
62,
3672,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4423,
346,
13,
30073,
7753,
7,
782,
28413,
62,
6978,
11,
28686,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
299,
42822,
62,
3605,
62,
3672,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
38240,
36253,
5726,
4122,
656,
13693,
4226,
198,
220,
220,
220,
220,
220,
220,
220,
5726,
4122,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
1324,
62,
6978,
11,
366,
9688,
13,
1477,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
13000,
4122,
62,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
1324,
12048,
796,
366,
9688,
21215,
10,
1324,
10,
1911,
1477,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6330,
62,
11600,
13,
19119,
7,
4895,
9688,
13,
1477,
1,
1058,
923,
1324,
12048,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
12233,
262,
705,
18558,
6,
3141,
287,
262,
4226,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
13000,
4122,
62,
6978,
8,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
19746,
796,
277,
13,
961,
22446,
33491,
10786,
18558,
17971,
31,
1,
3256,
10148,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
19746,
796,
551,
303,
742,
40450,
13,
7266,
10786,
2,
3888,
284,
17425,
13,
1477,
26867,
16,
3256,
649,
19746,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17425,
48929,
15853,
37082,
77,
1911,
22179,
26933,
257,
1343,
37082,
77,
1,
329,
257,
287,
551,
303,
742,
40450,
13,
19796,
439,
7,
3605,
19746,
8,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
418,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
923,
1324,
12048,
828,
366,
86,
10,
4943,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
13564,
7,
3605,
19746,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
48929,
15853,
366,
19571,
1,
1343,
923,
1324,
12048,
1343,
37082,
77,
1,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
38240,
36253,
2245,
4226,
198,
220,
220,
220,
220,
220,
220,
220,
5726,
4122,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
1324,
62,
6978,
11,
366,
11338,
13,
1477,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
13000,
4122,
62,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2245,
1324,
12048,
796,
366,
11338,
21215,
10,
1324,
10,
1911,
1477,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6330,
62,
11600,
13,
19119,
7,
4895,
11338,
13,
1477,
1,
1058,
2245,
1324,
12048,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4423,
346,
13,
30073,
7753,
7,
13000,
4122,
62,
6978,
11,
28686,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
2245,
1324,
12048,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2245,
48929,
15853,
366,
19571,
1,
1343,
2245,
1324,
12048,
1343,
37082,
77,
1,
220,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
38240,
36253,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
33491,
7,
33491,
62,
11600,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
6978,
13,
22179,
7,
1324,
62,
6978,
11,
366,
35,
12721,
7753,
12340,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
366,
17350,
13,
1477,
12340,
598,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
17393,
584,
3696,
198,
220,
220,
220,
220,
220,
220,
220,
3696,
796,
685,
69,
329,
277,
287,
28686,
13,
4868,
15908,
7,
1324,
8,
611,
277,
407,
287,
466,
62,
1662,
62,
30073,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2393,
287,
3696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
1324,
62,
6978,
11,
2393,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
418,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
2393,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
12331,
11,
2393,
4064,
82,
1541,
7160,
1600,
2393,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4423,
346,
13,
30073,
7,
7753,
62,
6978,
11,
6247,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
90,
92,
36253,
2939,
11513,
1911,
18982,
7,
1324,
4008,
198,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
366,
9688,
12,
439,
13,
1477,
12340,
366,
86,
4943,
355,
277,
25,
198,
220,
220,
220,
277,
13,
13564,
7,
9688,
48929,
8,
198,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
366,
11338,
12,
439,
13,
1477,
12340,
366,
86,
4943,
355,
277,
25,
198,
220,
220,
220,
277,
13,
13564,
7,
11338,
48929,
8,
198,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
49382,
62,
6978,
11,
366,
11250,
495,
13,
1477,
12340,
366,
86,
4943,
355,
277,
25,
198,
220,
220,
220,
277,
13,
13564,
7,
11250,
495,
48929,
8
] | 2.238328 | 1,842 |
from root_dir import root_dir
DEBUG = True
LOG_DIRECTORY = root_dir('..', 'dev_logs')
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
EMAIL_PORT = 1025
YWOT_HOST = 'localhost:8001'
PUSHER_APP_ID = '...'
PUSHER_KEY = '...'
PUSHER_SECRET = '...'
MIXPANEL_ID = "..."
STATIC_URL = '/static/'
SENTRY_DSN = None
| [
6738,
6808,
62,
15908,
1330,
6808,
62,
15908,
198,
198,
30531,
796,
6407,
198,
198,
25294,
62,
17931,
23988,
15513,
796,
6808,
62,
15908,
10786,
492,
3256,
705,
7959,
62,
6404,
82,
11537,
198,
198,
27630,
4146,
62,
31098,
10619,
796,
705,
28241,
14208,
13,
7295,
13,
4529,
13,
1891,
2412,
13,
17946,
11883,
13,
15333,
7282,
437,
6,
198,
27630,
4146,
62,
15490,
796,
838,
1495,
198,
198,
56,
54,
2394,
62,
39,
10892,
796,
705,
36750,
25,
7410,
16,
6,
198,
198,
47,
2937,
16879,
62,
24805,
62,
2389,
796,
705,
986,
6,
198,
47,
2937,
16879,
62,
20373,
796,
705,
986,
6,
198,
47,
2937,
16879,
62,
23683,
26087,
796,
705,
986,
6,
198,
8895,
27481,
1565,
3698,
62,
2389,
796,
366,
9313,
198,
198,
35744,
2149,
62,
21886,
796,
31051,
12708,
14,
6,
198,
198,
50,
3525,
18276,
62,
5258,
45,
796,
6045,
628
] | 2.22973 | 148 |
import re
import string
from typing import List
def tokenize_fast(input_text: str) -> List[str]:
"""Returns a very naive whitespace and punctuation based tokenization.
This helps for most but not all languages, should only be used if you don't know the language yet,
or if you have a lot of data and can sacrifice a lot of output quality for the sake of speed.
"""
return strip_most_punctuation(remove_html_tags(input_text)).split()
def remove_html_tags(input_text: str) -> str:
"""Removes all text enclosed by angle brackets."""
html_regex = re.compile("<.*?>")
return re.sub(html_regex, "", input_text)
def strip_most_punctuation(input_text: str) -> str:
"""Removes most punctuation except for particular characters inside a word.
E.g., "The dog." becomes "The dog" but "U.S.A." becomes "U.S.A".
"""
chars = [c for c in input_text]
for i in range(len(chars)):
if chars[i] in string.punctuation:
if ((chars[i] in "'./?&=:")
and 0 < i < len(chars) - 1 and not chars[i-1].isspace() and not chars[i+1].isspace()):
continue
chars[i] = ' '
return ''.join(chars)
| [
11748,
302,
198,
11748,
4731,
198,
6738,
19720,
1330,
7343,
628,
198,
4299,
11241,
1096,
62,
7217,
7,
15414,
62,
5239,
25,
965,
8,
4613,
7343,
58,
2536,
5974,
198,
220,
220,
220,
37227,
35561,
257,
845,
24354,
13216,
10223,
290,
21025,
2288,
1912,
11241,
1634,
13,
628,
220,
220,
220,
770,
5419,
329,
749,
475,
407,
477,
8950,
11,
815,
691,
307,
973,
611,
345,
836,
470,
760,
262,
3303,
1865,
11,
198,
220,
220,
220,
393,
611,
345,
423,
257,
1256,
286,
1366,
290,
460,
11728,
257,
1256,
286,
5072,
3081,
329,
262,
11060,
286,
2866,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
10283,
62,
1712,
62,
79,
16260,
2288,
7,
28956,
62,
6494,
62,
31499,
7,
15414,
62,
5239,
29720,
35312,
3419,
628,
198,
4299,
4781,
62,
6494,
62,
31499,
7,
15414,
62,
5239,
25,
965,
8,
4613,
965,
25,
198,
220,
220,
220,
37227,
8413,
5241,
477,
2420,
28543,
416,
9848,
28103,
526,
15931,
198,
220,
220,
220,
27711,
62,
260,
25636,
796,
302,
13,
5589,
576,
7203,
27,
15885,
30,
29,
4943,
198,
220,
220,
220,
1441,
302,
13,
7266,
7,
6494,
62,
260,
25636,
11,
366,
1600,
5128,
62,
5239,
8,
628,
198,
4299,
10283,
62,
1712,
62,
79,
16260,
2288,
7,
15414,
62,
5239,
25,
965,
8,
4613,
965,
25,
198,
220,
220,
220,
37227,
8413,
5241,
749,
21025,
2288,
2845,
329,
1948,
3435,
2641,
257,
1573,
13,
628,
220,
220,
220,
412,
13,
70,
1539,
366,
464,
3290,
526,
4329,
366,
464,
3290,
1,
475,
366,
52,
13,
50,
13,
32,
526,
4329,
366,
52,
13,
50,
13,
32,
1911,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
34534,
796,
685,
66,
329,
269,
287,
5128,
62,
5239,
60,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
11925,
7,
354,
945,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
34534,
58,
72,
60,
287,
4731,
13,
79,
16260,
2288,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
14808,
354,
945,
58,
72,
60,
287,
366,
4458,
20924,
5,
28,
25,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
290,
657,
1279,
1312,
1279,
18896,
7,
354,
945,
8,
532,
352,
290,
407,
34534,
58,
72,
12,
16,
4083,
747,
10223,
3419,
290,
407,
34534,
58,
72,
10,
16,
4083,
747,
10223,
3419,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34534,
58,
72,
60,
796,
705,
705,
198,
220,
220,
220,
1441,
705,
4458,
22179,
7,
354,
945,
8,
198
] | 2.598253 | 458 |
# The Expat License
#
# Copyright (c) 2017, Shlomi Fish
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import sys
from functools import reduce
from six import print_
if sys.version_info > (3,):
long = int
xrange = range
if __name__ == "__main__":
main()
| [
2,
383,
5518,
265,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
11,
911,
75,
12753,
13388,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
2,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
2,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
2,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
2,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
2,
198,
2,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
198,
2,
477,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
2,
198,
2,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
2,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
2,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
2,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
2,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
2,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
2,
47466,
13,
198,
198,
11748,
25064,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
2237,
1330,
3601,
62,
198,
198,
361,
25064,
13,
9641,
62,
10951,
1875,
357,
18,
11,
2599,
198,
220,
220,
220,
890,
796,
493,
198,
220,
220,
220,
2124,
9521,
796,
2837,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 3.589385 | 358 |
import requests
from requests.structures import CaseInsensitiveDict
import json
BLOG_ID = "2352119848425464545"
BASE_URL = "https://www.googleapis.com/blogger/v3/blogs/"
if __name__ == "__main__":
main()
| [
11748,
7007,
198,
6738,
7007,
13,
7249,
942,
1330,
8913,
20376,
18464,
35,
713,
198,
11748,
33918,
198,
198,
9148,
7730,
62,
2389,
796,
366,
22370,
2481,
22337,
2780,
32114,
3510,
2231,
2231,
1,
198,
33,
11159,
62,
21886,
796,
366,
5450,
1378,
2503,
13,
13297,
499,
271,
13,
785,
14,
14036,
1362,
14,
85,
18,
14,
49096,
30487,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.696203 | 79 |
import streamlit as st # web development
import numpy as np # np mean, np random
import pandas as pd # read csv, df manipulation
import time # to simulate a real time data, time loop
import plotly.express as px # interactive charts
# read csv from a github repo
df = pd.read_csv("https://raw.githubusercontent.com/Lexie88rus/bank-marketing-analysis/master/bank.csv")
st.set_page_config(
page_title = 'Real-Time Data Science Dashboard',
page_icon = '✅',
layout = 'wide'
)
# dashboard title
st.title("Real-Time / Live Data Science Dashboard")
# top-level filters
job_filter = st.selectbox("Select the Job", pd.unique(df['job']))
# creating a single-element container.
placeholder = st.empty()
# dataframe filter
df = df[df['job']==job_filter]
# near real-time / live feed simulation
for seconds in range(200):
#while True:
df['age_new'] = df['age'] * np.random.choice(range(1,5))
df['balance_new'] = df['balance'] * np.random.choice(range(1,5))
# creating KPIs
avg_age = np.mean(df['age_new'])
count_married = int(df[(df["marital"]=='married')]['marital'].count() + np.random.choice(range(1,30)))
balance = np.mean(df['balance_new'])
with placeholder.container():
# create three columns
kpi1, kpi2, kpi3 = st.columns(3)
# fill in those three columns with respective metrics or KPIs
kpi1.metric(label="Age ⏳", value=round(avg_age), delta= round(avg_age) - 10)
kpi2.metric(label="Married Count 💍", value= int(count_married), delta= - 10 + count_married)
kpi3.metric(label="A/C Balance $", value= f"$ {round(balance,2)} ", delta= - round(balance/count_married) * 100)
# create two columns for charts
fig_col1, fig_col2 = st.columns(2)
with fig_col1:
st.markdown("### First Chart")
fig = px.density_heatmap(data_frame=df, y = 'age_new', x = 'marital')
st.write(fig)
with fig_col2:
st.markdown("### Second Chart")
fig2 = px.histogram(data_frame = df, x = 'age_new')
st.write(fig2)
st.markdown("### Detailed Data View")
st.dataframe(df)
time.sleep(1)
#placeholder.empty()
| [
11748,
4269,
18250,
355,
336,
1303,
3992,
2478,
198,
11748,
299,
32152,
355,
45941,
1303,
45941,
1612,
11,
45941,
4738,
220,
198,
11748,
19798,
292,
355,
279,
67,
1303,
1100,
269,
21370,
11,
47764,
17512,
198,
11748,
640,
1303,
284,
29308,
257,
1103,
640,
1366,
11,
640,
9052,
220,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
1303,
14333,
15907,
220,
628,
198,
2,
1100,
269,
21370,
422,
257,
33084,
29924,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
7203,
5450,
1378,
1831,
13,
12567,
43667,
13,
785,
14,
45117,
494,
3459,
14932,
14,
17796,
12,
10728,
278,
12,
20930,
14,
9866,
14,
17796,
13,
40664,
4943,
628,
198,
301,
13,
2617,
62,
7700,
62,
11250,
7,
198,
220,
220,
220,
2443,
62,
7839,
796,
705,
15633,
12,
7575,
6060,
5800,
16189,
3526,
3256,
198,
220,
220,
220,
2443,
62,
4749,
796,
705,
26486,
227,
3256,
198,
220,
220,
220,
12461,
796,
705,
4421,
6,
198,
8,
198,
198,
2,
30415,
3670,
198,
198,
301,
13,
7839,
7203,
15633,
12,
7575,
1220,
7547,
6060,
5800,
16189,
3526,
4943,
198,
198,
2,
1353,
12,
5715,
16628,
220,
198,
198,
21858,
62,
24455,
796,
336,
13,
19738,
3524,
7203,
17563,
262,
15768,
1600,
279,
67,
13,
34642,
7,
7568,
17816,
21858,
20520,
4008,
628,
198,
2,
4441,
257,
2060,
12,
30854,
9290,
13,
198,
5372,
13829,
796,
336,
13,
28920,
3419,
198,
198,
2,
1366,
14535,
8106,
220,
198,
198,
7568,
796,
47764,
58,
7568,
17816,
21858,
20520,
855,
21858,
62,
24455,
60,
198,
198,
2,
1474,
1103,
12,
2435,
1220,
2107,
3745,
18640,
220,
198,
198,
1640,
4201,
287,
2837,
7,
2167,
2599,
198,
2,
4514,
6407,
25,
220,
198,
220,
220,
220,
220,
198,
220,
220,
220,
47764,
17816,
496,
62,
3605,
20520,
796,
47764,
17816,
496,
20520,
1635,
45941,
13,
25120,
13,
25541,
7,
9521,
7,
16,
11,
20,
4008,
198,
220,
220,
220,
47764,
17816,
20427,
62,
3605,
20520,
796,
47764,
17816,
20427,
20520,
1635,
45941,
13,
25120,
13,
25541,
7,
9521,
7,
16,
11,
20,
4008,
628,
220,
220,
220,
1303,
4441,
45814,
3792,
220,
198,
220,
220,
220,
42781,
62,
496,
796,
45941,
13,
32604,
7,
7568,
17816,
496,
62,
3605,
6,
12962,
220,
628,
220,
220,
220,
954,
62,
30526,
796,
493,
7,
7568,
58,
7,
7568,
14692,
3876,
1287,
8973,
855,
6,
30526,
11537,
7131,
6,
3876,
1287,
6,
4083,
9127,
3419,
1343,
45941,
13,
25120,
13,
25541,
7,
9521,
7,
16,
11,
1270,
22305,
198,
220,
220,
220,
220,
198,
220,
220,
220,
5236,
796,
45941,
13,
32604,
7,
7568,
17816,
20427,
62,
3605,
6,
12962,
628,
220,
220,
220,
351,
46076,
13,
34924,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2251,
1115,
15180,
198,
220,
220,
220,
220,
220,
220,
220,
479,
14415,
16,
11,
479,
14415,
17,
11,
479,
14415,
18,
796,
336,
13,
28665,
82,
7,
18,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
6070,
287,
883,
1115,
15180,
351,
11756,
20731,
393,
45814,
3792,
220,
198,
220,
220,
220,
220,
220,
220,
220,
479,
14415,
16,
13,
4164,
1173,
7,
18242,
2625,
23396,
2343,
237,
111,
1600,
1988,
28,
744,
7,
615,
70,
62,
496,
828,
25979,
28,
2835,
7,
615,
70,
62,
496,
8,
532,
838,
8,
198,
220,
220,
220,
220,
220,
220,
220,
479,
14415,
17,
13,
4164,
1173,
7,
18242,
2625,
7676,
2228,
2764,
12520,
240,
235,
1600,
1988,
28,
493,
7,
9127,
62,
30526,
828,
25979,
28,
532,
838,
1343,
954,
62,
30526,
8,
198,
220,
220,
220,
220,
220,
220,
220,
479,
14415,
18,
13,
4164,
1173,
7,
18242,
2625,
32,
14,
34,
22924,
27332,
120,
226,
1600,
1988,
28,
277,
1,
3,
1391,
744,
7,
20427,
11,
17,
38165,
33172,
25979,
28,
532,
2835,
7,
20427,
14,
9127,
62,
30526,
8,
1635,
1802,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2251,
734,
15180,
329,
15907,
220,
628,
220,
220,
220,
220,
220,
220,
220,
2336,
62,
4033,
16,
11,
2336,
62,
4033,
17,
796,
336,
13,
28665,
82,
7,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2336,
62,
4033,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
13,
4102,
2902,
7203,
21017,
3274,
22086,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2336,
796,
279,
87,
13,
43337,
62,
25080,
8899,
7,
7890,
62,
14535,
28,
7568,
11,
331,
796,
705,
496,
62,
3605,
3256,
2124,
796,
705,
3876,
1287,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
13,
13564,
7,
5647,
8,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2336,
62,
4033,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
13,
4102,
2902,
7203,
21017,
5498,
22086,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2336,
17,
796,
279,
87,
13,
10034,
21857,
7,
7890,
62,
14535,
796,
47764,
11,
2124,
796,
705,
496,
62,
3605,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
13,
13564,
7,
5647,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
336,
13,
4102,
2902,
7203,
21017,
4614,
6255,
6060,
3582,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
336,
13,
7890,
14535,
7,
7568,
8,
198,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
16,
8,
198,
220,
220,
220,
1303,
5372,
13829,
13,
28920,
3419,
628,
198
] | 2.415401 | 922 |
"""
Earth moon sun
"""
import arcade
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600
class MyGame(arcade.Window):
""" Main application class. """
def on_draw(self):
"""
Render the screen.
"""
# This command has to happen before we start drawing
arcade.start_render()
self.earth_shape_list.draw()
self.moon_shape_list.draw()
def update(self, delta_time):
""" Movement and game logic """
self.earth_angle += 1
self.moon_angle += 5
earth_center_x, earth_center_y = arcade.rotate_point(
self.sun_x + self.earth_dist, self.sun_y,
self.sun_x, self.sun_y, self.earth_angle)
self.moon_shape_list.center_x = earth_center_x
self.moon_shape_list.center_y = earth_center_y
self.earth_shape_list.angle = self.earth_angle
self.moon_shape_list.angle = self.moon_angle
if __name__ == "__main__":
main() | [
37811,
198,
22840,
8824,
4252,
198,
37811,
198,
198,
11748,
27210,
198,
198,
6173,
2200,
1677,
62,
54,
2389,
4221,
796,
10053,
198,
6173,
2200,
1677,
62,
13909,
9947,
796,
10053,
628,
198,
4871,
2011,
8777,
7,
5605,
671,
13,
27703,
2599,
198,
220,
220,
220,
37227,
8774,
3586,
1398,
13,
37227,
628,
220,
220,
220,
825,
319,
62,
19334,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
46722,
262,
3159,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
3141,
468,
284,
1645,
878,
356,
923,
8263,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
9688,
62,
13287,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16442,
62,
43358,
62,
4868,
13,
19334,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22977,
62,
43358,
62,
4868,
13,
19334,
3419,
628,
220,
220,
220,
825,
4296,
7,
944,
11,
25979,
62,
2435,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15477,
290,
983,
9156,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16442,
62,
9248,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22977,
62,
9248,
15853,
642,
198,
220,
220,
220,
220,
220,
220,
220,
4534,
62,
16159,
62,
87,
11,
4534,
62,
16159,
62,
88,
796,
27210,
13,
10599,
378,
62,
4122,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19155,
62,
87,
1343,
2116,
13,
16442,
62,
17080,
11,
2116,
13,
19155,
62,
88,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19155,
62,
87,
11,
2116,
13,
19155,
62,
88,
11,
2116,
13,
16442,
62,
9248,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22977,
62,
43358,
62,
4868,
13,
16159,
62,
87,
796,
4534,
62,
16159,
62,
87,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22977,
62,
43358,
62,
4868,
13,
16159,
62,
88,
796,
4534,
62,
16159,
62,
88,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16442,
62,
43358,
62,
4868,
13,
9248,
796,
2116,
13,
16442,
62,
9248,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22977,
62,
43358,
62,
4868,
13,
9248,
796,
2116,
13,
22977,
62,
9248,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 2.259524 | 420 |
# %% [markdown]
# 分析test.py文件
# %%
import torch
from model.model import parsingNet
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.io import read_image
from PIL import Image
import cv2
import scipy.special
torch.backends.cudnn.benchmark = True
cls_num_per_lane = 18
net = parsingNet(pretrained = False, backbone='18',cls_dim = (200+1,cls_num_per_lane,4),
use_aux=False).cpu()
modlePath = 'culane_18.pth'
state_dict = torch.load(modlePath, map_location = 'cpu')['model']
# %%
net.load_state_dict(state_dict, strict = False)
net.eval()
# %%
img_transforms = transforms.Compose([
transforms.Resize((288, 800)),
transforms.ToTensor(),
transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
])
cap = cv2.VideoCapture("20190408035014_020328AA.MP4")
_,img = cap.read()
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img2 = Image.fromarray(img)
x = img_transforms(img2)
x = x.unsqueeze(0).cpu()+1
# %%
img_path = "mytest.jpg"
image = Image.open(img_path)
img = img_transforms(image)
img = img.cpu()
img = img.unsqueeze(0).cpu()+1
with torch.no_grad():
out = net(img)
# %% [markdown]
# 下面参照demo.py处理输出数据
# %%
out_j = out[0].data.cpu().numpy()
# 下面让18行row ankor上下颠倒排列
out_j = out_j[:, ::-1, :]
# softmax的参数axis=0,表示只对201个gridding做softmax运算
# out_j1[:-1, :, :]表示第一维度gridding数量减1,去掉最后一个
prob = scipy.special.softmax(out_j[:-1, :, :], axis=0)
# %%
import numpy as np
idx = np.arange(200) + 1
idx1 = idx.reshape(-1, 1, 1)
loc = np.sum(prob * idx1, axis=0)
out_j = np.argmax(out_j, axis=0)
loc[out_j == 200] = 0
out_j = loc
# %%
vis = cv2.imread(img_path)
col_sample = np.linspace(0, 800 - 1, 200)
col_sample_w = col_sample[1] - col_sample[0]
img_w, img_h = 1640, 590
row_anchor = [121, 131, 141, 150, 160, 170, 180, 189, 199, 209, 219, 228, 238, 248, 258, 267, 277, 287]
for i in range(out_j.shape[1]):
if np.sum(out_j[:, i] != 0) > 2:
for k in range(out_j.shape[0]):
if out_j[k, i] > 0:
ppp = (int(out_j[k, i] * col_sample_w * img_w / 800) - 1, int(img_h * (row_anchor[cls_num_per_lane-1-k]/288)) - 1 )
cv2.circle(vis,ppp,5,(0,255,0),-1)
# %%
cv2.imwrite('out4.jpg', vis)
| [
2,
43313,
685,
4102,
2902,
60,
198,
2,
10263,
230,
228,
162,
252,
238,
9288,
13,
9078,
23877,
229,
20015,
114,
198,
198,
2,
43313,
198,
11748,
28034,
198,
6738,
2746,
13,
19849,
1330,
32096,
7934,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
10178,
13,
952,
1330,
1100,
62,
9060,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
269,
85,
17,
198,
11748,
629,
541,
88,
13,
20887,
198,
198,
13165,
354,
13,
1891,
2412,
13,
66,
463,
20471,
13,
26968,
4102,
796,
6407,
198,
565,
82,
62,
22510,
62,
525,
62,
33533,
796,
1248,
198,
3262,
796,
32096,
7934,
7,
5310,
13363,
796,
10352,
11,
32774,
11639,
1507,
3256,
565,
82,
62,
27740,
796,
357,
2167,
10,
16,
11,
565,
82,
62,
22510,
62,
525,
62,
33533,
11,
19,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
779,
62,
14644,
28,
25101,
737,
36166,
3419,
198,
198,
4666,
293,
15235,
796,
705,
3129,
1531,
62,
1507,
13,
79,
400,
6,
198,
5219,
62,
11600,
796,
28034,
13,
2220,
7,
4666,
293,
15235,
11,
3975,
62,
24886,
796,
705,
36166,
11537,
17816,
19849,
20520,
628,
198,
2,
43313,
198,
3262,
13,
2220,
62,
5219,
62,
11600,
7,
5219,
62,
11600,
11,
7646,
796,
10352,
8,
198,
3262,
13,
18206,
3419,
198,
198,
2,
43313,
198,
9600,
62,
7645,
23914,
796,
31408,
13,
7293,
577,
26933,
198,
220,
220,
220,
220,
220,
220,
220,
31408,
13,
4965,
1096,
19510,
25270,
11,
10460,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
31408,
13,
2514,
51,
22854,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
31408,
13,
26447,
1096,
19510,
15,
13,
32642,
11,
657,
13,
29228,
11,
657,
13,
29703,
828,
357,
15,
13,
23539,
11,
657,
13,
24137,
11,
657,
13,
18182,
36911,
198,
220,
220,
220,
33761,
198,
198,
11128,
796,
269,
85,
17,
13,
10798,
49630,
7203,
1264,
3829,
1821,
1795,
2327,
28645,
62,
15,
22416,
2078,
3838,
13,
7378,
19,
4943,
198,
62,
11,
9600,
796,
1451,
13,
961,
3419,
198,
9600,
796,
269,
85,
17,
13,
33967,
83,
10258,
7,
9600,
11,
269,
85,
17,
13,
46786,
62,
33,
10761,
17,
36982,
8,
198,
9600,
17,
796,
7412,
13,
6738,
18747,
7,
9600,
8,
198,
87,
796,
33705,
62,
7645,
23914,
7,
9600,
17,
8,
198,
87,
796,
2124,
13,
13271,
421,
1453,
2736,
7,
15,
737,
36166,
3419,
10,
16,
198,
198,
2,
43313,
198,
198,
9600,
62,
6978,
796,
366,
1820,
9288,
13,
9479,
1,
198,
9060,
796,
7412,
13,
9654,
7,
9600,
62,
6978,
8,
198,
9600,
796,
33705,
62,
7645,
23914,
7,
9060,
8,
198,
9600,
796,
33705,
13,
36166,
3419,
198,
9600,
796,
33705,
13,
13271,
421,
1453,
2736,
7,
15,
737,
36166,
3419,
10,
16,
198,
4480,
28034,
13,
3919,
62,
9744,
33529,
198,
220,
220,
220,
503,
796,
2010,
7,
9600,
8,
198,
198,
2,
43313,
685,
4102,
2902,
60,
198,
2,
220,
10310,
233,
165,
251,
95,
20998,
224,
163,
227,
100,
9536,
78,
13,
9078,
13783,
226,
49426,
228,
164,
122,
241,
49035,
118,
46763,
108,
162,
235,
106,
198,
198,
2,
43313,
198,
448,
62,
73,
796,
503,
58,
15,
4083,
7890,
13,
36166,
22446,
77,
32152,
3419,
198,
2,
220,
10310,
233,
165,
251,
95,
164,
106,
102,
1507,
26193,
234,
808,
16553,
273,
41468,
10310,
233,
165,
95,
254,
161,
222,
240,
162,
236,
240,
26344,
245,
198,
448,
62,
73,
796,
503,
62,
73,
58,
45299,
7904,
12,
16,
11,
1058,
60,
198,
2,
2705,
9806,
21410,
20998,
224,
46763,
108,
22704,
28,
15,
171,
120,
234,
26193,
101,
163,
97,
118,
20998,
103,
43380,
117,
1264,
10310,
103,
2164,
13494,
161,
223,
248,
4215,
9806,
32573,
238,
163,
106,
245,
198,
2,
503,
62,
73,
16,
58,
21912,
16,
11,
1058,
11,
1058,
60,
26193,
101,
163,
97,
118,
163,
105,
105,
31660,
163,
119,
112,
41753,
99,
2164,
13494,
46763,
108,
34932,
237,
49035,
237,
16,
171,
120,
234,
43889,
119,
162,
236,
231,
17312,
222,
28938,
236,
31660,
10310,
103,
198,
1676,
65,
796,
629,
541,
88,
13,
20887,
13,
4215,
9806,
7,
448,
62,
73,
58,
21912,
16,
11,
1058,
11,
1058,
4357,
16488,
28,
15,
8,
198,
198,
2,
43313,
198,
11748,
299,
32152,
355,
45941,
198,
312,
87,
796,
45941,
13,
283,
858,
7,
2167,
8,
1343,
352,
198,
312,
87,
16,
796,
4686,
87,
13,
3447,
1758,
32590,
16,
11,
352,
11,
352,
8,
198,
198,
17946,
796,
45941,
13,
16345,
7,
1676,
65,
1635,
4686,
87,
16,
11,
16488,
28,
15,
8,
198,
448,
62,
73,
796,
45941,
13,
853,
9806,
7,
448,
62,
73,
11,
16488,
28,
15,
8,
198,
17946,
58,
448,
62,
73,
6624,
939,
60,
796,
657,
198,
448,
62,
73,
796,
1179,
198,
198,
2,
43313,
198,
4703,
796,
269,
85,
17,
13,
320,
961,
7,
9600,
62,
6978,
8,
198,
4033,
62,
39873,
796,
45941,
13,
21602,
10223,
7,
15,
11,
10460,
532,
352,
11,
939,
8,
198,
4033,
62,
39873,
62,
86,
796,
951,
62,
39873,
58,
16,
60,
532,
951,
62,
39873,
58,
15,
60,
198,
9600,
62,
86,
11,
33705,
62,
71,
796,
1467,
1821,
11,
642,
3829,
198,
808,
62,
3702,
273,
796,
685,
19244,
11,
23134,
11,
25500,
11,
6640,
11,
13454,
11,
16677,
11,
11546,
11,
27230,
11,
1594,
11,
28815,
11,
30453,
11,
29041,
11,
32544,
11,
32996,
11,
37528,
11,
37364,
11,
38703,
11,
38721,
60,
198,
1640,
1312,
287,
2837,
7,
448,
62,
73,
13,
43358,
58,
16,
60,
2599,
198,
220,
220,
220,
611,
45941,
13,
16345,
7,
448,
62,
73,
58,
45299,
1312,
60,
14512,
657,
8,
1875,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
479,
287,
2837,
7,
448,
62,
73,
13,
43358,
58,
15,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
503,
62,
73,
58,
74,
11,
1312,
60,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
381,
796,
357,
600,
7,
448,
62,
73,
58,
74,
11,
1312,
60,
1635,
951,
62,
39873,
62,
86,
1635,
33705,
62,
86,
1220,
10460,
8,
532,
352,
11,
493,
7,
9600,
62,
71,
1635,
357,
808,
62,
3702,
273,
58,
565,
82,
62,
22510,
62,
525,
62,
33533,
12,
16,
12,
74,
60,
14,
25270,
4008,
532,
352,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
4703,
11,
381,
79,
11,
20,
11,
7,
15,
11,
13381,
11,
15,
828,
12,
16,
8,
198,
198,
2,
43313,
198,
33967,
17,
13,
320,
13564,
10786,
448,
19,
13,
9479,
3256,
1490,
8,
628,
628
] | 1.948829 | 1,153 |
# -*- coding: utf-8 -*-
"""
Django application to add 'django-crispy-forms' layout objects for Materialize
"""
__version__ = '0.2'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
35,
73,
14208,
3586,
284,
751,
705,
28241,
14208,
12,
66,
2442,
9078,
12,
23914,
6,
12461,
5563,
329,
14633,
1096,
198,
37811,
198,
834,
9641,
834,
796,
705,
15,
13,
17,
6,
198
] | 2.62 | 50 |
import json
import multiprocessing as mp
import random
import threading
import time
import numpy as np
from threading import Thread, Lock
from common.constants import *
from common.enums.climb_state import ClimbState
from common.enums.collision_control_methods import CCMethods
from common.enums.direction import Direction
from common.enums.layout import Layouts
from common.enums.layout_block import LayoutBlock
from common.enums.player import Player
from common.enums.server_message import ServerMessage
from common.layout_builder import get_level_layout
from server.donkey_kong_server import Server
from server.models.collision.pipe_message import Message
from server.models.game_objects.barrel import Barrel
from server.models.game_objects.coin import Coin
from server.models.game_objects.gorilla import Gorilla
from server.models.game_objects.princess import Princess
from server.models.networking.client import Client
class Match:
""" Starts object threads """
""" Sets the scene layout, notifies players to load the scene """
""" Sends a message to all players in the match """
""" Sends a message to the opponent """
""" Adds a player to the match """
""" Removes the player from the match and ends the match if favor of his opponent """
""" Checks if a player can move in the desired direction. """
""" Sets the layout of the current level """
""" Resets player lives """
""" Checks if a player should fall. Notifies both players to move the avatar of the falling player down. """
""" Checks if both players are dead """
""" Handles barrel movement, removing and collision with players """
""" Handles collision with princess, starts next level upon collision """
""" Handles collision with gorilla """
""" Handles gorilla movement and barrel throwing """
""" Handles coin drawing and removal """
""" Sets coin position """
""" Sends coin effect messages """
""" Notifies both players to move the gorilla """
""" Notifies both players to draw a barrel """
""" Thread safe check if threads should terminate """
""" Checks if both players are dead """
""" Notifies both players to move the player avatar left """
""" Notifies both players to move the player avatar right """
""" Notifies both players to move the player avatar up """
""" Notifies both players to move the player avatar down """
""" Stops running threads, closes all pipes to collision control and notifies players that the match ended """
""" Creates a pipe between collision control and this match """
""" Sets starting positions for players, princess, gorilla and gorilla movement boundaries """
""" Sets the current layout of the scene """
""" Resets player positions to their starting ones fot that scene """
""" Thread safe deleting of all barrels """
| [
11748,
33918,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
11748,
4738,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4704,
278,
1330,
14122,
11,
13656,
198,
6738,
2219,
13,
9979,
1187,
1330,
1635,
198,
6738,
2219,
13,
268,
5700,
13,
565,
14107,
62,
5219,
1330,
1012,
14107,
9012,
198,
6738,
2219,
13,
268,
5700,
13,
26000,
1166,
62,
13716,
62,
24396,
82,
1330,
12624,
46202,
198,
6738,
2219,
13,
268,
5700,
13,
37295,
1330,
41837,
198,
6738,
2219,
13,
268,
5700,
13,
39786,
1330,
18881,
5269,
198,
6738,
2219,
13,
268,
5700,
13,
39786,
62,
9967,
1330,
47639,
12235,
198,
6738,
2219,
13,
268,
5700,
13,
7829,
1330,
7853,
198,
6738,
2219,
13,
268,
5700,
13,
15388,
62,
20500,
1330,
9652,
12837,
198,
6738,
2219,
13,
39786,
62,
38272,
1330,
651,
62,
5715,
62,
39786,
198,
6738,
4382,
13,
9099,
2539,
62,
74,
506,
62,
15388,
1330,
9652,
198,
6738,
4382,
13,
27530,
13,
26000,
1166,
13,
34360,
62,
20500,
1330,
16000,
198,
6738,
4382,
13,
27530,
13,
6057,
62,
48205,
13,
5657,
2411,
1330,
29920,
198,
6738,
4382,
13,
27530,
13,
6057,
62,
48205,
13,
3630,
1330,
16312,
198,
6738,
4382,
13,
27530,
13,
6057,
62,
48205,
13,
7053,
5049,
1330,
19097,
5049,
198,
6738,
4382,
13,
27530,
13,
6057,
62,
48205,
13,
1050,
259,
919,
1330,
8449,
198,
6738,
4382,
13,
27530,
13,
3262,
16090,
13,
16366,
1330,
20985,
628,
198,
4871,
13225,
25,
628,
198,
220,
220,
220,
37227,
50181,
2134,
14390,
37227,
628,
220,
220,
220,
37227,
21394,
262,
3715,
12461,
11,
407,
6945,
1938,
284,
3440,
262,
3715,
37227,
628,
220,
220,
220,
37227,
311,
2412,
257,
3275,
284,
477,
1938,
287,
262,
2872,
37227,
628,
220,
220,
220,
37227,
311,
2412,
257,
3275,
284,
262,
6125,
37227,
628,
220,
220,
220,
37227,
34333,
257,
2137,
284,
262,
2872,
37227,
628,
220,
220,
220,
37227,
3982,
5241,
262,
2137,
422,
262,
2872,
290,
5645,
262,
2872,
611,
2661,
286,
465,
6125,
37227,
628,
220,
220,
220,
37227,
47719,
611,
257,
2137,
460,
1445,
287,
262,
10348,
4571,
13,
37227,
628,
220,
220,
220,
37227,
21394,
262,
12461,
286,
262,
1459,
1241,
37227,
628,
220,
220,
220,
37227,
1874,
1039,
2137,
3160,
37227,
628,
220,
220,
220,
37227,
47719,
611,
257,
2137,
815,
2121,
13,
1892,
6945,
1111,
1938,
284,
1445,
262,
30919,
286,
262,
7463,
2137,
866,
13,
37227,
628,
220,
220,
220,
37227,
47719,
611,
1111,
1938,
389,
2636,
37227,
628,
220,
220,
220,
37227,
7157,
829,
9036,
3356,
11,
10829,
290,
17661,
351,
1938,
37227,
628,
220,
220,
220,
37227,
7157,
829,
17661,
351,
21752,
11,
4940,
1306,
1241,
2402,
17661,
37227,
628,
220,
220,
220,
37227,
7157,
829,
17661,
351,
45314,
37227,
628,
220,
220,
220,
37227,
7157,
829,
45314,
3356,
290,
9036,
9644,
37227,
628,
220,
220,
220,
37227,
7157,
829,
10752,
8263,
290,
9934,
37227,
628,
220,
220,
220,
37227,
21394,
10752,
2292,
37227,
628,
220,
220,
220,
37227,
311,
2412,
10752,
1245,
6218,
37227,
628,
220,
220,
220,
37227,
1892,
6945,
1111,
1938,
284,
1445,
262,
45314,
37227,
628,
220,
220,
220,
37227,
1892,
6945,
1111,
1938,
284,
3197,
257,
9036,
37227,
628,
220,
220,
220,
37227,
14122,
3338,
2198,
611,
14390,
815,
23654,
37227,
628,
220,
220,
220,
37227,
47719,
611,
1111,
1938,
389,
2636,
37227,
628,
220,
220,
220,
37227,
1892,
6945,
1111,
1938,
284,
1445,
262,
2137,
30919,
1364,
37227,
628,
220,
220,
220,
37227,
1892,
6945,
1111,
1938,
284,
1445,
262,
2137,
30919,
826,
37227,
628,
220,
220,
220,
37227,
1892,
6945,
1111,
1938,
284,
1445,
262,
2137,
30919,
510,
37227,
628,
220,
220,
220,
37227,
1892,
6945,
1111,
1938,
284,
1445,
262,
2137,
30919,
866,
37227,
628,
220,
220,
220,
37227,
520,
2840,
2491,
14390,
11,
20612,
477,
19860,
284,
17661,
1630,
290,
407,
6945,
1938,
326,
262,
2872,
4444,
37227,
628,
220,
220,
220,
37227,
7921,
274,
257,
12656,
1022,
17661,
1630,
290,
428,
2872,
37227,
628,
220,
220,
220,
37227,
21394,
3599,
6116,
329,
1938,
11,
21752,
11,
45314,
290,
45314,
3356,
13215,
37227,
628,
220,
220,
220,
37227,
21394,
262,
1459,
12461,
286,
262,
3715,
37227,
628,
220,
220,
220,
37227,
1874,
1039,
2137,
6116,
284,
511,
3599,
3392,
277,
313,
326,
3715,
37227,
628,
220,
220,
220,
37227,
14122,
3338,
34817,
286,
477,
17907,
37227,
198
] | 3.991724 | 725 |
from pathlib import Path
import json
import pytest
import requests_mock
import shapely
# pylint: disable=unused-import,wrong-import-order
from .context import Workflow
from .fixtures import auth_mock, auth_live, workflow_mock, workflow_live, job_mock
import up42
json_workflow_tasks = {
"data": [
{
"id": "c0d04ec3-98d7-4183-902f-5bcb2a176d89",
"name": "sobloo-s2-l1c-aoiclipped:1",
"block": {
"name": "sobloo-s2-l1c-aoiclipped",
"parameters": {
"nodata": {"type": "number",},
"time": {
"type": "dateRange",
"default": "2018-01-01T00:00:00+00:00/2020-12-31T23:59:59+00:00",
},
},
},
},
{
"id": "af626c54-156e-4f13-a743-55efd27de533",
"name": "tiling:1",
"block": {
"name": "tiling",
"parameters": {
"nodata": {
"type": "number",
"default": None,
"required": False,
"description": "Value representing..",
},
"tile_width": {
"type": "number",
"default": 768,
"required": True,
"description": "Width of a tile in pixels",
},
},
},
},
],
"error": {},
}
@pytest.mark.live
@pytest.mark.live
@pytest.mark.skip
# TODO: Resolve
@pytest.mark.live
@pytest.mark.live
@pytest.mark.live
@pytest.mark.live
@pytest.mark.skip
@pytest.mark.live
# TODO: Resolve
# def test_update_name(workflow_mock, caplog):
# new_name = "new_workflow_name"
# with requests_mock.Mocker() as m:
# url_update_name = (
# f"{workflow_mock.auth._endpoint()}/projects/{workflow_mock.auth.project_id}/workflows/"
# f"{workflow_mock.workflow_id}"
# )
# json_new_properties = {"data": {}, "error": {}}
# m.post(
# url=url_update_name,
# json=json_new_properties,
# )
#
# workflow_mock.update_name(name=new_name)
# assert f"Updated workflow name: {new_name}" in caplog.text
@pytest.mark.skip
# TODO: Resolve
| [
6738,
3108,
8019,
1330,
10644,
198,
11748,
33918,
198,
11748,
12972,
9288,
198,
11748,
7007,
62,
76,
735,
198,
11748,
5485,
306,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
11748,
11,
36460,
12,
11748,
12,
2875,
198,
6738,
764,
22866,
1330,
5521,
11125,
198,
6738,
764,
69,
25506,
1330,
6284,
62,
76,
735,
11,
6284,
62,
12583,
11,
30798,
62,
76,
735,
11,
30798,
62,
12583,
11,
1693,
62,
76,
735,
198,
11748,
510,
3682,
628,
198,
17752,
62,
1818,
11125,
62,
83,
6791,
796,
1391,
198,
220,
220,
220,
366,
7890,
1298,
685,
198,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
366,
66,
15,
67,
3023,
721,
18,
12,
4089,
67,
22,
12,
19,
24839,
12,
24,
2999,
69,
12,
20,
15630,
65,
17,
64,
24096,
67,
4531,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
568,
2436,
2238,
12,
82,
17,
12,
75,
16,
66,
12,
5488,
291,
75,
3949,
25,
16,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9967,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
568,
2436,
2238,
12,
82,
17,
12,
75,
16,
66,
12,
5488,
291,
75,
3949,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
17143,
7307,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
77,
375,
1045,
1298,
19779,
4906,
1298,
366,
17618,
1600,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2435,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4906,
1298,
366,
4475,
17257,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12286,
1298,
366,
7908,
12,
486,
12,
486,
51,
405,
25,
405,
25,
405,
10,
405,
25,
405,
14,
42334,
12,
1065,
12,
3132,
51,
1954,
25,
3270,
25,
3270,
10,
405,
25,
405,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
366,
1878,
45191,
66,
4051,
12,
21599,
68,
12,
19,
69,
1485,
12,
64,
22,
3559,
12,
2816,
891,
67,
1983,
2934,
44994,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
83,
4386,
25,
16,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9967,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
83,
4386,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
17143,
7307,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
77,
375,
1045,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4906,
1298,
366,
17618,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12286,
1298,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
35827,
1298,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
11213,
1298,
366,
11395,
10200,
492,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
40927,
62,
10394,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4906,
1298,
366,
17618,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12286,
1298,
46720,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
35827,
1298,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
11213,
1298,
366,
30916,
286,
257,
17763,
287,
17848,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
366,
18224,
1298,
1391,
5512,
198,
92,
628,
628,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
48267,
198,
2,
16926,
46,
25,
1874,
6442,
628,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
628,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
48267,
198,
31,
9078,
9288,
13,
4102,
13,
12583,
628,
198,
2,
16926,
46,
25,
1874,
6442,
198,
2,
825,
1332,
62,
19119,
62,
3672,
7,
1818,
11125,
62,
76,
735,
11,
1275,
489,
519,
2599,
198,
2,
220,
220,
220,
220,
649,
62,
3672,
796,
366,
3605,
62,
1818,
11125,
62,
3672,
1,
198,
2,
220,
220,
220,
220,
351,
7007,
62,
76,
735,
13,
44,
12721,
3419,
355,
285,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
62,
19119,
62,
3672,
796,
357,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
90,
1818,
11125,
62,
76,
735,
13,
18439,
13557,
437,
4122,
3419,
92,
14,
42068,
14,
90,
1818,
11125,
62,
76,
735,
13,
18439,
13,
16302,
62,
312,
92,
14,
1818,
44041,
30487,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
90,
1818,
11125,
62,
76,
735,
13,
1818,
11125,
62,
312,
36786,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
3605,
62,
48310,
796,
19779,
7890,
1298,
1391,
5512,
366,
18224,
1298,
1391,
11709,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
7353,
7,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
28,
6371,
62,
19119,
62,
3672,
11,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
28,
17752,
62,
3605,
62,
48310,
11,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
30798,
62,
76,
735,
13,
19119,
62,
3672,
7,
3672,
28,
3605,
62,
3672,
8,
198,
2,
220,
220,
220,
220,
6818,
277,
1,
17354,
30798,
1438,
25,
1391,
3605,
62,
3672,
36786,
287,
1275,
489,
519,
13,
5239,
628,
198,
31,
9078,
9288,
13,
4102,
13,
48267,
198,
2,
16926,
46,
25,
1874,
6442,
198
] | 1.714589 | 1,412 |
# -*- coding: utf-8 -*-
CUSTOMER = '000'
SPANISH = '001'
ENGLISH = '002'
CATALAN = '003'
FRENCH = '004'
GERMAN = '005'
DUTCH = '006'
ITALIAN = '007'
SWEDISH = '008'
PORTUGUESE = '009'
VALENCIAN = '010'
POLISH = '011'
GALICIAN = '012'
EUSKERA = '013'
LANGUAGES = [
CUSTOMER,
SPANISH,
ENGLISH,
CATALAN,
FRENCH,
GERMAN,
DUTCH,
ITALIAN,
SWEDISH,
PORTUGUESE,
VALENCIAN,
POLISH,
GALICIAN,
EUSKERA
]
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
34,
7759,
2662,
1137,
796,
705,
830,
6,
198,
4303,
1565,
18422,
796,
705,
8298,
6,
198,
1677,
8763,
18422,
796,
705,
21601,
6,
198,
34,
1404,
1847,
1565,
796,
705,
11245,
6,
198,
10913,
1677,
3398,
796,
705,
22914,
6,
198,
30373,
10725,
796,
705,
22544,
6,
198,
35,
3843,
3398,
796,
705,
28041,
6,
198,
40579,
16868,
796,
705,
25816,
6,
198,
17887,
1961,
18422,
796,
705,
25257,
6,
198,
15490,
7340,
52,
33635,
796,
705,
28694,
6,
198,
23428,
24181,
16868,
796,
705,
20943,
6,
198,
45472,
18422,
796,
705,
28555,
6,
198,
38,
1847,
2149,
16868,
796,
705,
30206,
6,
198,
36,
2937,
42839,
32,
796,
705,
30273,
6,
198,
198,
43,
15567,
52,
25552,
796,
685,
198,
220,
220,
220,
327,
7759,
2662,
1137,
11,
198,
220,
220,
220,
6226,
1565,
18422,
11,
198,
220,
220,
220,
12964,
8763,
18422,
11,
198,
220,
220,
220,
38348,
1847,
1565,
11,
198,
220,
220,
220,
8782,
1677,
3398,
11,
198,
220,
220,
220,
44186,
10725,
11,
198,
220,
220,
220,
360,
3843,
3398,
11,
198,
220,
220,
220,
7283,
1847,
16868,
11,
198,
220,
220,
220,
12672,
1961,
18422,
11,
198,
220,
220,
220,
350,
9863,
7340,
52,
33635,
11,
198,
220,
220,
220,
26173,
24181,
16868,
11,
198,
220,
220,
220,
20634,
18422,
11,
198,
220,
220,
220,
402,
1847,
2149,
16868,
11,
198,
220,
220,
220,
412,
2937,
42839,
32,
198,
60,
198
] | 1.782609 | 253 |
import os
import unittest
from vipps import VippsEcomApi, VippsSignupApi
import env
VIPPS_CLIENT_ID = env.VIPPS_CLIENT_ID
VIPPS_CLIENT_SECRET = env.VIPPS_CLIENT_SECRET
VIPPS_SUBSCRIPTION_KEY = env.VIPPS_SUBSCRIPTION_KEY
VIPPS_MERCHANT_SERIAL_NUMBER = env.VIPPS_MERCHANT_SERIAL_NUMBER
VIPPS_SERVER = env.VIPPS_SERVER
VIPPS_CALLBACK_PREFIX = env.VIPPS_CALLBACK_PREFIX
VIPPS_FALLBACK_URL = env.VIPPS_FALLBACK_URL
| [
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
410,
3974,
82,
1330,
569,
3974,
82,
36,
785,
32,
14415,
11,
569,
3974,
82,
11712,
929,
32,
14415,
198,
198,
11748,
17365,
628,
198,
53,
4061,
3705,
62,
5097,
28495,
62,
2389,
796,
17365,
13,
53,
4061,
3705,
62,
5097,
28495,
62,
2389,
198,
53,
4061,
3705,
62,
5097,
28495,
62,
23683,
26087,
796,
17365,
13,
53,
4061,
3705,
62,
5097,
28495,
62,
23683,
26087,
198,
53,
4061,
3705,
62,
12564,
4462,
40165,
62,
20373,
796,
17365,
13,
53,
4061,
3705,
62,
12564,
4462,
40165,
62,
20373,
198,
53,
4061,
3705,
62,
29296,
3398,
8643,
62,
35009,
12576,
62,
41359,
13246,
796,
17365,
13,
53,
4061,
3705,
62,
29296,
3398,
8643,
62,
35009,
12576,
62,
41359,
13246,
198,
53,
4061,
3705,
62,
35009,
5959,
796,
17365,
13,
53,
4061,
3705,
62,
35009,
5959,
198,
53,
4061,
3705,
62,
34,
7036,
31098,
62,
47,
31688,
10426,
796,
17365,
13,
53,
4061,
3705,
62,
34,
7036,
31098,
62,
47,
31688,
10426,
198,
53,
4061,
3705,
62,
37,
7036,
31098,
62,
21886,
796,
17365,
13,
53,
4061,
3705,
62,
37,
7036,
31098,
62,
21886,
628
] | 2.150259 | 193 |
# -*- coding: utf-8 -*-
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628
] | 1.785714 | 14 |
import cv2 as cv
import numpy as np
import pandas as pd
import time
import os
start_time = time.time()
lengi = 0
df = pd.DataFrame(columns=['document_id', 'set_id', 'student_id', 'answer_keys'])
xForQuads = [(344, 552), (620, 828), (897, 1106), (1174, 1382)]
yForQuads = [(897, 1115), (1115, 1333), (1333, 1550), (1550, 1767), (1767, 1984)]
setCords = [480, 840, 856, 944]
studentCords = [480, 840, 970, 1378]
thresholdForWhitePixels = 0.195
for entry in os.scandir('/home/manish/Desktop/JhunAlignedWithBlob'):
if entry.path.endswith('.jpg') and entry.is_file():
src = entry.path
start = src.find('image')+5
end = src.find('.jpg')
docId = src[start:end]
imageOriginal = cv.imread(src, -1)
imageThresh = image_thresholding(imageOriginal)
imageSet = imageThresh[setCords[0]:setCords[1], setCords[2]:setCords[3]]
imageStudent = imageThresh[studentCords[0]:studentCords[1], studentCords[2]:studentCords[3]]
data = [docId, getIds(imageSet, 2), getIds(imageStudent, 9), getAnswerKeys(imageThresh)]
df.loc[len(df.index)] = data
lengi += 1
print(f'Done processing image {lengi}: {docId}')
# if lengi == 1:
# break
# break
# break
# print(df.head())
df['set_id'] = df['set_id'].apply('="{}"'.format)
df['student_id'] = df['student_id'].apply('="{}"'.format)
df['answer_keys'] = df['answer_keys'].apply('="{}"'.format)
df.to_csv('/home/manish/Desktop/bubble_processed3_V3.csv', index=False)
print(f'Total time taken: {(time.time() - start_time) / float(60)} minutes.') | [
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
640,
198,
11748,
28686,
198,
198,
9688,
62,
2435,
796,
640,
13,
2435,
3419,
198,
75,
1516,
72,
796,
657,
198,
7568,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
28,
17816,
22897,
62,
312,
3256,
705,
2617,
62,
312,
3256,
705,
50139,
62,
312,
3256,
705,
41484,
62,
13083,
6,
12962,
198,
87,
1890,
4507,
5643,
796,
47527,
33535,
11,
642,
4309,
828,
357,
38850,
11,
807,
2078,
828,
357,
4531,
22,
11,
9796,
21,
828,
357,
1157,
4524,
11,
1511,
6469,
15437,
198,
88,
1890,
4507,
5643,
796,
47527,
4531,
22,
11,
13374,
20,
828,
357,
1157,
1314,
11,
1511,
2091,
828,
357,
1485,
2091,
11,
1315,
1120,
828,
357,
1314,
1120,
11,
1596,
3134,
828,
357,
1558,
3134,
11,
12844,
15437,
198,
2617,
34,
3669,
796,
685,
22148,
11,
48777,
11,
807,
3980,
11,
860,
2598,
60,
198,
50139,
34,
3669,
796,
685,
22148,
11,
48777,
11,
40463,
11,
1511,
3695,
60,
198,
198,
400,
10126,
1890,
12256,
47,
14810,
796,
657,
13,
22186,
198,
198,
1640,
5726,
287,
28686,
13,
1416,
392,
343,
10786,
14,
11195,
14,
805,
680,
14,
36881,
14,
41,
20088,
2348,
3916,
3152,
3629,
672,
6,
2599,
198,
220,
220,
220,
611,
5726,
13,
6978,
13,
437,
2032,
342,
7,
4458,
9479,
11537,
290,
5726,
13,
271,
62,
7753,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
12351,
796,
5726,
13,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
12351,
13,
19796,
10786,
9060,
11537,
10,
20,
198,
220,
220,
220,
220,
220,
220,
220,
886,
796,
12351,
13,
19796,
7,
4458,
9479,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2205,
7390,
796,
12351,
58,
9688,
25,
437,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
20556,
796,
269,
85,
13,
320,
961,
7,
10677,
11,
532,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
817,
3447,
796,
2939,
62,
400,
10126,
278,
7,
9060,
20556,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
7248,
796,
2939,
817,
3447,
58,
2617,
34,
3669,
58,
15,
5974,
2617,
34,
3669,
58,
16,
4357,
900,
34,
3669,
58,
17,
5974,
2617,
34,
3669,
58,
18,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
38778,
796,
2939,
817,
3447,
58,
50139,
34,
3669,
58,
15,
5974,
50139,
34,
3669,
58,
16,
4357,
3710,
34,
3669,
58,
17,
5974,
50139,
34,
3669,
58,
18,
11907,
628,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
685,
15390,
7390,
11,
651,
7390,
82,
7,
9060,
7248,
11,
362,
828,
651,
7390,
82,
7,
9060,
38778,
11,
860,
828,
651,
33706,
40729,
7,
9060,
817,
3447,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
47764,
13,
17946,
58,
11925,
7,
7568,
13,
9630,
15437,
796,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
40038,
72,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
45677,
7587,
2939,
1391,
75,
1516,
72,
38362,
1391,
15390,
7390,
92,
11537,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
611,
40038,
72,
6624,
352,
25,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
1303,
2270,
198,
198,
2,
3601,
7,
7568,
13,
2256,
28955,
198,
7568,
17816,
2617,
62,
312,
20520,
796,
47764,
17816,
2617,
62,
312,
6,
4083,
39014,
10786,
2625,
90,
36786,
4458,
18982,
8,
198,
7568,
17816,
50139,
62,
312,
20520,
796,
47764,
17816,
50139,
62,
312,
6,
4083,
39014,
10786,
2625,
90,
36786,
4458,
18982,
8,
198,
7568,
17816,
41484,
62,
13083,
20520,
796,
47764,
17816,
41484,
62,
13083,
6,
4083,
39014,
10786,
2625,
90,
36786,
4458,
18982,
8,
198,
7568,
13,
1462,
62,
40664,
10786,
14,
11195,
14,
805,
680,
14,
36881,
14,
46176,
903,
62,
14681,
276,
18,
62,
53,
18,
13,
40664,
3256,
6376,
28,
25101,
8,
198,
4798,
7,
69,
6,
14957,
640,
2077,
25,
1391,
7,
2435,
13,
2435,
3419,
532,
923,
62,
2435,
8,
1220,
12178,
7,
1899,
38165,
2431,
2637,
8
] | 2.259207 | 706 |
import skimage
import tqdm
import numpy as np
from imageProcessing import *
| [
11748,
1341,
9060,
201,
198,
11748,
256,
80,
36020,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
2939,
18709,
278,
1330,
1635,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201
] | 2.542857 | 35 |
# Import the necessary packages and modules
import matplotlib.pyplot as plt
import numpy as np
f = open('history.txt', 'r')
for line in f:
if line.startswith('='):
tokens = line.split('\t')
# Prepare the data
x = np.linspace(0, 10, 100)
# Plot the data
plt.plot(x, x, label='linear')
# Add a legend
plt.legend()
# Show the plot
plt.show() | [
2,
17267,
262,
3306,
10392,
290,
13103,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
628,
198,
69,
796,
1280,
10786,
23569,
13,
14116,
3256,
705,
81,
11537,
198,
198,
1640,
1627,
287,
277,
25,
198,
220,
220,
220,
611,
1627,
13,
9688,
2032,
342,
10786,
11639,
2599,
628,
220,
220,
220,
16326,
796,
1627,
13,
35312,
10786,
59,
83,
11537,
198,
198,
2,
43426,
262,
1366,
198,
87,
796,
45941,
13,
21602,
10223,
7,
15,
11,
838,
11,
1802,
8,
198,
198,
2,
28114,
262,
1366,
198,
489,
83,
13,
29487,
7,
87,
11,
2124,
11,
6167,
11639,
29127,
11537,
198,
198,
2,
3060,
257,
8177,
198,
489,
83,
13,
1455,
437,
3419,
198,
198,
2,
5438,
262,
7110,
198,
489,
83,
13,
12860,
3419
] | 2.622222 | 135 |
SLAP_TEMPLATES = (
"{user1} {hits} {user2} with a {item}.",
"{user1} {hits} {user2} in the face with a {item}.",
"{user1} {hits} {user2} around a bit with a {item}.",
"{user1} {throws} a {item} at {user2}.",
"{user1} grabs a {item} and {throws} it at {user2}'s face.",
"{user1} launches a {item} in {user2}'s general direction.",
"{user1} starts slapping {user2} silly with a {item}.",
"{user1} pins {user2} down and repeatedly {hits} them with a {item}.",
"{user1} grabs up a {item} and {hits} {user2} with it.",
"{user1} ties {user2} to a chair and {throws} a {item} at them.",
"{user1} gave a friendly push to help {user2} learn to swim in lava.",
"{user1} {hits} {user2} with a diamond sword.",
"{user1} used Splash! But nothing happened...",
)
SLAP_SELF = (
"{user1} {hits} themselves with a {item} in their confusion!",
"{user1} {hits} themselves in the face with a {item}... what an idiot.",
"{user1} {hits} themselves around a bit with a {item}... but why?",
"{user1} hits their head against a wall... for some reason.",
"{user1} launches themselves into space without a spacesuit... because they thought there was oxygen.",
"{user1} {hits} themselves with a {item} after looking at Windows 8's UI. They lost all hope of humanity.",
"{user1} is confused. They hurt themselves in their confusion.",
)
SLAP_BASIC = (
"{user1} was squished too much.",
"{user1} fell from a high place.",
"{user1} suffocated in a wall.",
"{user1} was struck by lightning.",
"{user1} was squished by a falling anvil.",
)
ITEMS = (
"cast iron skillet",
"large trout",
"baseball bat",
"cricket bat",
"wooden cane",
"dildo",
"printer",
"shovel",
"CRT monitor",
"physics textbook",
"toaster",
"portrait of Richard Stallman",
"television",
"five ton truck",
"roll of duct tape",
"book",
"laptop",
"old television",
"sack of rocks",
"rainbow trout",
"rubber chicken",
"spiked bat",
"fire extinguisher",
"heavy rock",
"block of dirt",
"beehive",
"piece of rotten meat",
"bear",
"ton of bricks",
)
THROW = ("throws", "flings", "chucks", "hurls")
HIT = ("hits", "whacks", "slaps", "smacks", "bashes")
RUN_STRINGS = (
"Where do you think you're going?",
"Huh? what? did they get away?",
"ZZzzZZzz... Huh? what? oh, just them again, nevermind.",
"Get back here!",
"Not so fast...",
"Look out for the wall!",
"Don't leave me alone with them!!",
"You run, you die.",
"Jokes on you, I'm everywhere",
"You're gonna regret that...",
"You could also try /kickme, I hear that's fun.",
"Go bother someone else, no-one here cares.",
"You can run, but you can't hide.",
"Is that all you've got?",
"I'm behind you...",
"You've got company!",
"We can do this the easy way, or the hard way.",
"You just don't get it, do you?",
"Yeah, you better run!",
"Please, remind me how much I care?",
"I'd run faster if I were you.",
"That's definitely the droid we're looking for.",
"May the odds be ever in your favour.",
"Famous last words.",
"And they disappeared forever, never to be seen again.",
'"Oh, look at me! I\'m so cool, I can run from a bot!" - this person',
"Yeah yeah, just tap /kickme already.",
"Here, take this ring and head to Mordor while you're at it.",
"Legend has it, they're still running...",
"Unlike Harry Potter, your parents can't protect you from me.",
"Fear leads to anger. Anger leads to hate. Hate leads to suffering. If you keep running in fear, you might "
"be the next Vader.",
"Multiple calculations later, I have decided my interest in your shenanigans is exactly 0.",
"Legend has it, they're still running.",
"Keep it up, not sure we want you here anyway.",
"You're a wiza- Oh. Wait. You're not Harry, keep moving.",
"NO RUNNING IN THE HALLWAYS!",
"Hasta la vista, baby.",
"Who let the dogs out?",
"It's funny, because no one cares.",
"Ah, what a waste. I liked that one.",
"Frankly, my dear, I don't give a damn.",
"My milkshake brings all the boys to yard... So run faster!",
"You can't HANDLE the truth!",
"A long time ago, in a galaxy far far away... Someone would've cared about that. Not anymore though.",
"Hey, look at them! They're running from the inevitable banhammer... Cute.",
"Han shot first. So will I.",
"What are you running after, a white rabbit?",
"As The Doctor would say... RUN!",
)
| [
8634,
2969,
62,
51,
3620,
6489,
29462,
796,
357,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
1391,
7220,
17,
92,
351,
257,
1391,
9186,
92,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
1391,
7220,
17,
92,
287,
262,
1986,
351,
257,
1391,
9186,
92,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
1391,
7220,
17,
92,
1088,
257,
1643,
351,
257,
1391,
9186,
92,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
400,
8516,
92,
257,
1391,
9186,
92,
379,
1391,
7220,
17,
92,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
22378,
257,
1391,
9186,
92,
290,
1391,
400,
8516,
92,
340,
379,
1391,
7220,
17,
92,
6,
82,
1986,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
18617,
257,
1391,
9186,
92,
287,
1391,
7220,
17,
92,
6,
82,
2276,
4571,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
4940,
48966,
1391,
7220,
17,
92,
14397,
351,
257,
1391,
9186,
92,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
20567,
1391,
7220,
17,
92,
866,
290,
7830,
1391,
71,
896,
92,
606,
351,
257,
1391,
9186,
92,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
22378,
510,
257,
1391,
9186,
92,
290,
1391,
71,
896,
92,
1391,
7220,
17,
92,
351,
340,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
8470,
1391,
7220,
17,
92,
284,
257,
5118,
290,
1391,
400,
8516,
92,
257,
1391,
9186,
92,
379,
606,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
2921,
257,
8030,
4574,
284,
1037,
1391,
7220,
17,
92,
2193,
284,
9422,
287,
28856,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
1391,
7220,
17,
92,
351,
257,
15291,
8429,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
973,
45275,
0,
887,
2147,
3022,
9313,
11,
198,
8,
198,
198,
8634,
2969,
62,
50,
37738,
796,
357,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
2405,
351,
257,
1391,
9186,
92,
287,
511,
10802,
40754,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
2405,
287,
262,
1986,
351,
257,
1391,
9186,
92,
986,
644,
281,
22324,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
2405,
1088,
257,
1643,
351,
257,
1391,
9186,
92,
986,
475,
1521,
35379,
198,
220,
220,
220,
45144,
7220,
16,
92,
7127,
511,
1182,
1028,
257,
3355,
986,
329,
617,
1738,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
18617,
2405,
656,
2272,
1231,
257,
9029,
5013,
986,
780,
484,
1807,
612,
373,
11863,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
1391,
71,
896,
92,
2405,
351,
257,
1391,
9186,
92,
706,
2045,
379,
3964,
807,
338,
12454,
13,
1119,
2626,
477,
2911,
286,
9265,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
318,
10416,
13,
1119,
5938,
2405,
287,
511,
10802,
33283,
198,
8,
198,
198,
8634,
2969,
62,
33,
1921,
2149,
796,
357,
198,
220,
220,
220,
45144,
7220,
16,
92,
373,
2809,
1348,
1165,
881,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
3214,
422,
257,
1029,
1295,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
3027,
10533,
287,
257,
3355,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
373,
7425,
416,
14357,
33283,
198,
220,
220,
220,
45144,
7220,
16,
92,
373,
2809,
1348,
416,
257,
7463,
281,
2991,
33283,
198,
8,
198,
198,
2043,
39201,
796,
357,
198,
220,
220,
220,
366,
2701,
6953,
41306,
1600,
198,
220,
220,
220,
366,
11664,
49411,
1600,
198,
220,
220,
220,
366,
8692,
1894,
7365,
1600,
198,
220,
220,
220,
366,
66,
5557,
316,
7365,
1600,
198,
220,
220,
220,
366,
3822,
268,
33009,
1600,
198,
220,
220,
220,
366,
67,
39583,
1600,
198,
220,
220,
220,
366,
1050,
3849,
1600,
198,
220,
220,
220,
366,
1477,
78,
626,
1600,
198,
220,
220,
220,
366,
9419,
51,
5671,
1600,
198,
220,
220,
220,
366,
746,
23154,
28979,
1600,
198,
220,
220,
220,
366,
1462,
1603,
1600,
198,
220,
220,
220,
366,
634,
12907,
286,
6219,
35719,
805,
1600,
198,
220,
220,
220,
366,
660,
5024,
1600,
198,
220,
220,
220,
366,
13261,
5680,
7779,
1600,
198,
220,
220,
220,
366,
2487,
286,
28494,
9154,
1600,
198,
220,
220,
220,
366,
2070,
1600,
198,
220,
220,
220,
366,
75,
45007,
1600,
198,
220,
220,
220,
366,
727,
5581,
1600,
198,
220,
220,
220,
366,
82,
441,
286,
12586,
1600,
198,
220,
220,
220,
366,
3201,
8176,
49411,
1600,
198,
220,
220,
220,
366,
25089,
527,
9015,
1600,
198,
220,
220,
220,
366,
2777,
17951,
7365,
1600,
198,
220,
220,
220,
366,
6495,
24995,
4828,
1600,
198,
220,
220,
220,
366,
23701,
3881,
1600,
198,
220,
220,
220,
366,
9967,
286,
13647,
1600,
198,
220,
220,
220,
366,
1350,
17231,
425,
1600,
198,
220,
220,
220,
366,
12239,
286,
36371,
6174,
1600,
198,
220,
220,
220,
366,
33227,
1600,
198,
220,
220,
220,
366,
1122,
286,
28902,
1600,
198,
8,
198,
198,
4221,
49,
3913,
796,
5855,
400,
8516,
1600,
366,
2704,
654,
1600,
366,
354,
6238,
1600,
366,
71,
6371,
82,
4943,
198,
198,
39,
2043,
796,
5855,
71,
896,
1600,
366,
1929,
4595,
1600,
366,
6649,
1686,
1600,
366,
5796,
4595,
1600,
366,
65,
7465,
4943,
198,
198,
49,
4944,
62,
18601,
20754,
796,
357,
198,
220,
220,
220,
366,
8496,
466,
345,
892,
345,
821,
1016,
35379,
198,
220,
220,
220,
366,
46010,
30,
644,
30,
750,
484,
651,
1497,
35379,
198,
220,
220,
220,
366,
30148,
3019,
30148,
3019,
986,
45412,
30,
644,
30,
11752,
11,
655,
606,
757,
11,
1239,
10155,
33283,
198,
220,
220,
220,
366,
3855,
736,
994,
40754,
198,
220,
220,
220,
366,
3673,
523,
3049,
9313,
11,
198,
220,
220,
220,
366,
8567,
503,
329,
262,
3355,
40754,
198,
220,
220,
220,
366,
3987,
470,
2666,
502,
3436,
351,
606,
3228,
1600,
198,
220,
220,
220,
366,
1639,
1057,
11,
345,
4656,
33283,
198,
220,
220,
220,
366,
41,
3369,
319,
345,
11,
314,
1101,
8347,
1600,
198,
220,
220,
220,
366,
1639,
821,
8066,
13721,
326,
9313,
11,
198,
220,
220,
220,
366,
1639,
714,
635,
1949,
1220,
24585,
1326,
11,
314,
3285,
326,
338,
1257,
33283,
198,
220,
220,
220,
366,
5247,
11393,
2130,
2073,
11,
645,
12,
505,
994,
16609,
33283,
198,
220,
220,
220,
366,
1639,
460,
1057,
11,
475,
345,
460,
470,
7808,
33283,
198,
220,
220,
220,
366,
3792,
326,
477,
345,
1053,
1392,
35379,
198,
220,
220,
220,
366,
40,
1101,
2157,
345,
9313,
11,
198,
220,
220,
220,
366,
1639,
1053,
1392,
1664,
40754,
198,
220,
220,
220,
366,
1135,
460,
466,
428,
262,
2562,
835,
11,
393,
262,
1327,
835,
33283,
198,
220,
220,
220,
366,
1639,
655,
836,
470,
651,
340,
11,
466,
345,
35379,
198,
220,
220,
220,
366,
10995,
11,
345,
1365,
1057,
40754,
198,
220,
220,
220,
366,
5492,
11,
7101,
502,
703,
881,
314,
1337,
35379,
198,
220,
220,
220,
366,
40,
1549,
1057,
5443,
611,
314,
547,
345,
33283,
198,
220,
220,
220,
366,
2504,
338,
4753,
262,
46748,
356,
821,
2045,
329,
33283,
198,
220,
220,
220,
366,
6747,
262,
10402,
307,
1683,
287,
534,
7075,
33283,
198,
220,
220,
220,
366,
37,
10877,
938,
2456,
33283,
198,
220,
220,
220,
366,
1870,
484,
12120,
8097,
11,
1239,
284,
307,
1775,
757,
33283,
198,
220,
220,
220,
705,
1,
5812,
11,
804,
379,
502,
0,
314,
43054,
76,
523,
3608,
11,
314,
460,
1057,
422,
257,
10214,
2474,
532,
428,
1048,
3256,
198,
220,
220,
220,
366,
10995,
10194,
11,
655,
9814,
1220,
24585,
1326,
1541,
33283,
198,
220,
220,
220,
366,
4342,
11,
1011,
428,
5858,
290,
1182,
284,
29548,
273,
981,
345,
821,
379,
340,
33283,
198,
220,
220,
220,
366,
21351,
468,
340,
11,
484,
821,
991,
2491,
9313,
11,
198,
220,
220,
220,
366,
18521,
5850,
14179,
11,
534,
3397,
460,
470,
1805,
345,
422,
502,
33283,
198,
220,
220,
220,
366,
37798,
5983,
284,
8993,
13,
46061,
5983,
284,
5465,
13,
28334,
5983,
284,
7195,
13,
1002,
345,
1394,
2491,
287,
3252,
11,
345,
1244,
366,
198,
220,
220,
220,
366,
1350,
262,
1306,
27403,
33283,
198,
220,
220,
220,
366,
31217,
16765,
1568,
11,
314,
423,
3066,
616,
1393,
287,
534,
48949,
318,
3446,
657,
33283,
198,
220,
220,
220,
366,
21351,
468,
340,
11,
484,
821,
991,
2491,
33283,
198,
220,
220,
220,
366,
15597,
340,
510,
11,
407,
1654,
356,
765,
345,
994,
6949,
33283,
198,
220,
220,
220,
366,
1639,
821,
257,
266,
23638,
12,
3966,
13,
16314,
13,
921,
821,
407,
5850,
11,
1394,
3867,
33283,
198,
220,
220,
220,
366,
15285,
32494,
15871,
3268,
3336,
367,
7036,
42451,
40754,
198,
220,
220,
220,
366,
39,
40197,
8591,
410,
12523,
11,
5156,
33283,
198,
220,
220,
220,
366,
8241,
1309,
262,
6844,
503,
35379,
198,
220,
220,
220,
366,
1026,
338,
8258,
11,
780,
645,
530,
16609,
33283,
198,
220,
220,
220,
366,
10910,
11,
644,
257,
7030,
13,
314,
8288,
326,
530,
33283,
198,
220,
220,
220,
366,
17439,
306,
11,
616,
13674,
11,
314,
836,
470,
1577,
257,
12270,
33283,
198,
220,
220,
220,
366,
3666,
1465,
50133,
539,
6774,
477,
262,
6510,
284,
12699,
986,
1406,
1057,
5443,
40754,
198,
220,
220,
220,
366,
1639,
460,
470,
367,
6981,
2538,
262,
3872,
40754,
198,
220,
220,
220,
366,
32,
890,
640,
2084,
11,
287,
257,
16161,
1290,
1290,
1497,
986,
17877,
561,
1053,
19951,
546,
326,
13,
1892,
7471,
996,
33283,
198,
220,
220,
220,
366,
10814,
11,
804,
379,
606,
0,
1119,
821,
2491,
422,
262,
13203,
3958,
17980,
986,
327,
1133,
33283,
198,
220,
220,
220,
366,
29919,
2823,
717,
13,
1406,
481,
314,
33283,
198,
220,
220,
220,
366,
2061,
389,
345,
2491,
706,
11,
257,
2330,
22746,
35379,
198,
220,
220,
220,
366,
1722,
383,
9356,
561,
910,
986,
32494,
40754,
198,
8,
198
] | 2.760024 | 1,671 |
import os
import argparse
from flask import request
from flask_api import FlaskAPI, status, exceptions
from werkzeug.utils import secure_filename
import io
import numpy as np
from PIL import Image
import cv2
from datetime import datetime
import re
import math
import apriltag
from flask_cors import CORS
from logzero import logger
import boto3
DB_CLUSTER = "database320"
DB_NAME = "db320"
ARN = "arn:aws:rds:us-east-2:007372221023:cluster:database320"
SECRET_ARN = "arn:aws:secretsmanager:us-east-2:007372221023:secret:rds-db-credentials/cluster-BZEL6PSDLGVBVJB6BIDZGZQ4MI/admin320-fsoCse"
REGION_NAME = "us-east-2"
IMG_FORMAT = ".jpg" # changing this is not handled very gracefully at the moment, probably
UPLOAD_FOLDER = "/temp/uploads"
ALLOWED_EXTENSIONS = {"png", "jpg", "jpeg"}
def ret(error_message=None, **kwargs):
"""
Make return JSON object
:param error_message: sets "error" field to given message string
:param kwargs: fields to set on the return JSON
"""
r = {}
if error_message is not None:
r["error"] = error_message
r.update(kwargs)
return r
# Params: l1 and l2 are color image matrices
# Returns: 1 if aligned, 0 otherwise, -1 on error
def get_matching_s3_objects(
s3, bucket, prefix="", suffix="", max_keys_per_request=100,
):
"""
List objects in an S3 bucket.
:param s3: boto.client("s3") client
:param bucket: Name of the S3 bucket.
:param prefix: Only fetch objects whose key starts with
this prefix (optional).
:param suffix: Only fetch objects whose keys end with
this suffix (optional).
:param max_keys_per_request: number of objects to list down
"""
kwargs = {"Bucket": bucket}
# If the prefix is a single string (not a tuple of strings), we can
# do the filtering directly in the S3 API.
if isinstance(prefix, str):
kwargs["Prefix"] = prefix
else:
kwargs["Prefix"] = str(prefix)
kwargs["MaxKeys"] = max_keys_per_request
while True:
# The S3 API response is a large blob of metadata.
# 'Contents' contains information about the listed objects.
resp = s3.list_objects_v2(**kwargs)
try:
contents = resp["Contents"]
except KeyError:
return
for obj in contents:
key = obj["Key"]
if key.startswith(prefix) and key.endswith(suffix):
yield obj
# The S3 API is paginated, returning up to 1000 keys at a time.
# Pass the continuation token into the next response, until we
# reach the final page (when this field is missing).
try:
kwargs["ContinuationToken"] = resp["NextContinuationToken"]
except KeyError:
break
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--port", action="store", default="8000")
args = parser.parse_args()
port = int(args.port)
app = create_app()
app.run(host="0.0.0.0", port=port)
| [
11748,
28686,
198,
11748,
1822,
29572,
198,
6738,
42903,
1330,
2581,
198,
6738,
42903,
62,
15042,
1330,
46947,
17614,
11,
3722,
11,
13269,
198,
6738,
266,
9587,
2736,
1018,
13,
26791,
1330,
5713,
62,
34345,
198,
11748,
33245,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
269,
85,
17,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
302,
198,
11748,
10688,
198,
11748,
46593,
2326,
363,
198,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
6738,
2604,
22570,
1330,
49706,
198,
11748,
275,
2069,
18,
198,
198,
11012,
62,
5097,
7759,
1137,
796,
366,
48806,
19504,
1,
198,
11012,
62,
20608,
796,
366,
9945,
19504,
1,
198,
1503,
45,
796,
366,
1501,
25,
8356,
25,
4372,
82,
25,
385,
12,
23316,
12,
17,
25,
25816,
2718,
1828,
21536,
1954,
25,
565,
5819,
25,
48806,
19504,
1,
198,
23683,
26087,
62,
1503,
45,
796,
366,
1501,
25,
8356,
25,
2363,
8004,
37153,
25,
385,
12,
23316,
12,
17,
25,
25816,
2718,
1828,
21536,
1954,
25,
21078,
25,
4372,
82,
12,
9945,
12,
66,
445,
14817,
14,
565,
5819,
12,
33,
57,
3698,
21,
3705,
19260,
37094,
33,
53,
47858,
21,
33,
2389,
57,
38,
57,
48,
19,
8895,
14,
28482,
19504,
12,
69,
568,
34,
325,
1,
198,
31553,
2849,
62,
20608,
796,
366,
385,
12,
23316,
12,
17,
1,
198,
3955,
38,
62,
21389,
1404,
796,
27071,
9479,
1,
220,
1303,
5609,
428,
318,
407,
12118,
845,
11542,
2759,
379,
262,
2589,
11,
2192,
198,
198,
52,
6489,
41048,
62,
37,
3535,
14418,
796,
12813,
29510,
14,
39920,
1,
198,
7036,
3913,
1961,
62,
13918,
16938,
11053,
796,
19779,
11134,
1600,
366,
9479,
1600,
366,
73,
22071,
20662,
628,
628,
198,
4299,
1005,
7,
18224,
62,
20500,
28,
14202,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6889,
1441,
19449,
2134,
628,
220,
220,
220,
1058,
17143,
4049,
62,
20500,
25,
5621,
366,
18224,
1,
2214,
284,
1813,
3275,
4731,
198,
220,
220,
220,
1058,
17143,
479,
86,
22046,
25,
7032,
284,
900,
319,
262,
1441,
19449,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
374,
796,
23884,
198,
220,
220,
220,
611,
4049,
62,
20500,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
14692,
18224,
8973,
796,
4049,
62,
20500,
198,
220,
220,
220,
374,
13,
19119,
7,
46265,
22046,
8,
198,
220,
220,
220,
1441,
374,
628,
628,
628,
198,
2,
2547,
4105,
25,
300,
16,
290,
300,
17,
389,
3124,
2939,
2603,
45977,
198,
2,
16409,
25,
352,
611,
19874,
11,
657,
4306,
11,
532,
16,
319,
4049,
628,
198,
4299,
651,
62,
15699,
278,
62,
82,
18,
62,
48205,
7,
198,
220,
220,
220,
264,
18,
11,
19236,
11,
21231,
2625,
1600,
35488,
2625,
1600,
3509,
62,
13083,
62,
525,
62,
25927,
28,
3064,
11,
198,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7343,
5563,
287,
281,
311,
18,
19236,
13,
198,
220,
220,
220,
1058,
17143,
264,
18,
25,
275,
2069,
13,
16366,
7203,
82,
18,
4943,
5456,
198,
220,
220,
220,
1058,
17143,
19236,
25,
6530,
286,
262,
311,
18,
19236,
13,
198,
220,
220,
220,
1058,
17143,
21231,
25,
5514,
21207,
5563,
3025,
1994,
4940,
351,
198,
220,
220,
220,
220,
220,
220,
220,
428,
21231,
357,
25968,
737,
198,
220,
220,
220,
1058,
17143,
35488,
25,
5514,
21207,
5563,
3025,
8251,
886,
351,
198,
220,
220,
220,
220,
220,
220,
220,
428,
35488,
357,
25968,
737,
198,
220,
220,
220,
1058,
17143,
3509,
62,
13083,
62,
525,
62,
25927,
25,
1271,
286,
5563,
284,
1351,
866,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
479,
86,
22046,
796,
19779,
33,
38811,
1298,
19236,
92,
628,
220,
220,
220,
1303,
1002,
262,
21231,
318,
257,
2060,
4731,
357,
1662,
257,
46545,
286,
13042,
828,
356,
460,
198,
220,
220,
220,
1303,
466,
262,
25431,
3264,
287,
262,
311,
18,
7824,
13,
198,
220,
220,
220,
611,
318,
39098,
7,
40290,
11,
965,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
14692,
36698,
844,
8973,
796,
21231,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
14692,
36698,
844,
8973,
796,
965,
7,
40290,
8,
628,
220,
220,
220,
479,
86,
22046,
14692,
11518,
40729,
8973,
796,
3509,
62,
13083,
62,
525,
62,
25927,
628,
220,
220,
220,
981,
6407,
25,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
311,
18,
7824,
2882,
318,
257,
1588,
44812,
286,
20150,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
705,
15842,
6,
4909,
1321,
546,
262,
5610,
5563,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1217,
796,
264,
18,
13,
4868,
62,
48205,
62,
85,
17,
7,
1174,
46265,
22046,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10154,
796,
1217,
14692,
15842,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
7383,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
628,
220,
220,
220,
220,
220,
220,
220,
329,
26181,
287,
10154,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
796,
26181,
14692,
9218,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
13,
9688,
2032,
342,
7,
40290,
8,
290,
1994,
13,
437,
2032,
342,
7,
37333,
844,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7800,
26181,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
311,
18,
7824,
318,
42208,
3898,
11,
8024,
510,
284,
8576,
8251,
379,
257,
640,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6251,
262,
24659,
11241,
656,
262,
1306,
2882,
11,
1566,
356,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3151,
262,
2457,
2443,
357,
12518,
428,
2214,
318,
4814,
737,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
14692,
17875,
2288,
30642,
8973,
796,
1217,
14692,
10019,
17875,
2288,
30642,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
7383,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
79,
1600,
366,
438,
634,
1600,
2223,
2625,
8095,
1600,
4277,
2625,
33942,
4943,
628,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
220,
220,
220,
2493,
796,
493,
7,
22046,
13,
634,
8,
198,
220,
220,
220,
598,
796,
2251,
62,
1324,
3419,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
2625,
15,
13,
15,
13,
15,
13,
15,
1600,
2493,
28,
634,
8,
198
] | 2.573492 | 1,177 |
import threading
import time
import logging
import math
class Cart:
""" need to implement the move method with threading
so that it won't interfere with other functions """
# the original implmentation, with the bug.
# get all the passengers who want to go the "direction"
if __name__ == '__main__':
stop_threads = False
planner = Planner(5, 1)
""" while True:
try:
lvl_from = int(input())
lvl_to = int(input())
except:
planner.stopAll()
break
Person(lvl_from, lvl_to, planner) """
time.sleep(1)
Person(3, 4, planner)
time.sleep(1)
Person(2, 0, planner)
| [
11748,
4704,
278,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
10688,
628,
198,
4871,
13690,
25,
198,
220,
220,
220,
37227,
761,
284,
3494,
262,
1445,
2446,
351,
4704,
278,
198,
220,
220,
220,
523,
326,
340,
1839,
470,
18135,
351,
584,
5499,
37227,
628,
198,
220,
220,
220,
1303,
262,
2656,
4114,
14374,
11,
351,
262,
5434,
13,
628,
198,
220,
220,
220,
1303,
651,
477,
262,
10405,
508,
765,
284,
467,
262,
366,
37295,
1,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2245,
62,
16663,
82,
796,
10352,
198,
220,
220,
220,
42351,
796,
5224,
1008,
7,
20,
11,
352,
8,
198,
220,
220,
220,
37227,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33309,
62,
6738,
796,
493,
7,
15414,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33309,
62,
1462,
796,
493,
7,
15414,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42351,
13,
11338,
3237,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
7755,
7,
47147,
62,
6738,
11,
33309,
62,
1462,
11,
42351,
8,
37227,
198,
220,
220,
220,
640,
13,
42832,
7,
16,
8,
198,
220,
220,
220,
7755,
7,
18,
11,
604,
11,
42351,
8,
198,
220,
220,
220,
640,
13,
42832,
7,
16,
8,
198,
220,
220,
220,
7755,
7,
17,
11,
657,
11,
42351,
8,
198
] | 2.442446 | 278 |
#!/bin/python3
"""This is a very simple/terrible port scanner for educational purpose"""
import sys
import socket
from datetime import datetime
if len(sys.argv) == 2:
target = socket.gethostbyname(sys.argv[1]) # translate hostname
else:
print("Invalid amount of arguments.")
print("Syntax: python3 pyport.py <ip>")
print("-" * 50)
print("Scanning target "+ target)
print("Time started: " + str(datetime.now()))
print("-" * 50)
try:
for port in range(50, 85):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.setdefaulttimeout(1)
result = s.connect_ex((target,port)) # returns error indicator
if result == 0:
print("Port {} is open".format(port))
s.close()
except KeyboardInterrupt:
print("\nExiting program.")
sys.exit()
except socket.gaierror:
print("Hostname could not be resolved.")
sys.exit()
except socket.error:
print("Could not connect to server.")
sys.exit()
# command:
# python3 scanner.py <ip> | [
2,
48443,
8800,
14,
29412,
18,
198,
37811,
1212,
318,
257,
845,
2829,
14,
353,
5547,
2493,
27474,
329,
9856,
4007,
37811,
198,
198,
11748,
25064,
198,
11748,
17802,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
6624,
362,
25,
198,
220,
220,
220,
2496,
796,
17802,
13,
1136,
4774,
1525,
3672,
7,
17597,
13,
853,
85,
58,
16,
12962,
1303,
15772,
2583,
3672,
198,
17772,
25,
198,
220,
220,
220,
3601,
7203,
44651,
2033,
286,
7159,
19570,
198,
220,
220,
220,
3601,
7203,
13940,
41641,
25,
21015,
18,
12972,
634,
13,
9078,
1279,
541,
29,
4943,
198,
4798,
7203,
21215,
1635,
2026,
8,
198,
4798,
7203,
33351,
768,
2496,
43825,
2496,
8,
198,
4798,
7203,
7575,
2067,
25,
366,
1343,
965,
7,
19608,
8079,
13,
2197,
3419,
4008,
198,
4798,
7203,
21215,
1635,
2026,
8,
198,
28311,
25,
198,
220,
220,
220,
329,
2493,
287,
2837,
7,
1120,
11,
7600,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
264,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
220,
220,
220,
220,
220,
220,
220,
17802,
13,
2617,
12286,
48678,
7,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
264,
13,
8443,
62,
1069,
19510,
16793,
11,
634,
4008,
1303,
5860,
4049,
16916,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1255,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
13924,
23884,
318,
1280,
1911,
18982,
7,
634,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
264,
13,
19836,
3419,
198,
16341,
31973,
9492,
3622,
25,
198,
220,
220,
220,
3601,
7203,
59,
77,
3109,
1780,
1430,
19570,
198,
220,
220,
220,
25064,
13,
37023,
3419,
198,
16341,
17802,
13,
4908,
959,
1472,
25,
198,
220,
220,
220,
3601,
7203,
17932,
3672,
714,
407,
307,
12939,
19570,
198,
220,
220,
220,
25064,
13,
37023,
3419,
198,
16341,
17802,
13,
18224,
25,
198,
220,
220,
220,
3601,
7203,
23722,
407,
2018,
284,
4382,
19570,
198,
220,
220,
220,
25064,
13,
37023,
3419,
198,
2,
3141,
25,
198,
2,
21015,
18,
27474,
13,
9078,
1279,
541,
29
] | 2.700535 | 374 |
"""
Author: Wenru Dong
"""
from typing import Optional
if __name__ == "__main__":
bitmap = Bitmap(10)
bitmap.setbit(1)
bitmap.setbit(3)
bitmap.setbit(6)
bitmap.setbit(7)
bitmap.setbit(8)
for i in range(1, 11):
print(bitmap.getbit(i)) | [
37811,
198,
220,
220,
220,
6434,
25,
31164,
622,
28831,
198,
37811,
198,
198,
6738,
19720,
1330,
32233,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1643,
8899,
796,
4722,
8899,
7,
940,
8,
198,
220,
220,
220,
1643,
8899,
13,
2617,
2545,
7,
16,
8,
198,
220,
220,
220,
1643,
8899,
13,
2617,
2545,
7,
18,
8,
198,
220,
220,
220,
1643,
8899,
13,
2617,
2545,
7,
21,
8,
198,
220,
220,
220,
1643,
8899,
13,
2617,
2545,
7,
22,
8,
198,
220,
220,
220,
1643,
8899,
13,
2617,
2545,
7,
23,
8,
628,
220,
220,
220,
329,
1312,
287,
2837,
7,
16,
11,
1367,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
2545,
8899,
13,
1136,
2545,
7,
72,
4008
] | 2.082707 | 133 |
a = [[['Inform', 'Train', 'Choice', 'over 1'], ['Inform', 'Train', 'Choice', '000'], ['Request', 'Train', 'Depart', '?']],
[['Inform', 'Train', 'Depart', 'birmingham new street']],
[['Request', 'Train', 'Day', '?']],
[['Inform', 'Train', 'Day', 'wednesday']],
[['Inform', 'Train', 'Arrive', '20:23'], ['Inform', 'Train', 'Day', 'Wednesday'], ['Inform', 'Train', 'Depart', 'birmingham new street'], ['Inform', 'Train', 'Leave', '17:40']],
[['Inform', 'Train', 'People', '5']],
[['OfferBooked', 'Train', 'Ref', 'A9NHSO9Y']],
[['Inform', 'Hotel', 'Internet', 'yes'], ['Inform', 'Hotel', 'Stars', '4']],
[['Recommend', 'Hotel', 'Name', 'the cambridge belfry']],
[['Inform', 'Hotel', 'Day', 'wednesday'], ['Inform', 'Hotel', 'People', '5'], ['Inform', 'Hotel', 'Stay', '5']],
[['Book', 'Booking', 'Ref', '5NAWGJDC']],
[['thank', 'general', 'none', 'none']],
[['bye', 'general', 'none', 'none']]]
print(a)
for i in range(len(a)):
print()
for j in range(len(a[i])):
one = a[i][j]
left = "_".join(one[:-1])
right = one[-1]
whole = ": ".join([left, right])
print(whole) | [
198,
64,
796,
16410,
17816,
818,
687,
3256,
705,
44077,
3256,
705,
46770,
3256,
705,
2502,
352,
6,
4357,
37250,
818,
687,
3256,
705,
44077,
3256,
705,
46770,
3256,
705,
830,
6,
4357,
37250,
18453,
3256,
705,
44077,
3256,
705,
12156,
433,
3256,
705,
8348,
60,
4357,
198,
58,
17816,
818,
687,
3256,
705,
44077,
3256,
705,
12156,
433,
3256,
705,
65,
343,
17737,
649,
4675,
20520,
4357,
198,
58,
17816,
18453,
3256,
705,
44077,
3256,
705,
12393,
3256,
705,
8348,
60,
4357,
198,
58,
17816,
818,
687,
3256,
705,
44077,
3256,
705,
12393,
3256,
705,
19103,
3462,
20520,
4357,
198,
58,
17816,
818,
687,
3256,
705,
44077,
3256,
705,
3163,
11590,
3256,
705,
1238,
25,
1954,
6,
4357,
37250,
818,
687,
3256,
705,
44077,
3256,
705,
12393,
3256,
705,
27150,
6,
4357,
37250,
818,
687,
3256,
705,
44077,
3256,
705,
12156,
433,
3256,
705,
65,
343,
17737,
649,
4675,
6,
4357,
37250,
818,
687,
3256,
705,
44077,
3256,
705,
35087,
3256,
705,
1558,
25,
1821,
20520,
4357,
198,
58,
17816,
818,
687,
3256,
705,
44077,
3256,
705,
8061,
3256,
705,
20,
20520,
4357,
198,
58,
17816,
9362,
263,
10482,
276,
3256,
705,
44077,
3256,
705,
8134,
3256,
705,
32,
24,
45,
7998,
46,
24,
56,
20520,
4357,
198,
58,
17816,
818,
687,
3256,
705,
21352,
417,
3256,
705,
28566,
3256,
705,
8505,
6,
4357,
37250,
818,
687,
3256,
705,
21352,
417,
3256,
705,
29366,
3256,
705,
19,
20520,
4357,
198,
58,
17816,
41248,
3256,
705,
21352,
417,
3256,
705,
5376,
3256,
705,
1169,
12172,
9458,
894,
69,
563,
20520,
4357,
198,
58,
17816,
818,
687,
3256,
705,
21352,
417,
3256,
705,
12393,
3256,
705,
19103,
3462,
6,
4357,
37250,
818,
687,
3256,
705,
21352,
417,
3256,
705,
8061,
3256,
705,
20,
6,
4357,
37250,
818,
687,
3256,
705,
21352,
417,
3256,
705,
25681,
3256,
705,
20,
20520,
4357,
198,
58,
17816,
10482,
3256,
705,
10482,
278,
3256,
705,
8134,
3256,
705,
20,
4535,
54,
38,
41,
9697,
20520,
4357,
198,
58,
17816,
40716,
3256,
705,
24622,
3256,
705,
23108,
3256,
705,
23108,
20520,
4357,
198,
58,
17816,
16390,
3256,
705,
24622,
3256,
705,
23108,
3256,
705,
23108,
6,
11907,
60,
198,
198,
4798,
7,
64,
8,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
64,
8,
2599,
198,
220,
220,
220,
3601,
3419,
198,
220,
220,
220,
329,
474,
287,
2837,
7,
11925,
7,
64,
58,
72,
12962,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
530,
796,
257,
58,
72,
7131,
73,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1364,
796,
45434,
1911,
22179,
7,
505,
58,
21912,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
826,
796,
530,
58,
12,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2187,
796,
366,
25,
27071,
22179,
26933,
9464,
11,
826,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
1929,
2305,
8
] | 2.302905 | 482 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
"""A job that write Entries into Datastore.
The pipelines behave in the steps below.
1. Create and write Entities to Datastore
2. (Optional) If read limit was provided,
read it and confirm that the expected Entities were read.
3. Query the written Entities and verify result.
4. Delete Entries.
5. Query the written Entities, verify no results.
"""
from __future__ import absolute_import
import argparse
import hashlib
import logging
import uuid
import apache_beam as beam
from apache_beam.io.gcp.datastore.v1.datastoreio import DeleteFromDatastore
from apache_beam.io.gcp.datastore.v1.datastoreio import ReadFromDatastore
from apache_beam.io.gcp.datastore.v1.datastoreio import WriteToDatastore
from apache_beam.options.pipeline_options import GoogleCloudOptions
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOptions
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import assert_that
from apache_beam.testing.util import equal_to
# Protect against environments where apitools library is not available.
# pylint: disable=wrong-import-order, wrong-import-position
try:
from google.cloud.proto.datastore.v1 import entity_pb2
from google.cloud.proto.datastore.v1 import query_pb2
from googledatastore import helper as datastore_helper
from googledatastore import PropertyFilter
except ImportError:
pass
# pylint: enable=wrong-import-order, wrong-import-position
# pylint: enable=ungrouped-imports
def new_pipeline_with_job_name(pipeline_options, job_name, suffix):
"""Create a pipeline with the given job_name and a suffix."""
gcp_options = pipeline_options.view_as(GoogleCloudOptions)
# DirectRunner doesn't have a job name.
if job_name:
gcp_options.job_name = job_name + suffix
return TestPipeline(options=pipeline_options)
class EntityWrapper(object):
"""Create a Cloud Datastore entity from the given string."""
def make_entity(self, content):
"""Create entity from given string."""
entity = entity_pb2.Entity()
if self._namespace is not None:
entity.key.partition_id.namespace_id = self._namespace
# All entities created will have the same ancestor
datastore_helper.add_key_path(entity.key, self._kind, self._ancestor,
self._kind, hashlib.sha1(content).hexdigest())
datastore_helper.add_properties(entity, {'content': str(content)})
return entity
def make_ancestor_query(kind, namespace, ancestor):
"""Creates a Cloud Datastore ancestor query."""
ancestor_key = entity_pb2.Key()
datastore_helper.add_key_path(ancestor_key, kind, ancestor)
if namespace is not None:
ancestor_key.partition_id.namespace_id = namespace
query = query_pb2.Query()
query.kind.add().name = kind
datastore_helper.set_property_filter(
query.filter, '__key__', PropertyFilter.HAS_ANCESTOR, ancestor_key)
return query
def run(argv=None):
"""Main entry point."""
parser = argparse.ArgumentParser()
parser.add_argument('--kind',
dest='kind',
default='writereadtest',
help='Datastore Kind')
parser.add_argument('--num_entities',
dest='num_entities',
type=int,
required=True,
help='Number of entities to write')
parser.add_argument('--limit',
dest='limit',
type=int,
help='Limit of number of entities to write')
known_args, pipeline_args = parser.parse_known_args(argv)
pipeline_options = PipelineOptions(pipeline_args)
pipeline_options.view_as(SetupOptions).save_main_session = True
gcloud_options = pipeline_options.view_as(GoogleCloudOptions)
job_name = gcloud_options.job_name
kind = known_args.kind
num_entities = known_args.num_entities
project = gcloud_options.project
# a random ancesor key
ancestor = str(uuid.uuid4())
query = make_ancestor_query(kind, None, ancestor)
# Pipeline 1: Create and write the specified number of Entities to the
# Cloud Datastore.
logging.info('Writing %s entities to %s', num_entities, project)
p = new_pipeline_with_job_name(pipeline_options, job_name, '-write')
# pylint: disable=expression-not-assigned
(p
| 'Input' >> beam.Create(list(range(known_args.num_entities)))
| 'To String' >> beam.Map(str)
| 'To Entity' >> beam.Map(EntityWrapper(kind, None, ancestor).make_entity)
| 'Write to Datastore' >> WriteToDatastore(project))
p.run()
# Optional Pipeline 2: If a read limit was provided, read it and confirm
# that the expected entities were read.
if known_args.limit is not None:
logging.info('Querying a limited set of %s entities and verifying count.',
known_args.limit)
p = new_pipeline_with_job_name(pipeline_options, job_name, '-verify-limit')
query_with_limit = query_pb2.Query()
query_with_limit.CopyFrom(query)
query_with_limit.limit.value = known_args.limit
entities = p | 'read from datastore' >> ReadFromDatastore(project,
query_with_limit)
assert_that(
entities | beam.combiners.Count.Globally(),
equal_to([known_args.limit]))
p.run()
# Pipeline 3: Query the written Entities and verify result.
logging.info('Querying entities, asserting they match.')
p = new_pipeline_with_job_name(pipeline_options, job_name, '-verify')
entities = p | 'read from datastore' >> ReadFromDatastore(project, query)
assert_that(
entities | beam.combiners.Count.Globally(),
equal_to([num_entities]))
p.run()
# Pipeline 4: Delete Entities.
logging.info('Deleting entities.')
p = new_pipeline_with_job_name(pipeline_options, job_name, '-delete')
entities = p | 'read from datastore' >> ReadFromDatastore(project, query)
# pylint: disable=expression-not-assigned
(entities
| 'To Keys' >> beam.Map(lambda entity: entity.key)
| 'Delete keys' >> DeleteFromDatastore(project))
p.run()
# Pipeline 5: Query the written Entities, verify no results.
logging.info('Querying for the entities to make sure there are none present.')
p = new_pipeline_with_job_name(pipeline_options, job_name, '-verify-deleted')
entities = p | 'read from datastore' >> ReadFromDatastore(project, query)
assert_that(
entities | beam.combiners.Count.Globally(),
equal_to([0]))
p.run()
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
run()
| [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
670,
329,
3224,
1321,
5115,
6634,
9238,
13,
198,
2,
383,
7054,
37,
16625,
428,
2393,
284,
921,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
198,
2,
262,
13789,
13,
220,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
2,
198,
198,
37811,
32,
1693,
326,
3551,
7232,
1678,
656,
16092,
459,
382,
13,
198,
198,
464,
31108,
17438,
287,
262,
4831,
2174,
13,
628,
220,
352,
13,
13610,
290,
3551,
7232,
871,
284,
16092,
459,
382,
198,
220,
362,
13,
357,
30719,
8,
1002,
1100,
4179,
373,
2810,
11,
198,
220,
220,
220,
220,
1100,
340,
290,
6216,
326,
262,
2938,
7232,
871,
547,
1100,
13,
198,
220,
513,
13,
43301,
262,
3194,
7232,
871,
290,
11767,
1255,
13,
198,
220,
604,
13,
23520,
7232,
1678,
13,
198,
220,
642,
13,
43301,
262,
3194,
7232,
871,
11,
11767,
645,
2482,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
1822,
29572,
198,
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
334,
27112,
198,
198,
11748,
2471,
4891,
62,
40045,
355,
15584,
198,
6738,
2471,
4891,
62,
40045,
13,
952,
13,
70,
13155,
13,
19608,
459,
382,
13,
85,
16,
13,
19608,
459,
382,
952,
1330,
23520,
4863,
27354,
459,
382,
198,
6738,
2471,
4891,
62,
40045,
13,
952,
13,
70,
13155,
13,
19608,
459,
382,
13,
85,
16,
13,
19608,
459,
382,
952,
1330,
4149,
4863,
27354,
459,
382,
198,
6738,
2471,
4891,
62,
40045,
13,
952,
13,
70,
13155,
13,
19608,
459,
382,
13,
85,
16,
13,
19608,
459,
382,
952,
1330,
19430,
2514,
27354,
459,
382,
198,
6738,
2471,
4891,
62,
40045,
13,
25811,
13,
79,
541,
4470,
62,
25811,
1330,
3012,
18839,
29046,
198,
6738,
2471,
4891,
62,
40045,
13,
25811,
13,
79,
541,
4470,
62,
25811,
1330,
37709,
29046,
198,
6738,
2471,
4891,
62,
40045,
13,
25811,
13,
79,
541,
4470,
62,
25811,
1330,
31122,
29046,
198,
6738,
2471,
4891,
62,
40045,
13,
33407,
13,
9288,
62,
79,
541,
4470,
1330,
6208,
47,
541,
4470,
198,
6738,
2471,
4891,
62,
40045,
13,
33407,
13,
22602,
1330,
6818,
62,
5562,
198,
6738,
2471,
4891,
62,
40045,
13,
33407,
13,
22602,
1330,
4961,
62,
1462,
198,
198,
2,
21916,
1028,
12493,
810,
2471,
270,
10141,
5888,
318,
407,
1695,
13,
198,
2,
279,
2645,
600,
25,
15560,
28,
36460,
12,
11748,
12,
2875,
11,
2642,
12,
11748,
12,
9150,
198,
28311,
25,
198,
220,
422,
23645,
13,
17721,
13,
1676,
1462,
13,
19608,
459,
382,
13,
85,
16,
1330,
9312,
62,
40842,
17,
198,
220,
422,
23645,
13,
17721,
13,
1676,
1462,
13,
19608,
459,
382,
13,
85,
16,
1330,
12405,
62,
40842,
17,
198,
220,
422,
467,
519,
992,
265,
459,
382,
1330,
31904,
355,
4818,
459,
382,
62,
2978,
525,
198,
220,
422,
467,
519,
992,
265,
459,
382,
1330,
14161,
22417,
198,
16341,
17267,
12331,
25,
198,
220,
1208,
198,
2,
279,
2645,
600,
25,
7139,
28,
36460,
12,
11748,
12,
2875,
11,
2642,
12,
11748,
12,
9150,
198,
2,
279,
2645,
600,
25,
7139,
28,
2150,
3233,
276,
12,
320,
3742,
628,
198,
4299,
649,
62,
79,
541,
4470,
62,
4480,
62,
21858,
62,
3672,
7,
79,
541,
4470,
62,
25811,
11,
1693,
62,
3672,
11,
35488,
2599,
198,
220,
37227,
16447,
257,
11523,
351,
262,
1813,
1693,
62,
3672,
290,
257,
35488,
526,
15931,
198,
220,
308,
13155,
62,
25811,
796,
11523,
62,
25811,
13,
1177,
62,
292,
7,
11708,
18839,
29046,
8,
198,
220,
1303,
4128,
49493,
1595,
470,
423,
257,
1693,
1438,
13,
198,
220,
611,
1693,
62,
3672,
25,
198,
220,
220,
220,
308,
13155,
62,
25811,
13,
21858,
62,
3672,
796,
1693,
62,
3672,
1343,
35488,
628,
220,
1441,
6208,
47,
541,
4470,
7,
25811,
28,
79,
541,
4470,
62,
25811,
8,
628,
198,
4871,
20885,
36918,
2848,
7,
15252,
2599,
198,
220,
37227,
16447,
257,
10130,
16092,
459,
382,
9312,
422,
262,
1813,
4731,
526,
15931,
628,
220,
825,
787,
62,
26858,
7,
944,
11,
2695,
2599,
198,
220,
220,
220,
37227,
16447,
9312,
422,
1813,
4731,
526,
15931,
198,
220,
220,
220,
9312,
796,
9312,
62,
40842,
17,
13,
32398,
3419,
198,
220,
220,
220,
611,
2116,
13557,
14933,
10223,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
9312,
13,
2539,
13,
3911,
653,
62,
312,
13,
14933,
10223,
62,
312,
796,
2116,
13557,
14933,
10223,
628,
220,
220,
220,
1303,
1439,
12066,
2727,
481,
423,
262,
976,
31836,
198,
220,
220,
220,
4818,
459,
382,
62,
2978,
525,
13,
2860,
62,
2539,
62,
6978,
7,
26858,
13,
2539,
11,
2116,
13557,
11031,
11,
2116,
13557,
1192,
395,
273,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
11031,
11,
12234,
8019,
13,
26270,
16,
7,
11299,
737,
33095,
12894,
395,
28955,
628,
220,
220,
220,
4818,
459,
382,
62,
2978,
525,
13,
2860,
62,
48310,
7,
26858,
11,
1391,
6,
11299,
10354,
965,
7,
11299,
8,
30072,
198,
220,
220,
220,
1441,
9312,
628,
198,
4299,
787,
62,
1192,
395,
273,
62,
22766,
7,
11031,
11,
25745,
11,
31836,
2599,
198,
220,
37227,
16719,
274,
257,
10130,
16092,
459,
382,
31836,
12405,
526,
15931,
198,
220,
31836,
62,
2539,
796,
9312,
62,
40842,
17,
13,
9218,
3419,
198,
220,
4818,
459,
382,
62,
2978,
525,
13,
2860,
62,
2539,
62,
6978,
7,
1192,
395,
273,
62,
2539,
11,
1611,
11,
31836,
8,
198,
220,
611,
25745,
318,
407,
6045,
25,
198,
220,
220,
220,
31836,
62,
2539,
13,
3911,
653,
62,
312,
13,
14933,
10223,
62,
312,
796,
25745,
628,
220,
12405,
796,
12405,
62,
40842,
17,
13,
20746,
3419,
198,
220,
12405,
13,
11031,
13,
2860,
22446,
3672,
796,
1611,
628,
220,
4818,
459,
382,
62,
2978,
525,
13,
2617,
62,
26745,
62,
24455,
7,
198,
220,
220,
220,
220,
220,
12405,
13,
24455,
11,
705,
834,
2539,
834,
3256,
14161,
22417,
13,
39,
1921,
62,
20940,
6465,
1581,
11,
31836,
62,
2539,
8,
628,
220,
1441,
12405,
628,
198,
4299,
1057,
7,
853,
85,
28,
14202,
2599,
198,
220,
37227,
13383,
5726,
966,
526,
15931,
628,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
628,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
11031,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2244,
11639,
11031,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
8933,
567,
324,
9288,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
27354,
459,
382,
14927,
11537,
198,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
22510,
62,
298,
871,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2244,
11639,
22510,
62,
298,
871,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
15057,
286,
12066,
284,
3551,
11537,
198,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
32374,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2244,
11639,
32374,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
39184,
286,
1271,
286,
12066,
284,
3551,
11537,
628,
220,
1900,
62,
22046,
11,
11523,
62,
22046,
796,
30751,
13,
29572,
62,
4002,
62,
22046,
7,
853,
85,
8,
198,
220,
11523,
62,
25811,
796,
37709,
29046,
7,
79,
541,
4470,
62,
22046,
8,
198,
220,
11523,
62,
25811,
13,
1177,
62,
292,
7,
40786,
29046,
737,
21928,
62,
12417,
62,
29891,
796,
6407,
198,
220,
308,
17721,
62,
25811,
796,
11523,
62,
25811,
13,
1177,
62,
292,
7,
11708,
18839,
29046,
8,
198,
220,
1693,
62,
3672,
796,
308,
17721,
62,
25811,
13,
21858,
62,
3672,
198,
220,
1611,
796,
1900,
62,
22046,
13,
11031,
198,
220,
997,
62,
298,
871,
796,
1900,
62,
22046,
13,
22510,
62,
298,
871,
198,
220,
1628,
796,
308,
17721,
62,
25811,
13,
16302,
198,
220,
1303,
257,
4738,
281,
728,
273,
1994,
198,
220,
31836,
796,
965,
7,
12303,
312,
13,
12303,
312,
19,
28955,
198,
220,
12405,
796,
787,
62,
1192,
395,
273,
62,
22766,
7,
11031,
11,
6045,
11,
31836,
8,
628,
220,
1303,
37709,
352,
25,
13610,
290,
3551,
262,
7368,
1271,
286,
7232,
871,
284,
262,
198,
220,
1303,
10130,
16092,
459,
382,
13,
198,
220,
18931,
13,
10951,
10786,
33874,
4064,
82,
12066,
284,
4064,
82,
3256,
997,
62,
298,
871,
11,
1628,
8,
198,
220,
279,
796,
649,
62,
79,
541,
4470,
62,
4480,
62,
21858,
62,
3672,
7,
79,
541,
4470,
62,
25811,
11,
1693,
62,
3672,
11,
705,
12,
13564,
11537,
628,
220,
1303,
279,
2645,
600,
25,
15560,
28,
38011,
12,
1662,
12,
562,
3916,
198,
220,
357,
79,
198,
220,
220,
930,
705,
20560,
6,
9609,
15584,
13,
16447,
7,
4868,
7,
9521,
7,
4002,
62,
22046,
13,
22510,
62,
298,
871,
22305,
198,
220,
220,
930,
705,
2514,
10903,
6,
9609,
15584,
13,
13912,
7,
2536,
8,
198,
220,
220,
930,
705,
2514,
20885,
6,
9609,
15584,
13,
13912,
7,
32398,
36918,
2848,
7,
11031,
11,
6045,
11,
31836,
737,
15883,
62,
26858,
8,
198,
220,
220,
930,
705,
16594,
284,
16092,
459,
382,
6,
9609,
19430,
2514,
27354,
459,
382,
7,
16302,
4008,
628,
220,
279,
13,
5143,
3419,
628,
220,
1303,
32233,
37709,
362,
25,
1002,
257,
1100,
4179,
373,
2810,
11,
1100,
340,
290,
6216,
198,
220,
1303,
326,
262,
2938,
12066,
547,
1100,
13,
198,
220,
611,
1900,
62,
22046,
13,
32374,
318,
407,
6045,
25,
198,
220,
220,
220,
18931,
13,
10951,
10786,
4507,
263,
1112,
257,
3614,
900,
286,
4064,
82,
12066,
290,
45505,
954,
2637,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1900,
62,
22046,
13,
32374,
8,
198,
220,
220,
220,
279,
796,
649,
62,
79,
541,
4470,
62,
4480,
62,
21858,
62,
3672,
7,
79,
541,
4470,
62,
25811,
11,
1693,
62,
3672,
11,
705,
12,
332,
1958,
12,
32374,
11537,
198,
220,
220,
220,
12405,
62,
4480,
62,
32374,
796,
12405,
62,
40842,
17,
13,
20746,
3419,
198,
220,
220,
220,
12405,
62,
4480,
62,
32374,
13,
29881,
4863,
7,
22766,
8,
198,
220,
220,
220,
12405,
62,
4480,
62,
32374,
13,
32374,
13,
8367,
796,
1900,
62,
22046,
13,
32374,
198,
220,
220,
220,
12066,
796,
279,
930,
705,
961,
422,
4818,
459,
382,
6,
9609,
4149,
4863,
27354,
459,
382,
7,
16302,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
4480,
62,
32374,
8,
198,
220,
220,
220,
6818,
62,
5562,
7,
198,
220,
220,
220,
220,
220,
220,
220,
12066,
930,
15584,
13,
785,
8800,
364,
13,
12332,
13,
9861,
672,
453,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
4961,
62,
1462,
26933,
4002,
62,
22046,
13,
32374,
60,
4008,
628,
220,
220,
220,
279,
13,
5143,
3419,
628,
220,
1303,
37709,
513,
25,
43301,
262,
3194,
7232,
871,
290,
11767,
1255,
13,
198,
220,
18931,
13,
10951,
10786,
4507,
263,
1112,
12066,
11,
33183,
484,
2872,
2637,
8,
198,
220,
279,
796,
649,
62,
79,
541,
4470,
62,
4480,
62,
21858,
62,
3672,
7,
79,
541,
4470,
62,
25811,
11,
1693,
62,
3672,
11,
705,
12,
332,
1958,
11537,
198,
220,
12066,
796,
279,
930,
705,
961,
422,
4818,
459,
382,
6,
9609,
4149,
4863,
27354,
459,
382,
7,
16302,
11,
12405,
8,
628,
220,
6818,
62,
5562,
7,
198,
220,
220,
220,
220,
220,
12066,
930,
15584,
13,
785,
8800,
364,
13,
12332,
13,
9861,
672,
453,
22784,
198,
220,
220,
220,
220,
220,
4961,
62,
1462,
26933,
22510,
62,
298,
871,
60,
4008,
628,
220,
279,
13,
5143,
3419,
628,
220,
1303,
37709,
604,
25,
23520,
7232,
871,
13,
198,
220,
18931,
13,
10951,
10786,
5005,
293,
889,
12066,
2637,
8,
198,
220,
279,
796,
649,
62,
79,
541,
4470,
62,
4480,
62,
21858,
62,
3672,
7,
79,
541,
4470,
62,
25811,
11,
1693,
62,
3672,
11,
705,
12,
33678,
11537,
198,
220,
12066,
796,
279,
930,
705,
961,
422,
4818,
459,
382,
6,
9609,
4149,
4863,
27354,
459,
382,
7,
16302,
11,
12405,
8,
198,
220,
1303,
279,
2645,
600,
25,
15560,
28,
38011,
12,
1662,
12,
562,
3916,
198,
220,
357,
298,
871,
198,
220,
220,
930,
705,
2514,
26363,
6,
9609,
15584,
13,
13912,
7,
50033,
9312,
25,
9312,
13,
2539,
8,
198,
220,
220,
930,
705,
38727,
8251,
6,
9609,
23520,
4863,
27354,
459,
382,
7,
16302,
4008,
628,
220,
279,
13,
5143,
3419,
628,
220,
1303,
37709,
642,
25,
43301,
262,
3194,
7232,
871,
11,
11767,
645,
2482,
13,
198,
220,
18931,
13,
10951,
10786,
4507,
263,
1112,
329,
262,
12066,
284,
787,
1654,
612,
389,
4844,
1944,
2637,
8,
198,
220,
279,
796,
649,
62,
79,
541,
4470,
62,
4480,
62,
21858,
62,
3672,
7,
79,
541,
4470,
62,
25811,
11,
1693,
62,
3672,
11,
705,
12,
332,
1958,
12,
2934,
33342,
11537,
198,
220,
12066,
796,
279,
930,
705,
961,
422,
4818,
459,
382,
6,
9609,
4149,
4863,
27354,
459,
382,
7,
16302,
11,
12405,
8,
628,
220,
6818,
62,
5562,
7,
198,
220,
220,
220,
220,
220,
12066,
930,
15584,
13,
785,
8800,
364,
13,
12332,
13,
9861,
672,
453,
22784,
198,
220,
220,
220,
220,
220,
4961,
62,
1462,
26933,
15,
60,
4008,
628,
220,
279,
13,
5143,
3419,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
18931,
13,
1136,
11187,
1362,
22446,
2617,
4971,
7,
6404,
2667,
13,
10778,
8,
198,
220,
1057,
3419,
198
] | 2.805925 | 2,633 |
# input
input_word = input("Enter a word: ")
# response
print('***')
for letter in input_word:
print(letter)
print('***')
| [
2,
5128,
198,
15414,
62,
4775,
796,
5128,
7203,
17469,
257,
1573,
25,
366,
8,
198,
198,
2,
2882,
198,
4798,
10786,
8162,
11537,
198,
1640,
3850,
287,
5128,
62,
4775,
25,
198,
220,
220,
220,
3601,
7,
9291,
8,
198,
4798,
10786,
8162,
11537,
198
] | 2.76087 | 46 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tinkoff/cloud/stt/v1/stt.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
from tinkoff.cloud.longrunning.v1 import longrunning_pb2 as tinkoff_dot_cloud_dot_longrunning_dot_v1_dot_longrunning__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1etinkoff/cloud/stt/v1/stt.proto\x12\x14tinkoff.cloud.stt.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto\x1a.tinkoff/cloud/longrunning/v1/longrunning.proto\"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"2\n\x13SpeechContextPhrase\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\"W\n\rSpeechContext\x12:\n\x07phrases\x18\x03 \x03(\x0b\x32).tinkoff.cloud.stt.v1.SpeechContextPhraseJ\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03\"\x88\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xb4\x01\n\x1cVoiceActivityDetectionConfig\x12\x1b\n\x13min_speech_duration\x18\x01 \x01(\x02\x12\x1b\n\x13max_speech_duration\x18\x02 \x01(\x02\x12\"\n\x1asilence_duration_threshold\x18\x03 \x01(\x02\x12\x1e\n\x16silence_prob_threshold\x18\x04 \x01(\x02\x12\x16\n\x0e\x61ggressiveness\x18\x05 \x01(\x02\"\xdb\x04\n\x11RecognitionConfig\x12\x35\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32#.tinkoff.cloud.stt.v1.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\r\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\r\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12<\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32#.tinkoff.cloud.stt.v1.SpeechContext\x12$\n\x1c\x65nable_automatic_punctuation\x18\x08 \x01(\x08\x12\r\n\x05model\x18\n \x01(\t\x12\x14\n\x0cnum_channels\x18\x0c \x01(\r\x12\x1c\n\x12\x64o_not_perform_vad\x18\r \x01(\x08H\x00\x12H\n\nvad_config\x18\x0e \x01(\x0b\x32\x32.tinkoff.cloud.stt.v1.VoiceActivityDetectionConfigH\x00\x12\x1e\n\x16\x65nable_denormalization\x18\x10 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x11 \x01(\x08\x12$\n\x1c\x65nable_gender_identification\x18\x12 \x01(\x08\x42\x05\n\x03vadJ\x04\x08\x07\x10\x08J\x04\x08\t\x10\nJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0f\x10\x10R\x18\x65nable_word_time_offsetsR\x08metadataR\x0cuse_enhanced\"\x82\x01\n\x10RecognizeRequest\x12\x37\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\'.tinkoff.cloud.stt.v1.RecognitionConfig\x12\x35\n\x05\x61udio\x18\x02 \x01(\x0b\x32&.tinkoff.cloud.stt.v1.RecognitionAudio\"u\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12-\n\x05words\x18\x03 \x03(\x0b\x32\x1e.tinkoff.cloud.stt.v1.WordInfo\"^\n\x1dSpeechSentimentAnalysisResult\x12\x1b\n\x13negative_prob_audio\x18\x01 \x01(\x02\x12 \n\x18negative_prob_audio_text\x18\x02 \x01(\x02\"L\n SpeechGenderIdentificationResult\x12\x12\n\nmale_proba\x18\x01 \x01(\x02\x12\x14\n\x0c\x66\x65male_proba\x18\x02 \x01(\x02\"\x86\x03\n\x17SpeechRecognitionResult\x12H\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x32.tinkoff.cloud.stt.v1.SpeechRecognitionAlternative\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\x05\x12-\n\nstart_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12V\n\x19sentiment_analysis_result\x18\x05 \x01(\x0b\x32\x33.tinkoff.cloud.stt.v1.SpeechSentimentAnalysisResult\x12\\\n\x1cgender_identification_result\x18\x06 \x01(\x0b\x32\x36.tinkoff.cloud.stt.v1.SpeechGenderIdentificationResult\"S\n\x11RecognizeResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.tinkoff.cloud.stt.v1.SpeechRecognitionResult\"H\n\x14InterimResultsConfig\x12\x1e\n\x16\x65nable_interim_results\x18\x01 \x01(\x08\x12\x10\n\x08interval\x18\x02 \x01(\x02\"\x9c\x01\n\x1bLongRunningRecognizeRequest\x12\x37\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\'.tinkoff.cloud.stt.v1.RecognitionConfig\x12\x35\n\x05\x61udio\x18\x02 \x01(\x0b\x32&.tinkoff.cloud.stt.v1.RecognitionAudio\x12\r\n\x05group\x18\x03 \x01(\t\"\xbb\x01\n\x1aStreamingRecognitionConfig\x12\x37\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\'.tinkoff.cloud.stt.v1.RecognitionConfig\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12J\n\x16interim_results_config\x18\x03 \x01(\x0b\x32*.tinkoff.cloud.stt.v1.InterimResultsConfig\"\x97\x01\n\x19StreamingRecognizeRequest\x12L\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x30.tinkoff.cloud.stt.v1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x8c\x01\n\x1aStreamingRecognitionResult\x12I\n\x12recognition_result\x18\x01 \x01(\x0b\x32-.tinkoff.cloud.stt.v1.SpeechRecognitionResult\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\"k\n\x1aStreamingRecognizeResponse\x12\x41\n\x07results\x18\x02 \x03(\x0b\x32\x30.tinkoff.cloud.stt.v1.StreamingRecognitionResultJ\x04\x08\x01\x10\x02J\x04\x08\x03\x10\x04\"\x8f\x01\n\x1eStreamingUnaryRecognizeRequest\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\'.tinkoff.cloud.stt.v1.RecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x19\n\x17streaming_unary_request*\x91\x02\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x03\x12\x08\n\x04\x41LAW\x10\x08\x12\x0c\n\x08RAW_OPUS\x10\x0b\x12\x0e\n\nMPEG_AUDIO\x10\x0c\x12\x0c\n\x08\x41\x44TS_AAC\x10\r\x12\x0e\n\nRAW_AAC_LC\x10\x0e\x12\x11\n\rRAW_ER_AAC_LD\x10\x0f\"\x04\x08\x02\x10\x02\"\x04\x08\x04\x10\x04\"\x04\x08\x05\x10\x05\"\x04\x08\x06\x10\x06\"\x04\x08\x07\x10\x07\"\x04\x08\t\x10\t\"\x04\x08\n\x10\n*\x04\x46LAC*\x03\x41MR*\x06\x41MR_WB*\x08OGG_OPUS*\x16SPEEX_WITH_HEADER_BYTE*\tLINEAR32F*\nOGG_VORBIS2\xd0\x04\n\x0cSpeechToText\x12z\n\tRecognize\x12&.tinkoff.cloud.stt.v1.RecognizeRequest\x1a\'.tinkoff.cloud.stt.v1.RecognizeResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/stt:recognize:\x01*\x12{\n\x12StreamingRecognize\x12/.tinkoff.cloud.stt.v1.StreamingRecognizeRequest\x1a\x30.tinkoff.cloud.stt.v1.StreamingRecognizeResponse(\x01\x30\x01\x12\x9b\x01\n\x14LongRunningRecognize\x12\x31.tinkoff.cloud.stt.v1.LongRunningRecognizeRequest\x1a\'.tinkoff.cloud.longrunning.v1.Operation\"\'\x82\xd3\xe4\x93\x02!\"\x1c/v1/stt:longrunningrecognize:\x01*\x12\xa8\x01\n\x17StreamingUnaryRecognize\x12\x34.tinkoff.cloud.stt.v1.StreamingUnaryRecognizeRequest\x1a\'.tinkoff.cloud.stt.v1.RecognizeResponse\",\x82\xd3\xe4\x93\x02&\"!/v1/stt:streaming_unary_recognize:\x01*(\x01\x42NZDgithub.com/Tinkoff/voicekit-examples/golang/pkg/tinkoff/cloud/stt/v1\xa2\x02\x05TVKSRb\x06proto3')
_AUDIOENCODING = DESCRIPTOR.enum_types_by_name['AudioEncoding']
AudioEncoding = enum_type_wrapper.EnumTypeWrapper(_AUDIOENCODING)
ENCODING_UNSPECIFIED = 0
LINEAR16 = 1
MULAW = 3
ALAW = 8
RAW_OPUS = 11
MPEG_AUDIO = 12
ADTS_AAC = 13
RAW_AAC_LC = 14
RAW_ER_AAC_LD = 15
_RECOGNITIONAUDIO = DESCRIPTOR.message_types_by_name['RecognitionAudio']
_SPEECHCONTEXTPHRASE = DESCRIPTOR.message_types_by_name['SpeechContextPhrase']
_SPEECHCONTEXT = DESCRIPTOR.message_types_by_name['SpeechContext']
_WORDINFO = DESCRIPTOR.message_types_by_name['WordInfo']
_VOICEACTIVITYDETECTIONCONFIG = DESCRIPTOR.message_types_by_name['VoiceActivityDetectionConfig']
_RECOGNITIONCONFIG = DESCRIPTOR.message_types_by_name['RecognitionConfig']
_RECOGNIZEREQUEST = DESCRIPTOR.message_types_by_name['RecognizeRequest']
_SPEECHRECOGNITIONALTERNATIVE = DESCRIPTOR.message_types_by_name['SpeechRecognitionAlternative']
_SPEECHSENTIMENTANALYSISRESULT = DESCRIPTOR.message_types_by_name['SpeechSentimentAnalysisResult']
_SPEECHGENDERIDENTIFICATIONRESULT = DESCRIPTOR.message_types_by_name['SpeechGenderIdentificationResult']
_SPEECHRECOGNITIONRESULT = DESCRIPTOR.message_types_by_name['SpeechRecognitionResult']
_RECOGNIZERESPONSE = DESCRIPTOR.message_types_by_name['RecognizeResponse']
_INTERIMRESULTSCONFIG = DESCRIPTOR.message_types_by_name['InterimResultsConfig']
_LONGRUNNINGRECOGNIZEREQUEST = DESCRIPTOR.message_types_by_name['LongRunningRecognizeRequest']
_STREAMINGRECOGNITIONCONFIG = DESCRIPTOR.message_types_by_name['StreamingRecognitionConfig']
_STREAMINGRECOGNIZEREQUEST = DESCRIPTOR.message_types_by_name['StreamingRecognizeRequest']
_STREAMINGRECOGNITIONRESULT = DESCRIPTOR.message_types_by_name['StreamingRecognitionResult']
_STREAMINGRECOGNIZERESPONSE = DESCRIPTOR.message_types_by_name['StreamingRecognizeResponse']
_STREAMINGUNARYRECOGNIZEREQUEST = DESCRIPTOR.message_types_by_name['StreamingUnaryRecognizeRequest']
RecognitionAudio = _reflection.GeneratedProtocolMessageType('RecognitionAudio', (_message.Message,), {
'DESCRIPTOR' : _RECOGNITIONAUDIO,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.RecognitionAudio)
})
_sym_db.RegisterMessage(RecognitionAudio)
SpeechContextPhrase = _reflection.GeneratedProtocolMessageType('SpeechContextPhrase', (_message.Message,), {
'DESCRIPTOR' : _SPEECHCONTEXTPHRASE,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.SpeechContextPhrase)
})
_sym_db.RegisterMessage(SpeechContextPhrase)
SpeechContext = _reflection.GeneratedProtocolMessageType('SpeechContext', (_message.Message,), {
'DESCRIPTOR' : _SPEECHCONTEXT,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.SpeechContext)
})
_sym_db.RegisterMessage(SpeechContext)
WordInfo = _reflection.GeneratedProtocolMessageType('WordInfo', (_message.Message,), {
'DESCRIPTOR' : _WORDINFO,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.WordInfo)
})
_sym_db.RegisterMessage(WordInfo)
VoiceActivityDetectionConfig = _reflection.GeneratedProtocolMessageType('VoiceActivityDetectionConfig', (_message.Message,), {
'DESCRIPTOR' : _VOICEACTIVITYDETECTIONCONFIG,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.VoiceActivityDetectionConfig)
})
_sym_db.RegisterMessage(VoiceActivityDetectionConfig)
RecognitionConfig = _reflection.GeneratedProtocolMessageType('RecognitionConfig', (_message.Message,), {
'DESCRIPTOR' : _RECOGNITIONCONFIG,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.RecognitionConfig)
})
_sym_db.RegisterMessage(RecognitionConfig)
RecognizeRequest = _reflection.GeneratedProtocolMessageType('RecognizeRequest', (_message.Message,), {
'DESCRIPTOR' : _RECOGNIZEREQUEST,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.RecognizeRequest)
})
_sym_db.RegisterMessage(RecognizeRequest)
SpeechRecognitionAlternative = _reflection.GeneratedProtocolMessageType('SpeechRecognitionAlternative', (_message.Message,), {
'DESCRIPTOR' : _SPEECHRECOGNITIONALTERNATIVE,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.SpeechRecognitionAlternative)
})
_sym_db.RegisterMessage(SpeechRecognitionAlternative)
SpeechSentimentAnalysisResult = _reflection.GeneratedProtocolMessageType('SpeechSentimentAnalysisResult', (_message.Message,), {
'DESCRIPTOR' : _SPEECHSENTIMENTANALYSISRESULT,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.SpeechSentimentAnalysisResult)
})
_sym_db.RegisterMessage(SpeechSentimentAnalysisResult)
SpeechGenderIdentificationResult = _reflection.GeneratedProtocolMessageType('SpeechGenderIdentificationResult', (_message.Message,), {
'DESCRIPTOR' : _SPEECHGENDERIDENTIFICATIONRESULT,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.SpeechGenderIdentificationResult)
})
_sym_db.RegisterMessage(SpeechGenderIdentificationResult)
SpeechRecognitionResult = _reflection.GeneratedProtocolMessageType('SpeechRecognitionResult', (_message.Message,), {
'DESCRIPTOR' : _SPEECHRECOGNITIONRESULT,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.SpeechRecognitionResult)
})
_sym_db.RegisterMessage(SpeechRecognitionResult)
RecognizeResponse = _reflection.GeneratedProtocolMessageType('RecognizeResponse', (_message.Message,), {
'DESCRIPTOR' : _RECOGNIZERESPONSE,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.RecognizeResponse)
})
_sym_db.RegisterMessage(RecognizeResponse)
InterimResultsConfig = _reflection.GeneratedProtocolMessageType('InterimResultsConfig', (_message.Message,), {
'DESCRIPTOR' : _INTERIMRESULTSCONFIG,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.InterimResultsConfig)
})
_sym_db.RegisterMessage(InterimResultsConfig)
LongRunningRecognizeRequest = _reflection.GeneratedProtocolMessageType('LongRunningRecognizeRequest', (_message.Message,), {
'DESCRIPTOR' : _LONGRUNNINGRECOGNIZEREQUEST,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.LongRunningRecognizeRequest)
})
_sym_db.RegisterMessage(LongRunningRecognizeRequest)
StreamingRecognitionConfig = _reflection.GeneratedProtocolMessageType('StreamingRecognitionConfig', (_message.Message,), {
'DESCRIPTOR' : _STREAMINGRECOGNITIONCONFIG,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.StreamingRecognitionConfig)
})
_sym_db.RegisterMessage(StreamingRecognitionConfig)
StreamingRecognizeRequest = _reflection.GeneratedProtocolMessageType('StreamingRecognizeRequest', (_message.Message,), {
'DESCRIPTOR' : _STREAMINGRECOGNIZEREQUEST,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.StreamingRecognizeRequest)
})
_sym_db.RegisterMessage(StreamingRecognizeRequest)
StreamingRecognitionResult = _reflection.GeneratedProtocolMessageType('StreamingRecognitionResult', (_message.Message,), {
'DESCRIPTOR' : _STREAMINGRECOGNITIONRESULT,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.StreamingRecognitionResult)
})
_sym_db.RegisterMessage(StreamingRecognitionResult)
StreamingRecognizeResponse = _reflection.GeneratedProtocolMessageType('StreamingRecognizeResponse', (_message.Message,), {
'DESCRIPTOR' : _STREAMINGRECOGNIZERESPONSE,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.StreamingRecognizeResponse)
})
_sym_db.RegisterMessage(StreamingRecognizeResponse)
StreamingUnaryRecognizeRequest = _reflection.GeneratedProtocolMessageType('StreamingUnaryRecognizeRequest', (_message.Message,), {
'DESCRIPTOR' : _STREAMINGUNARYRECOGNIZEREQUEST,
'__module__' : 'tinkoff.cloud.stt.v1.stt_pb2'
# @@protoc_insertion_point(class_scope:tinkoff.cloud.stt.v1.StreamingUnaryRecognizeRequest)
})
_sym_db.RegisterMessage(StreamingUnaryRecognizeRequest)
_SPEECHTOTEXT = DESCRIPTOR.services_by_name['SpeechToText']
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'ZDgithub.com/Tinkoff/voicekit-examples/golang/pkg/tinkoff/cloud/stt/v1\242\002\005TVKSR'
_SPEECHTOTEXT.methods_by_name['Recognize']._options = None
_SPEECHTOTEXT.methods_by_name['Recognize']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/stt:recognize:\001*'
_SPEECHTOTEXT.methods_by_name['LongRunningRecognize']._options = None
_SPEECHTOTEXT.methods_by_name['LongRunningRecognize']._serialized_options = b'\202\323\344\223\002!\"\034/v1/stt:longrunningrecognize:\001*'
_SPEECHTOTEXT.methods_by_name['StreamingUnaryRecognize']._options = None
_SPEECHTOTEXT.methods_by_name['StreamingUnaryRecognize']._serialized_options = b'\202\323\344\223\002&\"!/v1/stt:streaming_unary_recognize:\001*'
_AUDIOENCODING._serialized_start=3185
_AUDIOENCODING._serialized_end=3458
_RECOGNITIONAUDIO._serialized_start=166
_RECOGNITIONAUDIO._serialized_end=234
_SPEECHCONTEXTPHRASE._serialized_start=236
_SPEECHCONTEXTPHRASE._serialized_end=286
_SPEECHCONTEXT._serialized_start=288
_SPEECHCONTEXT._serialized_end=375
_WORDINFO._serialized_start=378
_WORDINFO._serialized_end=514
_VOICEACTIVITYDETECTIONCONFIG._serialized_start=517
_VOICEACTIVITYDETECTIONCONFIG._serialized_end=697
_RECOGNITIONCONFIG._serialized_start=700
_RECOGNITIONCONFIG._serialized_end=1303
_RECOGNIZEREQUEST._serialized_start=1306
_RECOGNIZEREQUEST._serialized_end=1436
_SPEECHRECOGNITIONALTERNATIVE._serialized_start=1438
_SPEECHRECOGNITIONALTERNATIVE._serialized_end=1555
_SPEECHSENTIMENTANALYSISRESULT._serialized_start=1557
_SPEECHSENTIMENTANALYSISRESULT._serialized_end=1651
_SPEECHGENDERIDENTIFICATIONRESULT._serialized_start=1653
_SPEECHGENDERIDENTIFICATIONRESULT._serialized_end=1729
_SPEECHRECOGNITIONRESULT._serialized_start=1732
_SPEECHRECOGNITIONRESULT._serialized_end=2122
_RECOGNIZERESPONSE._serialized_start=2124
_RECOGNIZERESPONSE._serialized_end=2207
_INTERIMRESULTSCONFIG._serialized_start=2209
_INTERIMRESULTSCONFIG._serialized_end=2281
_LONGRUNNINGRECOGNIZEREQUEST._serialized_start=2284
_LONGRUNNINGRECOGNIZEREQUEST._serialized_end=2440
_STREAMINGRECOGNITIONCONFIG._serialized_start=2443
_STREAMINGRECOGNITIONCONFIG._serialized_end=2630
_STREAMINGRECOGNIZEREQUEST._serialized_start=2633
_STREAMINGRECOGNIZEREQUEST._serialized_end=2784
_STREAMINGRECOGNITIONRESULT._serialized_start=2787
_STREAMINGRECOGNITIONRESULT._serialized_end=2927
_STREAMINGRECOGNIZERESPONSE._serialized_start=2929
_STREAMINGRECOGNIZERESPONSE._serialized_end=3036
_STREAMINGUNARYRECOGNIZEREQUEST._serialized_start=3039
_STREAMINGUNARYRECOGNIZEREQUEST._serialized_end=3182
_SPEECHTOTEXT._serialized_start=3461
_SPEECHTOTEXT._serialized_end=4053
# @@protoc_insertion_point(module_scope)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
44569,
2364,
14,
17721,
14,
301,
83,
14,
85,
16,
14,
301,
83,
13,
1676,
1462,
198,
37811,
8645,
515,
8435,
11876,
2438,
526,
15931,
198,
6738,
23645,
13,
11235,
672,
3046,
13,
32538,
1330,
33829,
62,
4906,
62,
48553,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
43087,
355,
4808,
20147,
1968,
273,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
43087,
62,
7742,
355,
4808,
20147,
1968,
273,
62,
7742,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
3275,
355,
4808,
20500,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
14580,
355,
4808,
5420,
1564,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
6194,
62,
48806,
355,
4808,
1837,
23650,
62,
48806,
198,
2,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
320,
3742,
8,
198,
198,
62,
37047,
62,
9945,
796,
4808,
1837,
23650,
62,
48806,
13,
19463,
3419,
628,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
9478,
62,
40842,
17,
355,
23645,
62,
26518,
62,
11235,
672,
3046,
62,
26518,
62,
32257,
834,
40842,
17,
198,
6738,
23645,
13,
15042,
1330,
37647,
62,
40842,
17,
355,
23645,
62,
26518,
62,
15042,
62,
26518,
62,
34574,
602,
834,
40842,
17,
198,
6738,
44569,
2364,
13,
17721,
13,
6511,
20270,
13,
85,
16,
1330,
890,
20270,
62,
40842,
17,
355,
44569,
2364,
62,
26518,
62,
17721,
62,
26518,
62,
6511,
20270,
62,
26518,
62,
85,
16,
62,
26518,
62,
6511,
20270,
834,
40842,
17,
628,
198,
30910,
36584,
32961,
796,
4808,
20147,
1968,
273,
62,
7742,
13,
19463,
22446,
4550,
32634,
1143,
8979,
7,
65,
6,
59,
77,
59,
87,
16,
316,
676,
2364,
14,
17721,
14,
301,
83,
14,
85,
16,
14,
301,
83,
13,
1676,
1462,
59,
87,
1065,
59,
87,
1415,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
59,
87,
16,
64,
59,
87,
16,
1533,
78,
2467,
14,
11235,
672,
3046,
14,
32257,
13,
1676,
1462,
59,
87,
16,
64,
59,
87,
16,
66,
13297,
14,
15042,
14,
34574,
602,
13,
1676,
1462,
59,
87,
16,
64,
13,
83,
676,
2364,
14,
17721,
14,
6511,
20270,
14,
85,
16,
14,
6511,
20270,
13,
1676,
1462,
7879,
35,
59,
77,
59,
87,
940,
6690,
2360,
653,
21206,
59,
87,
1065,
59,
87,
1157,
59,
77,
59,
87,
2998,
59,
87,
5066,
38564,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
66,
39,
59,
87,
405,
59,
87,
1065,
59,
81,
59,
77,
59,
87,
3070,
9900,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
83,
39,
59,
87,
405,
59,
87,
3682,
59,
87,
15,
68,
59,
77,
59,
87,
15,
66,
59,
87,
5333,
463,
952,
62,
10459,
7879,
17,
59,
77,
59,
87,
1485,
5248,
3055,
21947,
2725,
22789,
59,
87,
1065,
59,
87,
15,
66,
59,
77,
59,
87,
3023,
5239,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
83,
59,
87,
1065,
59,
81,
59,
77,
59,
87,
2713,
26675,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2999,
7879,
54,
59,
77,
59,
81,
5248,
3055,
21947,
59,
87,
1065,
7479,
77,
59,
87,
2998,
746,
81,
1386,
59,
87,
1507,
59,
87,
3070,
3467,
87,
3070,
38016,
87,
15,
65,
59,
87,
2624,
737,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
21947,
2725,
22789,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
486,
59,
87,
940,
59,
87,
2999,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
2999,
59,
87,
940,
59,
87,
3070,
7879,
59,
87,
3459,
59,
87,
486,
59,
77,
59,
87,
2919,
26449,
12360,
59,
87,
1065,
12,
59,
77,
59,
77,
9688,
62,
2435,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
1129,
13,
13297,
13,
11235,
672,
3046,
13,
26054,
59,
87,
1065,
10,
59,
77,
59,
87,
2919,
59,
87,
2996,
358,
62,
2435,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
1129,
13,
13297,
13,
11235,
672,
3046,
13,
26054,
59,
87,
1065,
59,
87,
15,
66,
59,
77,
59,
87,
3023,
4775,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
83,
59,
87,
1065,
59,
87,
1065,
59,
77,
59,
77,
39745,
59,
87,
1507,
59,
87,
3023,
3467,
87,
486,
38016,
87,
2999,
7879,
59,
30894,
19,
59,
87,
486,
59,
77,
59,
87,
16,
66,
35708,
16516,
11242,
3213,
16934,
59,
87,
1065,
59,
87,
16,
65,
59,
77,
59,
87,
1485,
1084,
62,
45862,
62,
32257,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
59,
87,
16,
65,
59,
77,
59,
87,
1485,
9806,
62,
45862,
62,
32257,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
7879,
59,
77,
59,
87,
16,
292,
346,
594,
62,
32257,
62,
400,
10126,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
59,
87,
16,
68,
59,
77,
59,
87,
1433,
18217,
594,
62,
1676,
65,
62,
400,
10126,
59,
87,
1507,
59,
87,
3023,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
59,
87,
1433,
59,
77,
59,
87,
15,
68,
59,
87,
5333,
1130,
601,
6517,
59,
87,
1507,
59,
87,
2713,
3467,
87,
486,
38016,
87,
2999,
7879,
59,
87,
9945,
59,
87,
3023,
59,
77,
59,
87,
1157,
6690,
2360,
653,
16934,
59,
87,
1065,
59,
87,
2327,
59,
77,
59,
87,
2919,
59,
87,
2996,
10782,
7656,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
68,
59,
87,
2624,
2,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
21206,
27195,
7656,
59,
87,
1065,
59,
87,
1129,
59,
77,
59,
87,
1157,
39873,
62,
4873,
62,
372,
22877,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
81,
59,
87,
1065,
59,
87,
1314,
59,
77,
59,
81,
16129,
62,
8189,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
83,
59,
87,
1065,
59,
87,
1507,
59,
77,
59,
87,
940,
9806,
62,
33645,
2929,
59,
87,
1507,
59,
87,
3023,
3467,
87,
486,
38016,
81,
59,
87,
1065,
59,
87,
1507,
59,
77,
59,
87,
940,
5577,
19689,
62,
24455,
59,
87,
1507,
59,
87,
2713,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
27,
59,
77,
59,
87,
15,
69,
45862,
62,
22866,
82,
59,
87,
1507,
59,
87,
3312,
3467,
87,
3070,
38016,
87,
15,
65,
59,
87,
2624,
2,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
21947,
59,
87,
1065,
3,
59,
77,
59,
87,
16,
66,
59,
87,
2996,
77,
540,
62,
37800,
62,
79,
16260,
2288,
59,
87,
1507,
59,
87,
2919,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
59,
81,
59,
77,
59,
87,
2713,
19849,
59,
87,
1507,
59,
77,
3467,
87,
486,
38016,
83,
59,
87,
1065,
59,
87,
1415,
59,
77,
59,
87,
15,
66,
22510,
62,
354,
8961,
59,
87,
1507,
59,
87,
15,
66,
3467,
87,
486,
38016,
81,
59,
87,
1065,
59,
87,
16,
66,
59,
77,
59,
87,
1065,
59,
87,
2414,
78,
62,
1662,
62,
525,
687,
62,
85,
324,
59,
87,
1507,
59,
81,
3467,
87,
486,
38016,
87,
2919,
39,
59,
87,
405,
59,
87,
1065,
39,
59,
77,
59,
48005,
324,
62,
11250,
59,
87,
1507,
59,
87,
15,
68,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
2624,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
35708,
16516,
11242,
3213,
16934,
39,
59,
87,
405,
59,
87,
1065,
59,
87,
16,
68,
59,
77,
59,
87,
1433,
59,
87,
2996,
77,
540,
62,
6559,
6636,
1634,
59,
87,
1507,
59,
87,
940,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
0,
59,
77,
59,
87,
1129,
59,
87,
2996,
77,
540,
62,
34086,
3681,
62,
20930,
59,
87,
1507,
59,
87,
1157,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
3,
59,
77,
59,
87,
16,
66,
59,
87,
2996,
77,
540,
62,
8388,
62,
738,
2649,
59,
87,
1507,
59,
87,
1065,
3467,
87,
486,
38016,
87,
2919,
59,
87,
3682,
59,
87,
2713,
59,
77,
59,
87,
3070,
85,
324,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
2998,
59,
87,
940,
59,
87,
2919,
41,
59,
87,
3023,
59,
87,
2919,
59,
83,
59,
87,
940,
59,
77,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
15,
65,
59,
87,
940,
59,
87,
15,
66,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
15,
69,
59,
87,
940,
59,
87,
940,
49,
59,
87,
1507,
59,
87,
2996,
77,
540,
62,
4775,
62,
2435,
62,
8210,
1039,
49,
59,
87,
2919,
38993,
49,
59,
87,
15,
66,
1904,
62,
16550,
2903,
7879,
59,
87,
6469,
59,
87,
486,
59,
77,
59,
87,
940,
6690,
2360,
1096,
18453,
59,
87,
1065,
59,
87,
2718,
59,
77,
59,
87,
3312,
59,
87,
5066,
261,
5647,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
4458,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
16934,
59,
87,
1065,
59,
87,
2327,
59,
77,
59,
87,
2713,
59,
87,
5333,
463,
952,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
5,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
21206,
7879,
84,
59,
77,
59,
87,
16,
66,
5248,
3055,
6690,
2360,
653,
49788,
59,
87,
1065,
59,
87,
1065,
59,
77,
59,
429,
26084,
6519,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
83,
59,
87,
1065,
59,
87,
1065,
59,
77,
59,
77,
39745,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
12,
59,
77,
59,
87,
2713,
10879,
59,
87,
1507,
59,
87,
3070,
3467,
87,
3070,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
16,
68,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
26449,
12360,
7879,
61,
59,
77,
59,
87,
16,
67,
5248,
3055,
31837,
3681,
32750,
23004,
59,
87,
1065,
59,
87,
16,
65,
59,
77,
59,
87,
1485,
31591,
62,
1676,
65,
62,
24051,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
3467,
77,
59,
87,
1507,
31591,
62,
1676,
65,
62,
24051,
62,
5239,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2999,
7879,
43,
59,
77,
24709,
41394,
33234,
2649,
23004,
59,
87,
1065,
59,
87,
1065,
59,
77,
59,
21533,
1000,
62,
1676,
7012,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
2999,
59,
87,
1065,
59,
87,
1415,
59,
77,
59,
87,
15,
66,
59,
87,
2791,
59,
87,
2996,
22606,
62,
1676,
7012,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2999,
7879,
59,
87,
4521,
59,
87,
3070,
59,
77,
59,
87,
1558,
5248,
3055,
6690,
2360,
653,
23004,
59,
87,
1065,
39,
59,
77,
59,
87,
15,
66,
59,
87,
5333,
75,
759,
2929,
59,
87,
1507,
59,
87,
486,
3467,
87,
3070,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
2624,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
6690,
2360,
653,
49788,
59,
87,
1065,
59,
87,
15,
69,
59,
77,
59,
87,
2998,
59,
87,
5066,
71,
4276,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2713,
59,
87,
1065,
12,
59,
77,
59,
77,
9688,
62,
2435,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
1129,
13,
13297,
13,
11235,
672,
3046,
13,
26054,
59,
87,
1065,
10,
59,
77,
59,
87,
2919,
59,
87,
2996,
358,
62,
2435,
59,
87,
1507,
59,
87,
3023,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
1129,
13,
13297,
13,
11235,
672,
3046,
13,
26054,
59,
87,
1065,
53,
59,
77,
59,
87,
1129,
34086,
3681,
62,
20930,
62,
20274,
59,
87,
1507,
59,
87,
2713,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
2091,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
31837,
3681,
32750,
23004,
59,
87,
1065,
6852,
59,
77,
59,
87,
16,
66,
8388,
62,
738,
2649,
62,
20274,
59,
87,
1507,
59,
87,
3312,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
2623,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
41394,
33234,
2649,
23004,
7879,
50,
59,
77,
59,
87,
1157,
6690,
2360,
1096,
31077,
59,
87,
1065,
29,
59,
77,
59,
87,
2998,
43420,
59,
87,
1507,
59,
87,
486,
3467,
87,
3070,
38016,
87,
15,
65,
59,
87,
2624,
34507,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
6690,
2360,
653,
23004,
7879,
39,
59,
77,
59,
87,
1415,
9492,
320,
25468,
16934,
59,
87,
1065,
59,
87,
16,
68,
59,
77,
59,
87,
1433,
59,
87,
2996,
77,
540,
62,
3849,
320,
62,
43420,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
59,
87,
940,
59,
77,
59,
87,
2919,
3849,
2100,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2999,
7879,
59,
87,
24,
66,
59,
87,
486,
59,
77,
59,
87,
16,
65,
14617,
28768,
6690,
2360,
1096,
18453,
59,
87,
1065,
59,
87,
2718,
59,
77,
59,
87,
3312,
59,
87,
5066,
261,
5647,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
4458,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
16934,
59,
87,
1065,
59,
87,
2327,
59,
77,
59,
87,
2713,
59,
87,
5333,
463,
952,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
5,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
21206,
59,
87,
1065,
59,
81,
59,
77,
59,
87,
2713,
8094,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
83,
7879,
59,
87,
11848,
59,
87,
486,
59,
77,
59,
87,
16,
64,
12124,
278,
6690,
2360,
653,
16934,
59,
87,
1065,
59,
87,
2718,
59,
77,
59,
87,
3312,
59,
87,
5066,
261,
5647,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
4458,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
16934,
59,
87,
1065,
59,
87,
1507,
59,
77,
59,
87,
940,
29762,
62,
10381,
590,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
41,
59,
77,
59,
87,
1433,
3849,
320,
62,
43420,
62,
11250,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
24620,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
9492,
320,
25468,
16934,
7879,
59,
87,
5607,
59,
87,
486,
59,
77,
59,
87,
1129,
12124,
278,
6690,
2360,
1096,
18453,
59,
87,
1065,
43,
59,
77,
59,
87,
940,
5532,
278,
62,
11250,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
1270,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
653,
16934,
39,
59,
87,
405,
59,
87,
1065,
59,
87,
1558,
59,
77,
59,
22863,
952,
62,
11299,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
15,
66,
39,
59,
87,
405,
59,
87,
3682,
59,
87,
1485,
59,
77,
59,
87,
1157,
5532,
278,
62,
25927,
7879,
59,
87,
23,
66,
59,
87,
486,
59,
77,
59,
87,
16,
64,
12124,
278,
6690,
2360,
653,
23004,
59,
87,
1065,
40,
59,
77,
59,
87,
1065,
26243,
653,
62,
20274,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
34507,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
6690,
2360,
653,
23004,
59,
87,
1065,
59,
87,
940,
59,
77,
59,
87,
2919,
271,
62,
20311,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
2919,
59,
87,
1065,
59,
87,
1157,
59,
77,
59,
83,
301,
1799,
59,
87,
1507,
59,
87,
3070,
3467,
87,
486,
38016,
87,
2999,
7879,
74,
59,
77,
59,
87,
16,
64,
12124,
278,
6690,
2360,
1096,
31077,
59,
87,
1065,
59,
87,
3901,
59,
77,
59,
87,
2998,
43420,
59,
87,
1507,
59,
87,
2999,
3467,
87,
3070,
38016,
87,
15,
65,
59,
87,
2624,
59,
87,
1270,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
653,
23004,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
486,
59,
87,
940,
59,
87,
2999,
41,
59,
87,
3023,
59,
87,
2919,
59,
87,
3070,
59,
87,
940,
59,
87,
3023,
7879,
59,
87,
23,
69,
59,
87,
486,
59,
77,
59,
87,
16,
68,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
59,
87,
1065,
59,
87,
2670,
59,
77,
59,
87,
3312,
59,
87,
5066,
261,
5647,
59,
87,
1507,
59,
87,
486,
3467,
87,
486,
38016,
87,
15,
65,
59,
87,
2624,
59,
4458,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
16934,
39,
59,
87,
405,
59,
87,
1065,
59,
87,
1558,
59,
77,
59,
22863,
952,
62,
11299,
59,
87,
1507,
59,
87,
2999,
3467,
87,
486,
38016,
87,
15,
66,
39,
59,
87,
405,
59,
87,
3682,
59,
87,
1129,
59,
77,
59,
87,
1558,
5532,
278,
62,
403,
560,
62,
25927,
9,
59,
87,
6420,
59,
87,
2999,
59,
77,
59,
81,
21206,
27195,
7656,
59,
87,
1065,
59,
87,
1507,
59,
77,
59,
87,
1415,
59,
87,
2231,
7792,
3727,
2751,
62,
4944,
48451,
28343,
59,
87,
940,
59,
87,
405,
59,
87,
1065,
59,
87,
15,
66,
59,
77,
59,
87,
2919,
24027,
1503,
1433,
59,
87,
940,
59,
87,
486,
59,
87,
1065,
59,
83,
59,
77,
59,
87,
2713,
44,
6239,
12298,
59,
87,
940,
59,
87,
3070,
59,
87,
1065,
59,
87,
2919,
59,
77,
59,
87,
3023,
59,
87,
3901,
43,
12298,
59,
87,
940,
59,
87,
2919,
59,
87,
1065,
59,
87,
15,
66,
59,
77,
59,
87,
2919,
20530,
62,
3185,
2937,
59,
87,
940,
59,
87,
15,
65,
59,
87,
1065,
59,
87,
15,
68,
59,
77,
59,
77,
7378,
7156,
62,
48877,
9399,
59,
87,
940,
59,
87,
15,
66,
59,
87,
1065,
59,
87,
15,
66,
59,
77,
59,
87,
2919,
59,
87,
3901,
59,
87,
2598,
4694,
62,
32,
2246,
59,
87,
940,
59,
81,
59,
87,
1065,
59,
87,
15,
68,
59,
77,
59,
77,
20530,
62,
32,
2246,
62,
5639,
59,
87,
940,
59,
87,
15,
68,
59,
87,
1065,
59,
87,
1157,
59,
77,
59,
81,
20530,
62,
1137,
62,
32,
2246,
62,
11163,
59,
87,
940,
59,
87,
15,
69,
7879,
59,
87,
3023,
59,
87,
2919,
59,
87,
2999,
59,
87,
940,
59,
87,
2999,
7879,
59,
87,
3023,
59,
87,
2919,
59,
87,
3023,
59,
87,
940,
59,
87,
3023,
7879,
59,
87,
3023,
59,
87,
2919,
59,
87,
2713,
59,
87,
940,
59,
87,
2713,
7879,
59,
87,
3023,
59,
87,
2919,
59,
87,
3312,
59,
87,
940,
59,
87,
3312,
7879,
59,
87,
3023,
59,
87,
2919,
59,
87,
2998,
59,
87,
940,
59,
87,
2998,
7879,
59,
87,
3023,
59,
87,
2919,
59,
83,
59,
87,
940,
59,
83,
7879,
59,
87,
3023,
59,
87,
2919,
59,
77,
59,
87,
940,
59,
77,
9,
59,
87,
3023,
59,
87,
3510,
43,
2246,
9,
59,
87,
3070,
59,
87,
3901,
13599,
9,
59,
87,
3312,
59,
87,
3901,
13599,
62,
45607,
9,
59,
87,
2919,
7730,
38,
62,
3185,
2937,
9,
59,
87,
1433,
4303,
36,
6369,
62,
54,
10554,
62,
37682,
1137,
62,
17513,
9328,
9,
59,
83,
24027,
1503,
2624,
37,
9,
59,
77,
7730,
38,
62,
53,
1581,
33,
1797,
17,
59,
24954,
15,
59,
87,
3023,
59,
77,
59,
87,
15,
66,
5248,
3055,
2514,
8206,
59,
87,
1065,
89,
59,
77,
59,
83,
6690,
2360,
1096,
59,
87,
1065,
5,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
1096,
18453,
59,
87,
16,
64,
59,
4458,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
1096,
31077,
7879,
59,
87,
16,
66,
59,
87,
6469,
59,
24954,
18,
59,
27705,
19,
59,
87,
6052,
59,
87,
2999,
59,
87,
1433,
7879,
59,
87,
1157,
14,
85,
16,
14,
301,
83,
25,
26243,
1096,
7479,
87,
486,
9,
59,
87,
1065,
31478,
77,
59,
87,
1065,
12124,
278,
6690,
2360,
1096,
59,
87,
1065,
11757,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
1096,
18453,
59,
87,
16,
64,
59,
87,
1270,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
1096,
31077,
38016,
87,
486,
59,
87,
1270,
59,
87,
486,
59,
87,
1065,
59,
87,
24,
65,
59,
87,
486,
59,
77,
59,
87,
1415,
14617,
28768,
6690,
2360,
1096,
59,
87,
1065,
59,
87,
3132,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
14617,
28768,
6690,
2360,
1096,
18453,
59,
87,
16,
64,
59,
4458,
83,
676,
2364,
13,
17721,
13,
6511,
20270,
13,
85,
16,
13,
32180,
7879,
43054,
59,
87,
6469,
59,
24954,
18,
59,
27705,
19,
59,
87,
6052,
59,
87,
2999,
0,
7879,
59,
87,
16,
66,
14,
85,
16,
14,
301,
83,
25,
6511,
20270,
26243,
1096,
7479,
87,
486,
9,
59,
87,
1065,
59,
27865,
23,
59,
87,
486,
59,
77,
59,
87,
1558,
12124,
278,
3118,
560,
6690,
2360,
1096,
59,
87,
1065,
59,
87,
2682,
13,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
59,
87,
16,
64,
59,
4458,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
1096,
31077,
34607,
59,
87,
6469,
59,
24954,
18,
59,
27705,
19,
59,
87,
6052,
59,
87,
2999,
5,
7879,
48443,
85,
16,
14,
301,
83,
25,
5532,
278,
62,
403,
560,
62,
26243,
1096,
7479,
87,
486,
9,
38016,
87,
486,
59,
87,
3682,
37371,
35,
12567,
13,
785,
14,
51,
676,
2364,
14,
38888,
15813,
12,
1069,
12629,
14,
70,
349,
648,
14,
35339,
14,
83,
676,
2364,
14,
17721,
14,
301,
83,
14,
85,
16,
59,
27865,
17,
59,
87,
2999,
59,
87,
2713,
6849,
42,
12562,
65,
59,
87,
3312,
1676,
1462,
18,
11537,
198,
198,
62,
48877,
9399,
24181,
3727,
2751,
796,
22196,
36584,
32961,
13,
44709,
62,
19199,
62,
1525,
62,
3672,
17816,
21206,
27195,
7656,
20520,
198,
21206,
27195,
7656,
796,
33829,
62,
4906,
62,
48553,
13,
4834,
388,
6030,
36918,
2848,
28264,
48877,
9399,
24181,
3727,
2751,
8,
198,
24181,
3727,
2751,
62,
4944,
48451,
28343,
796,
657,
198,
24027,
1503,
1433,
796,
352,
198,
44,
6239,
12298,
796,
513,
198,
1847,
12298,
796,
807,
198,
20530,
62,
3185,
2937,
796,
1367,
198,
7378,
7156,
62,
48877,
9399,
796,
1105,
198,
2885,
4694,
62,
32,
2246,
796,
1511,
198,
20530,
62,
32,
2246,
62,
5639,
796,
1478,
198,
20530,
62,
1137,
62,
32,
2246,
62,
11163,
796,
1315,
628,
198,
62,
38827,
7730,
45,
17941,
48877,
9399,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
6690,
2360,
653,
21206,
20520,
198,
62,
4303,
36,
25994,
37815,
6369,
7250,
17184,
11159,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
5248,
3055,
21947,
2725,
22789,
20520,
198,
62,
4303,
36,
25994,
10943,
32541,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
5248,
3055,
21947,
20520,
198,
62,
54,
12532,
10778,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
26449,
12360,
20520,
198,
62,
29516,
8476,
10659,
3824,
9050,
35,
2767,
24565,
10943,
16254,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
35708,
16516,
11242,
3213,
16934,
20520,
198,
62,
38827,
7730,
45,
17941,
10943,
16254,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
6690,
2360,
653,
16934,
20520,
198,
62,
38827,
7730,
45,
14887,
9338,
35780,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
6690,
2360,
1096,
18453,
20520,
198,
62,
4303,
36,
25994,
38827,
7730,
45,
17941,
1847,
31800,
37045,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
5248,
3055,
6690,
2360,
653,
49788,
20520,
198,
62,
4303,
36,
2943,
7998,
3525,
3955,
3525,
1565,
1847,
16309,
1797,
19535,
16724,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
5248,
3055,
31837,
3681,
32750,
23004,
20520,
198,
62,
4303,
36,
25994,
38,
10619,
1137,
25256,
30643,
6234,
19535,
16724,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
5248,
3055,
41394,
33234,
2649,
23004,
20520,
198,
62,
4303,
36,
25994,
38827,
7730,
45,
17941,
19535,
16724,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
5248,
3055,
6690,
2360,
653,
23004,
20520,
198,
62,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
6690,
2360,
1096,
31077,
20520,
198,
62,
41358,
3955,
46274,
10943,
16254,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
9492,
320,
25468,
16934,
20520,
198,
62,
43,
1340,
10761,
4944,
15871,
38827,
7730,
45,
14887,
9338,
35780,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
14617,
28768,
6690,
2360,
1096,
18453,
20520,
198,
62,
2257,
32235,
2751,
38827,
7730,
45,
17941,
10943,
16254,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
12124,
278,
6690,
2360,
653,
16934,
20520,
198,
62,
2257,
32235,
2751,
38827,
7730,
45,
14887,
9338,
35780,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
12124,
278,
6690,
2360,
1096,
18453,
20520,
198,
62,
2257,
32235,
2751,
38827,
7730,
45,
17941,
19535,
16724,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
12124,
278,
6690,
2360,
653,
23004,
20520,
198,
62,
2257,
32235,
2751,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
12124,
278,
6690,
2360,
1096,
31077,
20520,
198,
62,
2257,
32235,
2751,
4944,
13153,
38827,
7730,
45,
14887,
9338,
35780,
796,
22196,
36584,
32961,
13,
20500,
62,
19199,
62,
1525,
62,
3672,
17816,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
20520,
198,
6690,
2360,
653,
21206,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
6690,
2360,
653,
21206,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
38827,
7730,
45,
17941,
48877,
9399,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
21206,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
6690,
2360,
653,
21206,
8,
198,
198,
5248,
3055,
21947,
2725,
22789,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
5248,
3055,
21947,
2725,
22789,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
4303,
36,
25994,
37815,
6369,
7250,
17184,
11159,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
21947,
2725,
22789,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
5248,
3055,
21947,
2725,
22789,
8,
198,
198,
5248,
3055,
21947,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
5248,
3055,
21947,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
4303,
36,
25994,
10943,
32541,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
21947,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
5248,
3055,
21947,
8,
198,
198,
26449,
12360,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
26449,
12360,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
54,
12532,
10778,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
26449,
12360,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
26449,
12360,
8,
198,
198,
35708,
16516,
11242,
3213,
16934,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
35708,
16516,
11242,
3213,
16934,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
29516,
8476,
10659,
3824,
9050,
35,
2767,
24565,
10943,
16254,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
35708,
16516,
11242,
3213,
16934,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
35708,
16516,
11242,
3213,
16934,
8,
198,
198,
6690,
2360,
653,
16934,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
6690,
2360,
653,
16934,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
38827,
7730,
45,
17941,
10943,
16254,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
653,
16934,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
6690,
2360,
653,
16934,
8,
198,
198,
6690,
2360,
1096,
18453,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
6690,
2360,
1096,
18453,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
38827,
7730,
45,
14887,
9338,
35780,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
1096,
18453,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
6690,
2360,
1096,
18453,
8,
198,
198,
5248,
3055,
6690,
2360,
653,
49788,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
5248,
3055,
6690,
2360,
653,
49788,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
4303,
36,
25994,
38827,
7730,
45,
17941,
1847,
31800,
37045,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
6690,
2360,
653,
49788,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
5248,
3055,
6690,
2360,
653,
49788,
8,
198,
198,
5248,
3055,
31837,
3681,
32750,
23004,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
5248,
3055,
31837,
3681,
32750,
23004,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
4303,
36,
2943,
7998,
3525,
3955,
3525,
1565,
1847,
16309,
1797,
19535,
16724,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
31837,
3681,
32750,
23004,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
5248,
3055,
31837,
3681,
32750,
23004,
8,
198,
198,
5248,
3055,
41394,
33234,
2649,
23004,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
5248,
3055,
41394,
33234,
2649,
23004,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
4303,
36,
25994,
38,
10619,
1137,
25256,
30643,
6234,
19535,
16724,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
41394,
33234,
2649,
23004,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
5248,
3055,
41394,
33234,
2649,
23004,
8,
198,
198,
5248,
3055,
6690,
2360,
653,
23004,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
5248,
3055,
6690,
2360,
653,
23004,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
4303,
36,
25994,
38827,
7730,
45,
17941,
19535,
16724,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
5248,
3055,
6690,
2360,
653,
23004,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
5248,
3055,
6690,
2360,
653,
23004,
8,
198,
198,
6690,
2360,
1096,
31077,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
6690,
2360,
1096,
31077,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
6690,
2360,
1096,
31077,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
6690,
2360,
1096,
31077,
8,
198,
198,
9492,
320,
25468,
16934,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
9492,
320,
25468,
16934,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
41358,
3955,
46274,
10943,
16254,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
9492,
320,
25468,
16934,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
9492,
320,
25468,
16934,
8,
198,
198,
14617,
28768,
6690,
2360,
1096,
18453,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
14617,
28768,
6690,
2360,
1096,
18453,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
43,
1340,
10761,
4944,
15871,
38827,
7730,
45,
14887,
9338,
35780,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
14617,
28768,
6690,
2360,
1096,
18453,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
14617,
28768,
6690,
2360,
1096,
18453,
8,
198,
198,
12124,
278,
6690,
2360,
653,
16934,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
12124,
278,
6690,
2360,
653,
16934,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
2257,
32235,
2751,
38827,
7730,
45,
17941,
10943,
16254,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
653,
16934,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
12124,
278,
6690,
2360,
653,
16934,
8,
198,
198,
12124,
278,
6690,
2360,
1096,
18453,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
12124,
278,
6690,
2360,
1096,
18453,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
2257,
32235,
2751,
38827,
7730,
45,
14887,
9338,
35780,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
1096,
18453,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
12124,
278,
6690,
2360,
1096,
18453,
8,
198,
198,
12124,
278,
6690,
2360,
653,
23004,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
12124,
278,
6690,
2360,
653,
23004,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
2257,
32235,
2751,
38827,
7730,
45,
17941,
19535,
16724,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
653,
23004,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
12124,
278,
6690,
2360,
653,
23004,
8,
198,
198,
12124,
278,
6690,
2360,
1096,
31077,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
12124,
278,
6690,
2360,
1096,
31077,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
2257,
32235,
2751,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
6690,
2360,
1096,
31077,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
12124,
278,
6690,
2360,
1096,
31077,
8,
198,
198,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
796,
4808,
5420,
1564,
13,
8645,
515,
19703,
4668,
12837,
6030,
10786,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
3256,
44104,
20500,
13,
12837,
11,
828,
1391,
198,
220,
705,
30910,
36584,
32961,
6,
1058,
4808,
2257,
32235,
2751,
4944,
13153,
38827,
7730,
45,
14887,
9338,
35780,
11,
198,
220,
705,
834,
21412,
834,
6,
1058,
705,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
301,
83,
62,
40842,
17,
6,
198,
220,
1303,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
4871,
62,
29982,
25,
83,
676,
2364,
13,
17721,
13,
301,
83,
13,
85,
16,
13,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
8,
198,
220,
32092,
198,
62,
37047,
62,
9945,
13,
38804,
12837,
7,
12124,
278,
3118,
560,
6690,
2360,
1096,
18453,
8,
198,
198,
62,
4303,
36,
2943,
6535,
2394,
13918,
796,
22196,
36584,
32961,
13,
30416,
62,
1525,
62,
3672,
17816,
5248,
3055,
2514,
8206,
20520,
198,
361,
4808,
20147,
1968,
273,
13557,
19108,
62,
34,
62,
30910,
36584,
51,
20673,
6624,
10352,
25,
628,
220,
22196,
36584,
32961,
13557,
25811,
796,
6045,
198,
220,
22196,
36584,
32961,
13557,
46911,
1143,
62,
25811,
796,
275,
6,
57,
35,
12567,
13,
785,
14,
51,
676,
2364,
14,
38888,
15813,
12,
1069,
12629,
14,
70,
349,
648,
14,
35339,
14,
83,
676,
2364,
14,
17721,
14,
301,
83,
14,
85,
16,
59,
27877,
59,
21601,
59,
22544,
6849,
42,
12562,
6,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13,
24396,
82,
62,
1525,
62,
3672,
17816,
6690,
2360,
1096,
6,
4083,
62,
25811,
796,
6045,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13,
24396,
82,
62,
1525,
62,
3672,
17816,
6690,
2360,
1096,
6,
4083,
62,
46911,
1143,
62,
25811,
796,
275,
6,
59,
19004,
59,
32637,
59,
33535,
59,
22047,
59,
21601,
59,
45987,
7879,
59,
46821,
14,
85,
16,
14,
301,
83,
25,
26243,
1096,
7479,
8298,
9,
6,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13,
24396,
82,
62,
1525,
62,
3672,
17816,
14617,
28768,
6690,
2360,
1096,
6,
4083,
62,
25811,
796,
6045,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13,
24396,
82,
62,
1525,
62,
3672,
17816,
14617,
28768,
6690,
2360,
1096,
6,
4083,
62,
46911,
1143,
62,
25811,
796,
275,
6,
59,
19004,
59,
32637,
59,
33535,
59,
22047,
59,
21601,
0,
7879,
59,
49841,
14,
85,
16,
14,
301,
83,
25,
6511,
20270,
26243,
1096,
7479,
8298,
9,
6,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13,
24396,
82,
62,
1525,
62,
3672,
17816,
12124,
278,
3118,
560,
6690,
2360,
1096,
6,
4083,
62,
25811,
796,
6045,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13,
24396,
82,
62,
1525,
62,
3672,
17816,
12124,
278,
3118,
560,
6690,
2360,
1096,
6,
4083,
62,
46911,
1143,
62,
25811,
796,
275,
6,
59,
19004,
59,
32637,
59,
33535,
59,
22047,
59,
21601,
5,
7879,
48443,
85,
16,
14,
301,
83,
25,
5532,
278,
62,
403,
560,
62,
26243,
1096,
7479,
8298,
9,
6,
198,
220,
4808,
48877,
9399,
24181,
3727,
2751,
13557,
46911,
1143,
62,
9688,
28,
18,
21652,
198,
220,
4808,
48877,
9399,
24181,
3727,
2751,
13557,
46911,
1143,
62,
437,
28,
27712,
23,
198,
220,
4808,
38827,
7730,
45,
17941,
48877,
9399,
13557,
46911,
1143,
62,
9688,
28,
23055,
198,
220,
4808,
38827,
7730,
45,
17941,
48877,
9399,
13557,
46911,
1143,
62,
437,
28,
24409,
198,
220,
4808,
4303,
36,
25994,
37815,
6369,
7250,
17184,
11159,
13557,
46911,
1143,
62,
9688,
28,
24940,
198,
220,
4808,
4303,
36,
25994,
37815,
6369,
7250,
17184,
11159,
13557,
46911,
1143,
62,
437,
28,
27033,
198,
220,
4808,
4303,
36,
25994,
10943,
32541,
13557,
46911,
1143,
62,
9688,
28,
25270,
198,
220,
4808,
4303,
36,
25994,
10943,
32541,
13557,
46911,
1143,
62,
437,
28,
22318,
198,
220,
4808,
54,
12532,
10778,
13557,
46911,
1143,
62,
9688,
28,
30695,
198,
220,
4808,
54,
12532,
10778,
13557,
46911,
1143,
62,
437,
28,
47396,
198,
220,
4808,
29516,
8476,
10659,
3824,
9050,
35,
2767,
24565,
10943,
16254,
13557,
46911,
1143,
62,
9688,
28,
48170,
198,
220,
4808,
29516,
8476,
10659,
3824,
9050,
35,
2767,
24565,
10943,
16254,
13557,
46911,
1143,
62,
437,
28,
40035,
198,
220,
4808,
38827,
7730,
45,
17941,
10943,
16254,
13557,
46911,
1143,
62,
9688,
28,
9879,
198,
220,
4808,
38827,
7730,
45,
17941,
10943,
16254,
13557,
46911,
1143,
62,
437,
28,
12952,
18,
198,
220,
4808,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
9688,
28,
12952,
21,
198,
220,
4808,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
437,
28,
1415,
2623,
198,
220,
4808,
4303,
36,
25994,
38827,
7730,
45,
17941,
1847,
31800,
37045,
13557,
46911,
1143,
62,
9688,
28,
1415,
2548,
198,
220,
4808,
4303,
36,
25994,
38827,
7730,
45,
17941,
1847,
31800,
37045,
13557,
46911,
1143,
62,
437,
28,
1314,
2816,
198,
220,
4808,
4303,
36,
2943,
7998,
3525,
3955,
3525,
1565,
1847,
16309,
1797,
19535,
16724,
13557,
46911,
1143,
62,
9688,
28,
1314,
3553,
198,
220,
4808,
4303,
36,
2943,
7998,
3525,
3955,
3525,
1565,
1847,
16309,
1797,
19535,
16724,
13557,
46911,
1143,
62,
437,
28,
1433,
4349,
198,
220,
4808,
4303,
36,
25994,
38,
10619,
1137,
25256,
30643,
6234,
19535,
16724,
13557,
46911,
1143,
62,
9688,
28,
1433,
4310,
198,
220,
4808,
4303,
36,
25994,
38,
10619,
1137,
25256,
30643,
6234,
19535,
16724,
13557,
46911,
1143,
62,
437,
28,
1558,
1959,
198,
220,
4808,
4303,
36,
25994,
38827,
7730,
45,
17941,
19535,
16724,
13557,
46911,
1143,
62,
9688,
28,
1558,
2624,
198,
220,
4808,
4303,
36,
25994,
38827,
7730,
45,
17941,
19535,
16724,
13557,
46911,
1143,
62,
437,
28,
17,
18376,
198,
220,
4808,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
13557,
46911,
1143,
62,
9688,
28,
17,
17464,
198,
220,
4808,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
13557,
46911,
1143,
62,
437,
28,
17572,
22,
198,
220,
4808,
41358,
3955,
46274,
10943,
16254,
13557,
46911,
1143,
62,
9688,
28,
17572,
24,
198,
220,
4808,
41358,
3955,
46274,
10943,
16254,
13557,
46911,
1143,
62,
437,
28,
1828,
6659,
198,
220,
4808,
43,
1340,
10761,
4944,
15871,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
9688,
28,
1828,
5705,
198,
220,
4808,
43,
1340,
10761,
4944,
15871,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
437,
28,
1731,
1821,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
17941,
10943,
16254,
13557,
46911,
1143,
62,
9688,
28,
1731,
3559,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
17941,
10943,
16254,
13557,
46911,
1143,
62,
437,
28,
2075,
1270,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
9688,
28,
2075,
2091,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
437,
28,
1983,
5705,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
17941,
19535,
16724,
13557,
46911,
1143,
62,
9688,
28,
1983,
5774,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
17941,
19535,
16724,
13557,
46911,
1143,
62,
437,
28,
1959,
1983,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
13557,
46911,
1143,
62,
9688,
28,
1959,
1959,
198,
220,
4808,
2257,
32235,
2751,
38827,
7730,
45,
14887,
1137,
1546,
47,
1340,
5188,
13557,
46911,
1143,
62,
437,
28,
1270,
2623,
198,
220,
4808,
2257,
32235,
2751,
4944,
13153,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
9688,
28,
1270,
2670,
198,
220,
4808,
2257,
32235,
2751,
4944,
13153,
38827,
7730,
45,
14887,
9338,
35780,
13557,
46911,
1143,
62,
437,
28,
18,
24294,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13557,
46911,
1143,
62,
9688,
28,
2682,
5333,
198,
220,
4808,
4303,
36,
2943,
6535,
2394,
13918,
13557,
46911,
1143,
62,
437,
28,
1821,
4310,
198,
2,
25248,
11235,
420,
62,
28463,
295,
62,
4122,
7,
21412,
62,
29982,
8,
198
] | 2.268885 | 8,234 |
from .engine import Engine
from ..utils.collate import box_collate_fn
from ..utils.visualizer import ObjectDetectionVisualizer
from ..utils.centernet.parse_detections import parse_detections, parse_batch_detections
from ..utils.ap_metrics import APMeter
import torch
import os
import json
| [
6738,
764,
18392,
1330,
7117,
198,
6738,
11485,
26791,
13,
26000,
378,
1330,
3091,
62,
26000,
378,
62,
22184,
198,
6738,
11485,
26791,
13,
41464,
7509,
1330,
9515,
11242,
3213,
36259,
7509,
198,
6738,
11485,
26791,
13,
1087,
1142,
316,
13,
29572,
62,
15255,
478,
507,
1330,
21136,
62,
15255,
478,
507,
11,
21136,
62,
43501,
62,
15255,
478,
507,
198,
6738,
11485,
26791,
13,
499,
62,
4164,
10466,
1330,
3486,
44,
2357,
198,
11748,
28034,
198,
11748,
28686,
198,
11748,
33918,
628
] | 3.493976 | 83 |
import os
from views import app
if __name__ == "__main__":
host = os.environ.get('HOST')
app.run(host=host)
| [
11748,
28686,
198,
198,
6738,
5009,
1330,
598,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2583,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
39,
10892,
11537,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
28,
4774,
8,
198
] | 2.408163 | 49 |
# Demonstrates the following:
# plotting logarithmic axes
# user-defined functions
# "where" function, NumPy array conditional
import numpy as np
import matplotlib.pyplot as plt
# Define the sinc function, with output for x=0 defined
# as a special case to avoid division by zero
# create arrays for plotting
x = np.arange(0., 10., 0.1)
y = np.exp(x)
t = np.linspace(-10., 10., 100)
z = s(t)
# create a figure window
fig = plt.figure(1, figsize=(9,8))
# subplot: linear plot of exponential
ax1 = fig.add_subplot(2,2,1)
ax1.plot(x, y)
ax1.set_xlabel('time (ms)')
ax1.set_ylabel('distance (mm)')
ax1.set_title('exponential')
# subplot: semi-log plot of exponential
ax2 = fig.add_subplot(2,2,2)
ax2.plot(x, y)
ax2.set_yscale('log')
ax2.set_xlabel('time (ms)')
ax2.set_ylabel('distance (mm)')
ax2.set_title('exponential')
# subplot: wide subplot of sinc function
ax3 = fig.add_subplot(2,1,2)
ax3.plot(t, z, 'r')
ax3.axhline(color='gray')
ax3.axvline(color='gray')
ax3.set_xlabel('angle (deg)')
ax3.set_ylabel('electric field')
ax3.set_title('sinc function')
# Adjusts while space around plots to avoid collisions between subplots
fig.tight_layout()
plt.savefig("MultPlotDemo.pdf")
plt.show()
| [
2,
7814,
2536,
689,
262,
1708,
25,
198,
2,
220,
220,
220,
220,
29353,
2604,
283,
342,
9383,
34197,
198,
2,
220,
220,
220,
220,
2836,
12,
23211,
5499,
198,
2,
220,
220,
220,
220,
366,
3003,
1,
2163,
11,
31835,
20519,
7177,
26340,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
2896,
500,
262,
264,
1939,
2163,
11,
351,
5072,
329,
2124,
28,
15,
5447,
198,
2,
355,
257,
2041,
1339,
284,
3368,
7297,
416,
6632,
198,
198,
2,
2251,
26515,
329,
29353,
198,
87,
796,
45941,
13,
283,
858,
7,
15,
1539,
838,
1539,
657,
13,
16,
8,
198,
88,
796,
45941,
13,
11201,
7,
87,
8,
198,
198,
83,
796,
45941,
13,
21602,
10223,
32590,
940,
1539,
838,
1539,
1802,
8,
198,
89,
796,
264,
7,
83,
8,
198,
198,
2,
2251,
257,
3785,
4324,
198,
5647,
796,
458,
83,
13,
26875,
7,
16,
11,
2336,
7857,
16193,
24,
11,
23,
4008,
198,
198,
2,
850,
29487,
25,
14174,
7110,
286,
39682,
198,
897,
16,
796,
2336,
13,
2860,
62,
7266,
29487,
7,
17,
11,
17,
11,
16,
8,
198,
897,
16,
13,
29487,
7,
87,
11,
331,
8,
198,
897,
16,
13,
2617,
62,
87,
18242,
10786,
2435,
357,
907,
8,
11537,
198,
897,
16,
13,
2617,
62,
2645,
9608,
10786,
30246,
357,
3020,
8,
11537,
198,
897,
16,
13,
2617,
62,
7839,
10786,
11201,
35470,
11537,
198,
198,
2,
850,
29487,
25,
10663,
12,
6404,
7110,
286,
39682,
198,
897,
17,
796,
2336,
13,
2860,
62,
7266,
29487,
7,
17,
11,
17,
11,
17,
8,
198,
897,
17,
13,
29487,
7,
87,
11,
331,
8,
198,
897,
17,
13,
2617,
62,
28349,
1000,
10786,
6404,
11537,
198,
897,
17,
13,
2617,
62,
87,
18242,
10786,
2435,
357,
907,
8,
11537,
198,
897,
17,
13,
2617,
62,
2645,
9608,
10786,
30246,
357,
3020,
8,
11537,
198,
897,
17,
13,
2617,
62,
7839,
10786,
11201,
35470,
11537,
198,
198,
2,
850,
29487,
25,
3094,
850,
29487,
286,
264,
1939,
2163,
198,
897,
18,
796,
2336,
13,
2860,
62,
7266,
29487,
7,
17,
11,
16,
11,
17,
8,
198,
897,
18,
13,
29487,
7,
83,
11,
1976,
11,
705,
81,
11537,
198,
897,
18,
13,
897,
71,
1370,
7,
8043,
11639,
44605,
11537,
198,
897,
18,
13,
897,
85,
1370,
7,
8043,
11639,
44605,
11537,
198,
897,
18,
13,
2617,
62,
87,
18242,
10786,
9248,
357,
13500,
8,
11537,
198,
897,
18,
13,
2617,
62,
2645,
9608,
10786,
31067,
2214,
11537,
198,
897,
18,
13,
2617,
62,
7839,
10786,
82,
1939,
2163,
11537,
198,
198,
2,
20292,
82,
981,
2272,
1088,
21528,
284,
3368,
31998,
1022,
850,
489,
1747,
198,
5647,
13,
33464,
62,
39786,
3419,
198,
198,
489,
83,
13,
21928,
5647,
7203,
15205,
43328,
11522,
78,
13,
12315,
4943,
198,
489,
83,
13,
12860,
3419,
198
] | 2.505176 | 483 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.